From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>, Andrew Lunn <andrew@lunn.ch>,
Jason Cooper <jason@lakedaemon.net>,
devicetree@vger.kernel.org,
Antoine Tenart <antoine.tenart@bootlin.com>,
Gregory Clement <gregory.clement@bootlin.com>,
linux-pm@vger.kernel.org,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
Nadav Haklai <nadavh@marvell.com>,
linux-ide@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Jens Axboe <axboe@kernel.dk>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
linux-arm-kernel@lists.infradead.org,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Subject: Re: [PATCH 1/7] ata: libahci_platform: comply to PHY framework
Date: Fri, 30 Nov 2018 16:40:16 +0100 [thread overview]
Message-ID: <20181130164016.7699efb3@xps13> (raw)
In-Reply-To: <f14c6e8e-73a9-0b62-0dbc-87d390789c0c@redhat.com>
Hi Hans,
Thanks for the review.
Hans de Goede <hdegoede@redhat.com> wrote on Fri, 23 Nov 2018 11:33:15
+0100:
> Hi Miquel,
>
> On 23-11-18 11:15, 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() and by adding calls to
> > ahci_platform_enable/disable_phys() at suspend/resume_host() time.
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > ---
> > drivers/ata/libahci_platform.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
> > index 4b900fc659f7..9f33f72b674b 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;
> > + }
> > +
>
> I see that phy_set_mode returns 0 for drivers which do not implement it,
> so this should be fine.
>
>
> > rc = phy_power_on(hpriv->phys[i]);
> > if (rc) {
> > phy_exit(hpriv->phys[i]);
> > @@ -738,6 +744,8 @@ int ahci_platform_suspend_host(struct device *dev)
> > writel(ctl, mmio + HOST_CTL);
> > readl(mmio + HOST_CTL); /* flush */
> > > + ahci_platform_disable_phys(hpriv);
> > +
> > return ata_host_suspend(host, PMSG_SUSPEND);
> > }
> > EXPORT_SYMBOL_GPL(ahci_platform_suspend_host);
>
> I'm afraid that this and the matching change in ahci_platform_suspend_host
> needs to be guarded by a flag, there are quite a few sata drivers
> using the libahci_platform functions as well as quite a few sata drivers
> combining this with using phy drivers.
>
> I'm worried that doing this unconditionally on drivers which have
> not been tested with this change my break things.
>
> I think it might be cleanest to extend the existing flags passed
> to ahci_platform_get_resources with a flag for this and storing them
> somewhere in ahci_host_priv so that the suspend/resume functions can
> get to them.
I understand your concern, please have a look at the v2 which addresses
this the way you suggested.
Thanks,
Miquèl
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2018-11-30 15:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-23 10:15 [PATCH 0/7] Bring suspend to RAM support to MVEBU SATA Miquel Raynal
2018-11-23 10:15 ` [PATCH 1/7] ata: libahci_platform: comply to PHY framework Miquel Raynal
2018-11-23 10:33 ` Hans de Goede
2018-11-30 15:40 ` Miquel Raynal [this message]
2018-11-23 15:18 ` Andrew Lunn
2018-11-23 15:27 ` Russell King - ARM Linux
2018-11-23 15:36 ` Andrew Lunn
2018-11-23 10:15 ` [PATCH 2/7] ata: ahci: mvebu: remove stale comment Miquel Raynal
2018-11-23 10:15 ` [PATCH 3/7] ata: ahci: mvebu: do Armada 38x configuration only on relevant SoCs Miquel Raynal
2018-11-23 10:15 ` [PATCH 4/7] ata: ahci: mvebu: add Armada 3700 initialization needed for S2RAM Miquel Raynal
2018-11-23 10:15 ` [PATCH 5/7] ata: ahci: mvebu: add clock support Miquel Raynal
2018-11-29 14:02 ` Miquel Raynal
2018-11-23 10:15 ` [PATCH 6/7] ARM64: dts: marvell: armada-37xx: declare SATA clock Miquel Raynal
2018-11-23 10:15 ` [PATCH 7/7] ARM64: dts: marvell: armada-3720-espressobin: declare SATA PHY property Miquel Raynal
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=20181130164016.7699efb3@xps13 \
--to=miquel.raynal@bootlin.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=hdegoede@redhat.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=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 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).