Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14024599pxu; Mon, 4 Jan 2021 10:45:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmIZvJSXClf7ukCz0lelurMmMOV/KcRHKvjF9MkwRWQAWfV45clzPGRjOzWnVJC8hOneZP X-Received: by 2002:a17:906:27d1:: with SMTP id k17mr69393877ejc.325.1609785957195; Mon, 04 Jan 2021 10:45:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1609785957; cv=pass; d=google.com; s=arc-20160816; b=Yv8uBF+NVyUnI8sXsIsfd+ZDIhbpJFXab7g7DAIYAO+KGnVEcF7FEa/wr0Ty7sVVvk iTIlATHaEjwwsdIeA5tC8LVgIjAZY+nQPyhHLfAIm+a007U4+WTn4UGomh4sttWpXSvi Cd/QHrhhWRReLlGf3/A/B24uURT1uabcbXNMcG3q+dlWAaC0w4TUU/TQ4C54xUF1Y8Io h67yOIadJ/7UuHPGc0HXb7vre9GI1SFwcn/OvVwELoHNHCE3aL0PYdsbidUyLZBHXJ2J 2ywkPPVaRX/3mKIjlNX/becwL+xCw7p66+8CyIs8dbVFmVbvxMMWw/erzIvnsoLXpS4D R24A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=gPfPGelOzeJZ1ikfXRGszzi9HrAfG3xWHT2CB0ROoyA=; b=fb9ZxQ7aT5B4wD63m3joYCfb4+dL9GOfl/2oCg20elNmv5Y3FTvgm5V5cAtKLJw+LJ xDLDrtdrC3zC+KMJ3UU1H9D5B8Y/gRHzlVhmpzZzkj/z94k1UB6iGdnXtJPSwxy6+7+I RP4IxIeLUuXBNVOSh6zuxlULwmqc7gP8c2RGOVkU1iRYkzZJ8KOAl4ghdlAkv5XjrVKt oT0ZeZ5xo0sr38d3v1edkWiServLKT/2GSxhvkqFcKHqGuv7aqTiaGyuqiB5h/pyV1/f PRNAMRWhjKETsJ78NOuu119maHgHvpKVoVZRdxFM+zCz5UvVMUKYCmQk16kuIZIK5yhH mdRw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=LzwyifsQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j20si21166310ejt.403.2021.01.04.10.45.34; Mon, 04 Jan 2021 10:45:57 -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=pass header.i=@nxp.com header.s=selector2 header.b=LzwyifsQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727845AbhADSoc (ORCPT + 99 others); Mon, 4 Jan 2021 13:44:32 -0500 Received: from mail-vi1eur05on2081.outbound.protection.outlook.com ([40.107.21.81]:51554 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726329AbhADSob (ORCPT ); Mon, 4 Jan 2021 13:44:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QTMbX6TpIFULnzv/CEaEsk+q+E7l7f26T3I8oqDmUjlGMV1N88DXjFTLLvz6IWUDFJDmn029FNSmn5R+Vvc13d7Mh4GqUGbMzjLAAZE8R4ZAvi2TGmHu97TwtgLR4D1HcqZzWq/JgbIrBdLq/qAkL5kRLkw+O8xtkRJb/U0vjjD2SukSKKF655CVoECwioBAnuRYmtWHIJWjL7DfDUqZR56bezK7hPtzmem+Cu6FSkUlrpzsJ0xRXaUCwkZ6yN7e/7xm4/12LFtJ1RQxBC8K5sp3QsoOQg7A+w5RTF0cc2hTAUwwThEWXSzfNtwdIuZQ+uWgkrWxVaJ9/OEjbblKeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gPfPGelOzeJZ1ikfXRGszzi9HrAfG3xWHT2CB0ROoyA=; b=YWE3CEO/uaGycSSH75Y9HZExg173g220VBTQ6u7I5XfDzTyPfjiA6GDzizMvlZMiD8c9IhPLYNChGKHt9oUX6pyVSF0ga2OjV9oMmyssYo472aC/TSxxM3BupEWTDK2xVlP+pBDAcM5hbYSBSkMN6bQTAG4COBayfjf/wzcKbFs9SifT4sHa2DyWVxq6qmJgv7gyHyq6cUVfeVXrLIFBw3105S7GgYJIvjV2QMgiay+e5Rxcg2Iqu8m448/tiLoDHkwWegKGpZ8U/ENM/g/bCzAs82Z0Dj4Ae9tUPDXYg9Ld5DE4Yl9enmaI5o27BEKs/bDXU+YfVQ9uewWoxujW5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gPfPGelOzeJZ1ikfXRGszzi9HrAfG3xWHT2CB0ROoyA=; b=LzwyifsQemZq70Hfpih5GVn5Mr0Jyato275TLJT/J89+QOi5+Qiehrkih0JCOKFtIFjueb5Xs99+hNInaldtJ2A5XOITdI23QvrvZ1uHwXtD3W6BxiDeT44RGqe1rrc9WfXI1gQayJrUDQJoFTL71YO0e9Z3rH6OUcQrsImig6w= Received: from VI1PR0402MB3871.eurprd04.prod.outlook.com (2603:10a6:803:16::14) by VI1PR0402MB3469.eurprd04.prod.outlook.com (2603:10a6:803:d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.23; Mon, 4 Jan 2021 18:43:43 +0000 Received: from VI1PR0402MB3871.eurprd04.prod.outlook.com ([fe80::818e:8d79:99a9:188f]) by VI1PR0402MB3871.eurprd04.prod.outlook.com ([fe80::818e:8d79:99a9:188f%6]) with mapi id 15.20.3721.024; Mon, 4 Jan 2021 18:43:43 +0000 From: Ioana Ciornei To: Andrew Lunn CC: Geert Uytterhoeven , Heiner Kallweit , "David S . Miller" , Jakub Kicinski , Russell King , Wolfram Sang , "netdev@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] [RFC] net: phy: Fix reboot crash if CONFIG_IP_PNP is not set Thread-Topic: [PATCH] [RFC] net: phy: Fix reboot crash if CONFIG_IP_PNP is not set Thread-Index: AQHW4pSHwxyh2hM/e0O6/3UMlPC3maoXjZOAgAAE5QCAAB7HAIAABB2AgAAEPYCAABRIgA== Date: Mon, 4 Jan 2021 18:43:42 +0000 Message-ID: <20210104184341.szvnl24wnfnxg4k7@skbuf> References: <20210104122415.1263541-1-geert+renesas@glider.be> <20210104145331.tlwjwbzey5i4vgvp@skbuf> <20210104170112.hn6t3kojhifyuaf6@skbuf> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lunn.ch; dkim=none (message not signed) header.d=none;lunn.ch; dmarc=none action=none header.from=nxp.com; x-originating-ip: [5.12.227.87] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: eb924217-bc28-4f29-4830-08d8b0e0a92f x-ms-traffictypediagnostic: VI1PR0402MB3469: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0GYfRb4/s+XHIUuq4aJ82np3KZmmcn73XFy1N/jeL6NYhDhSM1YtXWlCh+I562SRqxh+xe6fd0Txfa/9qk7exmoAMYEb3IZzUklz95G1bOVp71bb8jNvtMKE9Oh3dh+VLNmDue3Wi7ER4qtdEtkxWp7y8OC7p+Fd1DbXpVNTh4wNb1igOdHUUUkPfuwlOI292A2atqCagxkcMzfT8WcHycCoPj6rQn2dOQH+pgCAPT2MEHHRA3AHasdqip87+daUprOYmvMwPFXAJ7WGIr5bRy0JXiInS4HLG1YgbIHRwY2ABtZEG7iZru/H7LU4AIEeXypHMX17sxXp8GKXJ5+32j0USsSImAdNnYE78G8PvpWEm4dKVeUMOn/5XbVAew9r8AHgXy7P3jGDZPrNV7RqfA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR0402MB3871.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(7916004)(4636009)(366004)(136003)(376002)(346002)(39860400002)(396003)(186003)(33716001)(1076003)(5660300002)(478600001)(83380400001)(8676002)(66476007)(66446008)(66946007)(64756008)(8936002)(76116006)(54906003)(316002)(86362001)(6512007)(6916009)(6506007)(9686003)(91956017)(2906002)(44832011)(71200400001)(4326008)(26005)(7416002)(66556008)(6486002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?bvF2CkVEw99DeqFeAeFzsFDUc+W6QdjfGrWRlR1unPttXg02NrecKGH4vXw3?= =?us-ascii?Q?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E5GpBHmT5Dlhv?= =?us-ascii?Q?Jzz6T6iHcIhNM+ZBtcvdqVEt81AM0VrX3OxJG1sTPD1HYll1hbdWt+HGOcp7?= =?us-ascii?Q?bhfi?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: <35D2D4A914A4AF4BAE9FA5DA1262AB1C@eurprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3871.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb924217-bc28-4f29-4830-08d8b0e0a92f X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2021 18:43:42.9436 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 66BSPE4PdIMSUZSuYJ7uH+mdZ3crZd1gxIojkWVfiRwd6mAG/OTmYLHYqBVS7mWX2Ej+Ac1ne/M0dNXIjdyB4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3469 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2021 at 06:31:05PM +0100, Andrew Lunn wrote: > > The basic rules here should be, if the MDIO bus is registered, it is > > usable. There are things like PHY statistics, HWMON temperature > > sensors, etc, DSA switches, all which have a life cycle separate to > > the interface being up. >=20 > [Goes and looks at the code] >=20 > Yes, this is runtime PM which is broken. >=20 > sh_mdio_init() needs to wrap the mdp->mii_bus->read and > mdp->mii_bus->write calls with calls to >=20 > pm_runtime_get_sync(&mdp->pdev->dev); >=20 > and >=20 > pm_runtime_put_sync(&mdp->pdev->dev); >=20 Agree. Thanks for actually looking into it.. I'm not really well versed in runtime PM. > The KSZ8041RNLI supports statistics, which ethtool --phy-stats can > read, and these will also going to cause problems. >=20 Not really, this driver connects to the PHY on .ndo_open(), thus any try to actually dump the PHY statistics before an ifconfig up would get an -EOPNOTSUPP since the dev->phydev is not yet populated. This is exactly why I do not understand why some drivers insist on calling of_phy_connect() and its variants on .ndo_open() and not while probing the device - you can access the debug stats only if the interface was started.=