diff options
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r-- | drivers/ata/libata-sff.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 0eae9b453556..0b299b0f8172 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1013,9 +1013,12 @@ next_sg: | |||
1013 | qc->cursg_ofs = 0; | 1013 | qc->cursg_ofs = 0; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | /* consumed can be larger than count only for the last transfer */ | 1016 | /* |
1017 | WARN_ON_ONCE(qc->cursg && count != consumed); | 1017 | * There used to be a WARN_ON_ONCE(qc->cursg && count != consumed); |
1018 | 1018 | * Unfortunately __atapi_pio_bytes doesn't know enough to do the WARN | |
1019 | * check correctly as it doesn't know if it is the last request being | ||
1020 | * made. Somebody should implement a proper sanity check. | ||
1021 | */ | ||
1019 | if (bytes) | 1022 | if (bytes) |
1020 | goto next_sg; | 1023 | goto next_sg; |
1021 | return 0; | 1024 | return 0; |
@@ -1319,7 +1322,7 @@ fsm_start: | |||
1319 | * condition. Mark hint. | 1322 | * condition. Mark hint. |
1320 | */ | 1323 | */ |
1321 | ata_ehi_push_desc(ehi, "ST-ATA: " | 1324 | ata_ehi_push_desc(ehi, "ST-ATA: " |
1322 | "DRQ=1 with device error, " | 1325 | "DRQ=0 without device error, " |
1323 | "dev_stat 0x%X", status); | 1326 | "dev_stat 0x%X", status); |
1324 | qc->err_mask |= AC_ERR_HSM | | 1327 | qc->err_mask |= AC_ERR_HSM | |
1325 | AC_ERR_NODEV_HINT; | 1328 | AC_ERR_NODEV_HINT; |
@@ -1355,6 +1358,16 @@ fsm_start: | |||
1355 | qc->err_mask |= AC_ERR_HSM; | 1358 | qc->err_mask |= AC_ERR_HSM; |
1356 | } | 1359 | } |
1357 | 1360 | ||
1361 | /* There are oddball controllers with | ||
1362 | * status register stuck at 0x7f and | ||
1363 | * lbal/m/h at zero which makes it | ||
1364 | * pass all other presence detection | ||
1365 | * mechanisms we have. Set NODEV_HINT | ||
1366 | * for it. Kernel bz#7241. | ||
1367 | */ | ||
1368 | if (status == 0x7f) | ||
1369 | qc->err_mask |= AC_ERR_NODEV_HINT; | ||
1370 | |||
1358 | /* ata_pio_sectors() might change the | 1371 | /* ata_pio_sectors() might change the |
1359 | * state to HSM_ST_LAST. so, the state | 1372 | * state to HSM_ST_LAST. so, the state |
1360 | * is changed after ata_pio_sectors(). | 1373 | * is changed after ata_pio_sectors(). |