Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1008705rwe; Wed, 24 Aug 2022 13:05:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR6QTTQMx7vt+Kk8EK1iIkxa+J2MnXjuHqQeZjHJcXiAVvko9Bq3mY4n/nvDm11oXkRTdEA+ X-Received: by 2002:a17:907:2c61:b0:73d:94d1:7b3e with SMTP id ib1-20020a1709072c6100b0073d94d17b3emr367544ejc.222.1661371528018; Wed, 24 Aug 2022 13:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661371528; cv=none; d=google.com; s=arc-20160816; b=iqklVpdmv/jW0RIC3xMHs9XNuCZ1Z+uQq1baLyBzfQ8ZIE/ASexNWs6LJ3qGfaulYK 1hnYVnR1QQDeC/5Zoi2NK/KnIwrEjuWLMaBAmpQpo5QsJN5mMmOdwzAYHyaBuVR3Rd6/ ylf3867Mt8TCVmXb4NF09vR7o4vm/ieN6QPoLmKn/KWJ9Mtw7awpSoLsLf/wlviEJpmP irAl9Sd4IowA8Qh3/ejDCN7fcC50RDNIUH8pKSSSZyJborKNnoAVRE67v7Gt4le/3s7g LmcMo88xYk8gH/lkA6rSv/07/mobP/GsIF9axfujccIIToDcwvelUI/kajGXBuKqHlnJ ZhdA== 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=cliv8fOIUE97X2LZJl8OSkONVdBjqeQgsQroJzWn400=; b=aU5ZxPuFohnKZbC0WbLubGBix784/txL24IiVhmXRPRi3XA9UGNGK5ZViNnyVLwP8H GxDXgn3sNdX4eW/2Iw/LIB2JfRkAojBMuuF5OKXGQTnUlss2EFiBremIbirUD5sHrouH BvGPNm9UHkaEj2gyu0IF6mfk9Fm+m0g/Vs8QN91mPnz8g3XldlwtkKXyybDfKTKPfH+g rFBDOPTF2pAtPtq5ge+ua3u3TR4/7Wrfv3hCpIbjb2ekxmLqUX0+t4m4DSKfFboDdx+q JHGCyKtd9ZvhNLIEolFlV2l43wAyQ4Xhxf6QoBcHBR9EOfYU0/qocg8nmdxv/70hZPXg mcug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=wN3w5NUg; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d8-20020a170906304800b0072b521ba6e5si2053671ejd.81.2022.08.24.13.04.57; Wed, 24 Aug 2022 13:05:28 -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=wN3w5NUg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239950AbiHXTry (ORCPT + 99 others); Wed, 24 Aug 2022 15:47:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234610AbiHXTrx (ORCPT ); Wed, 24 Aug 2022 15:47:53 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77B2179ED1; Wed, 24 Aug 2022 12:47:52 -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=cliv8fOIUE97X2LZJl8OSkONVdBjqeQgsQroJzWn400=; b=wN3w5NUgq41D/YUu/EkW7FPwjJ woYC+U1ES1nXR04yaNs/qiws1a53aHRx2t4frvxmzV1hxQqjEeMwwh3dBvOQebSFyv/XZPHYROABs Jy3wKUIBoMNyZAX0lxBzbRwgqsEopF4qo6+lF2id3YzFRnsSu52N6ijCso9H8hEjpAW4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1oQwLs-00ETnd-95; Wed, 24 Aug 2022 21:47:48 +0200 Date: Wed, 24 Aug 2022 21:47:48 +0200 From: Andrew Lunn To: Horatiu Vultur Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, michael@walle.cc, UNGLinuxDriver@microchip.com, maxime.chevallier@bootlin.com Subject: Re: [PATCH net] net: phy: micrel: Make the GPIO to be non-exclusive Message-ID: References: <20220824192827.437095-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220824192827.437095-1-horatiu.vultur@microchip.com> 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,URIBL_BLOCKED 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 On Wed, Aug 24, 2022 at 09:28:27PM +0200, Horatiu Vultur wrote: > The same GPIO line can be shared by multiple phys for the coma mode pin. > If that is the case then, all the other phys that share the same line > will failed to be probed because the access to the gpio line is not > non-exclusive. > Fix this by making access to the gpio line to be nonexclusive using flag > GPIOD_FLAGS_BIT_NONEXCLUSIVE. This allows all the other PHYs to be > probed. > > Fixes: 738871b09250ee ("net: phy: micrel: add coma mode GPIO") > Signed-off-by: Horatiu Vultur > --- > drivers/net/phy/micrel.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c > index e78d0bf69bc3..ea72ff64ad33 100644 > --- a/drivers/net/phy/micrel.c > +++ b/drivers/net/phy/micrel.c > @@ -2878,7 +2878,8 @@ static int lan8814_release_coma_mode(struct phy_device *phydev) > struct gpio_desc *gpiod; > > gpiod = devm_gpiod_get_optional(&phydev->mdio.dev, "coma-mode", > - GPIOD_OUT_HIGH_OPEN_DRAIN); > + GPIOD_OUT_HIGH_OPEN_DRAIN | > + GPIOD_FLAGS_BIT_NONEXCLUSIVE); I would suggest putting a comment here. You are assuming the driver never gains a lan8814_take_coma_mode() when the PHY is put into suspend, since it sounds like that will put all PHYs on the shared GPIO into coma mode. Andrew