All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
@ 2016-10-24  3:59 Icenowy Zheng
  2016-10-24  6:45   ` Ondřej Jirman
  2016-10-24  8:28   ` Maxime Ripard
  0 siblings, 2 replies; 8+ messages in thread
From: Icenowy Zheng @ 2016-10-24  3:59 UTC (permalink / raw)
  To: linux-arm-kernel

Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
The code that poke some unknown bit of PMU for H3/A64 didn't check
the PHY, and will cause kernel oops when PHY 0 is used.

Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
---
 drivers/phy/phy-sun4i-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index b9342a2..ff8e9dd 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -264,7 +264,7 @@ static int sun4i_usb_phy_init(struct phy *_phy)
 		return ret;
 	}
 
-	if (data->cfg->enable_pmu_unk1) {
+	if (phy->index != 0 && data->cfg->enable_pmu_unk1) {
 		val = readl(phy->pmu + REG_PMU_UNK1);
 		writel(val & ~2, phy->pmu + REG_PMU_UNK1);
 	}
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [linux-sunxi] [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
  2016-10-24  3:59 [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu Icenowy Zheng
@ 2016-10-24  6:45   ` Ondřej Jirman
  2016-10-24  8:28   ` Maxime Ripard
  1 sibling, 0 replies; 8+ messages in thread
From: Ondřej Jirman @ 2016-10-24  6:45 UTC (permalink / raw)
  To: icenowy, Kishon Vijay Abraham I, Maxime Ripard, Chen-Yu Tsai
  Cc: linux-kernel, linux-arm-kernel, linux-sunxi


[-- Attachment #1.1: Type: text/plain, Size: 1036 bytes --]

Dne 24.10.2016 v 05:59 Icenowy Zheng napsal(a):
> Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
> The code that poke some unknown bit of PMU for H3/A64 didn't check
> the PHY, and will cause kernel oops when PHY 0 is used.
> 
> Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> ---
>  drivers/phy/phy-sun4i-usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
> index b9342a2..ff8e9dd 100644
> --- a/drivers/phy/phy-sun4i-usb.c
> +++ b/drivers/phy/phy-sun4i-usb.c
> @@ -264,7 +264,7 @@ static int sun4i_usb_phy_init(struct phy *_phy)
>  		return ret;
>  	}
>  
> -	if (data->cfg->enable_pmu_unk1) {
> +	if (phy->index != 0 && data->cfg->enable_pmu_unk1) {

It might be better to check for phy->pmu directly.

regards,
  o.
>  		val = readl(phy->pmu + REG_PMU_UNK1);
>  		writel(val & ~2, phy->pmu + REG_PMU_UNK1);
>  	}
> 




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 821 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [linux-sunxi] [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
@ 2016-10-24  6:45   ` Ondřej Jirman
  0 siblings, 0 replies; 8+ messages in thread
From: Ondřej Jirman @ 2016-10-24  6:45 UTC (permalink / raw)
  To: linux-arm-kernel

Dne 24.10.2016 v 05:59 Icenowy Zheng napsal(a):
> Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
> The code that poke some unknown bit of PMU for H3/A64 didn't check
> the PHY, and will cause kernel oops when PHY 0 is used.
> 
> Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> ---
>  drivers/phy/phy-sun4i-usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
> index b9342a2..ff8e9dd 100644
> --- a/drivers/phy/phy-sun4i-usb.c
> +++ b/drivers/phy/phy-sun4i-usb.c
> @@ -264,7 +264,7 @@ static int sun4i_usb_phy_init(struct phy *_phy)
>  		return ret;
>  	}
>  
> -	if (data->cfg->enable_pmu_unk1) {
> +	if (phy->index != 0 && data->cfg->enable_pmu_unk1) {

It might be better to check for phy->pmu directly.

regards,
  o.
>  		val = readl(phy->pmu + REG_PMU_UNK1);
>  		writel(val & ~2, phy->pmu + REG_PMU_UNK1);
>  	}
> 



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 821 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161024/d6dd79ef/attachment.sig>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
  2016-10-24  3:59 [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu Icenowy Zheng
@ 2016-10-24  8:28   ` Maxime Ripard
  2016-10-24  8:28   ` Maxime Ripard
  1 sibling, 0 replies; 8+ messages in thread
From: Maxime Ripard @ 2016-10-24  8:28 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Kishon Vijay Abraham I, Chen-Yu Tsai, linux-kernel,
	linux-arm-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

On Mon, Oct 24, 2016 at 11:59:30AM +0800, Icenowy Zheng wrote:
> Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
> The code that poke some unknown bit of PMU for H3/A64 didn't check
> the PHY, and will cause kernel oops when PHY 0 is used.
> 
> Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>

Cc'ing stable would be nice.

Apart from that, Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
@ 2016-10-24  8:28   ` Maxime Ripard
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Ripard @ 2016-10-24  8:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 24, 2016 at 11:59:30AM +0800, Icenowy Zheng wrote:
> Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
> The code that poke some unknown bit of PMU for H3/A64 didn't check
> the PHY, and will cause kernel oops when PHY 0 is used.
> 
> Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>

Cc'ing stable would be nice.

Apart from that, Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161024/a0929938/attachment.sig>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
  2016-10-24  8:28   ` Maxime Ripard
  (?)
@ 2016-10-25  3:32   ` Icenowy Zheng
  2016-10-25 10:43       ` Maxime Ripard
  -1 siblings, 1 reply; 8+ messages in thread
From: Icenowy Zheng @ 2016-10-25  3:32 UTC (permalink / raw)
  To: linux-arm-kernel



> On Mon, Oct 24, 2016 at 11:59:30AM +0800, Icenowy Zheng wrote:
> 
>> Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
>> The code that poke some unknown bit of PMU for H3/A64 didn't check
>> the PHY, and will cause kernel oops when PHY 0 is used.
>>
>> Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)
>>
>> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> 
> Cc'ing stable would be nice.

Yes... As it's also used by H3...

> 
> Apart from that, Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

If I change it to check whether phy->pmu is null, will you keep the ACK?

> 
> Thanks!
> Maxime
> 
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
  2016-10-25  3:32   ` Icenowy Zheng
@ 2016-10-25 10:43       ` Maxime Ripard
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Ripard @ 2016-10-25 10:43 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Kishon Vijay Abraham I, Chen-Yu Tsai, linux-kernel,
	linux-arm-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

Hi,

On Tue, Oct 25, 2016 at 11:32:44AM +0800, Icenowy Zheng wrote:
> 
> 
> > On Mon, Oct 24, 2016 at 11:59:30AM +0800, Icenowy Zheng wrote:
> > 
> >> Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
> >> The code that poke some unknown bit of PMU for H3/A64 didn't check
> >> the PHY, and will cause kernel oops when PHY 0 is used.
> >>
> >> Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)
> >>
> >> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> > 
> > Cc'ing stable would be nice.
> 
> Yes... As it's also used by H3...
> 
> > 
> > Apart from that, Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> 
> If I change it to check whether phy->pmu is null, will you keep the ACK?

Yep, thanks!

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
@ 2016-10-25 10:43       ` Maxime Ripard
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Ripard @ 2016-10-25 10:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Tue, Oct 25, 2016 at 11:32:44AM +0800, Icenowy Zheng wrote:
> 
> 
> > On Mon, Oct 24, 2016 at 11:59:30AM +0800, Icenowy Zheng wrote:
> > 
> >> Allwinner SoC's PHY 0, when used as OTG controller, have no pmu part.
> >> The code that poke some unknown bit of PMU for H3/A64 didn't check
> >> the PHY, and will cause kernel oops when PHY 0 is used.
> >>
> >> Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)
> >>
> >> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> > 
> > Cc'ing stable would be nice.
> 
> Yes... As it's also used by H3...
> 
> > 
> > Apart from that, Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> 
> If I change it to check whether phy->pmu is null, will you keep the ACK?

Yep, thanks!

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161025/09742e34/attachment.sig>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-26 22:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24  3:59 [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu Icenowy Zheng
2016-10-24  6:45 ` [linux-sunxi] " Ondřej Jirman
2016-10-24  6:45   ` Ondřej Jirman
2016-10-24  8:28 ` Maxime Ripard
2016-10-24  8:28   ` Maxime Ripard
2016-10-25  3:32   ` Icenowy Zheng
2016-10-25 10:43     ` Maxime Ripard
2016-10-25 10:43       ` Maxime Ripard

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.