From patchwork Thu Aug 18 16:16:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947386 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27730C32773 for ; Thu, 18 Aug 2022 16:17:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344473AbiHRQRO (ORCPT ); Thu, 18 Aug 2022 12:17:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344457AbiHRQRN (ORCPT ); Thu, 18 Aug 2022 12:17:13 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33CC6BD08F; Thu, 18 Aug 2022 09:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fWhtKdCumVF0jZHfQZj3ALCltmT//StqPe4nwynqKE00VKubD6OVZBuRe9W2nw68AgCSdLY881hubHFwKRfqHwbDpHqa38XIfDYyVLTnCy8x845YA5Okq+TIj/u/B6Y++6LXX3O4TQicJw01kXGCqisAeLTkM9F2sT0ck1WCVQVcRRJ4v/1WX6Y5v35Nkigv6gCbG2KBwGqhzczRK8ucnZo2eokD/8/n6f4eKRw5kr/7rAj0+KMtA7czLA9o1sgSQ6ckHTWUAPTCXZcgo45/rmn/CaJZDrQhA3v9jX/5W2i6KLD8P9OVTjsUAjizoOKdrVTBuVyP8YphQkdOf/JI1w== 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=SZuUDFAVgiNf2kcEotKjgbq3pqDMPDtsajTe/iQusEI=; b=ckuenD+RZTjewgDCSF2nmwH+vhXS5cHrVWOI+NZQNNRI/vTXmYvpKAxX+mNhYvoBArZdJVSHshzLoEftmx/B1zksMd2yJPAxNFrxo5Eb8EoLXLsesJCbwdPL5nP0tp/TYAw6VpnjgvnF76PjjBs+mdn0zqwiPH0rKNAN8bcyteykWmUC0SQseSfaDfdqyvsv3POT+fw02CX3xoWcT9naJ/d7XUP17TmdtqWDYBZxP3V27T4KzjG1Q6pMLO97ffSR4KMNUjMilGbTeX2a4a/c/P9e1RXuAR253sS8aWs0M1oAwCuAs8iiHTlxyiv63csy5BM45zcPD4Vb+Tw9WWfuVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SZuUDFAVgiNf2kcEotKjgbq3pqDMPDtsajTe/iQusEI=; b=NIn/S+LbQlkbo5pPJfIyp+eljX7fYQ4dPz+dOZGrFGAyre2SpMKgkYHqYsExGvJFa0LxY71rhDW2Tq/CXOqMtlMuZb9rB4s6fIwnpTWAHgjZL4gYaj4/FiLy7SkviL8Px/MxoQmx3IQoDU7jGCAWFkDqs9e6uf68dZETxtTaPBRrEpCr8n038LJpMQAF7GRe1urnFaYcxEokqoL1F5+D3lc72t7r0p1u3SWApXFKxZzwkKGHHAiceo+XX5zMwz9PUTPJJXxhypUKrLkEKfKdDNSyfk5KMYkToyLalb0lTZeXpRrvtoMzTpqCbwIMa2XPb/5vj/KyI94cWEFcDG3SDg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:08 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:08 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson , Rob Herring , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org Subject: [RESEND PATCH net-next v4 01/25] dt-bindings: net: Convert FMan MAC bindings to yaml Date: Thu, 18 Aug 2022 12:16:25 -0400 Message-Id: <20220818161649.2058728-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0efe07a0-3059-422d-062f-08da8135195b X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B1WsPvcDaQYKDkTEiXC6KWVs7kWmhTsNtl4QeVaSf0puw39jk3p5+m2FmaWqUgJt4IMCQSyr9KKVmSqAcbxvi+pqN/SyHg+mfQKyvEs7xfzH/SqRidAOKRRswYi/WZTpGfUnz2aUlrvCcIPXKIgC1CgN7R0MVNJgiB4YXOI8jbuJzCvDfbU9FKEW1X2Zy9Fb7GYUntzlF+sUAB/KrnIf0Nx1jdR0ubUzF2JbSDPscqYMM3JRiYPOxXfN3SErgdq4yUAEfDqKfGQeuOEgn/LaN0ixJH7Tp2E2n5Be/J2D5FLAXzhigVNYHsCIvtjE362Y5vflAWDs95wREx1MSj/Y9sSQjQ7kLbxroEkwHF4veZKIwgjLtWefaPDIKiEdCf5Bff/t1aG2/MhaBfFhVwLnEvFYy2l6stQFu+gMN+kqJ8sIz+gt/R/W3cjdCKRTorMacfhnF8YJg6W65LIk8PBcPjFGYnN/+N2eX3Q7ZR3BkXd6I07+LFFMkTZCdCKlM68V4Vk8JO7no5zyd2aeEypD3TwZ1aNJ/Kp++LqXVChmghkUF/vyITH33DZnP+HiDAaWKboq1Sw/iGJRPep6s6unwGORp8tVphiE71tmPylOC5yeUoMP7kEZ8rO0XSl4uEr6PnyM5PI06NxMCm0reHV0F3iy30T40dmchOWEstmuDfUXX9A8buNd2QiSeKa+f/YvULfFmoXaS6PjIqyqCq3MgZ0nIoC9qiYf2QpjyPya4DQvQn0FRoG3PNixx/DjqebzsJTGLZvzoOURc+cakhB6W41lAG12dH+M6XUek12bgJ4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(966005)(86362001)(41300700001)(6486002)(316002)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Iq31MqBf4ml7M6ZFIxwrHzGypUVUbvto9urB7ebKojGRG/NOJ2pVlp3T4uBCMJfwtbmXh2pdg7fHKGIZg66FpzuvDj7p918eYPH50HChEHAVA0lqa80c5tKMAdEds9hLReFmYXfnREy2aI3RrGXerW4IR3GB7e/uy+R0OCb3cF6hTmhl8YrmWKXuR1YvImfuSg7JQYRQbWOpUsFkSKYS0vYXQqG7MmUg1pbz67RknTQGFIBkZkswceryGFVwjiPhDcZdueyESEGH2Plf3RGQlZ0MtDGOhOsHrrkK4s58Go1gsacMcnQyGMRRm3Yl3uD1KRO/6Ji9kS5W9jdFXYRxlO9T7RPhQMk818xfBxlCtkklcH+cGaImRDpzQBETeksSfayLt50SRImjYQa5juNgJ9wS+D8ZogO4ySZu18ozKUNhcdoocmI2yKhFCRLZ8n+LzNvIWjZwDZxZlrR3bLZojXQFuMU3Wa5nbE+NLWB+dJqMpt+ul73w3BnDav6ln6zSnk8k1Z8IHU0bozGgthWsRIwDMEfoTOu3wZFXfZnjSZIk74+C7+WbENNvNOABUzx9EtCn00TWm4Jbzr/WPj00p3lmidOC+DFThzyo4c1GLVsHQ+piybFVskmxqoZ6gJbWv4T/lqacGUQaYx0Jc++9/lOS5X2aABfe00su3VHC94GuXmCDPYlojNtPZb2kNEiJQhyAz7HLl5KNDmJk1DzSAp3Dd9DUZt7xhksMrU2kxutyC9KwP700X+uedQCgdFkLD6m1mszDY7D1oZluLdQsCp+SGHKNswTq5Y9UEcv1j89xwvLjIlCHXK/1FcpaBHYLVNxjhiQeLi5gTl8cqsN8RW5ju5GjgoK7wGG7DGR0tCotXeA8AzlB7gY99zKyXgO8PpWvyNcd0qNjIGBPwUQq7itm7nKjm72FQl1VCvtBeqpBf8s7gnj21L9PA2NyWdo2StqLXiQRa6diKDkjsP4AcNFm2QnqGPwkyeOA62Eu1mCCgO/vkV+0q62dwyxb1sOVNcB1qD9cbgq7ELxqbjo36JfaA6yQGR+Hex1j4e7HTpfLm410aRFoIO4y62XXlsW7Bh5lva7Efyls9oXMhBowXPt1t5oSycnoADOe11akv/6JnfLrF5VYwJFwsP/eqh1rjTYZ70fbd53KtJJ9K/KTBPS9G01FHzeddVSzQv1Tz0MYZCB2lVchbBoR7uKfVoITdrnryR2VJFwquR6hkzgd6vXFcgE+VURXpX4/Gq5AH986qU7YtuyoYWG1w7g0INlN8bubtUqTly2PUEKTZR8tmhWDp+va8Lr0lHrgmWNZb6L+FxWzQIdMVdP55wYQ8LQ2SWiZBCMbkW6lsDWf1kX2uIOBiGRNu7VsirVPm9u859qM2kT150YZAQY1nO/XE3RAXMdUzCliYh3LdVW5I4Rc1gXDY+Ijpgxd8c5a+K6AUsXEHTfWkxTwksj3/lqh6FawfAdR69KSiuOunEjblAUd0w7WiV78QpZ6aRrW1sT6S8qAnaleE3jWlo0OWEinD/593qsMFNbg4d154fV9oSlrUVINmMIfjpmXowybtKt0YNnKkwA17gzRv5RTIZjGQ5Am6vqmO+J+4HNzbxHszfL5Ng== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0efe07a0-3059-422d-062f-08da8135195b X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:08.7023 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TfAw7VK7e4HAz59eDHlzQwIG9SBM2CyvKONcnxMOO9X30SB4gVWS9xzEXmp6mXwulsbNFBuEMnFE7nVEJ5UF0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This converts the MAC portion of the FMan MAC bindings to yaml. Signed-off-by: Sean Anderson Reviewed-by: Rob Herring Acked-by: Camelia Groza --- (no changes since v3) Changes in v3: - Incorperate some minor changes into the first FMan binding commit Changes in v2: - New .../bindings/net/fsl,fman-dtsec.yaml | 145 ++++++++++++++++++ .../devicetree/bindings/net/fsl-fman.txt | 128 +--------------- 2 files changed, 146 insertions(+), 127 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml diff --git a/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml b/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml new file mode 100644 index 000000000000..3a35ac1c260d --- /dev/null +++ b/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml @@ -0,0 +1,145 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/fsl,fman-dtsec.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP FMan MAC + +maintainers: + - Madalin Bucur + +description: | + Each FMan has several MACs, each implementing an Ethernet interface. Earlier + versions of FMan used the Datapath Three Speed Ethernet Controller (dTSEC) for + 10/100/1000 MBit/s speeds, and the 10-Gigabit Ethernet Media Access Controller + (10GEC) for 10 Gbit/s speeds. Later versions of FMan use the Multirate + Ethernet Media Access Controller (mEMAC) to handle all speeds. + +properties: + compatible: + enum: + - fsl,fman-dtsec + - fsl,fman-xgec + - fsl,fman-memac + + cell-index: + maximum: 64 + description: | + FManV2: + register[bit] MAC cell-index + ============================================================ + FM_EPI[16] XGEC 8 + FM_EPI[16+n] dTSECn n-1 + FM_NPI[11+n] dTSECn n-1 + n = 1,..,5 + + FManV3: + register[bit] MAC cell-index + ============================================================ + FM_EPI[16+n] mEMACn n-1 + FM_EPI[25] mEMAC10 9 + + FM_NPI[11+n] mEMACn n-1 + FM_NPI[10] mEMAC10 9 + FM_NPI[11] mEMAC9 8 + n = 1,..8 + + FM_EPI and FM_NPI are located in the FMan memory map. + + 2. SoC registers: + + - P2041, P3041, P4080 P5020, P5040: + register[bit] FMan MAC cell + Unit index + ============================================================ + DCFG_DEVDISR2[7] 1 XGEC 8 + DCFG_DEVDISR2[7+n] 1 dTSECn n-1 + DCFG_DEVDISR2[15] 2 XGEC 8 + DCFG_DEVDISR2[15+n] 2 dTSECn n-1 + n = 1,..5 + + - T1040, T2080, T4240, B4860: + register[bit] FMan MAC cell + Unit index + ============================================================ + DCFG_CCSR_DEVDISR2[n-1] 1 mEMACn n-1 + DCFG_CCSR_DEVDISR2[11+n] 2 mEMACn n-1 + n = 1,..6,9,10 + + EVDISR, DCFG_DEVDISR2 and DCFG_CCSR_DEVDISR2 are located in + the specific SoC "Device Configuration/Pin Control" Memory + Map. + + reg: + maxItems: 1 + + fsl,fman-ports: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 2 + description: | + An array of two references: the first is the FMan RX port and the second + is the TX port used by this MAC. + + ptp-timer: + $ref: /schemas/types.yaml#/definitions/phandle + description: A reference to the IEEE1588 timer + + pcsphy-handle: + $ref: /schemas/types.yaml#/definitions/phandle + description: A reference to the PCS (typically found on the SerDes) + + tbi-handle: + $ref: /schemas/types.yaml#/definitions/phandle + description: A reference to the (TBI-based) PCS + +required: + - compatible + - cell-index + - reg + - fsl,fman-ports + - ptp-timer + +allOf: + - $ref: ethernet-controller.yaml# + - if: + properties: + compatible: + contains: + const: fsl,fman-dtsec + then: + required: + - tbi-handle + - if: + properties: + compatible: + contains: + const: fsl,fman-memac + then: + required: + - pcsphy-handle + +unevaluatedProperties: false + +examples: + - | + ethernet@e0000 { + compatible = "fsl,fman-dtsec"; + cell-index = <0>; + reg = <0xe0000 0x1000>; + fsl,fman-ports = <&fman1_rx8 &fman1_tx28>; + ptp-timer = <&ptp_timer>; + tbi-handle = <&tbi0>; + }; + - | + ethernet@e8000 { + cell-index = <4>; + compatible = "fsl,fman-memac"; + reg = <0xe8000 0x1000>; + fsl,fman-ports = <&fman0_rx_0x0c &fman0_tx_0x2c>; + ptp-timer = <&ptp_timer0>; + pcsphy-handle = <&pcsphy4>; + phy-handle = <&sgmii_phy1>; + phy-connection-type = "sgmii"; + }; +... diff --git a/Documentation/devicetree/bindings/net/fsl-fman.txt b/Documentation/devicetree/bindings/net/fsl-fman.txt index 801efc7d6818..b9055335db3b 100644 --- a/Documentation/devicetree/bindings/net/fsl-fman.txt +++ b/Documentation/devicetree/bindings/net/fsl-fman.txt @@ -232,133 +232,7 @@ port@81000 { ============================================================================= FMan dTSEC/XGEC/mEMAC Node -DESCRIPTION - -mEMAC/dTSEC/XGEC are the Ethernet network interfaces - -PROPERTIES - -- compatible - Usage: required - Value type: - Definition: A standard property. - Must include one of the following: - - "fsl,fman-dtsec" for dTSEC MAC - - "fsl,fman-xgec" for XGEC MAC - - "fsl,fman-memac" for mEMAC MAC - -- cell-index - Usage: required - Value type: - Definition: Specifies the MAC id. - - The cell-index value may be used by the FMan or the SoC, to - identify the MAC unit in the FMan (or SoC) memory map. - In the tables below there's a description of the cell-index - use, there are two tables, one describes the use of cell-index - by the FMan, the second describes the use by the SoC: - - 1. FMan Registers - - FManV2: - register[bit] MAC cell-index - ============================================================ - FM_EPI[16] XGEC 8 - FM_EPI[16+n] dTSECn n-1 - FM_NPI[11+n] dTSECn n-1 - n = 1,..,5 - - FManV3: - register[bit] MAC cell-index - ============================================================ - FM_EPI[16+n] mEMACn n-1 - FM_EPI[25] mEMAC10 9 - - FM_NPI[11+n] mEMACn n-1 - FM_NPI[10] mEMAC10 9 - FM_NPI[11] mEMAC9 8 - n = 1,..8 - - FM_EPI and FM_NPI are located in the FMan memory map. - - 2. SoC registers: - - - P2041, P3041, P4080 P5020, P5040: - register[bit] FMan MAC cell - Unit index - ============================================================ - DCFG_DEVDISR2[7] 1 XGEC 8 - DCFG_DEVDISR2[7+n] 1 dTSECn n-1 - DCFG_DEVDISR2[15] 2 XGEC 8 - DCFG_DEVDISR2[15+n] 2 dTSECn n-1 - n = 1,..5 - - - T1040, T2080, T4240, B4860: - register[bit] FMan MAC cell - Unit index - ============================================================ - DCFG_CCSR_DEVDISR2[n-1] 1 mEMACn n-1 - DCFG_CCSR_DEVDISR2[11+n] 2 mEMACn n-1 - n = 1,..6,9,10 - - EVDISR, DCFG_DEVDISR2 and DCFG_CCSR_DEVDISR2 are located in - the specific SoC "Device Configuration/Pin Control" Memory - Map. - -- reg - Usage: required - Value type: - Definition: A standard property. - -- fsl,fman-ports - Usage: required - Value type: - Definition: An array of two phandles - the first references is - the FMan RX port and the second is the TX port used by this - MAC. - -- ptp-timer - Usage required - Value type: - Definition: A phandle for 1EEE1588 timer. - -- pcsphy-handle - Usage required for "fsl,fman-memac" MACs - Value type: - Definition: A phandle for pcsphy. - -- tbi-handle - Usage required for "fsl,fman-dtsec" MACs - Value type: - Definition: A phandle for tbiphy. - -EXAMPLE - -fman1_tx28: port@a8000 { - cell-index = <0x28>; - compatible = "fsl,fman-v2-port-tx"; - reg = <0xa8000 0x1000>; -}; - -fman1_rx8: port@88000 { - cell-index = <0x8>; - compatible = "fsl,fman-v2-port-rx"; - reg = <0x88000 0x1000>; -}; - -ptp-timer: ptp_timer@fe000 { - compatible = "fsl,fman-ptp-timer"; - reg = <0xfe000 0x1000>; -}; - -ethernet@e0000 { - compatible = "fsl,fman-dtsec"; - cell-index = <0>; - reg = <0xe0000 0x1000>; - fsl,fman-ports = <&fman1_rx8 &fman1_tx28>; - ptp-timer = <&ptp-timer>; - tbi-handle = <&tbi0>; -}; +Refer to Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml ============================================================================ FMan IEEE 1588 Node From patchwork Thu Aug 18 16:16:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947388 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2331AC3F6B0 for ; Thu, 18 Aug 2022 16:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344565AbiHRQR2 (ORCPT ); Thu, 18 Aug 2022 12:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344457AbiHRQRS (ORCPT ); Thu, 18 Aug 2022 12:17:18 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F4BABD099; Thu, 18 Aug 2022 09:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KdwAyxSclAcwJyr39CSvtZ0ifKg+NHVIBiH3fOoiORZnY6UMsF4MUi/z5DIMAY/7D9RQSyiTFxzzNuTM0mD2bEnbwAVLgAj1SaP8z7YbDxaSCrD5dj/nplXeeS3RweORyOzrp4F7UEhOEPPf3wY6KBXis4iYEZe8gZubLnO1HaCbR9fYso6sGJFN40tMtRdUWZ6Dw86qxiJnzM/z38/YPjmR9EfVQJLA1F3hYkh52ktv5mSqk9D9DRu2GOnJT8D714uwhtB73CYPL7oeYWbJGM4kVJWQ2gqllGUlM7xLsOsW51ET9n7ShsNMFJJAuSagHYLKfBVIiOrB9nwBxaqvqw== 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=OYvIu+eD8xuwaZeeIpqrGKTF6KIS03fE1xK9b/GiHNM=; b=QQApD4lsLZTg/BMNb/d9khk3mrQgJyB7fqmJ2Mar237c7nNy6LCRNB6yAJzeZ1p6pdJFfZWshtLMGiGeAV3hbUn8zXSS/GqJORQaBnbC0Lg9iTD1LP+1oTbJHeovtmb99G2/uf7caDAJDnhSQPcATVyaxJCGLM6iknCSeq7B6o1bxndpA6/5bLUSTGnEgUimkJQu+W5WkhsUY1nra6WlKY1g6elu/CGYn/ccU6ULi6AjkKj21E3Ff9coOBpXs7V43vrwWjI5xy0pL3IK8zCy+9HQ9hS7/3BN8KhzTt+RGXiJQKpNMindHTzRT7zvnHjQR5Gq42l+GxI1i8/AyIa6Bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OYvIu+eD8xuwaZeeIpqrGKTF6KIS03fE1xK9b/GiHNM=; b=ZSLgaAivPBO91uOZWt/5tAtGHJAHY0ptrTWZgwryfKmZKK7qnlZuc3hlK+v8n7vVmjTACTFSKQF4DIPnXdoS89lO/AcZLMe3/NEaXW2wc6MBM3268lBoOxRSbP8FwyrIcrFNmXJlDR0A6Hi2uyro5gZM0ZKqFyz0FIg5X92t7B6Uib6/P1IeHJRNqZSPXY8YwV+cko1+9UB7HwQImBI2lmrwFaaMuy1PipCnS+faO85+H1Qh8jj6tob5SGZHfvH9ND2tfAqofXmx15h7mlx68lnWUEf96zeS/K2SBB8pdAwuik1TRJn6KAThBQ3Dd4op2o7EJhe/5BlVYrBXdkXlNw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:10 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:10 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 02/25] net: fman: Convert to SPDX identifiers Date: Thu, 18 Aug 2022 12:16:26 -0400 Message-Id: <20220818161649.2058728-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7fdf7e97-6a9d-4eec-1d85-08da81351a5a X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jhsykia+PfVB/5vrxQyaTm4AjWidflJONEVmDR+Ge27Q71agIBQpBbf4i1qt1E3aqbCnsj1L9s28T4QFb8kKqz4Hhguk5iEHOX0nNplqcuGbcNtyknFZBqX6LNCa1nKJMvsbaOpTJtIe9/CQ3W8O5SfYrB+cruagsqZ7q7ev4CBNztPOs2Y1OzaBBq84iThCH3HNCTJJL7sYbPpO6Dl+lCozVv8Guasv88WC6zNKB+ZVbKreEkpcIzycjalQySGC+OuBkImm1ei+Dl1VgrFixrGT4WZTawNblaDjIu30RommY4oFYtLQJCmzIB8T/hH2jqD1m3gtBivH3s2cQzHcl2jnRvPPSPAx/v23pqKqERDxrryqHIksadFUkGLMJvJZ/5H3qPeJUqRGamt7p96NWZ9sDPMONKv5CWzX37akZU2bvfPYkB+ba7ZDOfynxS5EvFoAQtP2hlzeB4fGP69AJ2Q0avQ2D3zXrtB4FvjchtVp2o4/KoTciob4UaaZ/43ppK95RUngLnmmy29k6yLtTUhFA5MSZVUgQFNzWH2EZ6xZY/nKS5/DTzjh8YcbZz4le2D+tIwXbOajNG/aOlZP6fqEnHQuijTpxk3AyZXAwl36KZI/gAO63JXlC/1Nj6G5d3UxAO0mWcKYBBrPslh6rIQDIhN1kDp8H8xkCXOFURv7n1ysZX2o2qn4PlhDINlRtk1MvSmH/nDPKm1dk+jxuSwNOhrPaOjeF+973GMVQT5o7Re7gtaxtf2olaD6cU/l+XYrvo5kH9WATB5YbP5xpQgfqc0AQlZgX5fpRB/RtWY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(30864003)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002)(2004002)(579004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qEZPHqCK61PqRy82pjO8NFzIbtoFrcWOkAajj0tfFhO4fLr6sZAfafhGXm34aQxsyJExfLvE/KsWHDKrBp8JvN5b98qxA0PrmqEo4/1SQzZ0MeVqhBqJ6KC0NyPMuwcTuv/haiQsKkFxQc5kcWslXYDn51Pp3HpEh7F6aB+ME+2nH6Ny1sHiG+6Hwc543WAZb5QBQvXHF3nnbt6w6IJqkKZHKMDwO3ji6rMVAyPrV1Q00780Wo4RcGb/KECdFGL/QJh27KuAdK3IQO/9tPPFUkeNRFY+CTFfQTrR7OLnC0UeIuuaQWP03YPOS6RCTBbzwpdHCt3qkGHV1K3T4fsUfdigy+q2S8xWAEf9jVVpMm+/viTaZqbzLhczrThiF0GCUUpmPA6Ymck6baqSkQr43QXnn9HcO8AyzD66001Bh4srrIVpJpDGerfwcIBMWSUV3gomNh9V35kjSfVmd7+uOaI6jdP7yZBXDeQDIZOKOaL43yOcN765dvzdMfoQ4EsrexvgalT9DTwMuvTkyHLSrB3dvCQH/rBfs1bHyCsRLo1ZfMDESr576t/5PwCqjn07uEOX1VHuVkGVPQADMcnvAaqCeOf6PeA/twAtufG1nDjrUnpGklMjuiEROehdvlXlLhaJ7fGD1oBHbt+K3pRP13UvzOvN4Os80rUtU+y0+zXkTHjBfExs/JiNVzpO9HczYT9jkSWr7mhueAf6YSAirTx2Bxw0ZcCC92WQpWIgqHBFaC250fad+B2xSaz/BdHL4j39QkvefpM3finnZ8iFEMwXThwr3qs6ZKVrwnKK5YWnrYwVmw5pZZy++2hOvESxcl64qyHTtKxfHyELXM1XykRWOUMLsfUmVn4hbyB71M1NKsm9l0kUQsUEYYmwnEN4IupESH/074vuCsGSOtWFZVBUjLDeucFlmNoUAqKwvr303UhDNJawLapCCapZ7GQdULEwMQR+hCYQ8Yd/B1R+whGwI3Q4jQm5Aongw+Ls3EHzjtf8YYLkpie5J3S6EpBZ4IO01IFwHeNVHf+lpS4DZnsTV8zVMTxQMQckfro3Awt2UFHeS9x6yOSE42SAGAHnkC5Nl2Zvd1orD0SdlagtNaZWDLYQY5TUx+DTN+LFWLM0dbYLNCk07SjirgmyW3fVnaeb+GIiPrOCSvKgTM3RGVUFERWgh8+JTXgeWj8skB35u1ENzwxcp+T4x8jlr/luiRd6bs78ajJzB6oZz0fKvRc+AfUqyVM5BUSVbDe6144J0n5eKQVDCJXNvQ316fvyzALUP7W0mKFeuJ6+rLUV+O0xCo80R5bsqR99CHvVW/3v5yZ2MDugDtSuAZowTU1KlfF542rgLwV/DI39GB2FmVeEva7P76+dFPsuD7x3sFVNqOyPicaYnCKvZYHVjmcwuPA8NqMzka8RfDe++d2fzqrmriYBUV6YQM+ng/xw6jmRfLK/sNNUIUuktW8T1kuWXPE0cRE4rxLGfieRU8ywUR8zdIOPuBRNR/a2omF9+zhtSeCFoX6z0GcvV1zGp+5cSshBu2oT+8Bzh5i3cCS28OZOLo0OErCYKmlEscVPawpZRduzh1V7RpiLFx4Wzgk4nK6TS2Aj9N6w/PSMgkFh7w== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fdf7e97-6a9d-4eec-1d85-08da81351a5a X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:10.3897 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6UDSQIRBvaZfg6Q2ifpuwXib2JbpQrQDpYGPSFM1H+NVsSw4hY/PUWVEKE7N1PQWvLV/ofn3cfUVsteCe9b+OA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This converts the license text of files in the fman directory to use SPDX license identifiers instead. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/fman.c | 31 ++---------------- drivers/net/ethernet/freescale/fman/fman.h | 31 ++---------------- .../net/ethernet/freescale/fman/fman_dtsec.c | 31 ++---------------- .../net/ethernet/freescale/fman/fman_dtsec.h | 31 ++---------------- .../net/ethernet/freescale/fman/fman_keygen.c | 29 +---------------- .../net/ethernet/freescale/fman/fman_keygen.h | 29 +---------------- .../net/ethernet/freescale/fman/fman_memac.c | 31 ++---------------- .../net/ethernet/freescale/fman/fman_memac.h | 31 ++---------------- .../net/ethernet/freescale/fman/fman_muram.c | 31 ++---------------- .../net/ethernet/freescale/fman/fman_muram.h | 32 ++----------------- .../net/ethernet/freescale/fman/fman_port.c | 29 +---------------- .../net/ethernet/freescale/fman/fman_port.h | 29 +---------------- drivers/net/ethernet/freescale/fman/fman_sp.c | 29 +---------------- drivers/net/ethernet/freescale/fman/fman_sp.h | 28 +--------------- .../net/ethernet/freescale/fman/fman_tgec.c | 31 ++---------------- .../net/ethernet/freescale/fman/fman_tgec.h | 31 ++---------------- drivers/net/ethernet/freescale/fman/mac.c | 32 ++----------------- drivers/net/ethernet/freescale/fman/mac.h | 32 ++----------------- 18 files changed, 33 insertions(+), 515 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c index 8f0db61cb1f6..9d85fb136e34 100644 --- a/drivers/net/ethernet/freescale/fman/fman.c +++ b/drivers/net/ethernet/freescale/fman/fman.c @@ -1,34 +1,7 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later /* - * Copyright 2008-2015 Freescale Semiconductor Inc. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. * Copyright 2020 NXP - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/net/ethernet/freescale/fman/fman.h b/drivers/net/ethernet/freescale/fman/fman.h index f2ede1360f03..2ea575a46675 100644 --- a/drivers/net/ethernet/freescale/fman/fman.h +++ b/drivers/net/ethernet/freescale/fman/fman.h @@ -1,34 +1,7 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ /* - * Copyright 2008-2015 Freescale Semiconductor Inc. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. * Copyright 2020 NXP - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __FM_H diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 1950a8936bc0..a39d57347d59 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -1,33 +1,6 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later /* - * Copyright 2008-2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.h b/drivers/net/ethernet/freescale/fman/fman_dtsec.h index 68512c3bd6e5..3c26b97f8ced 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.h +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.h @@ -1,33 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ /* - * Copyright 2008-2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ #ifndef __DTSEC_H diff --git a/drivers/net/ethernet/freescale/fman/fman_keygen.c b/drivers/net/ethernet/freescale/fman/fman_keygen.c index e1bdfed16134..e73f6ef3c6ee 100644 --- a/drivers/net/ethernet/freescale/fman/fman_keygen.c +++ b/drivers/net/ethernet/freescale/fman/fman_keygen.c @@ -1,33 +1,6 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later /* * Copyright 2017 NXP - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NXP nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY NXP ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NXP BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/net/ethernet/freescale/fman/fman_keygen.h b/drivers/net/ethernet/freescale/fman/fman_keygen.h index c4640de3f4cb..2cb0df453074 100644 --- a/drivers/net/ethernet/freescale/fman/fman_keygen.h +++ b/drivers/net/ethernet/freescale/fman/fman_keygen.h @@ -1,33 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ /* * Copyright 2017 NXP - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NXP nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY NXP ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NXP BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __KEYGEN_H diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 2216b7f51d26..d47e5d282143 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1,33 +1,6 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later /* - * Copyright 2008-2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.h b/drivers/net/ethernet/freescale/fman/fman_memac.h index 3820f7a22983..702df2aa43f9 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.h +++ b/drivers/net/ethernet/freescale/fman/fman_memac.h @@ -1,33 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ /* - * Copyright 2008-2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ #ifndef __MEMAC_H diff --git a/drivers/net/ethernet/freescale/fman/fman_muram.c b/drivers/net/ethernet/freescale/fman/fman_muram.c index 7ad317e622bc..f557d68e5b76 100644 --- a/drivers/net/ethernet/freescale/fman/fman_muram.c +++ b/drivers/net/ethernet/freescale/fman/fman_muram.c @@ -1,33 +1,6 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later /* - * Copyright 2008-2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ #include "fman_muram.h" diff --git a/drivers/net/ethernet/freescale/fman/fman_muram.h b/drivers/net/ethernet/freescale/fman/fman_muram.h index 453bf849eee1..3643af61bae2 100644 --- a/drivers/net/ethernet/freescale/fman/fman_muram.h +++ b/drivers/net/ethernet/freescale/fman/fman_muram.h @@ -1,34 +1,8 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ /* - * Copyright 2008-2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ + #ifndef __FM_MURAM_EXT #define __FM_MURAM_EXT diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c index 4c9d05c45c03..ab90fe2bee5e 100644 --- a/drivers/net/ethernet/freescale/fman/fman_port.c +++ b/drivers/net/ethernet/freescale/fman/fman_port.c @@ -1,33 +1,6 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later /* * Copyright 2008 - 2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/net/ethernet/freescale/fman/fman_port.h b/drivers/net/ethernet/freescale/fman/fman_port.h index 82f12661a46d..4917fe8f0617 100644 --- a/drivers/net/ethernet/freescale/fman/fman_port.h +++ b/drivers/net/ethernet/freescale/fman/fman_port.h @@ -1,33 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ /* * Copyright 2008 - 2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __FMAN_PORT_H diff --git a/drivers/net/ethernet/freescale/fman/fman_sp.c b/drivers/net/ethernet/freescale/fman/fman_sp.c index 248f5bcca468..0fac60aa5283 100644 --- a/drivers/net/ethernet/freescale/fman/fman_sp.c +++ b/drivers/net/ethernet/freescale/fman/fman_sp.c @@ -1,33 +1,6 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later /* * Copyright 2008 - 2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "fman_sp.h" diff --git a/drivers/net/ethernet/freescale/fman/fman_sp.h b/drivers/net/ethernet/freescale/fman/fman_sp.h index 820b7f63088f..a62dd21c81f1 100644 --- a/drivers/net/ethernet/freescale/fman/fman_sp.h +++ b/drivers/net/ethernet/freescale/fman/fman_sp.h @@ -1,32 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ /* * Copyright 2008 - 2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __FM_SP_H diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 311c1906e044..a3c6576dd99d 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -1,33 +1,6 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later /* - * Copyright 2008-2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.h b/drivers/net/ethernet/freescale/fman/fman_tgec.h index b28b20b26148..8df90054495c 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.h +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.h @@ -1,33 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ /* - * Copyright 2008-2015 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ #ifndef __TGEC_H diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 39ae965cd4f6..2b3c6cbefef6 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -1,32 +1,6 @@ -/* Copyright 2008-2015 Freescale Semiconductor, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later +/* + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index daa285a9b8b2..909faf5fa2fe 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -1,32 +1,6 @@ -/* Copyright 2008-2015 Freescale Semiconductor, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ +/* + * Copyright 2008 - 2015 Freescale Semiconductor Inc. */ #ifndef __MAC_H From patchwork Thu Aug 18 16:16:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947387 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C88F1C00140 for ; Thu, 18 Aug 2022 16:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344547AbiHRQR1 (ORCPT ); Thu, 18 Aug 2022 12:17:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245699AbiHRQRO (ORCPT ); Thu, 18 Aug 2022 12:17:14 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97E5DBD094; Thu, 18 Aug 2022 09:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=InDH2jUFdfMYbH/R3HPzYOpE1hzMMrfpAtfNSKg6unlCZEltCKo4ejojbjBDuyEoAditjtYHn7NdLmDesF0QbSL0oBexo8f9eXLq3qR+HOq7CHwJbNnLzhaLUL0NaCW+I8UaNrTd1DoXqSaiz8jed5/Z8nEqfWmRc2lncut+PJAhCZkEBLXeV35S3sSKmLgCE0qxxde048uL0s3kzW/ESzHHGAZLsIwUyCwDu779rWdpAVj2A5T8OgMtDKsFogOnGtjNCY/PPnhv1TeVwoBqldSY+U4oKcM20YwuAf8FR32jvH3z2opPHv/ew8X7fsQmdO8PZTdLPMA0xsVu5oVTFQ== 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=bxl5ypHVF2yTjwLwhCMIKk+7ahbMUu0knhMwR6YqOck=; b=miZOBtrp6ljmpBOe003/+nlrMeqz4wI4tbSntufJiNV+QUOB1z0O3GGaAkH1p17u3lWBIyfiq+GjoKRBJsYyTaNeH2iwpi+vtbntaPqU+WdJjenxuEU4Q7Qf2a7ib5ueRL9QcznE+F7n0zbuzFIgO9/F5hq/nbM5jWXMPIN1nitgTuXe/B91gdYYDZzLNZ/Ip0WeZrLOm5dqSHKBi/KKNZ4HPcgNVKfyRjsExx1h3/lIHesDMChSPMy16clSfFd6/Ell04hNToZWfsKDjj5qUVVPl9AtEpEJqCU4ugBCVQYOyl3LL8FP9fuT7QCwGjEv3MdVkN6Rkus9HdAuRmg6xA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bxl5ypHVF2yTjwLwhCMIKk+7ahbMUu0knhMwR6YqOck=; b=10y6/FsSE7SNzWXdZEAxCm54EPFPaWY3rM6v6JPeLxE7jQpzAxFldgbwh23ZCgRtXlYn+petYeS7JxoELGoT7YUV1sXTeifyaFD+GeO/aY8TIFTeF1q9kTEmzgBuzVMH0tIoUPGWjx1i2bvucNx8rRcBlE0wztwTcX/DYC4UvvyTIR8ryIARqgA2w2352EnXYTbcEPuCih7+HvZHNIlkOcTh/ehdpaL3z5T6OU/ioCgPVib0NRB05HfVYDgNEV5YNu7nCFTssh8YEV19MUnx1bNvHDJsTilixONlxhKKQ8VngYTudQX6uP+ynHhrxVnxidvTeytAUnAw3/E5zJ09nQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:12 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:12 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 03/25] net: fman: Don't pass comm_mode to enable/disable Date: Thu, 18 Aug 2022 12:16:27 -0400 Message-Id: <20220818161649.2058728-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f793a05-aa62-4a78-5b8b-08da81351b60 X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PqmqR/aKr6IgQ87l3CE4lG/CL+bmob2BzNrXkTxwJ5ALzL3X63vu4O8jAQMSys82Z9R9pSLxqON5H7zH30oYNtMjtejEUcBbqUbZ+2A5QzHBn/OxveEtjBx3soV/sFc6htYGal76SJXlVaS3j6gMQHNjc1FqLq/Sa21bA7/VLLF6rYD2iI1uXWpWma7LLTK//GfvEFTEmN9AmmxDX8OJS9risngEGytRXyXFfHhvrMNHhlijf+mksSp/ZR+nP1gFKtE2cGghcFjgLIOtTsJ0IWIicArOya9SY9gtwwWkoLNQKHpFvrtAFOhFuMe0KJvPyONnirSaArzNuAYwAEPEiXhHllGX428aLHv/iuysyeSp0QjkiYjUXriBCSSTKAAQPAqtB2MrjJNyYCTU1ZcLWEqdc5bXQiENwyq13690NETykeZYnfoov+5SECKOniopETBIwLIiW1R4m5hPAMDxV5PiMzpAYIrmo0kvV5vAwE9rRJCL97XJczkpYqTpLwr9eI7v0zAVOahuG2KGDXnQRqjJFkQVIYFh6QjWDRzV2VNJK06bmItS1VUstQ5peEN7ozsWsI7lxc5UOOviRl1LnrqfBY9H/1aBupSs6+VClnPQ2wBpZRmMrfAx9SjgqVemIVOIqorc2SyznWzbAvDlpmMXP3nYRe9h3BVTT/E/sr1ndzan4mx+W2JKo5N228/euu1cx/DmnPdC/NOju8uVxqdcHhiOzET0g604m3FXSn7226g0B6JFu7hWkSCQyk4jB+9AfrfrHIuO6HI7CdzRtg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IfKJhn3K1z+CHVo1nQuOoKJ3rjkpFS5/ay52lpdHHeqRQbTG91uf4rprSzA2uj1m9kV8omeOmwNd+fWVM7VyO72MxSz+y664MVps0mLYlleHGF03r0tf3lYBEyDzFhKp/VbFKVToSVCPyLr/0W0JorTsEPhtaA98kPxByUXlpoV7P7fsNJqIM9wqtHzEp5VGZrIGQfwzRywzjPCDt9H0cctal90+pH8ym4hWylSGPoseYssVTOXtVYrhvCqYvujgpA+2byl3blxYCLOMWUY8OYQJNuCY5qisf3XFoXJGdaN+swAUllpUzBCKoM6vS7bvoDytwLUtXyJ+OHEbf3ftFaclj+XZmfGClhAhWgelDoLCesjyUpBWOXlkPvxGJlUpZvXyI1obfNuBNtcZZgKv55e0eauZBHsirshCl+I/ZBG9ZW3b/x2omwwFpVXwdXUpEYDN32JwU1VwO7/QCx+svtUuIcb+pOY0x1xYlDpcOzgnvIXcrkOgKGbyg91VVEhYoURy57eyoWGB/uVGEG5vYq3VizxhksSd+Z6fHdMwnwu1YTpx1CBf8Rwrjy8A+6EFAF2vAYRYn+JtSmCmhXnWQ50AhmUbEVPeB1R0Yf3AN/AVIWRkGhEmpMPmBFr/PNjaNNr6aNq+LpyhvXhIbZrht3fYUuF3dfuijE0j7R0AIflPJ+HFGh5FscPQ7+3xt+bCbUBwqYG8uuIkOAmEG2xOvAPg35T4e9etK7DP4IVvLaEMXTMdaeFyMnirzzxTM2D4MFll4GMhwbtHhCmpsz1iPBDMwR3rgnzHsj7Ps3z/GVhmAH9HKjR4q0oOs3xR2D87V6gNSGenj8PZBKA1N0VAovJ5Of8Bvge/Xq61gkvm1SwC7fAwtYKCg49pimjbmq1Vqo5h6UAmbphyma9FegXuUIsIgdhJC+ZiCit7xvAyrtKNiyhmeeirIdy2mj2dKjkxhZDANMaHxSS7yZTheQxs453JzOFelovviVJ9hcj1cTQ6ZBzogYW2UpQTTjWSS8dMZFDK+2PyDoNiRa1LGgN+b4do5Ntskhe5Ips2Y0Oja3WQdZux9+TjkxMy5T4+uSwyOtdHjljlWKHLDbKzCYpjQEGjRXDNYbe5FUtWWbzY2SFKeQUY1vDYqjhfV/gS9rl39pz5W35CxuNonXMO8U7e0ZKrrgkXmakZRiumYmUDZf4tUqdIV2p1/J8ENoBJ5L0gMu0xVTRe7PCYhtDy48iWhnRmR9pYtVJhIpSWgb1d15GYRf1mogTKVPNqsa+DIMnLWj/bdxxqwHgjewqiAl70bCMI3IMHQ8fdDOPmO/+X0BWfnLEFBaUUwIcBvbKfpf34IPbXe6WI4cBiTn7TAxwsQoWi6osI+afLZ58nU/Oz126/jq+MB48CPJ4e15A9FStk2UtRu8TY/fqBvgIq8BB2AJ+DS5JgtYjITaxMMV2UVyQlt7Rro0NQQTRLsPWxtDr0Pbjdjz1HTTa9w9NwAguxMVq/aEZ1OHOsxAUGVmI6wTxRhoeJ4TKc9t812OofQnmY2ThnMXgMiAVARFVXY+0GhQW2rxi1lsLByI4iGZe/EWFOmul+0AT2hEcXwOoDzSeffcMU8xLMbHNRg0NUpPXapA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f793a05-aa62-4a78-5b8b-08da81351b60 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:11.9989 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: waJvisb9La8gqLDllD7SeXv3F7E5YdnS4whZJVR40IqQF0Aq7HMGXQjmt8HbNOcmS4SKt+pOaLWvjT4xOVhMIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org mac_priv_s->enable() and ->disable() are always called with a comm_mode of COMM_MODE_RX_AND_TX. Remove this parameter, and refactor the macs appropriately. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 20 ++++++------------- .../net/ethernet/freescale/fman/fman_dtsec.h | 4 ++-- .../net/ethernet/freescale/fman/fman_memac.c | 16 ++++----------- .../net/ethernet/freescale/fman/fman_memac.h | 4 ++-- .../net/ethernet/freescale/fman/fman_tgec.c | 14 ++++--------- .../net/ethernet/freescale/fman/fman_tgec.h | 4 ++-- drivers/net/ethernet/freescale/fman/mac.c | 8 ++++---- 7 files changed, 24 insertions(+), 46 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index a39d57347d59..167843941fa4 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -879,7 +879,7 @@ static void graceful_stop(struct fman_mac *dtsec, enum comm_mode mode) } } -int dtsec_enable(struct fman_mac *dtsec, enum comm_mode mode) +int dtsec_enable(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; @@ -889,20 +889,16 @@ int dtsec_enable(struct fman_mac *dtsec, enum comm_mode mode) /* Enable */ tmp = ioread32be(®s->maccfg1); - if (mode & COMM_MODE_RX) - tmp |= MACCFG1_RX_EN; - if (mode & COMM_MODE_TX) - tmp |= MACCFG1_TX_EN; - + tmp |= MACCFG1_RX_EN | MACCFG1_TX_EN; iowrite32be(tmp, ®s->maccfg1); /* Graceful start - clear the graceful Rx/Tx stop bit */ - graceful_start(dtsec, mode); + graceful_start(dtsec, COMM_MODE_RX_AND_TX); return 0; } -int dtsec_disable(struct fman_mac *dtsec, enum comm_mode mode) +int dtsec_disable(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; @@ -911,14 +907,10 @@ int dtsec_disable(struct fman_mac *dtsec, enum comm_mode mode) return -EINVAL; /* Graceful stop - Assert the graceful Rx/Tx stop bit */ - graceful_stop(dtsec, mode); + graceful_stop(dtsec, COMM_MODE_RX_AND_TX); tmp = ioread32be(®s->maccfg1); - if (mode & COMM_MODE_RX) - tmp &= ~MACCFG1_RX_EN; - if (mode & COMM_MODE_TX) - tmp &= ~MACCFG1_TX_EN; - + tmp &= ~(MACCFG1_RX_EN | MACCFG1_TX_EN); iowrite32be(tmp, ®s->maccfg1); return 0; diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.h b/drivers/net/ethernet/freescale/fman/fman_dtsec.h index 3c26b97f8ced..f072cdc560ba 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.h +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.h @@ -16,8 +16,8 @@ int dtsec_adjust_link(struct fman_mac *dtsec, int dtsec_restart_autoneg(struct fman_mac *dtsec); int dtsec_cfg_max_frame_len(struct fman_mac *dtsec, u16 new_val); int dtsec_cfg_pad_and_crc(struct fman_mac *dtsec, bool new_val); -int dtsec_enable(struct fman_mac *dtsec, enum comm_mode mode); -int dtsec_disable(struct fman_mac *dtsec, enum comm_mode mode); +int dtsec_enable(struct fman_mac *dtsec); +int dtsec_disable(struct fman_mac *dtsec); int dtsec_init(struct fman_mac *dtsec); int dtsec_free(struct fman_mac *dtsec); int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en); diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index d47e5d282143..c34da49aed31 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -685,7 +685,7 @@ static bool is_init_done(struct memac_cfg *memac_drv_params) return false; } -int memac_enable(struct fman_mac *memac, enum comm_mode mode) +int memac_enable(struct fman_mac *memac) { struct memac_regs __iomem *regs = memac->regs; u32 tmp; @@ -694,17 +694,13 @@ int memac_enable(struct fman_mac *memac, enum comm_mode mode) return -EINVAL; tmp = ioread32be(®s->command_config); - if (mode & COMM_MODE_RX) - tmp |= CMD_CFG_RX_EN; - if (mode & COMM_MODE_TX) - tmp |= CMD_CFG_TX_EN; - + tmp |= CMD_CFG_RX_EN | CMD_CFG_TX_EN; iowrite32be(tmp, ®s->command_config); return 0; } -int memac_disable(struct fman_mac *memac, enum comm_mode mode) +int memac_disable(struct fman_mac *memac) { struct memac_regs __iomem *regs = memac->regs; u32 tmp; @@ -713,11 +709,7 @@ int memac_disable(struct fman_mac *memac, enum comm_mode mode) return -EINVAL; tmp = ioread32be(®s->command_config); - if (mode & COMM_MODE_RX) - tmp &= ~CMD_CFG_RX_EN; - if (mode & COMM_MODE_TX) - tmp &= ~CMD_CFG_TX_EN; - + tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN); iowrite32be(tmp, ®s->command_config); return 0; diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.h b/drivers/net/ethernet/freescale/fman/fman_memac.h index 702df2aa43f9..535ecd2b2ab4 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.h +++ b/drivers/net/ethernet/freescale/fman/fman_memac.h @@ -19,8 +19,8 @@ int memac_cfg_max_frame_len(struct fman_mac *memac, u16 new_val); int memac_cfg_reset_on_init(struct fman_mac *memac, bool enable); int memac_cfg_fixed_link(struct fman_mac *memac, struct fixed_phy_status *fixed_link); -int memac_enable(struct fman_mac *memac, enum comm_mode mode); -int memac_disable(struct fman_mac *memac, enum comm_mode mode); +int memac_enable(struct fman_mac *memac); +int memac_disable(struct fman_mac *memac); int memac_init(struct fman_mac *memac); int memac_free(struct fman_mac *memac); int memac_accept_rx_pause_frames(struct fman_mac *memac, bool en); diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index a3c6576dd99d..2b38d22c863d 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -392,7 +392,7 @@ static bool is_init_done(struct tgec_cfg *cfg) return false; } -int tgec_enable(struct fman_mac *tgec, enum comm_mode mode) +int tgec_enable(struct fman_mac *tgec) { struct tgec_regs __iomem *regs = tgec->regs; u32 tmp; @@ -401,16 +401,13 @@ int tgec_enable(struct fman_mac *tgec, enum comm_mode mode) return -EINVAL; tmp = ioread32be(®s->command_config); - if (mode & COMM_MODE_RX) - tmp |= CMD_CFG_RX_EN; - if (mode & COMM_MODE_TX) - tmp |= CMD_CFG_TX_EN; + tmp |= CMD_CFG_RX_EN | CMD_CFG_TX_EN; iowrite32be(tmp, ®s->command_config); return 0; } -int tgec_disable(struct fman_mac *tgec, enum comm_mode mode) +int tgec_disable(struct fman_mac *tgec) { struct tgec_regs __iomem *regs = tgec->regs; u32 tmp; @@ -419,10 +416,7 @@ int tgec_disable(struct fman_mac *tgec, enum comm_mode mode) return -EINVAL; tmp = ioread32be(®s->command_config); - if (mode & COMM_MODE_RX) - tmp &= ~CMD_CFG_RX_EN; - if (mode & COMM_MODE_TX) - tmp &= ~CMD_CFG_TX_EN; + tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN); iowrite32be(tmp, ®s->command_config); return 0; diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.h b/drivers/net/ethernet/freescale/fman/fman_tgec.h index 8df90054495c..5b256758cbec 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.h +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.h @@ -12,8 +12,8 @@ struct fman_mac *tgec_config(struct fman_mac_params *params); int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val); int tgec_modify_mac_address(struct fman_mac *tgec, const enet_addr_t *enet_addr); int tgec_cfg_max_frame_len(struct fman_mac *tgec, u16 new_val); -int tgec_enable(struct fman_mac *tgec, enum comm_mode mode); -int tgec_disable(struct fman_mac *tgec, enum comm_mode mode); +int tgec_enable(struct fman_mac *tgec); +int tgec_disable(struct fman_mac *tgec); int tgec_init(struct fman_mac *tgec); int tgec_free(struct fman_mac *tgec); int tgec_accept_rx_pause_frames(struct fman_mac *tgec, bool en); diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 2b3c6cbefef6..a8d521760ffc 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -40,8 +40,8 @@ struct mac_priv_s { u16 speed; u16 max_speed; - int (*enable)(struct fman_mac *mac_dev, enum comm_mode mode); - int (*disable)(struct fman_mac *mac_dev, enum comm_mode mode); + int (*enable)(struct fman_mac *mac_dev); + int (*disable)(struct fman_mac *mac_dev); }; struct mac_address { @@ -247,7 +247,7 @@ static int start(struct mac_device *mac_dev) struct phy_device *phy_dev = mac_dev->phy_dev; struct mac_priv_s *priv = mac_dev->priv; - err = priv->enable(mac_dev->fman_mac, COMM_MODE_RX_AND_TX); + err = priv->enable(mac_dev->fman_mac); if (!err && phy_dev) phy_start(phy_dev); @@ -261,7 +261,7 @@ static int stop(struct mac_device *mac_dev) if (mac_dev->phy_dev) phy_stop(mac_dev->phy_dev); - return priv->disable(mac_dev->fman_mac, COMM_MODE_RX_AND_TX); + return priv->disable(mac_dev->fman_mac); } static int set_multi(struct net_device *net_dev, struct mac_device *mac_dev) From patchwork Thu Aug 18 16:16:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947389 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A66BC00140 for ; Thu, 18 Aug 2022 16:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344491AbiHRQRa (ORCPT ); Thu, 18 Aug 2022 12:17:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344493AbiHRQRT (ORCPT ); Thu, 18 Aug 2022 12:17:19 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26CCCBD0A6; Thu, 18 Aug 2022 09:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IiUFZrlVFvyAbmOzJA/SqFk7eNbyzzf+ff8PFPST6Ti2FuY8GqIB82SIWO3XBekUapiGbhA6e36Sv2QYIu+KjWmnG42ESn/1CCqx/Tdu6evxVcFGmEJBeSPtyTZdZ6z0RGRdAimXoZMbq10rqp4NvNAxRv0VP3IAty/RgLB7Xci4vNCB2wFNq6ujDRxzkr99i18voeAy6E8CGPaXHMAp105145b//Scs/Y0ZEjUotlCHttS0l5yMtVsTt9PcEQ0kOGOmuVf2IkZJNQCBSNiEjpb3KZ6P9yvOBrOKdwONqBK7Uby609vvqLtykiIY9gU3yc+KejklXPH+XSlFhfo1kg== 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=8om8eH2QedUZdijrrSK77S2858Mj/v8BVIBqUQfR/qc=; b=LsAYFqv3rxCD4aWy4tEDhL52LFFBh7PQfIeHv+lB6QMB1IsQmxiCeGKJ/p+dVjzHCDJVbSy8S414O6msiPlsNhqwK00V4lbvCR23ZTeh34WSLFU0rZ+Ysln5mnLPpOp46yjY8BGr7IIBhIRatL0j9u2n7fPMUJNTyMtQxLY8WO1pDJRgt9T4+bCCkdxaDsbw3Mxb7twQ24F7SgDF2Pyn7phwSF1kWfCXG7o7k0+Jp6AodBo33iIzqOUrkUpRCo/SL8v3piQA9hPsyCPU9G1/Aah8ddxKC0x7YV+ce6kbOAz0CtnZpK46Z0tsCBZ113G3dSxLiT/aqX2InNbMxa1ycw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8om8eH2QedUZdijrrSK77S2858Mj/v8BVIBqUQfR/qc=; b=iCaIRFGUiiOuxSHjhSxWyKjljnYcdX2OQ0fC7zzCsiP3eKPNHrxFbtyfQBu4XC7EmDvvvCx25yPUP2XIrTifkLI5ge/HGh81CkW1KbG/nwzDixwgZSdmGSZHjciSdAstJPy3inSzzT8PtjVQDVclJtGEFmveGTZVFzKIysVksw3y7zvZfbdomRLQD6E4lIFFEnbU+XFVd8zMCurHraN9d5oF97qQO037nMNHrqiY8GnKiCuYZ/an6x33F20VzV0IF7xJy3H9MIhZMm5pYBgWNn1g1ZVAaixCXjceb/GCxpd2ohGnFbnJmMdTDyN4dW5KzrzlX+Min/7HSuSDcV9FVA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:13 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:13 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 04/25] net: fman: Store en/disable in mac_device instead of mac_priv_s Date: Thu, 18 Aug 2022 12:16:28 -0400 Message-Id: <20220818161649.2058728-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9f93b7d-72d9-41f0-c488-08da81351c2f X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bsr1iB/Qk7yIfKhCiITbAwoAlq1ORmk8l0ySSCd3T0hfOoo8Ist+pcB+6b5Jvgje/sCriYu/JM2MP449p4tO63pj353/GcKBrRTPKsdVhcGs8KZPwvICUQ89WHfLJ78tgqyQ2oIiBgBzHsOgvKfdkYxscD67/a9b+nijzyuEf2VkjFf6pIkmd33spQ4zF1OYQrBkzm86nOeimSS++s8Apn1LVlzzX22cFZtXZ7ZE9kJQQV4KmbA+oHOHNloaB6qydmi6xPN6qdm6HNZEsTRhHVOs9rakH4rr6XW8Vk+BRqDKWOZ+AC/Ycw/iX6joOtP4x66samqP2omq//DoS8Dfp4SAZIW7L7KwHi3PcmJSB+QTW0UCG6TzYB5eU22N2rPj2DmGOVOkPwJw18pnMYIBACwAQgI6FmXhWrw4529f1jxba7ELyZbot9ZUVoyDtYaHOAZCDJGUhejEbQD4/D9hVzttqE1YOOQSqSLYa0PJ+deP7EIqj+JXQp3P9ZYoF6VK0RNr7g9ABcXzq74sStBkf1qRU3TxDD0obwu8pgWGPyPk3/qgiHvV/Z+OpWDGm6fbkoEfZmI8Je5ly9lV7HN97uDVtYnTSQJkVTq/k3aS6ugVkiZRo97IlUjCtgxjjRR25OxamCMU5odlYXfZvOOaGW4XJjiW2RIndcXtrs6BOz7F82GoRdFjtUBK8Ze3ymF8pLOJM7MMc0uLKQjyKFVuvX/+LLgrwqxFUaO4ieLhsfQcYDrjUWzSH6Vwmpn2P3yf X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 97n/tCi9j+yTcArto9/SHEon+d2UxRrjgNi8Li8sr6u/AmEHVrr5l/y8wHRXTgTZ84BrTnpkg7UMJniP/Q+dGoaH6wo7QOmaoN+p5r4fA8Eb4DQyJa2f9d8VA5uNHtp7nAngO3xzvZ+bL077dEdYEcdaHO+7XVnInjWna82V6R72ShTAku6Ib1jKvOXjbwU5MJTrKx5e3pi5R4RhPNa6W0k5RXaYEtoSe15uXa9hLO5AdG/orMVImXJArE1Kbfn7rpz4KZWfAMVmHXhkM3l8IE3MlFWbrkEWfBQi5j826VdxFGRvc/k9fnobCngN/f73sLZzsytX3zAIJkB5U0jKvp6NLOnyRyGB/XajDdtCeRCAO3OKG2qarA8coZErLJzi6lNHqGhE+/YVYJkesmlrT+4ZiTQpxQfEqQcXlScybQDKxBlZT0cTQZMRvwbraJ4uR9T+aPESuqf4w27pFn/1A1k5fNjmVxS3dn/l6hrb4JtrBTIfHFredo6X+cxTYg832yeOWr8SGwiKh7Kb0SrMD5Rr+vCjNEjCNYzPA1sG5RuK+f9LFhPJKBLMs5ZzyMgajAkvbSKQKU3XRg3+FF01li5N9CcKY4q2Cfh3fKRFHYgqAllGDwqvg+/jZQUODS620NgTo1PWX62riKho7YPcx4BPOvPsCPBMQxYJjvNKmi70+RLFHwPWDGxSi0xINslvt5VvY8nVYSv3I3MSq3b84yWkCSUWFM9v6WJ2BA2cPQjS922lKEWUUG3xtG800xIGsz5om+V9GOfYV1yYAbI7ZKWbpc9rtZxICa9y/+K2oiUuwE0dtQHBmE0mD5vm6RisQ12Wpoj5xgLeHZCHXMu7WwbTghViZ51kdJzF6z4GpDoXWqW0A2/7EnVpsRV2ul3eq1ZRbSJEa4f/VNHQ/eQxMNK7Hy66rEvYRTyInwydQDCSzNtuYmHwPXVpxW3BGeiisuMTJe0MYxzdXpJ4irQFrjVpr9tfCLN6fnTXZj4Xv36dsNrPyJuyzglQZFej46hZWaDJ0y6DUx4j6VNXdJWhiinBzN8oKN1Twob0JZpNlL8h46xjmR2OW64PRV1oQAgOKRZuwXuhlLiIQuaJOST3QC8S25i57GXCRGK7C65nrtgep9+GSV029tmcWEWIsE6hUMKLXA1WKFBHgnKlx3IFSIvmY9rzukrmD8UlEof31K8ug/PGFPqi0Di9tU++yYbXQY3DBNjYWUiIfnmo9Vjvp9qNv6lzQTzc8dxQsI+k5ogH88lw0IJi+DlTNkOdnU5jveeeEeukl6iJo2zVXIRZJnwtX/d32nzeiGgfL0OjK2C93yDqSkAum6zMu7Ul89SYWyXQjg5aUvfT1CJo2LEwvS0FBtH46HVMkezb+cKH7j935ivzQQa9TMJXmN9NEq3vJGBzDzvGcgvxWIF7Z1xGqfiao0hhc/vqV+d1jY4dLBjQykKclo1tzX8JSKfDxH2VAkmlUkf6zzQYIhI+Q0yJJd1OXFJsYoeP8O7ecp45A1Wdu+ixpB0XHXf2jo/4h4ijUdVFm1KaHZFKZy2zdU+hZT2O+KqQa/PMCFyN7kX3C58xv0pVop5FR/izUX8LPmGfUCH0GZxe0G+ApnRBEsnJJA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9f93b7d-72d9-41f0-c488-08da81351c2f X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:13.4519 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: X6P4KuB8LjBa4RamrvYCpYyKX2fy/t/X4xYJQpetJf50TfVk3QtoJKOf/4xo7HDrhiMUN6Z0NnKcVwpzBx+MDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org All macs use the same start/stop functions. The actual mac-specific code lives in enable/disable. Move these functions to an appropriate struct, and inline the phy enable/disable calls to the caller of start/stop. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/dpaa/dpaa_eth.c | 11 +++-- drivers/net/ethernet/freescale/fman/mac.c | 44 +++---------------- drivers/net/ethernet/freescale/fman/mac.h | 4 +- 3 files changed, 15 insertions(+), 44 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 45634579adb6..a548598b2e2d 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -288,9 +288,11 @@ static int dpaa_stop(struct net_device *net_dev) */ msleep(200); - err = mac_dev->stop(mac_dev); + if (mac_dev->phy_dev) + phy_stop(mac_dev->phy_dev); + err = mac_dev->disable(mac_dev->fman_mac); if (err < 0) - netif_err(priv, ifdown, net_dev, "mac_dev->stop() = %d\n", + netif_err(priv, ifdown, net_dev, "mac_dev->disable() = %d\n", err); for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { @@ -2942,11 +2944,12 @@ static int dpaa_open(struct net_device *net_dev) goto mac_start_failed; } - err = priv->mac_dev->start(mac_dev); + err = priv->mac_dev->enable(mac_dev->fman_mac); if (err < 0) { - netif_err(priv, ifup, net_dev, "mac_dev->start() = %d\n", err); + netif_err(priv, ifup, net_dev, "mac_dev->enable() = %d\n", err); goto mac_start_failed; } + phy_start(priv->mac_dev->phy_dev); netif_tx_start_all_queues(net_dev); diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index a8d521760ffc..6a4eaca83700 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -39,9 +39,6 @@ struct mac_priv_s { struct fixed_phy_status *fixed_link; u16 speed; u16 max_speed; - - int (*enable)(struct fman_mac *mac_dev); - int (*disable)(struct fman_mac *mac_dev); }; struct mac_address { @@ -241,29 +238,6 @@ static int memac_initialization(struct mac_device *mac_dev) return err; } -static int start(struct mac_device *mac_dev) -{ - int err; - struct phy_device *phy_dev = mac_dev->phy_dev; - struct mac_priv_s *priv = mac_dev->priv; - - err = priv->enable(mac_dev->fman_mac); - if (!err && phy_dev) - phy_start(phy_dev); - - return err; -} - -static int stop(struct mac_device *mac_dev) -{ - struct mac_priv_s *priv = mac_dev->priv; - - if (mac_dev->phy_dev) - phy_stop(mac_dev->phy_dev); - - return priv->disable(mac_dev->fman_mac); -} - static int set_multi(struct net_device *net_dev, struct mac_device *mac_dev) { struct mac_priv_s *priv; @@ -454,11 +428,9 @@ static void setup_dtsec(struct mac_device *mac_dev) mac_dev->set_allmulti = dtsec_set_allmulti; mac_dev->set_tstamp = dtsec_set_tstamp; mac_dev->set_multi = set_multi; - mac_dev->start = start; - mac_dev->stop = stop; mac_dev->adjust_link = adjust_link_dtsec; - mac_dev->priv->enable = dtsec_enable; - mac_dev->priv->disable = dtsec_disable; + mac_dev->enable = dtsec_enable; + mac_dev->disable = dtsec_disable; } static void setup_tgec(struct mac_device *mac_dev) @@ -474,11 +446,9 @@ static void setup_tgec(struct mac_device *mac_dev) mac_dev->set_allmulti = tgec_set_allmulti; mac_dev->set_tstamp = tgec_set_tstamp; mac_dev->set_multi = set_multi; - mac_dev->start = start; - mac_dev->stop = stop; mac_dev->adjust_link = adjust_link_void; - mac_dev->priv->enable = tgec_enable; - mac_dev->priv->disable = tgec_disable; + mac_dev->enable = tgec_enable; + mac_dev->disable = tgec_disable; } static void setup_memac(struct mac_device *mac_dev) @@ -494,11 +464,9 @@ static void setup_memac(struct mac_device *mac_dev) mac_dev->set_allmulti = memac_set_allmulti; mac_dev->set_tstamp = memac_set_tstamp; mac_dev->set_multi = set_multi; - mac_dev->start = start; - mac_dev->stop = stop; mac_dev->adjust_link = adjust_link_memac; - mac_dev->priv->enable = memac_enable; - mac_dev->priv->disable = memac_disable; + mac_dev->enable = memac_enable; + mac_dev->disable = memac_disable; } #define DTSEC_SUPPORTED \ diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index 909faf5fa2fe..95f67b4efb61 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -36,8 +36,8 @@ struct mac_device { bool allmulti; int (*init)(struct mac_device *mac_dev); - int (*start)(struct mac_device *mac_dev); - int (*stop)(struct mac_device *mac_dev); + int (*enable)(struct fman_mac *mac_dev); + int (*disable)(struct fman_mac *mac_dev); void (*adjust_link)(struct mac_device *mac_dev); int (*set_promisc)(struct fman_mac *mac_dev, bool enable); int (*change_addr)(struct fman_mac *mac_dev, const enet_addr_t *enet_addr); From patchwork Thu Aug 18 16:16:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947390 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54501C2BB41 for ; Thu, 18 Aug 2022 16:17:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344575AbiHRQRd (ORCPT ); Thu, 18 Aug 2022 12:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344504AbiHRQR0 (ORCPT ); Thu, 18 Aug 2022 12:17:26 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDFA6BD0B6; Thu, 18 Aug 2022 09:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O4Cx6G3Pv81KqElMfA3jbPCKQKAKo8YrP93bSyBD6TtNVTzJ0hKjO940zQ1aPCreLPfHMOKixa/m1Z6Rv1I17X+2yMqwmEGfhMg21rLW+NOflgpPHjfwx7IAK3bO6zJTXz+naiQnIilp5bWEruFmhUjJz2HKa9tR/yAHWrj8djUKY/AzJBY9a07+N4wCZDF6VzcVm7EgVztGLWcac7jGet9EfxSaM7xQaCIfSYrs7aPECihfitk2VReb2DGNZ+NnwXgoijGa6AmKYiBpsyyfax0XSPhNJP6hdJ2lOyuPGUZblu9y1+HDCNSB3rg2dcpz0O7RJUHleFSNP1gjwy9T4Q== 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=9L6FnTqvCduyYhxu+YFwE1dDeiGhnmXGiGrEHy0sXGs=; b=dIwFLLz27ELJ3ndg2SoQePRchvGsQ5RseYCrh7AsM6DlL4pv5eaY9NEK1dkoyx3LVDlB7gHZLUKHcGhLkOngIzZpIh7hLpdwK1eLU3lVntgQAtr0Lg48bhGNP2FfN3jan6KGp6aPFYJbXM0Y2ZmZdKhpOcxTv2tBobiMUo4wRC3EoNKOC7G3SmZoMVCNJa3uH7EMFrC2RmE43cekpEBEli21S0mGtIDZBHHAJR9Jj+xJkMbKPv04ANCKeM/pwGixTOzAm5OIqbxg3kW4z3txoO4kZ2DCJXCwSJps8XRlX4Kg7z7k9o1gKA9Xdxb1a2TmyF02f6Xpkrf23DK++Aqx3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9L6FnTqvCduyYhxu+YFwE1dDeiGhnmXGiGrEHy0sXGs=; b=AVEgVlhFyHSAQpysl63TpSjInRnU0bFYvJe+/LKA6sz2nWitqJNbjVlpA0DyYfXtoau02p25XdWzgAcgMoEZpb20a9te/0N53VUHJULG5pS3MB3Aw6IQ6a107YtOgV3jGboVOI2OAeZ8bHjFUVywc204s/c2eMSl7IlhWyZ3E81qocxlRAysokb6Zw9L2Cr3/m943qPKYaeP3jgyXr9JiX1D+BHfYe4gAqxtPUkeSXpy9klOMzitzuZucghCCZr8SNLHblLPCv5zdbm9sFnQ4D7j3oBQ3P0Sdt6hIyKgGXMjgmgrJvHX8ImTD+lhEHQHHcg+75aVECx9F1gCFBsV1g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:14 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:14 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 05/25] net: fman: dtsec: Always gracefully stop/start Date: Thu, 18 Aug 2022 12:16:29 -0400 Message-Id: <20220818161649.2058728-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 16f05b4b-684f-4bd9-7b67-08da81351d0d X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ynDqqld0lkFwoKEgBLag23ijSJAH2vWHHd3Ltij056oHEl42dNra9Wz9vWfaEq/+kOyjnh2aqQBt1zwCWO0jWxsHbzK3JdiFxMy24tQUuJGwcKPj3FS+EcXOO/E2j/SnhFH0MNoSZe88U/FwiLOZkzD5KIgBctpGAMRogWV3pEC786KICAE9tGE3tY4C1YJRvpl3kukKcYWuWaxud9qczXI2Y3pUX7BM4AU3hzXgVe603yaA2zqq6GKT1c8SB9k/+Y/YppZdnDMCA6glPoGlvp9/p6Hw6sxMEd0ZRn9CitdhO9fABqIgHAJ8onewviwYDSeNb3ud3bocnPmNGEKMDasoMNUBFt5W4xryzaVHn29N4RMK7/SYLWexcNkIQcPXRPKPKD/+l5s28X2JhAEcrwuOWhTaA22ejpqCV1VVkQfs52TuzNVt8d/NGbNgWoFbOJmUnXQOejkAhu+QXbA794ACUo9SXTEewvZSxTJwk2JTzEVRRnps/OwzkDT0BDnyObIjA4ZywTQa3XN//POAjGyIZBZJ83dSsTu20ZbOsYl/HACleC3NNFttCC7cXROGuQpnDeR7yFY2gUt4MLERnehzYbWFOjnTE+qrpQg0Rtdc1e9yG0gI68qg+BFXZ53f6Q0fa/RgpX0FWJgG9oOasHMLpyznZkwp/UU5EeIExdRhAO2IRSwlegDKhyK6+DZRXB3+QpExlVNHcSFtHPadCXfyx6YHQHxPd4RMciMbfuz9gck0YAitN5Ax2tyaxXXnHEOJf7gJiN1zXXul1moTeA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bwUeJLkxWWjN3Eq6eQwEZVMdArFQtjWkJxWkoPLLDtFPnxi8Zih8EBWo2BvdmIFmPcuwZYlHY9LVs4/ivHQgwYfi80ZFujBJ0+jcfODGK9h48n5q81x1ozoEfJEv1B3oW5N6/Di3aMa+B+qWOkS2cXYDV13cO0XzxurNKR20GY+CTEVX9AppdukXFCuxR2HcFrpiroY44yRTQ+KLUG4Lt60Glg8XWb+zhS/uBrbDIquhoU6cpMQnmkEtNyXFl52WtOXGdwKNfB5QbOp/HN/ITUwEZ4qNXWBkKe25hZcYoOEnU5I4j0y5KB51uq3F43kF/dYGOlbj/Rpq+WQ9kjYfZRQD2Ksnns8XHNfHiyfP3eC+wZGQ0w0D/M8JF5O3VXGe7W4VzxmLTPbRWPpZ3M2N8WO8ARwtacc0aGaX0jlWsfbVqYqNPkaAJSoyPAmbefFWSuZrYTDq6GXKAqfylNW36yXvXQ+q/MMsNYcYneHJYTqxvcU3R2eB+OG3SYfA5yk/EnrhbWo0qBVNHj9Bmtr1mhH6v0e76baVYTIgAX7qVpT8CJwmDfgZL15G4ydNcPHcvxBEMkhvo5WGU6wLLy9xOHro+aQqndPrjiOmv0GxOntusTx9RSSbUia7BGCw5KikzvYQ2JXEgFLm0wsnYpDxhcIoSln2ncFupIA7gTNEA7pXVuNZ/0d+Qr74Ohl0y5OmfLJHeJPJtqy9K1XdGuTRz2zuuYg1yajnsviM07AlxQ72VMGA6izNQyQhFHSm4pLUbusQeTfo8UB3qvQlcLzfogrMVrkmhaQk1maMnDW6aFx2UCAjFXRLYQiKpgiz1VcOKHTzF8Ww9e0IlVBN2LcwfCzIL6w5HgG9GFWXM97yQWKBCvUoW47WDYPwjL2Yf0AuRhB+7UEnYUJSdlR1qphvlVYeLT9bAW/OPUfOfnSlkX5bUKDJfkDVHDn3U/qh5Kie/1fgV9TCtk/De1858QuxgXtiwhO4swnHgcPYbrf7LPOAuwABmn0yp0ebu0icns403yCzDbQCDQzr+2C24d1PyhaA9Ig1AxrntsVVqESL6vfhMMlxz1uSr6scAXCObiZjcAd12FxLF/WQpR+uRidhR0kiwL8S8HFenvgKq78adl7I8oYYD1/tB1RzCe+lc8L1xJbER8G1LBWJs8gyvThctXTTPRqA7+i4mEOa16VWhAcJOAe9ipFoa0w6X/Z4QQrevdVdN9ZwXV2m/fzs8TkUO0J30+P3E/K2wjnAhiKWdNOefyV4StiH8oGhmAn9tu9jF9eXA46YVKSJqZSoyxoJK1XhGygc2NNGBI3RtTW3+RPUmWlyMXf4R3OjIlJ8WaasYVJEQm/Xz3ltyvvb0k6yPoVsS2tivOt8puloCeeJbNVPDqsZNWntDs37MwsnLX5DEABPivfVybb28jwG76fa3iMYnDt02Gwn4xp5fqEhUMAh4hxT0DR3NCwtjAAXpw/9DCukEt4z2MQLY81lExfhbre2ASueDgZY61vPuCz+WF8Aot2MJ92DO6fHLLCiBbjR48YW2yJaVkP4aKKj0nifU0s1xSVxXYSlEb4NVWntvJzilFtmPActns0w51epCDirjNGxoYC4mIpxLjZb/bPXMA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16f05b4b-684f-4bd9-7b67-08da81351d0d X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:14.9362 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bWr8gNcNaueGL03EOyuN0XsC6a0mIE0a+Q1NbydqXkX/BxB4yvQqtonawWLTrphhYsm4KyRHrPm0/fSoEDbbHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There are two ways that GRS can be set: graceful_stop and dtsec_isr. It is cleared by graceful_start. If it is already set before calling graceful_stop, then that means that dtsec_isr set it. In that case, we will not set GRS nor will we clear it (which seems like a bug?). For GTS the logic is similar, except that there is no one else messing with this bit (so we will always set and clear it). Simplify the logic by always setting/clearing GRS/GTS. This is less racy that the previous behavior, and ensures that we always end up clearing the bits. This can of course clear GRS while dtsec_isr is waiting, but because we have already done our own waiting it should be fine. This is the last user of enum comm_mode, so remove it. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza --- Changes since previous series: - Fix unused variable warning in dtsec_modify_mac_address (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 94 ++++++------------- .../net/ethernet/freescale/fman/fman_mac.h | 10 -- 2 files changed, 30 insertions(+), 74 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 167843941fa4..7f4f3d797a8d 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -833,49 +833,41 @@ int dtsec_cfg_pad_and_crc(struct fman_mac *dtsec, bool new_val) return 0; } -static void graceful_start(struct fman_mac *dtsec, enum comm_mode mode) +static void graceful_start(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; - if (mode & COMM_MODE_TX) - iowrite32be(ioread32be(®s->tctrl) & - ~TCTRL_GTS, ®s->tctrl); - if (mode & COMM_MODE_RX) - iowrite32be(ioread32be(®s->rctrl) & - ~RCTRL_GRS, ®s->rctrl); + iowrite32be(ioread32be(®s->tctrl) & ~TCTRL_GTS, ®s->tctrl); + iowrite32be(ioread32be(®s->rctrl) & ~RCTRL_GRS, ®s->rctrl); } -static void graceful_stop(struct fman_mac *dtsec, enum comm_mode mode) +static void graceful_stop(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; /* Graceful stop - Assert the graceful Rx stop bit */ - if (mode & COMM_MODE_RX) { - tmp = ioread32be(®s->rctrl) | RCTRL_GRS; - iowrite32be(tmp, ®s->rctrl); + tmp = ioread32be(®s->rctrl) | RCTRL_GRS; + iowrite32be(tmp, ®s->rctrl); - if (dtsec->fm_rev_info.major == 2) { - /* Workaround for dTSEC Errata A002 */ - usleep_range(100, 200); - } else { - /* Workaround for dTSEC Errata A004839 */ - usleep_range(10, 50); - } + if (dtsec->fm_rev_info.major == 2) { + /* Workaround for dTSEC Errata A002 */ + usleep_range(100, 200); + } else { + /* Workaround for dTSEC Errata A004839 */ + usleep_range(10, 50); } /* Graceful stop - Assert the graceful Tx stop bit */ - if (mode & COMM_MODE_TX) { - if (dtsec->fm_rev_info.major == 2) { - /* dTSEC Errata A004: Do not use TCTRL[GTS]=1 */ - pr_debug("GTS not supported due to DTSEC_A004 Errata.\n"); - } else { - tmp = ioread32be(®s->tctrl) | TCTRL_GTS; - iowrite32be(tmp, ®s->tctrl); + if (dtsec->fm_rev_info.major == 2) { + /* dTSEC Errata A004: Do not use TCTRL[GTS]=1 */ + pr_debug("GTS not supported due to DTSEC_A004 Errata.\n"); + } else { + tmp = ioread32be(®s->tctrl) | TCTRL_GTS; + iowrite32be(tmp, ®s->tctrl); - /* Workaround for dTSEC Errata A0012, A0014 */ - usleep_range(10, 50); - } + /* Workaround for dTSEC Errata A0012, A0014 */ + usleep_range(10, 50); } } @@ -893,7 +885,7 @@ int dtsec_enable(struct fman_mac *dtsec) iowrite32be(tmp, ®s->maccfg1); /* Graceful start - clear the graceful Rx/Tx stop bit */ - graceful_start(dtsec, COMM_MODE_RX_AND_TX); + graceful_start(dtsec); return 0; } @@ -907,7 +899,7 @@ int dtsec_disable(struct fman_mac *dtsec) return -EINVAL; /* Graceful stop - Assert the graceful Rx/Tx stop bit */ - graceful_stop(dtsec, COMM_MODE_RX_AND_TX); + graceful_stop(dtsec); tmp = ioread32be(®s->maccfg1); tmp &= ~(MACCFG1_RX_EN | MACCFG1_TX_EN); @@ -921,18 +913,12 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, u16 pause_time, u16 __maybe_unused thresh_time) { struct dtsec_regs __iomem *regs = dtsec->regs; - enum comm_mode mode = COMM_MODE_NONE; u32 ptv = 0; if (!is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; - if ((ioread32be(®s->rctrl) & RCTRL_GRS) == 0) - mode |= COMM_MODE_RX; - if ((ioread32be(®s->tctrl) & TCTRL_GTS) == 0) - mode |= COMM_MODE_TX; - - graceful_stop(dtsec, mode); + graceful_stop(dtsec); if (pause_time) { /* FM_BAD_TX_TS_IN_B_2_B_ERRATA_DTSEC_A003 Errata workaround */ @@ -954,7 +940,7 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, iowrite32be(ioread32be(®s->maccfg1) & ~MACCFG1_TX_FLOW, ®s->maccfg1); - graceful_start(dtsec, mode); + graceful_start(dtsec); return 0; } @@ -962,18 +948,12 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en) { struct dtsec_regs __iomem *regs = dtsec->regs; - enum comm_mode mode = COMM_MODE_NONE; u32 tmp; if (!is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; - if ((ioread32be(®s->rctrl) & RCTRL_GRS) == 0) - mode |= COMM_MODE_RX; - if ((ioread32be(®s->tctrl) & TCTRL_GTS) == 0) - mode |= COMM_MODE_TX; - - graceful_stop(dtsec, mode); + graceful_stop(dtsec); tmp = ioread32be(®s->maccfg1); if (en) @@ -982,25 +962,17 @@ int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en) tmp &= ~MACCFG1_RX_FLOW; iowrite32be(tmp, ®s->maccfg1); - graceful_start(dtsec, mode); + graceful_start(dtsec); return 0; } int dtsec_modify_mac_address(struct fman_mac *dtsec, const enet_addr_t *enet_addr) { - struct dtsec_regs __iomem *regs = dtsec->regs; - enum comm_mode mode = COMM_MODE_NONE; - if (!is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; - if ((ioread32be(®s->rctrl) & RCTRL_GRS) == 0) - mode |= COMM_MODE_RX; - if ((ioread32be(®s->tctrl) & TCTRL_GTS) == 0) - mode |= COMM_MODE_TX; - - graceful_stop(dtsec, mode); + graceful_stop(dtsec); /* Initialize MAC Station Address registers (1 & 2) * Station address have to be swapped (big endian to little endian @@ -1008,7 +980,7 @@ int dtsec_modify_mac_address(struct fman_mac *dtsec, const enet_addr_t *enet_add dtsec->addr = ENET_ADDR_TO_UINT64(*enet_addr); set_mac_address(dtsec->regs, (const u8 *)(*enet_addr)); - graceful_start(dtsec, mode); + graceful_start(dtsec); return 0; } @@ -1226,18 +1198,12 @@ int dtsec_set_promiscuous(struct fman_mac *dtsec, bool new_val) int dtsec_adjust_link(struct fman_mac *dtsec, u16 speed) { struct dtsec_regs __iomem *regs = dtsec->regs; - enum comm_mode mode = COMM_MODE_NONE; u32 tmp; if (!is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; - if ((ioread32be(®s->rctrl) & RCTRL_GRS) == 0) - mode |= COMM_MODE_RX; - if ((ioread32be(®s->tctrl) & TCTRL_GTS) == 0) - mode |= COMM_MODE_TX; - - graceful_stop(dtsec, mode); + graceful_stop(dtsec); tmp = ioread32be(®s->maccfg2); @@ -1258,7 +1224,7 @@ int dtsec_adjust_link(struct fman_mac *dtsec, u16 speed) tmp &= ~DTSEC_ECNTRL_R100M; iowrite32be(tmp, ®s->ecntrl); - graceful_start(dtsec, mode); + graceful_start(dtsec); return 0; } diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h index 19f327efdaff..418d1de85702 100644 --- a/drivers/net/ethernet/freescale/fman/fman_mac.h +++ b/drivers/net/ethernet/freescale/fman/fman_mac.h @@ -75,16 +75,6 @@ typedef u8 enet_addr_t[ETH_ALEN]; #define ETH_HASH_ENTRY_OBJ(ptr) \ hlist_entry_safe(ptr, struct eth_hash_entry, node) -/* Enumeration (bit flags) of communication modes (Transmit, - * receive or both). - */ -enum comm_mode { - COMM_MODE_NONE = 0, /* No transmit/receive communication */ - COMM_MODE_RX = 1, /* Only receive communication */ - COMM_MODE_TX = 2, /* Only transmit communication */ - COMM_MODE_RX_AND_TX = 3 /* Both transmit and receive communication */ -}; - /* FM MAC Exceptions */ enum fman_mac_exceptions { FM_MAC_EX_10G_MDIO_SCAN_EVENT = 0 From patchwork Thu Aug 18 16:16:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947391 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89A60C00140 for ; Thu, 18 Aug 2022 16:17:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344607AbiHRQRv (ORCPT ); Thu, 18 Aug 2022 12:17:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344564AbiHRQR2 (ORCPT ); Thu, 18 Aug 2022 12:17:28 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7940CBD118; Thu, 18 Aug 2022 09:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OQlROIbJw8+bC9N9+hvg/yZ4NO45UHxjDY9obuBZyWcBc1hJCDnwOxS3DbhBmIS5FrpQ/u03v8Y/xR143gn5wpkFtD8jCi51P/SQI4roKBnKs9upG0ZDK+y8BKBDuQjK7WBrMa3Uo3wqHIHNlRvNRzJFjfa+++CF734JB+iOocFZdwUs2LNGKmz9mED3YpKw0WmBIt4PaSdcCFsU219HliJa06WBAi9+I5sgoeIgLruGYh3J4nnSs6EAM4V+hzRyjWtHiYNLTU7E9woEjQa9m1GHV9TKd08Xhovc8i4t348wXkHU4fG5EViBwf3lrRwXJxuhowroS/ZXD8tfqqr8Cg== 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=ikmed1H2u8yYjG0yC0+OW7IBD8A+JO361DVKp96y2Wc=; b=PHKUcwwoSAh05HCJaS6CPuShdRXQoRuAOKYoc7/mTJittJXtD/Zc6HmyeUg6rgmARYJoSnAhfQ2p3rOU4VsFqPmnTQytTdC1zXt2p/bazqsqehNNZDQ0mDGhrnP5u1c/sp4rNh/eUcQAY/+Ez+MrVvxQkigMI0dyiq0ADzDqyyysjPuU1wJeQIIKxRI9x7C8QJpl25hc9oJ6wjm4JqPoUFWDthPnrwrEhJftrP+BOORcxZZ0vUl5vtY+YqIBtozLqSXUx6qv2g4Gpgq4gWrwDBD2rM25sSgGYI/qnfwQCcastDh0npBHQZIrAsFwGs9wUf6zztUPdP5PnaFSa5f3UQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ikmed1H2u8yYjG0yC0+OW7IBD8A+JO361DVKp96y2Wc=; b=nKA4GbB4ZHnq30jrtqh8azxBCehKmcluKb9z7msDeZ97XW3petbzRzPrZD0TiAxQu4bbm4+lHACjlc46UeNMs+VLjx6pC06NfgUYONDOeC2xujWsqWadkdb0Yc18FtxS3C3uo4LOjfVI8OnXJ1bCnP7NGWx1Z0qxpYsyAGsPXA2GoEPxrwrALyk5uZKfaEE6r51elLp1vrDEt1l0iyH599Zf4TOZEQCCXZep4ABy/q1pdz2KACgKvh6mEDkL787fhR3wEfilgQafiHUxj0XMM2nL8TQfWtd9k6QSpmmAZErMDAwSpH31sCOqOtuMSadxCvsIAUSbK6DxS0bd6IZ8Nw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:16 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:16 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 06/25] net: fman: Get PCS node in per-mac init Date: Thu, 18 Aug 2022 12:16:30 -0400 Message-Id: <20220818161649.2058728-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73efe216-5f33-43c6-f6de-08da81351def X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4cw7ESdEFeHm8YWEEktL02VDtSmuaflQlFUXZBuZZXt16i5pfdB9HhIoO4hG0bMAyWMHhyIuu+KQYZMwBtIbK8CeigjbJJgIq9bTIaNxvI+dIWyHcGGz5nc1XO3GEiHJHVlk//B2lLEgjST+NZ38TYgrNs75UYLik+F+eNTTcQb5wc9A96IrrxEEz0gOFIUgqhJckyV3L33POPR/hIPwE8u+nfNAGdwruTaYJ1h0Iqg2wq1MdJ1E9FdXi1b0v2tuNALC+3OuWf5kpcH4jEq4SYAJbKJ0NA0UksVxsIDAGJKt9dWD7zxvEY2hU1Xo9GAdiOqtF1JVpxKUMJiwHp+ZN3DRKZ+9mOg/OpK8h9n7YLBnOonc1esaFMO7+g08oiJDbtD7L+Xyjq5SLVeDcmTQTyJ+91cWHV8gqwHyTFQXyhUmFa8TU2k+mHW3h4odqFDiIeNMf7IecqqVwPrmb+2WRkyjCwh3+8s+sl8EbsEafpIqXV7hMutOh+OE/qwe1w6nMcmCko72VcZrd+5TJNDHHWH+Cu+xL8oqYg+M7D4ne22ePEfCkACeBl/+KiHObQBC6xDgnOI99GEtzDftUMx0lrcbvEfMSsO2xtaOVy070p1zXtG1kyrHaIlfoArfAocnjWjP9CM/MuCIMwBbV2L/Ha2euurqGdkUT32RGGyTn8RAVDaLhLsMbk7Lm1SfZKSeIB5Dj6tFerfcj+0O17CdSpCxWCXkDHBSW7cjAnl2nOwjsG2EIOwXF7e0cZwY3KqizFvkawiHoDHqz3SUARR6dA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: m76BgoFrXECyguYF1XdThcTyDgkijk29VNIa4EDMWbxA1qYFtoLfZTCOQ2bG5TTsTkN85gOJ1euYDXU183nnIzLV6AY82BQ82EKL6zOnptuDOLIYNkDXs6sWe32UbkeeRnsd478IcIF7ytC0uQtOA52TxAuasKYqY02xlWy/BU6l1M/DOV4yXT1PyZPjSVGZZtDjUyZKpILpUnX3GoLNax/TDgAY2wlRftwEpg3+6zhu5LSKwTwAIu8vQ4tzpEMe9kmAxueGSZqwbzJVtNwjFStJe9jCIg1jUwdaSBiHC2iBddTRpYCVtGDRvr+X3Q2ZXJd6iL64cx0FmIjftfbkWM3++4sCvDC25C2Al1tLloxz3JP5NI48GrbgCEpq7xAvNKkmBW3EciHdE0TyszRs7DRLXIdizUyscgSV67RHPGg65nW4AHmWdqRY816rPgjlyf/IV5dncX5Ko+l3mVJKFy5WmvYGmSBo7igECkf6JncPZUzmU1P+Rt/ohkDivWQ5v9HMDcUNspPyx+IglU3khQYxzzwNSNm+k/yzlJEzawrIB+UR95e1CJf6+clg2GqJRoCu69xrqz2U0YVD0OulxCYotT9gXYaWrYKBr/IW31PM6ldaRz8f4WAdXzT5PQEQc5G2TGK9b5oEAoDrBgwPqJRHHNwZhs88EyXU2hWMGCcqYnAE3QNTIIvnCB3Io6CNko9UCu6CCSTMWuAyX4tXZn7XXZ3tio4EEXCMLxBvTsZV3qAn1dSyBFbsqwjjVHYAvx1xnF//1JJdikBscjga5EhHv/Ml6r2thsXEtdgAiSdET6ktz+hfEDpe1fpajlLRqrNzjK2jVFqpg11pfkc0tVjKlBsxESNZ3vFv863FulS/Qx1Vb/3J8tWPPFM4gQMKgfNTD6HKpQNWravRABbiEOGtilLTJCHSVXJvQSOJXl6uPeaPJ+PTZibGEApEQEpj3+sI0bU2zkQI6rvjqBcACd/sMNxmri7KHEZ51szh/dHunAAkEwDqloy9K3axQcU5JI+tMPOoqqb3eqvh6NOaOYxUjATYj4kOL4k3XRekAM/oIHxfkmlNt3aJc2dSzyV59KTk4JjhmzIcc4IpSvVGIbIxZ/GflwVddDhIDkKYkmiCOagv8U6NuOQ4uNkZC1+xiLxYNr+R/NAxG7Tsj9CXAEJyn6UcYaGdV58qRzJPJEMAee1ktu1+sFsoU7lOx5i06r3lKWUe47j9YQmGS+rkCqWxi/Hk75iGP+7qQ70p0chx7hSqYjvwtOt6tFE5kgHv1BFiAB8TyjcbDThhp4m8ZIStBYHjhiIhGal76WMyfVKkzBZK4UvApJlRxTH3+HhOMOBSxKqXBSpDN2p+49mEq4P0ShiXbmzxPs536mQgaVJeGcp76E6EyxWcvikMUsVyixF5Ra6sg5uC0d1/Ycl7t0Wf3mnPFRJ2O0Qvuy8bMPYhKTL1/2JdRgct+b2XsQrWSVnd963Fogf4DBNx8FfZMk8dIsqV1i+9X6l8MmTRyKNyjvmKNvReHfcYmuohYwP2IaRpKZsO0545tDRKvgkGyRFI2/FwclbBaSdN4t7ZS8l5a6tW8RAkbOudkL02J1vmpsLhGZOb71W3TQfyYqQ3bA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73efe216-5f33-43c6-f6de-08da81351def X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:16.3892 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: a7IxeFI980U16RaVvEhK5JR1GHlh6lvqBA+ljyuNwWxlqVLDvuFfX51ka7/IwHtO6Feupzg8NNRnMEWW2bh9bw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This moves the reading of the PCS property out of the generic probe and into the mac-specific initialization function. This reduces the mac-specific jobs done in the top-level probe function. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/mac.c | 19 +++++++++---------- drivers/net/ethernet/freescale/fman/mac.h | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 6a4eaca83700..0af6f6c49284 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -32,7 +32,6 @@ struct mac_priv_s { void __iomem *vaddr; u8 cell_index; struct fman *fman; - struct device_node *internal_phy_node; /* List of multicast addresses */ struct list_head mc_addr_list; struct platform_device *eth_dev; @@ -85,12 +84,12 @@ static int set_fman_mac_params(struct mac_device *mac_dev, params->exception_cb = mac_exception; params->event_cb = mac_exception; params->dev_id = mac_dev; - params->internal_phy_node = priv->internal_phy_node; return 0; } -static int tgec_initialization(struct mac_device *mac_dev) +static int tgec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) { int err; struct mac_priv_s *priv; @@ -138,7 +137,8 @@ static int tgec_initialization(struct mac_device *mac_dev) return err; } -static int dtsec_initialization(struct mac_device *mac_dev) +static int dtsec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) { int err; struct mac_priv_s *priv; @@ -150,6 +150,7 @@ static int dtsec_initialization(struct mac_device *mac_dev) err = set_fman_mac_params(mac_dev, ¶ms); if (err) goto _return; + params.internal_phy_node = of_parse_phandle(mac_node, "tbi-handle", 0); mac_dev->fman_mac = dtsec_config(¶ms); if (!mac_dev->fman_mac) { @@ -190,7 +191,8 @@ static int dtsec_initialization(struct mac_device *mac_dev) return err; } -static int memac_initialization(struct mac_device *mac_dev) +static int memac_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) { int err; struct mac_priv_s *priv; @@ -201,6 +203,7 @@ static int memac_initialization(struct mac_device *mac_dev) err = set_fman_mac_params(mac_dev, ¶ms); if (err) goto _return; + params.internal_phy_node = of_parse_phandle(mac_node, "pcsphy-handle", 0); if (priv->max_speed == SPEED_10000) params.phy_if = PHY_INTERFACE_MODE_XGMII; @@ -583,14 +586,10 @@ static int mac_probe(struct platform_device *_of_dev) if (of_device_is_compatible(mac_node, "fsl,fman-dtsec")) { setup_dtsec(mac_dev); - priv->internal_phy_node = of_parse_phandle(mac_node, - "tbi-handle", 0); } else if (of_device_is_compatible(mac_node, "fsl,fman-xgec")) { setup_tgec(mac_dev); } else if (of_device_is_compatible(mac_node, "fsl,fman-memac")) { setup_memac(mac_dev); - priv->internal_phy_node = of_parse_phandle(mac_node, - "pcsphy-handle", 0); } else { dev_err(dev, "MAC node (%pOF) contains unsupported MAC\n", mac_node); @@ -783,7 +782,7 @@ static int mac_probe(struct platform_device *_of_dev) put_device(&phy->mdio.dev); } - err = mac_dev->init(mac_dev); + err = mac_dev->init(mac_dev, mac_node); if (err < 0) { dev_err(dev, "mac_dev->init() = %d\n", err); of_node_put(mac_dev->phy_node); diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index 95f67b4efb61..e4329c7d5001 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -35,7 +35,7 @@ struct mac_device { bool promisc; bool allmulti; - int (*init)(struct mac_device *mac_dev); + int (*init)(struct mac_device *mac_dev, struct device_node *mac_node); int (*enable)(struct fman_mac *mac_dev); int (*disable)(struct fman_mac *mac_dev); void (*adjust_link)(struct mac_device *mac_dev); From patchwork Thu Aug 18 16:16:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947392 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99046C32772 for ; Thu, 18 Aug 2022 16:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344614AbiHRQRx (ORCPT ); Thu, 18 Aug 2022 12:17:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245699AbiHRQRa (ORCPT ); Thu, 18 Aug 2022 12:17:30 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70085.outbound.protection.outlook.com [40.107.7.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B31C9BD096; Thu, 18 Aug 2022 09:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nzcACWhd+8JRw4HP/oZOe7IdAmoYzngYNdYzSPnlKx1EMjW9cwmi/3iZpSsMQLQCTBxf5jx5mfsZvP7quAl7XDxM1MOETpQ08Qv5eCSqx5yApRukMX4jfqgdqEKEHHq0CzIBWI7JYMd2ctL1KpZ0pANxXFvctQFtJZVnK5donGf58+tNr/r4ihbJmAEUGPc0FH0LaPiF/9E5g9KGDOnR848xkaHoh1Wst5izDCh1sSYNDZRvCsBDGSqJ9NB4KUHC1+B7ezWMn+SIf8eypEQ1Q+6uRAtmcC+ssF0c0/Yu5fX2Tibuv+BOs2jUe+FNQekOuwUmHWN0Gq+smnQkfJmwQw== 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=ocQkgqrX6Z35C99M2VgFT5kfphkMMnx1HLgZf9vIK4M=; b=ZyOtIJMhuxjbR3QFDTHpx75OCmO+OfRK7bb25chQ8WV3r1zyXVXZky8ktNftNbxX4KR5NJwR0ZgDeNKI7aJFE3IJSDyab3Y0xEmt4ASBRg/3mmVD8Hxt32yQDZ+oAhFo9kUDTyVP4DT7pCCtW603+LnvdkoqQM/uPVoyWdK/Cfxfeg+EuXYvHHR+YOJXmFGxhs381QRT1Kz0pS/2KnWggema108qLktxmEoq4LqWRtQPu+Pd00VchirnmG1cD1sXqP6MlxH/UyLMXpVWlrkSgV4x0c09KuMvnpkdj6tmcWgxbqxJM4Vxos4qWdtE0X1S/LWf99tb5rtfMQL+WyUcMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ocQkgqrX6Z35C99M2VgFT5kfphkMMnx1HLgZf9vIK4M=; b=yYC2QoxK+4FlrVOyUMrOduvwB2f2pTzyYmsQ4cdoGPQTpcu03e1ijQABM8FJQE5YavAt9AmvOubHD8/azyHU63PWbLsnVnP6RcWEKKxjr5o2Nz5HJlkbUHqpL7ZGcFgHIDFQ+aI492EUptBfKk6iWbHdfZ+jwF/J6vVHdDf2oy7Y6JmHcT8pOHdRrjVYu1Mwz4gtYYmkcOf1j7oir5EluAMYl53sMq+uk4+YjcmVfaySy1PG9rSBI8oBXT9S11m4ukoeAcozj1n+UHPrvo4Mo4b0JW81noelYUnWz44FI/otWDqES9nWkoZeicrz0C7m03CUXIWTgEeM3BPNh7nvEA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:17 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:17 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 07/25] net: fman: Store initialization function in match data Date: Thu, 18 Aug 2022 12:16:31 -0400 Message-Id: <20220818161649.2058728-8-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f0b49e88-a972-4b76-86c5-08da81351ec6 X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XX2zrTp/Z+IcOWL9xUNYfhNh3+2RB0TwaQDNRlgLeFeWiR9h5iP9DVB/yLOtnBE0neEgdpkAuqWljSVC+q0KZ9HkP/QBxzePv16xnwjkdekw6eQ5AHk1d/4+tf511ArL5zKlH1em3k4GwrOvnJ8PXbwH2Bq5legXddC20fJoUIl7HX0EIgcozHaJD8bbi60mEjQMlAziVQ7a5CzXdyy/CLyzXuvKtmWSCaEgkjjwiBI6++02fchQZsaCKRe8m4g33Ea7+PaR0ybgMjh4JBdLteBKjykuJj5kBFywpSgqV5BHsJifNhFn5xiZoctl+WVFHw83X3C9qhp1sgSRN0Z5uR0Xvu2aed6l8B1bo4ihNGCT+W0x41aLOZ25iZ/yQTg82eTpXcEERMBwrrCa/LNR4ea7JuX+ctPDh2+jUF08tEXu8GXW1h0BQ90uWS7PfH2lgygX2MmTl1RrvE/lvV64wWSKxtoOwcnG1HSks25EGNinhBjPaCnokvzklfTJ1Gt2F0jfSkbHpYhQGszJlhqlPtky3OiGHDk7NvdzzA3OXkHgXKIDouBFZ0z9YTfr6qpjc4Bt5JjgGHPJrn/tfpIpuAaM+/vrbjk+KlTOjq/rIO99vPBgORhEAuL0IfQxiprhm9DTiwWflzFT10iBrWeO03ykbrNsl6lCm7CdGUDJkbuEELQz6pQt2aGsz8lVaB8AdtIq0KD4QOL93DHbW3erFW8itBpKpkFRurNsjlfzZCKo1/KHYFItTpuC83M1JlMaN+EFUiMeKsyBV6xN85PLPw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(30864003)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XrM+xZKfBjhfvVSSDmazbA/36p3K7bwEHOZ1UqKrCnx/0mb2uJ9aAS7X7vG46TClDfCowq1YfzHw/SV2XqrsrT5CN7G4u3nxg/zSCb7PrWODTSRBWcxIvuSELjAJlO68EkhkI6+nZJHZnpJISs2sciKMoLd3Rj0tkHIZ2q8Oii6vZoRrGlGxhsfXDnD8PMXrSSg1+BTSwsU3plZU5JQnfgCiGyfD6nfCQ938gmGDYvRUkgDGrCEF0aoNYGqZuR9QO3JS5hu4cNbVrr327YZ7/Dsw+OMfNXnPb6JsNvChL6whjgnx80TaTGiymE8l7TXCBEsVxpP7YO4N9D7/A/0BeQfMaKzHYgujT/9BXmvFM4e+wclpjZ0nZK0kOx85qx98owh+HozNQQIu4WmgpRRS2gMgv2UrHWSIikWdy8dYKEt+g5G4ecDvG1WaeL1BomPoQwGdoEFTDwptgPxu8BtY3T6H/MzLKtnEUJfDZ00nZn6/lsy/agypwInnM/k11xRSmBjw1jkURWz2hpamqOvucbLRcDq4IKcejZZliPzPFRxXr0wk9DT7rJ/0LOnzWSaotZpzD5ThynuC6wZHdfXNpnTAA73uQHKbVK3cg7Q/FcI7NKSWlJ2S0K/c361K6IgSkzY0mrGcUesY3SuoalMGgR+a/ahtQCFG7x+dhzmx39FjZPoHVF91ltdKgOuJSga/qh9vCjN14XRdXXxWhUikZqgXHCXKhmaCktmdUAut0jQr9HlcxPK7sTJkQd/ypgsXWcp9UZvQqWKhvlr2OCM61miReWfsbttbFjjDkycZQn3amNX9QDVpwGry9PiTC9Mpi58G3sbch8+fojY2qJUEI2aMLCskxYQeLfaqCABNnpLIuYmqGrc4bm05I8383Cd2PTTsNCp/SGmn53D0nQS+4t5aiRQzeGFyf3wS39JWzOd3o+3InYZqqICvlq2sPFktGZq9LEa5nMlGQAiis/R2kDeJdDEW5BatN6Ux/YU/52esOasZWz9tKDJDa+UYdkOFWh6hIdqdl9TVnrU+wKHW13tWYuus99O8XhadUdAOlpH6h5Ci8+ctO8KKXX7HEmjPifsGLw6CaaNPQY78PgL6cXs6IgZ/ReR7fBrDlGRaycD+4fIjIEY+pNZgCiFBbgnaIrqVJsJxq8I/P7L/BM+Tqs2fePyAloSJ7ePFqqs12VWIHyk+QNbrMGh365/2N7Eg3ZbDLX8Ay74TXkSEkDnpgwoSXvPDd7KGHT4SjU794DBWYu0pJFeW8dkcK7eYgDdvItwh6YnvCvG0ZI1HVirF87WxaA+SvnzFNsYjQnc9OP2cSPfSsZ9n0d2emkmiPq+VqkWCBCq9GOX3Rw0JDMtTDDSvNaBAqI4BkpbDgV9nleH9Br+XNyqQmQB5gMXj0BzOM1h80hXS4thHm5MOAKf+Y9Ic6d892tAKDsbDu+zOSYiHDMvMA/cuSPhirWhSDZDwdE8BZcEpfaRbTlcsIsmnTERDfc1KzXwfTsTtLAvLjs9YFZ6/LCodpiHkP6sCxBNNtimAalDmskKYCx692r5Ujc+RY+8uZ8EGBrCRV433XCgdDMx2+ysFRy85DZQfi7uynqulbbCrf1Qnb7dTQ5KuLg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0b49e88-a972-4b76-86c5-08da81351ec6 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:17.7798 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9Gs9pl/Ee8/j1lLRoSA9gx497G/vpQwLKK87k7aMZcr00lRRUlNlNPD++ix6ec9wAqONfBJQIqEn6pXCwxN1zg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Instead of re-matching the compatible string in order to determine the init function, just store it in the match data. The separate setup functions aren't needed anymore. Merge their content into init as well. To ensure everything compiles correctly, we move them to the bottom of the file. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- Changes in v4: - Clarify commit message drivers/net/ethernet/freescale/fman/mac.c | 356 ++++++++++------------ drivers/net/ethernet/freescale/fman/mac.h | 1 - 2 files changed, 165 insertions(+), 192 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 0af6f6c49284..8dd6a5b12922 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -88,159 +88,6 @@ static int set_fman_mac_params(struct mac_device *mac_dev, return 0; } -static int tgec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) -{ - int err; - struct mac_priv_s *priv; - struct fman_mac_params params; - u32 version; - - priv = mac_dev->priv; - - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - - mac_dev->fman_mac = tgec_config(¶ms); - if (!mac_dev->fman_mac) { - err = -EINVAL; - goto _return; - } - - err = tgec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); - if (err < 0) - goto _return_fm_mac_free; - - err = tgec_init(mac_dev->fman_mac); - if (err < 0) - goto _return_fm_mac_free; - - /* For 10G MAC, disable Tx ECC exception */ - err = mac_dev->set_exception(mac_dev->fman_mac, - FM_MAC_EX_10G_TX_ECC_ER, false); - if (err < 0) - goto _return_fm_mac_free; - - err = tgec_get_version(mac_dev->fman_mac, &version); - if (err < 0) - goto _return_fm_mac_free; - - dev_info(priv->dev, "FMan XGEC version: 0x%08x\n", version); - - goto _return; - -_return_fm_mac_free: - tgec_free(mac_dev->fman_mac); - -_return: - return err; -} - -static int dtsec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) -{ - int err; - struct mac_priv_s *priv; - struct fman_mac_params params; - u32 version; - - priv = mac_dev->priv; - - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - params.internal_phy_node = of_parse_phandle(mac_node, "tbi-handle", 0); - - mac_dev->fman_mac = dtsec_config(¶ms); - if (!mac_dev->fman_mac) { - err = -EINVAL; - goto _return; - } - - err = dtsec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); - if (err < 0) - goto _return_fm_mac_free; - - err = dtsec_cfg_pad_and_crc(mac_dev->fman_mac, true); - if (err < 0) - goto _return_fm_mac_free; - - err = dtsec_init(mac_dev->fman_mac); - if (err < 0) - goto _return_fm_mac_free; - - /* For 1G MAC, disable by default the MIB counters overflow interrupt */ - err = mac_dev->set_exception(mac_dev->fman_mac, - FM_MAC_EX_1G_RX_MIB_CNT_OVFL, false); - if (err < 0) - goto _return_fm_mac_free; - - err = dtsec_get_version(mac_dev->fman_mac, &version); - if (err < 0) - goto _return_fm_mac_free; - - dev_info(priv->dev, "FMan dTSEC version: 0x%08x\n", version); - - goto _return; - -_return_fm_mac_free: - dtsec_free(mac_dev->fman_mac); - -_return: - return err; -} - -static int memac_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) -{ - int err; - struct mac_priv_s *priv; - struct fman_mac_params params; - - priv = mac_dev->priv; - - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - params.internal_phy_node = of_parse_phandle(mac_node, "pcsphy-handle", 0); - - if (priv->max_speed == SPEED_10000) - params.phy_if = PHY_INTERFACE_MODE_XGMII; - - mac_dev->fman_mac = memac_config(¶ms); - if (!mac_dev->fman_mac) { - err = -EINVAL; - goto _return; - } - - err = memac_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); - if (err < 0) - goto _return_fm_mac_free; - - err = memac_cfg_reset_on_init(mac_dev->fman_mac, true); - if (err < 0) - goto _return_fm_mac_free; - - err = memac_cfg_fixed_link(mac_dev->fman_mac, priv->fixed_link); - if (err < 0) - goto _return_fm_mac_free; - - err = memac_init(mac_dev->fman_mac); - if (err < 0) - goto _return_fm_mac_free; - - dev_info(priv->dev, "FMan MEMAC\n"); - - goto _return; - -_return_fm_mac_free: - memac_free(mac_dev->fman_mac); - -_return: - return err; -} - static int set_multi(struct net_device *net_dev, struct mac_device *mac_dev) { struct mac_priv_s *priv; @@ -418,27 +265,15 @@ static void adjust_link_memac(struct mac_device *mac_dev) err); } -static void setup_dtsec(struct mac_device *mac_dev) +static int tgec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) { - mac_dev->init = dtsec_initialization; - mac_dev->set_promisc = dtsec_set_promiscuous; - mac_dev->change_addr = dtsec_modify_mac_address; - mac_dev->add_hash_mac_addr = dtsec_add_hash_mac_address; - mac_dev->remove_hash_mac_addr = dtsec_del_hash_mac_address; - mac_dev->set_tx_pause = dtsec_set_tx_pause_frames; - mac_dev->set_rx_pause = dtsec_accept_rx_pause_frames; - mac_dev->set_exception = dtsec_set_exception; - mac_dev->set_allmulti = dtsec_set_allmulti; - mac_dev->set_tstamp = dtsec_set_tstamp; - mac_dev->set_multi = set_multi; - mac_dev->adjust_link = adjust_link_dtsec; - mac_dev->enable = dtsec_enable; - mac_dev->disable = dtsec_disable; -} + int err; + struct mac_priv_s *priv; + struct fman_mac_params params; + u32 version; -static void setup_tgec(struct mac_device *mac_dev) -{ - mac_dev->init = tgec_initialization; + priv = mac_dev->priv; mac_dev->set_promisc = tgec_set_promiscuous; mac_dev->change_addr = tgec_modify_mac_address; mac_dev->add_hash_mac_addr = tgec_add_hash_mac_address; @@ -452,11 +287,121 @@ static void setup_tgec(struct mac_device *mac_dev) mac_dev->adjust_link = adjust_link_void; mac_dev->enable = tgec_enable; mac_dev->disable = tgec_disable; + + err = set_fman_mac_params(mac_dev, ¶ms); + if (err) + goto _return; + + mac_dev->fman_mac = tgec_config(¶ms); + if (!mac_dev->fman_mac) { + err = -EINVAL; + goto _return; + } + + err = tgec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); + if (err < 0) + goto _return_fm_mac_free; + + err = tgec_init(mac_dev->fman_mac); + if (err < 0) + goto _return_fm_mac_free; + + /* For 10G MAC, disable Tx ECC exception */ + err = mac_dev->set_exception(mac_dev->fman_mac, + FM_MAC_EX_10G_TX_ECC_ER, false); + if (err < 0) + goto _return_fm_mac_free; + + err = tgec_get_version(mac_dev->fman_mac, &version); + if (err < 0) + goto _return_fm_mac_free; + + dev_info(priv->dev, "FMan XGEC version: 0x%08x\n", version); + + goto _return; + +_return_fm_mac_free: + tgec_free(mac_dev->fman_mac); + +_return: + return err; +} + +static int dtsec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) +{ + int err; + struct mac_priv_s *priv; + struct fman_mac_params params; + u32 version; + + priv = mac_dev->priv; + mac_dev->set_promisc = dtsec_set_promiscuous; + mac_dev->change_addr = dtsec_modify_mac_address; + mac_dev->add_hash_mac_addr = dtsec_add_hash_mac_address; + mac_dev->remove_hash_mac_addr = dtsec_del_hash_mac_address; + mac_dev->set_tx_pause = dtsec_set_tx_pause_frames; + mac_dev->set_rx_pause = dtsec_accept_rx_pause_frames; + mac_dev->set_exception = dtsec_set_exception; + mac_dev->set_allmulti = dtsec_set_allmulti; + mac_dev->set_tstamp = dtsec_set_tstamp; + mac_dev->set_multi = set_multi; + mac_dev->adjust_link = adjust_link_dtsec; + mac_dev->enable = dtsec_enable; + mac_dev->disable = dtsec_disable; + + err = set_fman_mac_params(mac_dev, ¶ms); + if (err) + goto _return; + params.internal_phy_node = of_parse_phandle(mac_node, "tbi-handle", 0); + + mac_dev->fman_mac = dtsec_config(¶ms); + if (!mac_dev->fman_mac) { + err = -EINVAL; + goto _return; + } + + err = dtsec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); + if (err < 0) + goto _return_fm_mac_free; + + err = dtsec_cfg_pad_and_crc(mac_dev->fman_mac, true); + if (err < 0) + goto _return_fm_mac_free; + + err = dtsec_init(mac_dev->fman_mac); + if (err < 0) + goto _return_fm_mac_free; + + /* For 1G MAC, disable by default the MIB counters overflow interrupt */ + err = mac_dev->set_exception(mac_dev->fman_mac, + FM_MAC_EX_1G_RX_MIB_CNT_OVFL, false); + if (err < 0) + goto _return_fm_mac_free; + + err = dtsec_get_version(mac_dev->fman_mac, &version); + if (err < 0) + goto _return_fm_mac_free; + + dev_info(priv->dev, "FMan dTSEC version: 0x%08x\n", version); + + goto _return; + +_return_fm_mac_free: + dtsec_free(mac_dev->fman_mac); + +_return: + return err; } -static void setup_memac(struct mac_device *mac_dev) +static int memac_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) { - mac_dev->init = memac_initialization; + int err; + struct mac_priv_s *priv; + struct fman_mac_params params; + + priv = mac_dev->priv; mac_dev->set_promisc = memac_set_promiscuous; mac_dev->change_addr = memac_modify_mac_address; mac_dev->add_hash_mac_addr = memac_add_hash_mac_address; @@ -470,6 +415,46 @@ static void setup_memac(struct mac_device *mac_dev) mac_dev->adjust_link = adjust_link_memac; mac_dev->enable = memac_enable; mac_dev->disable = memac_disable; + + err = set_fman_mac_params(mac_dev, ¶ms); + if (err) + goto _return; + params.internal_phy_node = of_parse_phandle(mac_node, "pcsphy-handle", 0); + + if (priv->max_speed == SPEED_10000) + params.phy_if = PHY_INTERFACE_MODE_XGMII; + + mac_dev->fman_mac = memac_config(¶ms); + if (!mac_dev->fman_mac) { + err = -EINVAL; + goto _return; + } + + err = memac_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); + if (err < 0) + goto _return_fm_mac_free; + + err = memac_cfg_reset_on_init(mac_dev->fman_mac, true); + if (err < 0) + goto _return_fm_mac_free; + + err = memac_cfg_fixed_link(mac_dev->fman_mac, priv->fixed_link); + if (err < 0) + goto _return_fm_mac_free; + + err = memac_init(mac_dev->fman_mac); + if (err < 0) + goto _return_fm_mac_free; + + dev_info(priv->dev, "FMan MEMAC\n"); + + goto _return; + +_return_fm_mac_free: + memac_free(mac_dev->fman_mac); + +_return: + return err; } #define DTSEC_SUPPORTED \ @@ -546,9 +531,9 @@ static struct platform_device *dpaa_eth_add_device(int fman_id, } static const struct of_device_id mac_match[] = { - { .compatible = "fsl,fman-dtsec" }, - { .compatible = "fsl,fman-xgec" }, - { .compatible = "fsl,fman-memac" }, + { .compatible = "fsl,fman-dtsec", .data = dtsec_initialization }, + { .compatible = "fsl,fman-xgec", .data = tgec_initialization }, + { .compatible = "fsl,fman-memac", .data = memac_initialization }, {} }; MODULE_DEVICE_TABLE(of, mac_match); @@ -556,6 +541,7 @@ MODULE_DEVICE_TABLE(of, mac_match); static int mac_probe(struct platform_device *_of_dev) { int err, i, nph; + int (*init)(struct mac_device *mac_dev, struct device_node *mac_node); struct device *dev; struct device_node *mac_node, *dev_node; struct mac_device *mac_dev; @@ -568,6 +554,7 @@ static int mac_probe(struct platform_device *_of_dev) dev = &_of_dev->dev; mac_node = dev->of_node; + init = of_device_get_match_data(dev); mac_dev = devm_kzalloc(dev, sizeof(*mac_dev), GFP_KERNEL); if (!mac_dev) { @@ -584,19 +571,6 @@ static int mac_probe(struct platform_device *_of_dev) mac_dev->priv = priv; priv->dev = dev; - if (of_device_is_compatible(mac_node, "fsl,fman-dtsec")) { - setup_dtsec(mac_dev); - } else if (of_device_is_compatible(mac_node, "fsl,fman-xgec")) { - setup_tgec(mac_dev); - } else if (of_device_is_compatible(mac_node, "fsl,fman-memac")) { - setup_memac(mac_dev); - } else { - dev_err(dev, "MAC node (%pOF) contains unsupported MAC\n", - mac_node); - err = -EINVAL; - goto _return; - } - INIT_LIST_HEAD(&priv->mc_addr_list); /* Get the FM node */ @@ -782,7 +756,7 @@ static int mac_probe(struct platform_device *_of_dev) put_device(&phy->mdio.dev); } - err = mac_dev->init(mac_dev, mac_node); + err = init(mac_dev, mac_node); if (err < 0) { dev_err(dev, "mac_dev->init() = %d\n", err); of_node_put(mac_dev->phy_node); diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index e4329c7d5001..fed3835a8473 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -35,7 +35,6 @@ struct mac_device { bool promisc; bool allmulti; - int (*init)(struct mac_device *mac_dev, struct device_node *mac_node); int (*enable)(struct fman_mac *mac_dev); int (*disable)(struct fman_mac *mac_dev); void (*adjust_link)(struct mac_device *mac_dev); From patchwork Thu Aug 18 16:16:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947393 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6793C32772 for ; Thu, 18 Aug 2022 16:18:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344623AbiHRQR5 (ORCPT ); Thu, 18 Aug 2022 12:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344569AbiHRQRa (ORCPT ); Thu, 18 Aug 2022 12:17:30 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5CD0BD0A2; Thu, 18 Aug 2022 09:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UlUQSSP+XKrzs5YCRes3MlYyevDq/xldkfFTWMwOpQZSYMSV9iMJJg2Cg+PLmjqiNdksF6bsYAZj5gd07yLVcR5yvdzirD4A+uZ0lAJxme7o0LLOIUPoNtiU9QJfkVPoq35red7zAkJMpyyxnWH/o7oeGYKMWTZk72hj+/RQFeX+w3M2zVP9sQU1ZVSCVbHGwWQAPJupmyidnh+WtYSjbT9WnyvN5nm0EqjP7bTXosIvTsz8ZELygH+XLuL/40oJi1d0/aBjoLB/Eoev1/84bOXatXTKYQIrnlbJSfSnaqO8VKhkhgns2TNpHsk9bvmKQmoKRVVWaMvHb0G5Mm8wgA== 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=CPX7hRuvNHelwZEqnA8XUAFgil9vCNo0TTSKnqFGgX0=; b=JePjJznxx9VrVfc2+bDW5BabQsAVYZanz2Gib294oFQfALDLjXFP/VLm2RN1B9RZoDSpGalxeCFhS77Poicx0So4hgok1/UcHRP8cNOf6x0mMh9ZDeyVtSm6+kcGOiAqcyNKFNB1uIL1gRWoYVTWwNOcmOlGh/JFsm/4NK/2jbDsxg9ELsSySBuMO3y2ajtIY54+quIrkyfpuLPgXl0QXdrHocARGYL2oPo3pe5CF2N6FwdyAa9qbWMbb33M0/5yVX3oqRLK0QF7J7z/XDrgKAQdNbL0pJeu6OjPpgAubm0xHyjIYSFCZyMELmhtqw14iGIv+u9YIQ9mIz3imm1ieA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CPX7hRuvNHelwZEqnA8XUAFgil9vCNo0TTSKnqFGgX0=; b=UQsiFoaaha0WyBSh0llxIYzk/IiExHHMtUeIWzPlwi23Br6lzXSdpxUgyxAnsPpkDnbQi6JjGoD4y+V4KuQEFJAdQPMHgF48n49dIpG7ZC0GRgVXsaL46Ib05gI12GXajx3VtMbltNfYLgCAVr8NaOQNM3icrwgBa+1Dqi7yEI5TTk5+ID14GswNoRgHz524JSuuZw7oyDs9xeZ2rmwBULKNXiSCJ65RuJh9JcPXUOoAG7P6k8Qx09QeqbsYC0TEdfzTzF2gGf7JPWlZnveChuSeFQyEMXwuGiko3V6XyHOFo+wwR7f6UvCXW8YBVo3JMGbCqpRav76tU++TqNuc3w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:19 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:19 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 08/25] net: fman: Move struct dev to mac_device Date: Thu, 18 Aug 2022 12:16:32 -0400 Message-Id: <20220818161649.2058728-9-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea78c24a-3e75-44be-16b4-08da81351f9d X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qf+3NsUceho+l7HSPrAeMJwSTEmohgtOutofLieYyl1J8ZJAMIXUIT9G3QqvabEjJxQp7m+fyeTiOhZzqXJiFRDmdweMsOPUiNE2RBUYzJ3I47JVePzAXsTPUlK4az1a5T4RrUQn4hSHQRilQOYffr+CQPiut/YRRYuD2swOXfIE8h71dARJwOwTEMTLSkw+EaRCJbyI8X3Ut36lTtSoTb3NlEJ2FcMTFmo4pcj6g2A2etjxtHg+XpsLDmLipHjoR6MtDUMEaK1iikW5B5qY0ghbOJk+m2Fi6E+MGu9H18/G9BGKIP5/WP8jmtIVeC9OGiKbUd7oOLKkV/pfeZURVLX5HxIFuf3CSM1EpxuzuSwAznVfg7RUNz5i20bCRBY1V4LehArYlMGmKiCJ60PusaYt6TFl8d9RilqXXSHrd5FcbZbuz+EOBUQcZg1l3lCsMyo2gulmFN5Btax6WAIwTD8tEAMqiKmAWlPsT68dNC/0r7EY0gIWEhhTNhVxdrrLdIa7bi7CtEKsSv6VQcFEmjGW+lCNmwOtKdWltjaudDqImgLKUgIM/4itjhC8FmnshWgbOrZQjDzJFkF0v+CnOxCi/c2/UyTYrrV9C0wYRrie/zxI9J6SEefU5I/tfrGNg37sIGCWFClxRkEQrtNbt5CTbTNFolRd/d92QxUdTsQokAz+DfP5Fgsp50X4Aq2ngsB+mUX5bcKgwBciRLR85HYBe7isKnl5ED7eu19hrGJoGMjC4Txaa7uaxfV1Wmk20Xtz95KyvaVPwoCkHCiT+g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /0bOdinqNilD55NEY+1jj9rb39BKlYubuBfVU803lUzBVb5SdfvIw73VXzshn4yyJ5ZxdqHZLxR73A/iF4bq/nJGSdMjru1JwOZg0IelJqftJmeqdDGEjfyZ4KpaPl1ZfK8wYEvkIsBYR5pKid9Tg6JXZZMXQD3EWm3+NSscY869O1jq/Pn3nP6P5UQrp31pcQKfC3e6kZdwmZZhkUF+iLAtCFE3HiE6t1J/yXcCUWoWOm/HAyrnQJIPCGiDLozGq4KvSZtza5RTwMZpnOiFZ6QXj4zaaiWIrKdKun3qkWPNYt1NjM+UjaQyOG4zsamDr2K/Pg0XBnDWPH6cnPxAKCBhDSzs5odT+hpZb0sw8v4u2gi5sFnnYUzOAJrxkhcXWJ+6GBvKd2Aq1fxH7+bvLL1IFXOQYSIyFMkSjGjCcaQnf6cKeCgeHbS2cwBKl9Mf9wVQNXfC7+xW9FF/e0ZXkKqc+xopZJ1lxvtgQwcvrHbF007qj9ZZO/Sd1P0Mso9oPFVGDfHhUcj88NWVcwhx3dHRGXC6SHKGadxS0DEp4y63tThJub1AbEN5iLFPdW4uBps+G9nz1CZyTTfVpfC3Id8QbU8Kn3Ua6E6L7239rsrMlKb18gd/Tggv+FkkIvmmK0DJ2mVN9qNJY+EdPtuRy2a27/tVzslIPRJ4448x4RfGVv7cVufpAV5eNteRaJcjkOkSzdRpmDHMMeFdNANaO02AvQPSdygGAe1998aIvYdnwrpABYWK2KGd/71QM7t61/Bmg/VV9t8aWEoNXsj69+vp6NH8Du6PZ4Yl+w4/bjBHv4WPauVsijZhL+roPYDo/PhXolp4xZ8KgMNkJi2qyMYd3hjWD+9nlzNmgq+t8Knc3Mzk5QC/+Itq6tA0jdBSgh0UZdAeZEiK4GUpO4RD5gogsPmGvF8babTA5YnrfPw2GQXjDKmmXOb3jc/g2eK1kqRQthv3jby34cREhOWA8WwHeHdk0A/RCnaH59m/WVvp8dHGqyfRLNT7k7T80w4+BFrQPUY4cOlt8FMG819OIeXVmj0/lYWC9VwTisQJaVvq4M/g/6JWyhS1JRLZuTaJI/JMnHpeRmkgwyL7gqwFylxIHeuo5gJSGqtaKDjVKOF0kvsTGS0gegSrVlhGaojP7oHn0exbtTcnN+y4lp0DiCSU2mbW8dzuACxzyctEB5r7m3cjfdMPq4YvlgN47YNqyhNaqohRpHq4k3IW69khocRQJDpA+yjA1oqP04ZFDPicqMLfo0wnaMQXFg2v7BRY391RmemR1qdfUdmmj21hgLWjzAcmf0eZ35nOHs9avQQeSCy/XyJHO2voRgTaXz96TnyatT69jN154GR8NjrL+IuRO4coRWhFgPMJKz4D3Id5Ebzy8WEUvpmpYrt0GlkS09b+fsJb46RP+K1nxYg4TqM9GXRzkPpFHn3cQikgA7QwruVpCGMon67Ghy5t2x445+bCJ10bmjru1vf96tZhovT0xgyTgDEg/dSZuU15NMf4B+SnC/ZQ5ifjIP1WgaY1ko6xz1w5b1wQ3u6a6h28OsqWzPdGgrMaVXXVAdq2f53r2yC1HhDcxu8NmF2/0TPuf1BR9FJ1ry2Dr/ZWopYpkg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea78c24a-3e75-44be-16b4-08da81351f9d X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:19.1234 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wpN7LDWNBzUmiogC1pYnKvypBUy7gcGaKGB2RbtoKTm8MQeHFB2iSP1rI/rV6tBDDz+ifvk4VR9blV5dhMj4Dg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Move the reference to our device to mac_device. This way, macs can use it in their log messages. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v2) Changes in v2: - Remove some unused variables drivers/net/ethernet/freescale/fman/mac.c | 31 ++++++++--------------- drivers/net/ethernet/freescale/fman/mac.h | 1 + 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 8dd6a5b12922..5b3a6ea2d0e2 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -28,7 +28,6 @@ MODULE_LICENSE("Dual BSD/GPL"); MODULE_DESCRIPTION("FSL FMan MAC API based driver"); struct mac_priv_s { - struct device *dev; void __iomem *vaddr; u8 cell_index; struct fman *fman; @@ -47,20 +46,16 @@ struct mac_address { static void mac_exception(void *handle, enum fman_mac_exceptions ex) { - struct mac_device *mac_dev; - struct mac_priv_s *priv; - - mac_dev = handle; - priv = mac_dev->priv; + struct mac_device *mac_dev = handle; if (ex == FM_MAC_EX_10G_RX_FIFO_OVFL) { /* don't flag RX FIFO after the first */ mac_dev->set_exception(mac_dev->fman_mac, FM_MAC_EX_10G_RX_FIFO_OVFL, false); - dev_err(priv->dev, "10G MAC got RX FIFO Error = %x\n", ex); + dev_err(mac_dev->dev, "10G MAC got RX FIFO Error = %x\n", ex); } - dev_dbg(priv->dev, "%s:%s() -> %d\n", KBUILD_BASENAME ".c", + dev_dbg(mac_dev->dev, "%s:%s() -> %d\n", KBUILD_BASENAME ".c", __func__, ex); } @@ -70,7 +65,7 @@ static int set_fman_mac_params(struct mac_device *mac_dev, struct mac_priv_s *priv = mac_dev->priv; params->base_addr = (typeof(params->base_addr)) - devm_ioremap(priv->dev, mac_dev->res->start, + devm_ioremap(mac_dev->dev, mac_dev->res->start, resource_size(mac_dev->res)); if (!params->base_addr) return -ENOMEM; @@ -244,7 +239,7 @@ static void adjust_link_dtsec(struct mac_device *mac_dev) fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); if (err < 0) - dev_err(mac_dev->priv->dev, "fman_set_mac_active_pause() = %d\n", + dev_err(mac_dev->dev, "fman_set_mac_active_pause() = %d\n", err); } @@ -261,7 +256,7 @@ static void adjust_link_memac(struct mac_device *mac_dev) fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); if (err < 0) - dev_err(mac_dev->priv->dev, "fman_set_mac_active_pause() = %d\n", + dev_err(mac_dev->dev, "fman_set_mac_active_pause() = %d\n", err); } @@ -269,11 +264,9 @@ static int tgec_initialization(struct mac_device *mac_dev, struct device_node *mac_node) { int err; - struct mac_priv_s *priv; struct fman_mac_params params; u32 version; - priv = mac_dev->priv; mac_dev->set_promisc = tgec_set_promiscuous; mac_dev->change_addr = tgec_modify_mac_address; mac_dev->add_hash_mac_addr = tgec_add_hash_mac_address; @@ -316,7 +309,7 @@ static int tgec_initialization(struct mac_device *mac_dev, if (err < 0) goto _return_fm_mac_free; - dev_info(priv->dev, "FMan XGEC version: 0x%08x\n", version); + dev_info(mac_dev->dev, "FMan XGEC version: 0x%08x\n", version); goto _return; @@ -331,11 +324,9 @@ static int dtsec_initialization(struct mac_device *mac_dev, struct device_node *mac_node) { int err; - struct mac_priv_s *priv; struct fman_mac_params params; u32 version; - priv = mac_dev->priv; mac_dev->set_promisc = dtsec_set_promiscuous; mac_dev->change_addr = dtsec_modify_mac_address; mac_dev->add_hash_mac_addr = dtsec_add_hash_mac_address; @@ -383,7 +374,7 @@ static int dtsec_initialization(struct mac_device *mac_dev, if (err < 0) goto _return_fm_mac_free; - dev_info(priv->dev, "FMan dTSEC version: 0x%08x\n", version); + dev_info(mac_dev->dev, "FMan dTSEC version: 0x%08x\n", version); goto _return; @@ -446,7 +437,7 @@ static int memac_initialization(struct mac_device *mac_dev, if (err < 0) goto _return_fm_mac_free; - dev_info(priv->dev, "FMan MEMAC\n"); + dev_info(mac_dev->dev, "FMan MEMAC\n"); goto _return; @@ -507,7 +498,7 @@ static struct platform_device *dpaa_eth_add_device(int fman_id, goto no_mem; } - pdev->dev.parent = priv->dev; + pdev->dev.parent = mac_dev->dev; ret = platform_device_add_data(pdev, &data, sizeof(data)); if (ret) @@ -569,7 +560,7 @@ static int mac_probe(struct platform_device *_of_dev) /* Save private information */ mac_dev->priv = priv; - priv->dev = dev; + mac_dev->dev = dev; INIT_LIST_HEAD(&priv->mc_addr_list); diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index fed3835a8473..05dbb8b5a704 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -19,6 +19,7 @@ struct fman_mac; struct mac_priv_s; struct mac_device { + struct device *dev; struct resource *res; u8 addr[ETH_ALEN]; struct fman_port *port[2]; From patchwork Thu Aug 18 16:16:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947394 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B311C00140 for ; Thu, 18 Aug 2022 16:18:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344631AbiHRQSA (ORCPT ); Thu, 18 Aug 2022 12:18:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344554AbiHRQRb (ORCPT ); Thu, 18 Aug 2022 12:17:31 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70085.outbound.protection.outlook.com [40.107.7.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77376BD0B5; Thu, 18 Aug 2022 09:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dU1wXc8OQUk1vnPN4sl+NPNn6xuhh8ubzx+9NdTjK+7+T4D/4Vx0bo9hv6CFVCZOcLnj9KC+LPDIwP26hHyO4qnQqXiX3AJZPLMJuYmVBUq5nlPNQ9E+PZizgUB7F59/IGKutz/MprPEFP8BX/yBavIs9Fe2CCE1iKatsW7W9i+N4uf+RjbfI4PPPqZgJmVauWyBZAGP7r0VnGwZgTvpxgsbrwpHSFi4+ethTbNKTOBDro24xFHQpJUludfSqkIGwmWPCpXtS8tiudn3dMPrHBTfNK7mu4zGAEBSpjdiX46Fskqhm5T94rMEdMtP6peo51V9jD0aymvMa76eMBdasw== 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=wS5ITppNepmtVMtZsf6WSzWL6go75usr88Nid72CAN0=; b=SJjDUNZ73KzutcET665RU6ST8QxCYbF/1/UF81b0cetz1YTz7PVMPwLiVnxNekCY9T0SbSubuXAZEA8PEK87hE3OgWMXSgnMBGrK5i5pMze58iMKWryIhbIOXM+W8qwXawJciBRWLmWXMDytEm9jQa+OfLqe6ekKItntZJ4Aj3P9FBVai5tNoI5smfeZ3OKUE5JruQ0MoI9BCDr3/RZ++L+Q3sxgLWbW6ToX0DAwDc2LZyPQlurIAIpfO8XBLvxWxjIsOW3K1hrXIPnj+1dSbOuaNaCC4aRmkCbD7/gzKh2i2uR3eiVaq3/46TuoQfRfWLUAJ5Nz+emS+mgu6vL/aQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wS5ITppNepmtVMtZsf6WSzWL6go75usr88Nid72CAN0=; b=jcluQ+iPpDjeGnIYfzLI++I4GclROhQYY+vtOLNs8jHer86PXMDzwvvsq/1GbjgTir5VlyME8dU9B+F76XYeBUzWRLoNoJ2En/6mHW05Nx39ssuGreFZWBiVLV8tKCkXJYGT6WvTi+FjcHigRoXDvLhOR20fePdCpeG+QIEuCiadBpsGEcBU4WpWq4fYNQAgXJcBO7099evx3l3f8ehZQ47tpws6Gy38/yPGu24hAKaOx3t+QI6D8AI2Sv9DuW6m4xOchejZ0yRcRBH0Jgn2jWs+hdlH+CHxvRdhplIEIUueKgj+R4i3tOS+ZYbEAydJ28MNJmVwUUoEAYBi8m0sZg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:20 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:20 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 09/25] net: fman: Configure fixed link in memac_initialization Date: Thu, 18 Aug 2022 12:16:33 -0400 Message-Id: <20220818161649.2058728-10-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f0811b0-096f-4530-bb2c-08da81352067 X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4/btZ+wDkT7eZvYUlTuBn7tSyYCQc1DbDxP8rIam7X2w9OotLzBnMn2GGVSN3Btj2Anp74yVMSe+WVu+rEm7UlIYoMNzNnhBMMnfOur7RSbTRpsgddESg4c4SzY0hM0Jrt9sy0Z1e7d6rBQDDL/hsM50G2AD17IJCsiBWqtNC+nhU0tVpnePtJQLZbR4u3ctvgY97ELCbdZytKt6cWEqULLXKtCZAnqf+HS3MYo/J1kn8aPzd168EtRu4x77v3fLP8bADMJ+vZ2NTTeRhUSci5oGGYkCA1jSqc/ONdhQq6BJxt93LJfW1AnuEMMj6mmjmoYNYIr58vMyIaLWZQ74EPAhNnVsfziSY7MqE1Dtq4Ki+rxa4rWp7N+7TCadeSOwFpoiZarKQiMIxnFvLVeC/2VKBFGTh+bmLwl5u5ucaKsqucXJyQnsn41Ld66Y18bsrLs7VbtSogGUryn9QDBZlWLozXXW2nVLnx7Kl5e2tRdU3DsB5rAFBPmrOzdtcnsWA1Pnk1ek7g1ymuUnL2/xPPZ8DcZwtms+ZEilbB/Tg6+i6m9vxxjt2bgfNS2XTyW2sWFu2DMDsZkpI+4ABglUZfC70YmT2UQ71UixS1mWKfdhP+c4gntgKEh+zA3ZzGCqUhj3mkYMW9urCWTxiStRzloPusykyR7l1wBZ4UkmwZzW9EHZ9WdJsRedrpN9Du+trUGbAUxoWvs1idUl+8BF+l3YZBMf3ByuaHlzN6qwtsiWtVaaMHY//QF2ptmNjCiFbsJPW+XlM9WsfaEaNnxEDg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ikANFR+l4TK2+BCXTNgEqzZgg/2LB49S46FzuR1klo/m5vfRLNl7ToC+BPbXaDqvNAtWKPGukrx3CwoVy9hdvww01H4xNVU1eVHehX84IMr/WT2L2irZuCScpdd1ADoYnbvPG8NrPMrEMWS6E4erQdBqFlw/UPszc9Ez2P9G+ZXnJvcIuD4rgEpv4N0C0K5PfA638muMNTOKE41K7TUAQ5q3iPce0o5IC8oZiOAEi6PT2Qou7VJAT4v18BPzybgyGozJLpOsefwGEpobHcYYkogjN/7NRkPVT3vfjBt8YhfwnWhAMiS2/NpTqPmbctsudoGr33SmLJbVrwGhbPHkjHZjRoFOYHgGFJJWvXK8TZSFvBGSYjYXfOoEyJFoR1TMVz5RQY8aoFBOWQe5s6rlsMM80kPII3S/KzzCmRlIBLXOkAAeqV+fL50UKilKXdgsOlE9lAk6UdW9GOmHdnIM3R05baF0dGDyaeyRYwTAUMmoDyQ1tOsQKu7H9O6sis90V1nJ8pgFD1iRxs/gnb0yJVYvbnoQ1cSXrBsvMFItu/ELUfp6Ephuyw7SLZhFCV9arwn10ZIPisfbDuITNuT5tYvCW78XnHbJqPBFs3mooJUPI+Dj4VfjeiZt/0FKgAYJ7BtnDJ1LIV+7GokT3C+l6F1Aybxa8Z/qXiVQnSXF8zxSITeFOA2fqPp1XtvFRoVkyvo9dLtaP/hBbx0MtbGFjT5ab6gnLahzARHJAE/Y2kzhJf8m5YN4fpefzzhgspqKn9jWdHMd6FzFNSdr/h8QWTHHmmd0afip3qr5B9oAWH6RRGArN7l8yOoshjDVPf0WrGSxknf+rbt80BbEKc/L8tRaEV9w01vticyS+Hou0JuhtCYKG/EE/BCWiZgejEZ9/fHouXOs7A1Ja324VhXRUsrvJOMHsPn9ZqZWHwLWivNPIzRO01pIuXQRVeG+nL5sofLeoqCDKUrw7jRq9uNrgeKZIIr4TM/E2dWIw6rq2PEEY/KYxTJB3WuFhsrmFbLicAGOW+mSIHmrxRPhPtkvZJ8Fws3dGBrp5htVk+bgVZaHT641HiH2Lu6MXe15EdwCufa3wumsIfg8bWM5ch0rDbLfbIX8UjCkLeuNh2oeHleWsbzInjL0XKMkOObsy2BRM7QJofBtu8jsyJAikZfL67j70MBRrULEtBe+pFfAoYI+yGNra3uWpZlAUGDbVmAMPYFIHX73DO04EtxSo5w4pIqvxlveDpFDbFyT0cpvWwKYpibM1yKsSgmkUM+Vuqq3nxrea3jShE/dmkXszTQV3uY7JOf1zRKdxXJUXGro8zoOqj37z2XpEvKBc3fNeYeqqg0kfrLaFfRhzh1Vw+W+nYfudkR7q9CMy8zqRBBueNDI4tbnNT4P1mo/v0LyV+EN27Z7P6Jxi1K+7qColSC05b+RMIvBTBx08FFTNpTyLOVpu0H/IHTUpP1+/PLnntacqG2Y+yAS/nxUKzMWVdcV7Qy+KPT3Z0ocMW9euELPjqUKd6UShBfNM9SUlJYE4k1MESByjjafJDdtjxtSyXJ5IRfgO8hFI8OiCFPXfkmbRs2Leauy7JOepT4fX0+t/thThXiWymX3pXm4hrtmzuFXTg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f0811b0-096f-4530-bb2c-08da81352067 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:20.5140 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f0acTwbZyB6vQh4fV4Qp+pUOx8xo7MtYwxoetHSRzFtYibwxvJt/Zs1c1GXyJiqkT+ms+PYtV7uPfy9nk1roPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org memac is the only mac which parses fixed links. Move the parsing/configuring to its initialization function. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/mac.c | 93 +++++++++++------------ 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 5b3a6ea2d0e2..af5e5d98e23e 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -34,7 +34,6 @@ struct mac_priv_s { /* List of multicast addresses */ struct list_head mc_addr_list; struct platform_device *eth_dev; - struct fixed_phy_status *fixed_link; u16 speed; u16 max_speed; }; @@ -391,6 +390,7 @@ static int memac_initialization(struct mac_device *mac_dev, int err; struct mac_priv_s *priv; struct fman_mac_params params; + struct fixed_phy_status *fixed_link; priv = mac_dev->priv; mac_dev->set_promisc = memac_set_promiscuous; @@ -429,21 +429,52 @@ static int memac_initialization(struct mac_device *mac_dev, if (err < 0) goto _return_fm_mac_free; - err = memac_cfg_fixed_link(mac_dev->fman_mac, priv->fixed_link); - if (err < 0) - goto _return_fm_mac_free; + if (!mac_dev->phy_node && of_phy_is_fixed_link(mac_node)) { + struct phy_device *phy; + + err = of_phy_register_fixed_link(mac_node); + if (err) + goto _return_fm_mac_free; + + fixed_link = kzalloc(sizeof(*fixed_link), GFP_KERNEL); + if (!fixed_link) { + err = -ENOMEM; + goto _return_fm_mac_free; + } + + mac_dev->phy_node = of_node_get(mac_node); + phy = of_phy_find_device(mac_dev->phy_node); + if (!phy) { + err = -EINVAL; + of_node_put(mac_dev->phy_node); + goto _return_fixed_link_free; + } + + fixed_link->link = phy->link; + fixed_link->speed = phy->speed; + fixed_link->duplex = phy->duplex; + fixed_link->pause = phy->pause; + fixed_link->asym_pause = phy->asym_pause; + + put_device(&phy->mdio.dev); + + err = memac_cfg_fixed_link(mac_dev->fman_mac, fixed_link); + if (err < 0) + goto _return_fixed_link_free; + } err = memac_init(mac_dev->fman_mac); if (err < 0) - goto _return_fm_mac_free; + goto _return_fixed_link_free; dev_info(mac_dev->dev, "FMan MEMAC\n"); goto _return; +_return_fixed_link_free: + kfree(fixed_link); _return_fm_mac_free: memac_free(mac_dev->fman_mac); - _return: return err; } @@ -570,7 +601,7 @@ static int mac_probe(struct platform_device *_of_dev) dev_err(dev, "of_get_parent(%pOF) failed\n", mac_node); err = -EINVAL; - goto _return_of_get_parent; + goto _return_of_node_put; } of_dev = of_find_device_by_node(dev_node); @@ -604,7 +635,7 @@ static int mac_probe(struct platform_device *_of_dev) if (err < 0) { dev_err(dev, "of_address_to_resource(%pOF) = %d\n", mac_node, err); - goto _return_of_get_parent; + goto _return_of_node_put; } mac_dev->res = __devm_request_region(dev, @@ -614,7 +645,7 @@ static int mac_probe(struct platform_device *_of_dev) if (!mac_dev->res) { dev_err(dev, "__devm_request_mem_region(mac) failed\n"); err = -EBUSY; - goto _return_of_get_parent; + goto _return_of_node_put; } priv->vaddr = devm_ioremap(dev, mac_dev->res->start, @@ -622,12 +653,12 @@ static int mac_probe(struct platform_device *_of_dev) if (!priv->vaddr) { dev_err(dev, "devm_ioremap() failed\n"); err = -EIO; - goto _return_of_get_parent; + goto _return_of_node_put; } if (!of_device_is_available(mac_node)) { err = -ENODEV; - goto _return_of_get_parent; + goto _return_of_node_put; } /* Get the cell-index */ @@ -635,7 +666,7 @@ static int mac_probe(struct platform_device *_of_dev) if (err) { dev_err(dev, "failed to read cell-index for %pOF\n", mac_node); err = -EINVAL; - goto _return_of_get_parent; + goto _return_of_node_put; } priv->cell_index = (u8)val; @@ -650,14 +681,14 @@ static int mac_probe(struct platform_device *_of_dev) dev_err(dev, "of_count_phandle_with_args(%pOF, fsl,fman-ports) failed\n", mac_node); err = nph; - goto _return_of_get_parent; + goto _return_of_node_put; } if (nph != ARRAY_SIZE(mac_dev->port)) { dev_err(dev, "Not supported number of fman-ports handles of mac node %pOF from device tree\n", mac_node); err = -EINVAL; - goto _return_of_get_parent; + goto _return_of_node_put; } for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { @@ -716,42 +747,12 @@ static int mac_probe(struct platform_device *_of_dev) /* Get the rest of the PHY information */ mac_dev->phy_node = of_parse_phandle(mac_node, "phy-handle", 0); - if (!mac_dev->phy_node && of_phy_is_fixed_link(mac_node)) { - struct phy_device *phy; - - err = of_phy_register_fixed_link(mac_node); - if (err) - goto _return_of_get_parent; - - priv->fixed_link = kzalloc(sizeof(*priv->fixed_link), - GFP_KERNEL); - if (!priv->fixed_link) { - err = -ENOMEM; - goto _return_of_get_parent; - } - - mac_dev->phy_node = of_node_get(mac_node); - phy = of_phy_find_device(mac_dev->phy_node); - if (!phy) { - err = -EINVAL; - of_node_put(mac_dev->phy_node); - goto _return_of_get_parent; - } - - priv->fixed_link->link = phy->link; - priv->fixed_link->speed = phy->speed; - priv->fixed_link->duplex = phy->duplex; - priv->fixed_link->pause = phy->pause; - priv->fixed_link->asym_pause = phy->asym_pause; - - put_device(&phy->mdio.dev); - } err = init(mac_dev, mac_node); if (err < 0) { dev_err(dev, "mac_dev->init() = %d\n", err); of_node_put(mac_dev->phy_node); - goto _return_of_get_parent; + goto _return_of_node_put; } /* pause frame autonegotiation enabled */ @@ -782,8 +783,6 @@ static int mac_probe(struct platform_device *_of_dev) _return_of_node_put: of_node_put(dev_node); -_return_of_get_parent: - kfree(priv->fixed_link); _return: return err; } From patchwork Thu Aug 18 16:16:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947395 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 895ABC32772 for ; Thu, 18 Aug 2022 16:18:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344639AbiHRQSE (ORCPT ); Thu, 18 Aug 2022 12:18:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344555AbiHRQRc (ORCPT ); Thu, 18 Aug 2022 12:17:32 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE2A8BD0B7; Thu, 18 Aug 2022 09:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iDooIjSj52pOUK64EMMr/xmQjjsFCSdIqrFN/HRZtINF0WOVVhpG9VRFV26RoZJz7m76/mAPsC1eJ1dCdcYAwYX9fnsH+w5Cob2u4OoT+nzClWUaMfNKzk7tslgpgAtUn8/urnEdeeO0zc+cUTDKfVnlane3F+esSm4gAoKyJ3VjsKaKCfM3fGVps17OAIcEjCiREdA3avHYuvz3qSreZ++NXxfP+daywlRgX/P31FzHYQ/oRCfruakEUgX29j5/KXvARevvZNL2ElkXDTkFeUYMHJKAMdC2tVoYZoTJkTyy3IfArXceWdmf7wqpnMY2SqHnx9i+gHqrg6yp4n4FGA== 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=nzEMv80+yImB4Wmb71Po/tzw2y5X2yRQVMwQIIkbHMU=; b=VL6Be2cM8StG83NgWH/KQKgIJQm2BTcMDv+yuzaT3oWIA2Iqhp4Db/9+izReburxXVXCI6dtvf0X7D8YdFV6T/22SpIGNxiaQoQO3ynqoiDJSOi+6BqmSLT8ruSofN7NT67Y51fAxH5GKrKRZV/oW2LsfgWSZmpMcXFgubapX5nhlEvQcOp//au1082GsQwdC5NE/GtXBJ8U5qFoAIaVuYddsGQuGIx+mAjpYtCw7jbvakWIFxeydCAK6TJPJv2cm5yrWy9IK8zhySbIlLPqeWu49VBpJvLvBor1g3oTVuxYWgL6SMzrzM72kFqUNKYRceIMObgRiwiFDPEfksOTAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nzEMv80+yImB4Wmb71Po/tzw2y5X2yRQVMwQIIkbHMU=; b=PoCcA2VMh6BDFOCZUKksaj4nlEjbov+lRkS6gT7Qs+z3i1EIthOaPurlsZBPi8qjidiwqoaswNbrZheJ5kBBGSX9O/ZwHlValqqfgdk8BU5gxpJ77+XUFAA4mRye5MDoXwQKc/kJjkiFNYV6E0UbPdYTFbnYg9hrE4y7YtboozzeXfjopFNpPdl8gJ5wVq3GpwqsvNucnKnfWw3Ct2JAbpIv8tdWb2sCho5JHBNMRKy9GSOLOHzU5YZMWOvVazT1X0xJ1C9FhWeRsbqR/5F9iFLrzRxnQtgs8tiW0HRXZ2IlCamAAE0arT3JGKam61sun+ncB5X1+VpnI1ta3Dk9Ag== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:22 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:21 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 10/25] net: fman: Export/rename some common functions Date: Thu, 18 Aug 2022 12:16:34 -0400 Message-Id: <20220818161649.2058728-11-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5eaffb4-951f-4c69-d441-08da81352147 X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OMsZd6EBaSVC5zBwVlB26SGEgGeBHfHsUHY30yNXqWq/fhbY/T/YzTqMbjpLzIL/435YCnBIDBGfni0ZEcZQ39mjLjUTLB3fRUcd0DiGQxmqnzkaYA6AKlU4ZaFOFq7VYF+2/ihJ4jK9xunfFzM5/A9othrhUITqWtaZRn/Q3JEXOxJ3+E3nXQezKy+VeRsBiAESoRblR2F6AIuQen0Lzfo6oIiD/c009JAKisEWQsua2RsejaLQsiMsQchvLGayQy3dL63PwNLN16zjTqU0tTJFI1Pz87Zv3Ea/bqm6JQ8dA2IGP0S4vqMQPhWgQOnIAZ5DDExLcJ+LyieNkQY0Aai4vq4yn/XPP9/Q0vhWZTnOEguCi/WMG6u4bYzPA6TC5aiat3GrLZTsKH3qIqTcW5dVydRADMIdOJScoe5xL+dbos7uCZOdo2HaK8k61vC3zTtjxZqb06F0MMz/nQNv4TUYxnSgjLF3dgTWpGu28RTYIPBz1Wqdw7Unu1jd2lqD8AoXOTE+sZjEnNzIk4L0z30LfSDb85tWzc3fpefiHSnJcjG/CDWu8zk9ZanWXumQ+Fei9XpgT71nryMn/i1y5XNXR6v7h2WPf/srD03/fd8flqCrY4q7h6wPHBpIuD7M+3lIZKCUA/ZfN/jDocaYYA2FC1Lw7IA+YqK9NGFaBwB2eCNowRKnnjks/LnyKMYe7Ac+O/FZAP3eMte5CGefq4jBiL3D7+/az8OjjQ+bOniAi4Jip0WWlS5k37qgUll7+2pZ7kjnMMjL8regGs4Ijg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8OcBlCBfRg+MkGzISe+76dCfTVBo0fNfiYrIaAMay3h2XjJu+axRNopCek5L6DTm834JHdlS7p8fCrBCe/Ua7Cs5k6CGWJnmb1leWmxr2xcNu7LfDwdwtcp2fWDN05hbIAzDv8EvLnqehSlODh1zIJ/gkuGRU1fZ1LgaFF8w12kyZIVLGJgb8aQglBy5r/l50thhf1x4N2+gdNbpQ6G9/Ec/l9IbapG+SJFi2xPZR/BdAlNTiI3+lB1HileMU3RwCk0EihXwoS+PAjlZ5a9kddXjrGn1E/+GmoKnC9jO7HULMgBxzbPVPhSlESVfv4PDCcitDkuPn0AMcLXw4lc21eOjHgsnBapLlpXBd3kZMYmEYEyVMpKGX1INECBPFxSUg4LuCs3KaxpX1dVhzQZZyIn/uwnWvm5Tq2sM2ddENExmpsdnDsuyaHYzfQKJyqxrc9TJcW3//NsUpdOyif4q8AcJt12eRv77IOvTraCx/0mpCdbdTkvNYx+o6/OeG0xVb/ZxGu6q2RT6CRBC3r67FDf/RXCM/DUklj72zwuxN1n5h7jGhJLU4L4IyeihvAyJd6VgOIHfuZzjZFyXqFbsrqWRBaIKQmHyopntFEETnTqy3iIINBByvvA7B5Zcpx4lTv8cIklqMtpHxGNB2dW09xkqYhP053NJoN4DbdKLZs3zArqd8xv4y5VMy72bBmPIdEL/ija0D/AHwr5y6ttFxH16HdSrr1W+LEvrutovGhUjWcI2MGnmCXp7fT2qYFzHT0e0KNhjqIudUEoIAAe8Wwlz3mggqUCqIFG4EwWXY00GzfnWLkFhuAK4ow/C6ukh6M7HVKtwXCyh8o2mXXKAsTzSbr0m2KVWwWEKq6isX7hh7/0UqApfQs0k8KfHBVinElS0KOLDBt/pQJrPyjSY/6tccPd/dlQINodmE9XSoP/51TQH2fWXVEWR8pmUuEluXjrK1mVQYmUPdKYBCOtmE0dxEKG/Ln461JL6Ju4Tdob9XV4bz6oLhjLmedKa8B0JWiKP//BhX7JFo43Mpn06SnRmusSUA5tGQzxJjsF0TgkL6wEYWeiIoW9rHBOsLJqiNBDW/EXUfjFKcrlinBSX2J2oAhd6hMcmFmmWtZQeEQSuoBtwNz83PegQpTyNhAEea6OO3kIgPGJci2JmK2TV4o0GhbeS7tvC+RuZx0nKcBvwjZjerroM7mSm4aN0a5WlYFQ1NuU76IFaxRC9KcxGRCMNKRdApmm/l0Odue94U3SV2N4RWBETrORJbRsYnck1z0johzdZpIp7rTdMy30gjBnHL7Q/H+IfWNWDmyEos3zVzBwpasvsYyh+9f9x80KXf3+lqcA0Rtjs0R0rDv2xZZPHX+Xdvj4u7ODRed9wBcksqTZPe0RwL/Qc41ApgmqdRdqVYlSVVcTIUB//Ro3NMlzLc1g0zS1waw3T/0S004R6p5Cg+SIrxWgiKtMfdcybL1FmaTeMl5Be0WUqKDduWrRhWA7Pf2x+yDICgeBtwzgGbyoaLgX5rtnHgDHShiRRpfZurB5WuTt3Uj6bMqXLV4xfxRsgX2npvT9HsT2vmX1m/O8wy1RXJogTpm3Pt+QnJQmKL63RWhPO0jJ8od09uw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5eaffb4-951f-4c69-d441-08da81352147 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:21.9045 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XehLkDVpu3hekUn8bAOvPzJTcixOVAy7DKo291m28zUqxH4NESXPuk5CJwVnZfXK/qqUO9zpnrykb95T6MMzrg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In preparation for moving each of the initialization functions to their own file, export some common functions so they can be re-used. This adds an fman prefix to set_multi to make it a bit less genericly-named. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/mac.c | 12 ++++++------ drivers/net/ethernet/freescale/fman/mac.h | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index af5e5d98e23e..0ac8df87308a 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -58,8 +58,8 @@ static void mac_exception(void *handle, enum fman_mac_exceptions ex) __func__, ex); } -static int set_fman_mac_params(struct mac_device *mac_dev, - struct fman_mac_params *params) +int set_fman_mac_params(struct mac_device *mac_dev, + struct fman_mac_params *params) { struct mac_priv_s *priv = mac_dev->priv; @@ -82,7 +82,7 @@ static int set_fman_mac_params(struct mac_device *mac_dev, return 0; } -static int set_multi(struct net_device *net_dev, struct mac_device *mac_dev) +int fman_set_multi(struct net_device *net_dev, struct mac_device *mac_dev) { struct mac_priv_s *priv; struct mac_address *old_addr, *tmp; @@ -275,7 +275,7 @@ static int tgec_initialization(struct mac_device *mac_dev, mac_dev->set_exception = tgec_set_exception; mac_dev->set_allmulti = tgec_set_allmulti; mac_dev->set_tstamp = tgec_set_tstamp; - mac_dev->set_multi = set_multi; + mac_dev->set_multi = fman_set_multi; mac_dev->adjust_link = adjust_link_void; mac_dev->enable = tgec_enable; mac_dev->disable = tgec_disable; @@ -335,7 +335,7 @@ static int dtsec_initialization(struct mac_device *mac_dev, mac_dev->set_exception = dtsec_set_exception; mac_dev->set_allmulti = dtsec_set_allmulti; mac_dev->set_tstamp = dtsec_set_tstamp; - mac_dev->set_multi = set_multi; + mac_dev->set_multi = fman_set_multi; mac_dev->adjust_link = adjust_link_dtsec; mac_dev->enable = dtsec_enable; mac_dev->disable = dtsec_disable; @@ -402,7 +402,7 @@ static int memac_initialization(struct mac_device *mac_dev, mac_dev->set_exception = memac_set_exception; mac_dev->set_allmulti = memac_set_allmulti; mac_dev->set_tstamp = memac_set_tstamp; - mac_dev->set_multi = set_multi; + mac_dev->set_multi = fman_set_multi; mac_dev->adjust_link = adjust_link_memac; mac_dev->enable = memac_enable; mac_dev->disable = memac_disable; diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index 05dbb8b5a704..da410a7d00c9 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -71,5 +71,8 @@ int fman_set_mac_active_pause(struct mac_device *mac_dev, bool rx, bool tx); void fman_get_pause_cfg(struct mac_device *mac_dev, bool *rx_pause, bool *tx_pause); +int set_fman_mac_params(struct mac_device *mac_dev, + struct fman_mac_params *params); +int fman_set_multi(struct net_device *net_dev, struct mac_device *mac_dev); #endif /* __MAC_H */ From patchwork Thu Aug 18 16:16:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947396 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B0C1C32773 for ; Thu, 18 Aug 2022 16:18:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344643AbiHRQSF (ORCPT ); Thu, 18 Aug 2022 12:18:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344572AbiHRQRc (ORCPT ); Thu, 18 Aug 2022 12:17:32 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70085.outbound.protection.outlook.com [40.107.7.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8682BD0A8; Thu, 18 Aug 2022 09:17:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fn+nqhoq23ZbSwgUlFB64U5xjA1pDuiXQdMzGzAkiDvKMb1Y2GhEtM2h3vK8wY+zzTphPk1wrquT3kJLlO2cckzeRS96/z6kjJCFLjAZc/clS/nw2Rgmd6rGg1tMEE6Bk/ilS6OghUfcjE6tSCd+pgssrtg4VMYr7Y6nW9rONO1U/W0j05MLcsdKQVGu+A8nBpAoEKeuL1IAZGelsf8kFSpARjF/tjSZx3nUEoz9McTfWLe3GQn6e+igOWJLNsxmSf5Owt6grj4LmR4553HZ4KEEElrN5UMpKfentQfDdq93PARDzFoHaZl114k3C2eXUW9yLS3bPWeDQ00ovYcvqQ== 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=yjElZB4KBj9O7wepfR5xVozXWKsZLczj6QtJJ2HiuT8=; b=ZHhEfEDlT8YSHZ+t93PPNoLrDHwBGKQLDXbwmoFeKH7Lo6WL8FonDGC7MoXR86BTxTGeqPv5JQV3hR3WWWukQOVPmSanoBvjjhCCuWiTcGnujvUPJvwtE9+SEjkIxPTetnSrrZor1I21Oiq95cnXRU7ZU7zCUf+8SNIcYj++QhsiYNIKdcxlHzODRtOntP9B/ZF/MxSg0m7BVxdGwQIXFVHsWq+OEnWv04jFdU55tMuN8Vqw8wFDAraSwi26WepqhtgzhwMTJteycQWkq714OOvgynvwiXE78V6H3CIKoaG8pPiLp3nPq1J8JsvW3TN8AHR9IFE0U1bGrNpslJ+VqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yjElZB4KBj9O7wepfR5xVozXWKsZLczj6QtJJ2HiuT8=; b=l2peOThBT3qGL700O9NaCEmQsz3huuxm5z3gsi9hZigZEoN/tLlrsqKJDzPh5S9SoAzZcEV2W3s/IXJ9Px4/9IVgFvCRjo5mXHQmtwg2Uj7fW06u/TDZcaWPj+BVKKKXQk6iOtqvVRr2ceEUpObhstdOXT93ha+Pwknl1tMBtWCrwTzILDbMPzXMKfH8DIZ+Mul7PpR7t5xeKxLeGTnT5i+UPEeKM0FLyhrvcg6lugQbBc0GjHbqkP5k2q3sUF3iTDiHIpo+X1z8J/TNd+jIYYyZx7BdGIkTEOUIsuuJpizyH98ZqfDCjv9GL4lmELhfM6ASBpkY0rFy1nocC8Lkyw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:23 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:23 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 11/25] net: fman: memac: Use params instead of priv for max_speed Date: Thu, 18 Aug 2022 12:16:35 -0400 Message-Id: <20220818161649.2058728-12-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7800247a-401e-4553-01df-08da8135221c X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GaK6ZRrZgRVeegtnkig8MxP8amFR2a1nVXhwoRW33pelWPMSVQQgzrnOe5BbwzAtjGglMowxj7zk512hYBeSJsXrJZeyd207JdpaD61mas/8JGmOdo8V9584hCkE+uIbO31PWsaCFBHfD8H+s14dz5kxklnAMJIv5Npa4JsWeXvlNjGXj65QWBDHc4d+lLvK1wgsr3Q764887VYxpv9drQXw/TDo8mVYQg3Ex9lPPQoS9VvAH0wejbfi+yqW8trD0jInyz/tp4gkoMrDp19pqwqgj8M0tv6z1e6yvlipKDU6Nv/Xjdw11eFo1kQoXKC8ATZAUdX8SlhUDeOW41Ff2ElC161Q16/Apq6CcKSw266HmqHseEI2azzJShyc9qbo312C1gCgE4iHv4dCEXb9qiC0cmzHfb+7JbMjVKE0YU52dRJuE9Ah9lMk9zCwL+714fY5fx0ScaF53rSf6g/mES7bN/3agMW812JTSNk2kLSgZLL9MiG/dMm5aRMvmTSmFh7AXIDuK2YWuCKly4U6Lrha3Y1VG9r44EVB7NuGl/GtLP06rTGpPcO4xcRcNodoI+MNH5NvvXK2hNrbd62d6qIGFyhr/13i7+BVj02xEsYsaRePcbl/JoIaepP1XC7QrWLcRZNzEnLTDEQ5XiFRgbGFE74GKuh1swN468k8UAKsBNJ5xroXjea7ns0eTSoAAtqPXD9zw2sYqQJd/atCgXeqauqSraDufz6BGar6pgECgB7kXMr7oFc3mKq5Af8dQoJar/nh8ESvuhVNBQusDA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: erGXD0xTFy/ZtMxSo4xvjbjXzcddqEJ2IlkLnMm5+P2aHs43OG68G1p0g7AgTelGzbBurJrvX/hZjim/xA2aFgPcQ0lZ0bm+/o18SJYIBC6WUAs7wKjaHtD2Hk6c9fs/QP+UNQ/2vwFJMqMcOH3F3/dveCAfoo5C37qtsX1Y5gCWHHD8k0s48J0sAscybC2QvBAttVDXtaPzD5eQ8ox8uI+e5TMoUHyLMqqeNwLXPP88HZb03MSlQTLgSvCWSbXNLUGyJNm/yYzJCBGjR8eBw7WrSQ2ggvxN4L1n9v2iNiXkTVzp7LEXbEwzQPbQc6m/vG0n/4Xsk2AfZskwy7g+cVoJWGwsNvckMNFHV0DHACl4GqAXhfeoU4PNyA7z1iHhNTavBcyTFyseiknMfPaA8R4QkKy48yGAuZ9ClXD0P9oM71IbP6JMEModAE06fuMZ8+XTCi3sC5HxAZ/jqPsv/rg2J6ktq5k2GV1pn0p6Z3YQsKGPaEMxO9UEIpV1Z8z/RlhdI9ss/EwdOULIiFTKSxXyAe2GZMT3LjFulNH5233GWOisJZMYf8uABBEHv3tkPm50tNkr9zzCE7gWILBB03dvIXxmwJ3ww4oOYzsVTZIYAL5lOgxxQCDHGXx5pGroa0l5qHajrq1qsas7HygLY2/wT0Xv40DlTWaaS1TIbcUXKYZMsHxfX42KYeoAvp3mzblLFu3bfpJ4+M+EV7TCV11sc88HWyB8rd+mO0MZiXelHOLh5Bv3lb+3+bxJxqlLCrHfNRbcNCqBqIlJF0ERI3po2RvlDt3+4INj7evWLtebyat3vR4yTwpA3/chQ30D/2Rtzz7UcIELkKNchWLJi6rKsmeOUBqz0HywjeSvTsoAM3yIq7zdp4KbkSSk+IYEiTqW3lsls5ZCUo6UICRFmZORVD/9264OGIsjPsOLP+UrS7zYvV14xj+JjGdS1q2WsKsv4KX6Hso7RO98arJmvuQ9lTerPJBAycFrAPL7+DeJyCOyDK4w8z+FNIGVuUoBu2i0/Qt4qaUtznh+5EkslhwJAwWHidHwMTxtzA6ukhSjvDV30a7lzRQ98ufPVh7C6JvAEd22EKu0BdsImd3LW6He2b3d0WWW3YKIRnzEDyJsmNOEoE+RMAgVFngQvNJoZD1Ggnp+0lkIu9CisARAE2JBXMwUnJey634fv6N6boUj8Fpj3Ky7m5v7dTurV9TEuk2f8jGW6IGN+dZkgEX2NlnYjWd4Jsi+VxTF993fctEhvsUCKvqAa4r5F+q6flGMSQDZvC2HI7GYhzmMvpgo29kzh8WQNXreE0FwCqkBMQ9kVMuByXtFw8jyBLvQHAsaSuzMnzh16Mone+N4d8vkOovfjgGESJCLxhder+Wt2jrf47zWhtRZAJY0bcpz5wR/ecbEKYcvPAr2fSrW366H1Aw2sOq75Yct4qDr8EZF2qoRHaUDINERonrNmglTUkZxH+RRBEdEYNwkzxLdf1KtKSw5GjL5GnSplPgxT/42XU2027+nUruI9KYmd1CSd1Ly6MQe1Lpk7L4kGLWeulJ87qldpLh4iBLfsdltaSm6c8AdQJ8cKaLVbF00phnWgevmgaDwzzB96S/C+9YCWleupg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7800247a-401e-4553-01df-08da8135221c X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:23.3888 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hL3I2lp3yxXyijirdO7nhZ5Gk1VFBgFYK8yAjgW8ihlpS/DNG1cUHYvVOp9Q0NtE1ph6TEJyDztbrjwkWYBXfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This option is present in params, so use it instead of the fman private version. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/mac.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 0ac8df87308a..c376b9bf657d 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -388,11 +388,9 @@ static int memac_initialization(struct mac_device *mac_dev, struct device_node *mac_node) { int err; - struct mac_priv_s *priv; struct fman_mac_params params; struct fixed_phy_status *fixed_link; - priv = mac_dev->priv; mac_dev->set_promisc = memac_set_promiscuous; mac_dev->change_addr = memac_modify_mac_address; mac_dev->add_hash_mac_addr = memac_add_hash_mac_address; @@ -412,7 +410,7 @@ static int memac_initialization(struct mac_device *mac_dev, goto _return; params.internal_phy_node = of_parse_phandle(mac_node, "pcsphy-handle", 0); - if (priv->max_speed == SPEED_10000) + if (params.max_speed == SPEED_10000) params.phy_if = PHY_INTERFACE_MODE_XGMII; mac_dev->fman_mac = memac_config(¶ms); From patchwork Thu Aug 18 16:16:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947397 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93FF7C32772 for ; Thu, 18 Aug 2022 16:18:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344664AbiHRQSV (ORCPT ); Thu, 18 Aug 2022 12:18:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344596AbiHRQRj (ORCPT ); Thu, 18 Aug 2022 12:17:39 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A335BD0A6; Thu, 18 Aug 2022 09:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kt1QoqZzLm0atCuwrYmw/gE4L/ypLfv7s+AVlEFDEBCW1uT6PyL6HeIlwk9aGfjbpA4tXLzY9uFUAQ2UUxIpDMkE9yboXyO57IgBC6Pp8cKTdlPOPvLAvAJ/cEG1W6dJkVlche0I+FbKpdfcmnx3EIPohe9Tp9pVbeOQPA8k8aY9eqctprqOFVcXFImetH++9MNkt/DbJfL8e9V5jSZ88rTu7/7D5hpVh6L7EZC/8N+iabrO0hWBT4li0A+XiNMfS4LoOx10IrRphS5Q7fbTMqic1A7ydkSvisR3y98D7tjhtcGoKEaNTsuZZxHisO72UtV3As/yhhFBwJb7qXXYlw== 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=veD6HsB/zXZVLYUNWscbV7rOmgPddUpGNACYumEKmQ0=; b=QkcBxUI5uE833p8B40geL8eI9EtoJtM7MASO8uHUpSTONajVQkeFVv2o6usJPoyRW5qMftLa+gTNdfyLzDMw4yrsqqZJ4RPTRGcKevXYmSC5rUyhgXYYlU5aAawPO4G+BNgGsb6PNTciUtoEN2J4I514mUeS2diHIK2JsPBnMnoNSB7pYZjKgkcy0Nl4n4xxe6eS+foA7+cYXHR1vsbuEim+Sk5GewwlFTht2zwOAbuVZFS5NUawq6FKtIfzn6U5fryah6tqxsBTfvliCgloe9SdHjJMowoMMlACY79dVJNod27vrAXMGzqH3lrTaGX3yp/aN9P/DqbGCYO3VmQBKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=veD6HsB/zXZVLYUNWscbV7rOmgPddUpGNACYumEKmQ0=; b=undjFUwGFJJJbqLjGfcCqhs5MRj+t+FLYQCjRmHHFKhFuBkCNh7hbQoWrg5i/dV/H3Oq2XDJuheKdMIhIUi4wfnU6NLGegQthQGFd7AMbnXt2gdc0j/FcqWvkBOFRmN1+Q+xQw2+I9GfsqePWR0axj6eQ+aKrJSiQ/cIK7ow3La0ji+i22Hd2azjK7B7q9i+BHPDATDPAXevJhfjzem0acwSMMFsl8kWOkOkGv5zIBAd1XALCxA4vhfvm200/O+Z6sSNONlRpqcb2Nckf6/2kmxs4WpmTPCQKCljTGIP/yYujToLpslwUBcW4iVCoEbi3ddjOHgGfSqEGFWrQGXIgw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:25 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:25 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 12/25] net: fman: Move initialization to mac-specific files Date: Thu, 18 Aug 2022 12:16:36 -0400 Message-Id: <20220818161649.2058728-13-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4ce84cb9-c9af-4c69-b8bb-08da813522f9 X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jVUh7laERLnc5Cx9YTp0fmO8bIBqqlDNuHvkZnsvK8Z9X/hSjDYeBRdzu2+Gl4OlR4ACb7ajvrMokTwvjJDL7uSoTpLBk6BqNIAzUyOvve2KeCJrCp7pzhVzewRHuvxuKYNLOvuVR7WBS2uum++EYg+uW/SXlleiOu5xTEkXwzbaKA8svO2HqpRuJra/D6QYS+3pNYoyBhg0nKALxZ8lwuBMcw00ZNX/EMKQjvyCVUfVL087/3gYQuEzWxOOplalHFrvg2uJiAuSnrHUtkVSngnem6xDehx9x0FQuoEZJ7OFnN3y6Kr/lCllthyPkl7vfX6oxfKBB2A5MoGwHqP+Y+pYtIwTExq3iKv8nudKCiWXKTxVak4s79epiCjiSinlJ8iNGyL+IQuWuqtYWqQ4n5Cw7x4+2PbfihQ2RcNGatmKmIELmtwjc+/ezXKNeVVa6LtuXoTpkSuLX6gPYSdJbk5LLniyPHHSih/tSxT5HK3xoaZBiRqOazUgBQAbEC1mvVlbSqJ84csG4ektALLrSRS/Mw7nO5RRGokJpNlCERpkkJtNNm/TBDt8aTYiySL+7khUMvXna9QTYrAEqgcSbPjdMMO8luloo3PP4c2upmYOiMoa0S4wyC0e7TcaviW00sKKOfFca0Y23a80/2t9v088VTzZKh5RQylOOMmpAELVlFXeBQBJvXNSytR93gwMCEjdpE/66P+SIegHKJFxohOqD2UU0lA8V115FKENsP92IDK2dvGetWcY4PLxNsmbHk6HepX92nBkqIG9Ch6gqw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(30864003)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dIm3tPfrE+nwR38n1DeqzaqCjdB6cEc2Cv+embbgRtEGBKBlBljuYjuVzjXBITehf+GbBtIiYScgOdfx8R0mNvhPKvVSP/GyICHiX12a65g7fF3TFcgTNIRdQynWE24pLUCDBKEIN7XIWl6Sn4HbHyjVmdPKVMmDm+MQCDGKWveAUrBiK/VByJg9XZIg+Ui+BisegONiihB1u/1r/rW4dNKPbiPrpXupsLXCVt7Cw4VSvSUPCkm6mOhVqjvQdrnfJ6GZO34RGEy6EEnUYduw4HHWupL2Uai4Y6Q14pI6m/ixWo46SqY+LhGJ7qPEwqME7k3mX7CoE2RSVnOS9DSxRIMrW9ZhQj70pg/hA+8OZIkuhIxeCS5Xb0s/fU1/V53xL8mC+p+OGLJ7TP0xtYvcDV7XCEGb6MeHt9IVXeqhksNIMv/J5LcOklIBlBAVWpY9/By29ebk/BzOnFlA1HkggjP8a6lUKdhnwhxRgKrJT9QcZM2uDvZFOVjS0Miko1zcAOK3VXkrSJL8SU1w7dXwmki3FU8nhbDGg8QYKgxC64d90k0ggLjjrgQi5o938u3JLs0HICb3QpLPfhYFf2BRCHxGJzc3ezYVe6A45kTpb36Oqdze0vfaFcfTtlfzE5CireDFBYud3BaDZekl+ZCucR5FiaSejnnBKb7jDow2PSQHHN3sH5Lw9x8s9YaROIXYzFqgJ1jtnygilLyd9p1ruTFmvo2hcy/+/XBZzLPkszgts2YnaVjbH3n3X3ORvuXl9786fuov8hRiZaLu7fw9omNemSAYS6xjNKe8fCEePx4O4WfjJXOtn1zjFQ8S/MhsEvyjEvAVNDLlzLiDS/BS6ivlgK0q+IE7GEcdBE5wGLDA9JJV+tCkSu+iCDKyv1IVlJyBRsHmHPXNF1Uyl7a4UDvxbdcX79N35MbbWT4tgwL58hm9GVlPqRMgxOym+sbTcajfOB9PjVOe7CsSs4Uxn5uV3pqel6aY2tUx8ESLKQTDmbFDrOJmyK2El1J8QTRuRI4ecdI4uDzXDyAQ4XiY9iVAKwEr4eU+8ZV6VjnoMWnqAqo6OjnCEKFRTq9amypiceYn8caa7QYlyTyRxkPFoMXYOUKCuSUwKHTy+fNvhhIH7531cKKJ0d0IzCdhc0jyCg3cJrADjgSzP09AQSlkJ4u0lPFX+H6mbbtasaifAusp++7H9WuAjZ3ltPWLkTiq4z6787fRiM7id8Q3h60n5WjGQu5n139HRpDttiDYNQDj1UzfMF93LlqchM4uDVuLiEF70To58gJ3NHPSq6wHUaG+8NdvkTwXbpxAHQCE9ox7sOc6gKgxOpvHPjkTmdg3+5taXPFxwUJr+6hv3P2Mnkd1aRtgClr4ox2KLkt4bEZTKVgGgXS1U/J8l44u1JXn/ppTziZ7p/kkejsGePGmQamGhafLjuz+3y+9hoj86J8tDDRhxL+ezYSsiKfJjXXPjHw6RBthYPPMZviULH2ZzuPNdwrCNTEjXH5tvEvBusl4R+gumJJ8ZWP4qCTSRYSiNrBYeINlTvhBq5cSL8B7aFdRcNKMpa5ZqMPHWi43OhpR+6gMKHopO+j/uC9nxQ39bSdSMWmPZmz76adqFUpnkw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ce84cb9-c9af-4c69-b8bb-08da813522f9 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:25.1074 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3j9L4MvN9aW3Gf5UC7tD54YTxNYSSDF953HktE3tHyO8ZR0LKEBPihh0R8mp+PeL0Co91m/Oliuo/kOqMT3XkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This moves mac-specific initialization to mac-specific files. This will make it easier to work with individual macs. It will also make it easier to refactor the initialization to simplify the control flow. No functional change intended. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v2) Changes in v2: - Fix prototype for dtsec_initialization .../net/ethernet/freescale/fman/fman_dtsec.c | 88 ++++++ .../net/ethernet/freescale/fman/fman_dtsec.h | 26 +- .../net/ethernet/freescale/fman/fman_memac.c | 111 ++++++++ .../net/ethernet/freescale/fman/fman_memac.h | 25 +- .../net/ethernet/freescale/fman/fman_tgec.c | 65 +++++ .../net/ethernet/freescale/fman/fman_tgec.h | 22 +- drivers/net/ethernet/freescale/fman/mac.c | 261 ------------------ 7 files changed, 276 insertions(+), 322 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 7f4f3d797a8d..92c2e35d3b4f 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -7,6 +7,7 @@ #include "fman_dtsec.h" #include "fman.h" +#include "mac.h" #include #include @@ -1247,6 +1248,28 @@ int dtsec_restart_autoneg(struct fman_mac *dtsec) return 0; } +static void adjust_link_dtsec(struct mac_device *mac_dev) +{ + struct phy_device *phy_dev = mac_dev->phy_dev; + struct fman_mac *fman_mac; + bool rx_pause, tx_pause; + int err; + + fman_mac = mac_dev->fman_mac; + if (!phy_dev->link) { + dtsec_restart_autoneg(fman_mac); + + return; + } + + dtsec_adjust_link(fman_mac, phy_dev->speed); + fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); + err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); + if (err < 0) + dev_err(mac_dev->dev, "fman_set_mac_active_pause() = %d\n", + err); +} + int dtsec_get_version(struct fman_mac *dtsec, u32 *mac_version) { struct dtsec_regs __iomem *regs = dtsec->regs; @@ -1492,3 +1515,68 @@ struct fman_mac *dtsec_config(struct fman_mac_params *params) kfree(dtsec); return NULL; } + +int dtsec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) +{ + int err; + struct fman_mac_params params; + u32 version; + + mac_dev->set_promisc = dtsec_set_promiscuous; + mac_dev->change_addr = dtsec_modify_mac_address; + mac_dev->add_hash_mac_addr = dtsec_add_hash_mac_address; + mac_dev->remove_hash_mac_addr = dtsec_del_hash_mac_address; + mac_dev->set_tx_pause = dtsec_set_tx_pause_frames; + mac_dev->set_rx_pause = dtsec_accept_rx_pause_frames; + mac_dev->set_exception = dtsec_set_exception; + mac_dev->set_allmulti = dtsec_set_allmulti; + mac_dev->set_tstamp = dtsec_set_tstamp; + mac_dev->set_multi = fman_set_multi; + mac_dev->adjust_link = adjust_link_dtsec; + mac_dev->enable = dtsec_enable; + mac_dev->disable = dtsec_disable; + + err = set_fman_mac_params(mac_dev, ¶ms); + if (err) + goto _return; + params.internal_phy_node = of_parse_phandle(mac_node, "tbi-handle", 0); + + mac_dev->fman_mac = dtsec_config(¶ms); + if (!mac_dev->fman_mac) { + err = -EINVAL; + goto _return; + } + + err = dtsec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); + if (err < 0) + goto _return_fm_mac_free; + + err = dtsec_cfg_pad_and_crc(mac_dev->fman_mac, true); + if (err < 0) + goto _return_fm_mac_free; + + err = dtsec_init(mac_dev->fman_mac); + if (err < 0) + goto _return_fm_mac_free; + + /* For 1G MAC, disable by default the MIB counters overflow interrupt */ + err = mac_dev->set_exception(mac_dev->fman_mac, + FM_MAC_EX_1G_RX_MIB_CNT_OVFL, false); + if (err < 0) + goto _return_fm_mac_free; + + err = dtsec_get_version(mac_dev->fman_mac, &version); + if (err < 0) + goto _return_fm_mac_free; + + dev_info(mac_dev->dev, "FMan dTSEC version: 0x%08x\n", version); + + goto _return; + +_return_fm_mac_free: + dtsec_free(mac_dev->fman_mac); + +_return: + return err; +} diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.h b/drivers/net/ethernet/freescale/fman/fman_dtsec.h index f072cdc560ba..cf3e683c089c 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.h +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.h @@ -8,27 +8,9 @@ #include "fman_mac.h" -struct fman_mac *dtsec_config(struct fman_mac_params *params); -int dtsec_set_promiscuous(struct fman_mac *dtsec, bool new_val); -int dtsec_modify_mac_address(struct fman_mac *dtsec, const enet_addr_t *enet_addr); -int dtsec_adjust_link(struct fman_mac *dtsec, - u16 speed); -int dtsec_restart_autoneg(struct fman_mac *dtsec); -int dtsec_cfg_max_frame_len(struct fman_mac *dtsec, u16 new_val); -int dtsec_cfg_pad_and_crc(struct fman_mac *dtsec, bool new_val); -int dtsec_enable(struct fman_mac *dtsec); -int dtsec_disable(struct fman_mac *dtsec); -int dtsec_init(struct fman_mac *dtsec); -int dtsec_free(struct fman_mac *dtsec); -int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en); -int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, u8 priority, - u16 pause_time, u16 thresh_time); -int dtsec_set_exception(struct fman_mac *dtsec, - enum fman_mac_exceptions exception, bool enable); -int dtsec_add_hash_mac_address(struct fman_mac *dtsec, enet_addr_t *eth_addr); -int dtsec_del_hash_mac_address(struct fman_mac *dtsec, enet_addr_t *eth_addr); -int dtsec_get_version(struct fman_mac *dtsec, u32 *mac_version); -int dtsec_set_allmulti(struct fman_mac *dtsec, bool enable); -int dtsec_set_tstamp(struct fman_mac *dtsec, bool enable); +struct mac_device; + +int dtsec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node); #endif /* __DTSEC_H */ diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index c34da49aed31..b2a592a77a2a 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -7,6 +7,7 @@ #include "fman_memac.h" #include "fman.h" +#include "mac.h" #include #include @@ -774,6 +775,23 @@ int memac_adjust_link(struct fman_mac *memac, u16 speed) return 0; } +static void adjust_link_memac(struct mac_device *mac_dev) +{ + struct phy_device *phy_dev = mac_dev->phy_dev; + struct fman_mac *fman_mac; + bool rx_pause, tx_pause; + int err; + + fman_mac = mac_dev->fman_mac; + memac_adjust_link(fman_mac, phy_dev->speed); + + fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); + err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); + if (err < 0) + dev_err(mac_dev->dev, "fman_set_mac_active_pause() = %d\n", + err); +} + int memac_cfg_max_frame_len(struct fman_mac *memac, u16 new_val) { if (is_init_done(memac->memac_drv_param)) @@ -1178,3 +1196,96 @@ struct fman_mac *memac_config(struct fman_mac_params *params) return memac; } + +int memac_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) +{ + int err; + struct fman_mac_params params; + struct fixed_phy_status *fixed_link; + + mac_dev->set_promisc = memac_set_promiscuous; + mac_dev->change_addr = memac_modify_mac_address; + mac_dev->add_hash_mac_addr = memac_add_hash_mac_address; + mac_dev->remove_hash_mac_addr = memac_del_hash_mac_address; + mac_dev->set_tx_pause = memac_set_tx_pause_frames; + mac_dev->set_rx_pause = memac_accept_rx_pause_frames; + mac_dev->set_exception = memac_set_exception; + mac_dev->set_allmulti = memac_set_allmulti; + mac_dev->set_tstamp = memac_set_tstamp; + mac_dev->set_multi = fman_set_multi; + mac_dev->adjust_link = adjust_link_memac; + mac_dev->enable = memac_enable; + mac_dev->disable = memac_disable; + + err = set_fman_mac_params(mac_dev, ¶ms); + if (err) + goto _return; + params.internal_phy_node = of_parse_phandle(mac_node, "pcsphy-handle", 0); + + if (params.max_speed == SPEED_10000) + params.phy_if = PHY_INTERFACE_MODE_XGMII; + + mac_dev->fman_mac = memac_config(¶ms); + if (!mac_dev->fman_mac) { + err = -EINVAL; + goto _return; + } + + err = memac_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); + if (err < 0) + goto _return_fm_mac_free; + + err = memac_cfg_reset_on_init(mac_dev->fman_mac, true); + if (err < 0) + goto _return_fm_mac_free; + + if (!mac_dev->phy_node && of_phy_is_fixed_link(mac_node)) { + struct phy_device *phy; + + err = of_phy_register_fixed_link(mac_node); + if (err) + goto _return_fm_mac_free; + + fixed_link = kzalloc(sizeof(*fixed_link), GFP_KERNEL); + if (!fixed_link) { + err = -ENOMEM; + goto _return_fm_mac_free; + } + + mac_dev->phy_node = of_node_get(mac_node); + phy = of_phy_find_device(mac_dev->phy_node); + if (!phy) { + err = -EINVAL; + of_node_put(mac_dev->phy_node); + goto _return_fixed_link_free; + } + + fixed_link->link = phy->link; + fixed_link->speed = phy->speed; + fixed_link->duplex = phy->duplex; + fixed_link->pause = phy->pause; + fixed_link->asym_pause = phy->asym_pause; + + put_device(&phy->mdio.dev); + + err = memac_cfg_fixed_link(mac_dev->fman_mac, fixed_link); + if (err < 0) + goto _return_fixed_link_free; + } + + err = memac_init(mac_dev->fman_mac); + if (err < 0) + goto _return_fixed_link_free; + + dev_info(mac_dev->dev, "FMan MEMAC\n"); + + goto _return; + +_return_fixed_link_free: + kfree(fixed_link); +_return_fm_mac_free: + memac_free(mac_dev->fman_mac); +_return: + return err; +} diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.h b/drivers/net/ethernet/freescale/fman/fman_memac.h index 535ecd2b2ab4..a58215a3b1d9 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.h +++ b/drivers/net/ethernet/freescale/fman/fman_memac.h @@ -11,26 +11,9 @@ #include #include -struct fman_mac *memac_config(struct fman_mac_params *params); -int memac_set_promiscuous(struct fman_mac *memac, bool new_val); -int memac_modify_mac_address(struct fman_mac *memac, const enet_addr_t *enet_addr); -int memac_adjust_link(struct fman_mac *memac, u16 speed); -int memac_cfg_max_frame_len(struct fman_mac *memac, u16 new_val); -int memac_cfg_reset_on_init(struct fman_mac *memac, bool enable); -int memac_cfg_fixed_link(struct fman_mac *memac, - struct fixed_phy_status *fixed_link); -int memac_enable(struct fman_mac *memac); -int memac_disable(struct fman_mac *memac); -int memac_init(struct fman_mac *memac); -int memac_free(struct fman_mac *memac); -int memac_accept_rx_pause_frames(struct fman_mac *memac, bool en); -int memac_set_tx_pause_frames(struct fman_mac *memac, u8 priority, - u16 pause_time, u16 thresh_time); -int memac_set_exception(struct fman_mac *memac, - enum fman_mac_exceptions exception, bool enable); -int memac_add_hash_mac_address(struct fman_mac *memac, enet_addr_t *eth_addr); -int memac_del_hash_mac_address(struct fman_mac *memac, enet_addr_t *eth_addr); -int memac_set_allmulti(struct fman_mac *memac, bool enable); -int memac_set_tstamp(struct fman_mac *memac, bool enable); +struct mac_device; + +int memac_initialization(struct mac_device *mac_dev, + struct device_node *mac_node); #endif /* __MEMAC_H */ diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 2b38d22c863d..2f2c4ef45f6f 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -7,6 +7,7 @@ #include "fman_tgec.h" #include "fman.h" +#include "mac.h" #include #include @@ -609,6 +610,10 @@ int tgec_del_hash_mac_address(struct fman_mac *tgec, enet_addr_t *eth_addr) return 0; } +static void adjust_link_void(struct mac_device *mac_dev) +{ +} + int tgec_get_version(struct fman_mac *tgec, u32 *mac_version) { struct tgec_regs __iomem *regs = tgec->regs; @@ -794,3 +799,63 @@ struct fman_mac *tgec_config(struct fman_mac_params *params) return tgec; } + +int tgec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node) +{ + int err; + struct fman_mac_params params; + u32 version; + + mac_dev->set_promisc = tgec_set_promiscuous; + mac_dev->change_addr = tgec_modify_mac_address; + mac_dev->add_hash_mac_addr = tgec_add_hash_mac_address; + mac_dev->remove_hash_mac_addr = tgec_del_hash_mac_address; + mac_dev->set_tx_pause = tgec_set_tx_pause_frames; + mac_dev->set_rx_pause = tgec_accept_rx_pause_frames; + mac_dev->set_exception = tgec_set_exception; + mac_dev->set_allmulti = tgec_set_allmulti; + mac_dev->set_tstamp = tgec_set_tstamp; + mac_dev->set_multi = fman_set_multi; + mac_dev->adjust_link = adjust_link_void; + mac_dev->enable = tgec_enable; + mac_dev->disable = tgec_disable; + + err = set_fman_mac_params(mac_dev, ¶ms); + if (err) + goto _return; + + mac_dev->fman_mac = tgec_config(¶ms); + if (!mac_dev->fman_mac) { + err = -EINVAL; + goto _return; + } + + err = tgec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); + if (err < 0) + goto _return_fm_mac_free; + + err = tgec_init(mac_dev->fman_mac); + if (err < 0) + goto _return_fm_mac_free; + + /* For 10G MAC, disable Tx ECC exception */ + err = mac_dev->set_exception(mac_dev->fman_mac, + FM_MAC_EX_10G_TX_ECC_ER, false); + if (err < 0) + goto _return_fm_mac_free; + + err = tgec_get_version(mac_dev->fman_mac, &version); + if (err < 0) + goto _return_fm_mac_free; + + pr_info("FMan XGEC version: 0x%08x\n", version); + + goto _return; + +_return_fm_mac_free: + tgec_free(mac_dev->fman_mac); + +_return: + return err; +} diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.h b/drivers/net/ethernet/freescale/fman/fman_tgec.h index 5b256758cbec..2e45b9fea352 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.h +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.h @@ -8,23 +8,9 @@ #include "fman_mac.h" -struct fman_mac *tgec_config(struct fman_mac_params *params); -int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val); -int tgec_modify_mac_address(struct fman_mac *tgec, const enet_addr_t *enet_addr); -int tgec_cfg_max_frame_len(struct fman_mac *tgec, u16 new_val); -int tgec_enable(struct fman_mac *tgec); -int tgec_disable(struct fman_mac *tgec); -int tgec_init(struct fman_mac *tgec); -int tgec_free(struct fman_mac *tgec); -int tgec_accept_rx_pause_frames(struct fman_mac *tgec, bool en); -int tgec_set_tx_pause_frames(struct fman_mac *tgec, u8 priority, - u16 pause_time, u16 thresh_time); -int tgec_set_exception(struct fman_mac *tgec, - enum fman_mac_exceptions exception, bool enable); -int tgec_add_hash_mac_address(struct fman_mac *tgec, enet_addr_t *eth_addr); -int tgec_del_hash_mac_address(struct fman_mac *tgec, enet_addr_t *eth_addr); -int tgec_get_version(struct fman_mac *tgec, u32 *mac_version); -int tgec_set_allmulti(struct fman_mac *tgec, bool enable); -int tgec_set_tstamp(struct fman_mac *tgec, bool enable); +struct mac_device; + +int tgec_initialization(struct mac_device *mac_dev, + struct device_node *mac_node); #endif /* __TGEC_H */ diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index c376b9bf657d..7afedd4995c9 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -216,267 +216,6 @@ void fman_get_pause_cfg(struct mac_device *mac_dev, bool *rx_pause, } EXPORT_SYMBOL(fman_get_pause_cfg); -static void adjust_link_void(struct mac_device *mac_dev) -{ -} - -static void adjust_link_dtsec(struct mac_device *mac_dev) -{ - struct phy_device *phy_dev = mac_dev->phy_dev; - struct fman_mac *fman_mac; - bool rx_pause, tx_pause; - int err; - - fman_mac = mac_dev->fman_mac; - if (!phy_dev->link) { - dtsec_restart_autoneg(fman_mac); - - return; - } - - dtsec_adjust_link(fman_mac, phy_dev->speed); - fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); - err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); - if (err < 0) - dev_err(mac_dev->dev, "fman_set_mac_active_pause() = %d\n", - err); -} - -static void adjust_link_memac(struct mac_device *mac_dev) -{ - struct phy_device *phy_dev = mac_dev->phy_dev; - struct fman_mac *fman_mac; - bool rx_pause, tx_pause; - int err; - - fman_mac = mac_dev->fman_mac; - memac_adjust_link(fman_mac, phy_dev->speed); - - fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); - err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); - if (err < 0) - dev_err(mac_dev->dev, "fman_set_mac_active_pause() = %d\n", - err); -} - -static int tgec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) -{ - int err; - struct fman_mac_params params; - u32 version; - - mac_dev->set_promisc = tgec_set_promiscuous; - mac_dev->change_addr = tgec_modify_mac_address; - mac_dev->add_hash_mac_addr = tgec_add_hash_mac_address; - mac_dev->remove_hash_mac_addr = tgec_del_hash_mac_address; - mac_dev->set_tx_pause = tgec_set_tx_pause_frames; - mac_dev->set_rx_pause = tgec_accept_rx_pause_frames; - mac_dev->set_exception = tgec_set_exception; - mac_dev->set_allmulti = tgec_set_allmulti; - mac_dev->set_tstamp = tgec_set_tstamp; - mac_dev->set_multi = fman_set_multi; - mac_dev->adjust_link = adjust_link_void; - mac_dev->enable = tgec_enable; - mac_dev->disable = tgec_disable; - - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - - mac_dev->fman_mac = tgec_config(¶ms); - if (!mac_dev->fman_mac) { - err = -EINVAL; - goto _return; - } - - err = tgec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); - if (err < 0) - goto _return_fm_mac_free; - - err = tgec_init(mac_dev->fman_mac); - if (err < 0) - goto _return_fm_mac_free; - - /* For 10G MAC, disable Tx ECC exception */ - err = mac_dev->set_exception(mac_dev->fman_mac, - FM_MAC_EX_10G_TX_ECC_ER, false); - if (err < 0) - goto _return_fm_mac_free; - - err = tgec_get_version(mac_dev->fman_mac, &version); - if (err < 0) - goto _return_fm_mac_free; - - dev_info(mac_dev->dev, "FMan XGEC version: 0x%08x\n", version); - - goto _return; - -_return_fm_mac_free: - tgec_free(mac_dev->fman_mac); - -_return: - return err; -} - -static int dtsec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) -{ - int err; - struct fman_mac_params params; - u32 version; - - mac_dev->set_promisc = dtsec_set_promiscuous; - mac_dev->change_addr = dtsec_modify_mac_address; - mac_dev->add_hash_mac_addr = dtsec_add_hash_mac_address; - mac_dev->remove_hash_mac_addr = dtsec_del_hash_mac_address; - mac_dev->set_tx_pause = dtsec_set_tx_pause_frames; - mac_dev->set_rx_pause = dtsec_accept_rx_pause_frames; - mac_dev->set_exception = dtsec_set_exception; - mac_dev->set_allmulti = dtsec_set_allmulti; - mac_dev->set_tstamp = dtsec_set_tstamp; - mac_dev->set_multi = fman_set_multi; - mac_dev->adjust_link = adjust_link_dtsec; - mac_dev->enable = dtsec_enable; - mac_dev->disable = dtsec_disable; - - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - params.internal_phy_node = of_parse_phandle(mac_node, "tbi-handle", 0); - - mac_dev->fman_mac = dtsec_config(¶ms); - if (!mac_dev->fman_mac) { - err = -EINVAL; - goto _return; - } - - err = dtsec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); - if (err < 0) - goto _return_fm_mac_free; - - err = dtsec_cfg_pad_and_crc(mac_dev->fman_mac, true); - if (err < 0) - goto _return_fm_mac_free; - - err = dtsec_init(mac_dev->fman_mac); - if (err < 0) - goto _return_fm_mac_free; - - /* For 1G MAC, disable by default the MIB counters overflow interrupt */ - err = mac_dev->set_exception(mac_dev->fman_mac, - FM_MAC_EX_1G_RX_MIB_CNT_OVFL, false); - if (err < 0) - goto _return_fm_mac_free; - - err = dtsec_get_version(mac_dev->fman_mac, &version); - if (err < 0) - goto _return_fm_mac_free; - - dev_info(mac_dev->dev, "FMan dTSEC version: 0x%08x\n", version); - - goto _return; - -_return_fm_mac_free: - dtsec_free(mac_dev->fman_mac); - -_return: - return err; -} - -static int memac_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) -{ - int err; - struct fman_mac_params params; - struct fixed_phy_status *fixed_link; - - mac_dev->set_promisc = memac_set_promiscuous; - mac_dev->change_addr = memac_modify_mac_address; - mac_dev->add_hash_mac_addr = memac_add_hash_mac_address; - mac_dev->remove_hash_mac_addr = memac_del_hash_mac_address; - mac_dev->set_tx_pause = memac_set_tx_pause_frames; - mac_dev->set_rx_pause = memac_accept_rx_pause_frames; - mac_dev->set_exception = memac_set_exception; - mac_dev->set_allmulti = memac_set_allmulti; - mac_dev->set_tstamp = memac_set_tstamp; - mac_dev->set_multi = fman_set_multi; - mac_dev->adjust_link = adjust_link_memac; - mac_dev->enable = memac_enable; - mac_dev->disable = memac_disable; - - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - params.internal_phy_node = of_parse_phandle(mac_node, "pcsphy-handle", 0); - - if (params.max_speed == SPEED_10000) - params.phy_if = PHY_INTERFACE_MODE_XGMII; - - mac_dev->fman_mac = memac_config(¶ms); - if (!mac_dev->fman_mac) { - err = -EINVAL; - goto _return; - } - - err = memac_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); - if (err < 0) - goto _return_fm_mac_free; - - err = memac_cfg_reset_on_init(mac_dev->fman_mac, true); - if (err < 0) - goto _return_fm_mac_free; - - if (!mac_dev->phy_node && of_phy_is_fixed_link(mac_node)) { - struct phy_device *phy; - - err = of_phy_register_fixed_link(mac_node); - if (err) - goto _return_fm_mac_free; - - fixed_link = kzalloc(sizeof(*fixed_link), GFP_KERNEL); - if (!fixed_link) { - err = -ENOMEM; - goto _return_fm_mac_free; - } - - mac_dev->phy_node = of_node_get(mac_node); - phy = of_phy_find_device(mac_dev->phy_node); - if (!phy) { - err = -EINVAL; - of_node_put(mac_dev->phy_node); - goto _return_fixed_link_free; - } - - fixed_link->link = phy->link; - fixed_link->speed = phy->speed; - fixed_link->duplex = phy->duplex; - fixed_link->pause = phy->pause; - fixed_link->asym_pause = phy->asym_pause; - - put_device(&phy->mdio.dev); - - err = memac_cfg_fixed_link(mac_dev->fman_mac, fixed_link); - if (err < 0) - goto _return_fixed_link_free; - } - - err = memac_init(mac_dev->fman_mac); - if (err < 0) - goto _return_fixed_link_free; - - dev_info(mac_dev->dev, "FMan MEMAC\n"); - - goto _return; - -_return_fixed_link_free: - kfree(fixed_link); -_return_fm_mac_free: - memac_free(mac_dev->fman_mac); -_return: - return err; -} - #define DTSEC_SUPPORTED \ (SUPPORTED_10baseT_Half \ | SUPPORTED_10baseT_Full \ From patchwork Thu Aug 18 16:16:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947398 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36EE1C00140 for ; Thu, 18 Aug 2022 16:18:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344686AbiHRQSz (ORCPT ); Thu, 18 Aug 2022 12:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344598AbiHRQRq (ORCPT ); Thu, 18 Aug 2022 12:17:46 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70085.outbound.protection.outlook.com [40.107.7.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC1CABD112; Thu, 18 Aug 2022 09:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ub9l+sFd6XKFnvbkjUZiVch1ZLARkUdJgLkjstQq51xNuWlE99UWpT+5wgFGdITiREUhm3a7sAbWGjUpyl004leWs7ZO1qKuREMfx5tDGG9LM2pKdESTmrcbdQ8yAqBmEB37MxkFv22bXRCEbwpCEhaTGHIIKrkADuj4xh2Bl06ZOcH3KvVcitvW+xGxpndhNk4A2D0tkSHVQnbZM5gg741cN/+EfAwZPljQiSWSPJGcaDDT3TltfKAq+NqGypRruurrRl6NAQ51XF0SSQu7IwaxYE0Eg4gmJRT7p8vmVLdbZu6Opp2OvPRpxqyYv6/AY1uwFKF006SxmiYPyhk53A== 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=hz6WDFv74EuM8OJ4B+HPhYA66UPtmHjCYXGt6fNkJn4=; b=OfEUAQ+qPBKTCM+OmzdPVlUG74fWy1R9y8eIoQ8FBnn0IezgezAKGbSxQa9m4qOAgK2PBrZJ/MxeC6mVjS3fQeRPW88xwLjHfxGDL9g/+dOh/in0GqNh3X+VieGrfDE+ZfbzD/wB0pXpg29ealEGxhGzLNhk98kyDhMIAVGeNmfB9kkYmf5MWOY6GgXWODrCs3QaC9u0U9HJEAWsYs3o3THaSZPAEbFdqd7DKmcT05gl9FVW6O68nudvMhtrHYHfaHfGrUCbhOAKy7G4QX79uWNBn0B0YawlCHvoc8Nob15bm8sBXeHekjCp+teEIAgqtPH9WpgToGN+v+CDpHEQEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hz6WDFv74EuM8OJ4B+HPhYA66UPtmHjCYXGt6fNkJn4=; b=1VEXVt23rK2rikyzcLZ2u7+Pi5hUgn2al+AOQ1r59i9rwYJ7WLNL7C5evGFxp0acYj7NzUN2m5kJBDxoSvy4mXpkZtd0rvpjVRBLUniNQ3a7H+qaHq9MJNiFH2lNoTjfA2eqHeFl6f/enpwNelX9kF+sb28bruWQGhFsBuiM12L9mFLwgkjSp0spuHb7qhgE8mkeC/fCkaNpd2lM5DmOEeYqC4XSPmeZIN0ZIlMhggfpQV0GYvhh60HilbxvyGXVOVOnG8SCVejonuK30rvCdpHvdVA9A6Y+v+jcWx+y1KyUKInyJeOPgiOtd7D33IJSbm2ySavhqXXQEymtsmM3OQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:26 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:26 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 13/25] net: fman: Mark mac methods static Date: Thu, 18 Aug 2022 12:16:37 -0400 Message-Id: <20220818161649.2058728-14-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 258fd6e6-10d5-4f09-f6dd-08da813523ff X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v1GpMh585OvMXU8B5FL+SsXpCAPAHYO/jw63NZY8n0rGTeoEBscbn26Mevhdj63CsYNG9MpXkznf+AgkFLPk147DSvHk1kJoZG7p8zhTSHtJAekYcgK0l5ZrLxVM8BbfiestaBuFVf8j8t3qzp5lpqsaVhQC7sB3xjWiN8kgDRlWfLM+xhsAk/TzSkfEytMxTy+F0wxKrjEEyFe+2z//jrSwiNGyPMipllCzWRp6WxmHuZdhiN+UTVAfqkmanMzgV0tFfsBluuzhSZnkqxde+mxyZMFbBkE3PSE6fiOisMOmmD687ZXth0QSduxEVCsExrojxJ3sYajYihRqPaGhJf6PyCMIvbe5ZnDbD0Kk0oeMPD1YD+pelRuse5SeEhPoaFvkklUwPq1xw1WWxQcW0kPDd1ATvE3Vp0Hs7qwNyz0m4yAew1hIK25U8pS64SM7EHvhYn0RG+xno8/CrpMULG+FhnwUX+P6zEX8nE4Ty0zXHcbqdHIdM60lXbqKS/+qlIhRaV9k0yrPYRlQqP1ocgP4b4WBC1AnE5tA05CUrE81JyHr87KTarxZIJqMjxzw299DCtY7IBpZZxpZv51W3hpySUn5wlcnVSHWOaF+de+eDMSwJAnxZLy8eO5RaalbAEq8Aea5Ps99Ag2NImvEhq4Dqnn6A1suZThFdYDhO2hJowtckyZk/VLbjhrJiyLGLxTSWp75HOS6ODMMCOeM9lsnGXp8zIzHrvamyteGza1EX3dzA0cuYdsxDFiowr6Vnhz42EUzlPtahUIDkcul+g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(30864003)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xvUVqbXsLuVKdku4a2Ob67yA2A1onVd1wTL5Qzb7bnGDsy23P5jPbEVNTIv9hBOU/V06TvBAiDPul2rVPD+0n1aBQ5LfYV0Ou7DSPrLdUucHlE25ClNm0w4AnxpNgjagSpDeBK1jueQsXz+EH0xqdAMq979kehMV083At4uBIkFtcdSbclWAXeD+TkQVi3pi3WhyoySl574DcT0ZcDaeIVQmOJAN2LawIaF0gTCLD3TZyB11NfdU4YIuUVu1ja0EXTm3y2lurdJxPqQYbYOc4LM4khEeysHC3IOD4Syd+AL/WH0UgaX+UaxnG7lnEGWUGMpB3TIAMHPQDg6QQRbsKcComUJ1XWKnrdtYufinP1mL95KtN8JNyq2idIjRVfnTaKAGwu9ejPqxw4amtAhuxNMXM3D1bmQKAJQKi5PAA+U4ieCuC9/Q8q1vheFrYpdSgFEMZeM5758hWboHbtx5C/paNORlLulvUqEeV2X3lH7Guo4sJqUpV1AKpJF2cza42w17nViEbWT3XkSmMmO2VroXqXOCp7AZ17E4EL54rKM6Rfyr0MaUwKPQOMjao88MExO+ElngIlPiVwKt7XrcMSvErfjXBhR0KTSBwiyX8k83ggbfXd5mwm9DPdtg4WVeMPBLTIoUf31SSJPuaHP7j6EhNZ0s52EF6qgZNpbhFdxAsH5VzrTZS0XysJc+SzEacfF9Jfol/4b+1eKaMHSTxjupZZolIMyeKRz9QdoxXsr+5R4YgoO9EpjV694yRGMbsEdLDGhD+httqR9KdieG4x3EoB+lFBL0165ychnDpuV7Bixg8idb+fRe68hIxoSr9shmtnZRljjQpnJ4ADiMTEajLi/5G14BrMJbavQc61942ejiPMSG/bguj0UiXFqttrtWo/OX2eHI8t5QUiYI2OyGklHGC7lcfJ2/qKGsL5U4wFeu59LtTE5krL6oFfRjwQ+pOlgr7NJvhrrl8MoUPGA/rcuc7gZy8jsJcDA5DKLCjIX2ZcinuUvu8TdbbHBYWyOeJxaby2blNLlCLgMugV74uaZuoZKYw8HJ7Fe3FBn4iCLZwNx7gAw4N2Zp4L04aAFzareCUah1sQ/z/ba38Xgcmom8xRmxs2edXuhRShEG4XNkNgc94ZOV6My0doomEjfQLa+r5QpobkgWrfIrTzIMlhbJM7AXUWnWfEkNW5U2e0Hr+ydWkh6NCaapiK80igwB0BRqkFfQq/P8lzk7ORv3F0ssepvlXjeRrfoylmPYWkiwdZD7FdOe3kcdKX/FXmGOpJzJlOHfksl9R2iM9c6v3BA2LNAH/frfmyGDRrPiyse0C5SDhGOqwmrFXZ6tC+5D4xk01x1cuLcA9ysHwuu5m3MOhN5Fhs1lQwYZdCuqsxPg3eZ/9tXNjO6Yc17veWHbpc1UKgUFj48SB+I2xgFswhhyLBCQPtWHoTjrslA8Jxh0Dd861siff5aEWplQ+mcHFTJa/UL14n4+LddXUBbwICf/v6E7x1WiS3pUa6RkA03F4fFya0O9sDZGb+VucwH9uA0Td4uGmd7gyzsPts5w7vpZxciNGKNCE+aukIOoWNb5q9s9f4JmIOt8/oR/jb6MjiK9yarNFyXAyAOG5w== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 258fd6e6-10d5-4f09-f6dd-08da813523ff X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:26.6542 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9wDKEfLPiNhDqjmmdaApAeVxqRhQAQz28Caw2x7/BhiX3PyiicXiuBz0GHLEelMI9ByS5Kho0831AdqykmC9yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org These methods are no longer accessed outside of the driver file, so mark them as static. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 48 ++++++++++--------- .../net/ethernet/freescale/fman/fman_memac.c | 45 +++++++++-------- .../net/ethernet/freescale/fman/fman_tgec.c | 40 +++++++++------- 3 files changed, 72 insertions(+), 61 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 92c2e35d3b4f..6991586165d7 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -814,7 +814,7 @@ static void free_init_resources(struct fman_mac *dtsec) dtsec->unicast_addr_hash = NULL; } -int dtsec_cfg_max_frame_len(struct fman_mac *dtsec, u16 new_val) +static int dtsec_cfg_max_frame_len(struct fman_mac *dtsec, u16 new_val) { if (is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; @@ -824,7 +824,7 @@ int dtsec_cfg_max_frame_len(struct fman_mac *dtsec, u16 new_val) return 0; } -int dtsec_cfg_pad_and_crc(struct fman_mac *dtsec, bool new_val) +static int dtsec_cfg_pad_and_crc(struct fman_mac *dtsec, bool new_val) { if (is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; @@ -872,7 +872,7 @@ static void graceful_stop(struct fman_mac *dtsec) } } -int dtsec_enable(struct fman_mac *dtsec) +static int dtsec_enable(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; @@ -891,7 +891,7 @@ int dtsec_enable(struct fman_mac *dtsec) return 0; } -int dtsec_disable(struct fman_mac *dtsec) +static int dtsec_disable(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; @@ -909,9 +909,10 @@ int dtsec_disable(struct fman_mac *dtsec) return 0; } -int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, - u8 __maybe_unused priority, - u16 pause_time, u16 __maybe_unused thresh_time) +static int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, + u8 __maybe_unused priority, + u16 pause_time, + u16 __maybe_unused thresh_time) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 ptv = 0; @@ -946,7 +947,7 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, return 0; } -int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en) +static int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; @@ -968,7 +969,8 @@ int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en) return 0; } -int dtsec_modify_mac_address(struct fman_mac *dtsec, const enet_addr_t *enet_addr) +static int dtsec_modify_mac_address(struct fman_mac *dtsec, + const enet_addr_t *enet_addr) { if (!is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; @@ -986,7 +988,8 @@ int dtsec_modify_mac_address(struct fman_mac *dtsec, const enet_addr_t *enet_add return 0; } -int dtsec_add_hash_mac_address(struct fman_mac *dtsec, enet_addr_t *eth_addr) +static int dtsec_add_hash_mac_address(struct fman_mac *dtsec, + enet_addr_t *eth_addr) { struct dtsec_regs __iomem *regs = dtsec->regs; struct eth_hash_entry *hash_entry; @@ -1052,7 +1055,7 @@ int dtsec_add_hash_mac_address(struct fman_mac *dtsec, enet_addr_t *eth_addr) return 0; } -int dtsec_set_allmulti(struct fman_mac *dtsec, bool enable) +static int dtsec_set_allmulti(struct fman_mac *dtsec, bool enable) { u32 tmp; struct dtsec_regs __iomem *regs = dtsec->regs; @@ -1071,7 +1074,7 @@ int dtsec_set_allmulti(struct fman_mac *dtsec, bool enable) return 0; } -int dtsec_set_tstamp(struct fman_mac *dtsec, bool enable) +static int dtsec_set_tstamp(struct fman_mac *dtsec, bool enable) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 rctrl, tctrl; @@ -1096,7 +1099,8 @@ int dtsec_set_tstamp(struct fman_mac *dtsec, bool enable) return 0; } -int dtsec_del_hash_mac_address(struct fman_mac *dtsec, enet_addr_t *eth_addr) +static int dtsec_del_hash_mac_address(struct fman_mac *dtsec, + enet_addr_t *eth_addr) { struct dtsec_regs __iomem *regs = dtsec->regs; struct list_head *pos; @@ -1167,7 +1171,7 @@ int dtsec_del_hash_mac_address(struct fman_mac *dtsec, enet_addr_t *eth_addr) return 0; } -int dtsec_set_promiscuous(struct fman_mac *dtsec, bool new_val) +static int dtsec_set_promiscuous(struct fman_mac *dtsec, bool new_val) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; @@ -1196,7 +1200,7 @@ int dtsec_set_promiscuous(struct fman_mac *dtsec, bool new_val) return 0; } -int dtsec_adjust_link(struct fman_mac *dtsec, u16 speed) +static int dtsec_adjust_link(struct fman_mac *dtsec, u16 speed) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; @@ -1230,7 +1234,7 @@ int dtsec_adjust_link(struct fman_mac *dtsec, u16 speed) return 0; } -int dtsec_restart_autoneg(struct fman_mac *dtsec) +static int dtsec_restart_autoneg(struct fman_mac *dtsec) { u16 tmp_reg16; @@ -1270,7 +1274,7 @@ static void adjust_link_dtsec(struct mac_device *mac_dev) err); } -int dtsec_get_version(struct fman_mac *dtsec, u32 *mac_version) +static int dtsec_get_version(struct fman_mac *dtsec, u32 *mac_version) { struct dtsec_regs __iomem *regs = dtsec->regs; @@ -1282,8 +1286,8 @@ int dtsec_get_version(struct fman_mac *dtsec, u32 *mac_version) return 0; } -int dtsec_set_exception(struct fman_mac *dtsec, - enum fman_mac_exceptions exception, bool enable) +static int dtsec_set_exception(struct fman_mac *dtsec, + enum fman_mac_exceptions exception, bool enable) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 bit_mask = 0; @@ -1336,7 +1340,7 @@ int dtsec_set_exception(struct fman_mac *dtsec, return 0; } -int dtsec_init(struct fman_mac *dtsec) +static int dtsec_init(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; struct dtsec_cfg *dtsec_drv_param; @@ -1430,7 +1434,7 @@ int dtsec_init(struct fman_mac *dtsec) return 0; } -int dtsec_free(struct fman_mac *dtsec) +static int dtsec_free(struct fman_mac *dtsec) { free_init_resources(dtsec); @@ -1441,7 +1445,7 @@ int dtsec_free(struct fman_mac *dtsec) return 0; } -struct fman_mac *dtsec_config(struct fman_mac_params *params) +static struct fman_mac *dtsec_config(struct fman_mac_params *params) { struct fman_mac *dtsec; struct dtsec_cfg *dtsec_drv_param; diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index b2a592a77a2a..d3f4c3ec58c5 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -686,7 +686,7 @@ static bool is_init_done(struct memac_cfg *memac_drv_params) return false; } -int memac_enable(struct fman_mac *memac) +static int memac_enable(struct fman_mac *memac) { struct memac_regs __iomem *regs = memac->regs; u32 tmp; @@ -701,7 +701,7 @@ int memac_enable(struct fman_mac *memac) return 0; } -int memac_disable(struct fman_mac *memac) +static int memac_disable(struct fman_mac *memac) { struct memac_regs __iomem *regs = memac->regs; u32 tmp; @@ -716,7 +716,7 @@ int memac_disable(struct fman_mac *memac) return 0; } -int memac_set_promiscuous(struct fman_mac *memac, bool new_val) +static int memac_set_promiscuous(struct fman_mac *memac, bool new_val) { struct memac_regs __iomem *regs = memac->regs; u32 tmp; @@ -735,7 +735,7 @@ int memac_set_promiscuous(struct fman_mac *memac, bool new_val) return 0; } -int memac_adjust_link(struct fman_mac *memac, u16 speed) +static int memac_adjust_link(struct fman_mac *memac, u16 speed) { struct memac_regs __iomem *regs = memac->regs; u32 tmp; @@ -792,7 +792,7 @@ static void adjust_link_memac(struct mac_device *mac_dev) err); } -int memac_cfg_max_frame_len(struct fman_mac *memac, u16 new_val) +static int memac_cfg_max_frame_len(struct fman_mac *memac, u16 new_val) { if (is_init_done(memac->memac_drv_param)) return -EINVAL; @@ -802,7 +802,7 @@ int memac_cfg_max_frame_len(struct fman_mac *memac, u16 new_val) return 0; } -int memac_cfg_reset_on_init(struct fman_mac *memac, bool enable) +static int memac_cfg_reset_on_init(struct fman_mac *memac, bool enable) { if (is_init_done(memac->memac_drv_param)) return -EINVAL; @@ -812,8 +812,8 @@ int memac_cfg_reset_on_init(struct fman_mac *memac, bool enable) return 0; } -int memac_cfg_fixed_link(struct fman_mac *memac, - struct fixed_phy_status *fixed_link) +static int memac_cfg_fixed_link(struct fman_mac *memac, + struct fixed_phy_status *fixed_link) { if (is_init_done(memac->memac_drv_param)) return -EINVAL; @@ -823,8 +823,8 @@ int memac_cfg_fixed_link(struct fman_mac *memac, return 0; } -int memac_set_tx_pause_frames(struct fman_mac *memac, u8 priority, - u16 pause_time, u16 thresh_time) +static int memac_set_tx_pause_frames(struct fman_mac *memac, u8 priority, + u16 pause_time, u16 thresh_time) { struct memac_regs __iomem *regs = memac->regs; u32 tmp; @@ -861,7 +861,7 @@ int memac_set_tx_pause_frames(struct fman_mac *memac, u8 priority, return 0; } -int memac_accept_rx_pause_frames(struct fman_mac *memac, bool en) +static int memac_accept_rx_pause_frames(struct fman_mac *memac, bool en) { struct memac_regs __iomem *regs = memac->regs; u32 tmp; @@ -880,7 +880,8 @@ int memac_accept_rx_pause_frames(struct fman_mac *memac, bool en) return 0; } -int memac_modify_mac_address(struct fman_mac *memac, const enet_addr_t *enet_addr) +static int memac_modify_mac_address(struct fman_mac *memac, + const enet_addr_t *enet_addr) { if (!is_init_done(memac->memac_drv_param)) return -EINVAL; @@ -890,7 +891,8 @@ int memac_modify_mac_address(struct fman_mac *memac, const enet_addr_t *enet_add return 0; } -int memac_add_hash_mac_address(struct fman_mac *memac, enet_addr_t *eth_addr) +static int memac_add_hash_mac_address(struct fman_mac *memac, + enet_addr_t *eth_addr) { struct memac_regs __iomem *regs = memac->regs; struct eth_hash_entry *hash_entry; @@ -923,7 +925,7 @@ int memac_add_hash_mac_address(struct fman_mac *memac, enet_addr_t *eth_addr) return 0; } -int memac_set_allmulti(struct fman_mac *memac, bool enable) +static int memac_set_allmulti(struct fman_mac *memac, bool enable) { u32 entry; struct memac_regs __iomem *regs = memac->regs; @@ -946,12 +948,13 @@ int memac_set_allmulti(struct fman_mac *memac, bool enable) return 0; } -int memac_set_tstamp(struct fman_mac *memac, bool enable) +static int memac_set_tstamp(struct fman_mac *memac, bool enable) { return 0; /* Always enabled. */ } -int memac_del_hash_mac_address(struct fman_mac *memac, enet_addr_t *eth_addr) +static int memac_del_hash_mac_address(struct fman_mac *memac, + enet_addr_t *eth_addr) { struct memac_regs __iomem *regs = memac->regs; struct eth_hash_entry *hash_entry = NULL; @@ -984,8 +987,8 @@ int memac_del_hash_mac_address(struct fman_mac *memac, enet_addr_t *eth_addr) return 0; } -int memac_set_exception(struct fman_mac *memac, - enum fman_mac_exceptions exception, bool enable) +static int memac_set_exception(struct fman_mac *memac, + enum fman_mac_exceptions exception, bool enable) { u32 bit_mask = 0; @@ -1007,7 +1010,7 @@ int memac_set_exception(struct fman_mac *memac, return 0; } -int memac_init(struct fman_mac *memac) +static int memac_init(struct fman_mac *memac) { struct memac_cfg *memac_drv_param; u8 i; @@ -1124,7 +1127,7 @@ int memac_init(struct fman_mac *memac) return 0; } -int memac_free(struct fman_mac *memac) +static int memac_free(struct fman_mac *memac) { free_init_resources(memac); @@ -1137,7 +1140,7 @@ int memac_free(struct fman_mac *memac) return 0; } -struct fman_mac *memac_config(struct fman_mac_params *params) +static struct fman_mac *memac_config(struct fman_mac_params *params) { struct fman_mac *memac; struct memac_cfg *memac_drv_param; diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 2f2c4ef45f6f..ca0e00386c66 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -393,7 +393,7 @@ static bool is_init_done(struct tgec_cfg *cfg) return false; } -int tgec_enable(struct fman_mac *tgec) +static int tgec_enable(struct fman_mac *tgec) { struct tgec_regs __iomem *regs = tgec->regs; u32 tmp; @@ -408,7 +408,7 @@ int tgec_enable(struct fman_mac *tgec) return 0; } -int tgec_disable(struct fman_mac *tgec) +static int tgec_disable(struct fman_mac *tgec) { struct tgec_regs __iomem *regs = tgec->regs; u32 tmp; @@ -423,7 +423,7 @@ int tgec_disable(struct fman_mac *tgec) return 0; } -int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val) +static int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val) { struct tgec_regs __iomem *regs = tgec->regs; u32 tmp; @@ -441,7 +441,7 @@ int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val) return 0; } -int tgec_cfg_max_frame_len(struct fman_mac *tgec, u16 new_val) +static int tgec_cfg_max_frame_len(struct fman_mac *tgec, u16 new_val) { if (is_init_done(tgec->cfg)) return -EINVAL; @@ -451,8 +451,9 @@ int tgec_cfg_max_frame_len(struct fman_mac *tgec, u16 new_val) return 0; } -int tgec_set_tx_pause_frames(struct fman_mac *tgec, u8 __maybe_unused priority, - u16 pause_time, u16 __maybe_unused thresh_time) +static int tgec_set_tx_pause_frames(struct fman_mac *tgec, + u8 __maybe_unused priority, u16 pause_time, + u16 __maybe_unused thresh_time) { struct tgec_regs __iomem *regs = tgec->regs; @@ -464,7 +465,7 @@ int tgec_set_tx_pause_frames(struct fman_mac *tgec, u8 __maybe_unused priority, return 0; } -int tgec_accept_rx_pause_frames(struct fman_mac *tgec, bool en) +static int tgec_accept_rx_pause_frames(struct fman_mac *tgec, bool en) { struct tgec_regs __iomem *regs = tgec->regs; u32 tmp; @@ -482,7 +483,8 @@ int tgec_accept_rx_pause_frames(struct fman_mac *tgec, bool en) return 0; } -int tgec_modify_mac_address(struct fman_mac *tgec, const enet_addr_t *p_enet_addr) +static int tgec_modify_mac_address(struct fman_mac *tgec, + const enet_addr_t *p_enet_addr) { if (!is_init_done(tgec->cfg)) return -EINVAL; @@ -493,7 +495,8 @@ int tgec_modify_mac_address(struct fman_mac *tgec, const enet_addr_t *p_enet_add return 0; } -int tgec_add_hash_mac_address(struct fman_mac *tgec, enet_addr_t *eth_addr) +static int tgec_add_hash_mac_address(struct fman_mac *tgec, + enet_addr_t *eth_addr) { struct tgec_regs __iomem *regs = tgec->regs; struct eth_hash_entry *hash_entry; @@ -530,7 +533,7 @@ int tgec_add_hash_mac_address(struct fman_mac *tgec, enet_addr_t *eth_addr) return 0; } -int tgec_set_allmulti(struct fman_mac *tgec, bool enable) +static int tgec_set_allmulti(struct fman_mac *tgec, bool enable) { u32 entry; struct tgec_regs __iomem *regs = tgec->regs; @@ -553,7 +556,7 @@ int tgec_set_allmulti(struct fman_mac *tgec, bool enable) return 0; } -int tgec_set_tstamp(struct fman_mac *tgec, bool enable) +static int tgec_set_tstamp(struct fman_mac *tgec, bool enable) { struct tgec_regs __iomem *regs = tgec->regs; u32 tmp; @@ -573,7 +576,8 @@ int tgec_set_tstamp(struct fman_mac *tgec, bool enable) return 0; } -int tgec_del_hash_mac_address(struct fman_mac *tgec, enet_addr_t *eth_addr) +static int tgec_del_hash_mac_address(struct fman_mac *tgec, + enet_addr_t *eth_addr) { struct tgec_regs __iomem *regs = tgec->regs; struct eth_hash_entry *hash_entry = NULL; @@ -614,7 +618,7 @@ static void adjust_link_void(struct mac_device *mac_dev) { } -int tgec_get_version(struct fman_mac *tgec, u32 *mac_version) +static int tgec_get_version(struct fman_mac *tgec, u32 *mac_version) { struct tgec_regs __iomem *regs = tgec->regs; @@ -626,8 +630,8 @@ int tgec_get_version(struct fman_mac *tgec, u32 *mac_version) return 0; } -int tgec_set_exception(struct fman_mac *tgec, - enum fman_mac_exceptions exception, bool enable) +static int tgec_set_exception(struct fman_mac *tgec, + enum fman_mac_exceptions exception, bool enable) { struct tgec_regs __iomem *regs = tgec->regs; u32 bit_mask = 0; @@ -653,7 +657,7 @@ int tgec_set_exception(struct fman_mac *tgec, return 0; } -int tgec_init(struct fman_mac *tgec) +static int tgec_init(struct fman_mac *tgec) { struct tgec_cfg *cfg; enet_addr_t eth_addr; @@ -736,7 +740,7 @@ int tgec_init(struct fman_mac *tgec) return 0; } -int tgec_free(struct fman_mac *tgec) +static int tgec_free(struct fman_mac *tgec) { free_init_resources(tgec); @@ -746,7 +750,7 @@ int tgec_free(struct fman_mac *tgec) return 0; } -struct fman_mac *tgec_config(struct fman_mac_params *params) +static struct fman_mac *tgec_config(struct fman_mac_params *params) { struct fman_mac *tgec; struct tgec_cfg *cfg; From patchwork Thu Aug 18 16:16:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947399 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 819DEC00140 for ; Thu, 18 Aug 2022 16:19:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344701AbiHRQTS (ORCPT ); Thu, 18 Aug 2022 12:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344606AbiHRQRv (ORCPT ); Thu, 18 Aug 2022 12:17:51 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CB67BD0AA; Thu, 18 Aug 2022 09:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rx49yWR6/9RXa62SrQc9ozCIcyJTwpdxGpv99cn2IhoZM0WU0b9ZFAhiaPCgkMkVEXSh5KVyf521jZdZR2NPPkFUGxhp+0a4FJl01rGI1kB4BpSnJX68oHBJVv0o49mXrv+gMLBiSepofmo26WpVR2FneMnevo67JcUjtr8akeqNm6b4aMf2pVOP9Dl2rHDad4dZ/B7+pBYJRViMjAZv1+/9TfuWpIgWPgm5RagYiYR5l3SMbHVbebVnVY7+WFgTx2LLRjPcXQWfmnxRzrvctvjB8qxP9ErEkd60KtPWvggeSmkYqn3jhZ6YVbLBNzyd6MXIDSi9zrYue/ROpmMdIQ== 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=VTBd+07Ajx0H/fMKM+/8gZo/u28GTYMgGRAlmycrARs=; b=WAkybG2FN+jpmaiWkC8m7zp+BaSdxdEVvCIdwxtXeXEGrdqWmvVXTmYa1YXu1kouiw5pLVpWYQv+O1Ys5kwCCYaYv3Yb9iWZrxPRVX6FmHv0nanV7euLLBClcN8odfRbERQH3A1TdI2IJItOeFOLO41FiLOr2CtKobTfeLZOo86Hm/+zRuAou7rDjHidrKtAXeVAfcW3HA9/9W3Hu1pYiSRmG3Nhzb0d894OridlhOqtJjO+mPupjPuS19cap0ljsg+dZL6k4BYjdhgxfUeG13RBS54d23ByMkGcdQAx3cMIZX0rlRz1DkwvbrhiA2mVxqKL7XFGfQm9qTlAQ3lm+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VTBd+07Ajx0H/fMKM+/8gZo/u28GTYMgGRAlmycrARs=; b=nylDPjKPpc2LneTXa0pnpI4jPIlNui11jZ3ZMw+sfPOj1zwyRPwMj8uGeczSsFzSbKlj4UKqPXGLR9chF8AnZlGEhJ4JAlxyvMunvoZEjOSWNzv752wqZn36G4nuv7GA+PsmXBKATejwd7UwY18lGn+KS/7kiR894qQHQT5RP5L3/FjCzsxfRMn0jSO3k4Y8Ksn8CzeL6TiYQahnH0em8xk9mPzhlPXdGQ+pM+XJ3Wd9aiHEYvDu4Lw23TjygeR0yeNe7iX6WAnmPfqECFxA5YHcgnXKV9lZ+nS1hXxi9uuGBJ2nKlS8VWONgMdSqXlt3vCvh06tOZzcpczcyrkvQQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:28 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:28 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 14/25] net: fman: Inline several functions into initialization Date: Thu, 18 Aug 2022 12:16:38 -0400 Message-Id: <20220818161649.2058728-15-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 516a3c84-8215-40d4-3505-08da81352506 X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4+nCNC3jftX3f1EIGgnR7PzYK2dCemGs4F7rAdKinVLRUz1CpZ6y1xtBExtwL59uFV2ODQAcz0NjfiUTpg9XeY6NXQnnr80Bd/u6RETmGciH7DJ7m2bHoBDb5nq0GOnEH+zu1DVzWJTMLSP2xjUXknMHza9Pgk43URAyV/BEaf3Q/pegiA3yYkPXuLKQdl61KrzngR0ubMZ62hBfqHN919KLBNMIol9hm1dPFMbZlZl/40EZ2Gvh5+2OzTKjICUVrtTvavxZZfzUvzc356PCEH+i+GmTmzw12Xyt08Ra64hFjnDmudZdJqsgZWufeytLsdfBBB4A80+Oi9JyDRk0ofqLfQnj+PFaRTP5TJbEBLU63HhKnlTbvkpuvcTxnscKOa6tg6/2H+I9v24p8n3JuGJcmIx3lkWtXGyf0to0+9ODAaSQ1o6dfUYRGqFv+xuu9E7OGQBN7Mzv31f/8QN5VmoUSClfcTShTnI+coOh5kfF6wjx4T105CTq/VgDm2T7eMpie2aDNSrj3ZDfSuN3X2v/QRxbn/yOgzSnkeXWM6WVlENkiDOagUE9wAca/eyWoXDmeuFln+nbhv+URH2RG0NRZ9XHwSsDyZfwTlEAxG911WTumPXEi6lzg/n8/iGW4vUA1PhtaPAUHBt0B53XegdzgCQ32oWMp8eWP+5NPhW4qE1WqV0Kw6mcI4gEfFrAMWADbrW6vEPqM2P3PDf7OHZIhl1eLV2Pbz/7tbUfH9Xn8MXn05UKm31lRlu1l4apDXhWPI5lrc6IsgUvgS2reg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(6666004)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KLk6g0sTidE8Qsama0sHyBQyKHnchQGw08+etNw8WRerdDkA6hzcjeIQ5gZ6DODlC3pEhFSg8IDvQzIdpt7lNVCAdT1XzA1zpPRjb4HTxEo5DimetK9NkX6iyjkjzpDm+V2L0l4CuTXH/95sHGWz+czt1jCP44yiQp9kZp8bHBa/b9isUZ4TVh7LW4LZoXdXt5hwMNsn9Trcv/y5LmRvrR7X8v2pMG16kHL4HY8FXEoosvaFsmUJdFss/QwioNXK8+IPx9LS7jildyEvG/VkbsYo4JfmUGniomgv57AMLWmbglmRmnFmJAPcF3q8t4htE4OQFbiwEWB/Ft6ieDTAGsNHuy1okfk4uDXMs5+7ozkkUmY+efwqgbo9p+V4ASZxqFWNa4cfDNeIQPJ6g1Y7OoV3965g/zKy0sGJ32CAL5QsSfItlIb7BgRLFn3NcSBtNmYp1Nri1SoLBHZlTp9yLVUfRMhmys0MsXYXCV6qc14eLcqKLMaL1JBl/mlfZGAgAsxl3UvJIDnhiD15AtrMcizbyUxkKvxNnOMeooZkXIGEXxDEvUw9X9KwXkCcaascuT9Vihgpt5X3eCPc6C8NL9hdbRGz87wcQekLUbhFU3VkNlDBWpfshmFNCiJ9dXNUeBUmIgwtRuVOzhmavJ6B+khlA7QdWRz1HRLVd76Xk3ahAz8+3AajnFYdYl2D00ZkHF0O/D6/+aT+qeLog8afHFObWwgMFuM4SGl9wstKYz3T4J3OZTX5TiZeJFv52nR0VhTxVqVj+tUm2nVWYcR1HyCsq14cLAt4SUyuAvnk2Ar/1E7eMVUpaGe8AzszCS2q2CT/Ybwg92hOwySEfNQGOqGmen+zJDX29m9OAy0LFdsSwRALG95czcnVqj/Ss492eGsijncxcTSsGgDRx2GLRhjq/lvQN+k0dWF8VXyWGlqFHlFKY6P+TrQFiHicoHIoOi/FL2cdDwb5R4Wp7WszJ0CWyJ7+V6UlWxB9ani6SpqdNb4++IS73eqwWEDoaL2+GSQOgwrgDDz/RI4crzzlin1E0n7T8xumjxViucfDun9Q2dK0JJ4haVoL6dUaDRPZunnrjY8tLWaqamuM+akfRBYsZ+b80R0LaMg4b64ouzL1FZWL1ZU40tW3M4dM4M4egeiXLtuHp6Xiwq1Rtqvu85hitvK3GKlM+ZTyb9hI9n1lg4P9EHoK/j6u3B7PgKtT8ieMNaNqXDBFVryBXtmWl1OIg+dRLDPsTGmqXnkDQRq4/lqc+/gFYdY9qRdENEHuEqNhYPMa9P1gm/7L//Ec7Loca7o1SvLadSCT3Tlb+0puTcgR/s3L8YT986dZ1OEcZGM3xPNNdK6Ylzjd1dz+4/CKqIGAp25v7TPEQGkeRiv6BkXHIBv4FPrasmvCJwVMT6kQ2DNqRlG0X0QJmKiEkV94AnhvAeOom879WkHsZELxo3GtWPd4S2ZM30IizZZhI92cJChg+F6PJ7+RwrkJPzF3c+Q89I5paMPaT+Q6JMSjh0A2JaVuisME13HKmW6nVOlqnc1c7CDN+sDUkvEfqe2XNXfrxF0qoiwTERiBOjI2IvPbjhkJtOgnhWaJKymn4ejZFis8eI3IamM/zhAhCw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 516a3c84-8215-40d4-3505-08da81352506 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:28.4978 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YlLqcNXE6xAvQMmGm/HlJZOuQqOaMzGsxKjJXCM3/RLCWzjA4mbZg5rcXh72qwaL7z0BfA3F5MHpPLb60vp8Nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There are several small functions which were only necessary because the initialization functions didn't have access to the mac private data. Now that they do, just do things directly. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- Changes in v4: - weer -> were .../net/ethernet/freescale/fman/fman_dtsec.c | 59 +++---------------- .../net/ethernet/freescale/fman/fman_memac.c | 47 ++------------- .../net/ethernet/freescale/fman/fman_tgec.c | 43 +++----------- 3 files changed, 21 insertions(+), 128 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 6991586165d7..84205be3a817 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -814,26 +814,6 @@ static void free_init_resources(struct fman_mac *dtsec) dtsec->unicast_addr_hash = NULL; } -static int dtsec_cfg_max_frame_len(struct fman_mac *dtsec, u16 new_val) -{ - if (is_init_done(dtsec->dtsec_drv_param)) - return -EINVAL; - - dtsec->dtsec_drv_param->maximum_frame = new_val; - - return 0; -} - -static int dtsec_cfg_pad_and_crc(struct fman_mac *dtsec, bool new_val) -{ - if (is_init_done(dtsec->dtsec_drv_param)) - return -EINVAL; - - dtsec->dtsec_drv_param->tx_pad_crc = new_val; - - return 0; -} - static void graceful_start(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; @@ -1274,18 +1254,6 @@ static void adjust_link_dtsec(struct mac_device *mac_dev) err); } -static int dtsec_get_version(struct fman_mac *dtsec, u32 *mac_version) -{ - struct dtsec_regs __iomem *regs = dtsec->regs; - - if (!is_init_done(dtsec->dtsec_drv_param)) - return -EINVAL; - - *mac_version = ioread32be(®s->tsec_id); - - return 0; -} - static int dtsec_set_exception(struct fman_mac *dtsec, enum fman_mac_exceptions exception, bool enable) { @@ -1525,7 +1493,7 @@ int dtsec_initialization(struct mac_device *mac_dev, { int err; struct fman_mac_params params; - u32 version; + struct fman_mac *dtsec; mac_dev->set_promisc = dtsec_set_promiscuous; mac_dev->change_addr = dtsec_modify_mac_address; @@ -1552,34 +1520,25 @@ int dtsec_initialization(struct mac_device *mac_dev, goto _return; } - err = dtsec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); - if (err < 0) - goto _return_fm_mac_free; - - err = dtsec_cfg_pad_and_crc(mac_dev->fman_mac, true); - if (err < 0) - goto _return_fm_mac_free; - - err = dtsec_init(mac_dev->fman_mac); + dtsec = mac_dev->fman_mac; + dtsec->dtsec_drv_param->maximum_frame = fman_get_max_frm(); + dtsec->dtsec_drv_param->tx_pad_crc = true; + err = dtsec_init(dtsec); if (err < 0) goto _return_fm_mac_free; /* For 1G MAC, disable by default the MIB counters overflow interrupt */ - err = mac_dev->set_exception(mac_dev->fman_mac, - FM_MAC_EX_1G_RX_MIB_CNT_OVFL, false); + err = dtsec_set_exception(dtsec, FM_MAC_EX_1G_RX_MIB_CNT_OVFL, false); if (err < 0) goto _return_fm_mac_free; - err = dtsec_get_version(mac_dev->fman_mac, &version); - if (err < 0) - goto _return_fm_mac_free; - - dev_info(mac_dev->dev, "FMan dTSEC version: 0x%08x\n", version); + dev_info(mac_dev->dev, "FMan dTSEC version: 0x%08x\n", + ioread32be(&dtsec->regs->tsec_id)); goto _return; _return_fm_mac_free: - dtsec_free(mac_dev->fman_mac); + dtsec_free(dtsec); _return: return err; diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index d3f4c3ec58c5..039f71e31efc 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -792,37 +792,6 @@ static void adjust_link_memac(struct mac_device *mac_dev) err); } -static int memac_cfg_max_frame_len(struct fman_mac *memac, u16 new_val) -{ - if (is_init_done(memac->memac_drv_param)) - return -EINVAL; - - memac->memac_drv_param->max_frame_length = new_val; - - return 0; -} - -static int memac_cfg_reset_on_init(struct fman_mac *memac, bool enable) -{ - if (is_init_done(memac->memac_drv_param)) - return -EINVAL; - - memac->memac_drv_param->reset_on_init = enable; - - return 0; -} - -static int memac_cfg_fixed_link(struct fman_mac *memac, - struct fixed_phy_status *fixed_link) -{ - if (is_init_done(memac->memac_drv_param)) - return -EINVAL; - - memac->memac_drv_param->fixed_link = fixed_link; - - return 0; -} - static int memac_set_tx_pause_frames(struct fman_mac *memac, u8 priority, u16 pause_time, u16 thresh_time) { @@ -1206,6 +1175,7 @@ int memac_initialization(struct mac_device *mac_dev, int err; struct fman_mac_params params; struct fixed_phy_status *fixed_link; + struct fman_mac *memac; mac_dev->set_promisc = memac_set_promiscuous; mac_dev->change_addr = memac_modify_mac_address; @@ -1235,13 +1205,9 @@ int memac_initialization(struct mac_device *mac_dev, goto _return; } - err = memac_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); - if (err < 0) - goto _return_fm_mac_free; - - err = memac_cfg_reset_on_init(mac_dev->fman_mac, true); - if (err < 0) - goto _return_fm_mac_free; + memac = mac_dev->fman_mac; + memac->memac_drv_param->max_frame_length = fman_get_max_frm(); + memac->memac_drv_param->reset_on_init = true; if (!mac_dev->phy_node && of_phy_is_fixed_link(mac_node)) { struct phy_device *phy; @@ -1271,10 +1237,7 @@ int memac_initialization(struct mac_device *mac_dev, fixed_link->asym_pause = phy->asym_pause; put_device(&phy->mdio.dev); - - err = memac_cfg_fixed_link(mac_dev->fman_mac, fixed_link); - if (err < 0) - goto _return_fixed_link_free; + memac->memac_drv_param->fixed_link = fixed_link; } err = memac_init(mac_dev->fman_mac); diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index ca0e00386c66..32ee1674ff2f 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -441,16 +441,6 @@ static int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val) return 0; } -static int tgec_cfg_max_frame_len(struct fman_mac *tgec, u16 new_val) -{ - if (is_init_done(tgec->cfg)) - return -EINVAL; - - tgec->cfg->max_frame_length = new_val; - - return 0; -} - static int tgec_set_tx_pause_frames(struct fman_mac *tgec, u8 __maybe_unused priority, u16 pause_time, u16 __maybe_unused thresh_time) @@ -618,18 +608,6 @@ static void adjust_link_void(struct mac_device *mac_dev) { } -static int tgec_get_version(struct fman_mac *tgec, u32 *mac_version) -{ - struct tgec_regs __iomem *regs = tgec->regs; - - if (!is_init_done(tgec->cfg)) - return -EINVAL; - - *mac_version = ioread32be(®s->tgec_id); - - return 0; -} - static int tgec_set_exception(struct fman_mac *tgec, enum fman_mac_exceptions exception, bool enable) { @@ -809,7 +787,7 @@ int tgec_initialization(struct mac_device *mac_dev, { int err; struct fman_mac_params params; - u32 version; + struct fman_mac *tgec; mac_dev->set_promisc = tgec_set_promiscuous; mac_dev->change_addr = tgec_modify_mac_address; @@ -835,26 +813,19 @@ int tgec_initialization(struct mac_device *mac_dev, goto _return; } - err = tgec_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm()); - if (err < 0) - goto _return_fm_mac_free; - - err = tgec_init(mac_dev->fman_mac); + tgec = mac_dev->fman_mac; + tgec->cfg->max_frame_length = fman_get_max_frm(); + err = tgec_init(tgec); if (err < 0) goto _return_fm_mac_free; /* For 10G MAC, disable Tx ECC exception */ - err = mac_dev->set_exception(mac_dev->fman_mac, - FM_MAC_EX_10G_TX_ECC_ER, false); + err = tgec_set_exception(tgec, FM_MAC_EX_10G_TX_ECC_ER, false); if (err < 0) goto _return_fm_mac_free; - err = tgec_get_version(mac_dev->fman_mac, &version); - if (err < 0) - goto _return_fm_mac_free; - - pr_info("FMan XGEC version: 0x%08x\n", version); - + pr_info("FMan XGEC version: 0x%08x\n", + ioread32be(&tgec->regs->tgec_id)); goto _return; _return_fm_mac_free: From patchwork Thu Aug 18 16:16:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947400 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 049E2C00140 for ; Thu, 18 Aug 2022 16:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344705AbiHRQTV (ORCPT ); Thu, 18 Aug 2022 12:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344605AbiHRQRv (ORCPT ); Thu, 18 Aug 2022 12:17:51 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70085.outbound.protection.outlook.com [40.107.7.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35510BD4DD; Thu, 18 Aug 2022 09:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Leas3HLCYkNsZgpNHE68z9PUFMhd0g0dJNYQPkeWoJc1pNoLq1tlBHTRJe46Yt2Zti+iRzsoFxOM6t36sgsBJQJWoiLN2rp4RX1HE/ELDsAeJKiSqNmVqv5q2HOJvzYw9AHJjo5NfBZlb+gxmxNZNnOtwQKPIs4GVjLsyIpIoP3yxv9aOmA3G27W4P3Au86aVc11BAUtJW/L/Vfm5TWiDzQBSRs/ifFJn39zMyXhNVyOxPUNMzwCkxLWwwI+cxYg18YHeVb0FpNhHEgiTNWdKxKS+tbdi/tZQq8VzOx9TAhm/RAxURJCC2vQS0SQaqPz/pBXpTI0+Zv2S1R/Ul/qrw== 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=2uF6t3FMJH8eO9mFKLCWfuB6lgblJYlx+5+0EOJAwDQ=; b=O/zoJmR16zKaX7h2O0zXmqTNfJJsEpQMxmCelsKJwDoM3ULnBBrsZ8kLOfVUIEGANb/YlRl2Q3GcYRO0BcX7a4SlBhNgJWuRMdRzO2MFXK70oj9LsT5HZbL08KCb8F4hcq3bypG3p+rMRAso6rRqMf0PofbBQ0WwaYyYk7oVbtMiqtFS4U9OKmoCBpokqojenEmN2G83TfSctZnxetIaFbrr0Y5qGDfJEDrlCGVKdvgGgtagrxlFcjbYHx+Z6SfaDeAUwBdJ8AeP9NH3VX9bGehryHfw3QXePz03T9sRLT9ZEgV2vY0IpH7xe1J7ka/FQMb8/dCE8AyN3Y7SCEiebA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2uF6t3FMJH8eO9mFKLCWfuB6lgblJYlx+5+0EOJAwDQ=; b=sTwRgDhuE391j+tpGwaWbhcQluIIL9gzg6EGlHjfwKIYpBbFKiVTEG8NlK7nS9XOi47R0B1peVhbbQHIee3NGOUlofTJNk5+/V1qCJHnERdYNTEA+ScRt1RdTBiMW9ebypa1L4IcDhxuSECMAY55+h0Bkb0lejeSHpexfYw+Gc7RoFRirLTFU1+9KlD1C+KKYBkPBC01sMOpBOq7a/shG9Umoc+UFBrAngHp16vF8k0imE25B/TvnOPGnlXWmvIePt3ebLvVDuCF5nIpAUBqW9qlchjNE6BbvZcUtXekU1h8GkTz0I7lXUGJdnPCGBomTgzMX/MemTRXUc+D4hXDbg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB3PR0302MB3211.eurprd03.prod.outlook.com (2603:10a6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 16:17:30 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:30 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 15/25] net: fman: Remove internal_phy_node from params Date: Thu, 18 Aug 2022 12:16:39 -0400 Message-Id: <20220818161649.2058728-16-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f42b438-29e6-4d16-4c2d-08da81352605 X-MS-TrafficTypeDiagnostic: DB3PR0302MB3211:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YGwuHjazAIyZCJvzXs1R3G5TVnNDTrplYXGuhH6XIu6MYqK++PL0C4f5sXgFBDaEgAPqj+kLG+PM04EM3eyz0ZAYDjbgQDURrTWtBsbvuG0bLT/TiwpUEUFEOstju2uJId1WnszKGLg697U4b2JFu/7hgl9dS6RLNpzFTHcOW7GvTN5Ea4MU+UCuL5sfoJkWfyL2wrMIXoz3qkF10+H+bJXaMBFbUmoTMKsO7iQkuQAGForfv8PZkJcZrj8ozJp0gA02cydjgJa4KTB1LgOtpGfqG8JWSQ1Xo/KjlXgjCfC7ILZ6AZozlP+dVslptD8ckV4QDZRZPWvAnuAdzXA0js9Pcze1N2KtHP9swBJPv+J//s3g4XkQF705W4LlYMKR2jbcU/2JSvPVQohWxy5J/Fa/j7nrQWKe4SZ9kbA1QKMp8CVT30QFngXuRsvNzDyKBJ+hJWh1McCzAImVovpi6FJPnpK5BmV5mhAZMJXut4upN630MMeKSbO8VQZBPtL1bBgULd4MU40Qx584UeDPSYM8pN9XWarwFgVnU4JLiSJp2+AyFd6zuffMWahaJwHW5n9yBg5DLOEG1RckjgKaqDcc5/0R5hBzR6MWPNp7gcx1fATdMN+EUdkmSNaFNiYR4dar5eDOW5T2IHWc7LxfdDFaa8jILid/WLIMgAucao3Z4gZuRAyWYQJyo4vAgT/FyX/fI86wQPhfFOrEu+fdif18yIx6VNCq0Z5DQy5FcLLKdTuaMzMLRJ3Zl5M+47IIO/7iblFOai7dsQgp1lXmIg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(346002)(39840400004)(136003)(366004)(376002)(2616005)(38350700002)(8936002)(38100700002)(4326008)(6512007)(26005)(6506007)(52116002)(2906002)(8676002)(36756003)(66556008)(1076003)(66946007)(66476007)(54906003)(110136005)(44832011)(478600001)(86362001)(41300700001)(6486002)(316002)(107886003)(83380400001)(186003)(5660300002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZbIWzX4AV1WcNrysUOek7XsQM5aLs77qSBfXGIpjsuYMHhKhGUoiW/O4H/WrRpGRrK8w/QYeQKlxHj69HxV/JZR9+wEtscf/LUJcg6oKOEUxbNb6dR2OrRIwXQBtWLEkDC4El/Ia7soI1b4Yr0dP91NQzKxuYX6r7Qf1UE9KIS4EZo1vtzwwDYUjTkfuJQudQIhdraUdOP5COkVqQqy4dZDSEoQZoVLdhWUFgnsr3o4QCN06z/BEIavcbq2efyu/zHlV3E03axKVKboFwHPfWsxb8pWN+0H1B+c2FZ4/kGb/p+SvCzA150E89otyEqDlU7AomOsspL4FOcgoDNn35qvF37W032ai3hoqheWDBz454v60RNMLzKHm11dPZUfcteKyU+7/co3E3gB1zMfq4e+S6DIjmlyjNPlz2L08waCo4YrqdXjCoApiqncwpMvILZJKOjR46O7Ov+3FHXKb4B96jfcxhHlyCct5cIBLotBfiSXlhLX2QetgStfdV/VOkCg32ukyv9hUnZPTMfP3sF+Rd9QzNJJxl5lQLZE9rVn2TxJif9PI/BSRuZFcFA8e0JDEeZravAg+qGuIoTOfNcoyyh006yfDJTz1yVh+mOOwgayPoCPkONkbGp5ginoRDbfNHRtEfT3Gnh63138KZ4PcAeX/pzX2V5WpPGbJ13NtI8UIttKUhfH9BThgc2eopUPPme6hYpfOHqz2LeDYWEZmixBDEWqpOqwROCl26Z7r/D/vGyMNJsHZ79Cyu8x2EtqI09U7rmEIq02p5buvN2sxbevsC4Rnhn0UiFsydrqEAQq0dBw/ASXHdOqXMlUXBUNJZPGx11FzPO3UjiC2yDZ2fU4F8j4XSFXNqucR91N3qoAdYXDuQx5zf8T7gPduPMPvq7Hw7tmoKs/4L8nkQC8ReYIHT/DFzBSYXpS2nk1WetdqmFlOsby5/qTVWIailxBhP+HhUlrd1fj0Hw3NOvPoA7wMcLtfDR1RVOO9w5GwW9B2hU4+17OMx7azQ8nLMd6YIWf5U804C82xeib2oGPbQkRiDizcO0sl6frbZ2nBLM0aAExdRf71ZWWSMM/suQ3dhbha7Nb1TQm62OpYMOT02Jyd3trLSeuODOEBTE3QbiGZbEtMdexecaihZXeHRDD4dLu/F7KGecpplFbZQj84ERLjw9Bjtns/QQP/ajqKtRXNXlydMW6DoaNoXqk8SJu5aOctwDnN418vL2NDyICI1d26MBYlA0YLq/cw+MnusD1ZMPEXHc9hV/zQIoTa/8gdQ0bqUUXtYEThDZbXsPLnErZKyfnKoPT+inryU1Uv561gITpibiSESj+mJXpdQhck+jPJ3s8393QVD98ypWeU0LwgbjTewWgHx+m1kVJPz7ut8YrlCuq8XOu7WOWL27BfXGp2V8lhbbAno/q2fOB5FpCZJ97LnqTaYBVdsP8StWLR0jS7mGXlwZ2/2/Rqy3ewA0RyL0ILw19j9dCqPH0kR5Hw6qB3Exn60I3rxtyVDEMCSOXqD4KQi8j/2yqyFRdtGID1+D4gpd7Pnz6NAHs1SuZgHZyZBi7rTpXR/Kh3YnlXTGMKzcGDghRsLO0F3AVPcmct4mJmNcDiYMYJjg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f42b438-29e6-4d16-4c2d-08da81352605 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:29.9821 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ctW/rZdvajuk+0Q3n2EU547gVbgVyY6+lwMLGINqTNUTazgnWaoQ7opy5XhTMwoDzDMW1iSKP3e+eM6bLOVoOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0302MB3211 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This member was used to pass the phy node between mac_probe and the mac-specific initialization function. But now that the phy node is gotten in the initialization function, this parameter does not serve a purpose. Remove it, and do the grabbing of the node/grabbing of the phy in the same place. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 33 +++++++++--------- .../net/ethernet/freescale/fman/fman_mac.h | 2 -- .../net/ethernet/freescale/fman/fman_memac.c | 34 +++++++++---------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 84205be3a817..c2c4677451a9 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -1463,26 +1463,11 @@ static struct fman_mac *dtsec_config(struct fman_mac_params *params) dtsec->fm = params->fm; dtsec->basex_if = params->basex_if; - if (!params->internal_phy_node) { - pr_err("TBI PHY node is not available\n"); - goto err_dtsec_drv_param; - } - - dtsec->tbiphy = of_phy_find_device(params->internal_phy_node); - if (!dtsec->tbiphy) { - pr_err("of_phy_find_device (TBI PHY) failed\n"); - goto err_dtsec_drv_param; - } - - put_device(&dtsec->tbiphy->mdio.dev); - /* Save FMan revision */ fman_get_revision(dtsec->fm, &dtsec->fm_rev_info); return dtsec; -err_dtsec_drv_param: - kfree(dtsec_drv_param); err_dtsec: kfree(dtsec); return NULL; @@ -1494,6 +1479,7 @@ int dtsec_initialization(struct mac_device *mac_dev, int err; struct fman_mac_params params; struct fman_mac *dtsec; + struct device_node *phy_node; mac_dev->set_promisc = dtsec_set_promiscuous; mac_dev->change_addr = dtsec_modify_mac_address; @@ -1512,7 +1498,6 @@ int dtsec_initialization(struct mac_device *mac_dev, err = set_fman_mac_params(mac_dev, ¶ms); if (err) goto _return; - params.internal_phy_node = of_parse_phandle(mac_node, "tbi-handle", 0); mac_dev->fman_mac = dtsec_config(¶ms); if (!mac_dev->fman_mac) { @@ -1523,6 +1508,22 @@ int dtsec_initialization(struct mac_device *mac_dev, dtsec = mac_dev->fman_mac; dtsec->dtsec_drv_param->maximum_frame = fman_get_max_frm(); dtsec->dtsec_drv_param->tx_pad_crc = true; + + phy_node = of_parse_phandle(mac_node, "tbi-handle", 0); + if (!phy_node) { + pr_err("TBI PHY node is not available\n"); + err = -EINVAL; + goto _return_fm_mac_free; + } + + dtsec->tbiphy = of_phy_find_device(phy_node); + if (!dtsec->tbiphy) { + pr_err("of_phy_find_device (TBI PHY) failed\n"); + err = -EINVAL; + goto _return_fm_mac_free; + } + put_device(&dtsec->tbiphy->mdio.dev); + err = dtsec_init(dtsec); if (err < 0) goto _return_fm_mac_free; diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h index 418d1de85702..7774af6463e5 100644 --- a/drivers/net/ethernet/freescale/fman/fman_mac.h +++ b/drivers/net/ethernet/freescale/fman/fman_mac.h @@ -190,8 +190,6 @@ struct fman_mac_params { * synchronize with far-end phy at 10Mbps, 100Mbps or 1000Mbps */ bool basex_if; - /* Pointer to TBI/PCS PHY node, used for TBI/PCS PHY access */ - struct device_node *internal_phy_node; }; struct eth_hash_t { diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 039f71e31efc..5c0b837ebcbc 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1150,22 +1150,6 @@ static struct fman_mac *memac_config(struct fman_mac_params *params) /* Save FMan revision */ fman_get_revision(memac->fm, &memac->fm_rev_info); - if (memac->phy_if == PHY_INTERFACE_MODE_SGMII || - memac->phy_if == PHY_INTERFACE_MODE_QSGMII) { - if (!params->internal_phy_node) { - pr_err("PCS PHY node is not available\n"); - memac_free(memac); - return NULL; - } - - memac->pcsphy = of_phy_find_device(params->internal_phy_node); - if (!memac->pcsphy) { - pr_err("of_phy_find_device (PCS PHY) failed\n"); - memac_free(memac); - return NULL; - } - } - return memac; } @@ -1173,6 +1157,7 @@ int memac_initialization(struct mac_device *mac_dev, struct device_node *mac_node) { int err; + struct device_node *phy_node; struct fman_mac_params params; struct fixed_phy_status *fixed_link; struct fman_mac *memac; @@ -1194,7 +1179,6 @@ int memac_initialization(struct mac_device *mac_dev, err = set_fman_mac_params(mac_dev, ¶ms); if (err) goto _return; - params.internal_phy_node = of_parse_phandle(mac_node, "pcsphy-handle", 0); if (params.max_speed == SPEED_10000) params.phy_if = PHY_INTERFACE_MODE_XGMII; @@ -1208,6 +1192,22 @@ int memac_initialization(struct mac_device *mac_dev, memac = mac_dev->fman_mac; memac->memac_drv_param->max_frame_length = fman_get_max_frm(); memac->memac_drv_param->reset_on_init = true; + if (memac->phy_if == PHY_INTERFACE_MODE_SGMII || + memac->phy_if == PHY_INTERFACE_MODE_QSGMII) { + phy_node = of_parse_phandle(mac_node, "pcsphy-handle", 0); + if (!phy_node) { + pr_err("PCS PHY node is not available\n"); + err = -EINVAL; + goto _return_fm_mac_free; + } + + memac->pcsphy = of_phy_find_device(phy_node); + if (!memac->pcsphy) { + pr_err("of_phy_find_device (PCS PHY) failed\n"); + err = -EINVAL; + goto _return_fm_mac_free; + } + } if (!mac_dev->phy_node && of_phy_is_fixed_link(mac_node)) { struct phy_device *phy; From patchwork Thu Aug 18 16:16:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947401 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5745C00140 for ; Thu, 18 Aug 2022 16:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344709AbiHRQTa (ORCPT ); Thu, 18 Aug 2022 12:19:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344608AbiHRQRw (ORCPT ); Thu, 18 Aug 2022 12:17:52 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4654EBD0B8; Thu, 18 Aug 2022 09:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QYe1/KqdY4vwUQPdWGdDaRcC/mcmeZi6ZttGHiM+58ix48GcRelT8JQ1iikrQEBiSN8s6q9FzjwFpnni5F7t9R+mdIkPxfyopE/2RoTa1JC19VTxWPQCCE2CdN+Mp/Gj7aKB4msl2LpYgo+xGLKMv/idBK1cnquXYZ4UIbs7pVlF1N6DNJppn/AZ4VQOL+oBSMLNzHD7Gh7c63Q8sSDsUh1uMHOFXjQUW/0jl1lHCqWo5dyuLTI3pVubwfOc240DZbOdFL6YL7pS+cGeyqqXahzbEnJrdvNZJSXi8ErFGi5PLSC9TxDCIgN73cS1tdKsJD5Ak/3S5ylAos/hZtJuJA== 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=KGWQbBEdK1su/g5tIpfT1wDYLHV0nYKXcAAYaa2UHiA=; b=VZQpnueuHT0x6qFyCABXXBZqU5fCFBi1vvSlrgZhyuJf/aqdyQKeWj9FQeasst6KkO2j56n0/rvulH380CLABgDyYOT/gGmvfzc/VO3RZHxyGDX0DkuNNUuI28uoFjVVpTbGpkSDUlNxNYgDHej8/me0y4cstpTc7IBV+NEU1xAJzAXzLAD0PK1XUiYtEiRbVBQGqdzQ7sJD+7tT1DSBW1TJP5RFWfX2/bGQz42FCklFtVB3jAEVAn3j14xWjml8M6nfe/rpwM1qao0Jx64u2g0OC4nMTZu0ZKocoumQT0kffTs8bNr6Qn6PourZKbE9MSal6+gijVGEdEh7PiBQAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KGWQbBEdK1su/g5tIpfT1wDYLHV0nYKXcAAYaa2UHiA=; b=I6OlaceOB4bT5C9Ft1Djnb/nfwnm1n+N1LNvUN/VaYoLFemIAKcJjg7z65Nvt52oYhojW/G0MBqq0sZBtg506TE5a6QdPHyGDHkyHAX1s4yEitc+tV92ognFc3Nzb/TKvfmr4JfAbhm/1TeahiuI+ZxEZYfDB5zQ/kHKDE8bGpYZF/QxO3mb7Bc0qrt6hl27r6z/RcZ6bMg6WIilG7S3D7SJhRwW56mQ8p+6eEaKNcB1A8JrPIPRQQNjENrAviqGAO80/k9BN/wTaxZpEFwjc2/pYN0ncUPiNLn+TThFmiaB01+ji/R47QM5Mjxpkq9aNj6nfnftpvlSmEX1NYWw9g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:31 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:31 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 16/25] net: fman: Map the base address once Date: Thu, 18 Aug 2022 12:16:40 -0400 Message-Id: <20220818161649.2058728-17-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 60311f5e-8d9d-4368-ee90-08da813526ee X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XjSHCqIolUvZD53fvG0SiWz7FTTinR06sBvI1U2IOfSZXNef2B6PTfIBzqhmFz7ek5s0H/5zTiei7KrxgZQKVCDk4Oz5BsLbMr7HhKK+b8GbNipdzj3ZLa+MkWMBCirVVyR7yCn5LueaZIXGijdAiVXMlA3FBRWMoZlatfjblSDBcdXiGBuAcpFbZNHZ9yaPetvip+nlauFwdIEbEXs4WjvpVmY0XntL6zLagZZpcP2G975Jca3wUQqJZa8Du/xEUKgi4ZVDCrZSTgT3M917GQMg3l+T3fVFO3e6Zm+5E4cdZLDWo0qANGBtL//7JZOm6XpUl1OKrMNWfO3cv8VoDKUkxfrsw12CbSJ8PpsI25l6X5wa0wIdw0fgZ8giHAhzMJ03y/nJhPiZJ0Xpp0sPYMQ35ZxA4+k/87w+udyI2gAn+wUm3tgsDELIB2fTx+017L9Qukiqv4h3Af4MvxH4eyih+zpT2h6QC+ZNBP2bc0bFUygvEb3GeOKX+TOGfl5AaD64uYEbKccN7BmZBithxymO9bqezAL3NADE+cgv+mUDEqZ+dJEqZrzAnsXYD+bzGERBDywitdus5SYKiAw3OBci7XQgCLD/Tehwe8C4jP02VTxGOgE2mTCzYsqqNTk+dKlutxgKETB2FgLpx74I0fNN4TdUCtxVw6NHiQ8CR3RNZm0K1vaV5GPNV1y89uc2kp8j86ITAPPcglfJGG13HFIV7U5vD+EXmcMAra3sM0ZOCSzwdyoUUHEoG9x5Z6x5p/KowNJHDnFqZoJ9e739Lg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(2906002)(36756003)(6506007)(186003)(86362001)(107886003)(26005)(1076003)(6666004)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DIFIdSDoPpl8ARDf0VC5YRxSwFMQWO9qpW6g4iZoxLh+1DZTsdr0+7F52EI1jhD/Wez2F9CoABZUXrEZ19wY5R/1jk0QtmUKVzbuRzMmoRq/jXGKsShnINbCtwrlybI9Y59thiRTSGueb07B62UmML4LssnFLYByHakZ1PoXsU1n+qJ3IlKlODvhOJyLXD4FvYjlCvIZ9EDZ6JWtbmIb6whLEyaRnQW2Yzr2kO+GAqed8ZKqQlVquPu1dhUFFktVqg1H0Q2cIYXEy0caY/BGy7Xd3gGVls4EU9PKQpFEeSwEMwhbgxrKrVo3U+Lmlq82GB3F78k//vPK5gFe/IE5bJKm17jiB9Xr5JZ/Gtz4LPd93Ve8+LS83o7f/L5yMTBjdoWJv4P0J8cQph8WULC4ik35zGQcIG+eV4MG77n+wEzpNdDY6Zfc1YGXI6Qo9DoYYSGriZjIBiwiROdth0k5V/qnIwIkvytrUXF0DYxiBtrACqtwToZUlLapsoL7PAgmBYkk8gTvqPs7WNsl1TFGUIBP+6kS4TSoLDEUreOpP14dR95PIp1pcga9vIynlS/tE+29mGr8DClnhhL5ndV/TkGnTlFMIE3ghlXbogpuYqanv8yx3d49kAVF526TSRT8SP5HtCv/duGpAWbCmCJM23fdMZANkUSv56wQqeEYJYJx+XB1JpmRroXQDuNZuPqXLh/sDm3ravuD86iUZ68oA8xAIz8I4Rp66rvn408SCnYyEmnT6vn/k60DHGJsEzre8pYK+qSCxwcF5+DTSq1xmEJO/SXr3vesc3plEduonp9lBDDsfREJf1mjkTjtRDAbIwaLCLat3M6I1gdblEW4nVb/gCFe5R5qXc3ftVRRSJFwlk5Clq8ae7kb8+6s+8yktghSEs2uAaKY4eWG9p2SnHrMkW+BBMX2Shv1gLXT9E/mIMEQblmYEShrkY/X7C3zxnFHvLao5M7z/e2nt1tP7Nf1Ohae6dIPubpDhwRu3M75+TgkFD9FQ+kpXfQrmtW55NEto2QUBc5cnb65mKCfRVsbQBmyD391H3xhDC9GkpWffk4si0S9dFZYlkDgmzmBZQrqGb9nr63+2g+Io9g+FravbReUPOxKlJWMJXJjpUuPPH1lnI85rvBy/2kqbeho1bz0RApC9Sd+B7+qvv7vRavGqTMRL39kRCJaMrSGQk8PTF1eP5JyAyzOzW+3JiJa+vr0Hi3YJnqXG3+n26doWhHbEMDoH43O2Z0VA295qWoHuZowNMrQS2DIN6TNpPx3+JWZZOmkeZi5HaSNM4jCtXh0kUahVW/PPzE8bl8whMdQjrOGnZUpbf2z1zC7YwyZWQ9NXZYMAqLEDsVvqIDAoDtc6u5OrNzyzYM/Ccpo1ml2YfyOyMWo31ZauMftXs/yQD36GajgnXI+WGkn4lTnqTNPMFqSuPv1jfSwOm1RONzz6VtkdzPPy3jTGOHHnzC2Rg2JIbMO/G0YkFu7XLYX/9T52IC7FpZjp3lSsy9UNG357algpndghUmLbD7ZioWZSLXol/X93efb+Szro+im6qGXTVkURg2QcnwsaOYcqaE3W3rFg8DGqq5i8eMGyJvrpp4zyojPTM52+Cyn6drxeQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60311f5e-8d9d-4368-ee90-08da813526ee X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:31.5132 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tcmDekdhNQHhSEu353MoIfWHgfMnAAVbq9gVouRaMhKec/7pAvLlYfx7XmK8Lz30aMSVj1mOMQBvPfWvFrkyRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org We don't need to remap the base address from the resource twice (once in mac_probe() and again in set_fman_mac_params()). We still need the resource to get the end address, but we can use a single function call to get both at once. While we're at it, use platform_get_mem_or_io and devm_request_resource to map the resource. I think this is the more "correct" way to do things here, since we use the pdev resource, instead of creating a new one. It's still a bit tricky, since we need to ensure that the resource is a child of the fman region when it gets requested. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- Changes in v4: - tricy -> tricky Changes in v2: - Fix warning if sizeof(void *) != sizeof(resource_size_t) .../net/ethernet/freescale/dpaa/dpaa_eth.c | 4 +-- .../ethernet/freescale/dpaa/dpaa_eth_sysfs.c | 2 +- drivers/net/ethernet/freescale/fman/mac.c | 35 +++++++------------ drivers/net/ethernet/freescale/fman/mac.h | 3 +- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index a548598b2e2d..d443d53c4504 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -218,8 +218,8 @@ static int dpaa_netdev_init(struct net_device *net_dev, net_dev->netdev_ops = dpaa_ops; mac_addr = priv->mac_dev->addr; - net_dev->mem_start = priv->mac_dev->res->start; - net_dev->mem_end = priv->mac_dev->res->end; + net_dev->mem_start = (unsigned long)priv->mac_dev->vaddr; + net_dev->mem_end = (unsigned long)priv->mac_dev->vaddr_end; net_dev->min_mtu = ETH_MIN_MTU; net_dev->max_mtu = dpaa_get_max_mtu(); diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sysfs.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sysfs.c index 4fee74c024bd..258eb6c8f4c0 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sysfs.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sysfs.c @@ -18,7 +18,7 @@ static ssize_t dpaa_eth_show_addr(struct device *dev, if (mac_dev) return sprintf(buf, "%llx", - (unsigned long long)mac_dev->res->start); + (unsigned long long)mac_dev->vaddr); else return sprintf(buf, "none"); } diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 7afedd4995c9..62af81c0c942 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -28,7 +28,6 @@ MODULE_LICENSE("Dual BSD/GPL"); MODULE_DESCRIPTION("FSL FMan MAC API based driver"); struct mac_priv_s { - void __iomem *vaddr; u8 cell_index; struct fman *fman; /* List of multicast addresses */ @@ -63,12 +62,7 @@ int set_fman_mac_params(struct mac_device *mac_dev, { struct mac_priv_s *priv = mac_dev->priv; - params->base_addr = (typeof(params->base_addr)) - devm_ioremap(mac_dev->dev, mac_dev->res->start, - resource_size(mac_dev->res)); - if (!params->base_addr) - return -ENOMEM; - + params->base_addr = mac_dev->vaddr; memcpy(¶ms->addr, mac_dev->addr, sizeof(mac_dev->addr)); params->max_speed = priv->max_speed; params->phy_if = mac_dev->phy_if; @@ -305,7 +299,7 @@ static int mac_probe(struct platform_device *_of_dev) struct device_node *mac_node, *dev_node; struct mac_device *mac_dev; struct platform_device *of_dev; - struct resource res; + struct resource *res; struct mac_priv_s *priv; u32 val; u8 fman_id; @@ -368,30 +362,25 @@ static int mac_probe(struct platform_device *_of_dev) of_node_put(dev_node); /* Get the address of the memory mapped registers */ - err = of_address_to_resource(mac_node, 0, &res); - if (err < 0) { - dev_err(dev, "of_address_to_resource(%pOF) = %d\n", - mac_node, err); - goto _return_of_node_put; + res = platform_get_mem_or_io(_of_dev, 0); + if (!res) { + dev_err(dev, "could not get registers\n"); + return -EINVAL; } - mac_dev->res = __devm_request_region(dev, - fman_get_mem_region(priv->fman), - res.start, resource_size(&res), - "mac"); - if (!mac_dev->res) { - dev_err(dev, "__devm_request_mem_region(mac) failed\n"); - err = -EBUSY; + err = devm_request_resource(dev, fman_get_mem_region(priv->fman), res); + if (err) { + dev_err_probe(dev, err, "could not request resource\n"); goto _return_of_node_put; } - priv->vaddr = devm_ioremap(dev, mac_dev->res->start, - resource_size(mac_dev->res)); - if (!priv->vaddr) { + mac_dev->vaddr = devm_ioremap(dev, res->start, resource_size(res)); + if (!mac_dev->vaddr) { dev_err(dev, "devm_ioremap() failed\n"); err = -EIO; goto _return_of_node_put; } + mac_dev->vaddr_end = mac_dev->vaddr + resource_size(res); if (!of_device_is_available(mac_node)) { err = -ENODEV; diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index da410a7d00c9..7aa71b05bd3e 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -19,8 +19,9 @@ struct fman_mac; struct mac_priv_s; struct mac_device { + void __iomem *vaddr; + void __iomem *vaddr_end; struct device *dev; - struct resource *res; u8 addr[ETH_ALEN]; struct fman_port *port[2]; u32 if_support; From patchwork Thu Aug 18 16:16:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947402 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D593BC00140 for ; Thu, 18 Aug 2022 16:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344727AbiHRQT5 (ORCPT ); Thu, 18 Aug 2022 12:19:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344621AbiHRQRz (ORCPT ); Thu, 18 Aug 2022 12:17:55 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B81EBD17A; Thu, 18 Aug 2022 09:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bRXYjwP9QDypHQ0UrO8fNAvgttmlzcISxINxy2yavFKnxY9Vwp4pG1Rpr2Lr3vEupVnP63V7Ig6VKumLvX+Vwd5bSd1dldQ9Q0/EudxwjEYeQEb/TxXNRRXOzJ0kmrHWz1cL9rU4Hjq4tN5rKdWCUyaO08TCpQVxK7mZcryvpzEkBNE1Lcof6CARZZl9tBYD8lIIpgp1HCaUtrvElL1pdilug5Kr3UXnceYYVRikmQw5E5gHmtUjz8ybqw+Nf54KrGEEi9ahTZcDOjwl1ZwGwqiXOsbX7rDt7/Q/bjGKk8GWtE6wgZEapP1JnNkAyMQqfVKL0VSTNlAK8PQLW+Atuw== 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=BrjFhE6GcDc3NyqacZut6e2mzgJ8sem49dgtwHT5lEE=; b=UwmhJU3AalahgcAju88U47Lu7j+6xuRX/6nudY/fL55dK6iyxYuVA02uPEivZ3F7pa/ssGbyOxakDBFj8l8oaUAvG68cUonDPdNgwDYGepyTD0e3GTAY4fA9mffLOvuW3VctS9LJDmmaPMUZStJMuXmgFn2akPKMirgvDgeGy1wQZMCdWMDocIPJvUKxzlfEEBZ42b2f3mH/g3/VN/ToGGwk1Tx8ZuvL9xIzyoCvdXmZ4DmDpBD5D6ujVUOtzJUBlAgh+v3PulPUyYXz+txTcjPZx+mpwT1igX9qt0ia6Vr3dsNjX6I0O2RgTJtCijLY8wlTcr7n9BZLDb/roFrgTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BrjFhE6GcDc3NyqacZut6e2mzgJ8sem49dgtwHT5lEE=; b=lnrteL1a6cn+tImAqEf57ckzahSfEqmgLJndLQQVcuvrTTyjg1UB19RpyAJkVHJoKm/W+afAysbfY37MmKr4kY42tGkgIcMUqA1gQXFA4UTSJ4NJ8cqyQAp2cr/jwfjIN1/rFdd7pfkAnbCg7tSX//VffxZCUawU/kPmNQmzZWl1C4JqpJZ/yoXiLxd8RtqlUYpSdNDW++fstCblW/qGVqpV1XTlmxlIYbD058oaCvZK7/DacK38Dk0UUUp/fRDehizipzEzMRQ9X3H9itfXwM4HqGWdTFE61H6BqfJ3uueXJ9Dc++Kc9PLZRHqKiEMOv/DdyAkUY5E0NJf++d345Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:33 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:33 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 17/25] net: fman: Pass params directly to mac init Date: Thu, 18 Aug 2022 12:16:41 -0400 Message-Id: <20220818161649.2058728-18-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a757671-713d-427e-cc59-08da813527d3 X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pwHYYQc9MJf6SIpex1GPwXREoRil4o41zUYZRmhczjYzAnPAvlGNhGbsF5C6iQHbwi3qca+moGzkrx77fsXa4rFgAhEf9mFO4YnRq/4rX5DfB7ns6IxXHb/K+dcrKs4PTEfYm3dygcS/2Wf4JRk/7EDQUv4Ph8gtI59W9qTY1QmgfJrsmQ/rgRBIX3vcBUOw/8w2xM46Xha5AK3tPADTdvGaE3sumwlgfvEDaiCjZCY5RpL9ce4hG1OPpxznPYjOqg0UU9L9SsDHL09A5fl+jCqs1ZzOPeB6UFU/ZoDSKwXDht3N9sZquADg25uIsz+DcUQx0XoWxP6f9G+gPb4gp60zFOXLe3Wz2g682BV/Qf3k5eftr/lxBaJ7qcGGYPzbfhtjfADHDgYs+tCu/2CNvpwQBv3loXOcGBWkYLSNFg/U27e9OpbCHQImOYFLzuU4NZ3VZ7dkgRHj5uTdAKIoUUvvSWnkpFQpXKwu6u7IGk3qpNAPrpKPHXgdwrylenrEXcHkb3fgJsZTeULEnVrL+hKL6ojsE4XA4w09MiIIHUp+ads16NSJ5tMEKX4gldzB5Gdets2gOexg126Pcn38YW6l975g0ZogFPo5K5GSksbKsTPrf2jP0kCyM7hH6QmHMBHM0QFy0EoiSPaFDYJVJWwHx6nONhroJSzviULKGJ4+9u31Zo6NrDIH40TWk7QorxQuO6n5oZs37OMdpnfjKIgP04Umfg/J70/hi0ehGxlKeTP27ibRu5IW4tgYoTl1Is8herd0VuvuHh6ASUyzBg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(2906002)(36756003)(6506007)(186003)(86362001)(107886003)(26005)(1076003)(6666004)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g4s0yCvv8rtTybgT3tZS7Eh8OsTq22nQ80l1q+3d628zqHJPerglydkl/LcxfZsOWi7uiOqIpucdgR2REJJkMbox+RtGuJ9/zwTKBitn61DAJZoUHQjtbBNXE/u8MpCp7EVisUQzE6B0CedPu9KMVltdxABX74Qv1yB/n0/64uUZjtC6szRygHxvTpFiKipR2pi9IbVsgszH2iamPqzpi3/+OJ+y41Q3uO60uCirURDGCUFfiMzHi3WDl9jtnW9s0z57Ld/BxoI5yYylQAeSmgmnkvZRs9wlMNyBaOEBYUW2/gzyv6PWFJFB/jmOFvNn1Iw0CifQZdHrmbhcD2tbW0NzDzmfqU/Z75s7nFdPMMKDLbhgMgZKOV9++V+6bLLAQY3H0ZrXSmSeVPux8MznUbboGy2OyYugP/xCy9HlSONRE880GWWcjO3TnOwoxtYkAoPG4/QQQA6OVF8dAFnDVk7hlL9z98CdNCvjUav/yA8ySoPyjfdbn+X+s8Y3siycTTuHEBgSZDTpx+FWCSr53k4EMJj/AgyqpSz5AoM7WLiwBNagC+fB5Arc1mBmj/LjyDaHQ0Y+kE9uF1/bIX5iQbiOyyO1zTBTTvbofQM9lrg9zOUYUDaFXvUiVG1ktwY/OX/sKcMtnutsvzDSuc+7uG2BInCe0OY/rrUq7jDQiKZKBknd8y41NcfdnK95aiwIdXBVH1FaThTdt5OfOTJ73YW5InfIaI+3cya+d5UjqqaSN/dHCISLTTM2jQ72UcPxsp9ONPYxh1vgFXoWvQoLD0keNRH49DhckSH3d4eATIz8FEgCweWwkxRjPcG28zyqPHk9wrKbk/OXwhtrNwOcMqw5VKFrIEMoPwkMpYgRSz2vXMBM+oKEiTdCPfkzpeVWojpQfgjtJjn58xb53wD+rN+E526NYM9mMYOnH0K8wccKDvRk1e2aYUNk98wFohHNdmQ8DOUdUb+xfsUovV0fg26nsZOPCwukn9hp/JMi/xssEAjYnFk/kHJeP/3MYOtbj9Zc+wWaxgj8rzlLUBjCZPntnArI2mTDofH4oq90lQydsngjyZPJJu3KmEdJBiAlKKcTga3F6Dri1ApE+lVz+WdAtMoNfVDMxpc8+8Igk6o4oDuZylVOrEVJJ/5acjFl8GxjiV2ppGDrJT3j83Bw8zxLvFj7NICfldeYVrMTHV8sPoNapw3x7HNRzXNU+xDPFvPrddbrFWG1yG6+4HukHueAtCGQxxf9leJ31RXwWR41UQWPdFIwKu/hNzKAxOuST8t3GQV6MA6Qf2eMd6z+ak7byyx3F9PYePB3g/M7pzHkg3BOEeZQYLgAd+xl0JyB7GAetvMp3fxyNrP/8O8J5TvCMHVtI5Idpth9Z+V1XCiP5XOitcHDfdKV92ZTZwwQUNLzWbaX5d1ER/gTMU2IFKIz9yS0gFJ1TZs3SCL6xWNuwKxPyLp6041AlWT12vE9mTX/h0B6KYKeaF1n5xVWkTKAoXpyYWojt9vJGA+qufOlU9r0XmllGZvE2DiyMjoDELIrYLzyjJ3ttaeJe2HqeYqGdU7v+d2FcDkTRdwhkSReyemQ2Pzeisb26T+KAxD+s1xzOsfdM0kd4+Z2v+23Qw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a757671-713d-427e-cc59-08da813527d3 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:33.0287 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u3/K7UAl3n5QiPMD7rKNz0lhA2tA4w3PduK9gK/hTAR3bkhDJ15VjK9QzIoCiRw285BqpJcBfamUzyjaWaZ5eg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Instead of having the mac init functions call back into the fman core to get their params, just pass them directly to the init functions. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 10 ++---- .../net/ethernet/freescale/fman/fman_dtsec.h | 3 +- .../net/ethernet/freescale/fman/fman_memac.c | 14 +++----- .../net/ethernet/freescale/fman/fman_memac.h | 3 +- .../net/ethernet/freescale/fman/fman_tgec.c | 10 ++---- .../net/ethernet/freescale/fman/fman_tgec.h | 3 +- drivers/net/ethernet/freescale/fman/mac.c | 36 ++++++++----------- drivers/net/ethernet/freescale/fman/mac.h | 2 -- 8 files changed, 32 insertions(+), 49 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index c2c4677451a9..9fabb2dfc972 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -1474,10 +1474,10 @@ static struct fman_mac *dtsec_config(struct fman_mac_params *params) } int dtsec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) + struct device_node *mac_node, + struct fman_mac_params *params) { int err; - struct fman_mac_params params; struct fman_mac *dtsec; struct device_node *phy_node; @@ -1495,11 +1495,7 @@ int dtsec_initialization(struct mac_device *mac_dev, mac_dev->enable = dtsec_enable; mac_dev->disable = dtsec_disable; - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - - mac_dev->fman_mac = dtsec_config(¶ms); + mac_dev->fman_mac = dtsec_config(params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.h b/drivers/net/ethernet/freescale/fman/fman_dtsec.h index cf3e683c089c..8c72d280c51a 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.h +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.h @@ -11,6 +11,7 @@ struct mac_device; int dtsec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node); + struct device_node *mac_node, + struct fman_mac_params *params); #endif /* __DTSEC_H */ diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 5c0b837ebcbc..7121be0f958b 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1154,11 +1154,11 @@ static struct fman_mac *memac_config(struct fman_mac_params *params) } int memac_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) + struct device_node *mac_node, + struct fman_mac_params *params) { int err; struct device_node *phy_node; - struct fman_mac_params params; struct fixed_phy_status *fixed_link; struct fman_mac *memac; @@ -1176,14 +1176,10 @@ int memac_initialization(struct mac_device *mac_dev, mac_dev->enable = memac_enable; mac_dev->disable = memac_disable; - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; + if (params->max_speed == SPEED_10000) + params->phy_if = PHY_INTERFACE_MODE_XGMII; - if (params.max_speed == SPEED_10000) - params.phy_if = PHY_INTERFACE_MODE_XGMII; - - mac_dev->fman_mac = memac_config(¶ms); + mac_dev->fman_mac = memac_config(params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.h b/drivers/net/ethernet/freescale/fman/fman_memac.h index a58215a3b1d9..5a3a14f9684f 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.h +++ b/drivers/net/ethernet/freescale/fman/fman_memac.h @@ -14,6 +14,7 @@ struct mac_device; int memac_initialization(struct mac_device *mac_dev, - struct device_node *mac_node); + struct device_node *mac_node, + struct fman_mac_params *params); #endif /* __MEMAC_H */ diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 32ee1674ff2f..f34f89e46a6f 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -783,10 +783,10 @@ static struct fman_mac *tgec_config(struct fman_mac_params *params) } int tgec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node) + struct device_node *mac_node, + struct fman_mac_params *params) { int err; - struct fman_mac_params params; struct fman_mac *tgec; mac_dev->set_promisc = tgec_set_promiscuous; @@ -803,11 +803,7 @@ int tgec_initialization(struct mac_device *mac_dev, mac_dev->enable = tgec_enable; mac_dev->disable = tgec_disable; - err = set_fman_mac_params(mac_dev, ¶ms); - if (err) - goto _return; - - mac_dev->fman_mac = tgec_config(¶ms); + mac_dev->fman_mac = tgec_config(params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.h b/drivers/net/ethernet/freescale/fman/fman_tgec.h index 2e45b9fea352..768b8d165e05 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.h +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.h @@ -11,6 +11,7 @@ struct mac_device; int tgec_initialization(struct mac_device *mac_dev, - struct device_node *mac_node); + struct device_node *mac_node, + struct fman_mac_params *params); #endif /* __TGEC_H */ diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 62af81c0c942..fb04c1f9cd3e 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -57,25 +57,6 @@ static void mac_exception(void *handle, enum fman_mac_exceptions ex) __func__, ex); } -int set_fman_mac_params(struct mac_device *mac_dev, - struct fman_mac_params *params) -{ - struct mac_priv_s *priv = mac_dev->priv; - - params->base_addr = mac_dev->vaddr; - memcpy(¶ms->addr, mac_dev->addr, sizeof(mac_dev->addr)); - params->max_speed = priv->max_speed; - params->phy_if = mac_dev->phy_if; - params->basex_if = false; - params->mac_id = priv->cell_index; - params->fm = (void *)priv->fman; - params->exception_cb = mac_exception; - params->event_cb = mac_exception; - params->dev_id = mac_dev; - - return 0; -} - int fman_set_multi(struct net_device *net_dev, struct mac_device *mac_dev) { struct mac_priv_s *priv; @@ -294,13 +275,15 @@ MODULE_DEVICE_TABLE(of, mac_match); static int mac_probe(struct platform_device *_of_dev) { int err, i, nph; - int (*init)(struct mac_device *mac_dev, struct device_node *mac_node); + int (*init)(struct mac_device *mac_dev, struct device_node *mac_node, + struct fman_mac_params *params); struct device *dev; struct device_node *mac_node, *dev_node; struct mac_device *mac_dev; struct platform_device *of_dev; struct resource *res; struct mac_priv_s *priv; + struct fman_mac_params params; u32 val; u8 fman_id; phy_interface_t phy_if; @@ -474,7 +457,18 @@ static int mac_probe(struct platform_device *_of_dev) /* Get the rest of the PHY information */ mac_dev->phy_node = of_parse_phandle(mac_node, "phy-handle", 0); - err = init(mac_dev, mac_node); + params.base_addr = mac_dev->vaddr; + memcpy(¶ms.addr, mac_dev->addr, sizeof(mac_dev->addr)); + params.max_speed = priv->max_speed; + params.phy_if = mac_dev->phy_if; + params.basex_if = false; + params.mac_id = priv->cell_index; + params.fm = (void *)priv->fman; + params.exception_cb = mac_exception; + params.event_cb = mac_exception; + params.dev_id = mac_dev; + + err = init(mac_dev, mac_node, ¶ms); if (err < 0) { dev_err(dev, "mac_dev->init() = %d\n", err); of_node_put(mac_dev->phy_node); diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index 7aa71b05bd3e..c5fb4d46210f 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -72,8 +72,6 @@ int fman_set_mac_active_pause(struct mac_device *mac_dev, bool rx, bool tx); void fman_get_pause_cfg(struct mac_device *mac_dev, bool *rx_pause, bool *tx_pause); -int set_fman_mac_params(struct mac_device *mac_dev, - struct fman_mac_params *params); int fman_set_multi(struct net_device *net_dev, struct mac_device *mac_dev); #endif /* __MAC_H */ From patchwork Thu Aug 18 16:16:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947403 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E23CC32772 for ; Thu, 18 Aug 2022 16:20:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344750AbiHRQUG (ORCPT ); Thu, 18 Aug 2022 12:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344660AbiHRQST (ORCPT ); Thu, 18 Aug 2022 12:18:19 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50F11C12F5; Thu, 18 Aug 2022 09:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NpPpBdlghjCwc648DRp4dmZfh4FFC/2OMITYVr4ZvMR/4q4FdT5EjBLaGe0M1No4r4pBD04FrWGN4v7Iyb/YnnjuG+rlkczuzDJDic71ykwqi3PO9nVml3woLgbvw2he82wVtjFAyzL8z+iWyy1G3WbakQQlA+fvy93uq4NQowVX2hv2GZNV5pCuBX/Zciu0BN7QawwfPdMev3Xs6LZ46Hy8kJVFVIaO2z2WnD7DwgDdLUN5heqF7dCmx0I7350LF5g+N8amK89VPqXFPLjPS6eHO9pRzQkeEJZVWvnl85743GKlWIy5m7pNT7UtuA/Am/RS2qVlNNxHcij78BQE7w== 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=EjfdFtV2Kn0MnN32TKkSGHoI29fYTJaUy5GLPYutZkA=; b=MAcmcWsxAKbHHn6JmoK5uj178QG3qVc0lEhT84rw5rkU03DXeM52OQdGFqSF2OzI+vJMn1tt6ymrxq2i2f6j2GUP94GuDwiPWfCkH4V9ILGWyxY/+V0FO83008lVuJW2NuWuRg9t/T8cZk4Wm7qclJsF/z/mZk+OWkGdw87DVtnp2afPtYs/iXPPhwEzvUqmGL65BD57bXADfsNJwymZ2nWmJXqQ/UjGfrU7hpsGeWpoWrdmEC32gvv0dgOAX96LjS9eqzncm/qAyTbCPiJlouNETlxR3SXLQV/VvxTvoxeWJT8n2H1k+ZGIbPJu8phzJQ27el1bttUTLhoPM4uPLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EjfdFtV2Kn0MnN32TKkSGHoI29fYTJaUy5GLPYutZkA=; b=uttU97xbL2rQvEU5zew86iw3/fYQxUS9M3EM+jMqLgInAM22ho9mT1DR76w8IpYt6yr8rIl8/ABpVusg/judPgJOliiUj8hdH9YFTh9s1+oltf8axxgPm2CylHj7TplrfoUaZk4xb/bh0+nxNA4cWbqhHLP700lXszucHWPhupkEdvlMKV7/cRhFER39eqRHlmuLT0zCeFmkOvVi7Oqi4x1of3tEUoZguQB4YbyI54GjTgIwRLLgzjwWkAOt/xKfmFvIEq5AOWMvlOEkHwhE4Oh9/uCEG2DZqnI+SReBhsos2koekWMSlAiPC3uobPE2fiRCJBEzqvlZEI2iBbV6CA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:34 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:34 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 18/25] net: fman: Use mac_dev for some params Date: Thu, 18 Aug 2022 12:16:42 -0400 Message-Id: <20220818161649.2058728-19-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f1c71f1-e98d-40c2-47de-08da813528b6 X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oFfmLIBhj7gCl5GzbCwMBzbq4qie8zt+ktBnU9qadKaJcADzdCSP8xTpSLirrG3wPA0zXQHTmFLN0XNiuaeeNQgKMI00Ig9l5UD07g2nWb4ZK2p12V+9f9QREj6uXR9Z6JYXLvVZmLnVZzo3R6yYmU/jIM8gHQU3MMjor3HoitSBt8KR0o62ZXivnBroWRsBmovIEQvpzCs53B9rNWPTZYpqZn+hOxWg7GI5TRi48ZQWWkCa8xYnxM69GlkBpIlZy3Aplq1JmB3XoTXBhJKsM+dP5aH43W4+w+sONQ74UPUVEZ8sFMK06DSrufVEYVcFgC1mOxwgiFreOITKeZUAYCn3aVcU7PdNNI7K6t+5sxkx0Y5EsmlQBqvRbWK5+GzggetZwKkIe6q09QiHo60uPvhcf6Lf0ME1tnTW9kz6FnlcVz8koMMjHuudIC4BZuvT6iib1xaYupd5eB5T+RoSoK3y6V9S4N+KS5a2h3MX4RE70r2l6QlgkTeBR7BYPejceDGVIEP/84rDcTq0MQgvIX/ErYCY79WUGtN4FMeLThXo2t8PZLZPLtP/bSIMCJUfj5avgctWAsXvDt4VXTF9+SPcV8C7+309NuUxGT+WRoStH1NjHHStbZQMlhhlqAlEWEuQIPZF2CT0vTPk8CzcDiRE0zqeFwzordMASq+tFjoUgS+dhRDPOB25FUDbwX3QY9SR+/fGlPz26TOymlRakO5Sb+7L1l9lQmHbw51JrHYOGGg78yrjvJe2h9GcGieHEx2djSsZjNoA3XWIh4X/Zg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(2906002)(36756003)(6506007)(186003)(86362001)(107886003)(26005)(1076003)(6666004)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UMtdPhAME3RHUTR5WUB5vGtp9ANQzk566zUGpkHSmMVpPJ2rAfiQZ76rOFz4EXBQyBoD5WqH+2C2hH/Dv2hJc89Ii1DfJAnaylBortUdujMCY7+ediaYStCMQfTC7f0criFJkmIC4kPL0wImX/YfqUlR288BZflJ8Ue857YQCuZx05Yglx8m2s+JdDJJTB7ol9GYfaIxQQMJktUG2aNyLoCmcMK+QVk9ZjUtbpYoqvDPOpdKJ/4xGsDz8dDYt/iN4a5c0z5Djvg0kmQeVgqQVRVNUHWtTGDI6F4jNuf4AuZWNEXMZrGHXJcBRs1ejwJ1Z8eczvIEx1Fq61XEPXiEDD2IAvdAlfwDbrGB0/lnbE/LXt9LNkbnJ/bjBvrOJQ9QMZzk8czfePHZIpunpfU93aIfUFSFf+r/UNfL5vCb4lWv4e6F5S34nbnDrMZlcDLU2IvkAurpBWc/5/tW9CxIyER9bfJcvcsZTzMPHgF9xd/Y69ywUC2BHAwIQFqQN5cBfMARHI8LNZ56QUWlUzBTAoGG1482mtsIhAgOL/xQcDsIfQHerr0pbsTdLGSU9LWE25SmSSjUHAlCMsrc7/RQ6cMSrTVx0ZyVET7j6erx/3PXgCsuyRCIIPkKtT9KlnAQrGX5UKJ0Jafn6on9k9O9cZdeaTqkovDZ8OgpA83tyz8QIe5twyNh8KhKljurUPDTX03dgqgSrn7jPpcqqPz6ljyS5Tqw3Qj3RTyEr0pJtK/bS3qEe7vxUbJufQ84qf7+9yXctbu508n6xdFgqwcS6BVRS+tE3K4aLKJAKr+2i6qzjHD9Vj4draZH3zZ+KaKOiEZev9lcGc1db13sjowYniZE9Hp07t4KXWX82QMp0k0TGgEMeBQMPlI4OzxjvTMVuimlbHE6CiiOElcf5mb/5928hvBaATPj1xSlvjLnc61sWogzcKh5smrCEGLYKyy9TSdod/x3QuwpDKmltjEdb/6iyOZSjN4nVxDr4p0c6cq5+RpwaQlsOjZ1d4ASV47/VuL2s96ul+Ax9izjjQPfPiwVfnIteYzgJh8vzRaO6nJ9XrZST9bGO+4NWm6ED82EPvBHMjrxrJ6nRl4L6gIvomXkHIPUz0Pokjy0uFy/auixSRH2IiG689yh+7jVTttyP/LUkT5vPgrqx395v66GjeDGgjd3/md/1alGjitivHCPpPLcOdOghyV6L22rO7nsQa2pr3CWW7qedO3n8Eh0hKh7LTh9XYRpOEVLII1U53x79zqgNEhFx/0CkMgwWk/hywxsag2tkbv+7BLcZOKLZsg6z4gbXWIwMcERt/Kwdf4SvwIh5R0ZeicwFbHsNgyODKI/JJNrsBDNcRErtkIKK4YGPXunVwhdNsY8olguButmvSY4f5Bi/XpmF9nuXwzL1BVZlvblAZnlprnGDoOTvcE1N+ZGOTVFJSycCDwa9iR/8C+A/XFxhkaGhunv6siEPGn6hXefoMSu+o38jtpncGw/iFy+LGXtndu8i0taI1RdqfcqdQmWZY2f7iTK5fTUEdHXgYtVj4IatjLpC6FhMEkJ1qWC3G/I1pNN0j1HHVLeCpalXYcXxaFO0TP64y94cz25b+q7O7HVt0UPsIsbcg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f1c71f1-e98d-40c2-47de-08da813528b6 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:34.4037 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0P+F3gRFVRy+e3tszhVrRbV1R+6/WU0a7vdMyMhfy9gUG73PG9dqROcIf+OZuQb9UKKy7Zqq7iHDiMIvFoMreg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Some params are already present in mac_dev. Use them directly instead of passing them through params. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 16 +++++++--------- drivers/net/ethernet/freescale/fman/fman_mac.h | 7 ------- .../net/ethernet/freescale/fman/fman_memac.c | 17 ++++++++--------- drivers/net/ethernet/freescale/fman/fman_tgec.c | 12 +++++------- drivers/net/ethernet/freescale/fman/mac.c | 10 ++-------- 5 files changed, 22 insertions(+), 40 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 9fabb2dfc972..09ad1117005a 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -1413,13 +1413,11 @@ static int dtsec_free(struct fman_mac *dtsec) return 0; } -static struct fman_mac *dtsec_config(struct fman_mac_params *params) +static struct fman_mac *dtsec_config(struct mac_device *mac_dev, + struct fman_mac_params *params) { struct fman_mac *dtsec; struct dtsec_cfg *dtsec_drv_param; - void __iomem *base_addr; - - base_addr = params->base_addr; /* allocate memory for the UCC GETH data structure. */ dtsec = kzalloc(sizeof(*dtsec), GFP_KERNEL); @@ -1436,10 +1434,10 @@ static struct fman_mac *dtsec_config(struct fman_mac_params *params) set_dflts(dtsec_drv_param); - dtsec->regs = base_addr; - dtsec->addr = ENET_ADDR_TO_UINT64(params->addr); + dtsec->regs = mac_dev->vaddr; + dtsec->addr = ENET_ADDR_TO_UINT64(mac_dev->addr); dtsec->max_speed = params->max_speed; - dtsec->phy_if = params->phy_if; + dtsec->phy_if = mac_dev->phy_if; dtsec->mac_id = params->mac_id; dtsec->exceptions = (DTSEC_IMASK_BREN | DTSEC_IMASK_RXCEN | @@ -1456,7 +1454,7 @@ static struct fman_mac *dtsec_config(struct fman_mac_params *params) DTSEC_IMASK_RDPEEN); dtsec->exception_cb = params->exception_cb; dtsec->event_cb = params->event_cb; - dtsec->dev_id = params->dev_id; + dtsec->dev_id = mac_dev; dtsec->ptp_tsu_enabled = dtsec->dtsec_drv_param->ptp_tsu_en; dtsec->en_tsu_err_exception = dtsec->dtsec_drv_param->ptp_exception_en; @@ -1495,7 +1493,7 @@ int dtsec_initialization(struct mac_device *mac_dev, mac_dev->enable = dtsec_enable; mac_dev->disable = dtsec_disable; - mac_dev->fman_mac = dtsec_config(params); + mac_dev->fman_mac = dtsec_config(mac_dev, params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h index 7774af6463e5..730aae7fed13 100644 --- a/drivers/net/ethernet/freescale/fman/fman_mac.h +++ b/drivers/net/ethernet/freescale/fman/fman_mac.h @@ -163,25 +163,18 @@ typedef void (fman_mac_exception_cb)(void *dev_id, /* FMan MAC config input */ struct fman_mac_params { - /* Base of memory mapped FM MAC registers */ - void __iomem *base_addr; - /* MAC address of device; First octet is sent first */ - enet_addr_t addr; /* MAC ID; numbering of dTSEC and 1G-mEMAC: * 0 - FM_MAX_NUM_OF_1G_MACS; * numbering of 10G-MAC (TGEC) and 10G-mEMAC: * 0 - FM_MAX_NUM_OF_10G_MACS */ u8 mac_id; - /* PHY interface */ - phy_interface_t phy_if; /* Note that the speed should indicate the maximum rate that * this MAC should support rather than the actual speed; */ u16 max_speed; /* A handle to the FM object this port related to */ void *fm; - void *dev_id; /* device cookie used by the exception cbs */ fman_mac_exception_cb *event_cb; /* MDIO Events Callback Routine */ fman_mac_exception_cb *exception_cb;/* Exception Callback Routine */ /* SGMII/QSGII interface with 1000BaseX auto-negotiation between MAC diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 7121be0f958b..2f3050df5ab9 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1109,13 +1109,12 @@ static int memac_free(struct fman_mac *memac) return 0; } -static struct fman_mac *memac_config(struct fman_mac_params *params) +static struct fman_mac *memac_config(struct mac_device *mac_dev, + struct fman_mac_params *params) { struct fman_mac *memac; struct memac_cfg *memac_drv_param; - void __iomem *base_addr; - base_addr = params->base_addr; /* allocate memory for the m_emac data structure */ memac = kzalloc(sizeof(*memac), GFP_KERNEL); if (!memac) @@ -1133,17 +1132,17 @@ static struct fman_mac *memac_config(struct fman_mac_params *params) set_dflts(memac_drv_param); - memac->addr = ENET_ADDR_TO_UINT64(params->addr); + memac->addr = ENET_ADDR_TO_UINT64(mac_dev->addr); - memac->regs = base_addr; + memac->regs = mac_dev->vaddr; memac->max_speed = params->max_speed; - memac->phy_if = params->phy_if; + memac->phy_if = mac_dev->phy_if; memac->mac_id = params->mac_id; memac->exceptions = (MEMAC_IMASK_TSECC_ER | MEMAC_IMASK_TECC_ER | MEMAC_IMASK_RECC_ER | MEMAC_IMASK_MGI); memac->exception_cb = params->exception_cb; memac->event_cb = params->event_cb; - memac->dev_id = params->dev_id; + memac->dev_id = mac_dev; memac->fm = params->fm; memac->basex_if = params->basex_if; @@ -1177,9 +1176,9 @@ int memac_initialization(struct mac_device *mac_dev, mac_dev->disable = memac_disable; if (params->max_speed == SPEED_10000) - params->phy_if = PHY_INTERFACE_MODE_XGMII; + mac_dev->phy_if = PHY_INTERFACE_MODE_XGMII; - mac_dev->fman_mac = memac_config(params); + mac_dev->fman_mac = memac_config(mac_dev, params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index f34f89e46a6f..2642a4c27292 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -728,13 +728,11 @@ static int tgec_free(struct fman_mac *tgec) return 0; } -static struct fman_mac *tgec_config(struct fman_mac_params *params) +static struct fman_mac *tgec_config(struct mac_device *mac_dev, struct fman_mac_params *params) { struct fman_mac *tgec; struct tgec_cfg *cfg; - void __iomem *base_addr; - base_addr = params->base_addr; /* allocate memory for the UCC GETH data structure. */ tgec = kzalloc(sizeof(*tgec), GFP_KERNEL); if (!tgec) @@ -752,8 +750,8 @@ static struct fman_mac *tgec_config(struct fman_mac_params *params) set_dflts(cfg); - tgec->regs = base_addr; - tgec->addr = ENET_ADDR_TO_UINT64(params->addr); + tgec->regs = mac_dev->vaddr; + tgec->addr = ENET_ADDR_TO_UINT64(mac_dev->addr); tgec->max_speed = params->max_speed; tgec->mac_id = params->mac_id; tgec->exceptions = (TGEC_IMASK_MDIO_SCAN_EVENT | @@ -773,7 +771,7 @@ static struct fman_mac *tgec_config(struct fman_mac_params *params) TGEC_IMASK_RX_ALIGN_ER); tgec->exception_cb = params->exception_cb; tgec->event_cb = params->event_cb; - tgec->dev_id = params->dev_id; + tgec->dev_id = mac_dev; tgec->fm = params->fm; /* Save FMan revision */ @@ -803,7 +801,7 @@ int tgec_initialization(struct mac_device *mac_dev, mac_dev->enable = tgec_enable; mac_dev->disable = tgec_disable; - mac_dev->fman_mac = tgec_config(params); + mac_dev->fman_mac = tgec_config(mac_dev, params); if (!mac_dev->fman_mac) { err = -EINVAL; goto _return; diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index fb04c1f9cd3e..0f9e3e9e60c6 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -34,7 +34,6 @@ struct mac_priv_s { struct list_head mc_addr_list; struct platform_device *eth_dev; u16 speed; - u16 max_speed; }; struct mac_address { @@ -439,7 +438,7 @@ static int mac_probe(struct platform_device *_of_dev) mac_dev->phy_if = phy_if; priv->speed = phy2speed[mac_dev->phy_if]; - priv->max_speed = priv->speed; + params.max_speed = priv->speed; mac_dev->if_support = DTSEC_SUPPORTED; /* We don't support half-duplex in SGMII mode */ if (mac_dev->phy_if == PHY_INTERFACE_MODE_SGMII) @@ -447,7 +446,7 @@ static int mac_probe(struct platform_device *_of_dev) SUPPORTED_100baseT_Half); /* Gigabit support (no half-duplex) */ - if (priv->max_speed == 1000) + if (params.max_speed == 1000) mac_dev->if_support |= SUPPORTED_1000baseT_Full; /* The 10G interface only supports one mode */ @@ -457,16 +456,11 @@ static int mac_probe(struct platform_device *_of_dev) /* Get the rest of the PHY information */ mac_dev->phy_node = of_parse_phandle(mac_node, "phy-handle", 0); - params.base_addr = mac_dev->vaddr; - memcpy(¶ms.addr, mac_dev->addr, sizeof(mac_dev->addr)); - params.max_speed = priv->max_speed; - params.phy_if = mac_dev->phy_if; params.basex_if = false; params.mac_id = priv->cell_index; params.fm = (void *)priv->fman; params.exception_cb = mac_exception; params.event_cb = mac_exception; - params.dev_id = mac_dev; err = init(mac_dev, mac_node, ¶ms); if (err < 0) { From patchwork Thu Aug 18 16:16:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947404 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3ECFFC00140 for ; Thu, 18 Aug 2022 16:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344464AbiHRQUq (ORCPT ); Thu, 18 Aug 2022 12:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344713AbiHRQTc (ORCPT ); Thu, 18 Aug 2022 12:19:32 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3952FC0B47; Thu, 18 Aug 2022 09:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k/DS+VEstEQoxPp4N3KF6by9nijLpf10IlZBwxnJ1EJ5UMICBrHat1BZMts0m/sz9fqmeNipL9XanqFt2iF2xTXKIT8BN8H//besFiLJduoojhUKwVqi2tp3VNAoi5NPHgrWxLw/lPXZvyNfT2i1Qp4L419Pm4/aax8Jj0gDh+mzeEG/UrHxJmnPTba22UXt62irVnZQm0U3XGEiVWwQYtdqygx1AkC/mDrHmVCQJoNYq4QoTQoHNm0229izQLTyRWnbpuyodpXiT+Oxq7Eti25ZQ92LR4E0OXEw3jb+wYfGFJ9tpaQx0Htem/GeNRnC2OqiDq00z2g+10gCK3TzuA== 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=mo9Km00Er52i6dULb9Rb7HzPOzetPkenFipzAOcXWgc=; b=AgNRTlLPxP/5hTgqb1lDXULBOvQyrjEIKlu4IEix+L/FXfekT2XxtbJa3Y3n8Zsx79tTw5FgEYlIngntyCm22aHojdoF+RCT0VmPFOxeyXyCmYul4lvER+aai1hQNxf5oxph+QLOCecwYPboJwSDx/5cjJ2s/iRJkdWz5QrBZZhnhcFXLPX9Gqh65CiRZJyQ/2Y2Hy4EmyQ96PdB6fxR0O1wAdJ0Q86pFXABW3SR6xeyYpRre1Rwj2izTLOdryzMlAtMEGkwuPC14Ck4RVOFSb7xCckFFQpskSb/4xdWZ0j83WpXNxBdAF4g5OHZ5hmfG1quGXhRrI+lmwoMEjm80w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mo9Km00Er52i6dULb9Rb7HzPOzetPkenFipzAOcXWgc=; b=Aq1OXHbLRgyLkimv5LNY6D+LNazbzWH1jpyZvTP78DEQElFqyXrCuDdH5UrWbOirh5ICBmtgexs0RrstgrPVKZgol2qLXZprsezTVjfcMoMto4H7+m0eAoS3y8L9DtgkGvXXo804p+Si+vsqS8bvK5zug6yIRLf8enbgiIvhWPFPPCHURNQmwOUmXfuQbnywRLRDNVWlWpAJX/veq8DUzchY4tq5HItC8RT/KXf4y4Yyiohxu6vxuUbijov3zYk4vpTw2XpKy5QMCFghEW4QPnA/GJgShGQicg8g5J+vDNUiwvUR00yAdMDBtf8RlgVGtVj6ik360V/jl9cDFA2qbQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:35 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:35 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 19/25] net: fman: Specify type of mac_dev for exception_cb Date: Thu, 18 Aug 2022 12:16:43 -0400 Message-Id: <20220818161649.2058728-20-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 570372af-d5fb-48f2-1329-08da81352988 X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 43IlgqG3mR1JHIJI9JOfLG7tcrd3UdDGFNKDcJ9Cm9NrWa3m18HT/g+YJ+Vmg0H+ye63q787G8f5eljZpd3pqw/VRSSBBKa7ZnRe5Fw8u5sFJLg4xlPXZQiv+GrsUBLRL6lQWK2XedP7XCHqjbJrYj0SFOWy3uE7O0LRwAXXBtwebFbyyvCW7Z8VRRSTAeIB75bEBT+mu2HM8sRQNRs4NgeZEIcgT28D+LNXyoe02HT9gl3iinLlq2640YX6Hfokaj+lBO88rdzNZu2kPjc9VHt8G+4DhcoPQdyk+RIyy5DY9XICf+rg5FGaxZXvo4wbu7g/YfeVWZ1bCchpzEWrfD4Jq7KoqhkM+BASSNTLwEiUFhVgs6C8P4PltN15sE/d238/uVK3pVypl4XYwbTxJ4WcbVLasLsWEirtGPOPtKu8vHkEPvHwA7gEJL3npAE02sWktUZNr58DB76vusyTpos9YHJF24C6zQ+iZJXT/VQzjyvgjOvHDkfdnvqwGj4R9OJ1qxlV8+Wdf/rFkGkahAlOVW1a8Ul/TWV2swCn8bko3/B2hUnaZ3TwkJ9SqxahXoTOt9+R3UxRlMldVFg0SyC2ezo9KtN2vMl599DqC8xAA7JkGgWdeLJlVzS/o7NgXKzHR8vNAnk17ajHlKgam0s1LqoGoNWukMJjGrUJApKlNrq2uWZEw1uMsuJz/5crZntzvjwUIMXWfqUrwqiTeMn68Gr2RgD6TXTyVsBKH5gqsbzvIeobScOFMrxWFn131v8bt0EGQksPHiroLpXDVA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(2906002)(36756003)(6506007)(186003)(86362001)(107886003)(26005)(1076003)(6666004)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TbaU7CXUwA/a+UWHBW/YsWiJWZ1VOa7a108GYiYyspiOG9i13v0u4DJ1ijBpGGun9rOpSGaf7aZFJX7NPiQSa21Jb+HWiww7MHsMBjIjj9lN6fgbZcZSqLMyNDO/WPJVc1WWd2g61MWD7Muz/2xhiPIbrB513aeKrzYF4/KX5QRBfTg7El89/dwXrDi0w7lJMqNrYm+tj2kw6joopNdIGg8CNNECvMCodZJMIw5wXBFdN3+msErGXB4mncoapzpG593gkkegXfsuAiHF38HFXTQ9a1vDYGy8m+qZP0Vs7bkPuvlVNW5rH09QnEhp+48/JfMIPwH5drpVjzPqx+h6qNUE/BQFwr23IWFqdkCAst9nO1IWa/kwHmmYjieXan6Lj8UTS4PA6Q6HqyzLJ7AQxCYVl5MMeTyT+KWqINNIpUXbUyYjkUurkxHCggEmMTCslfOr3VhOlpN1eBD79pvHUBGxOP/zWyh0r9h6TEjCl9TOyyutxk7TXjpsFYUjHlKzW/xeJotvZEoscJCkKxAcGKD2cp1xuuyi4C1TZb7LMcTZ/E9QrsBuQ101nEikq5Llm6dK3zUw1Qs5Itqv6Ndp49QZNFG3QgXZzFPMxKBdTT5QXzD/T+We68+YReL9aZnX6uDwpgiNusDXMHP7k7YKfOOcUVO/ryMN9TTHqlYSb9Ji3iOcmSsqihNKfxjq8odgK3OBuHWUephM3pviQUHjUKOVbHy+yu1VJY1T3Bt3BYzyPkyZdyagJdVzV8HZb4QXpHHH0h502FDeWHTid8uI9waTu5w6/bdTl7IHj15Sw8u5T5ptmQYg5YgRYtwcYHd3SSsn6GaaLqz2ko1ElLHB+Loh28ib0W4USi/X9v9QY7Z01E8mBs8xVYI/P+6xk5YQ2IioJB86VmTiKLfDSSraKNJ53jqTKe/V2TLsEgMlGut0jT8jbklghJYk8D7SBmCltFUFy8dIgeQyEcCNnQ2hd94BF8Jtly7pLZiaj2W8VcFiM3lXNSXnf1UzNja8mP1PRhg9toclrxMHP+vOVDuErg7NEzoP04Un+MFuodj2mKx3vvEqpHcIGtPjjLxbnjE/TsQyQ9vxGv54FHRk49t20g1nOlRJgBLzIexkdqgRa4RRIEKg2sfrO+uy3ANgL0lr34KNJT76ZVBYnlj/QEvApZhAPa1gMwfd6dgceLByEGVF506g+Z+hAtZEw3NDY3bZAiF1u9shkVyX90EHg78+/euWQAH5Wfs+m8HVr7l/3oNkN9InORl5OboJTDyfGnf8b6YnfqcB5PXEWQbUFz6Qlx2YOYh1jT3t5L+GRVzzj16+ALEZZlGt0lwyp94tWsQkZGDcHa8QXyg9SI22+g11UYbcl8JyquDwIWNSh/xNVN/st6J1mw+nH0THrxFcGtjJ26iW1Ts52Wnd1o+yr9FC5RtFNyJdTDmqJyD2SG5yl+gCNlOlG9jVLHdJqcDrU96q23YmZD/7mYu8C8aqPTCl5+AkhnQ8UF0F2Hfn8Jvs+fYY3WlJRBLPUi7NYwzLmC1qYjY1egrdZznwKbLpf4Bd5IImwx0xsZus9/9OYEoNHRc2EpaRZYych4kfaLSColujC5zu2IfyoVY7gW16Ezx0JQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 570372af-d5fb-48f2-1329-08da81352988 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:35.8098 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ocFdgsPacvau76NhcMBGHir4emMqx7N0DJqGuhKVNGNZdSFMvf01VzNt92Pgut8j/XKxD8Y9iCDMIPSdEOurrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Instead of using a void pointer for mac_dev, specify its type explicitly. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v2) Changes in v2: - New drivers/net/ethernet/freescale/fman/fman_dtsec.c | 2 +- drivers/net/ethernet/freescale/fman/fman_mac.h | 5 +++-- drivers/net/ethernet/freescale/fman/fman_memac.c | 2 +- drivers/net/ethernet/freescale/fman/fman_tgec.c | 2 +- drivers/net/ethernet/freescale/fman/mac.c | 5 ++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 09ad1117005a..7acd57424034 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -301,7 +301,7 @@ struct fman_mac { /* Ethernet physical interface */ phy_interface_t phy_if; u16 max_speed; - void *dev_id; /* device cookie used by the exception cbs */ + struct mac_device *dev_id; /* device cookie used by the exception cbs */ fman_mac_exception_cb *exception_cb; fman_mac_exception_cb *event_cb; /* Number of individual addresses in registers for this station */ diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h index 730aae7fed13..65887a3160d7 100644 --- a/drivers/net/ethernet/freescale/fman/fman_mac.h +++ b/drivers/net/ethernet/freescale/fman/fman_mac.h @@ -41,6 +41,7 @@ #include struct fman_mac; +struct mac_device; /* Ethernet Address */ typedef u8 enet_addr_t[ETH_ALEN]; @@ -158,8 +159,8 @@ struct eth_hash_entry { struct list_head node; }; -typedef void (fman_mac_exception_cb)(void *dev_id, - enum fman_mac_exceptions exceptions); +typedef void (fman_mac_exception_cb)(struct mac_device *dev_id, + enum fman_mac_exceptions exceptions); /* FMan MAC config input */ struct fman_mac_params { diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 2f3050df5ab9..19619af99f9c 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -311,7 +311,7 @@ struct fman_mac { /* Ethernet physical interface */ phy_interface_t phy_if; u16 max_speed; - void *dev_id; /* device cookie used by the exception cbs */ + struct mac_device *dev_id; /* device cookie used by the exception cbs */ fman_mac_exception_cb *exception_cb; fman_mac_exception_cb *event_cb; /* Pointer to driver's global address hash table */ diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 2642a4c27292..010c0e0b57d7 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -180,7 +180,7 @@ struct fman_mac { /* MAC address of device; */ u64 addr; u16 max_speed; - void *dev_id; /* device cookie used by the exception cbs */ + struct mac_device *dev_id; /* device cookie used by the exception cbs */ fman_mac_exception_cb *exception_cb; fman_mac_exception_cb *event_cb; /* pointer to driver's global address hash table */ diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 0f9e3e9e60c6..66a3742a862b 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -41,10 +41,9 @@ struct mac_address { struct list_head list; }; -static void mac_exception(void *handle, enum fman_mac_exceptions ex) +static void mac_exception(struct mac_device *mac_dev, + enum fman_mac_exceptions ex) { - struct mac_device *mac_dev = handle; - if (ex == FM_MAC_EX_10G_RX_FIFO_OVFL) { /* don't flag RX FIFO after the first */ mac_dev->set_exception(mac_dev->fman_mac, From patchwork Thu Aug 18 16:16:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947405 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90D34C3F6B0 for ; Thu, 18 Aug 2022 16:20:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344617AbiHRQUs (ORCPT ); Thu, 18 Aug 2022 12:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344733AbiHRQT6 (ORCPT ); Thu, 18 Aug 2022 12:19:58 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150082.outbound.protection.outlook.com [40.107.15.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45A78C3F71; Thu, 18 Aug 2022 09:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A4w55kNqjeik88HgVMYkmpIuOZsjbZftcznLqqbGQN678TEGnn0+frS8SHSIy5ruX8feG20gqIyndmKtVwESHBWqVf0ToiaFnkQUyYffpuVBaEw1nsQf1IO/mXwO7Ky92DFo3PIlLcJEjulWW9IK798a7bIFDy9fr+YHX7R50wgLvHzpe0lPv3xP4yNsWFIPkgnlDOlpLkXtyOLE6GVGze/YIlpoF4RD56m4b6eKy0IvESAMjSyW4XfvHJ0++kTRwRtpRuRo3iwtNBwC9SXZ7rnlTx/AHxJanGMd6SCoa3WOFRI1xXHpT8RvBs0Ni1hH96lbqvUVVHN10sBnt/dioA== 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=F39VOWHdbomM6yNOWWJ7eMkODFt7MS7bR17qY8C8kTQ=; b=JLQqN0NcZCZQbHUh/sLzBM0M0zI9RR53bP5NcvR5NPlKItWKBoBciilmYBUENhW62sM84c+VuZ4xMRiHPgVDxY3Ez1OjRBHU4Y1rUnJWnX8FWDjzJbGk+C3ycbNws+LMeWVRD6t7lAKjJaUs9Xpfei6w6HTXYWASGiNvDBLKMjz/+oHow9AaOvOiwaW6PF9yw9xtahdI6FCtfNO7jo10Wi0mi6J2idWB8ftgMZRO9MS1CJD4QOsWbBbzHRCF8jVfIDF6yMGVtr6HumoD9kbnx1Dk/lTzKNBoASGGTSkJTJGQc/WgFC2xSxg+/aH5Gmx+i3xk75NJ4c5uhTW9PyXzkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F39VOWHdbomM6yNOWWJ7eMkODFt7MS7bR17qY8C8kTQ=; b=0p5mqzwpPBXQ4SS8miLYY3eCyv6shh4+UnFNIbhklbcLCDg1rYARwwQRqVEK3V4BhgNLUgEHyq9TMUK/XRAwJVpaOIuexe14rU8lnknS6q2e5kjd1mrNPI81ffrGcgSJfR50JDi/49++6lHIAultfwFfD3pKf+cSsPg3GyzHGV4wcX1eGkNgxca2q9aweuyP3cOW7FJEohyEozgov3RqtjA62oX/ElkE7hVSg373xqrSyryEqDH/HKMclFjGrCfiw79CwwqsgTpUUEWrdfc74Q7B4JGIvdRCOJ7wN46ouax5fBZPnfxxaAyP3MG6Vvq/UvRK7dYy9OW8ma1dhf9/aA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:37 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:37 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 20/25] net: fman: Clean up error handling Date: Thu, 18 Aug 2022 12:16:44 -0400 Message-Id: <20220818161649.2058728-21-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2e4fe0a-df80-4e10-de74-08da81352a59 X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /yXVOXKADuWAsmSsmXZgw4nr43H+NvmRuytgne7rhsYT1RcrUvmFYaPnjcJTJVdvLvqAt5JUek9eIYNFLWkj6g11LRhOaEirG1x9mkI3mh8MJRAib8LjvfI8tp9p3UVEsOLe4f5I7UL0KyVyV55O6XXFxkD5d1s1Qk+m6XcALzW3Qw3V2UPP0sZQiHiOuEGaOt6TI2CyoJ0VHQIZWvJDOlYHHpjrqwbnSpciprcW5ifq+Ps1s1CadQwLLl6KFHiJsZHnSW4AhugqGDxkUKfvdmPpKEtMFzosCWbVNXULLdlXmRRq2DruwSCPlhOiR8WOa6H9qr1rTOr25c/yZV0OQSEhXmkZBqSf4Pw/BMSAIAP6yUsypO1rXr3HYElT8p05LgTD78B06wHHRL8xgLVlVR9jr1kTXAngh/UWKgROuTD4RzxxSVPFNDTjJfPYB5hqmXvlr+V/ndy90IxYHofWgFwSSc+HOkaqSFDm96qxiwa3P2Iy8ZsuaBRNLVVPmYOxnnGkKT0pMSuscA0TD4Gd5sEhQi1rDh3oWhfvpxlUpdgqSg/NCjZoEomnjpX3imC9QXko56Pj/8So0imVdPjcM6+N4Kk82ADyxFOP1Fm6tfGiEU0OJ8MzXptNbYEXEmVNXIYT7/uW1deYifkwOEcUUikxn7/gb9zD0CiBC3xj4WcUCUeto/TE6CUkHlXKIpjihy36/z8y5R9UfWyKnSDUkvNh29WVF6gox14VgSAKUr7G1rIvw/9FbqJcEpEEuGlN+AFmcG+0vXrAyUXf67X5/A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(2906002)(36756003)(6506007)(186003)(86362001)(107886003)(26005)(1076003)(6666004)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: f2r/OW356i1NL9ALG+IERHr78W4buFJ7WLhV9IkzBY7hhJiRTun/oH+/yt1anR9rlS2oqjL+ctXjtoe30a+K+c1oiQoZg1sAzG14fBxbPO3tTig3pKJbN7mCVGs+LS5Y2MpjYcgrKwmbgsEsTYTETC1ciq23tMGPfW6Kt0EiAJe3Wl4uGU39qMtmkABd69uqOp2I71fJk8Drs64xtfWRmH7UKRhqTVADdyzqPE0i6Jyftk1jBbXWkYryXEpqJPxdCThNxcVVoU5qlG7I9pYholDP6/48u+rCsSEYkMYzomxVQoe114CeApOeWJlsPqOiQqrN972FugAbs3DEbGVl3H219uJvBjHj+oMM3HllY6hxRC9rL4au6pMAsTjtb0/uyeBdK9cQZ+ABcYEU3w7ScV5b+MIcopaC3m628Jt0bYrty5jvs4ySRKcmECsFwi/9Ouc+Tpzd2KerygFBOTFNwHF0XD1cJeqzOputBcEZo+MEGT2qLPA3X4zPJA8xRLfw8QG1p2JvU/m3IaRC+xCQI0PX4aMhy7JAFBKW66wThZT0nQlGkSAfV18oz6dS1N+xKS7CNfYVjejv6n+XJ4BbLRLUL5mqll4vQg1O444597bsATzJhKUtNFzVyc/wugIByyfEaV4TXrHFzhla9k0tL0BjBwA/7jkjplHypXAq2i0KAJN6cNop2Yk7qdoXhM5RXJrou4YYcwfMcWpE8m4WNVCs0t7QnJ358ZRw+81QaFBws7d8Tf0kMG2TAeRYkteIjjc+H8CQFAhdz+JJFQKqeSA0vA9kkR80/LWUC9hLUAjcGzl/C74E/sP8nVu2bdYB11dSf6ozHckWV310aD3Nv6PBlrW2CJBMzBo4KpLuZu9VJaPv9LfRmAa4p1G5FGFIeFZISr8p/8qikU9WP+Z3y+ln1SDASUEyplgOC7EYdfETYzsS9kXxrAwBVwNDlgVMkLnS5WwBmKSqBWNp5xhn5MN4CSuxEX0eBZIKoY+0m0Fvg/rZia7jEyfUoU147absq7briNMDW3Bmenmttd6xzwntAMTjr8iyFINhB1myd6WA+waTzbCW765vfsHgWThWeqsBdSmY15FBlLvVIQsFv3lzNmvvRkA+q41T57PTe4h24OQxDNTbyyT4jLDur8ZZBKQbUZFJhueGYlfiBLD0YvPL11ZMSloSi9ur6Rbv56X8itNjHAttqi0Qj5xwv2qv2yEtjErMBexPqfIbQ8K3tPxFqPtt34v3T3Ttw+QQqPD4fC8HOjGAkvh+3ofcLAYk/CxZp7/d3BvDL0rARuqbL2KnJRwi0rJaXmrg7iuo81GPM7K9ehbKz5zeqAocfzMsduTQeJn1J+RnlHdsRXWvT4H4M+TfZXCeRiYRbQwh5lqWWsbcW+Bp8OtM2fiCEBcH1FyOQcUrtAn5VtV/p8qeHMNP9B3kL2vxnhNyosyT62cNuE6KSh6lsSLmOjhGQvj/5ViFgVXA4ZBvWHZmqMokyHsB1E5cWWzNB7fJttu/8UPVzTtbjuzxFERDc83Bir0ZWhxJPnR5ETj4TBfXdy6ppOETENghWwmy2hfwb8Jpc19wxh5s256HIRhbzMj0rA136/sD26SICX6UInNbiTKYMg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2e4fe0a-df80-4e10-de74-08da81352a59 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:37.1847 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A/8EWccXJT1LcQletAebKG+o/d4QAVzcDdLjFlQdW2vzB6i7YFwRUykSfUtDTopGhcGX6Xkxa4zmI4a10/L2LQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This removes the _return label, since something like err = -EFOO; goto _return; can be replaced by the briefer return -EFOO; Additionally, this skips going to _return_of_node_put when dev_node has already been put (preventing a double put). Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/mac.c | 43 ++++++++--------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c index 66a3742a862b..7b7526fd7da3 100644 --- a/drivers/net/ethernet/freescale/fman/mac.c +++ b/drivers/net/ethernet/freescale/fman/mac.c @@ -291,15 +291,11 @@ static int mac_probe(struct platform_device *_of_dev) init = of_device_get_match_data(dev); mac_dev = devm_kzalloc(dev, sizeof(*mac_dev), GFP_KERNEL); - if (!mac_dev) { - err = -ENOMEM; - goto _return; - } + if (!mac_dev) + return -ENOMEM; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); - if (!priv) { - err = -ENOMEM; - goto _return; - } + if (!priv) + return -ENOMEM; /* Save private information */ mac_dev->priv = priv; @@ -312,8 +308,7 @@ static int mac_probe(struct platform_device *_of_dev) if (!dev_node) { dev_err(dev, "of_get_parent(%pOF) failed\n", mac_node); - err = -EINVAL; - goto _return_of_node_put; + return -EINVAL; } of_dev = of_find_device_by_node(dev_node); @@ -352,28 +347,24 @@ static int mac_probe(struct platform_device *_of_dev) err = devm_request_resource(dev, fman_get_mem_region(priv->fman), res); if (err) { dev_err_probe(dev, err, "could not request resource\n"); - goto _return_of_node_put; + return err; } mac_dev->vaddr = devm_ioremap(dev, res->start, resource_size(res)); if (!mac_dev->vaddr) { dev_err(dev, "devm_ioremap() failed\n"); - err = -EIO; - goto _return_of_node_put; + return -EIO; } mac_dev->vaddr_end = mac_dev->vaddr + resource_size(res); - if (!of_device_is_available(mac_node)) { - err = -ENODEV; - goto _return_of_node_put; - } + if (!of_device_is_available(mac_node)) + return -ENODEV; /* Get the cell-index */ err = of_property_read_u32(mac_node, "cell-index", &val); if (err) { dev_err(dev, "failed to read cell-index for %pOF\n", mac_node); - err = -EINVAL; - goto _return_of_node_put; + return -EINVAL; } priv->cell_index = (u8)val; @@ -387,15 +378,13 @@ static int mac_probe(struct platform_device *_of_dev) if (unlikely(nph < 0)) { dev_err(dev, "of_count_phandle_with_args(%pOF, fsl,fman-ports) failed\n", mac_node); - err = nph; - goto _return_of_node_put; + return nph; } if (nph != ARRAY_SIZE(mac_dev->port)) { dev_err(dev, "Not supported number of fman-ports handles of mac node %pOF from device tree\n", mac_node); - err = -EINVAL; - goto _return_of_node_put; + return -EINVAL; } for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { @@ -404,8 +393,7 @@ static int mac_probe(struct platform_device *_of_dev) if (!dev_node) { dev_err(dev, "of_parse_phandle(%pOF, fsl,fman-ports) failed\n", mac_node); - err = -EINVAL; - goto _return_of_node_put; + return -EINVAL; } of_dev = of_find_device_by_node(dev_node); @@ -465,7 +453,7 @@ static int mac_probe(struct platform_device *_of_dev) if (err < 0) { dev_err(dev, "mac_dev->init() = %d\n", err); of_node_put(mac_dev->phy_node); - goto _return_of_node_put; + return err; } /* pause frame autonegotiation enabled */ @@ -492,11 +480,10 @@ static int mac_probe(struct platform_device *_of_dev) priv->eth_dev = NULL; } - goto _return; + return err; _return_of_node_put: of_node_put(dev_node); -_return: return err; } From patchwork Thu Aug 18 16:16:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947407 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 149B0C00140 for ; Thu, 18 Aug 2022 16:20:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344636AbiHRQUy (ORCPT ); Thu, 18 Aug 2022 12:20:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344630AbiHRQUC (ORCPT ); Thu, 18 Aug 2022 12:20:02 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45935C3F69; Thu, 18 Aug 2022 09:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NE9kLZKmfjJIzgr14wPbJKywyblA4fDXvaCcFuBmNbk28/Wji/ljC6VLqJORTH84aql7QzSa5MtaKBW1va/pzlFM7UHGobN7T+bs8bVz7oMBGkNiXkJA9UMuBj294FURJlyV1TppBk2aZ1QBNKV5b2cSn41YyD9T1s7J6cSII7jUBaSvydkY32OHeCwXpZ6Mqkr83svuQQjipsdwqYcvlHgeyH9VX2xFBsSX4LwyiOT942Y5sRyZlhirTYGlWIocujDaImbYbwt8e7Ysj5fqkWn4q8ScyItM2Db38u9nYQGgV41/q9n/GtcL9qEZLacTERtG2mT/mWCKZEtA4DElnQ== 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=TW+mOa9KQRFDSI0Zt1Tw4dlfvjcTJC4gg2BjqexxeaM=; b=DNTjZ9NUgyFchzD+cYH7sJoZd6FEtuPMbJB3H8EBMPtUMPbPq7k04ye7p1reLDF2qGC9anLk+gjyudGVn5WM53b6I1cq3UNV+RKQ1BMOf/iXcZzhYq1Uh2MKDENxIwWSvQTNF/UOGMn1hok/eK8qnwXrYsEFXYQvper6P5QWi0MKlc14+RIKt24sTQ+ycn4Te7mw/JVdYdsmvyw1kWYobIBV8MzoqQpRMrKsR5s+K2MzZdptuy5HuCxeepPO4xn40SdlkUQ4PUgdjnpdvxOSivbJlWd84bfKFg/vTiaW8a+0aKsuUSErQa9p31byYhuQF8XmfYqD9Jsm0xqQAsdOFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TW+mOa9KQRFDSI0Zt1Tw4dlfvjcTJC4gg2BjqexxeaM=; b=I4sPSMrEjPVFp8Rcwme2lcCU1GFT8hn/jdaaYWIrf0lRryxJJWLL2a/AemPNPsLLHsr5a5pa/6rtBg6uV0GDtoiN++UaDXsdPlCHRrCV3LyhFv0wIdXFyHmaOgUWStDG9ipxo5XKxkk00ci2F/M71pu5J3Gf5519ohXD/nOEXRPGzoqcwi+TBlq+X/jBBdMjMc1RjwA5cVi0+dFXPdMcp8BlgMZDDslMMuoIheBPI3wR4LqWUScEtkk0XEPzl3UIyjUYlMRiQ4YMYKwDOwqGhMeFOoQX6Cb/bRns/x5XV8wprEYXBdXustW+Louf1OwIU/9ywuEmdJzv75gHIHQ3lQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:38 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:38 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 21/25] net: fman: Change return type of disable to void Date: Thu, 18 Aug 2022 12:16:45 -0400 Message-Id: <20220818161649.2058728-22-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 07b86fc7-b423-4dae-6e63-08da81352b30 X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D0M0nEQFUnY9rXBYI0tPuDQ5EW6HBf+BfUekiYaTqKY9BwTMSwwCIaUi6Vs2Yl9+0EpQlkbJVzts8y6+HwF7MtZOlnmQ/XM8AQdZ4Qjfwoth15r0gxSE4wnpE1OGbM5oXvdedAaDjxRhedMv+cKCKeN6a/rdqnyLF48BLRpQgn3+PKl7iRsjneh8ctOYwr9FqBZ/EHolHMeUqOMXSOCPdzUWK70HKoEEDDn/FeBhhxXdCXRPNbCqvOlPpxCbs3NBlMv9sUiuzcFpSlE6w1jYVRLm/HAIvf1Ipuz15MjqyEiTQSQzvo+v8exRE2DKdNL+0nrnDdf/xfpbnd5VveuJwHnJKW/USaxFoiUcaCswbuMCGB3CzvrRVDF4i3BXTugAEd1UuELcAS1wga108TVK+hq6o+jvoWOdyukw2zeV4QJQmGpFxWriSeyA3uXWG8FmDF0QHEKpEhtTe6d5YR6+wCYQWsVt9KjgNqC9nfJiHlPfgILWzmoM1OxAK2In62sovjOz7bCnDE6g3ogWy24alaroga8yB5n2ZOePGlnW4Sa1azEDUWd/MVw2kKBoJm/5Dafy3QZchtpeignG8qDehMHPxsOExSX4LFgtSTxrcU6HOqoBGdBfylh/EZYUsj0NHGaSdtTauLsiWQHT+GM8KFY0SE2de9a/0tOskvOYARg4CXuqGJfQ2yIgsREVj8btqw3gIHMrTRaJBCM4ulsdQ7BYxOsi+ielGLH7refWszv7Rb0BmXL+5IfnmC4ZmPEp X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(2906002)(36756003)(6506007)(186003)(86362001)(107886003)(26005)(1076003)(6666004)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dhXDA2+xhwe/XRSkZAX48WRO136uZdeOlEMvTD2rHagvXE7CUYUyVus63yfDrrfwdDyUZ+9K2YgfBDu56F3uO8XYUA+dAVGMrvDe/XU0jnI1ZjYSNKme939/Q9fQMozLl8fghqgA2KerK3lNnZpCebr+FngwaHuInY+wcTgcem1Y8/qRDA+OEm4DgbiiBCz4aqiWppK0QNlluXrUqiY7yqckdYGZ0v3G29rgTrrW81t6Fmun5iSJE/6T8T47cIvKs+cbaHCah4VdIsROg+roaBSlab5MwJ3lVJ4Yb83gXobulg9mSkF+NrHvss+VeOE/NIh2aoNiQsqUmInwGRgOWt1Xxnkd5XnUSZcK1ik/4X+6Cg3RB9GnPJ+5tOuZhN3f1Fw8aPS3bG6WmlsKjNKH7RqMeIIiP7V8Fhtrb95N+pK/POt/lyKSnBedoaK17ML+ZRaHrZz4o9jNdrbgyqeMY0ATfTkjEnZABFFX6BfBr4meV/XA+aI7p53DjBcbP2qwrJnpimW7cU3SQNiXYj79OLP08dOGZ0gUeWryJfv8Sjs2b/4SPqmotYoEhftRFbKe2Yb4M5xCpZKr5DtdhvMBvE+WeuQ4BEioNZe3fitCIwy53WXtYJKcV0Y2xAYCLxqtSp/lPdAzeKMcxdKAaBMqQb8GTIfd4BB0UEOjjTDddLwAYDpLoaiZ3tq0k1ZlOFfiBw0F8wVBP/DwTsQJ22ncEPn25IYGZaG+EK+8Y754ZMc8OjPU9uD1xYafx0kftNP3qisxXKEikWW/XREv75t+N0Z6SfX3z9vhzB9WZNIf5cUac2cZhJeNEW5UPfzu4954fRdZkUyZsIq2QVdHb3gkogJrwqRjH71lcVJ958B2DTjTGrY9Xdn30DUUE0KgUWJmUzxdkJY4eYOnG35NndsWirsgcWAOFbD06malmw//uc60MB3xFKPeWVmeIl3FjsncVNn5eN5CO08LSTT67+HCoU0pBL7tjgYKIXYtX5TWyCoQ+XcVe6OEIBfPpyJZVb/lcUjkR+Yl/lKgERsydY+dElK8PJZTp3ttO6OlyK3apidcJPwlpdndKH+SQmD2p23CsRuPIXnQY2ufqjuOQdHPfBpHgK5AOvk3KvTGCOD/RMKip/oJXZk7bCPUbLV8RYBelgZjrMyA45Lwdl7kasuzTzIPrTjUldiw1HZqME0JtM6ReT8ZWWV/2YKqVtO7Jj5E4QSXMvXn485dmmHYw7VsyXiBXdio5FFIi5s88tHwDBHeRQdDoRV5m7Ho5GQYoBv1oLaVR8Zw/j9MBURDAAn8oUx+n6FQ48QOzRjQwByv0mz+wyly2NRXkTCXaeSjSe4a6QfNV/W/5/Nl53xtHlY5g/cu+O5EyP4uyzjISkzJe9xsa05f3P7rhfxarPK8sFEAo3Vkxkm8Hz3PbfxA7MEhCaAJJqn207gr7WVqCz7GaDb09yVzraxnHuzwlMNr/W3n1wVf2O0LY4p/bP4BSmAjyfSZ9jygJn2AlF9TPHxhjIjMSJ08q9wsrz53cXz68d5bfIkWQs5tdMZo1bwL22c93B03az4WVkzNOIrlAyX92dXF+b/lBOgepnwkiFyRTfIFzqVizlXMOD8Cdmv2ifTzLg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07b86fc7-b423-4dae-6e63-08da81352b30 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:38.5909 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LTuY7IT41Pm99P0TnLN5Hue6Q7DpfjXtptc+EVcPXtsyUyaDuL47mg8j+44AuVJIK/j5jZsj9F5je1bTBeHS7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org When disabling, there is nothing we can do about errors. In fact, the only error which can occur is misuse of the API. Just warn in the mac driver instead. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 5 +---- drivers/net/ethernet/freescale/fman/fman_dtsec.c | 7 ++----- drivers/net/ethernet/freescale/fman/fman_memac.c | 8 +++----- drivers/net/ethernet/freescale/fman/fman_tgec.c | 7 ++----- drivers/net/ethernet/freescale/fman/mac.h | 2 +- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index d443d53c4504..0ea29f83d0e4 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -290,10 +290,7 @@ static int dpaa_stop(struct net_device *net_dev) if (mac_dev->phy_dev) phy_stop(mac_dev->phy_dev); - err = mac_dev->disable(mac_dev->fman_mac); - if (err < 0) - netif_err(priv, ifdown, net_dev, "mac_dev->disable() = %d\n", - err); + mac_dev->disable(mac_dev->fman_mac); for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { error = fman_port_disable(mac_dev->port[i]); diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 7acd57424034..f2dd07b714ea 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -871,13 +871,12 @@ static int dtsec_enable(struct fman_mac *dtsec) return 0; } -static int dtsec_disable(struct fman_mac *dtsec) +static void dtsec_disable(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; - if (!is_init_done(dtsec->dtsec_drv_param)) - return -EINVAL; + WARN_ON_ONCE(!is_init_done(dtsec->dtsec_drv_param)); /* Graceful stop - Assert the graceful Rx/Tx stop bit */ graceful_stop(dtsec); @@ -885,8 +884,6 @@ static int dtsec_disable(struct fman_mac *dtsec) tmp = ioread32be(®s->maccfg1); tmp &= ~(MACCFG1_RX_EN | MACCFG1_TX_EN); iowrite32be(tmp, ®s->maccfg1); - - return 0; } static int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 19619af99f9c..8ad93a4c0c21 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -701,19 +701,17 @@ static int memac_enable(struct fman_mac *memac) return 0; } -static int memac_disable(struct fman_mac *memac) +static void memac_disable(struct fman_mac *memac) + { struct memac_regs __iomem *regs = memac->regs; u32 tmp; - if (!is_init_done(memac->memac_drv_param)) - return -EINVAL; + WARN_ON_ONCE(!is_init_done(memac->memac_drv_param)); tmp = ioread32be(®s->command_config); tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN); iowrite32be(tmp, ®s->command_config); - - return 0; } static int memac_set_promiscuous(struct fman_mac *memac, bool new_val) diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index 010c0e0b57d7..f4cdf0cf7c32 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -408,19 +408,16 @@ static int tgec_enable(struct fman_mac *tgec) return 0; } -static int tgec_disable(struct fman_mac *tgec) +static void tgec_disable(struct fman_mac *tgec) { struct tgec_regs __iomem *regs = tgec->regs; u32 tmp; - if (!is_init_done(tgec->cfg)) - return -EINVAL; + WARN_ON_ONCE(!is_init_done(tgec->cfg)); tmp = ioread32be(®s->command_config); tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN); iowrite32be(tmp, ®s->command_config); - - return 0; } static int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val) diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index c5fb4d46210f..a55efcb7998c 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -38,7 +38,7 @@ struct mac_device { bool allmulti; int (*enable)(struct fman_mac *mac_dev); - int (*disable)(struct fman_mac *mac_dev); + void (*disable)(struct fman_mac *mac_dev); void (*adjust_link)(struct mac_device *mac_dev); int (*set_promisc)(struct fman_mac *mac_dev, bool enable); int (*change_addr)(struct fman_mac *mac_dev, const enet_addr_t *enet_addr); From patchwork Thu Aug 18 16:16:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947406 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B6EEC32772 for ; Thu, 18 Aug 2022 16:20:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344698AbiHRQUt (ORCPT ); Thu, 18 Aug 2022 12:20:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344742AbiHRQUD (ORCPT ); Thu, 18 Aug 2022 12:20:03 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150082.outbound.protection.outlook.com [40.107.15.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98496C482F; Thu, 18 Aug 2022 09:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bb9QTH2f0OMa7m6b2X3D0ijNVq70hcMYrbQ2R3n7skEtr0/SwPW+qEdxBbuVI4BQg1v67DN0aVRGDtM6eLttM47wkCw9RlC8QSAV2j5KkdbbxYere9biTsUnzUXUGH3TBTFlWulVBibxdEh8Pg8r3omfAJIVIlTccUhDdYQQxmzhl2BEPJGJDb9kbyFHHBqLL9Xl+R4cqbUUDObf3RWJ4+QFlv+E8X4RtaTom46pwy6gOxA8Mu5F/J6JlPSH8hHe83S/izZ1LEHPKhd3Stbv5ei8i3AHaI8Hp0nqWIvPe6gbb0YDBQvkqJpdhXREA0Of52t2kNu4x9sZILPwlZfsPg== 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=vWM3q3R1Y8E6SXV9dJvf6zSZ3NqhIdokyA4glzZABBk=; b=dkmVVwQ2dQ+S9awJcTNgARSFl3UqH9ei/DgJ7z+FiK1DV5TiI+bw/SYb/d+9MrVLSERsx55fePEAoYe74ddNIXB/EW0GrIJl+dlW6Pa0cmPyqszLKMTbzguu4Jal5phemUBBbRJSwAOagI4X3hhiTQNxHhZSvvKNtqpZgJpddh15RZlupGmgTb1rEibLCdlBveTr20i3kenqXr9ZvSx2A8oFAZuOwOvRCo6GzJpXkR2dis1o2cdlG/KaKhlAMy9AB22IKLruT0d0BqquQ4WNzMFhfw4dEw/4xy+3HoFOsn2hav6iRI2bxBIInM3MGbGLPCe9gXuSurl4xmdLKeKCIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vWM3q3R1Y8E6SXV9dJvf6zSZ3NqhIdokyA4glzZABBk=; b=I3dhJlgHtuAAdm1EGAuJ5HkSSDT2pkI2XzdncFcIVgT2p6cT4kTzrP/N/UKrim6HvztTs6dWU+ZLVPa+2/Wat5wZ12GLenReRMxeUnIE6VL8JARYbV23A1uWZUqFTnEeJy6Yty1Lhw/L27CZ5ZjyA40HrUCItftyGjhG+jaFdBu5c/ogBXlzEIj8pFm52OJgFKOH9ID/ovhj7ZLgNOs9vhmyF8MC0n/ge+ag671Rwri8vOdLjsgtrKpHnd3qhf1JaTAlS+9KAz6TxtgenzIQ5etmLgVKnOXVyXVLmj6hrMtSwVn7H1sCebn4KgtqpyJOegQ6DoP3dlXJerh5tPOffg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:40 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:39 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [RESEND PATCH net-next v4 22/25] net: dpaa: Use mac_dev variable in dpaa_netdev_init Date: Thu, 18 Aug 2022 12:16:46 -0400 Message-Id: <20220818161649.2058728-23-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3cf7cc65-d8d6-4239-39bd-08da81352c02 X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5imJ+SDGnq59zK0JbWrIpVmMCpS9UyD6sat+87NKXdqGCU1+7nTEczJefUfq4j9NVN/v7p9oeWdtxlvoIAtcR12W5TxP/vU5FI3jSWJb/4UEGdzIpZ4Z0+TgpqE/6bY2e8VgxCMv6EJUlKxEm5vqCNK9UtQKsFv4um6UR/g/fXz7HMFAgdgaop5iwyQ0mA/okBiSeYWH7kCvFC2ss/esAbCTD2Wcui5G9epFeHUcx/uINnnPLrIIcxAoO5UlZY9zGbeMwlauayC/AYusAjvvD/yHKii318tw8SGBr+cTO+9SOtQfUGYg81NxYuI/LfcFdNDnoLeo4jOC34mkwbNrgoDPK3aVzzJ/4P89/ioW4uMf41AybK9tHZrTo5yyjpPuqaEFlpNZtUGuNJ04SRI8Kr2vOqxyV2GkNNp0dcHCkobd4Cx1g7urZxtnDcI8s6oWbMrnZi4amUPwSSexR4YFouhnv2Mf+i/J/GibID94S9ysedZzNTOrmvQuuFKziox+AS/2mT63h+QDbm6kMxj6blutIjJ1wUxXD3hABgoy5xpS3YZCYR3F100jmux8yspd++WMEwsCEIVlFxv1RdZvtKY28cH1VezWNwfVtD9IrjrGJLVE0H68zZlEJ4Id6XWtjlph5lAOFQF5u+ZG/SnF16b7ziKSovORWfDaGHCzBjSp4OGG4196P9TK20YwK6HfdiIZnWrRNOX7EOtsvgq/eS/Woe8QtJkOQnJe9NT/zTLpkmO/caZClRciAacMHGBVCpFHGmIxfrL1X+c0g16KIA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(2906002)(36756003)(6506007)(186003)(86362001)(107886003)(26005)(1076003)(6666004)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H852fQZ1FVziu8Dnzvu3L5QQtD7UZLkUO8FcZUH3wKed0mbdqVTi0EbW5VIj3SRPG/Tzdr+iTHPX/6553/cXOBj6erhMS1qJBmFJyWWZjg3PtgJDNCPukp/jSWeZf2tecRSMNexUPMpTq8aj2HZGJaq9+but8DzpG3A3Sn84JpTTy9TKw52m71QoNCUKxFo1N4+9XxbR7f35qjs/PcMkiiKEUbyfGP1htAADoX8QXUeWfMD0oOEsswki6b2pKrqwCK0/YxNBSaXh0A3Vkl7HRopOVBk9XA4xCbfqbK/2qPQY9oKU3wYvNZM5yCJgDt0bZ9ned8Ntqwp9XXLywf/+gzDeAW1pccLCCqVaxw1ywhXRmS64OdQ7A2OT8JK+Tz/8fO1NtwVTkfW46ENNU4p1ida7165cya19A3iPB3+h982X+mCM1ev7wq8A+ThSAZdljacIas8MqDTkEHYl0d4BJa5Za25C0A+xpwWt+X9NTh7rZHekRpKevw357w6B1Ml99iA/aXUnNHTtqyYH2yeoggmQmDFzoO1WfxgtQZkvTP1tuzOZ1USMrk1sKA9MfBekjNGpN7y6D11FDTlkDlznYD9CHjLiKJgqGhjn4qUEuG6hlO2IZxe75eO9v74lGetyEXH6BAFP24CgMXfMF8wL5IqJbDrR8FAWAhWwjTHy+I3A3ZkHhfteq3EOV2eJOaJAuIQ5m1xAVTQ9M+LsS7kr8rIBSFUOomyJUOsEAbqKDER+6o4UHOKPH2hZTdi5GG/oir7gcHSmyj5JgwVDndGF5/GkhnA9cXvogWi5mnogOhZJ5MzDGV3vgNDfEKOoYmSOwL2yuthZubTZwD/mW/AfV0NTNAo1+Vafh5OXWuMO8I5jgHL+CVtSgjU84AQD93/s4viMrbFSJeEwymDuTN2OkNcqZGI+2MJqtkgtct+Ffv7BNnO+jnGzQcDLWG4TL9sKLjG+NJspzQ+PWindMft34/l3zxg58ZWBRm5huiWcHEYxJ3Zf9rdEe+fDLN8IwpU23ryEKBzF81nsbX4Ftf+OcfLDg/ZwOWrUBB48zTXpoztoa3gJoiaIbV7Bil1z0h+WevnmF4xM7xJihG4Tv9LBr2+p+QWzdkZnKYSb09RPFa770Ug1Tt4R/RZKA5cT98CKhr35f5VMfvw298zagogT6/21YS0inXBFsy3jcnpO1Yr2j5HOU2GH4SSyqfZmRaiiYrwHNA4uv9tdYHDlr9aGuoc6bYwWawa/p90uonqWxkzOJ4+KQFGLF8DPbxlYWjJoEFoeYWXjNiL6cY9QwWWUQmTA2gsPa4eAPxyHwEk12i1loDZRP4nH7YA5sNBml+OfPAlgRxrFxTVg6QmKM3X0/1sDcPbqodsAu9XSCIeheOnZjdkNmiKEPIS2vle8bMKVNVO/6hN528IYJ3LVcyGP4Tc3TeBtGHJ09/4qA8Xwi2bhLdjtFKezPtremlzGJ/+lJ5WVAkHjxCT5akg7EnuQthF0QsnJltXbiI9S+WcfR14vUOG6tKWmfcd+oZtQw+1yASbXTgPq0UtTVMvNOHNig4gZaFJf8TWQ95nFfgaIOd9Xar0sxp4BcWyOOCL/GFDLVwuidOLLLaWXwHKzanxS8g== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3cf7cc65-d8d6-4239-39bd-08da81352c02 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:39.9033 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mvlNfKyKrpEn/+wsiaBp9C5e1F/bYuFLnXq29Nrw8dmfgfRecubEt6K7XPu6bcyw+ay6j6rwsVVLo84fWpeIkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There are several references to mac_dev in dpaa_netdev_init. Make things a bit more concise by adding a local variable for it. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- Changes in v4: - Use mac_dev for calling change_addr drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 0ea29f83d0e4..b0ebf2ff0d00 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -203,6 +203,7 @@ static int dpaa_netdev_init(struct net_device *net_dev, { struct dpaa_priv *priv = netdev_priv(net_dev); struct device *dev = net_dev->dev.parent; + struct mac_device *mac_dev = priv->mac_dev; struct dpaa_percpu_priv *percpu_priv; const u8 *mac_addr; int i, err; @@ -216,10 +217,10 @@ static int dpaa_netdev_init(struct net_device *net_dev, } net_dev->netdev_ops = dpaa_ops; - mac_addr = priv->mac_dev->addr; + mac_addr = mac_dev->addr; - net_dev->mem_start = (unsigned long)priv->mac_dev->vaddr; - net_dev->mem_end = (unsigned long)priv->mac_dev->vaddr_end; + net_dev->mem_start = (unsigned long)mac_dev->vaddr; + net_dev->mem_end = (unsigned long)mac_dev->vaddr_end; net_dev->min_mtu = ETH_MIN_MTU; net_dev->max_mtu = dpaa_get_max_mtu(); @@ -246,7 +247,7 @@ static int dpaa_netdev_init(struct net_device *net_dev, eth_hw_addr_set(net_dev, mac_addr); } else { eth_hw_addr_random(net_dev); - err = priv->mac_dev->change_addr(priv->mac_dev->fman_mac, + err = mac_dev->change_addr(mac_dev->fman_mac, (const enet_addr_t *)net_dev->dev_addr); if (err) { dev_err(dev, "Failed to set random MAC address\n"); From patchwork Thu Aug 18 16:16:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947408 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30BAEC00140 for ; Thu, 18 Aug 2022 16:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344660AbiHRQVV (ORCPT ); Thu, 18 Aug 2022 12:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344170AbiHRQUP (ORCPT ); Thu, 18 Aug 2022 12:20:15 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C52EABD0B7; Thu, 18 Aug 2022 09:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RrK2zhsWQwnY+dmAuS9EEUfsOmG27Ay02g0cPXHjIAWquZ8lXWPMLs8zh9JKJR2RTpwF7ZkO62uyu+l8RiS1imQycrUWuK2uBpUyaUAEfVk2gCfjkgTzqQ9eS0YVAPZRnCTBK13yGxNzz/cnPdDfYNplyW1E3c9OY9IBuzZmK3JTyj6rBVV+1k35DcG/RCBd0vvS0c5OXop6KHihwPZSVQmnC9Tb9K0N7ZBr8K9oKuAzWkRcjRNNAJDzvzzTsRxzmYsWaeyE8EaUvl1nYC2T61WEr79W3Hl84kSnuVapiX2SkNGUMj0V//GU1FG2/g2xKrTMpq+YDSR6Zaymuxl4Fw== 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=N0iVIpavMKo9hh8B6pZsnQSMzDiNhLM+JGQPoO6Zp1c=; b=AIJt/TCvfTPbdcMqFNMTFmL8p1t9g5zrX2rFVeU/Gkj0pv5UzIhmPM0zXvWn5hlgv/+byI547c6+wSJOZZj2cqNHWyI5ZhDuSYRfZKlzqxibn59WTXUHcTcTFOAZmOX/xZx74qo24R5hK6bVAx4z7NdAijv/M97fDSu2ArKztJYAjDxUUOcimm8HE5LG8j8aIwgwI7O7nagcgxeq2BtjTyMuWUEU+FvLG8Q2wfQL/pnYlqEsT4KXO3k1agw5rNMxPLYi4rm21cj4+qZeXod8z1jXMJtRIkq/Rw3NkoyGd6TNUdl1XJ8fnzWe5jsWNky1GbmMctaYwinE/8j407CRqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N0iVIpavMKo9hh8B6pZsnQSMzDiNhLM+JGQPoO6Zp1c=; b=zkRtBVqeNzI8qHPcn/joB2fbAJXtCQEMPDQSWfMchXvV3oozLr6iZLDNbyIWn3k6+wgEUAUy355LEz5HjnWX46PJBdiWkb37btXnlgbp5r7OhvyEleOiCJ4a6LpEPdGY8t6y6/wuzG1VBIIw9la2qfXfxYwtpCYn2Nit/wzMPsig0QGrAhYocTVsBB5LoJ45+Tah2j8YWriRpPv3B6Mo++R0u3Xp+VFDJx/TkQqBdRFxlmfdp4W55FJrfxh1NVfBpSPXGW9+GJYpdpWofFpV4uFEMkXXxMe61/6AQ/0apjGnMd+Eoda+cyyGqflWy6TxTUJf8jEcWTFKr7I2rKlJpA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:41 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:41 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson , Li Yang Subject: [RESEND PATCH net-next v4 23/25] soc: fsl: qbman: Add helper for sanity checking cgr ops Date: Thu, 18 Aug 2022 12:16:47 -0400 Message-Id: <20220818161649.2058728-24-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 338f12a6-4c5a-483a-c994-08da81352cd8 X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Rg/YdMyHIyLDfGGX2eYxRMXsBQ7aut5F2AoUmRHunu+A3APQ5XwpaWU8jp5eH1KSlzWbOoxjUItPIkKYUVDCLrOSi7mSWpJFt2AboZcpypZyyNW/cUICwloDbfoK2PJYnjvJf+CcfEnhTWQ9RjOrqoMN4ZfSPam3lb0ifQIuXo0u8pO/jE7aP8nIlCkDuHXcJfDbDPg4i/ajALR2WK4kumruuxQC/NGxNT+qvmaNaosKx+zIpp+KSbB3hegdwMP2t58Vefo3Zpd5/+Zy2iaMfDj9ReKwEi7WDk3yQCWloOoR/Yzs32SK1VIJjX7oh4rCo8mLeXBI6IkYmqT0hjWI/xT7w/a0MVDRsHeXrqTAcVRH+H66mzpOdZzZdYmq8YEz9pupJqX8dPPFXhKDzXw2FdjeL1w+Kf+Hg86wRDJiH2PasaeJ9aEmxfVJgweLpIRebXMEm8kjapjZZjZ9MjgVJvKL3cxuC9ynNO08gty8Y022oUdaJ6Bekk4V2DMUVAHbxGZTcUdwsNLZOzd4tQ4Wssc1FWUDGE/WsZySfEe29zFB/s+CCKESl+GgedEHleOHwQQQll4L9RHUw3HWGU5TlvRzFkVYa3942pzzaaHNo7/KM5hy1/aCd1/Or5A3iV1jU10wdV6NG6a/PztH7onosWMGzISx1///X3EHg84arFNhE3bwIi76RkLVpryBLeVh1k6UnTODS0uzpLrajGGgVzcweNKTg6Lcgfj8Nbtz7sZJSOzGhV6i3DasDLdUp02n0KjZM6pF/McU8RoFov00uQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(2906002)(36756003)(6506007)(186003)(86362001)(26005)(1076003)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sf+S04h79gZI08c9VIdC/FnwBJ2hWR/BBeczfvvVbsmIkoK9OTsdrqi7faGQsbk2AqHdk8yQDwgaRLh514Tx0YsKgA7QG4hdz73pPMButefJPjJzv6dBa5T3NphN4Fe0saG6GY0sH02c2LRuKVDGgB+gNts3eFuxi9/EZPM0+Qe9vIoWq/P7cEyV0RtGTSVROnl/aqpAvUgZsukkBCZ39dR6Ke4nKmZbX56QF4WTVem5r4NGz1CbGs8qXs1TljHWSc1IluDGtDIpQ14IwAfVrUxDh9QmgrvJUtXhP2muA0JmaQCBEa0XkGQT4Mplruug869NFUHYlwOM96iVisHFC4qEZsrTmzl1HLVhgOKyUyrD83Am69XiqFqL5Vp/IPdHpclxnmc0PCIO4Dy1VGNqAHeO7k0vpOK9XjvPTz7zSY5bST9oYBp8EracSF8cqJmIkLwcH54W0I1SnyM3uSW1cVpLplxfa7eUCa0OHFa2W5SCDZMYDPklsaWczlRL9MKCbdvBSHFX1NjNhafdoNN5ox6esp6S4Y0bkKIEAetK3nSuuRNl3cLaHy8Q2zCDwX5uQeRp7pOgVMSaf8l8yE+IRjm97dIJmq9RxghxWhHuVCwtW0FZfm27nlXErzs8EZiiKeGqir5clRkGLZqk2Fboo3Zk4U56c59V0SFDLOM75jPB4CtwBbFvuaCC7wyg0a97e3zDQuEQHyu0SOTAjpraSrMP9KQvAn1iV5GLRM/aab4XyKW6bjWmQyZ0M1jDbZVTD8hvO3EsjJNhvr+hukqKnxZwfN/O2FcAln+ardpS9NglyFyESsCbTwRwrrOVRESQZLgw9s0KXQHuBq1Tr3zaOLOTLzlKcGYrqad890z/yAY2MjL37hjDfRH19h8VY2UQ+8iX2/7gG6QRhJCNjsnYfL7PxZkBwWJNCenst3YRLCrB87T2+3aCJTS3RjSHv7mF6LZM6Yd7HLXmNiiLQZHnSMa2ljUNClG/fhaWUSWHEgsDUMLa9E8pZsIJY5oQg7mLFRx6lQAreJgwn99rkyH8Js+Psv9f0Z8dWOwRhROEzoqhIAlwuDRV8sYSf73yoYF3tWdhx/Bxh1RpigL8fLwWQsP/0yq5Ihh5vAL003FG7AqS3cNrIyvUdX5y9Hl1/1YfXppagQOjOubdHCVrQeapwp9kj3kZONkPb8OQhZu4s6IGNS95QKgBxAfPGuz23Bm9o/9Bw3sUA5MKPN2rertvJHgpEZAguBiSK+q4vUaHO8Zf/GxuqQzOj4dnqbMf5X+jxBDoVdCi56Y7uU92v4kKRr9yzZDqD2/QVxOzVc8DBNO/n3Tqs5NhWm4mpFHQpOMJLYhIF8EmNS2uGavFf0Rb/CgwSJMi9ss2cFfVyYSbdxLcgRxHyAyJU7uV7iDO6pCQaLnn+In4/2MNrIkaYA+TRuyAEdKfi/JULTWSFw7nAlAeYQglcSfBlS4Uf1bkKtrSwo5Ul/shk6p2PJtBLUJTL1K1U2+YMicQ0wUynasenNDP4uh9tS2F+pqR1SQN/ZUP0IFVqmdYZBRDftyGyRUZvAgYxAbgdmeeRjzg6oXYvsLWVE1kyeaevtnmXD29JgQe5tjK59X59DTYFMPaj7LFbQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 338f12a6-4c5a-483a-c994-08da81352cd8 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:41.3094 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Aohile+D6bNeZirWoeNm9u31R1/RUBO9ZRhUNQGfHf6K5WkpBCfjsG1Un9dOOvB68pw5EAQB3kDpL/l5CUSshw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This breaks out/combines get_affine_portal and the cgr sanity check in preparation for the next commit. No functional change intended. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v2) Changes in v2: - New drivers/soc/fsl/qbman/qman.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index fde4edd83c14..eb6600aab09b 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -2483,13 +2483,8 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, } EXPORT_SYMBOL(qman_create_cgr); -int qman_delete_cgr(struct qman_cgr *cgr) +static struct qman_portal *qman_cgr_get_affine_portal(struct qman_cgr *cgr) { - unsigned long irqflags; - struct qm_mcr_querycgr cgr_state; - struct qm_mcc_initcgr local_opts; - int ret = 0; - struct qman_cgr *i; struct qman_portal *p = get_affine_portal(); if (cgr->chan != p->config->channel) { @@ -2497,10 +2492,25 @@ int qman_delete_cgr(struct qman_cgr *cgr) dev_err(p->config->dev, "CGR not owned by current portal"); dev_dbg(p->config->dev, " create 0x%x, delete 0x%x\n", cgr->chan, p->config->channel); - - ret = -EINVAL; - goto put_portal; + put_affine_portal(); + return NULL; } + + return p; +} + +int qman_delete_cgr(struct qman_cgr *cgr) +{ + unsigned long irqflags; + struct qm_mcr_querycgr cgr_state; + struct qm_mcc_initcgr local_opts; + int ret = 0; + struct qman_cgr *i; + struct qman_portal *p = qman_cgr_get_affine_portal(cgr); + + if (!p) + return -EINVAL; + memset(&local_opts, 0, sizeof(struct qm_mcc_initcgr)); spin_lock_irqsave(&p->cgr_lock, irqflags); list_del(&cgr->node); @@ -2528,7 +2538,6 @@ int qman_delete_cgr(struct qman_cgr *cgr) list_add(&cgr->node, &p->cgr_cbs); release_lock: spin_unlock_irqrestore(&p->cgr_lock, irqflags); -put_portal: put_affine_portal(); return ret; } From patchwork Thu Aug 18 16:16:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947409 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11974C00140 for ; Thu, 18 Aug 2022 16:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344251AbiHRQVY (ORCPT ); Thu, 18 Aug 2022 12:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344775AbiHRQUd (ORCPT ); Thu, 18 Aug 2022 12:20:33 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150082.outbound.protection.outlook.com [40.107.15.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2AC1C579A; Thu, 18 Aug 2022 09:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hEZx3KX7xjcjGVJNcZK1qRTxPfwEM7SjPDRAV8XPf8Ufux9HCxDu0urmbsSC1rtzSxXnQzNSEAtvPVyVccRgqFS0iBUg49Y/rhbR27AuR0Hg3vHS+9RwuvMfpWWkYKRSZKISnRYmgDJIxMwyDIW03QFpNMbn05awX61L0woU7Xr03bF62j9F32eyew3TN72OUsdQIpLV5L5139pCp/UgSF/zAj/9tXfJ0HjQjJOCi4dTauetigAc8bdSCkAS5cHAS/j2FJatb8JRlbIPcfAnd7EHuOhNrrgZk80UbOjJVZkQnZo4+eT8AeXE92CBvOgKpj6takDdQsi0IB9KS1S22g== 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=F9wh0bRuhapaBW5PoYNdr8D20ugPy+FDu31lyvMXzPE=; b=Y5dMazuMB2iv/6a/rvXwQ8WUL2MebUyFWXVhRkFjraSbVAJUwZdwZoNrT241cIQdf1XK14l0OBNIbpbUdqlHThngQyl0b2SEyoMgouVwJKTOkYHuHGwR8ORWhCsRX6iv1sO54vA7tXKpu+Fu5QV4OfMjv0wTW35ZYpWddBFzq9HSNFXooeTU+69ol6P8qWrRDoeI7ryzPGUpDfzBM/HZGgaX1LO4jWzofEKBAZGnPux0u/pRGqLTJPigzCWq5HFpzUqEwfQ4oImjEKtRKqtm2BV8banBDheMmGvPGGwcu5uBFjG7m1p1sHafLfQNCP2hRXx3JFzcruMyuSVISGMEVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F9wh0bRuhapaBW5PoYNdr8D20ugPy+FDu31lyvMXzPE=; b=WeG0W70gOZKNyZof0r5EEawoiwfegN4ggzsEs+Lv45hCxz1SslRbQc4q8VgIeFZVvkF4gLkoFdk+Bywytjjmw1ckb8EvVniYKpau6pi6BjPCjxEM0ROu8QOKTVdVHbNXhDcezpNkBQypNEw5gd1em1TIsvISCOzvAl4LiCyH1qpbJIBWsIs8Mdp14U0P1lJt92ldWI5GSzpXTivx05NfS5k2mSC32CzdBphbRU95bCyh8C0mOqCpHA3pdIxWnD27qlR8zgElJbful5NohIW59b+frdPN9J/tFpw/e+23yM4egQCysvmjlB5liYp4rgP3fN5GCzceTTpwCoauQ93qIw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:42 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:42 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson , Li Yang Subject: [RESEND PATCH net-next v4 24/25] soc: fsl: qbman: Add CGR update function Date: Thu, 18 Aug 2022 12:16:48 -0400 Message-Id: <20220818161649.2058728-25-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f07e994c-f2bc-4a01-8072-08da81352db6 X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6dj8G9p7Xx1kjjMU0PUT8xTYUPsgrizqp1rOftQeKthWkvtMyH8IfnIr/sMy+b+s468f1cdDT/YB7evZi2tJY2jWU5i4SLP+fHRAezw9ZJbXnPfLYFqpD578pkX+xKad/a6hZUPPJjRHHYl+7FHmmc4LpvnvxpahEXhL4kv95P1amhUW4H6nKe5iRDLv/f7AlMa6Nr5l/ZOQf8BmfpDRH2VpbgCS4CtTCj0PvNUvqa5lv+cE+CRjkkV5om0AH1iEjwz5wf92bKTrUtERNyTGvTZRfBWM27pVOEzKQhCzHSj4TXxjfRAHbdvTQNxzXlXRw1bSBLsnZBcU+h+Ah9d+aYEpj/60IqnioBEzDU9KrDfBxkgmSKWQ0b53nOBJhAnTUET7NdW8KAdFtEfAx7FHLJhfEKkAusLPA2WQNhukNHjkoqwmzpjcW49v8NahsV46lrVb76E17jaM/4Qr+p8EJOBy4OmYm94+jZJc9CBfuC1Pi47YFwYsLLX/mhvz+7pk2KQX1n42+qXG+hJaIFeMr5g5snZQ9ppvip4W/0+x9wUcvzC7f4rwe24BGAoYLApEo8S8ZKACt6tQJekRWX6BXw4ABx/IxRhM3lcDDoYifVcHvTq8mZTiU+8ip0rwlF8sX9CH+dil+tZmFE2PuXM7x5sv9RUHxJ9HpZdxcChqOYp8akzZZCQBXP0cduL6QCGXO9dWaZ8Ls7uzE0tj3dpVd3SfodACiUvrfrPq9wiH9L0ennGy7gD9i6zleDBOWeyzxw+IoZ28NwUwRL5iXex1CA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(15650500001)(2906002)(36756003)(6506007)(186003)(86362001)(26005)(1076003)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u8ZaoRgA7rQStUS7isG/m2NjeBYuMmQMjIkZZCntrDyIe6xuE5RYiy4/MUilkaRCwoeTHl7oKB+oePnzOnOgAQDLtqh4ZswUZLxYz3FdA6ISeg7QtLoOeZ3Qt6tn+mE/O4spjD1UWz2OpVk2sdvjfS9p864xtRxeWMSTCSo+UUMS+G3okq4gvi5YCsq8NvZURvykRJN9SxBgH9zHtWSXvBBeyxiv/u15+l2nS9bvDY9RxuPYgQMvTAy11UIO+wqt2Mj1gBKm7WQpmMkrb7QxlBD3YsBO/WA9haBzCKUAvi+MQ0pLHEcNy4EGj300q1FZDbLCkEI69MA4t6NUlJzWLLMxa6jYVrx38WdcOc0yRUIzQ2Ow+lz7YnW+VGbvBCYp0hi8egQ88eivckWkrIasRgJxvzjPSv6Lc8Pa2ZyQ3kyyF0sXd9/y8IdGpCjGFr456j1vFwHNiWv0gmLa1qLmpkwgOcEkDWGi7oKe4GuGffeSjBZO00ffdYkhGOcmlpZkzwqcET99jofsQnMT9fA1CDK/EAfkpYTXsKHieedwtRth03MaVj3rt2TuYPkSoZUiq1RHeHWGFu2/4cphkt6UD/DJKsgT2djZxZ5JO9hbYUiC1PvkXV7jCjzcGPT/4d2xmkAMUYyAwrLySG1+DdfbzL/WsmXMeG5hz9IcxTPCc6vfLVX7Zb5f1IwWSfh56YS09tSuOevUbLTuNWkohMn55fLYp2+phwNnPozEMkX9VUUxFns1oKhoY6GuYkk1rNeOtuXJk2xZV9x2Rb64IhNRID9ik2ndrTMVS97ygbWAGTLOWs1roKxDOzErrafCp6psRdcsGITFdyi8W4I00XwbC/Rs+vpDP4B8QRrik2MekTnlN4wF8c/ZNQcqRtGLVqRlYbw7P9Vi1yDauFCWydECiyFnqPNlIzzpiBVPH9FW6GhsaYG97qdSXu2G4ph199XRAd4wm6v3wcJvgKWBRXl6vA6rcG5OKgosnC7c1B2xNNFcjjdFwL2XGfEnhVl0uxqgoCVHIlzuipQ72a6JC7lQ9vZAVok1N2Izqcruo3d9/VzxS8LJvExK0O8/Y3jHgVg02wfUmR6Gj+r/kYX/iWD1eiTXg9N/HNqQzfJswv+NGDQJ+soL/O7Urenf4MZVnYh3qmLeExE5/nbb7yYlCi6EHUpTWbcYRnSaoCCN3YOTdJ6et2T+lqhcPFbg37GLfP2LPe2P8FXR8LaDU25NuVNMJeXTECGIhEyUDd1+kK7UB458VnaiTRuI3PDLk91vouxam9v+OHSXJOPJ1rBHWiDuic+jmbGJQ6m7efjWPOPVWlxZR+VsISOqSLtA3dNUbFcumLkXQhFHNlje+L6k5Q9S41qTNbm5MAaedkF5WW/OJe5HOIu0UHkXrBkzLH8ecnTOhcIAE4ompUX0+26mKzuHCMTmW9zrj4+HsqOocNqYUf9xHxEaiWMmHNUwtyFMIe6tqJkSnFC/BZ4X6uAQw2QUNXfSEY3JDINBOkxey7KID0uLASA1RV3FtKrImpIRDbHSSbxPbdckgY9A6vZ/rm4xZYVdgmc6Ax6R7MZVIvduFzK/xAOkjIYkg5fJscnFmlEVsIGiVdaCOFPhognWWSegng== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: f07e994c-f2bc-4a01-8072-08da81352db6 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:42.8250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Nju4vEsqRIdsl4r2EhsYLDXLJ7N8grLZBIcJBn2pKenF/CW2oe6USd8lnHMkWrIQkYphU75tz75qzJRq7VgIFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This adds a function to update a CGR with new parameters. qman_create_cgr can almost be used for this (with flags=0), but it's not suitable because it also registers the callback function. The _safe variant was modeled off of qman_cgr_delete_safe. However, we handle multiple arguments and a return value. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- Changes in v4: - qman_cgr_create -> qman_create_cgr Changes in v2: - New drivers/soc/fsl/qbman/qman.c | 47 ++++++++++++++++++++++++++++++++++++ include/soc/fsl/qman.h | 9 +++++++ 2 files changed, 56 insertions(+) diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index eb6600aab09b..68b825ea10f1 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -2568,6 +2568,53 @@ void qman_delete_cgr_safe(struct qman_cgr *cgr) } EXPORT_SYMBOL(qman_delete_cgr_safe); +static int qman_update_cgr(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts) +{ + int ret; + unsigned long irqflags; + struct qman_portal *p = qman_cgr_get_affine_portal(cgr); + + if (!p) + return -EINVAL; + + spin_lock_irqsave(&p->cgr_lock, irqflags); + ret = qm_modify_cgr(cgr, 0, opts); + spin_unlock_irqrestore(&p->cgr_lock, irqflags); + put_affine_portal(); + return ret; +} + +struct update_cgr_params { + struct qman_cgr *cgr; + struct qm_mcc_initcgr *opts; + int ret; +}; + +static void qman_update_cgr_smp_call(void *p) +{ + struct update_cgr_params *params = p; + + params->ret = qman_update_cgr(params->cgr, params->opts); +} + +int qman_update_cgr_safe(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts) +{ + struct update_cgr_params params = { + .cgr = cgr, + .opts = opts, + }; + + preempt_disable(); + if (qman_cgr_cpus[cgr->cgrid] != smp_processor_id()) + smp_call_function_single(qman_cgr_cpus[cgr->cgrid], + qman_update_cgr_smp_call, ¶ms, true); + else + params.ret = qman_update_cgr(cgr, opts); + preempt_enable(); + return params.ret; +} +EXPORT_SYMBOL(qman_update_cgr_safe); + /* Cleanup FQs */ static int _qm_mr_consume_and_match_verb(struct qm_portal *p, int v) diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h index 59eeba31c192..0d3d6beb7fdb 100644 --- a/include/soc/fsl/qman.h +++ b/include/soc/fsl/qman.h @@ -1171,6 +1171,15 @@ int qman_delete_cgr(struct qman_cgr *cgr); */ void qman_delete_cgr_safe(struct qman_cgr *cgr); +/** + * qman_update_cgr_safe - Modifies a congestion group object from any CPU + * @cgr: the 'cgr' object to modify + * @opts: state of the CGR settings + * + * This will select the proper CPU and modify the CGR settings. + */ +int qman_update_cgr_safe(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts); + /** * qman_query_cgr_congested - Queries CGR's congestion status * @cgr: the 'cgr' object to query From patchwork Thu Aug 18 16:16:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12947410 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA30FC00140 for ; Thu, 18 Aug 2022 16:21:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344777AbiHRQVm (ORCPT ); Thu, 18 Aug 2022 12:21:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344818AbiHRQUo (ORCPT ); Thu, 18 Aug 2022 12:20:44 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5DA2BD123; Thu, 18 Aug 2022 09:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OlfWcZseOCtiKUPc4Ue9/MO7sfB/Dmz5potZuKB1zXwBTCXmqtEq+7Yc9i9sfq/MEvcibPGkHq8aRiAYnK6mB17AJfE+5THusqLqKDUpKxO5Lf6g39lXSfx/31KAh53uXmUEfogZmYACK0/66ursk42vYHCTfsx2XdOF8H/WHaPcYIWc3O0cyXSmfNZiLn8BTD1LWkYSC7EfooJqAgcMEA4O4pXB0uKpTfN+74KD3Vrvgx1L6Q5t9N5nRgB+EewWJHSEuYkhUhO6c7zNVE2CY6TwpG+E11pCbQeOXiEp+393pTduCtbYxS+UVQ9JjteDZzzu/TZ9Ii62Dsbtjtj+HA== 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=m2icLyPw92tchujC7meQbydBWVzlYIdCZDbwzZflRR0=; b=Ssd6tWEJJUDg52wKA7UGYmj4xu2O3XggdyiYKkL+wNmhDXTjF4aGyVaQTvmAvjkSGmQHYN3nHjnJ4SWCbzcx1yw9xEvi6Hy1lFzc6lJO9zB7iN323zuQnn4obA1lD2uIzQb7zLPx0d5fFIlvveQTtwozZtnemFfe2Oes264M6KQqv68iFkuh0oMhSRtHkGQY8qn+dNLofXDtEIowslILRCDSVNR+Kj7LsZplrlSUOz+Rn57BW50m2EeVQszOPmwUfsaJSTY5StbirbFc4BDbBRbrbVYiQSzdpX9zYiiUEN7jueEZC/sL3k+VIvc0cNbN4l8nU2hST4VJCnD9LB8H0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m2icLyPw92tchujC7meQbydBWVzlYIdCZDbwzZflRR0=; b=uyPntzfGInTQC1Hvz9pDpszezS2TsG9iPYCeb9xEsJAh9TSnaR0eaWoq/w2FXDVTkD3TexpU6S9wXqA2WixLCEmPftqkgEWlhdBGtZExfrTmDEswKvu1tGIvCFj5NsVPstFnBcGlIE3cIO+XjbmcHK3PCMgyQezqcC/qLvBiICUIbSCNKKr5kKOEZ/kn25NR7rE53LBI0f5tFXTsqL9ZzdsSBqx4Ysm3Ur5OhcI6RxGF6XVBR0bsEChPeJNymrFMRFITnU7WtY+nXDMvSQUg8nLe7lR/L80q+sPV7S1kAR5MP11YBFciwtoZiF84+mEbofvER2e4oV4TjKH5EC5YKg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB5621.eurprd03.prod.outlook.com (2603:10a6:20b:f6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 18 Aug 2022 16:17:44 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.019; Thu, 18 Aug 2022 16:17:44 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Sean Anderson , Li Yang Subject: [RESEND PATCH net-next v4 25/25] net: dpaa: Adjust queue depth on rate change Date: Thu, 18 Aug 2022 12:16:49 -0400 Message-Id: <20220818161649.2058728-26-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220818161649.2058728-1-sean.anderson@seco.com> References: <20220818161649.2058728-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR20CA0009.namprd20.prod.outlook.com (2603:10b6:208:e8::22) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72a58b4f-fff4-46f7-833b-08da81352ec1 X-MS-TrafficTypeDiagnostic: AM6PR03MB5621:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P9L1mB7hnXffvk6PcvuhFeI6o3rhlfVyxATeSkV5/IY4dLcOK6RvcwkvCg2B1zah10GoDVdacquRZgcZpcP1vCgzR3pOJ1bP1Nar0MD/oeeYnBKYnuZWEo2fwmPST4ioyFkbmTerTqdm+Gkek9IprlDtKCZ6F12fWv9RyOJyu4O00pYEx1DJml/g7ng0ST232y8mfySrbK6k0PSwu1G8mSdPHzT8Ae8v+zi1erK1eQbsLmb2RHRDBvj6zH2KQc1m/CmQXVkQaWjb6vUHKiGSw9YaclQSc9KpETcAmfmTzAQdpMFKlfA+ugnyaitxMNL97miqXDgAhtlljnhpIkcUSUOdOCkkgyOICDAB2I7m/p4WJ4ssFom1ckXTOwdOgDdiawPTE5QmsyTYy4/OHOGfTjPyYJqESqThthd1BVse4HziiHeITFu31UxRCmuXjbIxoCrAt0pDfluynCVHvWjeapOe8FUsYqEgQ8AZukHRd+R3QK+nRCEjKdDlbsko1a32oX0yLsIOUhV68gt2DQe+iCVAm/VRewqS1uBowIPCyKazpGTjFu46qFQzVmhtGBWI9BcVkYMPF+wiDHIT8EDiV1Vb1sNztc4g10z8Uy1yDlZ2KibUm872fEIrDPuzYaI1qcO6/cG1tWgmBwTO8H5276dtWWTIcFPII6XxEnmMugEoW1Y9W9UJIRI4+VzvR6BKd5T1g0sAssRDIUn0jHZu9tna7dBbOJ4P5tuCXhRyM4GTpcxfHuiDOi5ReccCeh6w7ddPmPerdRYmcp3R6dBFGQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(396003)(376002)(39850400004)(41300700001)(316002)(478600001)(54906003)(38350700002)(5660300002)(38100700002)(6486002)(66946007)(7416002)(110136005)(66556008)(66476007)(8936002)(44832011)(8676002)(4326008)(2906002)(36756003)(6506007)(186003)(86362001)(26005)(1076003)(2616005)(52116002)(6512007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NxRXYg9Iue0b1TYx/9kGMA6KzF195Pq64B3sAeWg0rpZnrULSWTd/EjOQC9iQ3PYWFioR5wqzYza6lmWDHmTlTnwb+uuLei16byl8ruZNKg/ObfqFrAJxnvkcdlj/11Csreqd+2gePRrDdVSZJ8CDd9y978BvBWqVkua6l0SNelEv9ex+iL3KaekS2FaRtcVXL3ZY2BkX8GA6M3rds6uGUZ1nK9tyGVPWSEpdDpFMQKkmKd7YVnSHiBnUlKiVB+KoUiUcMwwukSKOy2ofL/jacrhlL6bSemxajihgXO+ZUXm8OjbC6V2wGH5ew+W9pzmNOfQn+p26cwPaVJDvg+xNq++W4avzMlzwV/R2/sap4HMxsB0XW4qJXlhRhQR9aBxanRcBKJgFFUXi3erYrHrFWFg3OWdkAFQAnav6txsxgBhqJ0Ul40ii7pE44iTig3H/wSxu6RFdjmw8YXc262iHfzodhh+UrNQWAEz+RdZQlLCuzQPHuWrAL91ujMCxM27m8F/qRpsSmBLxmFIWYbgupOXDWM8qyGbyhTSNHGeMmBOBwOFZ0atzL8qH61vjUV4ynZ57qaZHu7ftcvWmm1+t8y4va+FTMshym3fv2svt9IkONHDe30HL+x+4KjSdQDrot9pvMzLvN99+4qqNHXGydVmtABQObQLc3Mm2r8kikjuuXKi0K1+W5KM2CAg8UljXlGydGmVdGkVkyaFL7kcEOL3GyIKr5kM97RUNvYRdO2Ga0dVQthZTe33K0Mmk1rKkmZTDxjIK/9maG1yZ5bGAqWSJyV2j7behYo2c9YU+dd/GcLtEwMm9XeJ5plQpzxhRuImzraY2gjDTglQC98TPhb2G4V2PYNaEUUg+c/rLs766WH5PHzdZJxvPopcX3HE1vWSPS1yEY7xnT/4XFTwI3tkFADelY9Ic0zjQ0SMjemKatjMh90nszznopUAeplhVVjYIr2DcHHch/ucUOQSUS3EXMX++8qEpbQht65jaX1By0ezGoOxAn8DevodW33t3Ad75dsqrVHGzLdbR/nG8szGUBKl9qmY+wNdY0lpI4ijn9CmWQkTxtiBMPbmH5R3Kewpamy+rLYSPL2Ows8CQH7XGK/wtmWb+6m9JMRiEnLoyYoJXPrFUn45gFlLuhz0+2bw81QM0zMX6CvZuVHNTLpLMR39g581iwCy/Y4t58kOm5S8awLJJGx7D3ZwRc6Yz6cp5Q0X28Jr53JRKDg9xIYJsCnEJq2XhloTt1E66Qzra3dTni2VUALpb+qTeKI92nNlrK4dOHN+74hTIbSGzBKExLPZRyAQNe0fInet1bxPj7l1vtXic9Romtq8SNU89Gj5xNSwzovMYsXFJgcwsyUI3OpxnAxHrX2sSc5Pi9Yx0iCRk4MmiGuMi3dkGoXQb0W6IWGFM++qM+yXeoI8npU1gF8/+5yovmuquUXEzjUEG2fNpDOgPPw52FZTOPRO4aJXkt+0NwkZ1rxtnzwTpPbOQNIkFrb1n/i1y7VhQFLeiDyGX26bZ8I59G6AeSA94yK9EHQ3HAbvEt/hzYDgGYMU9+2KY10M/MSQJlBq6H/86A13UcdO5Ti36HW+3HnGr4RcXtKxe6hFUD40iKAsQA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72a58b4f-fff4-46f7-833b-08da81352ec1 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2022 16:17:44.5592 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: P4smnn4cV4DsHDvpvOeOfPayu4g4V+/SRb9hYfq6tbWzLLVYs/eGfg0UsTyi3ChXpn7vJgXYoA50ddZKPqOikw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB5621 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Instead of setting the queue depth once during probe, adjust it on the fly whenever we configure the link. This is a bit unusal, since usually the DPAA driver calls into the FMAN driver, but here we do the opposite. We need to add a netdev to struct mac_device for this, but it will soon live in the phylink config. I haven't tested this extensively, but it doesn't seem to break anything. We could possibly optimize this a bit by keeping track of the last rate, but for now we just update every time. 10GEC probably doesn't need to call into this at all, but I've added it for consistency. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v2) Changes in v2: - New .../net/ethernet/freescale/dpaa/dpaa_eth.c | 38 +++++++++++++++++-- .../net/ethernet/freescale/fman/fman_dtsec.c | 1 + .../net/ethernet/freescale/fman/fman_memac.c | 1 + .../net/ethernet/freescale/fman/fman_tgec.c | 7 +++- drivers/net/ethernet/freescale/fman/mac.h | 3 ++ 5 files changed, 44 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index b0ebf2ff0d00..f643009cac5f 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -197,6 +197,8 @@ static int dpaa_rx_extra_headroom; #define dpaa_get_max_mtu() \ (dpaa_max_frm - (VLAN_ETH_HLEN + ETH_FCS_LEN)) +static void dpaa_eth_cgr_set_speed(struct mac_device *mac_dev, int speed); + static int dpaa_netdev_init(struct net_device *net_dev, const struct net_device_ops *dpaa_ops, u16 tx_timeout) @@ -262,6 +264,9 @@ static int dpaa_netdev_init(struct net_device *net_dev, net_dev->needed_headroom = priv->tx_headroom; net_dev->watchdog_timeo = msecs_to_jiffies(tx_timeout); + mac_dev->net_dev = net_dev; + mac_dev->update_speed = dpaa_eth_cgr_set_speed; + /* start without the RUNNING flag, phylib controls it later */ netif_carrier_off(net_dev); @@ -826,10 +831,10 @@ static int dpaa_eth_cgr_init(struct dpaa_priv *priv) initcgr.we_mask = cpu_to_be16(QM_CGR_WE_CSCN_EN | QM_CGR_WE_CS_THRES); initcgr.cgr.cscn_en = QM_CGR_EN; - /* Set different thresholds based on the MAC speed. - * This may turn suboptimal if the MAC is reconfigured at a speed - * lower than its max, e.g. if a dTSEC later negotiates a 100Mbps link. - * In such cases, we ought to reconfigure the threshold, too. + /* Set different thresholds based on the configured MAC speed. + * This may turn suboptimal if the MAC is reconfigured at another + * speed, so MACs must call dpaa_eth_cgr_set_speed in their adjust_link + * callback. */ if (priv->mac_dev->if_support & SUPPORTED_10000baseT_Full) cs_th = DPAA_CS_THRESHOLD_10G; @@ -858,6 +863,31 @@ static int dpaa_eth_cgr_init(struct dpaa_priv *priv) return err; } +static void dpaa_eth_cgr_set_speed(struct mac_device *mac_dev, int speed) +{ + struct net_device *net_dev = mac_dev->net_dev; + struct dpaa_priv *priv = netdev_priv(net_dev); + struct qm_mcc_initcgr opts = { }; + u32 cs_th; + int err; + + opts.we_mask = cpu_to_be16(QM_CGR_WE_CS_THRES); + switch (speed) { + case SPEED_10000: + cs_th = DPAA_CS_THRESHOLD_10G; + break; + case SPEED_1000: + default: + cs_th = DPAA_CS_THRESHOLD_1G; + break; + } + qm_cgr_cs_thres_set64(&opts.cgr.cs_thres, cs_th, 1); + + err = qman_update_cgr_safe(&priv->cgr_data.cgr, &opts); + if (err) + netdev_err(net_dev, "could not update speed: %d\n", err); +} + static inline void dpaa_setup_ingress(const struct dpaa_priv *priv, struct dpaa_fq *fq, const struct qman_fq *template) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index f2dd07b714ea..6617932fd3fd 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -1244,6 +1244,7 @@ static void adjust_link_dtsec(struct mac_device *mac_dev) } dtsec_adjust_link(fman_mac, phy_dev->speed); + mac_dev->update_speed(mac_dev, phy_dev->speed); fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); if (err < 0) diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 8ad93a4c0c21..02b3a0a2d5d1 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -782,6 +782,7 @@ static void adjust_link_memac(struct mac_device *mac_dev) fman_mac = mac_dev->fman_mac; memac_adjust_link(fman_mac, phy_dev->speed); + mac_dev->update_speed(mac_dev, phy_dev->speed); fman_get_pause_cfg(mac_dev, &rx_pause, &tx_pause); err = fman_set_mac_active_pause(mac_dev, rx_pause, tx_pause); diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index f4cdf0cf7c32..33f3b1cc2cfe 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -601,8 +601,11 @@ static int tgec_del_hash_mac_address(struct fman_mac *tgec, return 0; } -static void adjust_link_void(struct mac_device *mac_dev) +static void tgec_adjust_link(struct mac_device *mac_dev) { + struct phy_device *phy_dev = mac_dev->phy_dev; + + mac_dev->update_speed(mac_dev, phy_dev->speed); } static int tgec_set_exception(struct fman_mac *tgec, @@ -794,7 +797,7 @@ int tgec_initialization(struct mac_device *mac_dev, mac_dev->set_allmulti = tgec_set_allmulti; mac_dev->set_tstamp = tgec_set_tstamp; mac_dev->set_multi = fman_set_multi; - mac_dev->adjust_link = adjust_link_void; + mac_dev->adjust_link = tgec_adjust_link; mac_dev->enable = tgec_enable; mac_dev->disable = tgec_disable; diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index a55efcb7998c..b95d384271bd 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -28,6 +28,7 @@ struct mac_device { struct phy_device *phy_dev; phy_interface_t phy_if; struct device_node *phy_node; + struct net_device *net_dev; bool autoneg_pause; bool rx_pause_req; @@ -56,6 +57,8 @@ struct mac_device { int (*remove_hash_mac_addr)(struct fman_mac *mac_dev, enet_addr_t *eth_addr); + void (*update_speed)(struct mac_device *mac_dev, int speed); + struct fman_mac *fman_mac; struct mac_priv_s *priv; };