[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <41f43381-c1bb-2f69-5f99-ac5cebf651ea@redhat.com>
Date: Fri, 28 Oct 2016 20:15:53 +0200
From: Hans de Goede <hdegoede@...hat.com>
To: icenowy@...c.xyz, Kishon Vijay Abraham I <kishon@...com>,
Maxime Ripard <maxime.ripard@...e-electrons.com>,
Chen-Yu Tsai <wens@...e.org>
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-sunxi@...glegroups.com
Subject: Re: [PATCH v2] phy: sun4i: check PMU presence when poking unknown bit
of pmu
Hi,
On 28-10-16 18:27, 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.
>
> This patch will check whether the pmu is not NULL before poking.
>
> Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy)
>
> Signed-off-by: Icenowy Zheng <icenowy@...c.xyz>
> Acked-by: Maxime Ripard <maxime.ripard@...e-electrons.com>
Patch LGTM too:
Reviewed-by: Hans de Goede <hdegoede@...hat.com>
Regards,
Hans
> ---
> 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..fec34f5 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->pmu && data->cfg->enable_pmu_unk1) {
> val = readl(phy->pmu + REG_PMU_UNK1);
> writel(val & ~2, phy->pmu + REG_PMU_UNK1);
> }
>
Powered by blists - more mailing lists