Skip to content

Commit d3fce1b

Browse files
Sergey Shtylyovgregkh
authored andcommitted
ata: pata_hpt37x: disable primary channel on HPT371
commit 8d093e0 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 18701d8 commit d3fce1b

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
@@ -917,6 +917,20 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
917917
irqmask &= ~0x10;
918918
pci_write_config_byte(dev, 0x5a, irqmask);
919919

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

0 commit comments

Comments
 (0)