ide-pio-blacklist.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * PIO blacklist. Some drives incorrectly report their maximal PIO mode,
  4. * at least in respect to CMD640. Here we keep info on some known drives.
  5. *
  6. * Changes to the ide_pio_blacklist[] should be made with EXTREME CAUTION
  7. * to avoid breaking the fragile cmd640.c support.
  8. */
  9. #include <linux/string.h>
  10. #include <linux/ide.h>
  11. static struct ide_pio_info {
  12. const char *name;
  13. int pio;
  14. } ide_pio_blacklist [] = {
  15. { "Conner Peripherals 540MB - CFS540A", 3 },
  16. { "WDC AC2700", 3 },
  17. { "WDC AC2540", 3 },
  18. { "WDC AC2420", 3 },
  19. { "WDC AC2340", 3 },
  20. { "WDC AC2250", 0 },
  21. { "WDC AC2200", 0 },
  22. { "WDC AC21200", 4 },
  23. { "WDC AC2120", 0 },
  24. { "WDC AC2850", 3 },
  25. { "WDC AC1270", 3 },
  26. { "WDC AC1170", 1 },
  27. { "WDC AC1210", 1 },
  28. { "WDC AC280", 0 },
  29. { "WDC AC31000", 3 },
  30. { "WDC AC31200", 3 },
  31. { "Maxtor 7131 AT", 1 },
  32. { "Maxtor 7171 AT", 1 },
  33. { "Maxtor 7213 AT", 1 },
  34. { "Maxtor 7245 AT", 1 },
  35. { "Maxtor 7345 AT", 1 },
  36. { "Maxtor 7546 AT", 3 },
  37. { "Maxtor 7540 AV", 3 },
  38. { "SAMSUNG SHD-3121A", 1 },
  39. { "SAMSUNG SHD-3122A", 1 },
  40. { "SAMSUNG SHD-3172A", 1 },
  41. { "ST5660A", 3 },
  42. { "ST3660A", 3 },
  43. { "ST3630A", 3 },
  44. { "ST3655A", 3 },
  45. { "ST3391A", 3 },
  46. { "ST3390A", 1 },
  47. { "ST3600A", 1 },
  48. { "ST3290A", 0 },
  49. { "ST3144A", 0 },
  50. { "ST3491A", 1 }, /* reports 3, should be 1 or 2 (depending on drive)
  51. according to Seagate's FIND-ATA program */
  52. { "QUANTUM ELS127A", 0 },
  53. { "QUANTUM ELS170A", 0 },
  54. { "QUANTUM LPS240A", 0 },
  55. { "QUANTUM LPS210A", 3 },
  56. { "QUANTUM LPS270A", 3 },
  57. { "QUANTUM LPS365A", 3 },
  58. { "QUANTUM LPS540A", 3 },
  59. { "QUANTUM LIGHTNING 540A", 3 },
  60. { "QUANTUM LIGHTNING 730A", 3 },
  61. { "QUANTUM FIREBALL_540", 3 }, /* Older Quantum Fireballs don't work */
  62. { "QUANTUM FIREBALL_640", 3 },
  63. { "QUANTUM FIREBALL_1080", 3 },
  64. { "QUANTUM FIREBALL_1280", 3 },
  65. { NULL, 0 }
  66. };
  67. /**
  68. * ide_scan_pio_blacklist - check for a blacklisted drive
  69. * @model: Drive model string
  70. *
  71. * This routine searches the ide_pio_blacklist for an entry
  72. * matching the start/whole of the supplied model name.
  73. *
  74. * Returns -1 if no match found.
  75. * Otherwise returns the recommended PIO mode from ide_pio_blacklist[].
  76. */
  77. int ide_scan_pio_blacklist(char *model)
  78. {
  79. struct ide_pio_info *p;
  80. for (p = ide_pio_blacklist; p->name != NULL; p++) {
  81. if (strncmp(p->name, model, strlen(p->name)) == 0)
  82. return p->pio;
  83. }
  84. return -1;
  85. }