Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4349eebf authored by Alan Cox's avatar Alan Cox Committed by Jeff Garzik
Browse files

pata_hpt366: Enable bits are unreliable so don't use them



Various people had problems with both old and new IDE when hpt366 enable
bits started getting honoured. It turns out they are not reliable so
don't rely on them

Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 39f19886
Loading
Loading
Loading
Loading
+1 −27
Original line number Diff line number Diff line
@@ -220,32 +220,6 @@ static int hpt36x_cable_detect(struct ata_port *ap)
	return ATA_CBL_PATA80;
}

static int hpt36x_pre_reset(struct ata_port *ap, unsigned long deadline)
{
	static const struct pci_bits hpt36x_enable_bits[] = {
		{ 0x50, 1, 0x04, 0x04 },
		{ 0x54, 1, 0x04, 0x04 }
	};
	struct pci_dev *pdev = to_pci_dev(ap->host->dev);

	if (!pci_test_config_bits(pdev, &hpt36x_enable_bits[ap->port_no]))
		return -ENOENT;

	return ata_std_prereset(ap, deadline);
}

/**
 *	hpt36x_error_handler	-	reset the hpt36x bus
 *	@ap: ATA port to reset
 *
 *	Perform the reset handling for the 366/368
 */

static void hpt36x_error_handler(struct ata_port *ap)
{
	ata_bmdma_drive_eh(ap, hpt36x_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
}

/**
 *	hpt366_set_piomode		-	PIO setup
 *	@ap: ATA interface
@@ -351,7 +325,7 @@ static struct ata_port_operations hpt366_port_ops = {

	.freeze		= ata_bmdma_freeze,
	.thaw		= ata_bmdma_thaw,
	.error_handler	= hpt36x_error_handler,
	.error_handler	= ata_bmdma_error_handler,
	.post_internal_cmd = ata_bmdma_post_internal_cmd,
	.cable_detect	= hpt36x_cable_detect,