Comment 22 for bug 1971151

Revision history for this message
Sumit Saxena (ssaxena) wrote : Re: [Ubuntu 22.04.1] mpi3mr: Add management application interface(BSG) support

Michael,

Problem is- the patch- "256bd4f23d9c scsi: mpi3mr: Return I/Os to an unrecoverable HBA with DID_ERROR" is calling "scmd_done(scmd)" directly whereas Ubuntu kernel expects "scmd->scsi_done(scmd)".

So the patch causing issue has to be adjusted for Ubuntu kernel as below [scmd_done(scmd) replaced with scmd->scsi_done(scmd)]:

-------
 drivers/scsi/mpi3mr/mpi3mr_os.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 89a4918..5c57519 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -3996,6 +3996,12 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost,
  int iprio_class;
  u8 is_pcie_dev = 0;

+ if (mrioc->unrecoverable) {
+ scmd->result = DID_ERROR << 16;
+ scmd->scsi_done(scmd);
+ goto out;
+ }
+
  sdev_priv_data = scmd->device->hostdata;
  if (!sdev_priv_data || !sdev_priv_data->tgt_priv_data) {
   scmd->result = DID_NO_CONNECT << 16;
------

Please let me know if it works for you.