From: Tejun Heo <tj@kernel.org>
To: DingXiang <dingxiang@huawei.com>
Cc: linux-ide@vger.kernel.org, fangwei1@huawei.com,
miaoxie@huawei.com, wangyijing@huawei.com,
zhangaihua1@huawei.com, zhaohongjiang@huawei.com,
houtao1@huawei.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH resend] libata:fix kernel panic when hotplug
Date: Wed, 15 Jun 2016 13:56:07 -0400 [thread overview]
Message-ID: <20160615175607.GE24102@mtj.duckdns.org> (raw)
In-Reply-To: <1465982132-26151-1-git-send-email-dingxiang@huawei.com>
Hello,
On Wed, Jun 15, 2016 at 05:15:32PM +0800, DingXiang wrote:
> From: Miao Xie <miaoxie@huawei.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@huawei.com>
> Signed-off-by:Chenqilin <chenqilin2@huawei.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
prev parent reply other threads:[~2016-06-15 17:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 9:15 [PATCH resend] libata:fix kernel panic when hotplug DingXiang
2016-06-15 11:10 ` Sergei Shtylyov
2016-06-15 11:11 ` Sergei Shtylyov
2016-06-15 17:56 ` Tejun Heo [this message]
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=20160615175607.GE24102@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=dingxiang@huawei.com \
--cc=fangwei1@huawei.com \
--cc=houtao1@huawei.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=wangyijing@huawei.com \
--cc=zhangaihua1@huawei.com \
--cc=zhaohongjiang@huawei.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;
as well as URLs for NNTP newsgroup(s).