Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp430469rdf; Fri, 3 Nov 2023 05:14:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwXYw3rujtodh574uLSyj15px3R3aOwHpmzPQilR0/WqOVHOQSFf5zE8O4H4FKIb5/Z73F X-Received: by 2002:a17:903:41c2:b0:1c5:cf7c:4d50 with SMTP id u2-20020a17090341c200b001c5cf7c4d50mr4025909ple.18.1699013671107; Fri, 03 Nov 2023 05:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699013671; cv=none; d=google.com; s=arc-20160816; b=ZRDhhl6osEUqkVopqprbl6fPqjtxDKOEvuc4jlJ6oQ6UOtF4UA4Aap7dLt7Ez380+I a+D7Su0zjdAJbRbCkh9dJ26rNt771Q226legsyZH/2HKaSuvXabieUkcPm/XCjsfj4L/ +E9/U1aQgG62sHEbLkyl+jQ2j9eZbDwYeEyP4X9LgQtt/24BAL9YZF1IxWiS22/02xZD bDc8Jb0eGuiF9n5P+mKlTkDqeyAnbZkYE6Ocd658OTkCpScfgoXt9sW1I8vjMtA08gof ds5i00i0xXqwlYp7a1499Jlq1zivabRya3KUoY19GBo63B+4OnJ7O0lHgFLN7A89zDj7 6H7A== 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=uGWXOxmGU6DijpJJLAD9Go42xjGlOch3s+DAI+XWLI0=; fh=cEjTKHvWzrDXaeEW35y4IWasG4Hkhs/vv+evhy232xk=; b=UtOPApJNkDnQUuzAA6/wnnfeLyf7zi/SXxTvPDCXPkSQMkOrt455vtLtNGQ8FqSG22 ZcY/N/ak2Js/4WTh21qrjwkbXe/+CUvoHZCLnHFGfXJ6xA+qwiZOq8SSKzQ9oU6O37Wy 7OcGop5uXUoLJeOzVNAa95TOo3bZumII7ExzYmsXqBhV+emWtDSiOCKQ2LOO9hYJpvh+ JgXETz5ELpM2UsHwnHpC32YWELdPadSEAps0vRahHYIdmASxzk3A69TbMA9iETmnPg/S Ix6Kk5u2s1Y9NEAodB2Ve5HzHyjXzF144tJK2VmN+kXPJQy+3v1Ai/88xQWGBoT7CZ2t uwog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=VQasqY3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h3-20020a170902f7c300b001cc692bf120si1428723plw.61.2023.11.03.05.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 05:14:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=VQasqY3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B449283AC0F0; Fri, 3 Nov 2023 05:14:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346709AbjKCMO1 (ORCPT + 99 others); Fri, 3 Nov 2023 08:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345837AbjKCMOZ (ORCPT ); Fri, 3 Nov 2023 08:14:25 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D842D44; Fri, 3 Nov 2023 05:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=uGWXOxmGU6DijpJJLAD9Go42xjGlOch3s+DAI+XWLI0=; b=VQasqY3JRsMGSCiXl/ygTaJTha d5TgpVFRabepseEvnzDZ+yjcH/AVdGfAWz+X4svsx2o7AsV09fm+JfCLbQ6kmndwJpQC+kh1YuigU VJnRJF/GzPjWOgT3ic/S+Kv7gpk2yLz9Aam8jtk5sv4to969wcoIh5F7IbN72hbSAZBE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qyt3j-000oOe-Vj; Fri, 03 Nov 2023 13:13:55 +0100 Date: Fri, 3 Nov 2023 13:13:55 +0100 From: Andrew Lunn To: Marco von Rosenberg Cc: Florian Fainelli , Broadcom internal kernel review list , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: phy: broadcom: Wire suspend/resume for BCM54612E Message-ID: <6d45f4da-c45e-4d35-869f-85dd4ec37b31@lunn.ch> References: <20231030225446.17422-1-marcovr@selfnet.de> <5414570.Sb9uPGUboI@5cd116mnfx> <4890615.31r3eYUQgx@5cd116mnfx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4890615.31r3eYUQgx@5cd116mnfx> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 05:14:29 -0700 (PDT) On Fri, Nov 03, 2023 at 02:47:38AM +0100, Marco von Rosenberg wrote: > On Wednesday, November 1, 2023 11:06:56 PM CET Andrew Lunn wrote: > > On Wed, Nov 01, 2023 at 10:42:52PM +0100, Marco von Rosenberg wrote: > > > On Tuesday, October 31, 2023 1:31:11 AM CET Andrew Lunn wrote: > > > > Are we talking about a device which as been suspended? The PHY has > > > > been left running because there is no suspend callback? Something then > > > > triggers a resume. The bootloader then suspends the active PHY? Linux > > > > then boots, detects its a resume, so does not touch the hardware > > > > because there is no resume callback? The suspended PHY is then > > > > useless. > > > > > > Hi Andrew, > > > > > > thanks for your feedback. I guess a bit of context is missing here. The > > > issue has nothing to do with an ordinary suspension of the OS. The main > > > point is that on initial power-up, the bootloader suspends the PHY before > > > booting Linux. With a resume callback defined, Linux would call it on > > > boot and make the PHY usable. > > > > Ah, so you rely on phy_attach_direct() calling phy_resume(phydev). > > > > This seems an odd way to solve the problem. It was not Linux which > > suspend the PHY, so using resume is asymmetric. > > > > I think soft_reset() or config_init() should be taking the PHY out of > > suspend. > > I agree with all of your points. This is just one way which happens to solve > this specific problem. Of course it might be asymmetric to see the patch as > a solution to my problem. However is there anything fundamentally wrong with > adding suspend/resume callbacks? No, there is nothing wrong with that at all, if you want to support suspend/resume. I do however see that as a different use case to what you describe as your problem. It fixing your problem is more of a side effect. We can go with this fix, but please change your justification in the commit message. Also, its unlikely, but resume could be made conditional in phy_attach_direct(), and you would then be back to a broken PHY on boot. Fixing this in config_init() is the correct way for your use case. Andrew