Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1110252pxb; Fri, 22 Jan 2021 07:24:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJznjJimE/cOde/VR7zFPXZ6RE/G1YWE+wij1WM99tG6HFZn5i3OAF4g0m6KJNs/tP1J/Yzt X-Received: by 2002:a17:906:2f83:: with SMTP id w3mr3470069eji.292.1611329077519; Fri, 22 Jan 2021 07:24:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611329077; cv=none; d=google.com; s=arc-20160816; b=LSCLnhnwYJmfOAZjbB/4aF5jwZGk6Fv0o36xV0TOm8FRADBmZxtPIG31C0s96jQUXs txMs8MLug2UR+VcHvUs8k7hcMDoUZqLeWv3Z5VRBfG2/r3FE5WiXtO3rmUMZlPqT/NAs xpShsdVvA7XUMK+mzwUposZoQ+OySfjrvGAdXTSEnpaiXN9mXE3u4/7q3g6n7EhyGzvc vGCs505e3qo5oqtvWiRBzStmHaBWpqF+RwrfZ3l7YghRv5SDPO/hFj67dUW0ep+lW40x M0s1P2wFa49RF/E+tTQFP7uJypCVSzhEZzNjkmYdEYFCujwXwTaOFIvdJptFToKWmgkv 5KuA== 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:subject:from :references:to:dkim-signature; bh=43Pf87vNh1BvVz9DEmjXXzc9gq+Qi8n2DU1ll5dE4h8=; b=OiuKDG0ClMxSbeJ+r//mjPBXcAklLwRhdWN8HaygUybwerQ7uf0CZ0G2gTmM2Ncrf1 kx5qzmPc5KT534JKHi/dPMApkI1eZ6n0o6b+ViXIx8T1HLOLE+DNOnJZAUhauw3o7Az/ +53gvLCErGwabGIArd7SzT5Eqhx2bI0+8a19BqIBXUgJdCysL+EGQQZh6KTbNiJtYCb3 V5FA9HMDgJLSekUUbpjIe0gurjVyIppSk2b9RWS2KZydZmPAXAaoS8TofF0yzjAphhYt T8mD0os1cqHc1Zubr4dh+rGFcQxtSIyvLG1vD3WM4cdWkL4PcvTdKHpXfB2xR0bHcEo2 Nh2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="i5zdWF/d"; 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 q21si3047041ejd.515.2021.01.22.07.24.11; Fri, 22 Jan 2021 07:24:37 -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=@gmail.com header.s=20161025 header.b="i5zdWF/d"; 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 S1728833AbhAVPWM (ORCPT + 99 others); Fri, 22 Jan 2021 10:22:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbhAVPUs (ORCPT ); Fri, 22 Jan 2021 10:20:48 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3384BC061786; Fri, 22 Jan 2021 07:20:01 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id y187so4654804wmd.3; Fri, 22 Jan 2021 07:20:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:references:from:subject:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=43Pf87vNh1BvVz9DEmjXXzc9gq+Qi8n2DU1ll5dE4h8=; b=i5zdWF/damgIZSl6VfswKyzA/dRnZIaqifNgsR9dMVjZqVELlN4hN93a6oKLXdO1Te alkAkf02l2i/Z/4nrfHUSptjpkEw2GCTxwn9XWQrpmg3elyP0AZcbK8PBLeqwd5f+x7F uEunOoeZ/ETsB4X7b/nb2oEDi8M/hN9ZuAciVJY5aeCvqqCeEbtTuE95uRqgD10G81VJ HMTXTN//l9r5e30Hp+KwBGbUffEPgc6u5uGkxePFDPUmdVvUI5h17OQ05kCYTQBbMkmv iebT8idPfduCJxzYvkfQXZVL0Gt7pWeoHx+bFInFOpsrvj2gyOXV+DMIoivHwZGwneyE hvYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=43Pf87vNh1BvVz9DEmjXXzc9gq+Qi8n2DU1ll5dE4h8=; b=BsMqeXXCbBVrO+oTlkX/YwoUoCpB1OZuaKDZJ7McxJEAlmbi/QUZjziAQk756XtNVW Xxw2k2MVkgx4YTiIRna+fRxQNhVk12ALn6ZQqeF+MZBF39ziXIUz5yasGfXj0dvmsSYL z/SpEgCTllQddrrrWcPG0jJRuzvJlAL4NYai0Kdbk41bLKdEujYmi7IvWKgOREY3x2U/ RDJ/H99ebP+r22xPWxUcxWRXnPYl+jq9nMblTJaBCzaL3KAu/CxXtrKUfjgh5siy36hn TaCsQCDZ1gu6dgd1VNeMf4fJQ1hNgxMeZLAAvYir7VpuIhMQGhoQN1vNsefwQfVjGpJH tcFg== X-Gm-Message-State: AOAM531MfQGtz70vWKQEJ88NEDJDpqU4vkmlVnhNOu6952EbNo6q25cA +IMoFJEuQoYdHsd753iGyyPfLjDVjOw= X-Received: by 2002:a1c:5686:: with SMTP id k128mr4459219wmb.189.1611328799500; Fri, 22 Jan 2021 07:19:59 -0800 (PST) Received: from ?IPv6:2003:ea:8f06:5500:5c9d:dd78:3e40:95d? (p200300ea8f0655005c9ddd783e40095d.dip0.t-ipconnect.de. [2003:ea:8f06:5500:5c9d:dd78:3e40:95d]) by smtp.googlemail.com with ESMTPSA id d199sm11736696wmd.1.2021.01.22.07.19.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Jan 2021 07:19:59 -0800 (PST) To: Laurent Badel , netdev@vger.kernel.org, Andrew Lunn , Russell King , "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, "Rafael J . Wysocki" , Pavel Machek , linux-pm@vger.kernel.org References: <20210122143524.14516-1-laurentbadel@eaton.com> From: Heiner Kallweit Subject: Re: [PATCH net 0/1] net: phy: Fix interrupt mask loss on resume from hibernation Message-ID: <32cbb60d-67f3-765a-d51e-48d74c0785d6@gmail.com> Date: Fri, 22 Jan 2021 16:19:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210122143524.14516-1-laurentbadel@eaton.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.01.2021 15:35, Laurent Badel wrote: > Some PHYs such as SMSC LAN87xx clear the interrupt mask register on > software reset. Since mdio_bus_phy_restore() calls phy_init_hw() which > does a software reset of the PHY, these PHYs will lose their interrupt > mask configuration on resuming from hibernation. The (optional) software reset is done via soft_reset callback. So if the PHY in question needs special treatment after a soft reset, why not add it to the soft_reset callback? > > I initially reconfigured only the PHY interrupt mask using > phydev->config_intr(), which worked fine with PM_DEBUG/test_resume, but > there seems to be an issue when resuming from a real hibernation, by which > the interrupt type is not set appropriately (in this case > IRQ_TYPE_LEVEL_LOW). Calling irq_set_irq_type() directly from sysfs This sounds to me like a lower level driver (e.g. for GPIO / interrupt controller) not resuming properly from hibernation. Supposedly things like edge/level high/low/both are stored per interrupt line in a register of the interrupt controller, and the controller would have to restore the register value on resume from hibernation. You may want to have a look at that driver. > restored the PHY functionality immediately suggesting that everything is > otherwise well configured. Therefore this patch suggests freeing and > re-requesting the interrupt, to guarantee proper interrupt configuration. > > Laurent Badel (1): > net: phy: Reconfigure PHY interrupt in mdio_bus_phy_restore() > > drivers/net/phy/phy_device.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >