Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp613312rwl; Wed, 5 Apr 2023 05:33:59 -0700 (PDT) X-Google-Smtp-Source: AKy350YCG+E2bMERfWDizIJI9tAPgpo8JRo0kCk14DI4hJ7oU2hLN/DLQF6cAi5AUzHTTrI94KQ8 X-Received: by 2002:a17:90b:4d0e:b0:23f:7464:ae55 with SMTP id mw14-20020a17090b4d0e00b0023f7464ae55mr6962918pjb.0.1680698039395; Wed, 05 Apr 2023 05:33:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680698039; cv=none; d=google.com; s=arc-20160816; b=t4Aoo4AUmjWJ+Q9fhMLBuFmfZ1dS+Oiyks+TpSKdqcc2+IF/BDL5KaMU4UEL29AqNL sfn+H1hUuB9IfmzeVb4I0KaYMY8BWx4lYK4zMq1dtBKrdyyuYcWL/iba4WO4gi6QrBH9 +FceVKf4CnGoZevnW2uMvh1O+7etWVPBa2E4A4HWNmPOwhtmUcS0ZONmoE1jZq8qQv41 oIg+bVuOobqeem8yHyBn3/MCU1vuBC4YvDck2CeMx4UvXjOAx88IB0DVGEJuJs4WKqom L7T/NIetGH3+6Lp1MwUYso0hKSza5hojxmBdT09ldkIj3kuHx28kW8nJLmJbLcp/KEcx /LCg== 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=R0oXmomB7CE455X2FHzGCtcL8upYdv/7BC030arTe9s=; b=XK0b5f9v9kcp+Um0kXlW/eo/ZBa1S2hWxz2i8rYE1HWTomH/3hZDzAtB6oNgcLtfZa IAIY2rhgtytevY5A2TqIT/oqiysV2+pzLFxWiFmvux7a0DgJSpTzg+zQO16/WXiknqGt PCkl/IAz95tExCMO5ON5DcHQsshSgWh9GZFvylRp8nwDWwjysx8EHX71Itv+OlTUG4KG 6z7BeGWKgNwhsVhMhUdqVdXBrmqCB90rO7Z38fOJnygja2nPYiZIYbh+aCXqv0CP/eFP vj9/5KPBNDA5N3JzmrbJwAArmMPpdNtwKpLgrrRQlZq0Me7KfVamPHmxfTEDV85xoyVb wrKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Aq0Kq05N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a17090aaf8d00b0023d2847e355si1344001pjq.0.2023.04.05.05.33.47; Wed, 05 Apr 2023 05:33:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Aq0Kq05N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238033AbjDEMcc (ORCPT + 99 others); Wed, 5 Apr 2023 08:32:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238025AbjDEMcb (ORCPT ); Wed, 5 Apr 2023 08:32:31 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3F255B9D; Wed, 5 Apr 2023 05:32:29 -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=R0oXmomB7CE455X2FHzGCtcL8upYdv/7BC030arTe9s=; b=Aq0Kq05NbpaT3FgQF09VSkWq90 vjaB/TXCx4ewCShuCMYVBLYXnNCtPEvBkc4H6wfKd+AHZmzANfgx9EV4ofCkMlmyIjmzAnG8eXesO 54U+A4HaZxxlp27LYexXLsW5HjIYsOnHvSKnfGb2qVcx06ZE7SE87Qm3XW0l0XsDKX6Y=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pk2J6-009WGo-Mv; Wed, 05 Apr 2023 14:32:08 +0200 Date: Wed, 5 Apr 2023 14:32:08 +0200 From: Andrew Lunn To: Marco Felsch Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Broadcom internal kernel review list , Richard Cochran , Radu Pirea , Shyam Sundar S K , Yisen Zhuang , Salil Mehta , Jassi Brar , Ilias Apalodimas , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , "Rafael J. Wysocki" , Len Brown , Rob Herring , Frank Rowand , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH 00/12] Rework PHY reset handling Message-ID: References: <20230405-net-next-topic-net-phy-reset-v1-0-7e5329f08002@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230405-net-next-topic-net-phy-reset-v1-0-7e5329f08002@pengutronix.de> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 On Wed, Apr 05, 2023 at 11:26:51AM +0200, Marco Felsch wrote: > The current phy reset handling is broken in a way that it needs > pre-running firmware to setup the phy initially. Since the very first > step is to readout the PHYID1/2 registers before doing anything else. > > The whole dection logic will fall apart if the pre-running firmware > don't setup the phy accordingly or the kernel boot resets GPIOs states > or disables clocks. In such cases the PHYID1/2 read access will fail and > so the whole detection will fail. > > I fixed this via this series, the fix will include a new kernel API > called phy_device_atomic_register() which will do all necessary things > and return a 'struct phy_device' on success. So setting up a phy and the > phy state machine is more convenient. Please add a section explaining why the current API is broken beyond repair. You need to justify adding a new call, rather than fixing the existing code to just do what is necessary to allow the PHY to be found. Andrew