Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: pata_hpt366: disable fast interrupts in prereset() method

The PIO/DMA mode setting function is hardly a good place for disabling
the fast interrupts on a channel -- let's move that code to the driver's
prereset() method instead.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

authored by

Sergey Shtylyov and committed by
Damien Le Moal
a58ff050 cf369e4e

+7 -6
+7 -6
drivers/ata/pata_hpt366.c
··· 23 23 #include <linux/libata.h> 24 24 25 25 #define DRV_NAME "pata_hpt366" 26 - #define DRV_VERSION "0.6.12" 26 + #define DRV_VERSION "0.6.13" 27 27 28 28 struct hpt_clock { 29 29 u8 xfer_mode; ··· 300 300 static const struct pci_bits hpt366_enable_bits = { 301 301 0x50, 1, 0x30, 0x30 302 302 }; 303 + u8 mcr2; 303 304 304 305 if (!pci_test_config_bits(pdev, &hpt366_enable_bits)) 305 306 return -ENOENT; 307 + 308 + pci_read_config_byte(pdev, 0x51, &mcr2); 309 + if (mcr2 & 0x80) 310 + pci_write_config_byte(pdev, 0x51, mcr2 & ~0x80); 306 311 307 312 return ata_sff_prereset(link, deadline); 308 313 } ··· 339 334 340 335 static void hpt36x_init_chipset(struct pci_dev *dev) 341 336 { 342 - u8 drive_fast, mcr1; 337 + u8 mcr1; 343 338 344 339 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4)); 345 340 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78); 346 341 pci_write_config_byte(dev, PCI_MIN_GNT, 0x08); 347 342 pci_write_config_byte(dev, PCI_MAX_LAT, 0x08); 348 - 349 - pci_read_config_byte(dev, 0x51, &drive_fast); 350 - if (drive_fast & 0x80) 351 - pci_write_config_byte(dev, 0x51, drive_fast & ~0x80); 352 343 353 344 /* 354 345 * Now we'll have to force both channels enabled if at least one