Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1506943 > unrolled thread

Re: [linux-sunxi] [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu

Started byOndřej Jirman <megi@xff.cz>
First post2016-10-24 09:00 +0200
Last post2016-10-24 09:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [linux-sunxi] [PATCH 1/3] phy: sun4i: check PHY id when poking  unknown bit of pmu Ondřej Jirman <megi@xff.cz> - 2016-10-24 09:00 +0200

#1506943 — Re: [linux-sunxi] [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu

FromOndřej Jirman <megi@xff.cz>
Date2016-10-24 09:00 +0200
SubjectRe: [linux-sunxi] [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu
Message-ID<svHoK-40i-19@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

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);
>  	}
> 



[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web