Hi,
Guenter reported scsi boot issue caused by commit c3288dd8c232
("scsi: core: avoid pre-allocating big SGL for data").
Turns out there are at least three issues.
The 1st patch fixes sg_alloc_table_chained() which may try to use
the pre-allocation SGL even though user passes zero to 'nents_first_chunk'.
The 2nd patch fixes issue in case that NO_SG_CHAIN on some ARCHs,
such as alpha, arm and parisc.
The 3rd patch makes esp scsi working with SG_CHAIN.
V2:
- add the patch1, which is verified by Guenter
- add .prv_sg to store the previous sg for esp_scsi
Ming Lei (3):
scsi: lib/sg_pool.c: clear 'first_chunk' in case of no pre-allocation
scsi: core: don't pre-allocate small SGL in case of NO_SG_CHAIN
scsi: esp: make it working on SG_CHAIN
drivers/scsi/esp_scsi.c | 20 +++++++++++++-------
drivers/scsi/esp_scsi.h | 2 ++
drivers/scsi/scsi_lib.c | 6 +++++-
lib/sg_pool.c | 2 +-
4 files changed, 21 insertions(+), 9 deletions(-)
Cc: Christoph Hellwig <[email protected]>
Cc: Bart Van Assche <[email protected]>
Cc: Ewan D. Milne <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Finn Thain <[email protected]>
Cc: Guenter Roeck <[email protected]>
--
2.20.1