* [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3
@ 2018-08-06 10:42 Wolfram Sang
2018-08-06 11:20 ` Geert Uytterhoeven
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-08-06 10:42 UTC (permalink / raw)
To: linux-ide
Cc: linux-renesas-soc, Yoshihiro Shimoda, Tejun Heo,
Masaharu Hayakawa, Wolfram Sang
From: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
According to documentation, setting of PHY registers is unnecessary with
R-Car Gen3. The registers are not even described. So, don't initialize
them.
Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
[wsa: updated commit message]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Tested with a Renesas R-Car M3N Salvator-XS board. I did a platform suspend to
check if the controller and PHY work properly after resume.
drivers/ata/sata_rcar.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 1ad168f76ef3..10ecb232245d 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -830,10 +830,11 @@ static void sata_rcar_init_controller(struct ata_host *host)
sata_rcar_gen1_phy_init(priv);
break;
case RCAR_GEN2_SATA:
- case RCAR_GEN3_SATA:
case RCAR_R8A7790_ES1_SATA:
sata_rcar_gen2_phy_init(priv);
break;
+ case RCAR_GEN3_SATA:
+ break;
default:
dev_warn(host->dev, "SATA phy is not initialized\n");
break;
@@ -995,7 +996,6 @@ static int sata_rcar_resume(struct device *dev)
return ret;
if (priv->type == RCAR_GEN3_SATA) {
- sata_rcar_gen2_phy_init(priv);
sata_rcar_init_module(priv);
} else {
/* ack and mask */
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3
2018-08-06 10:42 [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3 Wolfram Sang
@ 2018-08-06 11:20 ` Geert Uytterhoeven
2018-08-06 14:59 ` Wolfram Sang
2018-08-06 14:56 ` Sergei Shtylyov
2018-08-06 17:26 ` Tejun Heo
2 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2018-08-06 11:20 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-ide, Linux-Renesas, Yoshihiro Shimoda, Tejun Heo,
Masaharu Hayakawa
Hi Wolfram,
On Mon, Aug 6, 2018 at 12:43 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> From: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
>
> According to documentation, setting of PHY registers is unnecessary with
> R-Car Gen3. The registers are not even described. So, don't initialize
> them.
>
> Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
> [wsa: updated commit message]
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Thanks for your patch!
> Tested with a Renesas R-Car M3N Salvator-XS board. I did a platform suspend to
> check if the controller and PHY work properly after resume.
"platform suspend"? Is that s2ram aka a full PSCI system suspend?
I guess not, as it is supposed to fail without PCA9654 suspend/resume support...
So more information is needed to convince me ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3
2018-08-06 10:42 [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3 Wolfram Sang
2018-08-06 11:20 ` Geert Uytterhoeven
@ 2018-08-06 14:56 ` Sergei Shtylyov
2018-08-06 17:26 ` Tejun Heo
2 siblings, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2018-08-06 14:56 UTC (permalink / raw)
To: Wolfram Sang, linux-ide
Cc: linux-renesas-soc, Yoshihiro Shimoda, Tejun Heo, Masaharu Hayakawa
On 08/06/2018 01:42 PM, Wolfram Sang wrote:
> From: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
>
> According to documentation, setting of PHY registers is unnecessary with
> R-Car Gen3. The registers are not even described. So, don't initialize
> them.
>
> Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
> [wsa: updated commit message]
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[...]
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
MBR, Sergei
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3
2018-08-06 11:20 ` Geert Uytterhoeven
@ 2018-08-06 14:59 ` Wolfram Sang
2018-08-06 15:10 ` Geert Uytterhoeven
0 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2018-08-06 14:59 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Wolfram Sang, linux-ide, Linux-Renesas, Yoshihiro Shimoda,
Tejun Heo, Masaharu Hayakawa
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
> "platform suspend"? Is that s2ram aka a full PSCI system suspend?
It is this:
echo platform > /sys/power/pm_test
echo mem > /sys/power/state
Is there a better name for it?
The HDD was also spinning down/up during the cycle...
> I guess not, as it is supposed to fail without PCA9654 suspend/resume support...
Yeah, I was wondering about that last time, too.
> So more information is needed to convince me ;-)
Here they are :)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3
2018-08-06 14:59 ` Wolfram Sang
@ 2018-08-06 15:10 ` Geert Uytterhoeven
2018-08-06 17:04 ` Wolfram Sang
0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2018-08-06 15:10 UTC (permalink / raw)
To: Wolfram Sang
Cc: Wolfram Sang, linux-ide, Linux-Renesas, Yoshihiro Shimoda,
Tejun Heo, Masaharu Hayakawa
Hi Wolfram,
On Mon, Aug 6, 2018 at 5:00 PM Wolfram Sang <wsa@the-dreams.de> wrote:
> > "platform suspend"? Is that s2ram aka a full PSCI system suspend?
>
> It is this:
>
> echo platform > /sys/power/pm_test
> echo mem > /sys/power/state
Thanks!
> Is there a better name for it?
I don't know. It never gets to the actual system suspend step.
> The HDD was also spinning down/up during the cycle...
>
> > I guess not, as it is supposed to fail without PCA9654 suspend/resume support...
>
> Yeah, I was wondering about that last time, too.
>
> > So more information is needed to convince me ;-)
>
> Here they are :)
With "platform", it doesn't do the full cycle.
Please try without that step, or do "echo none > /sys/power/pm_test".
Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3
2018-08-06 15:10 ` Geert Uytterhoeven
@ 2018-08-06 17:04 ` Wolfram Sang
2018-08-06 18:37 ` Geert Uytterhoeven
0 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2018-08-06 17:04 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Wolfram Sang, linux-ide, Linux-Renesas, Yoshihiro Shimoda,
Tejun Heo, Masaharu Hayakawa
[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]
Hi Geert,
> Please try without that step, or do "echo none > /sys/power/pm_test".
Did this now with a q'n'd hacked gpio driver (see below). Worked like a
charm. So, the sata_rcar patch under discussion here seems to be fine.
We only need the GPIO resume on specific boards. This is a seperate
task. D'accord?
Thanks,
Wolfram
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 023a32cfac42..17ab27ca0187 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -914,6 +914,7 @@ static int pca953x_probe(struct i2c_client *client,
dev_warn(&client->dev, "setup failed, %d\n", ret);
}
+ dev_set_drvdata(&client->dev, chip);
i2c_set_clientdata(client, chip);
return 0;
@@ -986,11 +987,27 @@ static const struct of_device_id pca953x_dt_ids[] = {
MODULE_DEVICE_TABLE(of, pca953x_dt_ids);
+static int pca953x_resume(struct device *dev)
+{
+ struct pca953x_chip *chip = dev_get_drvdata(dev);
+
+ pca953x_write_regs(chip, chip->regs->output, chip->reg_output);
+
+ pca953x_write_regs(chip, chip->regs->direction,
+ chip->reg_direction);
+ return 0;
+}
+
+static const struct dev_pm_ops pca953x_dev_pm_ops = {
+ .resume = pca953x_resume,
+};
+
static struct i2c_driver pca953x_driver = {
.driver = {
.name = "pca953x",
.of_match_table = pca953x_dt_ids,
.acpi_match_table = ACPI_PTR(pca953x_acpi_ids),
+ .pm = &pca953x_dev_pm_ops,
},
.probe = pca953x_probe,
.remove = pca953x_remove,
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3
2018-08-06 10:42 [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3 Wolfram Sang
2018-08-06 11:20 ` Geert Uytterhoeven
2018-08-06 14:56 ` Sergei Shtylyov
@ 2018-08-06 17:26 ` Tejun Heo
2 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2018-08-06 17:26 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-ide, linux-renesas-soc, Yoshihiro Shimoda, Masaharu Hayakawa
On Mon, Aug 06, 2018 at 12:42:00PM +0200, Wolfram Sang wrote:
> From: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
>
> According to documentation, setting of PHY registers is unnecessary with
> R-Car Gen3. The registers are not even described. So, don't initialize
> them.
>
> Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
> [wsa: updated commit message]
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Applied to libata/for-4.19.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3
2018-08-06 17:04 ` Wolfram Sang
@ 2018-08-06 18:37 ` Geert Uytterhoeven
0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2018-08-06 18:37 UTC (permalink / raw)
To: Wolfram Sang
Cc: Wolfram Sang, linux-ide, Linux-Renesas, Yoshihiro Shimoda,
Tejun Heo, Masaharu Hayakawa
Hi Wolfram,
On Mon, Aug 6, 2018 at 7:04 PM Wolfram Sang <wsa@the-dreams.de> wrote:
> > Please try without that step, or do "echo none > /sys/power/pm_test".
>
> Did this now with a q'n'd hacked gpio driver (see below). Worked like a
> charm. So, the sata_rcar patch under discussion here seems to be fine.
> We only need the GPIO resume on specific boards. This is a seperate
> task. D'accord?
Thanks for testing!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-08-06 20:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-06 10:42 [PATCH] ata: sata_rcar: exclude setting of PHY registers in Gen3 Wolfram Sang
2018-08-06 11:20 ` Geert Uytterhoeven
2018-08-06 14:59 ` Wolfram Sang
2018-08-06 15:10 ` Geert Uytterhoeven
2018-08-06 17:04 ` Wolfram Sang
2018-08-06 18:37 ` Geert Uytterhoeven
2018-08-06 14:56 ` Sergei Shtylyov
2018-08-06 17:26 ` Tejun Heo
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.