From: Ming Lei Date: Thu, 6 Jun 2019 08:34:09 +0000 (+0800) Subject: scsi: core: don't preallocate small SGL in case of NO_SG_CHAIN X-Git-Tag: v5.4-rc1~606^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e99b3b13a1fc8f7354edaee4c04f73a07faba69;p=platform%2Fkernel%2Flinux-rpi.git scsi: core: don't preallocate small SGL in case of NO_SG_CHAIN The preallocated small SGL depends on SG_CHAIN so if the ARCH doesn't support SG_CHAIN, preallocation of small SGL can't work at all. Fix this issue by not using small preallocation in case of NO_SG_CHAIN. Cc: Christoph Hellwig Cc: Bart Van Assche Cc: Ewan D. Milne Cc: Hannes Reinecke Cc: Guenter Roeck Reported-by: Guenter Roeck Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Tested-by: Guenter Roeck Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 45b43e9..30cbea5 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -43,9 +43,13 @@ * Size of integrity metadata is usually small, 1 inline sg should * cover normal cases. */ +#ifdef CONFIG_ARCH_NO_SG_CHAIN +#define SCSI_INLINE_PROT_SG_CNT 0 +#define SCSI_INLINE_SG_CNT 0 +#else #define SCSI_INLINE_PROT_SG_CNT 1 - #define SCSI_INLINE_SG_CNT 2 +#endif static struct kmem_cache *scsi_sdb_cache; static struct kmem_cache *scsi_sense_cache;