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 via email to