Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp189163rdf; Thu, 2 Nov 2023 18:48:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3angx9nXC3pvLi/J9FX7Sn85uG3Ew7ZeKZOWJL+wc2Q/mGrCDyURl7taf+V/A77sM6p+G X-Received: by 2002:a17:902:bd05:b0:1c7:5f03:8562 with SMTP id p5-20020a170902bd0500b001c75f038562mr17901780pls.30.1698976081375; Thu, 02 Nov 2023 18:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698976081; cv=none; d=google.com; s=arc-20160816; b=xH6UUuXWXGE+v0fh5MbSYQvwQ1nD/4UpbxIoxd8+Gx8iyDpzYPyZ6gq8DlkQ1wd4+y DkLpgsIFB33IOU8PTrmxuFAJfJBQSJW/c3pNsSku0bSJaxbQVkXj/dGJsFerkjtl/XeC 3COkI3Uw68KYSzUvIxaf/e9tcOpsUtZFz0K82iyrAzvmtbHXWdWX29AuKYTqKozyZ1nt XvYKVz4zrQZNsUNwhkZSaw1KqO30KkwElTJ/+cC/qT12wJDJkwjdOc0rduyyGfjA/PZY 16kOqsObQs58615fxzzFTLC2zEmdYVnhb5Khy/tlnQmqOF2ZMrJ1/2tLZNyG8jqwE6ru QgaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CS7Jy0RmpWKZtYX8kkokoR7rFAe5FlYr840NCfh7jGU=; fh=yX97SFOFkjCZdPw3kVZt+6pfbmffz9zq2/p95uCGVQU=; b=tvsYGwdYlT/WD+1box2D76s0RiBqJV+VTGsnKNbm4ppd5boGM56z9iicQFiUocV2O9 Lnu/vjN2dvJBy4KkoWC1TIGFISGJmOCbSKOeygW5ALN/Vk2iKUESpTScw/JrL9ibNHTY kDp26bewPFVAJ0uev3R80yRrSb9Or8eKe/3MEPx+Y63C566AotbtwsSTV1FLM6UUj7j8 CjDjv91rlFUpOHBrvTPHoObOxBzRbpasyfbVLcV4pPCnFwsCaSxjbQH+3dvieU8qw1of Yp7P5ABWmUhOeReTgGJiryAU73EIoq64mwe8inFC5oLxLqPTYvsGoTHh3EV+epA8zQ7R jEBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@selfnet.de header.s=selfnet header.b=bjoNWvY1; 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id kz16-20020a170902f9d000b001c9cc3a07c3si585469plb.280.2023.11.02.18.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 18:48:01 -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=@selfnet.de header.s=selfnet header.b=bjoNWvY1; 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E03F282F7FBD; Thu, 2 Nov 2023 18:47:59 -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 S229980AbjKCBr7 (ORCPT + 99 others); Thu, 2 Nov 2023 21:47:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjKCBr6 (ORCPT ); Thu, 2 Nov 2023 21:47:58 -0400 Received: from mail-1.server.selfnet.de (mail-1.server.selfnet.de [141.70.126.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EEC2198; Thu, 2 Nov 2023 18:47:48 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 43838402F7; Fri, 3 Nov 2023 02:47:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=selfnet.de; s=selfnet; t=1698976060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CS7Jy0RmpWKZtYX8kkokoR7rFAe5FlYr840NCfh7jGU=; b=bjoNWvY1keqSIO+m4yp4akMI8QlxQKPYRDoRp7Sbh27P0kcta/SNNIil/fQ05zb4hUd6Dy baeWW5qpvJ0PDcWeesr48kSrYdMsQbqNycpQouOLmy8WnYCRQllZkXIU8yOwBXvwnU8t6q 7w8h1lQ+EHb9wiCkB566Giv30kjc7Mo6XkgdA1rGTgERPV51TIcxNcRaednOD80w3ApvA1 j5npJUb2BReiEmkJod2HYzgl+XpZF/IQAy8vQvInaqld2Gnk2Xe8lSoV5VOzZNyxafEyJy /l3Cz+Jxz7DEEOt8JaGIrR5rkcaj1F6WLNYoVE1o/tIqttNXYNsng6ttRjl8Zg== Authentication-Results: mail-1.server.selfnet.de; auth=pass smtp.auth=marcovr smtp.mailfrom=marcovr@selfnet.de From: Marco von Rosenberg To: Andrew Lunn 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, Marco von Rosenberg Subject: Re: [PATCH] net: phy: broadcom: Wire suspend/resume for BCM54612E Date: Fri, 03 Nov 2023 02:47:38 +0100 Message-ID: <4890615.31r3eYUQgx@5cd116mnfx> In-Reply-To: References: <20231030225446.17422-1-marcovr@selfnet.de> <5414570.Sb9uPGUboI@5cd116mnfx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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_NONE,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]); Thu, 02 Nov 2023 18:48:00 -0700 (PDT) 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? I see some other drivers having these callbacks defined and some not (it seems a bit inconsistent throughout the drivers in broadcom.c to be honest). I'm wondering if I should just omit this whole "motivation" paragraph in the commit message and just use the commit message of commit 38b6a9073007 ("net: phy: broadcom: Wire suspend/resume for BCM50610 and BCM50610M") as a template. I mean, regardless of my motivation, I would say it makes sense for this PHY to support suspend and resume. Marco