Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "mauricfo@linux.vnet.ibm.com" <mauricfo@linux.vnet.ibm.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: "chaitra.basappa@broadcom.com" <chaitra.basappa@broadcom.com>,
	"sathya.prakash@broadcom.com" <sathya.prakash@broadcom.com>,
	"suganath-prabu.subramani@broadcom.com"
	<suganath-prabu.subramani@broadcom.com>,
	"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Subject: Re: [PATCH] test-case
Date: Wed, 31 Jan 2018 22:50:24 +0000	[thread overview]
Message-ID: <1517439022.7325.9.camel@wdc.com> (raw)
In-Reply-To: <1517426684-23050-1-git-send-email-mauricfo@linux.vnet.ibm.com>

On Wed, 2018-01-31 at 17:24 -0200, Mauricio Faria de Oliveira wrote:
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> index 3c4e47c..611cee33 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -2997,6 +2997,12 @@ int mpt3sas_scsih_issue_locked_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle,
>  		"attempting task abort! scmd(%p)\n", scmd);
>  	_scsih_tm_display_info(ioc, scmd);
>  
> +	if (ioc->logging_level & 0x01000000) {
> +		pr_info(MPT3SAS_FMT "fail task abort scmd(%p)\n", ioc->name, scmd);
> +		r = FAILED;
> +		goto out;
> +	}
> +
>  	sas_device_priv_data = scmd->device->hostdata;
>  	if (!sas_device_priv_data || !sas_device_priv_data->sas_target) {
>  		sdev_printk(KERN_INFO, scmd->device,
> @@ -5584,6 +5590,11 @@ static int _scsih_set_satl_pending(struct scsi_cmnd *scmd, bool pending)
>  
>  	scsi_dma_unmap(scmd);
>  
> +	if (ioc->logging_level & 0x10000000 && scmd->cmnd[0] != 0x35) {
> +		pr_info(MPT3SAS_FMT "skip scsi_done scmd(%p)\n", ioc->name, scmd);
> +		return 1;
> +	}
> +
>  	scmd->scsi_done(scmd);
>  	return 1;
>  }
> @@ -10016,6 +10027,11 @@ static void scsih_remove(struct pci_dev *pdev)
>  
>  	_scsih_ir_shutdown(ioc);
>  	mpt3sas_base_detach(ioc);
> +
> +	while (ioc->logging_level & 0x10000000) {
> +		pr_info(MPT3SAS_FMT "sleep on shutdown\n", ioc->name);
> +		ssleep(1);
> +	}
>  }

Hello Mauricio,

I think it would be useful to have some variant of the above code in the kernel
tree. Are you familiar with the fault injection framework (see also
<linux/fault-inject.h> and Documentation/fault-injection/fault-injection.txt)?
Do you think that framework would be appropriate for controlling whether or not
the above code gets executed?

Thanks,

Bart.

  reply	other threads:[~2018-01-31 22:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 19:00 [PATCH] scsi: mpt3sas: fix oops in error handlers after shutdown/unload Mauricio Faria de Oliveira
2018-01-31 19:06 ` Bart Van Assche
2018-01-31 19:48   ` Mauricio Faria de Oliveira
2018-01-31 22:59     ` Bart Van Assche
2018-02-01 19:54       ` Mauricio Faria de Oliveira
2018-01-31 19:24 ` [PATCH] test-case Mauricio Faria de Oliveira
2018-01-31 22:50   ` Bart Van Assche [this message]
2018-02-01 20:18     ` Mauricio Faria de Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517439022.7325.9.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=chaitra.basappa@broadcom.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mauricfo@linux.vnet.ibm.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox