Commit 8bc1e5aa06a2a9a425c4a6795fc564cba1521487

Authored by Bartlomiej Zolnierkiewicz
1 parent 0fcef027f6

ide: respect quirk_drives[] list on all controllers

* Add ide_check_nien_quirk_list() helper to the core code
  and then use it in ide_port_tune_devices().

* Remove no longer needed ->quirkproc methods from hpt366.c
  and pdc202xx_{new,old}.c.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Showing 6 changed files with 28 additions and 80 deletions Side-by-side Diff

drivers/ide/hpt366.c
... ... @@ -138,18 +138,6 @@
138 138 #undef HPT_RESET_STATE_ENGINE
139 139 #undef HPT_DELAY_INTERRUPT
140 140  
141   -static const char *quirk_drives[] = {
142   - "QUANTUM FIREBALLlct08 08",
143   - "QUANTUM FIREBALLP KA6.4",
144   - "QUANTUM FIREBALLP KA9.1",
145   - "QUANTUM FIREBALLP KX13.6",
146   - "QUANTUM FIREBALLP KX20.5",
147   - "QUANTUM FIREBALLP KX27.3",
148   - "QUANTUM FIREBALLP LM20.4",
149   - "QUANTUM FIREBALLP LM20.5",
150   - NULL
151   -};
152   -
153 141 static const char *bad_ata100_5[] = {
154 142 "IBM-DTLA-307075",
155 143 "IBM-DTLA-307060",
... ... @@ -733,20 +721,6 @@
733 721 hpt3xx_set_mode(drive, XFER_PIO_0 + pio);
734 722 }
735 723  
736   -static void hpt3xx_quirkproc(ide_drive_t *drive)
737   -{
738   - char *m = (char *)&drive->id[ATA_ID_PROD];
739   - const char **list = quirk_drives;
740   -
741   - while (*list)
742   - if (strstr(m, *list++)) {
743   - drive->quirk_list = 2;
744   - return;
745   - }
746   -
747   - drive->quirk_list = 0;
748   -}
749   -
750 724 static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
751 725 {
752 726 ide_hwif_t *hwif = drive->hwif;
... ... @@ -1408,7 +1382,6 @@
1408 1382 static const struct ide_port_ops hpt3xx_port_ops = {
1409 1383 .set_pio_mode = hpt3xx_set_pio_mode,
1410 1384 .set_dma_mode = hpt3xx_set_mode,
1411   - .quirkproc = hpt3xx_quirkproc,
1412 1385 .maskproc = hpt3xx_maskproc,
1413 1386 .mdma_filter = hpt3xx_mdma_filter,
1414 1387 .udma_filter = hpt3xx_udma_filter,
drivers/ide/ide-iops.c
... ... @@ -282,6 +282,31 @@
282 282 return 0;
283 283 }
284 284  
  285 +static const char *nien_quirk_list[] = {
  286 + "QUANTUM FIREBALLlct08 08",
  287 + "QUANTUM FIREBALLP KA6.4",
  288 + "QUANTUM FIREBALLP KA9.1",
  289 + "QUANTUM FIREBALLP KX13.6",
  290 + "QUANTUM FIREBALLP KX20.5",
  291 + "QUANTUM FIREBALLP KX27.3",
  292 + "QUANTUM FIREBALLP LM20.4",
  293 + "QUANTUM FIREBALLP LM20.5",
  294 + NULL
  295 +};
  296 +
  297 +void ide_check_nien_quirk_list(ide_drive_t *drive)
  298 +{
  299 + const char **list, *m = (char *)&drive->id[ATA_ID_PROD];
  300 +
  301 + for (list = nien_quirk_list; *list != NULL; list++)
  302 + if (strstr(m, *list) != NULL) {
  303 + drive->quirk_list = 2;
  304 + return;
  305 + }
  306 +
  307 + drive->quirk_list = 0;
  308 +}
  309 +
285 310 int ide_driveid_update(ide_drive_t *drive)
286 311 {
287 312 u16 *id;
drivers/ide/ide-probe.c
... ... @@ -732,6 +732,8 @@
732 732 int i;
733 733  
734 734 ide_port_for_each_present_dev(i, drive, hwif) {
  735 + ide_check_nien_quirk_list(drive);
  736 +
735 737 if (port_ops && port_ops->quirkproc)
736 738 port_ops->quirkproc(drive);
737 739 }
drivers/ide/pdc202xx_new.c
... ... @@ -40,18 +40,6 @@
40 40 #define DBG(fmt, args...)
41 41 #endif
42 42  
43   -static const char *pdc_quirk_drives[] = {
44   - "QUANTUM FIREBALLlct08 08",
45   - "QUANTUM FIREBALLP KA6.4",
46   - "QUANTUM FIREBALLP KA9.1",
47   - "QUANTUM FIREBALLP LM20.4",
48   - "QUANTUM FIREBALLP KX13.6",
49   - "QUANTUM FIREBALLP KX20.5",
50   - "QUANTUM FIREBALLP KX27.3",
51   - "QUANTUM FIREBALLP LM20.5",
52   - NULL
53   -};
54   -
55 43 static u8 max_dma_rate(struct pci_dev *pdev)
56 44 {
57 45 u8 mode;
... ... @@ -200,19 +188,6 @@
200 188 return ATA_CBL_PATA80;
201 189 }
202 190  
203   -static void pdcnew_quirkproc(ide_drive_t *drive)
204   -{
205   - const char **list, *m = (char *)&drive->id[ATA_ID_PROD];
206   -
207   - for (list = pdc_quirk_drives; *list != NULL; list++)
208   - if (strstr(m, *list) != NULL) {
209   - drive->quirk_list = 2;
210   - return;
211   - }
212   -
213   - drive->quirk_list = 0;
214   -}
215   -
216 191 static void pdcnew_reset(ide_drive_t *drive)
217 192 {
218 193 /*
... ... @@ -473,7 +448,6 @@
473 448 static const struct ide_port_ops pdcnew_port_ops = {
474 449 .set_pio_mode = pdcnew_set_pio_mode,
475 450 .set_dma_mode = pdcnew_set_dma_mode,
476   - .quirkproc = pdcnew_quirkproc,
477 451 .resetproc = pdcnew_reset,
478 452 .cable_detect = pdcnew_cable_detect,
479 453 };
drivers/ide/pdc202xx_old.c
... ... @@ -23,18 +23,6 @@
23 23  
24 24 #define PDC202XX_DEBUG_DRIVE_INFO 0
25 25  
26   -static const char *pdc_quirk_drives[] = {
27   - "QUANTUM FIREBALLlct08 08",
28   - "QUANTUM FIREBALLP KA6.4",
29   - "QUANTUM FIREBALLP KA9.1",
30   - "QUANTUM FIREBALLP LM20.4",
31   - "QUANTUM FIREBALLP KX13.6",
32   - "QUANTUM FIREBALLP KX20.5",
33   - "QUANTUM FIREBALLP KX27.3",
34   - "QUANTUM FIREBALLP LM20.5",
35   - NULL
36   -};
37   -
38 26 static void pdc_old_disable_66MHz_clock(ide_hwif_t *);
39 27  
40 28 static void pdc202xx_set_mode(ide_drive_t *drive, const u8 speed)
... ... @@ -151,19 +139,6 @@
151 139 outb(clock & ~(hwif->channel ? 0x08 : 0x02), clock_reg);
152 140 }
153 141  
154   -static void pdc202xx_quirkproc(ide_drive_t *drive)
155   -{
156   - const char **list, *m = (char *)&drive->id[ATA_ID_PROD];
157   -
158   - for (list = pdc_quirk_drives; *list != NULL; list++)
159   - if (strstr(m, *list) != NULL) {
160   - drive->quirk_list = 2;
161   - return;
162   - }
163   -
164   - drive->quirk_list = 0;
165   -}
166   -
167 142 static void pdc202xx_dma_start(ide_drive_t *drive)
168 143 {
169 144 if (drive->current_speed > XFER_UDMA_2)
170 145  
... ... @@ -256,13 +231,11 @@
256 231 static const struct ide_port_ops pdc20246_port_ops = {
257 232 .set_pio_mode = pdc202xx_set_pio_mode,
258 233 .set_dma_mode = pdc202xx_set_mode,
259   - .quirkproc = pdc202xx_quirkproc,
260 234 };
261 235  
262 236 static const struct ide_port_ops pdc2026x_port_ops = {
263 237 .set_pio_mode = pdc202xx_set_pio_mode,
264 238 .set_dma_mode = pdc202xx_set_mode,
265   - .quirkproc = pdc202xx_quirkproc,
266 239 .cable_detect = pdc2026x_cable_detect,
267 240 };
268 241  
... ... @@ -1453,6 +1453,7 @@
1453 1453 void ide_register_region(struct gendisk *);
1454 1454 void ide_unregister_region(struct gendisk *);
1455 1455  
  1456 +void ide_check_nien_quirk_list(ide_drive_t *);
1456 1457 void ide_undecoded_slave(ide_drive_t *);
1457 1458  
1458 1459 void ide_port_apply_params(ide_hwif_t *);