Skip to content

Commit 8d093e0

Browse files
Sergey ShtylyovDamien Le Moal
authored andcommitted
ata: pata_hpt37x: disable primary channel on HPT371
The HPT371 chip physically has only one channel, the secondary one, however the primary channel registers do exist! Thus we have to manually disable the non-existing channel if the BIOS hasn't done this already. Similarly to the pata_hpt3x2n driver, always disable the primary channel. Fixes: 669a5db ("[libata] Add a bunch of PATA drivers.") Cc: stable@vger.kernel.org Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
1 parent 5f6b0f2 commit 8d093e0

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/ata/pata_hpt37x.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,20 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
919919
irqmask &= ~0x10;
920920
pci_write_config_byte(dev, 0x5a, irqmask);
921921

922+
/*
923+
* HPT371 chips physically have only one channel, the secondary one,
924+
* but the primary channel registers do exist! Go figure...
925+
* So, we manually disable the non-existing channel here
926+
* (if the BIOS hasn't done this already).
927+
*/
928+
if (dev->device == PCI_DEVICE_ID_TTI_HPT371) {
929+
u8 mcr1;
930+
931+
pci_read_config_byte(dev, 0x50, &mcr1);
932+
mcr1 &= ~0x04;
933+
pci_write_config_byte(dev, 0x50, mcr1);
934+
}
935+
922936
/*
923937
* default to pci clock. make sure MA15/16 are set to output
924938
* to prevent drives having problems with 40-pin cables. Needed

0 commit comments

Comments
 (0)