* Re: [PATCH v2] phy: sun4i: check PMU presence when poking unknown bit of pmu
[not found] <20161028162701.4531-1-icenowy@aosc.xyz>
@ 2016-10-28 18:15 ` Hans de Goede
2016-11-05 5:48 ` Kishon Vijay Abraham I
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2016-10-28 18:15 UTC (permalink / raw)
To: icenowy, Kishon Vijay Abraham I, Maxime Ripard, Chen-Yu Tsai
Cc: linux-kernel, linux-arm-kernel, linux-sunxi
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@aosc.xyz>
> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Patch LGTM too:
Reviewed-by: Hans de Goede <hdegoede@redhat.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);
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] phy: sun4i: check PMU presence when poking unknown bit of pmu
2016-10-28 18:15 ` [PATCH v2] phy: sun4i: check PMU presence when poking unknown bit of pmu Hans de Goede
@ 2016-11-05 5:48 ` Kishon Vijay Abraham I
0 siblings, 0 replies; 2+ messages in thread
From: Kishon Vijay Abraham I @ 2016-11-05 5:48 UTC (permalink / raw)
To: Hans de Goede, icenowy, Maxime Ripard, Chen-Yu Tsai
Cc: linux-kernel, linux-arm-kernel, linux-sunxi
On Friday 28 October 2016 11:45 PM, Hans de Goede wrote:
> 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@aosc.xyz>
>> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>
> Patch LGTM too:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
merged, thanks.
-Kishon
>
> 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);
>> }
>>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-05 5:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20161028162701.4531-1-icenowy@aosc.xyz>
2016-10-28 18:15 ` [PATCH v2] phy: sun4i: check PMU presence when poking unknown bit of pmu Hans de Goede
2016-11-05 5:48 ` Kishon Vijay Abraham I
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).