scsi: megaraid_sas: some bug fixes and cod cleanup
Subsystems (2)
cover scsi: megaraid_sas: some bug fixes and cod cleanup
*** BLURB HERE ***
Hi guys,
This series has bug fix and a few simple cleanups, please review.
Guixin Liu (5):
scsi: megaraid_sas: correct the parameter of scsi_device_lookup
scsi: megaraid_sas: correct an error message
scsi: megaraid_sas: simplify the megasas_update_device_list
scsi: megaraid_sas: remove unnecessary memset
scsi: megaraid_sas: move megasas_dbg_lvl init to megasas_init
drivers/scsi/megaraid/megaraid_sas_base.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/5 scsi: megaraid_sas: correct the parameter of scsi_device_lookup
When a delete event is received, find the scsi_device and remove it, the scsi_device_lookup`s parameter id should be "ld_target_id % MEGASAS_MAX_DEV_PER_CHANNEL".
--- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +1 -1
@@ -8922,7 +8922,7 @@ void megasas_add_remove_devices(struct megasas_instance *instance, sdev1 =scsi_device_lookup (instance->host,MEGASAS_MAX_PD_CHANNELS + (ld_target_id /MEGASAS_MAX_DEV_PER_CHANNEL ), - (ld_target_id -MEGASAS_MAX_DEV_PER_CHANNEL ), + (ld_target_id %MEGASAS_MAX_DEV_PER_CHANNEL ),0 );dev_info (&instance->pdev->dev,"Debug_lgx: ld_target_id:%u, sdev1:%p.\n" , ld_target_id, sdev1);
Signature · 1 line
1.8.3.1
Re: [PATCH 1/5] scsi: megaraid_sas: correct the parameter of scsi_device_lookup
Quoted 7 lines · Guixin Liu
When a delete event is received, find the
scsi_deviceand remove it, the scsi_device_lookup`s parameter id should be "ld_target_id%MEGASAS_MAX_DEV_PER_CHANNEL".Fixes ae6874ba4b43 ("scsi: megaraid_sas: Early detection of VD deletion through RaidMap update")Signed-off-by Guixin Liu <[email protected]>
Looks good to me.
PATCH 2/5 scsi: megaraid_sas: correct an error message
In reply to Guixin LiuCorrect the error message when alloc init request fail.
--- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +1 -1
@@ -7224,7 +7224,7 @@ int megasas_alloc_ctrl_dma_buffers(struct megasas_instance *instance)if (!fusion->ioc_init_request) {dev_err (&pdev->dev, -"Failed to allocate PD list buffer\n" ); +"Failed to allocate ioc init request\n" );return -ENOMEM ; }
Signature · 1 line
1.8.3.1
Re: [PATCH 2/5] scsi: megaraid_sas: correct an error message
Quoted 4 lines · Guixin Liu
Correct the error message when alloc init request fail.
Signed-off-by Guixin Liu <[email protected]>
PATCH 3/5 scsi: megaraid_sas: simplify the megasas_update_device_list
In reply to Guixin LiuRemove unnecessary dcmd_ret check and go to statements.
--- drivers/scsi/megaraid/megaraid_sas_base.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-)
drivers/scsi/megaraid/megaraid_sas_base.c +5 -12
@@ -8766,33 +8766,26 @@ static inline void megasas_remove_scsi_device(struct scsi_device *sdev)int megasas_update_device_list (struct megasas_instance *instance,int event_type) { -int dcmd_ret =DCMD_SUCCESS ; +int dcmd_ret;if (instance->enable_fw_dev_list) { - dcmd_ret =megasas_host_device_list_query (instance, false); -if (dcmd_ret !=DCMD_SUCCESS ) - goto out; +return megasas_host_device_list_query (instance, false); }else {if (event_type &SCAN_PD_CHANNEL ) { dcmd_ret =megasas_get_pd_list (instance); -if (dcmd_ret !=DCMD_SUCCESS ) - goto out; +return dcmd_ret; }if (event_type &SCAN_VD_CHANNEL ) {if (!instance->requestorId ||megasas_get_ld_vf_affiliation (instance,0 )) { - dcmd_ret =megasas_ld_list_query (instance, +return megasas_ld_list_query (instance,MR_LD_QUERY_TYPE_EXPOSED_TO_HOST ); -if (dcmd_ret !=DCMD_SUCCESS ) - goto out; } } } - -out: -return dcmd_ret; +return DCMD_SUCCESS ; }/**
Signature · 1 line
1.8.3.1
Re: [PATCH 3/5] scsi: megaraid_sas: simplify the megasas_update_device_list
Quoted 4 lines · Guixin Liu
Remove unnecessary
dcmd_retcheck and go to statements.Signed-off-by Guixin Liu <[email protected]>
PATCH 4/5 scsi: megaraid_sas: remove unnecessary memset
In reply to Guixin LiuRemove memset pd_list and ld_ids in megasas_get_device_list, because they will be memset in megasas_host_device_list_query or megasas_get_pd_list and megasas_ld_list_query.
--- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/scsi/megaraid/megaraid_sas_base.c +0 -4
@@ -5878,10 +5878,6 @@ static void megasas_setup_reply_map(struct megasas_instance *instance)static int megasas_get_device_list (struct megasas_instance *instance) { -memset (instance->pd_list,0 , - (MEGASAS_MAX_PD *sizeof (struct megasas_pd_list ))); -memset (instance->ld_ids,0xff ,MEGASAS_MAX_LD_IDS ); -if (instance->enable_fw_dev_list) {if (megasas_host_device_list_query (instance, true))return FAILED ;
Signature · 1 line
1.8.3.1
Re: [PATCH 4/5] scsi: megaraid_sas: remove unnecessary memset
Quoted 6 lines · Guixin Liu
Remove memset
pd_listandld_idsinmegasas_get_device_list, because they will be memset inmegasas_host_device_list_queryormegasas_get_pd_listandmegasas_ld_list_query.Signed-off-by Guixin Liu <[email protected]>
PATCH 5/5 scsi: megaraid_sas: move megasas_dbg_lvl init to megasas_init
In reply to Guixin LiuThe megasas_dbg_lvl is a driver level parameter, dont init in probe path, otherwise we can not see any debug print when bind a device to megaraid driver.
--- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +1 -1
@@ -7439,7 +7439,6 @@ static inline void megasas_init_ctrl_params(struct megasas_instance *instance) (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) instance->flag_ieee = 1; - megasas_dbg_lvl =0 ; instance->flag =0 ; instance->unload =1 ; instance->last_time =0 ;
@@ -9011,6 +9010,7 @@ static int __init megasas_init(void)*/ pr_info ("megasas: %s\n" ,MEGASAS_VERSION ); + megasas_dbg_lvl =0 ; support_poll_for_event =2 ; support_device_change =1 ; support_nvme_encapsulation = true;
Signature · 1 line
1.8.3.1
Re: [PATCH 5/5] scsi: megaraid_sas: move megasas_dbg_lvl init to megasas_init
Quoted 6 lines · Guixin Liu
The
megasas_dbg_lvlis a driver level parameter, dont init in probe path, otherwise we can not see any debug print when bind a device to megaraid driver.Signed-off-by Guixin Liu <[email protected]>
Hi,
Gentle ping.
Best regards,
Guixin Liu
Quoted 17 lines · Guixin Liu
*** BLURB HERE ***
Hi guys,
This series has bug fix and a few simple cleanups, please review.
Guixin Liu (5):
scsi:megaraid_sas: correct the parameter ofscsi_device_lookup
scsi:megaraid_sas: correct an error message
scsi:megaraid_sas: simplify themegasas_update_device_list
scsi:megaraid_sas: remove unnecessary memset
scsi:megaraid_sas: movemegasas_dbg_lvlinit tomegasas_initdrivers/scsi/megaraid/megaraid_sas_base.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-)
Hi,
Gentle ping...
I think both "scsi: megaraid_sas: correct the parameter of scsi_device_lookup" and
"scsi: megaraid_sas: move megasas_dbg_lvl init to megasas_init " are importent issue.
Best regards,
Guixin Liu
Quoted 27 lines · Guixin Liu
Hi,
Gentle ping.
Best regards,
Guixin Liu
Quoted 18 lines · Guixin Liu
*** BLURB HERE ***
Hi guys,
This series has bug fix and a few simple cleanups, please review.
Guixin Liu (5):
scsi:megaraid_sas: correct the parameter ofscsi_device_lookup
scsi:megaraid_sas: correct an error message
scsi:megaraid_sas: simplify themegasas_update_device_list
scsi:megaraid_sas: remove unnecessary memset
scsi:megaraid_sas: movemegasas_dbg_lvlinit tomegasas_init
drivers/scsi/megaraid/megaraid_sas_base.c| 27
++++++++-------------------1 file changed, 8 insertions(+), 19 deletions(-)
Martin K. Petersen
AppliedGuixin,
Quoted 6 lines
Guixin Liu (5):
scsi:megaraid_sas: correct the parameter ofscsi_device_lookup
scsi:megaraid_sas: correct an error message
scsi:megaraid_sas: simplify themegasas_update_device_list
scsi:megaraid_sas: remove unnecessary memset
scsi:megaraid_sas: movemegasas_dbg_lvlinit tomegasas_init
Applied to 6.1/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering