[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160615175607.GE24102@mtj.duckdns.org>
Date: Wed, 15 Jun 2016 13:56:07 -0400
From: Tejun Heo <tj@...nel.org>
To: DingXiang <dingxiang@...wei.com>
Cc: linux-ide@...r.kernel.org, fangwei1@...wei.com, miaoxie@...wei.com,
wangyijing@...wei.com, zhangaihua1@...wei.com,
zhaohongjiang@...wei.com, houtao1@...wei.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH resend] libata:fix kernel panic when hotplug
Hello,
On Wed, Jun 15, 2016 at 05:15:32PM +0800, DingXiang wrote:
> From: Miao Xie <miaoxie@...wei.com>
>
> In normal condition,if we use sas protocol and hotplug a sata disk on a port,
> the sas driver will send event "PORTE_BYTES_DMAED" and call function "sas_porte_bytes_dmaed".
> But if a sata disk is run io and unplug it,then plug a new sata disk,this operation may cause
> a kernel panic like this:
Can you please flow the text so that it fits inside 80 column?
...
> Signed-off-by:Dingxiang <dingxiang@...wei.com>
> Signed-off-by:Chenqilin <chenqilin2@...wei.com>
Can you please put a space between the first and last names?
Please also cc linux-scsi and people who are more familiar with SAS.
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index 61dc7a9..ac5ec4d 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -816,8 +816,12 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
>
> if (ap->pflags & ATA_PFLAG_LOADING)
> ap->pflags &= ~ATA_PFLAG_LOADING;
> - else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG)
> - schedule_delayed_work(&ap->hotplug_task, 0);
> + else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG){
> + if(ap->flags & ATA_FLAG_SAS_HOST)
> + ap->pflags &= ~ATA_PFLAG_SCSI_HOTPLUG;
> + else
> + schedule_delayed_work(&ap->hotplug_task, 0);
> + }
ATA_PFLAG_SCSI_HOTPLUG is cleared below anyway, so the above can be
else if ((ap->pflags & ATA_PFLAG_SCSI_HOTPLUG) &&
!(ap->pflags & ATA_PFLAG_SAS_HOST))
Thanks.
--
tejun
Powered by blists - more mailing lists