Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2666481rwb; Sat, 8 Oct 2022 11:55:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5gu+u3nUHBDQXMQzuDSdQOC3/wsc8CYjoY369/gyK1/vv92yfUo24fLo1MoCZffOg7306L X-Received: by 2002:a05:6402:348c:b0:459:9a51:5569 with SMTP id v12-20020a056402348c00b004599a515569mr10361914edc.65.1665255332584; Sat, 08 Oct 2022 11:55:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1665255332; cv=pass; d=google.com; s=arc-20160816; b=TnyERJOM008M3uspgnJ2X7xeKc2uTr7dPDvGS2PULdyIddkAe+bLfUNovyQRPi6LbY FeQ3Dq8ki3EfJmNDbBpWv+4/p6PjNDB+LuPODDndGMt/sPf+Q699GVIfHG5utMwJIUEH N514apd0tGLx81BOSOYAw6wX7VBfZe7akriLIDDLLfsn8oI0t1NT71tvKyXgr9HnGB9l 5pjPSmzYoOhofc+is/N4cF3YnQMO9x36700dabBbpme3LA6fvALv0xAqr92L90PqbUGF OBPMMpHqf5gdTsLRMxQ6KGH2fgPMEEk5qq2uQQcCJb3VgrNuFFUnEHTorouBhEfqQYUM 9w4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=s9C2cB/cNu1wPrGU1Va66eSBDv15hq/BGirkJxced2s=; b=EMxJyLXjtk7NklIDVyNHdB9+moeuZbRslbGxh2zcxh9198dZuUaLxPe2sNdW+FLwFu M6xChUK+/ZN03eQcdoXidFZfyVeP1ppotlQwaHobxNqgTDm5xnDM+BQ89Rf7LjuSTxlE jcGdeZj5j7Bic8s0w8+FGT1BmClBgA9EbH96vt/2/5H3PuWOtF2Z5XIWk66xeQclZr7u AJY/dl6m+bsdpVfUlMbP3cwHKf8VxjD1LrZuwqRqjSxBofsX3Km2sLGceELl+BES9dUO 3SRRPdVRwWteeUhUvj9t7KwEdbn4RNM/J2/67VCYUZHu9SFmfISOQH/mcjJE1Lyo+ARq f7tA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=PraPQvh8; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a50aac3000000b0044f01473b5bsi5111848edc.205.2022.10.08.11.55.07; Sat, 08 Oct 2022 11:55:32 -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=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=PraPQvh8; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbiJHSxG (ORCPT + 99 others); Sat, 8 Oct 2022 14:53:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229813AbiJHSwR (ORCPT ); Sat, 8 Oct 2022 14:52:17 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2118.outbound.protection.outlook.com [40.107.94.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D09893F315; Sat, 8 Oct 2022 11:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CjAvYLK8nmPkkuiQPOg9e33CRGCBkQ+ENJ8qhXUh4FJbnp8f4lkPH9In1J6E1v4f7wtf3BuuTeO6yOO6E+n0chnDMhSOMnqxKdh3cjpk/yLE9pkkcQv4BPKeu+dhhgr/KCP59VG+OG2vOTfqRDsJNYD8scfkVQqcRGth0praYyXGDwEfD2aDcs1bfl1LEGLmw98HRMrwI0tZ/RuGyiGEutwUV7ynFUxN9iAhtgASiDPL0UteR0gil6j7YCNpRuuqzJTJowK69A14jVfEGl8NiM96OMSLndmuQe3uepgtNxESK74e6SeD/ncynwcDNbQHsFGZE32wly6AE19mQCv9hA== 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=s9C2cB/cNu1wPrGU1Va66eSBDv15hq/BGirkJxced2s=; b=PUXrn/65u50nZm+YDZ5r9BVxHM6vUbZwZarcLhJVYL1C3hG7FxDEoc35UZRYvWTqvqk+k1+Lp7Gr3O1joeEhsy+mFyZkGq3Ugm/X6vYa5eJ09U1NngSvTONiBnXlT1CS0BhqOrimF7EdvIBlMulCUw0hzD9rGy2JghbVf1/Ozr695XkIHcyKDDPMmis/Q4wXEN8oXrEtRIpm/tkcYRJ0uDz1PmiFs3vTJuf4aEkJv4ombr9z4Q06RqNvLwLsmQkLGvvNy09c7gP3RUutQWyKg58dlUnD0avx+tV19Lbls+xSjoj/JMAzLVn+93G7+vWq0DfFia6sm/JwTGQYfFTZ6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s9C2cB/cNu1wPrGU1Va66eSBDv15hq/BGirkJxced2s=; b=PraPQvh8uUE0ay8iBkJmCsNgH6+rNALbFmPjWcbjs6GR5Pj8H5wVcIM5MovxUHJaN6hEi19snz6atuTeO8q3CT92jzTqbt6/ReAxX1SuYmoTeSx6+HBn+7f62gGdQ56e83ZUwlOH9+nq1loqsMnPXfAq8wolvoRK5/C+dY9K5bA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by PH7PR10MB6129.namprd10.prod.outlook.com (2603:10b6:510:1f7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20; Sat, 8 Oct 2022 18:52:09 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::ee5e:cbf9:e304:942f]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::ee5e:cbf9:e304:942f%7]) with mapi id 15.20.5676.028; Sat, 8 Oct 2022 18:52:09 +0000 From: Colin Foster To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Russell King , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Vivien Didelot , Andrew Lunn , Krzysztof Kozlowski , Rob Herring , Lee Jones Subject: [RFC v4 net-next 10/17] net: dsa: felix: add functionality when not all ports are supported Date: Sat, 8 Oct 2022 11:51:45 -0700 Message-Id: <20221008185152.2411007-11-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221008185152.2411007-1-colin.foster@in-advantage.com> References: <20221008185152.2411007-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR03CA0304.namprd03.prod.outlook.com (2603:10b6:303:dd::9) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|PH7PR10MB6129:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a2e67fb-0370-4004-da78-08daa95e33da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gXzwuwxnWbJPvk2o9FAY1Jw4BXx4rLZgv3mh3gXMO7bgQWJr2DjaLg/P/SbrRdedHaf2kVCPkoR3B2odC2oFZyJPeA4jw2H9YPfxcIT20r3kvsdjqoe/JHt3Z6Ia6T97KhNoTmCh1EOUf6xdt3xG+OFnmpS9YcEsHuXhqGplBVFepkdBlW+91F8Cg/9n1DpHMJ5hUKKKCawuXavXKYERv6+pJr7xp966lk2zt2i/nDSG1V4DUpp1e/5AaW4YteyYuMXhqSvlaYcUFoVPWEDM2bH7wdSxKlbhT9ibQGvHJv4kISB63eLs5IJfLgcEJAHdajPwx8IWpl8yxE7soPgH58JBQvdyn4zuzGbtBtFrzyldlzxU/Q7ySNJfU2hKc91b+8OLy3HMIqDCw+ElNIyo6VKobXtBdLEOX/wHxwbnf5U+V3HUPkXCI2iUfv+dzFJGcZMsKO4NRS+c0NhZb5QeVNuEtg3hybsrO+HgChafrX4u3zGLRXMOB283766CNujSzk7rZ9ZK5okY9NX/fXqL0VxmAzpqVgUIe3Tmb/XWgOOegBEl4Avw0UtcjM9VO3NXPC9n7UtavtXwcVPbdefN3NkLPi7XS6m2n5ufPyIV+7kddKQdcH2g/ptE2CCfHvddZiTUHHxEAUhl7wYpRey/BI6Qfl470Tpqs3Qw3dHyT4bFLLKXvNWtvfpLNcNDA6ITJfz9YZKe8Zcy0Ma04hztMEMt5kVrHW+0Clr0A1QA3T9OaJ5eNi/9e+TbFO90ZgE8YrdRyjaSlsVgvFE7qiyBtA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(39830400003)(376002)(366004)(136003)(396003)(451199015)(44832011)(186003)(6512007)(6666004)(26005)(6486002)(6506007)(2616005)(316002)(54906003)(38100700002)(38350700002)(52116002)(4326008)(86362001)(83380400001)(1076003)(478600001)(36756003)(7416002)(2906002)(41300700001)(8676002)(66476007)(8936002)(5660300002)(66946007)(66556008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?o+ivObe4GcEr2uvSPWKjB86kPKXvKB8eJtjEoItiIY5PGNvF0A6FBg26LfES?= =?us-ascii?Q?lPGpZTF+oRmWe82RMZiv/sHIJWGVNDKd9saDHj9Tmb/MZETWZGZAcRF8VXEo?= =?us-ascii?Q?s4FhRK5Z1wMOiSPejM0eFPyqzuvOQq06u2r2ZvTQxCygb1tyG0QlsIE5YE90?= =?us-ascii?Q?uEUKAkoGJAP4qtxGXJskV7BKKKYc7A2zzK1l755+yoG+9Iz59Po6V7sIHLOO?= =?us-ascii?Q?fqRRT65GfC4gBrbCfoojek3WE0LgHZb+VX6bQEs2vGbncyWKLhAJKAsfB61e?= =?us-ascii?Q?UxXrQ6tvgs8Jd5MCkAPAo2hr5iaEPdMo5N6kjNsSPVntI0I7Cj0aJe9jtsbk?= =?us-ascii?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Mac7aUSoqPb8?= =?us-ascii?Q?fMZkWd5RtxPDMJHl7ZWUwuTyhS4/6y7Th5N4i8X2VGiDG7n7J5pAh2Pm5qzA?= =?us-ascii?Q?1HApgAn5tpXFWLGulMCpu63HzMvFCeD2LpBWAJOLuz2fRnipFSXUjw7XYDp0?= =?us-ascii?Q?xv4zCeGmEnwv8SzpgS2I2VYU+LmDfPpdNdFepICtFF+EXcuVjwmPBVB7Dp0T?= =?us-ascii?Q?xJXkuEiEVPFDMeRVhzasGxUHRASSn/CjcW3G7SjOHcwMzTGK9djPVfZsE1yO?= =?us-ascii?Q?4Q8MXcVjy8fmxyfaIdeeI5ZbJM1I4RmD8h8ScVXsyuIoYCGcye8eIFkMkurL?= =?us-ascii?Q?N553TOzknaghKJHoDiDE4PjcyUnzKInnhNdUkSNBpxqMgeKK1ETEVq1r1UnR?= =?us-ascii?Q?DgdCsTbFhINShO4d//+NrfM=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a2e67fb-0370-4004-da78-08daa95e33da X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2022 18:52:08.9909 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +r4dP3YC1gERAUxi2bk2zfczWsCJ1yFpDWmGpv3XJVM/XsHfrRmqmdA9YjpfKkpRBjBIGTczEthTtKzyxozWh9xsj2ZwlmTkD12VpMmbWhQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the Felix driver would probe the ports and verify functionality, it would fail if it hit single port mode that wasn't supported by the driver. The initial case for the VSC7512 driver will have physical ports that exist, but aren't supported by the driver implementation. Add the OCELOT_PORT_MODE_NONE macro to handle this scenario, and allow the Felix driver to continue with all the ports that are currently functional. Signed-off-by: Colin Foster --- v4 * New patch --- drivers/net/dsa/ocelot/felix.c | 11 ++++++++--- drivers/net/dsa/ocelot/felix.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index fb0a0f7e42ac..70c3e4e203c2 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1283,10 +1283,15 @@ static int felix_parse_ports_node(struct felix *felix, err = felix_validate_phy_mode(felix, port, phy_mode); if (err < 0) { - dev_err(dev, "Unsupported PHY mode %s on port %d\n", - phy_modes(phy_mode), port); + dev_info(dev, "Unsupported PHY mode %s on port %d\n", + phy_modes(phy_mode), port); of_node_put(child); - return err; + + /* Leave port_phy_modes[port] = 0, which is also + * PHY_INTERFACE_MODE_NA. This will perform a + * best-effort to bring up as many ports as possible. + */ + continue; } port_phy_modes[port] = phy_mode; diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h index e6b7021036c2..90e04df0276a 100644 --- a/drivers/net/dsa/ocelot/felix.h +++ b/drivers/net/dsa/ocelot/felix.h @@ -7,6 +7,7 @@ #define ocelot_to_felix(o) container_of((o), struct felix, ocelot) #define FELIX_MAC_QUIRKS OCELOT_QUIRK_PCS_PERFORMS_RATE_ADAPTATION +#define OCELOT_PORT_MODE_NONE 0 #define OCELOT_PORT_MODE_INTERNAL BIT(0) #define OCELOT_PORT_MODE_SGMII BIT(1) #define OCELOT_PORT_MODE_QSGMII BIT(2) -- 2.25.1