Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3798272pxk; Tue, 22 Sep 2020 02:55:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxT3ZA2zQiiOpEm0wXLUXJItpDnvbkr5XeDbTNrCpT662JaZAcqWkwO566/Hx3mmfCmp/x X-Received: by 2002:a17:906:724b:: with SMTP id n11mr3992978ejk.328.1600768510888; Tue, 22 Sep 2020 02:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600768510; cv=none; d=google.com; s=arc-20160816; b=r2nogZnwLdzKeMkVHuNdUmLTMjjJaZgAFLzyWusikva1EOKrr5lBAKETC1TdDYk5Gu XaJG7m5ysIZE6NKnQwNo2tCZUrOt+1dWhHwIuQVoDpqU/V1IbMbPzC1wTf5S4Pg9u8ld ZCMLkeW7q/+cJ/JRoawIwe4Emm1yheOhmF/cJrgMCFvcU0U7lIyl582rzkeTyKnAKI9s 68TSqxfGWz8Xzl9JR27PXTOoFVr2fsqvEL38zTFRbEmeGblFUXm5AvqpZSmJApTpoBk2 WYoG9bVwo6WkCr2405TZcekWfUcKOmSCF/+xk9zwCDPiuGY61gIvNjS2IfAUFt7wblz6 /T6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=+i7aBMoF6jV+rGnPKiYKPNmoc8geU7C4VPgWDVerolU=; b=n6SdX4NozVRS+JF0l+bYrDsZ2j0G/DBTg0TiwBTChJ3Fi242pQw5YWEisseNpjKX7B fmpS6l+tgSuI0Rq8IhPRBsP2aSgE0VJn4Y0ULaMo2qc7bAxcl+5gCgbe0Eqjh75bGOaS waZg8R4FE3ZSZDmYWwoIpaEGosZnP+RGjl89fkbWJ+1FwXy/MS2SO7JFhJAqM4J0RR1U fJ3xl5MZUyDQR7IEC8aFHXcItRNNzjjbruP+biY35cusy+rTCOt0pHoMGnw4PT9iK0dq LfzrmrsqMxjvci8+t9eeF0OU8Sd0jzM/bz0Jj86lDL8/6OuSl8E77ey3iRCEHZNjyCaa P3aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LitoGsUW; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m23si9831091ejo.333.2020.09.22.02.54.45; Tue, 22 Sep 2020 02:55:10 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=LitoGsUW; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726539AbgIVJxs (ORCPT + 99 others); Tue, 22 Sep 2020 05:53:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbgIVJxr (ORCPT ); Tue, 22 Sep 2020 05:53:47 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 213D0C061755; Tue, 22 Sep 2020 02:53:47 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id c2so13574987ljj.12; Tue, 22 Sep 2020 02:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+i7aBMoF6jV+rGnPKiYKPNmoc8geU7C4VPgWDVerolU=; b=LitoGsUWcZ9QgkrF4+ZYNUL7eTogmiXT/i0lNCBMAROw0jOBbmza9EhQDack8OlEs8 CVK0uRy2bTFtmn1vXRFaD7flCqK5cbpBRmehnQOO0fa4pAYDt6AXhDuoOI4YQnUI5KSZ ZMpkYkjFJ45EnP47g1FEad6oH7K4OeW9SYMTbh/qBDX2YWywmFKhsWKmWFL9Qd4B6UB+ flxrHj0QQ2oPjSJyUyWKR14qB1BE+y0QH2NH+6S3go3hbFRtYz3cY6D8i8k1xNg12YnN HvMze7oFLcyExP+pG32JsyeI/l9C/Q1iNb7+Bt51XL32a6vVZLbuDcWLFr3t4laRvWSA Ig5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=+i7aBMoF6jV+rGnPKiYKPNmoc8geU7C4VPgWDVerolU=; b=dULkrwX+ZXHVfoPCaCKaMAD0BcM0Jnrnbf4qnEIbC8M+agy8ZkEGDBIbMa6zY9Q5lZ 44XVrJqnIoAne7QEuJY3Vi8cZ2w0pIqtSNmxD75w4ihEGtYQ/t7lKBp11IlV1ZGxhsQ/ wK+iCuUPW9URg0JaDVWgzzMFoAy7UvN9NGdLUwBOke9PClrhsxpj/ysQX9mlOvRlhHUf MCxpQnW24vpG8cKFc1VN8H04akv2pybbf7WKfH940pe4tO7vkhQPwFcUA5q1y2NOxhMR FfT+VvsOLiheQP6b0V4UhdTMd5KSgbHvWZ3pg/+zU03rCBmBnzco+FA5OUwoe7UMdUef dZmg== X-Gm-Message-State: AOAM530qxlbvHZBKj7Bfb9ZtI4f3w8wDqeQiad3P1GuSjsZhtUXZMXUC +ofqe58p02BpPCIvhioMTCd0j5kXZhHs+A== X-Received: by 2002:a2e:a202:: with SMTP id h2mr1348967ljm.282.1600768425408; Tue, 22 Sep 2020 02:53:45 -0700 (PDT) Received: from ?IPv6:2a00:1fa0:426e:8bbe:c99d:2ede:2a50:6604? ([2a00:1fa0:426e:8bbe:c99d:2ede:2a50:6604]) by smtp.gmail.com with ESMTPSA id r13sm3349330lfe.114.2020.09.22.02.53.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Sep 2020 02:53:44 -0700 (PDT) Subject: Re: [PATCH net] Revert "ravb: Fixed to be able to unload modules" To: Geert Uytterhoeven , "David S . Miller" , Jakub Kicinski , Yuusuke Ashizuka Cc: Andrew Lunn , Heiner Kallweit , Russell King , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20200922072931.2148-1-geert+renesas@glider.be> From: Sergei Shtylyov Organization: Brain-dead Software Message-ID: <32351a6c-07ea-2a5c-0edd-4ef92dc38002@gmail.com> Date: Tue, 22 Sep 2020 12:53:37 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200922072931.2148-1-geert+renesas@glider.be> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.09.2020 10:29, Geert Uytterhoeven wrote: > This reverts commit 1838d6c62f57836639bd3d83e7855e0ee4f6defc. > > This commit moved the ravb_mdio_init() call (and thus the > of_mdiobus_register() call) from the ravb_probe() to the ravb_open() > call. This causes a regression during system resume (s2idle/s2ram), as > new PHY devices cannot be bound while suspended. > > During boot, the Micrel PHY is detected like this: > > Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=228) > ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off > > During system suspend, (A) defer_all_probes is set to true, and (B) > usermodehelper_disabled is set to UMH_DISABLED, to avoid drivers being > probed while suspended. > > A. If CONFIG_MODULES=n, phy_device_register() calling device_add() > merely adds the device, but does not probe it yet, as > really_probe() returns early due to defer_all_probes being set: > > dpm_resume+0x128/0x4f8 > device_resume+0xcc/0x1b0 > dpm_run_callback+0x74/0x340 > ravb_resume+0x190/0x1b8 > ravb_open+0x84/0x770 > of_mdiobus_register+0x1e0/0x468 > of_mdiobus_register_phy+0x1b8/0x250 > of_mdiobus_phy_device_register+0x178/0x1e8 > phy_device_register+0x114/0x1b8 > device_add+0x3d4/0x798 > bus_probe_device+0x98/0xa0 > device_initial_probe+0x10/0x18 > __device_attach+0xe4/0x140 > bus_for_each_drv+0x64/0xc8 > __device_attach_driver+0xb8/0xe0 > driver_probe_device.part.11+0xc4/0xd8 > really_probe+0x32c/0x3b8 > > Later, phy_attach_direct() notices no PHY driver has been bound, > and falls back to the Generic PHY, leading to degraded operation: > > Generic PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=POLL) > ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off > > B. If CONFIG_MODULES=y, request_module() returns early with -EBUSY due > to UMH_DISABLED, and MDIO initialization fails completely: > > mdio_bus e6800000.ethernet-ffffffff:00: error -16 loading PHY driver module for ID 0x00221622 > ravb e6800000.ethernet eth0: failed to initialize MDIO > PM: dpm_run_callback(): ravb_resume+0x0/0x1b8 returns -16 > PM: Device e6800000.ethernet failed to resume: error -16 > > Ignoring -EBUSY in phy_request_driver_module(), like was done for > -ENOENT in commit 21e194425abd65b5 ("net: phy: fix issue with loading > PHY driver w/o initramfs"), would makes it fall back to the Generic > PHY, like in the CONFIG_MODULES=n case. > > Signed-off-by: Geert Uytterhoeven > Cc: stable@vger.kernel.org Reviewed-by: Sergei Shtylyov > --- > Commit 1838d6c62f578366 ("ravb: Fixed to be able to unload modules") was > already backported to stable v4.4, v4.9, v4.14, v4.19, v5.4, and v5.8), > and thus needs to be reverted there, too. Ugh! Sorry for not noticing the issue with the original patch... :-/ MBR, Sergei