Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2120057pxb; Thu, 11 Feb 2021 05:04:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3cnqof98DKpwY2I2i1x3aLG1zyMuztLSmV48lYXTbR9DxQQvJfFofZdvpOrQlCI84Jen8 X-Received: by 2002:a17:906:8519:: with SMTP id i25mr8643227ejx.106.1613048640886; Thu, 11 Feb 2021 05:04:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613048640; cv=none; d=google.com; s=arc-20160816; b=xaWhWYNL5omdI2XtLvGOqVs9m9n0KpcfW+FapcfVhr5HGW8iZPcDhzkvN/gKyKHCu3 lJo+lV0Ovf1QlC1sUAAK9DqEzJ+F11K4C5dzRgqWTaJFfYSheLtSppdKdDzyTs3LRoCe oRExFUS7sARCwXJMk1iKPHiE+WHs19aR4RJIuIe4dvLcFlG/TO9hBmDB/JMgpBIBeLQ8 V0cvhpbuB/xlqBygRdj353fEJf5LzAuwGzxtHHwhuqtoGXTskPtnl3YJw3P49CDvFdTZ kx8+jv7mWpba4dYziFWbASEmnp7rxCe7zvXzsidcgPlwE2m6F7bP3PjUO7ma3fhg4QTA Sk8A== 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:cc:to:dkim-signature; bh=wvId9QB5MA8DN7Z/Wwn99KHW4uDuXdx8aL5nWnOvqUI=; b=h25rM4FohIPCMp1AH3Qs4kBCTnQb7zZ5BLZt7Z82rq1Saz8aJ5NAMLiCfbQQ7xzbQD zrdTFEIMumgVZShy5pqTRjsdx38WXXTh7/WFAxU84wHJmfAedj8PXlffyVTO4uAyksDV GDO9SyBOcL5LsW/QWqA0Z/G6P0XeldJbOiRSFe6jE2gx3lxokSzp4xNPgFvvR3R9dmM6 cnTmCBMK3KfaEmB9IkSY95XN6sBwML2undEZIg9Ktt6Asj894rK2kkDYUv2boO10pyHd oM/DGdscpINHj8oC94xs5pB0Pq9tpxanxNxIT07Xnzv6Q+Geeexv9aV+zcebwr1iCOKY 2Z3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KWhn7mo9; 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 x20si3782043ejw.92.2021.02.11.05.03.36; Thu, 11 Feb 2021 05:04:00 -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=KWhn7mo9; 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 S229876AbhBKNBy (ORCPT + 99 others); Thu, 11 Feb 2021 08:01:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231406AbhBKMhF (ORCPT ); Thu, 11 Feb 2021 07:37:05 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8236C061574; Thu, 11 Feb 2021 04:36:24 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id n10so3710402wmq.0; Thu, 11 Feb 2021 04:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wvId9QB5MA8DN7Z/Wwn99KHW4uDuXdx8aL5nWnOvqUI=; b=KWhn7mo93wQSGNpPerkogAeENqdhj/Jet54/l8HJ9cnyHNJoun/Itg4shkO9w6bbO9 AYTTuNp8NJbNHMJt0wK2qScEnSjM+rkNgck/SoibYkFKX+yutXwZWpIN7Z3EQaCE6wAh xTs36xzMGtlIRCYLZA+ADwd0BBWH3md3eozN/aDxSqfDtKIG7zDLm3dLIJaN5fNunFMm 66gBFbaXnbHGFsIWEuRiwEjHLbVwuhmfgl2WyP1ld5/DCkMqYhE5sw8klLSZCWsbBl6O /T6keqTEASsJ4VKX7Se6Mi/bGFmHsC/fpU3qC/LDtTOOHJJs3K/Ky4Z6G1zUsfSwQCAu 46eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wvId9QB5MA8DN7Z/Wwn99KHW4uDuXdx8aL5nWnOvqUI=; b=t2zqzdBEtNr7WPav7RamrpsK7lIMNZOwgwfSlRiEgmGk3xArCbiQ9wsoa5AAvIY+N7 yRtuVjV0ushnSzmgJgb5VtF7NhUm49VrNkTrv4MMsfeEoPkFFZm+8s5vi1NvU6dsIPek 7WjbkH09nua6D1Hte6vAhZSGIvlFkwVCXUrD0GJfnWOWAW3zHlbdip8HYaYzxJ5uORGT QKaNLvC1WFfy0tdhHXv3LlToIRu+IvjKOGx6PPR6U17J1LmXAq2RSTZ5zqcmAuIcbQzl zkh/uQvMZjx8inH+D78mT7RJ5O/kyWNSpJb+uYRdOjnwYErEFS6LMbTV93Ok1L1xZGnq 0AwA== X-Gm-Message-State: AOAM530In2h5mIAYLOA48GgS9sYZLRFFy1R5I245018d1lKnDyUyoqgZ NcKGt4a+Zugkzf5ub5MbRqW46A8wlB1tsg== X-Received: by 2002:a1c:6002:: with SMTP id u2mr4868870wmb.83.1613046983117; Thu, 11 Feb 2021 04:36:23 -0800 (PST) Received: from ?IPv6:2003:ea:8f1f:ad00:60ca:853:df03:450e? (p200300ea8f1fad0060ca0853df03450e.dip0.t-ipconnect.de. [2003:ea:8f1f:ad00:60ca:853:df03:450e]) by smtp.googlemail.com with ESMTPSA id u3sm5228983wre.54.2021.02.11.04.36.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Feb 2021 04:36:22 -0800 (PST) To: Pavel Machek Cc: Claudiu.Beznea@microchip.com, linux@armlinux.org.uk, andrew@lunn.ch, davem@davemloft.net, kuba@kernel.org, rjw@rjwysocki.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org References: <1610120754-14331-1-git-send-email-claudiu.beznea@microchip.com> <25ec943f-ddfc-9bcd-ef30-d0baf3c6b2a2@gmail.com> <7976f7df-c22f-d444-c910-b0462b3d7f61@gmail.com> <20210114102508.GO1551@shell.armlinux.org.uk> <56366231-4a1f-48c3-bc29-6421ed834bdf@gmail.com> <20210211121701.GA31708@amd> From: Heiner Kallweit Subject: Re: [PATCH] net: phy: micrel: reconfigure the phy on resume Message-ID: <0ac6414e-b785-1f82-94a2-9aa26b357d02@gmail.com> Date: Thu, 11 Feb 2021 13:36:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210211121701.GA31708@amd> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.02.2021 13:17, Pavel Machek wrote: > On Thu 2021-01-14 12:05:21, Heiner Kallweit wrote: >> On 14.01.2021 11:41, Claudiu.Beznea@microchip.com wrote: >>> >>> >>> On 14.01.2021 12:25, Russell King - ARM Linux admin wrote: >>>> >>>> As I've said, if phylib/PHY driver is not restoring the state of the >>>> PHY on resume from suspend-to-ram, then that's an issue with phylib >>>> and/or the phy driver. >>> >>> In the patch I proposed in this thread the restoring is done in PHY driver. >>> Do you think I should continue the investigation and check if something >>> should be done from the phylib itself? >>> >> It was the right move to approach the PM maintainers to clarify whether >> the resume PM callback has to assume that power had been cut off and >> it has to completely reconfigure the device. If they confirm this >> understanding, then: > > Power to some devices can be cut during s2ram, yes. > Thanks for the confirmation. >> - the general question remains why there's separate resume and restore >> callbacks, and what restore is supposed to do that resume doesn't >> have to do > > You'll often have same implementation, yes. > If resume and restore both have to assume that power was cut off, then they have to fully re-initialize the device. Therefore it's still not clear to me when you would have differing implementations for both callbacks. >> - it should be sufficient to use mdio_bus_phy_restore also as resume >> callback (instead of changing each and every PHY driver's resume), >> because we can expect that somebody cutting off power to the PHY >> properly suspends the MDIO bus before > > If restore works with power cut and power not cut then yes, you should > get away with that. > > Best regards, > Pavel > Heiner