Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3172193pxb; Mon, 9 Nov 2020 04:44:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZ6+HFiR0VAJnuP/oJtXk7W5syIEn0qWcb9QbRcTyru8t/XV4/gLTa64tKWCrzfhIGZ904 X-Received: by 2002:a05:6402:206:: with SMTP id t6mr14843757edv.291.1604925893969; Mon, 09 Nov 2020 04:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604925893; cv=none; d=google.com; s=arc-20160816; b=0f6QYTt5HIqrISAKz0nj1wTKOSwpLX/jSbcwkau3+e6FDZ8cecqN8g2Y3pPqN7JliQ Ujnhk09bcuP49M7KvycTNlZN4E9qGGXawFRlCyHilZ5cioSalSqaHD7+v9v21jmrHbkR LOTLmroGZ4vLrO8q6xxXpvgFiUVHwtUA1Gn4cv94lsOsucQgUGxiOReMb2yagRqnnNQT ALRKV8rN99O9gonwdG93RCB+jt0RdpEIFj0n2/YQxgPhIjBDTyJqVlnbTDekwVTkM3cD jKpxSHcHS/mzoFlPJuQmS6q10m/Dd3qOHUVVu6M2uZGWYtmQ0bsQeQWzkcCiiZ4tIIiX OZBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=9orrVQA6ZGrDDlSsN/ncqmLDoFzNICbVQMitGTCGvzk=; b=ZG7nPKxUYByLVeQIIRvfIXQOpyOJZgI1TDD2QAkfeEI6qJGYFnieZ4nCCDScBGajk/ neDkGse7id7R61lBS4JD01+hKnXvEcoaXMU695fwrXIViESFa4CvsvJgA8uHeHKEGj7G BZ1qyTgBsvjC43UdtRRjYyYjOFJoKzBbjgJe85O7NN/Fx+G8uFtYJghuHte++4xkas34 iBWF1XA+OtP1kmdXNZpEhAuKCtcICcHYiuJSdrX5YdA5DaoMXwCSP6Uw1lSCRUThX9P5 comunsJUfYsxSnCwbsfepAnXHZhlVSiRX4E6+hxnZskTCJZhsCOVT9Lht5BE4qHDaMU5 G1Hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si6594276edi.111.2020.11.09.04.44.31; Mon, 09 Nov 2020 04:44:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729776AbgKIMkt (ORCPT + 99 others); Mon, 9 Nov 2020 07:40:49 -0500 Received: from mga01.intel.com ([192.55.52.88]:43619 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729038AbgKIMkt (ORCPT ); Mon, 9 Nov 2020 07:40:49 -0500 IronPort-SDR: XE4LLSM2e1Heqyc+pP/LZsevXieFRGf1owyzxLp6rkjNf/vQc5GQ+UtXbWstgg1bTz/+BhWEBg vFS36W/QYVlQ== X-IronPort-AV: E=McAfee;i="6000,8403,9799"; a="187741198" X-IronPort-AV: E=Sophos;i="5.77,463,1596524400"; d="scan'208";a="187741198" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2020 04:40:49 -0800 IronPort-SDR: WkFNnJabM/KZwt/ZkJYDIVyDWOyYm/WDjCNUTd97x/wsp6GrlUHIUSWfaxgmX8rJiGFwF4jLQd NqSNQ63XtIcA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,463,1596524400"; d="scan'208";a="307638358" Received: from glass.png.intel.com ([172.30.181.98]) by fmsmga008.fm.intel.com with ESMTP; 09 Nov 2020 04:40:46 -0800 From: Wong Vee Khee To: Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ong Boon Leong , Voon Wei Feng , Wong Vee Khee Subject: [PATCH net-next 1/1] net: phy: Allow mdio buses to probe C45 before falling back to C22 Date: Mon, 9 Nov 2020 20:43:47 +0800 Message-Id: <20201109124347.13087-1-vee.khee.wong@intel.com> X-Mailer: git-send-email 2.17.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch makes mdiobus_scan() to try on C45 first as C45 can access all devices. This allows the function available for the PHY that supports for both C45 and C22. Reviewed-by: Voon Weifeng Reviewed-by: Ong Boon Leong Signed-off-by: Wong Vee Khee --- drivers/net/phy/mdio_bus.c | 5 +++++ include/linux/phy.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 56094dd6bf26..372d0d088f7e 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -691,6 +691,11 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr) if (IS_ERR(phydev)) phydev = get_phy_device(bus, addr, true); break; + case MDIOBUS_C45_C22: + phydev = get_phy_device(bus, addr, true); + if (IS_ERR(phydev)) + phydev = get_phy_device(bus, addr, false); + break; } if (IS_ERR(phydev)) diff --git a/include/linux/phy.h b/include/linux/phy.h index 189bc9881ea6..73d9be2c00f4 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -360,6 +360,7 @@ struct mii_bus { MDIOBUS_C22, MDIOBUS_C45, MDIOBUS_C22_C45, + MDIOBUS_C45_C22, } probe_capabilities; /** @shared_lock: protect access to the shared element */ -- 2.17.0