Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2243333pxb; Mon, 18 Jan 2021 12:06:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJw94QujSAqUNPfYfuo2VW/KR7TGJiUyiOzqiYJf+ALKjmJwBRw3C2jrKv07LBJQuA+GT20e X-Received: by 2002:a17:906:36da:: with SMTP id b26mr849810ejc.28.1611000405127; Mon, 18 Jan 2021 12:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611000405; cv=none; d=google.com; s=arc-20160816; b=wu7RhBdFOaGS+on+YvHS9FQsDymg2Si/HsCBMasmTLziz5bbr4JmblJEaF6lyCPPrg aS+yf3xX1VjiwZQMwE4+8mec7GREVC/H8pprjp1laZGpZdaWrO9tPi4AwagF139VerMf i+bYvkSQ+6GCIczzfTMRjzXQr2jYcXjVy4u2oJfeet8xwyp/nMu0uNBkrRgRZgp79JOb hshoVgpRUZwR/VLKu/4C9rAcg71odAz3W+LfYE/TtX3eQQRR48FvTj458/j25w3hGv7p l+7jcGt+6lQYfuMPthxDLwdU2+W31lCIGnz7Br1zhXckDBrAyHlRetw5LJMyTZDe3htn wtbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g5yLGdvcgNvZA5pL+XmpLfs3rwxINb6QeGPV+nBnm7o=; b=SysANYLYJn2cMX26ZB+9vH2A4Ha/0ihr5b0uGJP2QDiT8mv1FvU4pEuFV+ngMqF7j0 JM7Lw6c1SXroSUK4QmnrZM+5hK5v4mJg2rnOmdjAPK1wwnqbNWFk1j3HToQjEvyH6McY s4YrQ6VeH+tNVk/Liq/KESPCxIYtfCtzRmAFfBJz+1W6vGW6lUCiD1A3ZlMoJF9sP8aD O8+9GKIrb5DHnklH96LlAmwKZYE7lBMfsfDbPOtr1zmah89pXaf+e/OIzGvRqwXmZl5E 1L3sEI8ogq9+iuOZGe0E7aMCUE41+FdQpnP1NQd5CrgT4Spn2Cf6dZAg2bdgM6PMszRv zfTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=Rtn9M8+N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k23si984089ejo.402.2021.01.18.12.06.15; Mon, 18 Jan 2021 12:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=Rtn9M8+N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437883AbhARUCQ (ORCPT + 99 others); Mon, 18 Jan 2021 15:02:16 -0500 Received: from www.zeus03.de ([194.117.254.33]:58760 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437705AbhART7U (ORCPT ); Mon, 18 Jan 2021 14:59:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=k1; bh=MlSaK6Ui06f/EDER6E9Oq6CxLQur WoAScEmV6KaaYek=; b=Rtn9M8+NkVXK811BrWD2In+E3sqdwPOYWWIYtFwIEqhc 358kjkItswWvWl9w1a3wbjoPIiQ5SHRGVgcq+KN2D2wLSRsxJeT2bZAnw2mTtteg Nj8ogbYrOCaLY+Z6v8XRG5jJ344fyoQJn74ZYcDQfwaudpicYduMVyvCY3WhFTc= Received: (qmail 828814 invoked from network); 18 Jan 2021 20:58:37 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Jan 2021 20:58:37 +0100 X-UD-Smtp-Session: l3s3148p1@eVTIJTK5BokgAwDPXwacAOByz8F9Mgm1 Date: Mon, 18 Jan 2021 20:58:35 +0100 From: Wolfram Sang To: Geert Uytterhoeven Cc: Sergei Shtylyov , "David S . Miller" , Jakub Kicinski , Andrew Lunn , Heiner Kallweit , Florian Fainelli , Russell King , Ioana Ciornei , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net v2 2/2] sh_eth: Make PHY access aware of Runtime PM to fix reboot crash Message-ID: <20210118195835.GB112457@ninjato> References: <20210118150656.796584-1-geert+renesas@glider.be> <20210118150656.796584-3-geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="UHN/qo2QbUvPLonB" Content-Disposition: inline In-Reply-To: <20210118150656.796584-3-geert+renesas@glider.be> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 18, 2021 at 04:06:56PM +0100, Geert Uytterhoeven wrote: > Wolfram reports that his R-Car H2-based Lager board can no longer be > rebooted in v5.11-rc1, as it crashes with an imprecise external abort. > The issue can be reproduced on other boards (e.g. Koelsch with R-Car > M2-W) too, if CONFIG_IP_PNP is disabled, and the Ethernet interface is > down at reboot time: >=20 > Unhandled fault: imprecise external abort (0x1406) at 0x00000000 > pgd =3D (ptrval) > [00000000] *pgd=3D422b6835, *pte=3D00000000, *ppte=3D00000000 > Internal error: : 1406 [#1] ARM > Modules linked in: > CPU: 0 PID: 1105 Comm: init Tainted: G W 5.10.0-rc1-00= 402-ge2f016cf7751 #1048 > Hardware name: Generic R-Car Gen2 (Flattened Device Tree) > PC is at sh_mdio_ctrl+0x44/0x60 > LR is at sh_mmd_ctrl+0x20/0x24 > ... > Backtrace: > [] (sh_mdio_ctrl) from [] (sh_mmd_ctrl+0x20/0x24) > r7:0000001f r6:00000020 r5:00000002 r4:c22a1dc4 > [] (sh_mmd_ctrl) from [] (mdiobb_cmd+0x38/0xa8) > [] (mdiobb_cmd) from [] (mdiobb_read+0x58/0xdc) > r9:c229f844 r8:c0c329dc r7:c221e000 r6:00000001 r5:c22a1dc4 r4:00000= 001 > [] (mdiobb_read) from [] (__mdiobus_read+0x74/0xe= 0) > r7:0000001f r6:00000001 r5:c221e000 r4:c221e000 > [] (__mdiobus_read) from [] (mdiobus_read+0x40/0x= 54) > r7:0000001f r6:00000001 r5:c221e000 r4:c221e458 > [] (mdiobus_read) from [] (phy_read+0x1c/0x20) > r7:ffffe000 r6:c221e470 r5:00000200 r4:c229f800 > [] (phy_read) from [] (kszphy_config_intr+0x44/0x= 80) > [] (kszphy_config_intr) from [] (phy_disable_inte= rrupts+0x44/0x50) > r5:c229f800 r4:c229f800 > [] (phy_disable_interrupts) from [] (phy_shutdown= +0x18/0x1c) > r5:c229f800 r4:c229f804 > [] (phy_shutdown) from [] (device_shutdown+0x168/= 0x1f8) > [] (device_shutdown) from [] (kernel_restart_prep= are+0x3c/0x48) > r9:c22d2000 r8:c0100264 r7:c0b0d034 r6:00000000 r5:4321fedc r4:00000= 000 > [] (kernel_restart_prepare) from [] (kernel_resta= rt+0x1c/0x60) > [] (kernel_restart) from [] (__do_sys_reboot+0x16= 8/0x208) > r5:4321fedc r4:01234567 > [] (__do_sys_reboot) from [] (sys_reboot+0x18/0x1= c) > r7:00000058 r6:00000000 r5:00000000 r4:00000000 > [] (sys_reboot) from [] (ret_fast_syscall+0x0/0x5= 4) >=20 > As of commit e2f016cf775129c0 ("net: phy: add a shutdown procedure"), > system reboot calls phy_disable_interrupts() during shutdown. As this > happens unconditionally, the PHY registers may be accessed while the > device is suspended, causing undefined behavior, which may crash the > system. >=20 > Fix this by wrapping the PHY bitbang accessors in the sh_eth driver by > wrappers that take care of Runtime PM, to resume the device when needed. >=20 > Reported-by: Wolfram Sang > Suggested-by: Andrew Lunn > Signed-off-by: Geert Uytterhoeven Tested-by: Wolfram Sang Thanks for debugging and fixing this, Geert! --UHN/qo2QbUvPLonB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmAF6GsACgkQFA3kzBSg KbbEVg/8CbHfWKcP2AUfaglUNA6335SvezgMyjIKuCOGrTN/7AsQVt69NxB8o24x Ja2xyRmYvRx/mj/APFIiM7BO5LJLocsYAZNzA5zci01oNE5vgs0X9y9uz2Uousnz B61OGakN5ZpN64qEeWaV7uDwnvwEX3u5PaV/HB/3pTua3hT3ezUXALyFb07O1elT uzTRePSnS2YEDznIRYdHIwHcbjZHJEoaNb/ZCqv9CuWQK2OvOfC3zK0hYHOiOUaM 31xNyDTG1GAooAJVjaPmQc9jLRuC9Ck6pe8QVzMPCpx5Jug6cl4ZpwqjQlQrVZHj XjhBPrTz9q7gaem+Nkos0ph2cEUjDQj7Ajxh7zJLJA0t2PtXBzuRomwQX0B8h6Bt wLw/rRaggwTsFJrrUOAVvI3VQaFYdnjleS4DrSkFl0Qu1H6CsJLvRYDFMXxHWTy0 HWZH716fnSN6j3h1wek1m9voS3AggT/L5/teypI9gBEM0G9dqP8Z7/P3p+MfGtNM 3HHCK7tZuVrbogkvAusBS6Ug3PoVwtH7lvn+dRTzaz9CebbCJyFoWiMp2PHur5gJ Ca2K6UpEXjf/NepGXeZViEcKj6s9Tueyqdp8H2nyetzZA6fs5sRitw4pjgp+lrbP zgNQysu0vbXA2/4SqUKxTpmDj5V4BWU+ReHubbN/2wwVub9r7wc= =4qx2 -----END PGP SIGNATURE----- --UHN/qo2QbUvPLonB--