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

ata: pata_hpt3x2n: 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
25d83f9d 6110530b

+10 -13
+10 -13
drivers/ata/pata_hpt3x2n.c
··· 24 24 #include <linux/libata.h> 25 25 26 26 #define DRV_NAME "pata_hpt3x2n" 27 - #define DRV_VERSION "0.3.17" 27 + #define DRV_VERSION "0.3.18" 28 28 29 29 enum { 30 30 PCI66 = (1 << 1), ··· 166 166 { 0x50, 1, 0x04, 0x04 }, 167 167 { 0x54, 1, 0x04, 0x04 } 168 168 }; 169 + u8 mcr2; 169 170 170 171 if (!pci_test_config_bits(pdev, &hpt3x2n_enable_bits[ap->port_no])) 171 172 return -ENOENT; ··· 175 174 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); 176 175 udelay(100); 177 176 177 + /* Fast interrupt prediction disable, hold off interrupt disable */ 178 + pci_read_config_byte(pdev, 0x51 + 4 * ap->port_no, &mcr2); 179 + mcr2 &= ~0x07; 180 + pci_write_config_byte(pdev, 0x51 + 4 * ap->port_no, mcr2); 181 + 178 182 return ata_sff_prereset(link, deadline); 179 183 } 180 184 ··· 187 181 u8 mode) 188 182 { 189 183 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 190 - u32 addr1, addr2; 184 + int addr = 0x40 + 4 * (adev->devno + 2 * ap->port_no); 191 185 u32 reg, timing, mask; 192 - u8 fast; 193 - 194 - addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no); 195 - addr2 = 0x51 + 4 * ap->port_no; 196 - 197 - /* Fast interrupt prediction disable, hold off interrupt disable */ 198 - pci_read_config_byte(pdev, addr2, &fast); 199 - fast &= ~0x07; 200 - pci_write_config_byte(pdev, addr2, fast); 201 186 202 187 /* Determine timing mask and find matching mode entry */ 203 188 if (mode < XFER_MW_DMA_0) ··· 200 203 201 204 timing = hpt3x2n_find_mode(ap, mode); 202 205 203 - pci_read_config_dword(pdev, addr1, &reg); 206 + pci_read_config_dword(pdev, addr, &reg); 204 207 reg = (reg & ~mask) | (timing & mask); 205 - pci_write_config_dword(pdev, addr1, reg); 208 + pci_write_config_dword(pdev, addr, reg); 206 209 } 207 210 208 211 /**