From: Tejun Heo <tj@kernel.org>
To: "Huang, Shane" <Shane.Huang@amd.com>
Cc: jgarzik@pobox.com, linux-ide@vger.kernel.org
Subject: Re: [PATCH #upstream, v2] ahci: Implement SATA AHCI FIS-based switching support
Date: Wed, 02 Sep 2009 11:40:40 +0900 [thread overview]
Message-ID: <4A9DDB28.7070709@kernel.org> (raw)
In-Reply-To: <C8E4BD7D001E44499280E0884BD9DB30FC988D@sshaexmb1.amd.com>
Hello, Shane.
Huang, Shane wrote:
> static void ahci_enable_fbs(struct ata_port *ap)
> {
> struct ahci_port_priv *pp = ap->private_data;
> void __iomem *port_mmio = ahci_port_base(ap);
> u32 fbs;
> int rc;
>
> if (!pp->fbs_supported)
> return;
>
> fbs = readl(port_mmio + PORT_FBS);
> if (fbs & PORT_FBS_EN)
> return;
This can leave pp->fbs_enabled out of sync, right? Just don't check
and set the bit anyway.
> rc = ahci_stop_engine(ap);
> if (rc)
> return;
>
> writel(fbs | PORT_FBS_EN, port_mmio + PORT_FBS);
> fbs = readl(port_mmio + PORT_FBS);
> if (fbs & PORT_FBS_EN) {
> dev_printk(KERN_INFO, ap->host->dev, "FBS is
> enabled.\n");
> pp->fbs_enabled = true;
> pp->fbs_last_dev = -1; /* initialization */
> } else
> dev_printk(KERN_ERR, ap->host->dev, "Failed to enable
> FBS\n");
>
> ahci_start_engine(ap);
> }
>
>
> static void ahci_disable_fbs(struct ata_port *ap)
> {
> struct ahci_port_priv *pp = ap->private_data;
> void __iomem *port_mmio = ahci_port_base(ap);
> u32 fbs;
> int rc;
>
> if (!pp->fbs_supported)
> return;
>
> fbs = readl(port_mmio + PORT_FBS);
> if ((fbs & PORT_FBS_EN) == 0)
> return;
Ditto.
Thanks.
--
tejun
next prev parent reply other threads:[~2009-09-02 2:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-18 4:45 [PATCH #upstream, v2] ahci: Implement SATA AHCI FIS-based switching support Shane Huang
2009-08-31 8:01 ` Tejun Heo
2009-09-01 12:22 ` Huang, Shane
2009-09-01 12:28 ` Tejun Heo
2009-09-01 13:08 ` Huang, Shane
2009-09-01 13:14 ` Tejun Heo
2009-09-02 1:55 ` Huang, Shane
2009-09-02 1:58 ` Tejun Heo
2009-09-02 2:32 ` Huang, Shane
2009-09-02 2:40 ` Tejun Heo [this message]
2009-09-02 6:42 ` Huang, Shane
2009-09-02 6:49 ` Tejun Heo
2009-09-02 6:58 ` Huang, Shane
2009-09-03 4:53 ` Huang, Shane
2009-09-03 6:04 ` Tejun Heo
2009-09-04 2:25 ` Huang, Shane
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=4A9DDB28.7070709@kernel.org \
--to=tj@kernel.org \
--cc=Shane.Huang@amd.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
/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).