scsi: lpfc: Use unsigned type for num_sge
[ Upstream commit d6c1b19153f92e95e5e1801d540e98771053afae ] LUNs going into "failed ready running" state observed on >1T and on even numbers of size (2T, 4T, 6T, 8T and 10T). The issue occurs when DIF is enabled at the host. The kernel logs: Cannot setup S/G List for HBAIO segs 1/1 SGL 512 SCSI 256: 3 0 The host lpfc driver is failing to setup scatter/gather list (protection data) for the I/Os. The return type lpfc_bg_setup_sgl()/lpfc_bg_setup_sgl_prot() causes the compiler to remove the most significant bit. Use an unsigned type instead. Signed-off-by: Hannes Reinecke <hare@suse.de> [dwagner: added commit message] Signed-off-by: Daniel Wagner <dwagner@suse.de> Link: https://lore.kernel.org/r/20231220162658.12392-1-dwagner@suse.de Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
7fb1979274
commit
6a375022b0
@@ -1944,7 +1944,7 @@ out:
|
|||||||
*
|
*
|
||||||
* Returns the number of SGEs added to the SGL.
|
* Returns the number of SGEs added to the SGL.
|
||||||
**/
|
**/
|
||||||
static int
|
static uint32_t
|
||||||
lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
||||||
struct sli4_sge *sgl, int datasegcnt,
|
struct sli4_sge *sgl, int datasegcnt,
|
||||||
struct lpfc_io_buf *lpfc_cmd)
|
struct lpfc_io_buf *lpfc_cmd)
|
||||||
@@ -1952,8 +1952,8 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
|||||||
struct scatterlist *sgde = NULL; /* s/g data entry */
|
struct scatterlist *sgde = NULL; /* s/g data entry */
|
||||||
struct sli4_sge_diseed *diseed = NULL;
|
struct sli4_sge_diseed *diseed = NULL;
|
||||||
dma_addr_t physaddr;
|
dma_addr_t physaddr;
|
||||||
int i = 0, num_sge = 0, status;
|
int i = 0, status;
|
||||||
uint32_t reftag;
|
uint32_t reftag, num_sge = 0;
|
||||||
uint8_t txop, rxop;
|
uint8_t txop, rxop;
|
||||||
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
|
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
|
||||||
uint32_t rc;
|
uint32_t rc;
|
||||||
@@ -2124,7 +2124,7 @@ out:
|
|||||||
*
|
*
|
||||||
* Returns the number of SGEs added to the SGL.
|
* Returns the number of SGEs added to the SGL.
|
||||||
**/
|
**/
|
||||||
static int
|
static uint32_t
|
||||||
lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
||||||
struct sli4_sge *sgl, int datacnt, int protcnt,
|
struct sli4_sge *sgl, int datacnt, int protcnt,
|
||||||
struct lpfc_io_buf *lpfc_cmd)
|
struct lpfc_io_buf *lpfc_cmd)
|
||||||
@@ -2148,8 +2148,8 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
|
|||||||
uint32_t rc;
|
uint32_t rc;
|
||||||
#endif
|
#endif
|
||||||
uint32_t checking = 1;
|
uint32_t checking = 1;
|
||||||
uint32_t dma_offset = 0;
|
uint32_t dma_offset = 0, num_sge = 0;
|
||||||
int num_sge = 0, j = 2;
|
int j = 2;
|
||||||
struct sli4_hybrid_sgl *sgl_xtra = NULL;
|
struct sli4_hybrid_sgl *sgl_xtra = NULL;
|
||||||
|
|
||||||
sgpe = scsi_prot_sglist(sc);
|
sgpe = scsi_prot_sglist(sc);
|
||||||
|
Reference in New Issue
Block a user