Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4485093rwn; Sun, 11 Sep 2022 13:17:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR7DQhULht43ZFsb2vS1gsdxVsf8kBR9Lv1b7UnsIFhlVf11M/WRn/P0HwQ8O7bKIlyw/WEX X-Received: by 2002:aa7:c0c8:0:b0:44f:90cb:2acd with SMTP id j8-20020aa7c0c8000000b0044f90cb2acdmr16010811edp.326.1662927438936; Sun, 11 Sep 2022 13:17:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662927438; cv=pass; d=google.com; s=arc-20160816; b=H8kY+HrkOCSnZL5vqeJj73MgimW3VGphsxEnxUuEgAC86+qtsvJeyJaFm11BiiJzrj JVjSljh+rEW10axh0pOUoZRGs1NcSzqNnlvF2I/PKA4kImfjLVWq2C6MeUlft0um/eR2 8PAC0WkQPfpVd8D5hgXLLXRbs4hxexcLDiszVqB2cbGdUlxy64Yh6rgJVLTJTtZrJa7l 0bjstYheEVtCTylCnDfKOy27lTy6kbqrstX2Zej6yL0OT9npMTAxmkw2SKHoioZz/A0d U+nq72KAnQnyXgP8mYRAlv1KvOyLCFgFKzwNdD++AGkBfiLpHxIS08z91wPOnxGLP0wO 3HDA== 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=+HViFjZUYBhJdDRqMdRSOv+hUz8MatZx/Gql5ZewmlA=; b=VrqydPT8liPY8zoVi17tW6T+dcvcQueqRWVehDTXPE7hxM+WBicEyEi9C7zyQrty0M pD3B02auq6vKTl4h8NAB5vcNwEOS/yoyK/2Gm+jVGNbxFRwPRlt2R2FUUfThrRM7vGnX MUwjqENTK9JTfktG/IWNM5/22j/DPLGFYKrRNw6R65Qeff/jvOPNW/2DsOlQzUJn+STd z+eD1NAa5T3qdtCnw03KtiZKwdUZmo1JyMR9OMUp0QWekziBYr7BQr8keRQ+x3ulOMAH PRARNb/1nx+MTXkapHLp7/nkQG0hvrjXqjBjw1gi1NAS3BIiwiu3UxlLVwJNEfTFXTQh Kqng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=QFEDnM33; 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 l21-20020a170906795500b0073ddf717266si3901037ejo.449.2022.09.11.13.16.53; Sun, 11 Sep 2022 13:17:18 -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=QFEDnM33; 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 S229850AbiIKUDn (ORCPT + 99 others); Sun, 11 Sep 2022 16:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbiIKUDY (ORCPT ); Sun, 11 Sep 2022 16:03:24 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2121.outbound.protection.outlook.com [40.107.243.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFCBA27FD5; Sun, 11 Sep 2022 13:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aHjdnkvsAWU4bpNi5X8jfDUgpN1v5JdlDYiPVZdp+mWjvYr6El5Z2MwMEJ18AaAYkcmtBhd/L0jlwXIvIOD27ocnizZNfHZCYNsyTxrJa3U7kILiMJTT3EVTZxdMY71RV1nEI/Uwr1JX4wwVZanLGXwoAfO3h4t6vzUZPkAAYPmWwcO5xnD9Hum9Ok9p/kCori33ZpiycHXd5L8hSQIJl4YvT2RSrfQ0RCap0fdWmYfB75f8St50jCgIAEQurtgIg1mcStENNJhsHwdOoHkwxPcq0XiSgYqxlLIHpR9BHbp66HBj3qQlmRb9LX0QiG+2c7S80wd3foplEKi6e+zT+w== 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=+HViFjZUYBhJdDRqMdRSOv+hUz8MatZx/Gql5ZewmlA=; b=n4I+jDpGazWf58xiC3awTpe14m/u1nFeIdGIZtjKp9TgY/y64cxYpwkG5gCyPP4JhLHdOy05QYv7zxO9NHucrt8pnV7+sa2/4PXTgwGrsP7EBHXOq3Fwdb+Yl13+5a6wylday24ePEeBDKAH07BGPAyxPhb8eQdwlSnrlyJupd8rlCdJ8B2aP4Bf6xKAjoRAnSuAtAvZnVBugyYhxT+0hsiSbLQsNUr/VMLFpAUij1vhcf2/JYbohkd2VjMH22VoBinE4NMU0y9W+lJef2U42QiP8U5xPXNgQt2kOTRM959Qfk79GKGPz/5CsnhFwFgYdzarta5oEhz2g2wTZPJ1uA== 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=+HViFjZUYBhJdDRqMdRSOv+hUz8MatZx/Gql5ZewmlA=; b=QFEDnM3318yt5kczdQQVKwPSxRz6OEM9MfF3ULP6INARgkcCa/htSW+L7k1FcLOK+swNHnThPb4hGPw0GmPKniLR/SbwNqsDBbFA7lYCooYZZqdHkrd4eILbcHYQUq5HwRo6h/VY5Z0QiW1DIb2lPKHZJdYgzWAPw4OXvHH73CM= 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 BN0PR10MB5335.namprd10.prod.outlook.com (2603:10b6:408:127::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Sun, 11 Sep 2022 20:02:58 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::38ee:4bfb:c7b8:72e1]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::38ee:4bfb:c7b8:72e1%7]) with mapi id 15.20.5588.020; Sun, 11 Sep 2022 20:02:58 +0000 From: Colin Foster To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Vivien Didelot , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [RFC v1 net-next 5/8] net: dsa: felix: add configurable device quirks Date: Sun, 11 Sep 2022 13:02:41 -0700 Message-Id: <20220911200244.549029-6-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220911200244.549029-1-colin.foster@in-advantage.com> References: <20220911200244.549029-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR03CA0318.namprd03.prod.outlook.com (2603:10b6:303:dd::23) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 771bf3a1-1db8-446c-b84d-08da94309ec1 X-MS-TrafficTypeDiagnostic: BN0PR10MB5335:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: REJQzG+N8flTZvNvLm80Jx6OBH2O+Y5fXB4d79IQ9Emc71nWNFmYt8gAAWqMD27ZBdfYSXmh9i1kMs/66QyqqUJQmScAzT3RyNjXzXN5WuH8k3EZFOW8GyCpX+g+tUg0PtOrcaTzujydis+PAkc9GOH71Z90FNaaEqtERxpgUKPC5w+RFEWwVJPwQQdFutKLhAZjhcpUK+9TQNyvxTJVcNISsiVE3xKgWnT4uX/Pn+tiC4eNlzZhfn8Or/kCEm84QW0oH5Wa9Cwy86+tGu4TuBJm5X9V/nnpdhHsl5ybZMnJ4xHN81+/FEFiK4W914F5AoC3DteN3uhVTZz/PNUqZQa6WIQyyWGf4Qc2mnuEX+ezclEjmKjn5AweFq8ntOGrJoE/NsDA384qY9HQ8UpJ7ksebd1m3aIIX3XBJnCEl2RntuV7t27N1UiOLrkAVxaSf4EIUSrD6cHj7lbGDDoQ8h9eQcA2YZYWkH8NTsqG/7hL8wnaDjdWxII1y7g1FPwWmxC3N/qztliHR5oCIRVFKGSqlImgqfQZ68pRY0M9vfn36iuB5RXxnnITZ3kN5YgjaLwmVWq3zB7lTofTtYhCjtvjjAFVFMhezd/ZOyr8CQ2kPHEKYMNvgPV8oWl28aooMDdKZloK7kIx1ArjY02d6s495UEWdBaDrY8GACsmzupEICtj8BDta8TUSihmBZco2KOnZgFOeYUpCJlDnkJBHgxZYjPWNA0OYmoaJdd+4cjAjPefW9bfHxHoVdY9kVgt 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:(13230016)(396003)(136003)(366004)(39830400003)(376002)(346002)(38350700002)(38100700002)(8676002)(4326008)(66946007)(36756003)(86362001)(66556008)(66476007)(2906002)(83380400001)(186003)(2616005)(6512007)(6506007)(1076003)(52116002)(478600001)(6486002)(6666004)(26005)(316002)(54906003)(44832011)(41300700001)(8936002)(5660300002)(7416002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?q4+kIZCCsZjQngT2Yz5ZwM1OKObn5lN4HykC1YO90ui6YCCp44Z97vodu+i/?= =?us-ascii?Q?NjTyER22RDstLBaH+g2c4BXfBrfydRjAFngpoEVeo8vG4ixlH/qNI7hDBHrr?= =?us-ascii?Q?dT70eYSALxMDAkxnPoQDXI5ycNloA7ehfqyM1qkO3/A2Bmu2ctHDRrHXPAkh?= =?us-ascii?Q?YciVZCvJr7AqX5WgvRJqHlOsJmmOLHLQtXZuDY9f03UmuvKnAnI+1A3uwT7l?= =?us-ascii?Q?u+1zrSEMU5V2FwQRMQnSPlHEL1aviszxDqZrCHCt6jYSdoOsgjS03ilrE8ub?= =?us-ascii?Q?oQTNdemllnqOjLjSnPWhejD5nlwxV4h3ha1vQhfPuSd9OFgmpwkRXhAaJE0K?= =?us-ascii?Q?mEUwX/MrUHMAZ5sv+B3261+vtdFzP72BiEFlpwIaQvS24zOpLqlf8+xGtwne?= =?us-ascii?Q?YI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X/7vfeMTIN3H9?= =?us-ascii?Q?0vVpHjgP1FRqVSy7ix9JzzDnnD+MJfcXY4BtV7yfQ9FRgy6ofo3jxGrbW9xh?= =?us-ascii?Q?aK0pA3uC7CLc80K+DKqzOQC8zVKSSISsfa8pkfXVahPwI78jcn6CSi1qHxPm?= =?us-ascii?Q?MA+qNxBTJNpHbdqO8enTwER0ll4qPviWLg6p7bxBDV6Ilqn74rxdbxprwxX9?= =?us-ascii?Q?29v4UgiXzcbiGPC5WjeCPOu9h9/B4AE5HUCea/ztRzN+eoFRGtnyGyXfeyWr?= =?us-ascii?Q?/lZKPWL2qyC4/C5/bAf+aRL0CzOAOWBHBu05blwVv+fk+41GMNUq/NpsZTL/?= =?us-ascii?Q?tA=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 771bf3a1-1db8-446c-b84d-08da94309ec1 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2022 20:02:57.0589 (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: jgJStR4GAHNHlQwXszcFvTq7i/CW6nBrmr9ptZVmeCsKWFyms4Ifh9tx6dCMhajfaHzngTNjBm5d1XGQxI4+onFNPRFVgTcWCV23X8tFyaY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5335 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, 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 The define FELIX_MAC_QUIRKS was used directly in the felix.c shared driver. Other devices (VSC7512 for example) don't require the same quirks, so they need to be configured on a per-device basis. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean --- v1 from previous RFC: * No changes --- drivers/net/dsa/ocelot/felix.c | 7 +++++-- drivers/net/dsa/ocelot/felix.h | 1 + drivers/net/dsa/ocelot/felix_vsc9959.c | 1 + drivers/net/dsa/ocelot/seville_vsc9953.c | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index c73ef5f7aa64..95a5c5d0815c 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -990,9 +990,12 @@ static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port, phy_interface_t interface) { struct ocelot *ocelot = ds->priv; + struct felix *felix; + + felix = ocelot_to_felix(ocelot); ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, interface, - FELIX_MAC_QUIRKS); + felix->info->quirks); } static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port, @@ -1007,7 +1010,7 @@ static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port, ocelot_phylink_mac_link_up(ocelot, port, phydev, link_an_mode, interface, speed, duplex, tx_pause, rx_pause, - FELIX_MAC_QUIRKS); + felix->info->quirks); if (felix->info->port_sched_speed_set) felix->info->port_sched_speed_set(ocelot, port, speed); diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h index deb8dde1fc19..12a1c03bfeb8 100644 --- a/drivers/net/dsa/ocelot/felix.h +++ b/drivers/net/dsa/ocelot/felix.h @@ -33,6 +33,7 @@ struct felix_info { u16 vcap_pol_base2; u16 vcap_pol_max2; const struct ptp_clock_info *ptp_caps; + unsigned long quirks; /* Some Ocelot switches are integrated into the SoC without the * extraction IRQ line connected to the ARM GIC. By enabling this diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 459288d6222c..4adb109c2e77 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -2605,6 +2605,7 @@ static const struct felix_info felix_info_vsc9959 = { .num_mact_rows = 2048, .num_ports = VSC9959_NUM_PORTS, .num_tx_queues = OCELOT_NUM_TC, + .quirks = FELIX_MAC_QUIRKS, .quirk_no_xtr_irq = true, .ptp_caps = &vsc9959_ptp_caps, .mdio_bus_alloc = vsc9959_mdio_bus_alloc, diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c index 3ce1cd1a8d4a..ba71e5fa5921 100644 --- a/drivers/net/dsa/ocelot/seville_vsc9953.c +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c @@ -1071,6 +1071,7 @@ static const struct felix_info seville_info_vsc9953 = { .vcap_pol_max = VSC9953_VCAP_POLICER_MAX, .vcap_pol_base2 = VSC9953_VCAP_POLICER_BASE2, .vcap_pol_max2 = VSC9953_VCAP_POLICER_MAX2, + .quirks = FELIX_MAC_QUIRKS, .num_mact_rows = 2048, .num_ports = VSC9953_NUM_PORTS, .num_tx_queues = OCELOT_NUM_TC, -- 2.25.1