Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1017523rwe; Thu, 25 Aug 2022 13:42:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR7s943Rq8hSuTrzKHIk/NNj++qkfhJ3alntPBZo0VnYo3eE/i3q+/2vHVsRg5BLLIEdhoGQ X-Received: by 2002:a17:906:4598:b0:73d:ed3c:de with SMTP id qs24-20020a170906459800b0073ded3c00demr519252ejc.562.1661460162119; Thu, 25 Aug 2022 13:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661460162; cv=none; d=google.com; s=arc-20160816; b=0/54F6XSYxfvYEPUDOw5UNhxN7673yh4dtDVFMEGurb9V2QOiEu4uFEC9MQLD7a0fW gVtXpwBjVwn31REzfUQPfPAwX4eKawMgdALBIyb04bDPOx2lF0mUGPmatd8iecQEvKZy xRQa0c6c542rOPTFX5iTk2y8kaG4prEhVyHk61weoQLgU/hunIfdiNExyg/wnPxAHfj3 Q+4XaNtxDECTSOY1oW1lQolw3uI+aOj91HpIxd1qJb16LYBimFnKyEWq2zrfCooUUNuy LodvqpTVCfbdc6ahkDFNW+m2RnLQAJEykNBWn/ux57GoptDq8YqpvAfxf6lAwgN98vCZ 5Ebw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=UjmJrZUNDoWSMky66yFLZ2lQcsw0l9LzFolnlPKk1F0=; b=YxkKDrx27m22dObkL4r+VlKGCNv6kfAaCF5Jj6UPz+/1+qW5zV9qnhQD+Gzf73d2oz gG10kI2Gq+Fg9n34vLl4h3Yt8/v5AYZze70lJPClo0Z7wDJYgmZr2JTqae34Sm9+jvh3 ynLQiupP9wZM6gekqhxEA2A+CbK1ubtCsb4UOI4cNwycJQWxjvlzIIi6990gUAwG3BF2 XBsd9YX8KtAW/55GvcUi0qKRgfg8cTSwk2smmWaHhXN8VIw6aa/8RnZ6W74DYCYIK5AJ e2ZS4LsiV9OOTY1NtIbUp7s9+Efb7ZAqnhiT2xW7cz83J4GQ5TFtXBaoIlDhTrZ8OdQQ A7ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=2gIspUra; 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 g3-20020a056402090300b0043b9617f589si257349edz.209.2022.08.25.13.42.16; Thu, 25 Aug 2022 13:42:42 -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=2gIspUra; 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 S243561AbiHYUK6 (ORCPT + 99 others); Thu, 25 Aug 2022 16:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243391AbiHYUK4 (ORCPT ); Thu, 25 Aug 2022 16:10:56 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6A7BB99E5; Thu, 25 Aug 2022 13:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1661458256; x=1692994256; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xoVBKI8vtRPLhTpfe9zpgP4YLTMRraRWqMv5jTZ2XKs=; b=2gIspUra4RtZEe4GdL8zWpRMyR0fy2rTSd+iOmHeNATqL9bVueu0rJUP YuBNYXx9xcjVOotdHJrg0jhIKN8Va6jEVaeYETfBcsVIEftT9dbC4Co9M P+hiihfhf9PU1XjsKJr6SGEPsyV+GmWOm8wOEmRNIFN4b5nofnPBTlk+7 mvpmNR4fzRgzkQmVYPdolHk043Xd3Zm+MUmb3O5BQsej2VPrnd4tXmJnM BUNERaSgZmFI05sMx2iB5tx1Ml1YccVHMQuO4CHiQrv/jDbAnjV6GMKHK wWhdQX+slzu+bT9aVmPJdXhXywC9DdklLRf8gjjO54x2cbuiZa03EBVnZ g==; X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="171001056" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Aug 2022 13:10:55 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Thu, 25 Aug 2022 13:10:48 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 25 Aug 2022 13:10:46 -0700 From: Horatiu Vultur To: CC: , , , , , , , , , , , Horatiu Vultur Subject: [PATCH net-next v2] net: phy: micrel: Make the GPIO to be non-exclusive Date: Thu, 25 Aug 2022 22:14:47 +0200 Message-ID: <20220825201447.1444396-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 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 --- v1->v2: - add comment describing that there should not be anyone putting back the phy in coma mode. --- 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 e78d0bf69bc3..6f52b4fb6888 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -2873,12 +2873,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.33.0