ata fixes for 5.17.0-rc6
Two fixes for the pata_hpt37x driver for 5.17-rc6, both from Sergey: * Fix a PCI register access using an incorrect size (8bits instead of 16bits). * Make sure to always disable the primary channel as it is unused. -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSRPv8tYSvhwAzJdzjdoc3SxdoYdgUCYhhxBwAKCRDdoc3SxdoY dkmRAP47TARzGptIhVd7itg4U8MrZbdZI4p4BFsyz2rVZgyEnQEAy1iHFgJXypil R3U4S3yMFEi0Pj/RyiGyDLJb9+qQ8AM= =Y7aA -----END PGP SIGNATURE----- Merge tag 'ata-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fixes from Damien Le Moal: "Two fixes for the pata_hpt37x driver, both from Sergey: - Fix a PCI register access using an incorrect size (8bits instead of 16bits) - Make sure to always disable the primary channel as it is unused" * tag 'ata-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_hpt37x: disable primary channel on HPT371 ata: pata_hpt37x: fix PCI clock detection
This commit is contained in:
commit
7808159497
@ -919,6 +919,20 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
irqmask &= ~0x10;
|
||||
pci_write_config_byte(dev, 0x5a, irqmask);
|
||||
|
||||
/*
|
||||
* HPT371 chips physically have only one channel, the secondary one,
|
||||
* but the primary channel registers do exist! Go figure...
|
||||
* So, we manually disable the non-existing channel here
|
||||
* (if the BIOS hasn't done this already).
|
||||
*/
|
||||
if (dev->device == PCI_DEVICE_ID_TTI_HPT371) {
|
||||
u8 mcr1;
|
||||
|
||||
pci_read_config_byte(dev, 0x50, &mcr1);
|
||||
mcr1 &= ~0x04;
|
||||
pci_write_config_byte(dev, 0x50, mcr1);
|
||||
}
|
||||
|
||||
/*
|
||||
* default to pci clock. make sure MA15/16 are set to output
|
||||
* to prevent drives having problems with 40-pin cables. Needed
|
||||
@ -950,14 +964,14 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
|
||||
if ((freq >> 12) != 0xABCDE) {
|
||||
int i;
|
||||
u8 sr;
|
||||
u16 sr;
|
||||
u32 total = 0;
|
||||
|
||||
dev_warn(&dev->dev, "BIOS has not set timing clocks\n");
|
||||
|
||||
/* This is the process the HPT371 BIOS is reported to use */
|
||||
for (i = 0; i < 128; i++) {
|
||||
pci_read_config_byte(dev, 0x78, &sr);
|
||||
pci_read_config_word(dev, 0x78, &sr);
|
||||
total += sr & 0x1FF;
|
||||
udelay(15);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user