From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Xiangliang Yu <yxlraid@gmail.com>
Cc: tj@kernel.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] AHCI: disabled FBS prior to issuing software reset
Date: Sat, 28 Sep 2013 19:23:38 +0400 [thread overview]
Message-ID: <5246F47A.8030200@cogentembedded.com> (raw)
In-Reply-To: <1380366816-16221-1-git-send-email-yxlraid@gmail.com>
Hello.
On 28-09-2013 15:13, Xiangliang Yu wrote:
> If device is attached to port multiplier, the detection process
> look like this:
> ahci_hardreset(link, class, deadline)
> if (class == ATA_DEV_PMP) {
> sata_pmp_attach(dev) /* will enable FBS */
> sata_pmp_init_links(ap, nr_ports);
> ata_for_each_link(link, ap, EDGE) {
> sata_std_hardreset(link, class, deadline);
> if (link_is_online)
> ahci_softreset(link, class, deadline);
> }
> }
> But, according to chapter 9.3.9 in AHCI spec: Prior to issuing software reset,
> software shall clear PxCMD.ST to '0' and then clear PxFBS.EN to '0'.
> Signed-off-by: Xiangliang Yu <yxlraid@gmail.com>
> ---
> drivers/ata/libahci.c | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
> diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
> index acfd0f7..8d024a4 100644
> --- a/drivers/ata/libahci.c
> +++ b/drivers/ata/libahci.c
> @@ -1267,9 +1267,11 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
> {
> struct ata_port *ap = link->ap;
> struct ahci_host_priv *hpriv = ap->host->private_data;
> + struct ahci_port_priv *pp = ap->private_data;
> const char *reason = NULL;
> unsigned long now, msecs;
> struct ata_taskfile tf;
> + bool flag = FALSE;
Why not lowercase 'false'? And this is not a good name for a variable (too
generic), it should better be called 'fbs' or something...
> @@ -1279,6 +1281,11 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
> if (rc && rc != -EOPNOTSUPP)
> ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc);
>
> + if (!ata_is_host_link(link) && pp->fbs_enabled) {
> + ahci_disable_fbs(ap);
> + flag = TRUE;
Why not lowercase 'true'?
WBR, Sergei
next prev parent reply other threads:[~2013-09-28 15:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-28 11:13 [PATCH 1/1] AHCI: disabled FBS prior to issuing software reset Xiangliang Yu
2013-09-28 11:49 ` Tejun Heo
2013-09-28 13:04 ` xiangliang yu
2013-09-28 13:10 ` Tejun Heo
2013-10-12 6:56 ` xiangliang yu
2013-10-13 19:57 ` Tejun Heo
2013-10-14 1:48 ` xiangliang yu
2013-10-15 3:40 ` xiangliang yu
2013-10-15 12:50 ` Tejun Heo
2013-09-28 15:23 ` Sergei Shtylyov [this message]
[not found] <CAP0P+NUQSByVNquY-zP3S-6GKhSvQXgq_4dDCTd2R8FM=YC_Gg@mail.gmail.com>
2013-10-27 11:57 ` Tejun Heo
2013-10-28 1:48 ` xiangliang yu
2013-11-14 0:26 ` xiangliang yu
2013-11-14 5:25 ` Tejun Heo
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=5246F47A.8030200@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=yxlraid@gmail.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).