All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Gregory Clement <gregory.clement@bootlin.com>,
	Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Jens Axboe <axboe@kernel.dk>
Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Nadav Haklai <nadavh@marvell.com>,
	linux-ide@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/7] ata: libahci_platform: comply to PHY framework
Date: Tue, 4 Dec 2018 20:48:15 +0100	[thread overview]
Message-ID: <ccde58fa-badd-dcd6-9834-7ef689e922e2@redhat.com> (raw)
In-Reply-To: <20181204192831.12440-2-miquel.raynal@bootlin.com>

Hi,

On 04-12-18 20:28, Miquel Raynal wrote:
> Current implementation of the libahci does not take into account the
> new PHY framework. Correct the situation by adding a call to
> phy_set_mode() before phy_power_on().
> 
> PHYs should also be handled at suspend/resume time. For this, call
> ahci_platform_enable/disable_phys() at suspend/resume_host() time. These
> calls are guarded by a HFLAG (AHCI_HFLAG_SUSPEND_PHYS) that the user of
> the libahci driver must set manually in hpriv->flags at probe time. This
> is to avoid breaking users that have not been tested with this change.
> 
> Suggested-by: Grzegorz Jaszczyk <jaz@semihalf.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Patch looks good to me now:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Rest of the series looks ok to me to:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
>   drivers/ata/ahci.h             |  2 ++
>   drivers/ata/libahci_platform.c | 13 +++++++++++++
>   2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
> index ef356e70e6de..8810475f307a 100644
> --- a/drivers/ata/ahci.h
> +++ b/drivers/ata/ahci.h
> @@ -254,6 +254,8 @@ enum {
>   	AHCI_HFLAG_IS_MOBILE		= (1 << 25), /* mobile chipset, use
>   							SATA_MOBILE_LPM_POLICY
>   							as default lpm_policy */
> +	AHCI_HFLAG_SUSPEND_PHYS		= (1 << 26), /* handle PHYs during
> +							suspend/resume */
>   
>   	/* ap->flags bits */
>   
> diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
> index 4b900fc659f7..81b1a3332ed6 100644
> --- a/drivers/ata/libahci_platform.c
> +++ b/drivers/ata/libahci_platform.c
> @@ -56,6 +56,12 @@ static int ahci_platform_enable_phys(struct ahci_host_priv *hpriv)
>   		if (rc)
>   			goto disable_phys;
>   
> +		rc = phy_set_mode(hpriv->phys[i], PHY_MODE_SATA);
> +		if (rc) {
> +			phy_exit(hpriv->phys[i]);
> +			goto disable_phys;
> +		}
> +
>   		rc = phy_power_on(hpriv->phys[i]);
>   		if (rc) {
>   			phy_exit(hpriv->phys[i]);
> @@ -738,6 +744,9 @@ int ahci_platform_suspend_host(struct device *dev)
>   	writel(ctl, mmio + HOST_CTL);
>   	readl(mmio + HOST_CTL); /* flush */
>   
> +	if (hpriv->flags & AHCI_HFLAG_SUSPEND_PHYS)
> +		ahci_platform_disable_phys(hpriv);
> +
>   	return ata_host_suspend(host, PMSG_SUSPEND);
>   }
>   EXPORT_SYMBOL_GPL(ahci_platform_suspend_host);
> @@ -756,6 +765,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_suspend_host);
>   int ahci_platform_resume_host(struct device *dev)
>   {
>   	struct ata_host *host = dev_get_drvdata(dev);
> +	struct ahci_host_priv *hpriv = host->private_data;
>   	int rc;
>   
>   	if (dev->power.power_state.event == PM_EVENT_SUSPEND) {
> @@ -766,6 +776,9 @@ int ahci_platform_resume_host(struct device *dev)
>   		ahci_init_controller(host);
>   	}
>   
> +	if (hpriv->flags & AHCI_HFLAG_SUSPEND_PHYS)
> +		ahci_platform_enable_phys(hpriv);
> +
>   	ata_host_resume(host);
>   
>   	return 0;
> 

WARNING: multiple messages have this Message-ID (diff)
From: Hans de Goede <hdegoede@redhat.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Gregory Clement <gregory.clement@bootlin.com>,
	Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Jens Axboe <axboe@kernel.dk>
Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Nadav Haklai <nadavh@marvell.com>,
	linux-ide@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/7] ata: libahci_platform: comply to PHY framework
Date: Tue, 4 Dec 2018 20:48:15 +0100	[thread overview]
Message-ID: <ccde58fa-badd-dcd6-9834-7ef689e922e2@redhat.com> (raw)
In-Reply-To: <20181204192831.12440-2-miquel.raynal@bootlin.com>

Hi,

On 04-12-18 20:28, Miquel Raynal wrote:
> Current implementation of the libahci does not take into account the
> new PHY framework. Correct the situation by adding a call to
> phy_set_mode() before phy_power_on().
> 
> PHYs should also be handled at suspend/resume time. For this, call
> ahci_platform_enable/disable_phys() at suspend/resume_host() time. These
> calls are guarded by a HFLAG (AHCI_HFLAG_SUSPEND_PHYS) that the user of
> the libahci driver must set manually in hpriv->flags at probe time. This
> is to avoid breaking users that have not been tested with this change.
> 
> Suggested-by: Grzegorz Jaszczyk <jaz@semihalf.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Patch looks good to me now:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Rest of the series looks ok to me to:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
>   drivers/ata/ahci.h             |  2 ++
>   drivers/ata/libahci_platform.c | 13 +++++++++++++
>   2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
> index ef356e70e6de..8810475f307a 100644
> --- a/drivers/ata/ahci.h
> +++ b/drivers/ata/ahci.h
> @@ -254,6 +254,8 @@ enum {
>   	AHCI_HFLAG_IS_MOBILE		= (1 << 25), /* mobile chipset, use
>   							SATA_MOBILE_LPM_POLICY
>   							as default lpm_policy */
> +	AHCI_HFLAG_SUSPEND_PHYS		= (1 << 26), /* handle PHYs during
> +							suspend/resume */
>   
>   	/* ap->flags bits */
>   
> diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
> index 4b900fc659f7..81b1a3332ed6 100644
> --- a/drivers/ata/libahci_platform.c
> +++ b/drivers/ata/libahci_platform.c
> @@ -56,6 +56,12 @@ static int ahci_platform_enable_phys(struct ahci_host_priv *hpriv)
>   		if (rc)
>   			goto disable_phys;
>   
> +		rc = phy_set_mode(hpriv->phys[i], PHY_MODE_SATA);
> +		if (rc) {
> +			phy_exit(hpriv->phys[i]);
> +			goto disable_phys;
> +		}
> +
>   		rc = phy_power_on(hpriv->phys[i]);
>   		if (rc) {
>   			phy_exit(hpriv->phys[i]);
> @@ -738,6 +744,9 @@ int ahci_platform_suspend_host(struct device *dev)
>   	writel(ctl, mmio + HOST_CTL);
>   	readl(mmio + HOST_CTL); /* flush */
>   
> +	if (hpriv->flags & AHCI_HFLAG_SUSPEND_PHYS)
> +		ahci_platform_disable_phys(hpriv);
> +
>   	return ata_host_suspend(host, PMSG_SUSPEND);
>   }
>   EXPORT_SYMBOL_GPL(ahci_platform_suspend_host);
> @@ -756,6 +765,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_suspend_host);
>   int ahci_platform_resume_host(struct device *dev)
>   {
>   	struct ata_host *host = dev_get_drvdata(dev);
> +	struct ahci_host_priv *hpriv = host->private_data;
>   	int rc;
>   
>   	if (dev->power.power_state.event == PM_EVENT_SUSPEND) {
> @@ -766,6 +776,9 @@ int ahci_platform_resume_host(struct device *dev)
>   		ahci_init_controller(host);
>   	}
>   
> +	if (hpriv->flags & AHCI_HFLAG_SUSPEND_PHYS)
> +		ahci_platform_enable_phys(hpriv);
> +
>   	ata_host_resume(host);
>   
>   	return 0;
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2018-12-04 19:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 19:28 [PATCH v3 0/7] Bring suspend to RAM support to MVEBU SATA Miquel Raynal
2018-12-04 19:28 ` [PATCH v3 1/7] ata: libahci_platform: comply to PHY framework Miquel Raynal
2018-12-04 19:28   ` Miquel Raynal
2018-12-04 19:48   ` Hans de Goede [this message]
2018-12-04 19:48     ` Hans de Goede
2018-12-04 19:28 ` [PATCH v3 2/7] ata: ahci: mvebu: remove stale comment Miquel Raynal
2018-12-04 19:28   ` Miquel Raynal
2018-12-04 19:28 ` [PATCH v3 3/7] ata: ahci: mvebu: do Armada 38x configuration only on relevant SoCs Miquel Raynal
2018-12-04 19:28   ` Miquel Raynal
2018-12-04 19:28 ` [PATCH v3 4/7] ata: ahci: mvebu: add Armada 3700 initialization needed for S2RAM Miquel Raynal
2018-12-04 19:28   ` Miquel Raynal
2018-12-04 19:28 ` [PATCH v3 5/7] ata: ahci: mvebu: request PHY suspend/resume for Armada 3700 Miquel Raynal
2018-12-04 19:28   ` Miquel Raynal
2018-12-04 19:28 ` [PATCH v3 6/7] ARM64: dts: marvell: armada-37xx: declare SATA clock Miquel Raynal
2018-12-04 19:28   ` Miquel Raynal
2019-02-06  9:46   ` Gregory CLEMENT
2019-02-06  9:46     ` Gregory CLEMENT
2018-12-04 19:28 ` [PATCH v3 7/7] ARM64: dts: marvell: armada-3720-espressobin: declare SATA PHY property Miquel Raynal
2018-12-04 19:28   ` Miquel Raynal
2019-02-06 14:19   ` Gregory CLEMENT
2019-02-06 14:19     ` Gregory CLEMENT
2018-12-05  0:11 ` [PATCH v3 0/7] Bring suspend to RAM support to MVEBU SATA Jens Axboe
2018-12-05  0:11   ` Jens Axboe
2019-01-11 13:34   ` Miquel Raynal
2019-01-11 21:48     ` Jens Axboe
2019-01-11 21:48       ` Jens Axboe

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=ccde58fa-badd-dcd6-9834-7ef689e922e2@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andrew@lunn.ch \
    --cc=antoine.tenart@bootlin.com \
    --cc=axboe@kernel.dk \
    --cc=devicetree@vger.kernel.org \
    --cc=gregory.clement@bootlin.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=nadavh@marvell.com \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.