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. V3: - add reviewed-by & tested-by tag - update 1st patch's commit log & kernel doc 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 | 6 ++++-- 4 files changed, 24 insertions(+), 10 deletions(-) Cc: Christoph Hellwig <hch@xxxxxx> Cc: Bart Van Assche <bvanassche@xxxxxxx> Cc: Ewan D. Milne <emilne@xxxxxxxxxx> Cc: Hannes Reinecke <hare@xxxxxxxx> Cc: Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx> Cc: Guenter Roeck <linux@xxxxxxxxxxxx> -- 2.20.1