linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tj@kernel.org (Tejun Heo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] drivers: ata: wake port before DMA stop for ALPM
Date: Fri, 8 Jan 2016 11:36:10 -0500	[thread overview]
Message-ID: <20160108163610.GS1898@mtj.duckdns.org> (raw)
In-Reply-To: <1452211413-1350-4-git-send-email-f.fainelli@gmail.com>

Hello,

On Thu, Jan 07, 2016 at 04:03:32PM -0800, Florian Fainelli wrote:
> diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
> index d61740e78d6d..b6664c579f9a 100644
> --- a/drivers/ata/libahci.c
> +++ b/drivers/ata/libahci.c
> @@ -595,6 +595,58 @@ int ahci_stop_engine(struct ata_port *ap)
>  	void __iomem *port_mmio = ahci_port_base(ap);
>  	u32 tmp;
>  
> +	/*
> +	 * On some controllers, stopping a port's DMA engine
> +	 * while the port is in ALPM state (partial or slumber)
> +	 * results in failures on subsequent DMA engine starts.
> +	 * For those controllers, put the port back in active
> +	 * state before stopping it's DMA engine.
> +	 */
> +	if (ap->flags2 & ATA_FLAG2_WAKE_BEFORE_STOP) {
...

So, I'm not too comfortable with open coding ALPM switching in
ahci_stop_engine().  Shouldn't it be possible to update and/or
refactor and reuse ahci_set_lpm()?

> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -236,6 +236,8 @@ enum {
>  
>  	/* bits 24:31 of ap->flags are reserved for LLD specific flags */
>  
> +	/* struct ata_port flags2 */
> +	ATA_FLAG2_WAKE_BEFORE_STOP = (1 << 0), /* wake link before DMA stop */

What's wrong with bits 2-5 in ATA_FLAG_* space?  Also, should this be
a ahci priv flag?

Thanks.

-- 
tejun

  reply	other threads:[~2016-01-08 16:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08  0:03 [PATCH 0/4] ata: ahci_brcmstb: ALPM support Florian Fainelli
2016-01-08  0:03 ` [PATCH 1/4] ata: ahci_brcmstb: enable support for ALPM Florian Fainelli
2016-01-08 16:29   ` Tejun Heo
2016-01-08  0:03 ` [PATCH 2/4] ata: ahci_brcmstb: disable DIPM support Florian Fainelli
2016-01-08 16:30   ` Tejun Heo
2016-01-08  0:03 ` [PATCH 3/4] drivers: ata: wake port before DMA stop for ALPM Florian Fainelli
2016-01-08 16:36   ` Tejun Heo [this message]
2016-01-08 23:20     ` Danesh Petigara
2016-01-10 17:29       ` Tejun Heo
2016-01-08  0:03 ` [PATCH 4/4] libata: skip debounce delay on link resume Florian Fainelli
2016-01-08 16:50   ` 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=20160108163610.GS1898@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.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).