From patchwork Thu Aug 17 15:06:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13356696 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBFFD14F79 for ; Thu, 17 Aug 2023 15:07:07 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2064.outbound.protection.outlook.com [40.107.20.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C129C106; Thu, 17 Aug 2023 08:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mck5g8ceeEiKn77tM1Pkgx2Mq6wC8T1FeZgIKul8BmvSCYKDaOX+7Dt8fWhdQ29F/SUgwyl4rLIzzkFBCJO1IkqWYeKZUWKJv3qBEEE/qIedmY3zW3v1vzqHmhJ0VnhCD0TBYuz9RxIKGj3k5A4KbDl2PAG4xbmc/bHwQH4WJ7gli9oKkE6brpssbkG1nN4dnwPiisqbMca2PJleM++v1ssmecJc6JKr8WdNqYPwgDbisJxlU4s9mMRIoOtdfuaEhvRDF4gYj4tWgQ+5W5ReAK5WYvoc1JVgSWJFaX6fJLJF9RPQHb02n29kKfIZi+3yJXpsVKpL+WsQjW16CGsywg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s8AkHZ8cYvnIpEOwkWEUYJkx8PnKV/JTVotjFoEl3Oc=; b=l8Ki+CEgeO+oH/yEuMK7spd3i8P+QFrmboRvqFz7Ogqe6dE9/DeKeInKYWLa2NS9ifjrlL0s195fnbI0BP8Zv5jyQZ4uyfpNSvS2K8GPgTS1NuChzCUALBP/AbqjkMK6KkuJxpo+dcCyOkKngKU5Xn9YVM0hFdGBFkGU8+QVN0sdqZ8bvMn9mtT8JpPc1QyhRCvY0KSVGOTyaMtS2+OJN4yhI9TD3Eddci2GMf75wL0lqHenxG7iu7jagTKy5lm7KXQI2cvWO42d+uAnZvaiDiPlwK4y+DHnxRYC0oOORoEH39IWlLg0pRSr7lU8k7HNLk2pS77SF0OKXyvj4nwpLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s8AkHZ8cYvnIpEOwkWEUYJkx8PnKV/JTVotjFoEl3Oc=; b=DL9qVRFvEgH4Zm6BRhLPEBx2VLSpdjtU4v4RFjZtlHiTNwEOEaSObv00Uq4mXPfUU2LuST6rncLj7yq9KQnY/n+j2//T4LUgv4qcBl3JMVNFq98+O+UbuRoQRpFa+FWXJXNmsN1ZumEbYQ94z/LOEhQJkuMScCZBEMdU2G+k3O8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by PAXPR04MB9469.eurprd04.prod.outlook.com (2603:10a6:102:2b4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Thu, 17 Aug 2023 15:07:04 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::d4ed:20a0:8c0a:d9cf]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::d4ed:20a0:8c0a:d9cf%7]) with mapi id 15.20.6678.031; Thu, 17 Aug 2023 15:07:04 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org Cc: "Russell King (Oracle)" , Heiner Kallweit , Andrew Lunn , Florian Fainelli , Madalin Bucur , Ioana Ciornei , Camelia Groza , Li Yang , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sean Anderson , Maxime Chevallier , Vinod Koul , Kishon Vijay Abraham I Subject: [RFC PATCH net-next 6/8] net: phy: initialize phydev->master_slave_set to MASTER_SLAVE_CFG_UNKNOWN Date: Thu, 17 Aug 2023 18:06:42 +0300 Message-Id: <20230817150644.3605105-7-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230817150644.3605105-1-vladimir.oltean@nxp.com> References: <20230817150644.3605105-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM0PR02CA0137.eurprd02.prod.outlook.com (2603:10a6:20b:28c::34) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|PAXPR04MB9469:EE_ X-MS-Office365-Filtering-Correlation-Id: e7790dd4-1735-4a57-22e6-08db9f339dd0 X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Dr4hbIfWHVUTdmwSgDyxVy4YVZMqrHCmihXThARakQJqDDBa1Ah3yV37AoB904I6seF4WBPzHWt4kXTvpUGeyBCpu1xnUBJYbOYeuJ2CuO8Pa342mPLtCOdAICoD4iDESIbf1mNjbJQrEfn0cCw7Yb8x/CExIfrnPBkKFKh4MfhGwDybTggrITrX9o3e4mQlfTSZweBshhpQS9oJ1nSSHulfuXkDNOG3lun6no4buQ4nBm7IO7G/csQnnslkGgoh2Eu7lxFw+qNC57A/b2VOvQUBgOWXlGq/j1lMPtYXzMfJY9SihCs+NgWR6+18+cKasK/uSM3lOtuB0nCZAmnfasZSZtkDs5g6S6c0pwSRmdUT4r/6NTQ5L6v4j5mDcgn+kfPdALH42vF5fuur4csoO6FXe7SvdwK2v/D3ZJFVEVvXbYWdIYX1AcZWNPXj72m4LTapHj5tvGsL1co2KRTFgO4ISIGMpC0A6So2lrjWBBiZIOAiB9UX84ctN+8H9RXKiuw02LtMVNFhUGmZkLrlC/I2/zlTEYvss49gpvaG4CQNOUJJR7ogciaXuEF/MT1VhTsr5WAAeSi6F09DVW9fGvmqBc9/7WmU0lARH2/glWYbWnkPr4JTmgkK9W5R0QQC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(376002)(136003)(346002)(39860400002)(396003)(186009)(451199024)(1800799009)(2906002)(83380400001)(26005)(86362001)(7416002)(478600001)(6506007)(36756003)(6666004)(2616005)(1076003)(6486002)(6512007)(52116002)(44832011)(5660300002)(41300700001)(316002)(54906003)(66946007)(66476007)(66556008)(4326008)(8676002)(8936002)(38350700002)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5Rn9knMI1/Hy3NRw5xHXdkCGgsmbzG9nhSOQj8AoECZEyhKcb+vVrYb6qgg403xb58qbAVX8Z4zAfmC0to+EDjMIwT0eNiu7rq01Yj2h8d6iwsMrpw2qNne1h/pZi+DnHDs4NALEVaCkGNhzP/iGhuYhMYvCJ1qFFkrY8uTupJK18BwwVxwTBZ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YMDTlXXjeGlt/We237sLDCz7GErTlWd9g5Hzr4JsaQdU2dqxgql0zmzYhhGxc2Y2SEBphva0S9jYRepPMXR0NlAEE3w8X0zg6Qk+ykm6g7GRFrnPh01XY5l3+8KBejUwmEtsmkp+3JOdfzUkAw8LezijKUrpd/fvoErRNb8deiMdwdaqh8Tx8urW6EHWLho1vFqoBLn4AVMVLGML1NwFQkhvkPse+SAQCg40YKLWkqCeux9oUlkA6xQA62jvCMe2/rj/zxqCVSR/fHJkyJ/IfoMq3wx6zSn7RmnruZKGom+HVjIkxzZ11fuonm5omybkfjlMTpE7ypCgUVULF34xQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7790dd4-1735-4a57-22e6-08db9f339dd0 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2023 15:07:04.4620 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kqZYkxD31DRUu1S7Vnt5ymt8TZRRxfZo27r8xDHsNCzkaSRI/VHR4Ll6V4flTkqInzUGlR42Y10N32QP7qwwkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9469 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC It doesn't really make sense for phydev->master_slave_set (the user requested AN master/slave configuration) to take the value MASTER_SLAVE_CFG_UNSUPPORTED. That only exists, AFAICS, to detect implementations which don't report phydev->master_slave_get and phydev->master_slave_state. Permit the most trivial of drivers to exist, that where .config_aneg() accepts any user request, and is implemented as: /* We support anything */ phydev->master_slave_get = phydev->master_slave_set; This is currently rejected by ethnl_update_linkmodes() with the message "master/slave configuration not supported by device", precisely because lsettings->master_slave_cfg (which came from phydev->master_slave_get through phy_ethtool_ksettings_get()) is MASTER_SLAVE_CFG_UNSUPPORTED (coming from phydev->master_slave_get, see implementation above). By making phydev->master_slave_set never hold UNSUPPORTED, we avoid the above confusion (driver does implement master/slave but still gets detected as unsupported by core) without special casing in the driver. Signed-off-by: Vladimir Oltean --- drivers/net/phy/phy_device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 9cb5aa04b2b5..e374d1a57030 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -3276,6 +3276,7 @@ static int phy_probe(struct device *dev) phydev->is_internal = true; phydev->suspended = true; + phydev->master_slave_set = MASTER_SLAVE_CFG_UNKNOWN; /* Deassert the reset signal */ phy_device_reset(phydev, 0);