Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4469972rwb; Tue, 6 Sep 2022 08:00:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR6x77ye4ogCGw+py6shvGkvkLmteJrvzhWT/yEA5yGuq1Dg7Bb2PEU0J4Sf/obb7axIsZZ3 X-Received: by 2002:a17:907:9816:b0:741:89cc:af19 with SMTP id ji22-20020a170907981600b0074189ccaf19mr29315288ejc.492.1662476457858; Tue, 06 Sep 2022 08:00:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662476457; cv=none; d=google.com; s=arc-20160816; b=B+mMSeh5R9Fhece9AkCkoHojbPFTw1VfgnlQZMLZgC36dBMeuliLMhqEylxhydzzjv 8bFBrZOEOlgRA2vxXw/nVyZuaM/S7nguQwNiflbkMny1TOBMfWhGhSU+MCUqTJW5Acm9 OXrmERkZ6NCw1zLKkHF+2K3vs5VgpQ3Sh4SxC/VeV7m3/J6sT3CetPSFKucRArlNhUi2 WGLevnWxceh4tfxZRZT3uBYt/cvWlsyijZ7QO+RzpPDBuupO6TdlxBKc0nLDX1jsOPZX OnJN5xVkSXIJPcGNbseoB6U4yZw/qNq0tyXMzeQA2OzO91oBTgBRCitmUizPC8szHWHt rcnw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZuQwswqJz1NLYKnj1Vs1kdOxPb97VGHFGh/W9PkfsoM=; b=Rxd2dMf9Ostx/UrPybrtVxbr7Einh2eBSldQDKiFl+5U5iOHUwhSEW8VNKTeGahcPR GO04OnbvXHRFAGzLtLTuBBvCpwxOp+PwOImM5dacHSDvxKZWulXeHJd+5UpZxHYxnSEI tG1gYe5ZmZS042lRHHhtGzKjcp1B/ar605ZTe9P9tSiVLZ+hVXQIxyRXpkzmfHxsZctO bMQkRIS+6ixjve8gbSa9H9dbfNl+k2CWj1NXNdAeE9G7MujbgT+8LVEmQdnw9nLvlj8R PxjERypAaBGFhJ5lkUFujaYUbuIbNOzm62G+WX69e0rKEIpLWdLJ7sJYPpgBXokBSHYt UxRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DIOnYuic; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s19-20020a1709060c1300b00741a3548ca5si277552ejf.761.2022.09.06.08.00.28; Tue, 06 Sep 2022 08:00:57 -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=@linuxfoundation.org header.s=korg header.b=DIOnYuic; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240919AbiIFOMI (ORCPT + 99 others); Tue, 6 Sep 2022 10:12:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240628AbiIFOIB (ORCPT ); Tue, 6 Sep 2022 10:08:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9087F85FD8; Tue, 6 Sep 2022 06:45:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 349816155D; Tue, 6 Sep 2022 13:44:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DC0CC433D7; Tue, 6 Sep 2022 13:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471884; bh=wb7UPJN4NYPb1TO690B9c40Rfzbvv/Y4FMpbqVIGKyo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DIOnYuicbL2/li4yEM9FBnePM5m42EcL7iTTNAeBSZOrk3EGlz199ow1dyC899rtg vDJSgCaVh6Gn1cMq3Wzcrfpce6OfZ0fsRbF8FERjtmm1gv7GHneUNpdsORS0XKsnuc vNgZIP6ps+Au4XYi9B/gWKWgHzOz3GKvPH3g2yyw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Lunn , Horatiu Vultur , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.19 041/155] net: phy: micrel: Make the GPIO to be non-exclusive Date: Tue, 6 Sep 2022 15:29:49 +0200 Message-Id: <20220906132831.142924443@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132829.417117002@linuxfoundation.org> References: <20220906132829.417117002@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Horatiu Vultur [ Upstream commit 4a4ce82212ef014d70f486a427005b2b5bab8e34 ] 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") Reviewed-by: Andrew Lunn Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220830064055.2340403-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/micrel.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 22139901f01c7..34483a4bd688a 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -2838,12 +2838,18 @@ static int lan8814_config_init(struct phy_device *phydev) return 0; } +/* It is expected that there will not be any 'lan8814_take_coma_mode' + * function called in suspend. Because the GPIO line can be shared, so if one of + * the phys goes back in coma mode, then all the other PHYs will go, which is + * wrong. + */ 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); if (IS_ERR(gpiod)) return PTR_ERR(gpiod); -- 2.35.1