Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp322827rwe; Thu, 25 Aug 2022 00:26:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR7WU6WE824wx/6sXqUu1mVina/UiJDYbZe+EJBedcKuXO8LSYOo5IvlFV2eH5gFUaE8O5zY X-Received: by 2002:a17:907:75dc:b0:730:9c68:9a2e with SMTP id jl28-20020a17090775dc00b007309c689a2emr1675877ejc.22.1661412414955; Thu, 25 Aug 2022 00:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661412414; cv=none; d=google.com; s=arc-20160816; b=jdaeUqW3BoAGFFw4n7+mAGywVq9dlHAibPBN/GYH5+OSvh+3C5iomwvlw3WdW2MqMT ESWXw/gLnUcQmxvjoLgg07pe2gJd1wuIQmQ+veFEzeF5uILdFWcHeM0s2QCMPNna7y/z vHTZ1PBkWv6ouhGAJnHbBNqortyuoDBDVQJuD1YsSNlyv9YY8hFVrYEVEd7CZcygxaVe yPuWuqHzRajpD+lF4ugz4O7q1PxE+TbdvPPuTwXLVTUxsGjjInMJBmmmiXfBHMAKlTEd gNDuZ2DnJhrqQ/YeVfsxsdloB0SAG0VFd0ysCZ/TZVqDwS7SkaEQqRsvXkfJA4/iw79y bMxQ== 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=ajfe9wYG16dE1r2eTfm8QcjLPmL+AVBQkRhklEIdaSI=; b=L/mHXDFyFU2OznMN71XAFh1Y8MLDbmit8NezjUpTWc52kGq36lOizPvWcykvJzME6G YNIyE7+yPjkA3nXxhxCe8M3JG0947kIV+qvRULjt0GJmA5d6H8v0IRcnithQU3gQ1tqe KOOu7gQD6owyJEUCLBXF5i0LpLlAXdc6MIHIxt98TeZOXyxvh453nxTI01z28Sx1Y59F 2T/IHniPgnOmn51D7+fz1S5VAXVfEqOifcCyuJwLB9ROOHn1/4/1c0Afx9R+cjSajDJL T5l4BU9NvYtsah7GYGGojXpBjF8jqIXOiAGxIlE1Evjdvm+h+iwceTNBd/naPCMhuf08 4wyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Xp1eGcmF; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a50d702000000b0044612f19c98si4934772edi.512.2022.08.25.00.26.29; Thu, 25 Aug 2022 00:26:54 -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=@microchip.com header.s=mchp header.b=Xp1eGcmF; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236184AbiHYGuC (ORCPT + 99 others); Thu, 25 Aug 2022 02:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232550AbiHYGt5 (ORCPT ); Thu, 25 Aug 2022 02:49:57 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AB98BC8E; Wed, 24 Aug 2022 23:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1661410197; x=1692946197; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=xLuE/B27u6eRSGn7Ft71FXRlPAdU68aHCYLKp0Orpvc=; b=Xp1eGcmFxAWM24LwlkVsjrXmflpDxDfHInZr1BmtscIV93uL14B/nUHc WBpQ71b18tqWiTHSGteEdvo43LBeFomdIpKdPUmW/MYUCCkuGfzIo/U6j 9YxXqnbs0J1LoiM+YYG+T3HRCDNQxXHy/d8jd0ffbsQw2EDiyCiiWROKP XxEBW2jz2mQXbu2P1IaOcm0WxxuhLqRNNCEKvAbIoFHgB6SpUKrM3VjJr DQxE1lJ4sWCIYyaYgn/xxsEdj4UFUuji1dSH+rOTNAP/lvTBGNrwhqWZf +Q7rxhF9UQDpjdZyhdHJSgxSvCdUrPclU6/O4aQ1f2Bbk99graiH24w3F Q==; X-IronPort-AV: E=Sophos;i="5.93,262,1654585200"; d="scan'208";a="187978584" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 Aug 2022 23:49:56 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Wed, 24 Aug 2022 23:49:56 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Wed, 24 Aug 2022 23:49:56 -0700 Date: Thu, 25 Aug 2022 08:54:11 +0200 From: Horatiu Vultur To: Andrew Lunn CC: , , , , , , , , , , Subject: Re: [PATCH net] net: phy: micrel: Make the GPIO to be non-exclusive Message-ID: <20220825065411.wjmuh2xyfh4xuk6b@soft-dev3-1.localhost> References: <20220824192827.437095-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 The 08/24/2022 21:47, Andrew Lunn wrote: Hi Andrew, > > 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. That is correct. I will add a comment in the next version. > > Andrew -- /Horatiu