Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757176AbcJXGxg (ORCPT ); Mon, 24 Oct 2016 02:53:36 -0400 Received: from megous.com ([83.167.254.221]:52282 "EHLO xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543AbcJXGxf (ORCPT ); Mon, 24 Oct 2016 02:53:35 -0400 X-Greylist: delayed 444 seconds by postgrey-1.27 at vger.kernel.org; Mon, 24 Oct 2016 02:53:34 EDT Subject: Re: [linux-sunxi] [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu To: icenowy@aosc.xyz, Kishon Vijay Abraham I , Maxime Ripard , Chen-Yu Tsai References: <20161024035930.20274-1-icenowy@aosc.xyz> Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com From: =?UTF-8?Q?Ond=c5=99ej_Jirman?= Message-ID: Date: Mon, 24 Oct 2016 08:45:55 +0200 MIME-Version: 1.0 In-Reply-To: <20161024035930.20274-1-icenowy@aosc.xyz> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="beUpnOanpDgQtwJBvU6AfnLSgvcnmhl65" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2997 Lines: 80 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --beUpnOanpDgQtwJBvU6AfnLSgvcnmhl65 Content-Type: multipart/mixed; boundary="OB9lIkdAE0L6bRt1iDJDtXIB5gVHvhtux"; protected-headers="v1" From: =?UTF-8?Q?Ond=c5=99ej_Jirman?= To: icenowy@aosc.xyz, Kishon Vijay Abraham I , Maxime Ripard , Chen-Yu Tsai Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com Message-ID: Subject: Re: [linux-sunxi] [PATCH 1/3] phy: sun4i: check PHY id when poking unknown bit of pmu References: <20161024035930.20274-1-icenowy@aosc.xyz> In-Reply-To: <20161024035930.20274-1-icenowy@aosc.xyz> --OB9lIkdAE0L6bRt1iDJDtXIB5gVHvhtux Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Fixes: b3e0d141ca9f (phy: sun4i: add support for A64 usb phy) >=20 > Signed-off-by: Icenowy Zheng > --- > drivers/phy/phy-sun4i-usb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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; > } > =20 > - if (data->cfg->enable_pmu_unk1) { > + if (phy->index !=3D 0 && data->cfg->enable_pmu_unk1) { It might be better to check for phy->pmu directly. regards, o. > val =3D readl(phy->pmu + REG_PMU_UNK1); > writel(val & ~2, phy->pmu + REG_PMU_UNK1); > } >=20 --OB9lIkdAE0L6bRt1iDJDtXIB5gVHvhtux-- --beUpnOanpDgQtwJBvU6AfnLSgvcnmhl65 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIpBAEBCAATBQJYDa4oDBxtZWdpQHhmZi5jegAKCRBuZCbGd8/v8Va2D/96d7F4 9A2tElv1cnjgn75jz7eKp8RvrpS3wkNUNxoxEqAJypkdceyaEM8bzKyDg+terr3S lPNw3pRYFpxQx/ZXM56JTkFEM+FYHSGlJSy81A6tDpyf8FJGZAxcnyj9b7Rmu27w kzQ+FGT8fEZyUs05vbkdcV8jkJP4Sz4Z3OaA0GVqhO2OdIqjdmNLryerXjHCUwQ2 IJiJT3LIO6igo4XHkKQM0ud6kEvDZEl7JVSv7/9Gun7LcIC4ES38pCcouq6YCVpz VE6412GBKiW1zp4aIjl2x8lvUGTeXjsA2eSOWULihoX95JiXF5leHVjkbg8/XYT2 LWIR41XsyFxJMeQ2kQgTbkF/jrygbwSJ6gsOL+cPA3ffdYy+iaSExQ6+A2C9OSyy 8gJSJxYivtiGUbDTf2fjm9xFkaNYfqawrLphgwelrwrf6tqRFqytMP7ordXMPjbv 5Z5YmK+vHPRgM+S735tvQetbJEbCMp+7aSzqwxlYkOrc1MEtip0ffqpsFNoZjkm5 N7rAgoBFvw9ylncBWogIip9bmMvBOXZig3F/JNSsXlooMDZat/nMuKfKY6byvWo6 wWQ0K5v4HgCzkkXmxfqmfvvU29HiS78IT7Qn2m9OWastOjNPPLnP6mvkxQhHne7V dSSZNDmCRws7HfNYI3W7hTIKriyYO1AYPmX85Q== =Ct3l -----END PGP SIGNATURE----- --beUpnOanpDgQtwJBvU6AfnLSgvcnmhl65--