Hannes, Thank you for pointing it out. Will incorporate the suggested changes in the upcoming patches. Thanks & Regards, Anand R.L -----Original Message----- From: Hannes Reinecke [mailto:hare@xxxxxxx] Sent: Thursday, January 16, 2020 6:01 PM To: Anand Lodnoor <anand.lodnoor@xxxxxxxxxxxx>; linux-scsi@xxxxxxxxxxxxxxx Cc: kashyap.desai@xxxxxxxxxxxx; sumit.saxena@xxxxxxxxxxxx; kiran-kumar.kasturi@xxxxxxxxxxxx; sankar.patra@xxxxxxxxxxxx; sasikumar.pc@xxxxxxxxxxxx; shivasharan.srikanteshwara@xxxxxxxxxxxx; chandrakanth.patil@xxxxxxxxxxxx Subject: Re: [PATCH v2 10/11] megaraid_sas: Use Block layer API to check SCSI device in-flight IO requests On 1/14/20 12:21 PM, Anand Lodnoor wrote: > Remove usage of device_busy counter from driver. Instead of > device_busy counter now driver uses 'nr_active' counter of > request_queue to get the number of inflight request for a LUN. > > Link : https://patchwork.kernel.org/patch/11249297/ > Signed-off-by: Chandrakanth Patil <chandrakanth.patil@xxxxxxxxxxxx> > Signed-off-by: Anand Lodnoor <anand.lodnoor@xxxxxxxxxxxx> > --- > drivers/scsi/megaraid/megaraid_sas_fusion.c | 56 > ++++++++++++++++------------- > 1 file changed, 31 insertions(+), 25 deletions(-) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > index 0bdd477..f3b36fd 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c > @@ -364,6 +364,35 @@ inline void megasas_return_cmd_fusion(struct > megasas_instance *instance, > instance->max_fw_cmds = instance->max_fw_cmds-1; > } > } > + > +static inline void > +megasas_get_msix_index(struct megasas_instance *instance, > + struct scsi_cmnd *scmd, > + struct megasas_cmd_fusion *cmd, > + u8 data_arms) > +{ > + int sdev_busy; > + > + /* nr_hw_queue = 1 for MegaRAID */ > + struct blk_mq_hw_ctx *hctx = > + scmd->device->request_queue->queue_hw_ctx[0]; > + While this might be true it would be better to use the hctx from the request itself: struct blk_mq_hw_ctx *hctx = scmd->request->mq_hctx; Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer