From patchwork Mon Jul 25 15:10:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928141 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 90997CCA48C for ; Mon, 25 Jul 2022 15:11:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232406AbiGYPLE (ORCPT ); Mon, 25 Jul 2022 11:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235126AbiGYPLD (ORCPT ); Mon, 25 Jul 2022 11:11:03 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10066.outbound.protection.outlook.com [40.107.1.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E1E99FEB; Mon, 25 Jul 2022 08:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DWwBnV/ZVGWVQkBqPSQwKA/K3YXUtwvT7DRybPzw+BonjOmA9xN55RW6DN7E8T3Ggki0n7+JwvhiPtWqhQzlB8pJDLKv/CgzObJWMYlv5FmLYHVMg7gnnA1gMuAiMISwLjKzevFUcKo04iJ5Zn/DXE5pJfcXmRrOcLAHMNQHv/4ksJMgqIhTjNVi9QTJQ1QM5A8otM7I3SGxUxYkso/r4EUiGZl8kru5LqLiFWeQ3EkFzfHPFAsSRAtq7Hq5nljjPQBFWEzCSuUU7nl7wluxidwvsBxnXgDokS1RCHSc7tjhKaLThUV03zdWP+KLkFN3CelsZCzmeMZy6KCFoRF5nA== 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=Ztt4rIUBOPc1xIJSVIQjxGh+cKK9SDDVoQDd3WCk7MY=; b=YphxfoTzuPDeEQKQ9hj0RKceIlp5HUFOeKJbBkJDInFGYJApgNe5v/iBffft7SBOB4SLyjGlwjNZi7mfPlfqdbUedS+/tX/8vE0XLpxKaGSSGMWDAxqVxYdvT2V+htor2uEaKPb8RrOTZRdWeYuI/lHzR3m0i7TM6uM1EKS0BxFWHXuGKaCXyoO2M9/i4vGndSXDMqBTtbhSjSVVqOcaCqguENZoPyoFSOxraxE1B4sUWPForN/hKt2sjW8mCys4X/VldrCZMvgE3z9VABj0gHLWVXHeNbO+LaxOJhAYThjgGll/xeg90bDpS+kmDn7qisgJ5Fnjg7bSM9Ct27cO2w== 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=Ztt4rIUBOPc1xIJSVIQjxGh+cKK9SDDVoQDd3WCk7MY=; b=vVPvFKjbHSchE0KPauMIn76qv+yFmnLIUc6nabYkQc3N12sv592fotz0bqbZ9Kud5XSa1/+2KFEN9HgI9bwuMv1quCOUVWmbXrH+8nCr45QsYbW7bpb6r9NysMNN1LWNn2WbHPh65nTIL1ypBCW8OSKlkggAMmMAPCuQ7B85JyESgQ/QpwAW2UjU16fMmq2KOKKLe3lWO54qV7ymL5zF9Lst1y3b2WXShQDdbysco9sfNg+6H1EYRdV1hVxsqJRp2ZX8zBxf0FSUGUztQ74nZHLN4HIAkB33wjDOcQfjlDwX3xWrIy+ZU0hgbzTW1t/YOqWFgfVJIrtaII5Sq77BPA== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:10:59 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:10:59 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson , Rob Herring , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v4 01/25] dt-bindings: net: Convert FMan MAC bindings to yaml Date: Mon, 25 Jul 2022 11:10:15 -0400 Message-Id: <20220725151039.2581576-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: c0a077f3-f893-4ef1-4c4e-08da6e4fe18f X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MhfPGcHW5C56e1+lloN74aUx8oZDhEY2H9dNmLqwZshKC1KGwBHai/ggsbMP5xdzuQFpZoiverEpTMNPeS35SF4R8QseWIlNrehntOe9rMp9gtJKVGGJs2AcgaNqGjZ8SO5kx/nqQVHO7M2YGF0ohBCndWHVEHa+7FFoHzl+OZJ5B0AjvgiNBexFTBQTLdz3GEon8uq+C0zq9Nl1pIG4dMQgyTZhyM4GkCnriwNCNhS/6KPjUFs7PQw/GwpJSN/2KhnWgcHj/J7DFM0WWXpwUt76m5H+FDhchMht7gnpbPlLd8y34isjZQkGTlP17MWY7c7z3RWFzcjy27XkOju3b4nbfbfuL7E8XYYLOzI1+FEGXQPt4zVJo+lweP+zUepbxqzwFDnX991oZgVEgoPjvxb1MmFcEn1BTmmLGu3i12jL6LgKc2QHEAzvisowDZqyABBpZV4H0O1CkB7gjO0+sCOhAfR6G3KgAjrOoOjHsIng6FLqgSx+wH02yr2hN41ecJmKo6qSv3xduP1jd1JEtnnE/GOriDfzePjjJEipbK/1IyfMHGuxIMw4kvRc8E4txgL5yQ2zDgB+ViZe1+8wgVWLMpzrG/WwuLHvx2nqd64LsVW2wGuTtZT5aCOH6Idr5An1SEJ1myHAquMCyWd3jm474nqMt4MWeuGKYDW5dp/U5ALzcWK7erh6di8CdnsSEWB2U8o/Nh1PdTwLWASf38st/r4IdvYUuw/umunCqUQEcPbNpphi1SoWcJA2qyAj0ZGg9BFfskoubaPIyFeSKxJZxNXeIPsWk6ugIlrzufILZ1EnbLl/lh/zjxy8UgZwMM1WZlq5h6S5pvGeInGpm0Ftbeo7WogwObTo7gtnTYML6K7+fVbnhjAESurlq09f 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(966005)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oXoZ8el4KJTq8IKDswgblYFll0cnGNA2c+JPTmydpL2HY94ZwLqZB5bRIfld7j+RkMdkIrO4leMNXL1weBnk7shLzNx75tq/LJWSD4nQA7Q+GFVmy96tIsEgAtmxYbreQQ5WfrR3pZQccwDw3GC70myoWUecSUVntZw4BlWTyTBp851BtAoMNzcP3uYO7k5rGN3K6BmAdEsy5hThcIe1qD2mnwmM2XqmzhAsUwSzA76u+7PS06LGhCBNs4HGjZT4ndJjIalv0RooE/kInt248ts/W+tIrqKTFGcFuXDWuOj6fvOQGKyC+4KHu7rj7vSRNWXWjSSVVvZeNGo8/QL6G7t7HB1sL/S2FRjecm4mXbzwuMwxNAqj3uPV7D5YkscRNQtpIf3m8g0EMwupPJyNMQw4lKvEnheUMo1WPguOeqOlZErJ2WnBlUCEeHeapjIidNNS0Bo3udAzZHsiHAnY85pB1LWM+7smj+iXNmkAHaF4d/tpu/Eij6F32Wf0ZzMo1/q/2CvLKuOHEUK0FQIekVm5s/mzz+c0q68JzjXJWj2lBaNLDdO5HO8L5PITyQ+wj7zPYkJS5wlSoBAb75GZ9G3GfkNMfN97mfx9SqloqVC8d7qRO+ZXK1/JJ+A2AWtCK4o4JSqT5agyYUnvVbhOMjArA4afEiePVUR4kiEfyWAqJ+NRyp3cRYWRKuG7BoPe1r4ACAkhoMi2H1dww/aJC4D7IWJdXQSJBFUxj/dfyD9Qq51y/PvbtiNevqQbsp9Xj97goEORXu8x0do8ixyCrWilQVaCLKsvIZBuH25QqFQzfu7O5gYJXh0emP1mMNqPJxiIraZElfAKwBYWZ/8sIczrkrwIsAZ8tq+BgKBw7D4oRljewriqynsb0cBOvokJ5eHCRy0TpzxReguIB3FIYfwsDPwe9K3qVXuFxcEa508UyTrws8sWbGdyi6kXQqXZhmfWc2XI2FXj7nK3iW3lqqDprrzx5aIfAfWc97vJC5PoskJ4cuUva+OfUyx4BOjX19b/VuvQhlk0juuIl+50m8+vQ8XYwVtCHl97r+lbCKL/Wn/lanbYiyhqDQn/dL274PF5mJmsEhRI85W1VWhXKN9unY+iiGHSaQ5I2jEJ7jVz2LXRcoGYljRT97Zt9F9vYcIqWmbZ80KR5PhvmIM+gbWtYE21sSYX8mxSnpi8H8+kC3NwrdI4CcdGZVlKzO8vTwI1Fz2WX0YOYm4vFgyFS2P3PCnKtcjxw+flrO0SSeLG0Vvuf+omA9V5ECjzF8EYsfdJinSPf5Yg5DTX4CLpau+6hHc1JGAixHthmsRVf569gyHw3Kd7R0A0WNKqFefTziaK2ffseKzyqoNcWggXEmRFvZNMo+R42tK++oX8CSdvb/idUxWU3qiPWfilc6wIUzT2oYORN5X/VHJebgUoxkZaifDgM0w/62W120QufKrY7LsQTRMbwipCrT2JJREQeu/H+bac5QdM9TuhipAdhUjqkaRv0Hkblw59uxxiqLF7mXBBODK7X1XbyAlfdntBAgzkg+H1Ehtbl0MyhaiPHaJyWKwUxDGn69T1HGr4OjaGs3bmWqJykkthGaQbpMjpP86IgTez2wVw0E67dy4mqQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0a077f3-f893-4ef1-4c4e-08da6e4fe18f X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:10:59.4114 (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: mUVryMKgIh33LYSR59VWEQafUfGqdrZeL6oZd8VfwTPLDPrdo93/WelxE6PwvHM4h1ST9+kX01dk8MdgEwlxFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 --- (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 Mon Jul 25 15:10:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928143 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 06B31C433EF for ; Mon, 25 Jul 2022 15:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235638AbiGYPLZ (ORCPT ); Mon, 25 Jul 2022 11:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235600AbiGYPLW (ORCPT ); Mon, 25 Jul 2022 11:11:22 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 427D49FF5; Mon, 25 Jul 2022 08:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bd2eCg1am/OM/1oXU6g3SiyFT/AlHMUwOpdlOXzldtO2MgAugUjdHftR4T36bjlqAfFqgw9/zEgGelXs8Sr41UHHbwydUVYL262VI8qcqnn+nw+00Pj2B0j5jyKePjU1NLYCUkEB/1568uzh4DoyRRLZjw7d6nkRuCH/rz4nh7G6rOPW1AO6l85zjtSSPFjrl+DwJI/yfb3DlcsnDujYtzjIkqceRd9QHMVPNjAU5bDXjW+QcpaIDfm2FNFF9rn8ilmdKOl3slTNN3Sjifzw8yWRbFXz2m/9sLqd3hOPGOVbcq2hdAMXB48myZlzOwoe7U/SQGX7KWZmvHqWK4H3KA== 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=O8Vd7su3YweDIuKJVUNOFvbHrmeYh3ndPbbhMP5MSbi3M+iM835q/T+b3XTrSXy2vCPvlPIyStGItkFh7wSTdJ8lUgMUnCyI89JibBaxSCMSX+14IZXczR4bAauJHKNhQzbCoA3Bnrhz2bkQez6JpaNg+jMSuKyHzTy9nPvzeMdtIZNt9RY0HpvSzLJH9ZWmB5C8P9WuOcZTw22uiT+nBICy/hT0Go6UQ1L/LkPAhZlIx8IzuZYu+k24uqKWqLI3PLy/xgznUAtzJvImq9sqcHovObYlAOraWaYRwSf4dM4nha84lhz2Fvk+Ne9MGddlp9nzSAIn6euSFFXzUjtyRw== 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=12iOnZjUAqtyoJ3YAOOsXYEm43H5YQSBAgPret+Ig8647bLo36CBJH6SmHBO8EJynhrlGGbaENGF8CGLzOhXQ/jyb9lYlI85JV50nE5WJ/mAcmFoM7+eoO8v8OkbGXIT/zA7LrVGDs4yvVNvuoIGzJevhjxpNcgSwEtyZIAYF/VwTWAoy9TWDdv23KRJ1XD37xoCjIBRmjrZQnmMUg5tTuoaxjWBwPiYAiizSw2DRX47jMrnlwjw3Fup3DrLwdFLXtXgbCiM6Fcfgr48yxPRrROhzeetxbpacawgbiQLleGLKs2Sl+O8Wl8chuHIA2pLQhrxUjXc7qlYmOlWp38AHA== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:01 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:01 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 02/25] net: fman: Convert to SPDX identifiers Date: Mon, 25 Jul 2022 11:10:16 -0400 Message-Id: <20220725151039.2581576-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 3b03bbdd-e365-4818-2676-08da6e4fe2b2 X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U8QT/TbGm7LLrJ602DpbY9qkRjReBlV8aJer1laxVtP/N71/LvVWPB9gnjZSIkY8Ue6UoZ0rYyAvNDu45MgdknzjHzGoqaw3VypiKH+PMpY9fbKGTM3ez1ylSJ5C71bcTdfICX18w6og64GXGlnYP+EWeS3GWZp7pQa6ElfE4rW7ddzjZxFyqJY4VE5kznld9EFJqRWdBny+GbcOGjZswCrAmEQrXgRdsOLmFnL5p7I71rofLnGcyUDttJmRCzYe7nVV+75AXPpOptGPiwTIPpb1tjj40WKe9NH8xaYXlfK8Dqw1xuZZegOmWIAs7VfzKpG2ktXQ7JclU9TcHohkYnOssxClm9spBbrIoyASr9/B69gwdfaVEz1UeDkhtQFyv/yLCwxPxdD6dr3wIr/hZeQnphmHQR+YGyaOluvLH45wUk9LQtvFds4miiv1o7CDGhq8oSts4SxkHrtspdw5EGrqqObO1I5stcd/tWyjUEOYSEkGU5btAcuGAeS5IoZYyKojh1dczqTW767MmuNiAkZkwUGA4iYW8gsXrsggX4g6lOz6GNc7h0avF9wB3o7j4ZQzN/oEWQ3n72PQN//tx+0+C5VJlSQqHwBw1jlN5WvbfEvIEYg3stjkTbqf/MTRhiFVk0KdeJWG4NsezCitgFLR5PVqTD6fbvbmdXh+Qs+L6vC5qJNc27dRR7H8o9BnyIWPzVlfz7hDzhKTXK0pM0HBRda2MV9sCYiDVXTFV05FqCCQdtXyLCgCIIA97+4jcb6GpNWX6HW0KEwaC6mc829xi2YxeRyfiSCbYMbybEqhKhbdJCzbQZilFFummJzWxxfH737nD0UOKstBDOtgHw== 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(30864003)(26005)(6512007)(52116002)(107886003)(1076003)(2906002)(2004002)(579004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rcvvznEw1Q/nHfUFMB3ocpJO0t5xWWel5TaWfJaEt6n/NwJSDFB8KX0QvAOlRCXgc+D/rUuGWMKPj95+cin/pfLA4pzu5TmAZMXFepirf4iOn4g87lJQk+zk6GPI9FIGatQKd8T3jswYKkddPmTRum+kHihOiERxYlwJlzoIO1O741P6r52ykA/MNtFLyxsdtzNqbKkE9Dju0dQbwghCBCzM3ktTc4RGrjPFLkaGNCrAtwFeeOB6Dolz4eeqF6ZFNI5q+mGV+C0TSNFRnEYF/DXb+qBFKH3wWNyI5N1oAZ77u/YKl+5LX0H3mP0B7nu5Xcb+wPdctkDd4P8vMUgnafd5mcbAk5EAqjOutcenA8Up2mhdeg8EC6eXXIVYyLA9FVspZyIlh5DEyfqbAz35pZY680ysMrESEJCZr7OvReljHi+SxiX8XtLSGz06z1VkaG4Lc4pxemGrUtvvAuPcMBzrZlH0H+mxynsjU2RWnk0ZDtwFly2Cwk7q72+e1K9dVk2TT7Zp+BvA7zBl5hHomjaICW70Ib+8hqMfnlXNTasbOntSMZMR99DLetjNM2y3auzoJwcvAr2zIM2vxmWRzvXxs3kLVcPObJoK/3Lmsz80xRw35Hh1vJ8OPflddAyiR1A3ejAep5lNjVoL5eU/a5LMzhXfB1EsrXaMnHq5agkvpSxuzgygFDJ+nK6BCtmd8j4ub2Q6U6G2VfaK4p/6xSV/1wBxghiDZNqSEUAzKSBihtxYLa5gU0lugdRlHVSeTRKtkzutrXjHDFOTnWH77my+51hgipVeDrxUmO000eYBqRd0JqWCYcpSsrvawXrCOf4gG9Osg2vmyUfmgNpkLUtYfW57l06ZXBp/h1RLXKDmi3SpPEdonHaseR0vqWAslr5ntB94yhkUuR2/w3B60SZwpjcw/vDR96dF/ymvi6hQFXRA39ngtyohRHrJD2ecYERlS1cJNuml75UEHxfl/Kn4WEx5r7LfuEiCrI3quReWRtshfCp1dW8faVvz4SAVTmeueaaF6Vehf0Rt3HuUHCa9TMLuBw1PLaH8HZvDTjKwkDjp3Sh29oSBiSnX7HIwzVZ03dLN9JdduC8hoK5s/XBz3RiYUqIKUQCGya1o0YNg/GJwRFZ3DqdFPa1gZLricJIRn5XW63x/A02UdvAC1RIjzbJTlwaDU0ejxj28WPFwT/sAF/ovnjGFn3vREVFuwT2QdtdEO/L9WiyyvNs18Axn0niEdcbwtKcWyz19upgQ7wfs9+RRpnF8h/raQLfBebS2PwEg/UpACTolxJ41JexhLVTlxNUrpxgAgG3sf79yDGaQFTO4zJOmBwm+mlyuun0GsygRMeqTi2P09VZMhf8iRn8MtsQr0MZKlFnwPe1lhk2gaZjCQu1yDRd/Q/Jj80RYpFestXgUN/LJZCUkrTJyyS4C59Zu6DWpqVOChrYTggy/rXNcAb/GshBPkbmDpFnns5YkuWm116Mv2gMJLYjVXGLcJCwEIS0MZ5OB7h+E6ezRn3o+gQiJrLJs1KNtaqVdtjiAv+b+mkb+iOoXunAinWVhP73BkgZRXlz1SQhkc7Uxo0ypLRWitV931m5FzSmA6PNTskVGQMvQp5Q9Ow== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b03bbdd-e365-4818-2676-08da6e4fe2b2 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:01.3956 (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: hIRTt/v//XKx6mV0qovLlPh6wOrnYFcen5JX4BthjACqLjbJ7bjprj/FzV4VLHyJgEMGUxgpE94xgeLBd+RGlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 Mon Jul 25 15:10:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928142 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 0A4EBC43334 for ; Mon, 25 Jul 2022 15:11:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235836AbiGYPLY (ORCPT ); Mon, 25 Jul 2022 11:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235679AbiGYPLH (ORCPT ); Mon, 25 Jul 2022 11:11:07 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 834F9DF11; Mon, 25 Jul 2022 08:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BYatifGoqMtnlMxi0s2IZct3O95m6wUdneqWgsB5An53oAspJ2YVo2uibtBR+uEMcXP92kSuwfpW/olJCGc8LCv7C3xg11nVkzs6BQ98EODwKFXKJ5RkjuwDrA0cSb4YyFxaNhEDQ3Rkd/x0hiI6E3ey1fbK4pFeI1ebMZyyZtIs9LqwkCnCgOI1gOVK2QQ6gtMHuEkcXxG6hHWUmezT0uUWG/n4O5ftnXrkibGjk+szcxllgwcZyRBmzrZNOvrW5dYvLDrP3AcQM2hsVnIHSDBFqWjhaSO4o/INTBthk7VvTuf/gKCiWopQBOM+pxGOQBZPkHut1eh0fMV30gSYRw== 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=lafAiOh3r5TqZPVW123ldK4bgNFLY/6bpDZcF4ZZFYGTOiR7s56Yara47m2NelZvyFKPJu89qy/rLPgw7cepJVDHiryLma4YjyFgYZNnSZrm7SRHQMpw8iIJ3m7kBlHbwXnDQ24XL9y7brR+Vwx/wTndESGOTdbjCrfT5KTAQx4xOY8SsK0KJugLPD13BfNIjYIW6Sel0/lQl0N4hQ2H/to9yCHLlBRhdwDbJV7s7hWC/47EShW5lqY+e6NvRLv5c0CkTEj5FPDH+YCXmf/dCwCpIk6lzkIR22hlA3CaeFo4ju4qGbg450PkVOA/FExTIV8KaQBsjH5OL5mnF2fdHQ== 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=yAdJkoUW3YrbWfMzxB5bMb9yAmcxOTRwLeuSvSaHT5HzQDw9TH+oIvRWBQj46mq/k1C9hA6MlGLsKzWC9rArMQtfwlK6BeOIU8XxnMKt9L84WCJC6YtWXB8EGnRblAR3x9uQP6B4VdeRXOnQQeW9L7Qozwwik9MZxaatF0xf1wmkXpp9EGmv2WL/hci48Vh90NT2NxaJX9JQfN1zkOAwuVyppDxF0to6RUDelorCDuYFljcndO7wHVR78KxQulbgcbISxN72pHS1eG6BGue07RL0usNO391tPBcN7Ec/jGzMRpecv7JkrdVr4Wwg0nqcfw9d2Q7ryE51e8Qw6V5U7A== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:03 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:03 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 03/25] net: fman: Don't pass comm_mode to enable/disable Date: Mon, 25 Jul 2022 11:10:17 -0400 Message-Id: <20220725151039.2581576-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 2b6b1b73-b9f7-4a8c-b0c4-08da6e4fe3e5 X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cvb87LqvSTY4ZHwG+FtXxDRiGRe6amNoKZRScJ4CqNUFoLJ0NuClTGHXBf4shBh2BKYq/uO7zlO+1K9J4lA9la15pwZDQNXCiT+Hf22XhjpUo7eYQreUK0grxTmHms66kCa6ITdrAvFhoFKgT059882wkt64O5mQnDiwC2s0j8uz+oQ6piJ55HHWlNk3+eUoMNZX2RtTBnaCX8+jDbidnYh2uQde0iLbpRdya7KP6GslQOvMa507FUTnmQB1BjEzO5aeiTCs7JTOnMScUDPhL0wLMpQw8WdNGyBPiE+PHCxCOaCkKd6AqbSR4oR+MoP5jiTxREj2eNUT3T0W76RDakUMyCdQAiPAMC/Cey/rRtUoEcJsuzAIuP/Ifr8Zb0e+1rfR90ZU1UtzTk7lyy8KVt6TAjmclpcodRMFLnEXtafU5BlTyRre1w8pzwNgxkrmuzmIfFPYzmtofGudzoPqieQXEg4riuUVMijh8YEPbFUn0K8FqJhQfrVhrUJWJeZMtif7EKzlE8aP8U10ua1wigEVO5PZxpwENe24c1eEoSDi8DL+OJfVkEWW5xoR5RV7Qx9+apJ30gVpbeAANLclwm/VEPnxDq0Mj2mIg1WqfrPBMR7SL5Q4CbTaikZcnQjgnlttoXvt/iPgm512jSK1BsjQcuxNcj6rBStbfObXQRbkXwKzd4hWzFs2199hSG784+x1B6TqflV+QD4YsSj7eO5XOeh5LsVJk2HPkHF6IQoCc3x8nRLuT9GO8hs9QX5+98vmwa5H8/UDcKxAp6GNkkJhk2UexXMG7Aimyf5cUX8= 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: T/DbuLZisGfNhi58UGTdny1lvcxufvI2zeFKuhDRK84/552fwpdBe6qMAEPuX2UVng9tcOvU+e7LnCi3SoP47kDMKtkIsWVIy65be+Xg1mdqC6x4gB5H6+giz9uwFH+N0t3IXOnRkyakyOjNJ75QNsVf4gtk6zBk1CcWyl3l9ITAYUujAjOmLkl2ob0Nm3QXeOGELt1Nf2lHwacwucKIuTCyzjtxEDD1Znw0PJRF5z4GZIf7cqkISQz73TbmqnyvLGgoHD++S64QW/H8EV+sMr1Gob2a60U5onQ4McnW2ALaJ7aJKMZ0tzCUZt7NrOfNnE82NoFdVvrKnNXNGtAa3GJG5629MTwIlNZEO1BH6zh82LyL5yj5843CHwPQDjUq9S9Xv38sYWlixyLQ4XNHoJt8r7aDtwNPFAHJOX6whRuSBxoCdxxIxG2GdV+ArEffvf7Nnao+h088RUVdMmU1olLXBllFUnfOi4RL9V+wsJk59msv+aern5U+k8FNqQvrnRiMr6pmnVqelMykzDUZcO7HmJKsjhx8lMv4DfKRHAR/MqFMDz6zp1j9tz9FB7wQaVapwGV2AZeGLGNLDwSG76R3J4UNq1kuAEktGekuVXIm79Naxb89nVdWPWMQxTpRdiB7l/QE1gGZKfJpk7vXUTuoZWa/zakXVRqVBFN51/9sHaCBVClWf1bLERtYb8bn9SgDdhmmxAwS2L6yWaeZYFI7+W+jZYa/sHKqRz+lmGw7QC6nH9eaHdOa8uoQit4wEZrlNzWdvRHSyedI4oYcXukDu9TDgnEegztLAMgQAl00I3rNGO89ESKon+LXNYLdfhk+qdzeIFXTlTJhbjrQRIT2d7AKUb4pF1XIF7oN//NRXKEjUJ+l8OjRDVvoah8OmpO66lswM9PFfrOfTBJLWnK8o0KSawu00YqPayDZJ0JlZw8AkgscPb3GwLer6ygfDTjkK3rUdX8SGltK6fgc++ckWzAQMPp835iOJtsciF4LDlWlJ3i+gIZkIijTktC5nFreEUmtTB7I1Byuxz2tKNExB6QibWyUV2fKIvvOdB1/2XZBoxI+zIdMK/CYFqaKnqG9opeKmB2vboq3L+xoF12P32LOwfudNYJgc/DHA/zWwRa2EZuPNBX73sLWrh9ZUbqmD842NKPee7RNppj+LFlXI/vi37EI8yhw37/YnRINhiQxBhKtmyK1viVuSyqJODbjzvF0pc2aCdCZJAUzH8kZLjylsEZbXTLFD4iU0/wu0iO1ofHrEPt7TtlOvnSrEcdGUQojLmQtRv6W9YopuzlX00iJ3OJOtjZdhmequxsFc4nnnLFoNcsNpWFP+PFszqLSJyyt2peqvYR5BiCvzNZ6DBKkvfEzC2iQ2DpRfD2ZW6/dC66Q/MIYPkwjp6giHdERvy/7HyJBv/xzMOTQ6wb74HdoJ8ll0QdY+MLcIdyPQWfJqt8le/3CI/3yvxPwT1upYp84EX+/GU0mDzTf6EtI07Q39AmwZNfNtZBo+jw8p+tpkI1y4KvgON9E3CznVdoh705uTZkPxkBRUmDAYJbp6LexcQ3UZptatBB4AEp6maWYFkkzcwSQB0QUBk+sL1vCu/mcrTm3fIxgvD/vrw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b6b1b73-b9f7-4a8c-b0c4-08da6e4fe3e5 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:03.2861 (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: BOvJ2BQ7P75h/EieoJWyzLo3+dL7bRw1sQ+oSfznG/oDKxW0o1CBbNG+E+3yBDc2/rfWvzRlpYi8Soai9mFdvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 Mon Jul 25 15:10:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928144 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 EDB7DC43334 for ; Mon, 25 Jul 2022 15:11:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235685AbiGYPL1 (ORCPT ); Mon, 25 Jul 2022 11:11:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235789AbiGYPLX (ORCPT ); Mon, 25 Jul 2022 11:11:23 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA7C012D2B; Mon, 25 Jul 2022 08:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=liCxHX55nAIaGGrN60P8dkTPIBjuw5Lp2hdSnF0/xrUMM/ZVgIcjHWm5IgAdx1ebFPtVoaB9WdDNYeIKcBPnXM6NB60auvTQYLxUnjET7wwW8h9abaNHJRM5AHgQ9UVEWuq86fLiUBCytMcPiTSljao4Ko/tvO9JSwgrHANCHY4A1xhFdVzraETRc9wVFyeWj3KWB3TasidN439csWqVODrEos2R2AsUT0MsOM8/DfFqddEjQrqq98j0y5HwTeWr5+EDE/us7evln9qmeA2Hlx/X/2exx/7zbDHZKID2utQrG7n/fPY1c6SB0xiCrQUzIQtIHxjGknfAHJhnaAjTOQ== 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=al673W+9dbNI2j7cH7u6Rl8YJxawN4q1NMs1e+gJoUz17PxfCkJ1eey+uKIZNifNslg4SrcDG/wj5GkU4PWG3V9tTqAC/mB3r/VyAviMfnVgwi5uz/z1lE8atX1k5FZsHl/SdNcV/tkAn3exA+2hQcKAZWe4x1WkRLRNQXzleHJJINk7NMSi84cWlIc6NVBJGfNG+TLsGJiZ8n2/RO2vFkjje4ml6lymSOolyyLWml4p214IBkFjwJ0HpWGsCGSr3ynoo8sT0yKUe4p9i4zFQIq894if7TJr0SUHJIzK4p+BJXNDG9y5O5hDJNpi1V3wmRi52j6xyXiRYTSL95bdCQ== 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=0finZS6rnY6jRTBRam/u5+ElDob6BucfSzbujmPCoqxuSjCHQbt9VHiFlAYh/5+rB6bFfi0frUMLS9kD4BJEFFPQ+0GqjwRAtzpMr/mRgVSP13zwl/yuUPvnEx5MFioE3fK1XLpVUJIJU4jCiMWXMoPnufivc8N+r+tdChNPETriAATp0+fjtXp9JAOdy/FOzYhDsYfZ8V/cBwpVFSPGVYdYFmYieGIFFzBl3TEkiE/3hd3IwRPJw8xB9+HCFT6hupQ8v6faVhj9soBiSvzQfUiOpfdD4uSXtlSHu2+eyusXY7+zAGPfKKXdCwdTjibawOscpWs2ULA1AIP0Ehb9Ig== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:05 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:05 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 04/25] net: fman: Store en/disable in mac_device instead of mac_priv_s Date: Mon, 25 Jul 2022 11:10:18 -0400 Message-Id: <20220725151039.2581576-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 2297e743-e747-4b5c-640d-08da6e4fe501 X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZJpWWazYWUs6apCkX8aXkJTfldpf33CnHqolFmZikH+GQzDXCd6WNV1WnO1P0WrQ7NEFFO54ZVYXVPsDLB46zuHVePPnsA2zTBBIKUby6UWylChNeMoJ+UZN85HnDgwyig+512xdKEQpy5SJcS8tiIyAtRS1Yf3/GT/j5YwLD+R0Pr2pUdFliMvJiYjjtZN9TD6i4Ki/YSX3bPLrORVFt8FybXV8EqrXfTxmYJ9kWJUojTkk2J23hTVl3vXGHUZIJ4VM3CcnNQb1HHZ8LT9cOhFgw9mEDgtWEkmWRd0RcHosVpHjAmgSExxEDVq+jTwVA0kO5U9iungtTH1JtYCZvfOCmk7g7ZcQmVstlWfDUJyZoVpTu6lbCMMgbn1AxO58fbCVleSmB6/jFBSGuudS38ZKAmsmK2WERI1sh7kHfmph/0TM2ZUaJSRSJOjhi4rid+fLAYDfM/UAsVqEdt9sNlUqKxthuvf7PlGhCahRB2IVeUath/Omnk/9dWIersfqG48zFlsNd2MudIw4ME3BYOO0j7d1KzRGxAWyq2nwSTB8ozb5RxzFCzuMeLo+E58rg9925WtXR+6zABdbLgH6LJd0m/HE+v0crAKL/dbbd7vGUtQgyrcvFskWI3QnTOPEK5PhAMhqTWRnIAtCOcd6XiSbw88WdkfH0OOyJ2nVfJybhWFNmRdE34NUZhqNsSbd76VNXD3G82s+OpmuydRK+o4sKClTvHgtdlv0Ij0rvNE/WVSubvIdz8QaMcAvbjIBAvs58Et6sIbsODlomTqt0pg7I7qUnqPMcI7ALSbHi+I= 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ufJYZSn8A3q+zQ/LR2BwNRfjX2pvfex5q9uSoM4gCwOgtLoMkNtv26KSU7uzLmCWHpwOAuiG+GVhCY6wKKM9feKVxjeeFNtkoYCfSMSzrSXZLzBObFhBHwj3FJPRdFM8dEc9bPCvy0yBmNxarPZkE2GRx1i1UKB5+jdIbUpJcFIESW8kTVeGjDVvClE2ODyEZ0WwG4MOfNJH1HorCwpUR1jPMRSP+nzai2kUvRE+aZ5tW0xbdZPk2QhtdwuoBYXYZC6exDcl0W1dmbpRQE/gbCBnRSOvvcrY0ZOQl57WQNcJj6pOJP11NxxQODpi7WrUx3GCBwojAPugiXgmUdKQyrMkHmF1gHRRzeJdj6dC1o+MUiYakubtYuXleGWhP6mD4akfHv4IAaEVYZayAxhYxrAxCHWqS2xt6H1QseWdvwogHvPtHeWDs+phT4p4t0YHDVtRLftJAyXR13GqDkhx2rhm1cVFXgx71H93I/bzzphdRJASAYY4wAImjg6dCcVNPJCTWOxxaAxlDtGqkekr4SD/F2B6qNmOrf6RPdNcp3bExKAL9T2i8JRZaJmmNh5gHzERNsx6QlMYrV/VM8gX5ErnVIeNRH1Q+5BCsRQVdYJu3TyFFQSgP6MYYmFOPeZWOMYs6j7l60AnIsuP3bXVOBW1dDYGdfLkZpYI1aOqxcbjzjqDqD2Pb7VjVzlt9AhfEoe9q1QJBp+oSbMFPNIE0MXoEDpuaRG7aHwJbdqXrxOjRUEgwPnVxm3Yc4qLHL1YCnFek+kgWUfeJwiT2Gx4jjUsMlrDX6FCP7clUlPF/f23dPmbWa4M1F07lYqhklu73YXgOdwAuWCQUzO2Io15xum8HbxM/0OBMa1dZo7HbsQBAxTAshHABMM71gycT7hszIV+0TTHP8ACDUqJRNqgW29eCtfiGViSkBgRelidACj47M7KNWi/ltc3ADYBHwiGqdSaHLkEzRS15Rr3J+JEcFz41d8g5q4C89ZHfMWbO4Ndq1/0ZqLplDUKsZIxQqTgXy1bRaHXcth0ESPImh6jsPxX0+3EHjh75yq400PBVpsrj9WTGFgYhtiuRZJ2yjd7uZdw6yJ+107D5TRryCy8JpUjFs/t9EgJGv8rsXDwSxMOfREnQzbhZcCrcw8csVVFjYn852WQ5+OyC5+TRQECOfnotvjkJeZgnK/ePCQY9bXzIQQnYKapzhtqNA9/ueGzLjxtn6vLxOZG50EBAdmy3FyKxkNC0eDEqDiggwYZcZKkH421LE90Q/iD5Id9FvRmQ9Olnu9Nz+upED7b3RWZ9otT3Mk9PntFm2V00oTXIuvn2/lEmqtzsCngVzoLHhjiduZiByT2+40ZB70jyBoi7AzqlT6WZTB/1GOTsOFGFyGgJNAmAkHT6Mrb44QdFITZBOuulYjD4atJzsrgWRExI0CKHYHTnmYYQOmOE9ySIs7avrBjTu1WNNd7D0jEC5Nx/2NwmUIEyg2NAG2X6hoLgU/9PA92fVnlcqEgXQQHmvdk+wRVL7hQ5OyAxtIT3QBIjuVdeZ6jzrAw9x1q+cQoryAjMLDKKPkfZQbG6rhOOtRI0JcVrHM60k+V7LgtgNkgxy0jdry3ihK3xQr2BnYYFQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2297e743-e747-4b5c-640d-08da6e4fe501 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:05.1141 (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: z4MSC5+ECTUXW9xfyRVDymXS+6NpIkN94g4n3HMAFwHnM4lhCmjzLENn43RablVvdRTAs4/H1pEDVUNBYlftZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 Mon Jul 25 15:10:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928145 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 6D20FC43334 for ; Mon, 25 Jul 2022 15:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235908AbiGYPLb (ORCPT ); Mon, 25 Jul 2022 11:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235476AbiGYPLY (ORCPT ); Mon, 25 Jul 2022 11:11:24 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CAF518E1F; Mon, 25 Jul 2022 08:11:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itdSOrI7HJ+EyMk92C5U2Ot3P3qGJGQxn8dy6absoQpjT1sZPFcs80GIDnobmoAOIT/pRMwxKii83CVmyMnfG4tF4+jz5lgYyiI5xSSScf6/oX3QNAHh9gbUMJPqx2KjTT1qfbtGGRFWaZcjKYWdm7plqX9TWGUb3PdqPUnLTZOb5KrVdcZWwzrjEsK/f+5jB7DV27mGIynMUlvOLQi27P4YDkfWyuPgMAth9+RjWHk8urb/BjcqklX5JzirhScT1OH7+7k0w/C+urg6leRDuJSpzCiPxw2PDM35lS1e6RPyPOtfg9OmLR7EvaV95ONfrS6KHNG8d2PbUYf+UXuTEg== 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=RpzL6sWw32tnLkux1lS0yluzr511QMU9x/Ca9Zbck0iztTHhd7H+KcigQU6RjJc8SLgCfMqBDrylrVy6IMfdGxAbyyd2xkVsOxlpYi1LcO4eZhsTfiq587BhAx91K0JYGg46PSL8CIMkapuKn+sH4BbKnv3a84oeWufcblUzpvoDp+O+MHCWvL2IH4/nPVXjm6Pm1DQDPXCx18aSxdUZ45Jaa/bUlMJaD1be6c/IxNqNZi6Ziw+9cAb/bnMCq8FYQXduWFasQai1O3Sre7AIvOsW85/0fYAh5BxjpsgRAKT/6kVWjZdFNzjHSYT2frRodK90d7jBT4ZXR6+5GyzrYg== 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=KyCv3v9J17MZuK2OtCrzWJULdKW5mS41QihPzi6jQBvqWUJMnLnXa0sc8BqXaE5xH459tcRP5sWFg2Tn33d9nat1g2Ia1raWfzGFLVDxaPOQDV+mHgWF1eN5syrLb82qcQZrETXKjh42U6gg772RzAZDggu3N1qQrCv0NOKT3+IzWBGsKqCk8lMU144ybOExU/Yv85yWtvwHss4oN/7YyVXZc6NsCmzxOzUy9xy/iWaXQAX8hPZSxWhfEXgIlEmKFmscR544TPlYr9wBGRSOJBNr1rC0qIzNnu2F2BsynpEMps6NpRnzZXzkj0df6X9hLkIimjkvlpLYhDePXwQSfw== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:07 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:07 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 05/25] net: fman: dtsec: Always gracefully stop/start Date: Mon, 25 Jul 2022 11:10:19 -0400 Message-Id: <20220725151039.2581576-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 476b69e1-ed95-4386-52a1-08da6e4fe618 X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nHKistol+IvQogE4IXIYSrkxGKQ+eDsHWeEFDmMAvjHOTZcWu8Ra2b6rr+4CWqEvGNGQuWGBho/9DWa7XW2eMAIqdcefaUeUjPmETLuFLxq8/MrdID2gdHJ+0jAtjqnWtI5W+MowcWQyTBMpTo69vmthfgx0uXFz5jD9VjSoHlf3ZpWO+8LRrYpmuY15bQFYOqh1U9K0E10A00xxFkQCaLLex9IxfuFEYEOw8VMzSpQHwOMpADVx0qlBMDEPDCzGMUL5hue20YWYZ1GuhXcAbsKoVFEA3+m87QsiKffSZgWw3+wFlkp7oj8IqofHhgORUDhYwfTYOsyylJrMtX51pUhilRCOYTWmbGw0EaU/CB/Y1aSjUR5Iu/u00K05/Tdds1toQvUlt5QT2n7EnHAd95QkftfCXgPeDGMCcF6+Crz4FnVSjw+6cMOZFa5EB5lLr8JUEYX61WBK5zYrbd+lTI/sbe3L69fPFodTHzk1b2Yixs+PCVX8CtqCkAW5Tmgki9K64ZrsVVEQXbNXowNhcxM23iljG1Pje+CIJ1Hz2j2/XnlT7WvqcVYA8QU2aDGPMO0gbQpadv+nsiIsbiXFYCxbkIK7XLNttFprbOCJCFOx6dOqtnBCbM9fqfJGDOyi1nCcFHy1Jj6rtoqb4CWhe1gT2IING270ReQs4ysKv3WaDK8w2vc5w7bvmdR5G0ol6f8I6Q6g07r9SwE9X73HfqelZSK0ctO7yRCta0W3T/GsJgItYVsOBkDYZWUgs3POyuhWdni3k8ebpa2eoKpCwc1//1594Aq3/5xh9j9GE+8= 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mx+q1kmkmYUKfznfwRl1+tvIU5wZMehMOYmjzabNPu+zswrI6JZTYArHPqWKdiqHxs2dQGt73ogNHJKwo4mLY/NeBwyw/HZ0B1yE4Zs5f7kgyd6XNrBjw6qyssRd0xKE3/pZGjA9hmOqkdrigX7fRJSaRckFlxVF+hoi8x/YlckMQ9jThZoWkUTEOhF42GbYiyGrDAMeTSDdPK8mp6tPGf/3hYnpeQ9eCMR06ibGRKvKZgWSp3vQFnpWzv/Q9RFSxADqC9VLR6Oo7Dve2+MvUtpWWkqwj/oMzVxaUxrLFz5/dXk1YtikCMW3CEyOY0krVi7KOHGaZjc813Pg/7lzmankj7mEC2D7hWpVpSFjV5Rn0x+1x83jfNHIIvcZIUUV3kXo+CeHBedJQ4rM7H89cBKYsRUJ1ASQwjW5fTz3Y7ETM7ojoU5ib5QqZwzwU6UV3eQ5OBrDWKpiimHYOYcaYEtGXapCrMHLRZHTFZT4f5ImSDe8HnsiirrHYlXbAA5QvuwVuw3oEk33TdrtMYJ2LdYNb0nPrmfyEPLB3V4YFwRQ90+27lMEvngugWsqR8csFjKYpE5hp8DBVbOZRPuAveFqzABO3iP93EeYaySb6htVeUeymsU7cY8Be+BAnQfqPvtfDnIA6Sqvcxx6L/gduG/bvUaHmtpvMAjCgQ4ft19zLbHDNgNEzfVd9nM7cLeLaKYi7E+ZdV45jcFycOVOxwLyE4gxx7b+eHDF6AHLp2Rzp6G1mGcgOwt5rSMgmyThmX1kuhUchvwi/5H9COkKDdSqrIJ/WczJ+slpuWPJE8v61T/0Sss4eLgqJIOV0nUYWK75jwNks73V1aVgEBmFcnkk/+4xVMnoP7WYB1dIGAcejWt/AI4u1NiCGB0YA/BEg5ZMR4EqmDAkK3DS3rEl2bbLX5XVHFbmuqKRXT2X5c5gK2Ds+CITvH/LocCOfe3ZdSZE3NJ9Eacv/ltXxb+krEQ0PHefIBXS9SovOGNuIsg5mkKQt6guDL4QwEhXj7ZHf++qVuWMUNSfD+KLhizZh+WLB6zjD6JKnNu0HPsQegPlaekURkGCMmneN4akw175Kz4mobeLH6xo1GHQn8PTDTxsoKZXP1ni5PNW6rVDNt6Ujg201pq1qIAviDbLwGRN512WvPspxD5SgSumrdaynUOV6jfj2lFrjjpeDEqgtPUK3BkC8Ky+6A9/mQIDV+L6dAOeZ3QRfpLd61AobyXeJu2KvyyoL2HyTD6X8JJ1EzUZXFmvCaJZTytiqN2pZbie8g/jdpBIsDGJrVL6tSWzbo0QkKHWvW5VbLkUYu+b9xwWx2kgpmPDEIAdn87mEfanra/OgJl6dW1X1M6Vmanh+Ul4yvwjHAU5H6VXqf3hBjobaVufyzk0gH04hsGkwcGuwRBMiJan/1mc9Tnp8YiJmygbVbUkx4Hx8c9sr9gjDel3e0yYV7t9hH1mzvQkAs31Y/1+z6oTdL3qrboPHTof9nCWs/Hg8Qt+WWOlk9eGbr8/LKzmAKos1EUKCH7dyAU/bmI2ehtP4XbuOKU09MXBiRRCfwE59F+UGWd9Ka/JOmZkJFyXqYu310cdvRA8/Q+VGtEoX4UaPQm+g2ozZB+QDw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 476b69e1-ed95-4386-52a1-08da6e4fe618 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:07.0203 (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: l3ZRsFx2qbGpaBSinImZiS7ZofUBpyHSHy/j8RTPUTvVn7gTVJQOGi4xwCXq80JZoP0CJsxgqMTo/H6DYxqcZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 Mon Jul 25 15:10:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928146 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 63EC8C43334 for ; Mon, 25 Jul 2022 15:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235835AbiGYPLe (ORCPT ); Mon, 25 Jul 2022 11:11:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235840AbiGYPLY (ORCPT ); Mon, 25 Jul 2022 11:11:24 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF53E186D8; Mon, 25 Jul 2022 08:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D+cc+5touLdySxcvtChoZBAhuY3ng7ygoLVxlZX7qCUxt4JxQczP6ndJ2fPaYUqbWj2Q+CNtdSPOaxZVhnOws9+O2Y8RpEHwrAjXRcLdIIv8lQaVseVUy4bLNcr6Gv9dAV8h2gkCaOQQq0GVKSVGQuSPUKquvWKcxnfYhn/rZNt+OhPq5JZGMojyJZTztgcPPKkE+4T3OLLY/3kn1SuHAV7nHzIJE+o6jYCdZGOoiS0GKNmhMfsryVUBPaev5sAf1qai1NLbcko1AZi5f6aDyz4T32ow6lCkP46bladpQGHzvsOlHNvZBuBpJHQfMe8akOhxlcCGXCJ8Kwg9Mp8+/Q== 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=kzLxkwANXSNc9UqAt6wKtu0qjYn0uCfAlfBs8qqclN/FLwWiMGbWpavsJm6tk76U+vKZhQDYSSkG8F8cUv7Iy1KYD0BJDjg+q5Hvqlgs4RYxgx9qAc+ZwKIAzBd5b47BLJUxskw6P9BIIw/RVA7AE9NvZsvQl2uXcSYJ33GBu0i9vjN0QG47/Vue0Y6uopsJNc/BPoAvyaWe8y8jE4keuOM7rXHOxhA+oFpxGdFgcukGj1LlUsXVdJ6xC3c6fYKcUr57fz8b5g3IIurKjgrdj0pPVfw0fvH9HrQGC1VKcSBey6OSJliLws+ehmBOeyHcAG7lBO92R5slFd4v3OsPMg== 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=t00mocFGigi/57JjMos3c1KWGryevoBiH0cyMviwc23aarStlgWxtZHlbl0j+qUvywUAON6iyZFl/g+g06RRMFpOmIHQAJUYrBonV71Jp032e1mLWQ/+AWugVY7IwgMM12LGRUv93BTiWwLDYkk9KeoW4J8d2WNVJcI6v+zcTaBTiBI/GtQqCGlOW68v4X70h7dWtLJt8EQXZK2wspnXYQ3mkRC/KOUbLFLneWW1D53HavaGsEHjU63Z3SQbrrHSz2G0vRdr35SKDFNPOSpL6YfzjnvknKb1+NRptJ2Sn4LdB7dueDnKwP+EtNR0uVLQUr6DiRHiBvM6+BG9lxxi+A== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:08 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:08 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 06/25] net: fman: Get PCS node in per-mac init Date: Mon, 25 Jul 2022 11:10:20 -0400 Message-Id: <20220725151039.2581576-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: a3370923-7b06-4d83-ca8e-08da6e4fe738 X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LWx/yidFVIFN6HvhXRjE/La+pkrYg+qv307Wp5sQh571RHi8QMDuK/Cn7eUkfmE94Vo0nX3EmeuLHJ4dvCvlCQSzOCpzhTGNOCssAUbcRlKsPUYNfTcAAPr1795vSeiuZW+vLd+F1woF/QyHcus+xSNKb2e+fZ2RMlmZIDZiLx59SHXoMAXNcRb8XvAC33QSN4X8inBP94SYkK2nYLaSWvqLxRt+/xaWRFIn7Xuf/tbfHvfmEEDNk9p5vYa45KHko6UoE+mAsVuFuJ6qMEMwA06aXS+A/iuImz1KwXZFxWd/X9gN65KsjqgcHJDRf2mRHeZifs/1gWdhhVShbiMQT68ymayMCsqYdPSqUGHW3bQWZsoLo89VTsLd9IPwfeUC82iSKyg1t2a714X7+dC7IxR3hHWDPTNlYEwtD+FZCJhPR4ku3S/odLlLsqG7xo6YPvJY2/fw7AuiHapp+Fdz4Kjx6PJCBr43RGL+fUuKV0RdZ9+1urCtMuJaFNDU5l8QuiZNamPWs+DO/6KmhC527MM212vMYgBeNeQzgbyGiM8KZnozC+u1bS82yIEg/t9MKatzpNUL3UqiTVge1rzBU1QKs38YRNZTLM96q/+7i/2U9CYmEq6UfWyq2HBpq9sEXbupilgmeVQTFQmDstDrIbmy5Z0XpXQdxh9muFjaGTzY7ItBgQ4+7uUVXMVC/lgJhLxxXVPzPxb4ENlJlKmOijUqbG6Z6omYrCgAMFVGQmq+eV32Bjl/GWfPRRSQqjGIC8nv6UKLjhIakOxKkBkaVrn21Btz4jfpmbg7j31FzsQ= 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Gwr52nhdGDyg+8DpQAoRrbCQWb+UqRXwTP9EFaQNCQOdDfrgsEJKzgS0dqJF6GmjAxPVM3q30CnJ+x47kPAAEV26yAiq7UVZobOaeHxkKLHYuTDkpCt3IYPN7kvnoqVzcrI8tYCcPx1rxn0cTjdj44bVfN9pqHui1BxSmfdEwvaPr5PNZFKUAp6mHQ1GI337MqQsAZXgd1fBvYJDWQHrhL/vKLeCWnYqrLdWwgHXvShF1dqbeK3dqbqFg7yRAZqwIjBW61d+Yik7mJW52UYV0owS1YcvEEpBxegzLZAP73pqJ9bia0LtBJqnPuVoY8BvBVaWQQPJkL9eK5oGjXyA3nMAHggC3KmIVEFi0UYEMjKiz8hiy06U9JdsjQylpPL+mqu1J0/a6uJrHFonB8z1BzOmBjOgJhQdj3w04W99HDc8p/oCvzRz/DfQCceE2NeCLRuXnYHgkOQAFNmKEODDZh4pkKNPEnQ9q4wLuZX7S4DKmXzHsj0/DaUBFC2ASw7s/oWHPpwvyE0AsmDapV804qwn+a6Uc9LcEcggoc23YS7HOvoJoR48EMlbIzS6f2HyOhLrbozUT68+IASWrJMJvSIWmgOhitf8UMSAZc9vvVINqobFo8raAvwKQ0LIgl/n10nX9wq7XGVrMFLaIfU7Ey0rfuNZzlG2XHFhYiF0OxKZLJFUCjjHN8WjLVGmfxpWfXKgJ3IbVjhwDhLwA3U/l2YtnnGPCh5mKMGwTtu0nHVPp/5MWuFoxqRMMuqCvF+ny2cS2X1ljc3zp2xKlBFc9m3TkJhrqT08pgffVwPXLTStY9+n70YuC3ggbjcmB89Nt1CEaueZVKk8vSKzTNs6X599mYD+Kwwo854PGp2xKZAdWfHOJCCxXTaNeuvfFO2SA8g6+34uAZT8KGJK1f0H2sKxSBpr63grmaqz9aFr1mOnp10nnOrpEc+HLZxHEluKUx80Ld/VntXvtiGoaNIGKoXJxWxwXhp5AbGbp/cOfQCY3dizd417B2/QKobHwuhm2OPh6D93+RBxUskQtkT9fdju10BIr41oOwEQZr9qeh9371gPsG5+qZibmH93BwBOQewZDSgUEDNwg6X1TAYtQeRgKJWBwv7VTIg9ta6lsXFPZwwXf06/KZsli0Qcjx8Ax17e5z2VK/alg+sJ5KZkoZ+Ftfmzlna/qeKgBqUQam1NQZPS1jxPOwn/RHY8peBH7iGixNOphoxCNnAw+fiIPdcpGwoFNz93gzJv8bs4dHZZQB62GzMKQHP1tiBP28ygw6f6cd4YNkUVUJNG66zPcHLzSE234gKuE9EQTmU5dz5bdRF47sDXZoPHp62bp0dC6PDcxMnSD2pU/G6N+lfBeZV/gyf28nqeruN4ZA1U2QGfDrAQFX0E+uxwqnhqlHIDznEuzJ+ekhcIpPnP77Blqhh9Q2GskFOIOC1Kqbx6YuNqlYqLKUEp27AtANEgpx/qpSfWXXLBt5nvGczv7J2BhxdkvEaotdgtWT7gx2t7v0OGSHvs7ow3j6V/Eft0NSU99vbCnvzdhOm1/12Y/aOkTOKS8S7O/0y9o2F7l4jXQQuS5sckam/pcmyRRn2Hq58JEGbOIG5KDeQ43mzemr+k0Q== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3370923-7b06-4d83-ca8e-08da6e4fe738 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:08.8170 (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: KMRogFKW0J3At9gztaTZv/10aDsJ2Zg8WzCn89m5O/cCt4kuHqE5Zihy4kQQ6u3k4UJTIQdeOQelvhbq9DmkwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 Mon Jul 25 15:10:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928147 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 DA90FCCA473 for ; Mon, 25 Jul 2022 15:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235840AbiGYPLp (ORCPT ); Mon, 25 Jul 2022 11:11:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235753AbiGYPLY (ORCPT ); Mon, 25 Jul 2022 11:11:24 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3502919031; Mon, 25 Jul 2022 08:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ibhG6odQYGIpk3yUj8PXNC3x1Uher1VdzcqTp9E8xbx7jXnXVEFL0M4zveaxsstMWortxXUXW0WRIzTCLQ3yUa9bwQ7ZseW4lE2mUSQfNps/BsxcYUzQzuenpc4v5NgmO41cwxc7aTcpbFJOQ0eQ9JCXq30uh/r+BH1WMD+XjqH64jfE7dL8OWtfIMP9hytLHHWgP1T1ZdX/FgojZAdHDK2tGe7RN4S/4/F6zzuBoa6CX9ea+IwyCsiOPTviDcGRKh34fIS9o4m1tbVEQtS3lQ2+VgHV4r7FvkOOa6Ytp0N5eagTxOme93P9gecccUCHSQ18SVyeEYyRculDeUBd2w== 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=H42JxlaUiI2QTBB3aziPE5e+yp3XMrP+CLpm7/F9/6nFxs6Cyvu4aQI/yHnX6W2icP+UkPoJly1rCOOrwSfe1tWb6HhDGKGaecM65UB6+cvL35rI47IaR/eZsbqOXPiEtxmGG2b5EgZMZxjrUYD+LEkhPoqfVCnH62xEPJBLzcE/dMGYUfsu0Hoks50626jNpW+4fkwUDpozASo+rFGsov/BMG9MaN4mroo0C0KQALNKBFBB7aSMjlJyXQl+IOD6ekDxz9WX14CsNgzov5EwkzMzczOEEJmAC0FTyZbl7Qk1kYtAWi1qQw2eCsaLT5ArhDZDF5CfIQSkrC+TGKD+2A== 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=prqE/BdQjl+7H5bvk7hVjx8L/pYKO9yYjEyb3i4dZcMDOYn298T2zB2Ep2rmJWJulRqeTrpN4RkiVXF9XnzkNLxQzDGRU4+4qPMLjPvj7EelbwS1sHPKi5Us0O5fmwbYOkYXcii/aFg28MTPCdOHO3bJKGnRKW6Rr8QJW6Rd12fcsaycze8/sz7Cnc3UmMgFlXcVUytH+FaiBZmbH11BSokrA5v3JpfsLyvKKBxlsvQhJcT2wYvpFnNGpP+stt/omxMd7YTUWKdaBaaIS4Ke8L/Brm1QaWVf5ktfEXDSBFwbMWkyzQfykVwy7HOZ314zFei7bAo6mHwQuwQEir63Ig== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:10 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:10 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 07/25] net: fman: Store initialization function in match data Date: Mon, 25 Jul 2022 11:10:21 -0400 Message-Id: <20220725151039.2581576-8-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: aa0d351b-7c26-43ba-9227-08da6e4fe848 X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ibkff2R0Tx/R9eH1ot2ZxbshKUaN+MPaXiqd/VwcxgF+f/ytXeC6EWv7euzzKwB3vr8dsDRqt9WWGjp9duurbTBj1mXsw7bmPrHB4g2ttAeoo29I4V+iE6wspwf0y4gxsvEMmSXcrxXf66mqEj0WyEsF169e8eKjwme7K+lh+UtJmCWBLY27wJ7ryMmrd9D+6oye0chWa+iQuh8HOvJVk60c/SNvmd40cRirUhvm8r9PgIqRpAmS0M5dUCRe6zTJZhRcBP5PPa4WDV65A9/Pxfa9gsL0dIARcX7SJ7eC0Lt3AwqvukPRAluNH2XLXHFs2U7+/pusTttLZG+nzAiah5NCoAJRilZjL5cguJRdxzvO7sRBDo8uW5KWSf36euVUvGyRNv1eUWpGlkFeJ0ZTGSjiAK7QI6+qB/bydd08U9OtStFbmXvkBf6WFF+8WXJrRotdC1UT9953DecPxqjg6ZG7sxmEAwl0Ozm/DoOiHKVF9o6ye21IgqGXdrBbk0RUKaw6igEOj4nz9Tggvsr1vgvpHzuBstvxskNwMGtFYwxBx27ydUMsliH1Hu6kq+ohV29D7N+0uRA4PanJzLZtLaX4fWzwPGWfIcEMS8Cb3FObj6fvUI9lBWNkrYWiQqmA3d/TFmN9JixUiMW4XmPH/BAfFC06dFDqP2InGII+S++AtqUxB752oDkXIibASCXZQuP7/0uodp1pRalDXGkqoc+SctzUQ+N9IvLD4gMvUBSBPW6ukGfBlJ4x1r9RI9IZKFjPLVmJOXmEOs4F2pqyKfGbKCUTSryki6MdqGS4n1Q= 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(30864003)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RLhaj8rcWVQ54anJWpXboEDXh9msz84fizxPEovgSpcryPwifBJkUmj9rDHQb3TjKHMZhn72KIvLRkhoV9pyEla/Gzr4RJIUDjOfeE+bBuAvUY380CyvoTxorGMT7BNLYGOmANnUUceezEJ/v3kqhAB9d9s8sbbrLLphFH6lO/UQxdRdE6M/s3CiMDuLMQ2fFTf5EaHERV5aOe/pquzmxPJNcyi+XpOneB5FLLefm/gOZj3UIale4Aew86TbN6fiG25Mygc65j7MONHlTM6ebGKbYAHA2djDDzg+I3TBZO/tveWqWJ8RU2qf8P9l9nN1mOYphDnJxGj6sxfiBRZXFc6yHripbNKb/qw9eHgeR2cjbDRp2tf7Ygm8dvUVivjsy+lU5oXqVDr90mym8ova9MMjeCUbzcj1Moec6dJ+A3JbqMBZmlxUyf3oTXf4kHPW9SGCXWpAiN2phGPQt0piKTnl3E1WNvKwofix79Or2aRAkj74KrV+tY0+rRwwIHddYABGI1IRXKZyAsvAstdI7k0OHWEETNrMRldqxmotWkHHr/LAMtUUpD7cLFvTv89UN3L9TuwyfVfHQQhVABuK5Ji4P3O3FkLqRK630qDKQVvO6dqRwmUXh8memwadxfOfnCZ6YJPlpaFdVF56zSFrk3VdWPS5LU4aDMlOCoiu0MtTZ+32U0AUJnXtQ4U7dLJxhNFcLS/rmvXaJnz4PmNwQ+AhgrhpsN33KBUSfr3ZgmWIpyaCMAGCVRSekCpvdDQzm6bprdBwMrY7v9gogAmq+EB3ZI6AWnYaxKs+qOZQvqoWMJEBLxJxiEdSjPgZeUUpjdi4ofYe4HFMszOJIDvR+0+6U4lmlQfWdYHM+BDhVRwxQYI4JU8ikbr/c50RF19P2LJMDCM5Sm5BouW+Ido/tGzgQsPglIkfvFHrIDJDspk6HqaYdE59rANsGdK+39wy/PfLJV//rcZQmsiVuFQzp20H74IkC2tQGRmD+JtSNCgWKhWTH94v4rjys6umIeyKU1Ww6fkFg4Twdk36V0k9xNJ8n8oN8uUMVSWm8OB7e2utnTQiKrA485Y894HvP/tOcrYYE4utBaBPpQslTh+eFXY5Bzj8ewVZda+vunEOG4m6K8nXgYeOfIyga0ZoNuu3xUidM/GlAfySSCndfxX0JwCvU6R89JdnNjxm7/f3pSzzHgRI93hhN3frBJMbUPmMP+bRBlV7CdB7rjt7pQPFOROK3IpPUnIag7+VBi7OAB2X7LX/mBl7s6rSorDgbK2ztOG66lQc+5bRanqOCUyGs8mB2HXuegEkKyxb2KGq4tt350cx9WZgNyC4n/obLAVnbZQ/fM7Hmi3F5asSEn1v7yB8Ss3Brc9X3AMX5UV+dx1fRpfw/ZgXkauKGLAonx0rRHj3bQ773+i8n6velglgoJO3Tf+zFOOGYIhQhcUNpY/CtECOf/DuezY7A1JM7e9YLCQVPHyv8hLNJhWNNYycRr2+2VJC5yi4t4FmHkPbbMsdBjAFXerRH79n4kDMoxkDKYwSsdDABo0nZGF0yfhb2KXpCpnDaA8CCVvWqVd/9EnpbrQ9yBTnYCXjGn3kG8uxBySGDzr8Gsth28cZ10CjNA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa0d351b-7c26-43ba-9227-08da6e4fe848 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:10.6919 (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: LK/TOR4YX8p48DiifedHViJvjmJfNKIvBV8NYoykxMd0dBkbJb5EO/bzZ4ew/olep+mJ8et5Wl0OlzZXZtkLQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 Mon Jul 25 15:10:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928148 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 58189C43334 for ; Mon, 25 Jul 2022 15:11:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235956AbiGYPLr (ORCPT ); Mon, 25 Jul 2022 11:11:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235858AbiGYPLY (ORCPT ); Mon, 25 Jul 2022 11:11:24 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15E8F193D2; Mon, 25 Jul 2022 08:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k1kGb7O0pRmKrFMZiS1TAG+sBJho8LcK6oia7kbs0ZAntj6H5izFqONDin0EdFBPkWuP7wbUSrP4DpKne2kp28dTx9J+V2G7J3yMh0YfLCjWzpIb1481uhrDqdvEjp/ecMfsroIm2BaKSYQfRUVKTUFAp9xWeJ1J02qnXIij0jYmuY/V5t7dguBgruXNfUhV7ISO6ZskB1YDt1sJRbRQs6fS8d3QcTTqy7opXhRJOLqy1VzOYlPjTODREG9zCYcsrgfoguCugs8uquqE6mBPnlXU64ZcIiW37M2eW7w8gXvTvpX81YbHYZBL6R8A/bomglooLrS0rnaqDxUJJ+wTiA== 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=Pb2mH9+AZzHevysMzHg4xQIO11O6LXCnejODvkHaNgrNjUL9tn0Ic5oDu12v7kMLdUCcEh7Ruj+yjZKo9iJkEEXahSU6X3DtzwDtqsvnXAX0xIr6HE6d8LHtg/N3Zm0eNggnowC4wvGicElfryvUx6x35rszcbD9XGKpTAjlE47NRXZHwRB50aXF4x6inHY4M442Tf4f5Sl5pZLm+Pj0b8nN2P4CrL//4cTv4GxkGWGHdeZqsZuvqJv32ojTq7hOc8ZUNm34XdThQL6VDUKIN6r95leMtdv9eRd9TA07tIinI90JRe+MVgpsFUNj68LWwBU9A49mXfCW7/ZGs/683g== 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=NWE/jcANsfJQ++rI8k3QZTjG2suWs2u9wCSX03txw42OKu6wIUGwuDycpT2Yf8rmwGT8aGpZ6hMjprkpWDJTPicSg66nosa4dewdH5cooTA9Pk+MRfTlWpDsNT+KgL73adqhCMTtvXCjvufrKlMF48maVQOk+IVEysAi27Hf82xLhw0DxjLqeACWmJhqD+n3qYcNE7aub74Rt10RH4PYu9yf8ybHZ2EV/y6mdWl7KP+vX8I+pG3pZbvm5BS5sGyrqozN76zoZwhUnJczuNCGywvzfykuk//XHs8WrK1eDSKZ1EyMc1a8+mA7LCDccNUP4newA7K1Kwk8LO9wmlsjhg== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:12 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:12 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 08/25] net: fman: Move struct dev to mac_device Date: Mon, 25 Jul 2022 11:10:22 -0400 Message-Id: <20220725151039.2581576-9-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 4d59d2de-799f-49b5-ce95-08da6e4fe96d X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HBF3aJcvcZPgMYHErEOEp6aRoRKhU6HvlK3wp8WrHKOgQPWkcss09BsZYOW52uSmBYUADgQDwvmI43Gfw9Af/IFyOLgSK79PMCm/j1ThaBpWvDowoVUuUGBM2MIQSA/TR8+pCMpc+h8Z0RrhccBmMkEllgfU8pnZ66/gCU+BMC6ReTixNgtoyTy+rosoZYm1xnftaIVqkeIfdFJAzHGgqg9QtARE3UazkcqSxVJVOfxL9rAW0TCL6OL39msd1FwqdShWtfpAjqxPtcVDVNXfKVXWcgFbfEzTI3mqAhcw7cBh3lduG9XTq7r/Hr/ZOBsjNQ43jDechpjwtcVS3qb4gYB3DEB94XRfu3NAx7oUMPH2UGSKT6sf3sUMC4OTC2KSU6gIPrsP6YX7ZVcwVe5GBvroSAYcF+i3JiP9z01eeHT7cXB+kDoPlv6JUrO0//UyVv9AJ9CSmCfZ6Tbs5OJMNmQ6MoaCjungaPvDBZIUNHRRtszkfHi8M2AJAkt+y2iN+eh6r6PQ0i+m2n3nON3rNbpy9i+UtMCp9cM8/bxA0ZKK95EhKey1qQxMUTRqosjIfxUKGrpeA+81+3dHUGJx0aywyGHWGn+uoQV+uiXHhogL9x7aIz8ToVKtavM17EqoTEk0hrM++71XGew8lpwPUt7dO1Agec0uxvbUG/1Gjv0PwH4Q9yk2uw7zoPV2vxzHmi3b2/ObQvTMI0/QeRVF4CPOhS9rzQ9pneR2r9orSv5Era9XfbLGClPTXOLr1TLBhuAA7dqsvCMg0SBT0RzPrxYXKO534e8Ix4x40SAQb/Y= 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: W/ETnwbf6ONS7sR9Z4ELTQ/QmWSIYwmqb5cHQqcPv36XSBXerkgBjURy27vUyKn9zUrxHexy4BL8a5TZZ+OW5MLugqkk+cJBub38vrh2izF9DVfY1k1lJGZjuC0OLzJTRWwkLc9sdmKhMpAfVD5sbB4UxDs2PYx0dnGm/aoUAz2aHOS5pOg1tqrbmklUpTik92sHAqq4zdfi6MOBcjTcGkXPYboeiX8dQ1WxnSJIYo9otx2obAEQAqoKjOSoNBJwME8qJytBdmSOIoJO/quGUPDLjt6Y+wPF/GUZ4YGJnsU6GQZbClzAgwrnBvbA3ZbykBo2GHr4MSQWin8iFEx+3gIvbM3VJ/o7xPz4zUW7a4B/cZHz0OSjjdouQF7nNc0bMlw8E7GjMqDjOw6AS3P6gUtIZ4bTdVDMlCGCOymaUVyRodsOAb5PNQwXjWqt/fIuSTDwJn/ZliQuMc27SIFOTQkeGRgjtMfjNV++i9WzFiHS3ocBf8TfGZUdwmv7F/VOHfC4YxTSc88YKkF5UNqlbaVGBy0ybRww/WX2oB1aNvy9PDAC16fpmsmhiC9M1WbgR62oOIY6+cEnQiDqBYLeYDZ+86hKJc3rsyID853VLrYLLpL7k4xg9FOdTSC8CSPN66JJffm1kyZj+ZBVhXvRii3dWwXHzNIfH6eaAjAqI1tUGKMf7UiMvMrkbZMFGLDQI1eve/jlqMYB+NixU9ybMjazWzVEIjUaHC4D3NKTE2kR9TxDwt5TchBrmXu1snbFRJTeCcr+yDfQwmiH/D4LB8T6Eq4I1v1DcykV0VQpMzrdfygUjzZK6ttbD756MlD8vHwWw2usJTdKAy5rdI7zsc8Q1+bFw3meWPjwJubvYWwZmqUg3X+u0mykUY0YRFhnaHMqA8mhhpiY70DOJ5SeCnpx8Fbl/HC8DBiRV8m3tUk67BHV4DILjemCG02FM0cZ3Rr++pZgUVAqqOR55WtZrRW42QnCLepykK/7xf1C4U4V+xoG0qkIeGLqo8umJokrkiPiUWoLJs/hZ2loUc9bXGolbC0Xx0RDBduyaVAefed58skYWMbIk2JmoejSSg5vz/1OFh9oEPrLKrx8qiyVehyT6tUsD9QRr61IVmHCxNGmhVPW55uxCoxieEs2V8T+9Hk1ezpkEv/FOeQT4q1HFLcMR9eOP/WkwPhItn5O8qojigONgnHkFRPBvgNU6GxvBNhecbFNqU5RzYUMVgMJm7SpJK2RhaKbCFa6+rXhDp6zKaORTgENWHiG/mOdsMDeiZ0bSKLY8KM0Zy4Dg31jZd7iuiqaL9eododH4u9vZs071l/Z7t2+oXpqkt8xn1C8Eq0dkpST5J+FO7DAsUE+dPrYQJc1d79LyMmIYvLeh3VEc/edkQzYzFU8a8r1rYvdQYhGtdDn2hsyUydt4voU5K0zBHIXJxYlrUxKJBjJx7sXU/eQV6xCL7zRaSQFc5+vbv6nqButWmJeBkJlNhQ6LQFFyWuXmH7uOo2T2UyilNvKIOz+v4D45PoPbsVHZHUNv7vI+dlq9V3pEmXkSm78ooMEhLqZycZPlz+bYNmHFQNredRt+h5615eQNqcO1rUQNEI2aAdXsSJDPeq6JAcICw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d59d2de-799f-49b5-ce95-08da6e4fe96d X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:12.5199 (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: WQh1qfDEKZK6J9g/sOzw7g66Squ2EhPjgkxa9mggSsbhBw+eihTjwhWX/EKVL2tOB7WNhS3CJEzmumoOaJ6TlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 Mon Jul 25 15:10:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928149 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 0D052C43334 for ; Mon, 25 Jul 2022 15:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235999AbiGYPM3 (ORCPT ); Mon, 25 Jul 2022 11:12:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235869AbiGYPLZ (ORCPT ); Mon, 25 Jul 2022 11:11:25 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B65619C0F; Mon, 25 Jul 2022 08:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gOrjz7hRZS7AqIV4j8M1jxkHB15bkJdiBZd6oWXeOrmyYfN7a+u2irXs4SeOjVespFny1JZbl5Xr8CWiFKPb9Ja6pI++ZxaPjBX8t4cBc3L2evjOBbvj6CioZKtRnibPoEm0OiaazJ5gOdetv/8Il4WVoh+CvfIRpulwFGwFvvczzpNyfgLFqxdhhibEV2peHugjOyH56b/RXfpVXkfQeEZL76oNbyfXPSj1CfrjRcBLCdZGuqVTQvTa5hMmZ0DoXpKyEU2YELH4GbG2HGyvd+CCX14CEkDZJR+VVXaPZ+C9ZzHHc/ZQerIsg3UZMQP0n6mMFmfg6U9z+qqsb/0JFA== 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=QdXnvdMxiDhoICQ4r1Oe6VvfCkthf129TzMD2J1Q4leMGNBL9PzdDXv/oYT6F3F6z0abVFt9nx6PiT/jSwj2pcgQIRrSCvj2cIsaktMKMXa6hNl9nIwKL6RuqW1bIDShRq0q/XcLJ4j10EuIeyyD3dVNHRa7DUB2RCGrekMpDLnzPDvQZa7Zjv5WQt2w3s5JLGKdrQgfY/lKDQC3MM8cIR37GDLfZWy5rUybAcHfijZTOndQSRVmw43Wf5ltdOyI6WfRewVm+MciHygmZB2uHiwCQ603F29n+dfJY30UJ5fQzW0SQR1GHRuW6yVXxJT3vVtJh3lYEOPCIhF+CYxBAw== 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=LzshjRGWZhYu8bsEixVmBKXKjc55b5xs0ClEvf/8RCzLjvp47sw4yTbWMMVYkTIUyr0LxOr7xxf4rVKY508m6fldVGOx/jt4KYyhUC3z9+qD5MNKYxC8PHr6wD3Sq/yH0FnSnJMzIt+iYm0oruoNN5KcHgrh+OtVVTXlFULLuW8iEkwwHC+Xb9Yill9FHCJLU6lxIoE4gFgcQdpYwG/JQcnGRKzI3+YcWUUdk9gWkXYjZJJkVGyxLLDCD6dJbvkjVF+a3+5h4/fDD0VzUwia3ei82/bYcj2rECbnMm55xzJDDXbnh1jb9vHvYhtl0NlhfmYq+oq5zaHCPiigjYdWMw== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:14 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:14 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 09/25] net: fman: Configure fixed link in memac_initialization Date: Mon, 25 Jul 2022 11:10:23 -0400 Message-Id: <20220725151039.2581576-10-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 9efb05ce-6a41-4e44-5ade-08da6e4fea82 X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qeimUrH3vPktVU8ShkVrZfFi7Sk8v0cjUYIF11OSNDFvyMFpo/TtHQJjzY+kYHeqcRVPIYqsAppk6uzCNKmB2Sz7f4NkKDz7L+EXkkM7iPsQjXsHgZpAKH30OFeqV7isoHhktzRaqUz/cZOEX4Cs5HI5+VepYAkeFBwoEjy1VawceLw+8qJt//EHiW8p3cW/OS/SVO3dD4h7GdSz/IgDSlUGlwr2cadR1Mq+whfwwIpmnRvsuMTD8PvM7y+FkWhEYqINokz8heqweBF8wOFxWXCrd1k1fD9nB3iZKe1Xbqo0GtuKj8wtYX9jtGyMJZRCbDqKmgwlrURp0/GnIYYwy7TxH1jakq9aT6nNq6fGwbno/so+nGzkbVMX0OX9QfG83OBr4O/keo69cv1w074lR+Hgbs/PLkmS1Q8aRm/pSqDzLN/WiVLkuIJ8v1zvEMoT8/n2w933JoRrRMIGnWBtYKP3It6rSpIPo+13sCgF0TiLKg9p0BigE99nQO0InxYdTF2eN/LSYswy8xzEfdZODCwWxkE2bgqnEI4YVLpOSPuM2wwsIF6YJtdKUXyiSLj5Ed/308BkIGdztLpxWdHebiIpHPZAhwM6hDP63bQRFhoGgOwqfU1DEXMhkOjaNN1Rp8+lITxs8ifIlB1SCYMIfos29u5fkbUfBssZ6yJLyhJJ9ySV0+x08rVm5LqGrhaoCdzRjwaNCY9OBqabB0oaqnHTMslf9iuMVY6dA+NhIKIeeYg22nabv6YOt3Ly3RCuO72C72ETw0z3h5TWJKBpLL/s8HQEMa9ty/PGG52YScc= 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gvyDbx0bTedxbqRJ8YTl6ikOboqEtWF2u8F9rRfY8xpiedd9ZaWTBzZDTCUfp/wAygLsSCTPKcA1iQU2hMCLMAebvuXN9gxptmFzZ0jfJpO2Oso+2ufcHOTym3Nmthl3OOZYik7dzICB4X6+WS2GSNtYijP2yPM3FoaoVmrHa2d/h/Sh98wUjKfx/mOS3IHqEbbMdmq8pn72IeLvtJJ7c/fL8u2L38EKx3tLDcJAus+88OYoiFR7DHjMoF+XIAqQVoBevxC0CgwtEoZpvOEj8c75by9qkUxAOZ+6eWS1BVw1ASSQShw18qaTnNX0e4pqVmm5suVFGhmksWk28q5JSdNLvFEtH+93iAp8E2sD7HUqSZtHopMRfKmlKxeVMtX8q+BQ6ym2mRqmcYaK9ZaLHGFctn2+gaQjBzXVvX9gY1ANN/7OgZegaJXRtBTkd6sNQbaSw9vt6Xcevwk0vnTxs6o9aNHzlZbO+wgdAzdRec9YYr9Xdk2Z0xcCErRExgZY7TEOp1kmp4muCED3h9sqJhKw0bx5QpuBajlrTN624TR31z8NIsDPXRvTEYo+aZkqURE0WN1G0TIAWYF6bAA9+lf2laK3M3I8Qj1eqbNvLBrS5Z1DXGysuKTn89NrmJcT3estPe1Niz1FmM3dYC1dUhQkBfSCcrXdnOVnwKZ9xAsKhcY2ebMSlHXxuvKEmJvcZ5UPYsLA6c/N4goxH9oW93C7Mw4ofXVFKxEm9rfzifzYHInxgO91HJlIB/9tnm31gsKv4fNQV9nDnMtA8u0ZIhmrPkx4tdXwcuOiNK1d8rdlaWvgrdIaSP0yhS40oIdDDQ0J9q4jUtkEgLIEUJj3V1aNwf714SwNySk6oKHjZyMcwj20vP8V8zFm1682ToFwBk2zwk0U4Z726tuMgovUOJu76GGq9pmpJkHrgQ3IaToQi1+IfdvwNGzPQwV4bj5tDZovueFpwAWq53kQwv7JxnuC7oBQmu4wexdlS+53LJwxT+txFt7jKkZ17k1Uh68krX9WmrwCouW2PWGl8MXoEu8l+iwCbMedym/Gs992X0qZdAG/up8VLKguHJAUeEiw/iVpwSMG1DFYN33axtj6Lr2PWfzH9L4VRp6vccW+9vItZs0zh2fct9c5ED4/G0sdvpIQ5uqVwhGCVyyUcg5LM4s/ds39hwhhcAZuLXpaPLljT7/f6SvWWtmzRqktFgLtliEN4KYkbE99ed+6aOlprSg8b7aWnPAR3pWeNiXbXNXlhEWZlOHBVPsW+G7Qp7C1BwPWQkOagA40Yf8lB93STAmNvzlu4nNOHTQs9Xi6Vb04uIlrsUvqH7/DpBpFv/1Es/8Hn29O61rwKEL1SzqHR+7zYXI0MhFfX+ekQRcdOubNQBdldMi61vMQswEKdQjEEUtt03PCub7mZFxtsQgnozaKO5KmefvKt1q5D732oln5xSjhy1rP4Zj8X/MBrIoEa2OiPEGzByxiP6NcRDX8BESvt25GC/F1/gTHUUZYN62xAi5T/pnz1/7w7z1FWRQHL2Tzes8VSVU+SqtTE8WQSTbTZx9b8iu9AJBYzBlE8SK+yUpti4rkeqki4oT4X+OOjANi3iJlozoayb8FT7Ow+w== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9efb05ce-6a41-4e44-5ade-08da6e4fea82 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:14.3323 (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: 7Ub4MrcBF2hHgLUoF/IKL/Zu/brhEnaRzIqdO3zmuXFrURCoLzNR1mGzm1eXxhcseTqkbEj60zE/tuVWLucFLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 Mon Jul 25 15:10:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928151 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 538DBCCA473 for ; Mon, 25 Jul 2022 15:12:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235900AbiGYPMd (ORCPT ); Mon, 25 Jul 2022 11:12:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235823AbiGYPLa (ORCPT ); Mon, 25 Jul 2022 11:11:30 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB8BE13EB3; Mon, 25 Jul 2022 08:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fnpNSleJdSCUoie0I+iXtrbCmKS0xTQMBrEvn/mio7OJHD7pllFG8P6pFN0jRdmc6tLerSa3ZWGTpXj0nN1YUgrQoD+MlKDzWptGYo7F1PfhKzxSm7ZTxH7hWkBAQQ9bOcW7Y6Or0qLR3uJz9DB8cQaDeg2yHZdtvo31yE1YOFZhOm7zbuj6hkfasuMshmHRlNoa7/z+injWQZwTBmjdwuDv4NCslT9wLonV5uPwTX/9mjt5CVi/CqeKqVx6HD05XBw1zDorTih2j8aV1q3ylwnl/n1tTmC4Zbs8OYHlVeZL39a4pL/BBiAbHJncRlKHpyU87U+c6lLPkc7jnckigA== 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=beNOGhD5sQ1VqB48LFKEZfWm3NhcQj+jUhGGtS+GXr7KpeWaXOIifUOHebV9NElXqb65bnwH8EX9GE99gDdYGQUQoTj8m8UtzvYnK1JAP7Jv8LTvDd0qdCk3ebQqAuqF7Hk6fxiZ5eLXK5zQU4qYZGgKM55VGlC481CzsJ9/tl+RCTnCoLDrBulHbhkTKAwj68HEKG1xZh3PBG09jmqk/+LRCopIIbhheeEMHDAPxi4Wx3x/LPHsgj5TBT381x1SelteTKf1/9V60XxPnN6u6C5hyk8kAQ4r/5AxtsJgLLCi268etFAld9U0TeV3WbsV9NosYopdlY3CnCN+2cq9GQ== 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=xLOz3181AUypI2ysGsEPxvMK8Jpot7GI3S1PSnYWDBYLGjVWJkTBKKSrkU4hLqWjI7HjcxOUOW+0wMXXftm8zlSMmNK6D/Sil6JOdJvvUpSjFDUwAX8Dh6ut84sjMRQeW2EvhW1I7VW9p6ou6y/XgMofZxvq9iD1gfBDfS6Kho5FrzTeF3Ykmvu1+c6IF2jIx3b93a3IyT4Zw8o/XNkNtJK57MTV51iodQansMC3ZHl5gbHds5ESMeiaTKB2S8Me+1jbLEq4FfPS2qIyLeXwZdCwuGqtYi5tjNNCScDQBY9v6g21O9G4XgPJAubb/fgKh6GF29yxAsrweBiwYzqFbw== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:16 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:16 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 10/25] net: fman: Export/rename some common functions Date: Mon, 25 Jul 2022 11:10:24 -0400 Message-Id: <20220725151039.2581576-11-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 105b6ea4-b07a-43c9-84d5-08da6e4feb94 X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5nK4aSutn8YMtZWQLyipnYdwj06zBpl/JO4D/nm4L0Ahju37VKxaWFPBxr0nOxq5VEAL9znFEwVFpGl7RdXFtA/iHQIk1Uck6wtz0oWFMhAgBLevFaC6VQveTmMQI2qhqHE6kiBD39LK8SG4L66sMOB+iww+2NS0KM7/mMKJNjqRshVFf/VNJFij2phSvhtIirVBEAc4iz2r2tnnuEetjJlBtWwJ16jE9Qqac/uoVvjQ5MyjxpjhrMd+MzMvJzRFgF7buzxybNGSi2s5DM7ilzj9l4vbzJmWym4V0Qf8Yk68dhelj+jcSc3+anc7JXxWQTBLKcgRgCZxj3VJ0Ab7w3bTp/ktt2yny05S6sfSVGGQDfmT58TCAKQydMKiZZudp1sCLXX3snEnTKKmH/dXB32AzdxZh+TEWw80BKLVnQuFSjQ2unuoFG+wCwL2xjlhM7tV8ijruouJjwgEZJVSCww6NMmhTra18o7Zfm+7GaprnP0wyeF64a0gqC7fnuWRFpllwH/UPZvb+PjJbuGK8tsQoOTxjeH7CLxzn1QJd2HpFpmmKae4etwAjEFpxsizJTtzBwZw1Sb/B+Nl5DMXUlSdnpruQs8KnpzvJQHK6fQC9iv1mb3E6nZwBnHLjbj0McMsKrUBAwBNQpiq3HJoaK3govbNKTOTCgJ3a/kFz8V25uv9FaUbLfFdRRsqx/s8ryxe+v6zcaCfnYOcNYPQXlXzR6T52weV+FFTjO6IQ91ylYRQDX3PVrm2ATtqwr89gmkJl00pDDZCSKlebBki7Wyh5n92o/21oXNHlQVqzwI= 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gB5JaBIbm+S1ZbQSkW/HMw66FgI0dyhzRmfSq0ZXDMrafqCFiykYA1C+a7eBE53vO0G+NSkdR0S1ndGDGPdwxejIr9ioTIwIebHUvp0Rzlkhy44kHV4/2BFEil4y1kGFEhNs1yN6QRTQDQ9xbztKFZK5Qg5/RVD5dDWuUuqDGYclsa8dIUrcOwNGXT3puHb0Muz3XYekxchzZiV1tPev2fNnYyrlKx9qskTp0Mk6KTbrN7xvvDb3Y+XQ6jroncKefEjBrWS8vs0yl0WbYma+DocSnNfbava40zDdFJgZ7khvICALbWASxdYsEzCKSqipS1qBz8JJbGhXqJ6OQHg8oLyKt5/0fGH58Ewge309Ewnis2QC73xCmCVQYI6QkrKqiDExEw2ovWnpQeSG+pZaFhX2iUJT70MZxElZRjSF8OXWgIX9POtxuRibb0Cekc2IiyI1P2w9Ce1e31r4w36+zgCnGPhCXUyq9deuafys2q3SB+UuBIJbUpXJv58rvY+y+bUCpUnR+zX1g9N7VPVjJNQV5UzwojKPUtq7ljo4CptYhqwHe0smYDWYnVYPocSo22QiDOVCF1qQZx8OFBJbDaW+zMbJsWemtcGTcq4WwglNPVxaF+Hn8i48U7pHfMYVLGMa2CLcvTPcqhIxcVeOjtLpntMNBeXcGMfRT2E0BneohBS6bKd6Sn7T7EJbVeShH4jWLA9ILi1jF0Po/nKeQabLpgdQ00AvPShUa82z39n4GNCtzoqyseIGWJMxOReL+/39HvpArwr5yPFJEz1Qxf+Md/f9n0URGs6M18uvnjii6KZHuYTkqlkK+5TYSVzKAszpBjAQg+EdnNwrcp1xp/75XuAaTqgeZmjZ1uCiG9nxRBQRaohoKAxydOV7vrpucNaFA8gmXuYf1amoZKqdSQTHyYvnl96924nR7tLB7qffYpyNGPW7QGJ0CsxxFkcRiAwTxnxOA8LQEa47LvPksXvFWQTTQ0guMB15UMf/FkgLV9RS8nfickEKs1cN/6Umykjmtv3EWkzMHsE1fqtLX71EFgjQgWqSWXkiNJ4pB9apLDS+pWFPpK6uNaP+gyGj6DfbnYjFv8rxftoTVGjFnmOEc22fYw8LF7ZwFwSVlDJmlMgyUlpMaQCmOrZ2Lu855PK/5puD+JWcq9EXy/RPn147JuIth0MYLA+f+UhKFJzNM/vKdbkGNnLjCl/o7ryKwTUXOVRFWGvLdvQqQlRbh1kwgHbRXm20FwLW8SJz12ZSoaHLemWBtET8DkUf/uTti9bAfoNzQpIitZsn/TDEzqtZRlEJzokl1pAVCWrdxS1WoBkgVZYcUW+tllhJh2HiGEcNClnlhPZAmXvV/u0W007kPuQ3BaCe6AmzzUop9KjCSdyuYPkPCGE+UxTxApsBkr4EDFMT9eGiqTJDdYeE/thmAEkRTfDXfXvmT+ylEpBHWKoMbsc9Mji06ODh0NoGxYVrCr4Q78YhbJe1QMKnqlDObiYYuzCglM5F56Qrsaz/6th6oDxm9chT+/j0f/JqhbglsLige8CfJ5s5F8wdV/Ssizu7aTLmDLd/aMjBLhBERMksjVcWpehirPMyFQJP+tuXgfIDkYykXhrRLLU+YQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 105b6ea4-b07a-43c9-84d5-08da6e4feb94 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:16.1447 (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: sA3k8i4RnMt6+beHxJsxR/XY6J2mrzeKm50IKZZcwNxXQv/qzkJlT2XM2MYXpQaZFVHYSBKQ7pyVhQLdMO09lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 Mon Jul 25 15:10: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: 12928150 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 A28A4C43334 for ; Mon, 25 Jul 2022 15:12:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236021AbiGYPMa (ORCPT ); Mon, 25 Jul 2022 11:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235873AbiGYPL1 (ORCPT ); Mon, 25 Jul 2022 11:11:27 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E29E1193E9; Mon, 25 Jul 2022 08:11:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VeVJJ6K3/cEL3ltURXGdVd9NmXRsmc1gRjEH/Q19c6SGDV7I0Z+FpiD/KeoGEjgbB3/SkmPqqQXbFiJ+RVKwgZInat5MmlH0J0byS3SORn8jCkYdCD/UOaCPsHEZI8apMOdCw3IW7UJqIf1CbaMQUoD4iN/7qYVTkuuF0AMJ9T5q4EF68ljBdsKC53KWvMvjKkypHwdczhIFrtBb7zI8zGDpWFgqS2CuRQBrTGMMgH+5Z8e994L5ZJaqF4+4Y6s2EZ/THXHGYdC0OpNIWzefsAu59AdrA+vnwPAuWn0pvm8sHkXzJgs7hjItVzjZqZJ21mclrgUt6OrvGsKdLwZoeQ== 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=hnwo3Yg7kK0aBSBzzqDV5Ff8hjsoQ7QjvU9L7M+OqUbDl55ufPjJqpJcBnk+em4EVPe9qVPkc9YNs9sA1Or1OY4koLAESErhgcLKuZCPOrMuk7tusCWzVOCTiGlKivNkvQoYi5A8v3MEdS+/0iuQG/GWAZIjIU+Iot97/HpKy3U+ZO3+quETo5XcEG7wI8Fs/Hi3OZtJq2TknCZ0OSAPsvqTLPNbkRYFuFo+/KfUPzFSZhe87HWZgkeqAjBCwR5QU1qC1frMhEE57lUjWczXjC7kNaW7/RC+VuquxR7TC+cuNxypsJ1hTVSc36t16wMnivoiFq44p8R3C6lE6kBgbA== 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=Lw2NDVc7ppNq11GsFfIqHRdIujzWWBwDVFBygOSlVocb7JPHblTolRqJBHnY1+hlpuHiFcZyL0Bht0GJ21jt7xZh4Vx9JxHcDHw5Ks7CZAJWXy9vc/OuelSKP1eI9PcLjcb5Alzt6bCOJ7QsC2100q74BoZ7fkTQHaerCylWY4OaX5IeFArswA+1HvIsSL6o/Y5rK4PSvnLfVWYBggMFtgRHz8N1mkFcKgHJz7BvlZpHlgV70FddhghoG2Tg/Gu8hL96xsQXB4WCx2A5TiRhy/K0SModl0mJxmwvTK3GInLPzN0lBR1L4o9sc1MFFV7L7jbTPd1Xh9L7uOaG+VbKDA== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:18 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:18 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 11/25] net: fman: memac: Use params instead of priv for max_speed Date: Mon, 25 Jul 2022 11:10:25 -0400 Message-Id: <20220725151039.2581576-12-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 354b5a9b-8223-46f9-111e-08da6e4feca9 X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gF61q32NfkKyXAeyEuaCI6WbWI6eQx2AnOtuIwP8HnAyL8cziEc31qprMnEezDZjsoNp8+tWTjTxnGb2EAl2WOzNqW14yTEObl0snTBURbxWtLBJ4nSBt6C6aLkLeA8logLfSqRanl11kXDIzHizQZwl4nJDhpQT2UX9dGoOdObq4YXWZAAqDn2Wbv/q21RmMr8bopkqC2BF91ZTGBtR5BBhBbq31kbFcwm/jz/pGr3/YONYPIGL3NadxJnbQMYcVGSEIDCcP4lGOjtYibCJxKCoTSmv/AaWTBQZ43D/G1fnc1a0A8JvYtBZbfxcZE8jnmar26dgxUJi6gaTf519+pcppNZAN2pqLhpRLXi60/Ib7e+Ci45qRyBNTaQUTtDNxv5qMx2svJbw9oRRns2ZNMlrUfw+uVFQcYJFGIBJwJrqAwffvZw2JqbuoGANzXMycvT9/UO32akZiTThoKrKAXNfsR+R+OFJYiCRFj1rrpv/ruaCq65O2u9x6p5+YDX0EjObyadguuwQUXiUQGLwCRKO49pJuFWW1pV1LQWVx4iHdcMBLwmMsq6TDsuv9VizUVKlVqSxnmO7Z4iQDQY+6UFvHS1Nun3tBOsqtVj1qUlcq3Nv1MOPua7O5Bs/qboP4ePJAr3PUbU+UGe363EkG8t8NhB93XmOpZIZ0Q+RfAE1ft7vH19pTsurtSSBxNMsrhN7tCJAFiI/+y9LTUSr3koQn2dIZIZv1G0O7E5lrIfY7farUueEY/4+MYPF/55SzmOV9oL9ye2RjnwwrfB4BNeXgCJo7Ch4cQjZdHCpI0o= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(6666004)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vh1kLrVsXcSAbAlHz1XZA+AOhxoGSvaFrzFE7Z5Umiau49K8fLa9mVfJ6vIyjjoddm2I0okK2Q1WVfyNTzGaRO0zBiHcU+Mv0j5udaD81Uh9m2Fk+51cknziVOyvPhhiQ8fpxwBwOkDvBvrUoNKIIP6rwDxmFpe6+jdytrdod0Oc+UB2kKuo6T9UO3VoTEYmE1RTSWiPyvwHZo5wGdGF/6ciWCooZnhmx7tARBkbucovYFvKLT6qP+XHClwt+yQfIdzmHAwLG0WN5dfx63imVmDR+XuMSFS6hnizGWvyxe8I4mAdBT+cbcPXAeDZ8mESkUytlrUNnhiH66J0M+F9rp3C6vN0Z9HCvmoEUH25S08DCyJvkMRAxHZ0mX4HfLo/inSQGv/NtfxCvM705DrJGX2ZYLRgj6rArsE4e+Z4NzyC8hrtF5hAo2uizznmYiWCbmQeDtl0menFvDY5Y4L0h9s7Myb2rtmwrq+H2KwrVbE7YeoKP9hglLD+i2pqijLKz/UJksJJdLVBYjIlZq/9qQQgxBBL9Dgb2WnGOFtCvfJ6YvoC/SsK/HA6//YfQvTZhLbMPTb2Qoq51muxguVt0FqFhhsVu63w8ZnFF8DUAynbHyQZsTNvy865L4N3wVocbCnKtpWgVLdlBQ+k3BAwJbl4/1XKIpL5x8qsF98Jz3z4X2sm8W5gMwyHpjuvieQIh6mnq5ymPuohqlc6B1QRMyUxrShPa0c1N8d2vN8rP7JG60i4Z82Xi72R1ZHQbK6/XrpMuUgkx+VB52L8db9NIIGZUKl4JS3s9BrQqE0aRp9ukWtuVKj5d+X9O4hoZkpk3B35Q848kVfNdQZwnpDTJWmsS9h4dl+xvG/5ZfNcp4MeXkjXdE2mK/Ui+YenM4rhKUaYblyhXpJAbRRgEBVS/a7k+cOX3vIw4q1uatNLr4OyZaUkQIeaf4A2vYODLPz3va6kUVJxU3WtQe/RUlnGIrEr2RW1JAEY61jS+YP9FEcCSULsh0vipXy71a3Z3yALuCSYQFUCMr1N7Vu2dy+KR46HzksbaWDipdj7iFgeweC7ci6uGGxbhqroVxCQlrd2RUEGHkNccZtTQ9S/X5nPxGHTYaIrPo1Sy3SKKgtG6le8ZabnqiiHipm/MihwkC7jtH+hsFT06NSIO6JUrWWZYU2wOUbqhkmJguyXNchRhwuEAIkpzy2tqEPFmFoSAZyxvjRZN3YKeDSk6spo7O0z8km+3XBTZKRam88J4xZPam26v4/89sV7xL2g8zVQB6LpmAPuHBsmjIDTMuIyBrbKZielE1gbjao8V5HSQc1VKyfrVGi6Eyik5zZBrXjmLkdqWgR8n5AA9zR9BY1v8qzJAvF18zLAVZSlOQBf6zquYQ8svv4isKCZghAAcAU3bjTCcaCUF4HZf+wpgreMUlzJG8YIDfGejkt+bpXDe+yFd93KAepjUhN49AXJnAZYAnpkdtdrLWj0Gx4sfw4Ajk2jChqmXXZnmxFHN07bufL+PHiSvpZWN1C1mA5MpIpBrao8zNNpCBvQQOn4k0cbGT5ubHUFJUZqBN+p/lvncdQcAIsUNTQblvOgNTdygFpR/4YkxKjvqIO5sSrj2Tx5RLdRjw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 354b5a9b-8223-46f9-111e-08da6e4feca9 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:18.0664 (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: +C4T0vsr/9lP5TWE3TNKCp15PJixrYyrEHbZbxM+Fmhx0X2oOc4cXKnatM8cBfPX8SKfcHkRf2NSv+adUM17EA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928152 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 047A8C43334 for ; Mon, 25 Jul 2022 15:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236045AbiGYPMf (ORCPT ); Mon, 25 Jul 2022 11:12:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235891AbiGYPLa (ORCPT ); Mon, 25 Jul 2022 11:11:30 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5188265C9; Mon, 25 Jul 2022 08:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PJeDduocSEToxAVOejT8vQ8HTzav6SK5VkanIcIt0Zan+aRxv/UPZjFT9rBBXA71zuqTv/U52pklFPPMKqpzk+Y3T6diIqsVONKKN4mgERUcxXks00I312ojMyBjVUSn/irlE4//1SUmGqy0CZMJKakgddpR96OSKxn8uxbuvy3tNlwSMbMbxsIk2TFx9nej30wgAWWMbApeDyjzMTA95BZ3cLZXDkkD5c5ai07Sxwe/iZuzexRXNlLHslGu78KGO0D4jI9wPPoPXMZ0hIWQ8fbl5urgzw396JMNGYMCjyEhQUk/8v/eytknmtG6jDahpUrMWmD1do4TEtugcnHMzg== 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=RQ4QvALjJc9Z7FUrqvWhvaGJhvUUKh3MC6QhnCenxxxrt3EZmNydXejbfR9QS6SQxwk1Pvl5OpcN+mZlKs6QS97NwRjABZeKGv5SR71Hit9xbadDa3DEGkoYGTQVIRxx2TABrmGiW66ShbLmezhhhnDVsiuaBPQC67BeAybCT6V9E/3kVDB8+Krw7yBE4nhQktReoQOQ00FBVhYHmtQYvMI+WOOILZe8/0kYxI5KXYQ8rkxkEYbwyQ2xtoBcTMpOxXIyDQPcC+WUNqSoy3McXqV+F//QVhrNczSzNqhUw0th8olHzKoJaZuVeMgOuCg/4yiCffBvdAsS9IcxbvC9xQ== 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=WECPIPS6rmlepmShmi9ZBWiXtrzPzOcknAwLW6221t3zJoValfbocu8cEmqoENkYwyzrgA65cfznMkdWzJRu04o5YzcnanrtzfG7k9CWxMgwOFiws6Mb0ZXa+DMIBs7PEaXZXrf3sK14zdJ4mc/UfSLlL3uzzVRUyduEIqUhsYNFuaP7SVUIg9D3Ux8CGbzxtdBmRaSVA/chBP9bbL8ogF6DxNhe66k4e7bKUiStzmRkoigN+IlOXw9zf2Y9OHWNYvC7hoSW8EJO2SOYFy0F4dVJWgLitt5/g/MoYgyPlLQPOOTvkRxnqccIeiwf2cJskk9/f/CNMk4LUbnv7gR6uQ== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:20 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:20 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 12/25] net: fman: Move initialization to mac-specific files Date: Mon, 25 Jul 2022 11:10:26 -0400 Message-Id: <20220725151039.2581576-13-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 613d4469-9fc0-4733-104c-08da6e4fedf2 X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R9BTgdrwZcow9D/JgWtMyO9Kqyt55g4WsTil+RAv3gXBwq9Of4G7BAc338lZLtIMkUGez93MA/IatZdTVdLKWZ0IEO9084vUTGtstGz2XJsc3JbWgSANmTUrvaQQAYYL19OL0NH/hSZmHPECrqKwQ8vaT/xgQ+v5PRyJ4GmYxpY424rCqOeyAU639z1hrvPbwTHUJmwAHfCA1IaGznR1XasbQ8xkO8bvCwDciQ375wcfBqZ3FK6nP//0oZuuHOAFRPVI/pjz9EXittIEJfbj4c/zXFgI4RKu/BmdcXWcur/vWlK7b8zxOPPxKUqIG30FppuQmnm6STMRPP/VCPJoEPgY/NSqwVaNak7VAp51mzcL/N921hxmCcLnbkZ2eqinWs//PwMgVD2dH9L7Z7JClhxgkDHYuZiZN8XxLWEa6BsNrZzFM5cIGQ4Ap0LgUn/oH9+FCRorAwC/HuE81ED1Q08EjfMbKV6P1Wg6Khi2qvRsUVLFii1uKu7j8ewBqmNaY0qcBRtGYubbPimJjMnQxzOGC8fmPB6C+PaLbnhr8t8vJubMpjqbJr70n0x0Zi6pv5SmKGFadgNSDC5vcN4Kc86tpm5uSApXcjyKzIsSZu8lP7GbMz9SuT0fjAE9j7YfJc9JiYp8gNuPkQBhnjHgQcjUBTl5DXVQqZ6QHq4L6FTjwg8LVZjP0Xemi9geGPAT8otWciQ5Sz3sY1SZUpYgO4fCpBdWayrl87Pmz+VEG01fsosA4FTkCgN4OEI59j8qa/LCYg4s3O5m4WR/aWQWER3D/2n97x1hSTez7+XCKiQ= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(30864003)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 65e+REeM/GOI0W3GIXOVW2AgP5Eq3ax7SEo91s7F7MK/B7m883z6N6WNv9yzPGbld13+9c/j1xUY/8l4uQ6y5hj694EdtCRP3vHtUV6u0TaP2eGhj3cub2hijDeLSTxT2kLGSjOj3bh3cw7zB7THfx43+XBnZmJ9diDUjTb7RESyF2O8PjV0igHT7rnE8C+WtmPVZ7J1KTtdwJpizl7GE59FoMO9ftbr8PSsS2zHpj2DofgLumYs7H/hJ+Ea08TA5c7T2eyAnGDicuk0RAZo6Im/UxrAgucXn5vdXcPio088oTwnrojxXlNsSdpRHrD6ybTHwJgaQQdMC09o17oOvh7Dz8dSVCFZkF2NfvEf5BWI817JnLO1h62uSX/UlAQwzkFeB0LQigdQYuFiLVnhGtMyB3qKSEVffNcRSynKopw1H2HoNm7lsKF7GsUIAmOWTPzW9gPSlGc9sbidehzUzWaoAD3qXjBnSJpsnR7p4D8qP/jFCToB/ixGndc7eYNipBX+XriW5LsBSPibQc7HmU43Z9hlG2R0flhYBG96IzrvYw46GKQOU3QseIUhp4bGEDNMu4AGUWkbmOx71R0eauLLxdX1Rwk9CTIlOBUXd5EqyKTeSgoXc+hWaxH/4yFaoZhi+LDLmjCzLFr/OBUTZlBlBC+aAxpTm0geZdibhSKSDICgPeyXRV5MISTeu2ljFJB/hzbTA5NpBvl1nTlH8xo1gkS02PLgxFfwUhI/qtBQef/4/5dOt2OaE8/XGsDxUCntmcrrqRZ93aonhJyaF9X2cLvA9Qhqh/54G7NgClBhnmgkVrIHEOs7WzfTFzUedRDfcgoaQF874Nxr7PITKXzT48Ioz8zekAUW1ScguIWN2jx18UZ+Bz05i9wPDo7FhWIrApPbZD1SD7uDd5cll71DDqlu1Yz3XIHuflwtU/qXLOCZsGVtE8Sgf6xQUYwl4Lem5npc8J10FGcAi2TyqBTg3kHH2yrDYlDi4nGZyrg9K0a/q6RCQe4FBiT3sm5prXyIfsNs3suS241eTawf3lrL+SDLxuezGfd7GIZO4xzkM6wS6QJZDSKYpR5CT0I89amRjuBk+VwEPKkhD9WD/zE9eCWwzhMqtci4MV22DjlDoH/CtaCt7PzztiH1uuy3heghe8UK/opPNA6K3Hus6jNXbYNaBYlg8O7S1vtzgR4iGDYdBeYkf5b42Q3U8rvv6V/0fGX1t6q7qXF8jQEl71g6+VUP+4GTm6zJJfBquGLblaZ5oHCJER/8YqZvwORUgtVjFKgHFPn7JbUxUuoCSg+vpgNYeAZm7M5RzBPF1Bm0+55KGtYnJ/Jz1mwKytXLKA6wly3CnMMDxhkioMoeozf1VjhWnVCnRam+GJCngNxCsmb1YchiF4Cz9RHD16DxqC8wX71GKaDvEJ+ujbCyyHXUz3RF4Mjerv7RBbR1XsxUw5FgoGRO2vzMZnl/uznxYclI1Q/4GqwY1zxL64/WtpsDfYLXr6ucsy28RDXm/53k1YQZuyOar/METqXLeCGTEs13ruBU5NX9aScKtO1/0le82kQOVqlqwYucjaNNZGemmSaIGzyefsgZdRolMfJDWAs6v7qIRbBkuW2QFN/1QA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 613d4469-9fc0-4733-104c-08da6e4fedf2 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:20.2069 (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: K1xq2MkuTUSLBLDxR/UwrGSmV2Kh9bP6fNW1YrPsDdo6i71tVwTa8i15GAkYkrAVnVoQqljenj+gd1PDNv/bhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928154 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 856EBC433EF for ; Mon, 25 Jul 2022 15:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236070AbiGYPNL (ORCPT ); Mon, 25 Jul 2022 11:13:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235944AbiGYPLo (ORCPT ); Mon, 25 Jul 2022 11:11:44 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA23B19C35; Mon, 25 Jul 2022 08:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NwJEyK80Bu8mawWxQnrVR/XeUJ1wu9RmciNwJwLJTMsaTml0TvErcRESxgOLWH6VP35BNOWBfzTb4AdUIOKIMSgy9Y/rMyQQF/cbzDPRGMFKdM+JwLQMbPGTnIUZ3U4i0wKk5pBf+7kqgTSDqGbFkS7AVq/i0Wuc48MzmBG+tpPPbuAN6TxOiJ8Lm9tsDDFLdAEHm9m+a4sO2bCbWekuA/yBFCtjRqbBxsV9a+IOivDVcGr/c7dvfSP27g+xuBlfbgRtHzSkIpUGTmM7i1ofodHLTodSGQDIwwfJphWnjd14WvS6/0egb4Mk56cdNDDq6v5VooOS5LTOBKq6N93DnQ== 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=JCxGP9iTDC8i1y0FeuuRY2IhLpyTiuXz1d1Rulh46xEUTlm6LWf41bjuJrU4YVxqI5yVJX+CoMJGvDUS4wy6goR+6bAVKRYWd1QlAOS3KnaZkXe0MEDPzJ8h2DLLMzaNtniBSHli9gSVGIlFA0ty7xwXnxG3HcAr23xYcDl62gKEDHs1MKbpU0cUuTgLtHs2byrTbsbrUSPZPFRFFUfBVG1+Bt7UnJ0YeuMnH5g4wlSDFWcofQ6oUEEGcSuARedZejWZlxriWFcOvQ3OBuK6R/uUmaX12ufMdWOhEVhPX7LtEcixIWscV35vgfxzFpRdA4UTJdjQw+1AsjllJr/OSg== 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=uvZIQ2wO3Fv/S1zfL6ZJrz1GBNBV8X4+H79x7ToF8Fuo6eOJO5F4N6j9gOEfeJVymYtoHZR9qnUCH8Y9DLdzoOAK8vAz7GUpvkFz0EOnzbdD22oHl81vvlqTPhqxNzpnDBj2HrkapePTmnuoHzukDrT9QDyC9qo5Rbb/gQR8Pe2C6qMGZ7NUSDq3jl9UbYi1EPSFAMSHQ6M66Xf7iogFVtqoLqJpqlMR1230uybwEu73AQYTpLsCyEwsUk9pJ+JFycW/nr608dBkCVZyiDLuGLdxu+sdijrgGWXpX+ZOp0Xeb35L75iKKnL78JB9ktD7nLSSgaaQM/+k/drjH+nGwA== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:22 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:22 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 13/25] net: fman: Mark mac methods static Date: Mon, 25 Jul 2022 11:10:27 -0400 Message-Id: <20220725151039.2581576-14-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: caa46b96-b26b-4cb2-4cb2-08da6e4fef17 X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gpoxwzuFRpXJHnPJ7lwboQYArVmBC58i0VOc+td78qtIDaE6FKLwVuSqVboDufmn3MAfIxxj2EkKDI7VPBkDuiR7wBe9rQJagnDYeUcfwOr0Fn8FMgc0ZHHjj4JVOnYNZjtg25fpgzexZfFdAy/Afqm4a+5nuAVo2I5OUT7ZC98BTPCw+r4xjWTb0i+VDObWjCytCXeRj8Xy8+RZ/vMHBlqUD7ScXhZSL7udISGqE5L1NfgoViInBgb9V3aO+5zFuSEhfTaFu8CIEfQvVcG9UdCaHjabTBJQF3bwFlfMeOlyddLQJyeLRiBss6NzWgbH0M2ew9ibxu3lo0Ad1juxGbtIquKJxT9Td5Tf29NdlMZf25ygBnuB88y7hV107WWN61StzeyyWwQUxIXmvq+4EtgRxTV4xkAHM1LjumohR2qpJIBqVJAzu8YgDMdn8HAHqkTWuSIFMK7wbxZSLFkbvUGn5lpMznQFE49B+NB2qjvvXfMRbZMTWoF+UjyjBKLukPqDddIPFOa1RoCmr2ptRrOwnHW8dPznM4pEFVcWxblL13yAS2J6F9BURaaUAsv5zbVF+jZSwREL85NwsOZM38DrRb4mWkVJtdW4rQZeLu4RKTFo16ucH/x/O3WXT8I23pQXjfhuYEY/K81vIAC3FBg2tSp7Mieedaqihu8puDWcV46akAkmQMUZu+8rsi+UVk57FU0wosyJMwyO4BKXWOFFHpu1dT1bfHuK6cEW/EDJBbniB5tm7MxZB9PqnCoWp4e/Va6g6J6iN9z4uH0HLUI2r3MaoSw+uglBoesEgeE= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(30864003)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S3yxjFbVTVP95XxspiDq1tGKOxrJa1hoTgZGv3jeMDpOKFUyD5RmBFMjSc3O7NvfNRhYjqcSwzNAvhSdeUCEZF6zrcfBP3xc9oBfTc6A5gHowrskinOVABfFeihmJh4k6RxWr03TB2HB/32rSS0YUgfTp3A6t4VDsYmUBSB6ReTyY7fCSIog8NsP4m5KK6cytK9pyu49FPXSfahwRVcd3aJd+WEZlkvja44qra8HWDHBajQolTuKp/+fNYd48gYwW7Ifbi3Pg5jM/tv3M1RRPVgV2k0Qi+bW+uYYje/mt8vlr1LDjpnI+Cy9/8HRwcunzl/hFn+XcFsPKTwmFHTgIt64Got4wT5zEZG4fiNv1Ts1kC0qTTBm7mlc1GrnoQXpHgZI/bRjIFjxdz097Eek4CPjQEka+DmaRrmqmWH36VrpFpotjaHzUrVf8jtSSoFZWzuVtwpqKtb/0QNa361/MF/SxVjadp6MyIsZbNmzoXTmHPdirjaIN8vl/TG9o2ueG3BYy2fhjGRbnAbmzVigTGdMC10B4j8D+eBaH8+EinCSxVS4mLBexSRkUAQuRXVOIjD4HQfrp0hQRUsl37lxyrWwCY1Ku01JHjOsYeXqR/T737aGdfP0LLP27gTuStls8KgoNiW32ZKjvXZG7M8cY84JXv3SnFoVYdQX6Z0UZ0vmVnqHqyH5lh+7uj2vCtvMLmwPfOMzMJrR+I9uABqeYKJ2dRvBiIpUv2a9u0InvSoz142JTyTcRBbCFLW4Gjh2m8PpsHPvRHlvA5qd5IlBr6PHsqplDtjz5nrX3hQHxh7HxnDkunlBlKjlouDGDA3ortfPK1+pWdYoA1iZbj81X46fLRXy8u11UZElmI3kJmDGBKPwuu+mpAgX7R2ufjnXg+pT8Fa9fMw7HHNbAq6rGKmYKRRNckDNmnoa19VKkqIZXLXb007fD4stVS/QOOK11exr/+U1SCAwSN5IfmAfmhQOlsSFhW2uJGVNQqrULgC4lM3ua4ry2gvvLeQfKeKaNXlAtU7ZVPNKp0sDcXXX5LsElvysESy/OAWbDLP1DyAW09XIlVYaHEz9idH/2fiIaCEvvnIPAumfF/a2jJW7mgbhYExmMAtTVQyRuAifbijgQYmvfvU1JV6YiU805RY71lbZ6XRbqRDfpsuh45rASuYw/B/4YvHWsKD8b41F9QWjbNVNb4IQKmoXDeuy5TU9BrE0BxIP05XUi3nOClK9kSCtxuMfOkV8cZIopIXP0xbJwip+08CPW3gUrjRAAiAJkU1v+JkDQZirkgWeVigtoYsy1a5RGqExaVrMpSpA+UB4a1l91RWtxuvLaI2oyYBhv4+qQw3nfU8sHexd4c60chuykEcaCdDqHiTeIVIdzEnII9jkYUIkBlTn8D+5OsC0AUUZocJs2P/8QmEoecY5TroEIXb2H7yDzOXRc90GLhcaoeM+UOqqvR232yTgR4OKtHaqc6Bh3tdTIzKBwzPzDIkwqvg4BHskUdD5DGEeXE67qFTRDNdT4ElacpB4yOXP10lBd8VFC6cRymvpMpzdV25UFALsCQaaX/W5tQW0u5bA0QZQMHnTnvz5U6Mt0KsQSnbBq8YMN6beRaUjesV4SA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: caa46b96-b26b-4cb2-4cb2-08da6e4fef17 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:22.1599 (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: QDwavMGcHhgviTWGGaFG52HYbGVwOWpuOCTCoSq5ZITALCZPz6mej4p/Qaz6MaqFX1K1u00sTY19128nXZMUfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928153 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 327F6CCA48B for ; Mon, 25 Jul 2022 15:12:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236061AbiGYPMg (ORCPT ); Mon, 25 Jul 2022 11:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235903AbiGYPLb (ORCPT ); Mon, 25 Jul 2022 11:11:31 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10078.outbound.protection.outlook.com [40.107.1.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CD3118B02; Mon, 25 Jul 2022 08:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U1aXeKK+OEI2MX3R4MaAPnhDVgVdVXKc7UT2GqV4kN58FZbyRZS/8rw5bjGksBEM+vGh7y7xOK2gTRt515c9NewxuZVlHeBXpYUda1hjbDzoPwsZiBbASucGG10L+j0Mvzg68/Dn6uDp03tJyX4pDIq1QqWEpSmdUq+5QV876BNsJ584IfaU+alW1fgD/aIBOwfTAMng3ntBUOl/gehJ98h0G+fHCD0UwafCdqzCyWJJbVCLOsERincoyDlpbtBdb0EQzpx8cTv4B9rz2vwgGxjCyFBOJFaDYlS6fW2bmc/GuJbJ7wGpUNu8eBK0TZVjxG9TZLOZ6NhhCvDXsRN51w== 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=SznJCZz/d+YA540zG7OQsPSH+/Hg9BUbTQsrOiHr36M=; b=lLa4nvgJC4zCPqWJxqAWFircrlws4c5+8UnzcA9G1qkOFroMRt8EHJSqwCVzLtIdVPRwM7TBjhEUs2BTm4ger59xfexnPZ5GPUxDvtvuNXb3ifh1S78nPsnV6kY27aLOFrU/DgXyXEIDONlqolknRXvEnVBX7ORG+HZXLfjYZJqWX+0CEOKjDYibL3a6VyfwGujo8Cq9H4/bL75cr/Dm3sVG/kcVafP4oC04tF+WZYp4mjVE/Zf5ttbPU85Zo/Ynvnio5MPOYHAbKx0PMpk6zMc7XhBXZ5hMQKVcLb3xA5bMfD/0so2rPjmIdsIJcQ3d2dkfodPP/tJWGSpn7ap09Q== 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=SznJCZz/d+YA540zG7OQsPSH+/Hg9BUbTQsrOiHr36M=; b=AjF+Yrqs1ZuaRW4J9NWILxAO/t5HCSb/d95BemKls4X9FUkCXTeO9Cl0N3NMl8IsRGV5fWGDO9rGd9uq8MJtqIK4osgnIh8lC5DiwxXK5cr7z1SX7+yfk6ace7QMkuhe9Vj9qarkJ+/UeM9HFQyDV93yJu0yE7gGlmB/Ab9whQPP4DGZbiati5PcQ5XDic53xIGEYqNgFZKHbHPfdx4jgq8TOnarSra5rq09ZKYbQceDJpwoDO0pI+bZLcKFU1FhRpg9cXZjrFanXpjo/6mNw5KU5InWXYxZuFjycYT1KfHBXrxW5AMTEGnDP4vQU3J9IEpmp26sHgbEPkxwZmWKcg== 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 AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:24 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:24 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 14/25] net: fman: Inline several functions into initialization Date: Mon, 25 Jul 2022 11:10:28 -0400 Message-Id: <20220725151039.2581576-15-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 976ce7dd-774e-4369-892e-08da6e4ff03c X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VHwZbHfhkZ/hPJlyxLOagi0cFmtFA3Taf8cOZRXKaNXwwdYsVuBbJLRUjp7PlETTKSFXvC+u6VREtI/EkYCa1F5MNgGergvOg2Iohs2r9hhEFDsQLlmAXDqPTTw42+/kRHoxB2auQ7Vq6IjOA4aBrpCdoVo9kKfnV8SJSJj+nE+z1OyJaocseNixPqf8XvZ+tZHc5UdQl679+4EM2L5vOq+AqgiGu/5U6AmZGpIEMR464c7YXnhQhG39XzLc4R44UedZzddjHNW/Cj9Fkx30qDPPPHKMZ9yXY8eW9g/V9J9rUeIrJxj1lpYSeOVLpZehy4jMo8lMWroHhuQ9SZtcI1Bz9LhQngJfjzMjPRt4ubXA58uWdWfZGA3YaEFq5DCqovQV+nYg7VND/kfOVgijGYf3421/noecFp2wSF72syKEAuiNeSucjbP94gSRzSwVFHdSntT7bvhtLBs6SsNn1WndNm411bM30A4ODrpY7SfRDQv/DMMXezSDLFGjaxymvXe0Cyd3IFpjPFLLxbbusOVtj7EUX4VM2mxTAr9xjIqZvUPoKQrNli/H07flMXF36m53kSW5oGX4PpUAKYGrr1cKnzEseJZzgDVLN2EPPW2ka00ZLrX3Om2IFWp5L6T1PpQfrt7hgps+adHeJtvszJryAXj5DdYz0k3+p9bcGNCfm5ZWEUtrGneVccVyg1ZtYV0wgq5LXiG8/Z6QqlePcKThgdeky4Qg6Z2IcV7bCLgSf97xFxDE02GkMdRV7vlnw5TopZE9znkT+rd6CV4dBfWkjHt2aUoMHItop7zFBoM= 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)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uwi8CfWgr4Y4J2pubjqsSHAXvDnFpxhnicSv6Wt08zZlje0c/Wz5AMABSk24K62IX+CDaU3Xf3rp7fw6+EKCk1vtNtYWrrXCMAiZQ+oSyjic5zV+bsCsAUw/r10gFSaNLbC+UQVYrhv8biMR62bHWp4/uudwvacm+GADCXkYGiCufi40nWJbYEMsCIShreqfmh72TH4Bbv1bUnKiOzT5pOze1wMJdwpj5KGBQsUSxjw+Bbtox92LJaWfZivk2G24doT8Ipt7Z1SiYNUw4lvyjrnvx6GXFLgd3JuYJz9MWQ810p2gLhIyIlS5ghXdBEw9CyKhfKhjjA8cF7xEYk7+bLEyTDD2XbidSY609/pK6JGt2599BU0c+wshkTN48BpMFdtKROPJ7pfrN3POA3qLodaXUVhCcfqG0L0g/nf5tSvWUFVE3AFZkB2q0qtmKNwSWg33Txvss2wbrygF6S0I1zw6CwT86Dj3UDPfZyM4UcPH7sbdCS+8QH9sMYgYEMd3DsN7bGOUuA4T3VEQdue5DNL6CMu07XuSqXdn6UoDz2hbqvbmHQlq99N+xjoiQnXmm/elHcuvHkwYccFQvaGB4+IYQz5Js5zjDPzwL+N7sA6Aas8T0YSjr1+pH3eeALt8ySTbPB2N6eRyOCp4VQvEhhi7uGlWwxcFlS9vUHfzOkj5M6BFYGgpjFnAQ/IHFqN70+Nrh02sE6VMGCojiSaizCs25H3PJmreGtoTiMs3Ae8w1z2uMa5R9SdsidRwL+7C9RN2TI+5ABtROhByXsFQYlM/X7+w+YzaBqwDbo4e7aJkdNcV9r/bgcnpElaCBo+yFYYKZwHo3W1pyHZ9R6DNjUTjsH9/32fSBTK2rfaQ24AkGEFJ5ku7GO9MwKk5iCB3NBmjw4bqibXahGg/qGROwmU5c5g8KqEBnL++AWF+u3iuUZGeDDgt80FKnfYtXxYxFihaVOuse0pTNAwQyLhg2DFN9T3vi8Q4ZnCe5WXIjawB/rLOjnZSWjOBWHeahMut5g+pd+38wTD0+ym74Ih9Y2MESgAOvwPtMZEF20eDHWd03UCIhcw/k6DqWTJhhP2A3Dnmd0uWGNq68LNcIsR4BsOmwdxvxvZz53/rD9sX+0hVUqNlKujsU0A75DfHs+AL+EQiiwoeVwqCLdUfcj0e9a9GU3txz5z+wIMYWZt+4PT5pRAvnO6d5VaOggeaQ6npWn8AZgPPBIbyKrNSOrPXwZv8w8EiCVkLyz0+Pra9/0MilaJFs0uf+EvGid7zpIU8i7ZIqpsqhd9ECDrd0zgcbvrpzNWHWadmf5RgLFiZjWHXkTQTjEoBHTmp19NmIlekKCtcJMyVQq9qULcoJZrnVtVHXVJ/Wxrhu3XX/lXZvR9zB5eKMR8w5/prWA2ieAV2ADmxU4yZtNafNSMjDlBb8FRvdKI/rfkS9tthEDU8/nvLIm5El1Vlv3GdS0zqpsOj9HBbq1lVBTk20mVmNDus8NYGDwF2MxGkX2C/PSpUoRvkuKGjIia8saQnDGcq4GmbSCQUaCisLKvFVpIeLH7H9gK/cAiBq6gn1jAkEV300xJesI2BbhDh0GgEc70EZ6wQSg4uBLhZkpATkXWoIoYH2g== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 976ce7dd-774e-4369-892e-08da6e4ff03c X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:24.0504 (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: B+7mcZUOBKf5lEY4ikzyKwSd8x0/FCQCrtPQLz7aQKepTJS4ky2Pca/dqhA76GGS3ggJdVoGZbSPLH6W6So9lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 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 --- 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 Mon Jul 25 15:10: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: 12928155 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 03A8ACCA473 for ; Mon, 25 Jul 2022 15:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235944AbiGYPNO (ORCPT ); Mon, 25 Jul 2022 11:13:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235981AbiGYPM1 (ORCPT ); Mon, 25 Jul 2022 11:12:27 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76FE11A3A4; Mon, 25 Jul 2022 08:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aiyJT8k3h0vUHOEMv4PX+eKFvvoTkFr2sanOiATV2sFkR9a13LY955eKKSPQ41aaT7EkjbX8+9Zc2vWvcAdoFVoCM3GLCHMQB7Dn4xgIm7P0cur6rf3L48iQy6gmn47UV3/wPP+qQ9hTZb5NYA4i33BTHB6A3+f58X45gJKsWrmt6rfhGVPFw/Dtf1itnnhYg8sfsQtpp9wSf/GY/Q2MCsn4pQiyZBGf9PdOxXdYU6dIwzT8Segxw4wZJghr2O4VI1zmY/YbZMfV+Mm3j3WSrTt7p4I6JYYEDE0W1w9LV0S2sCVrwQiXQqJmlEmwa2LxWfQYc08wjpypVfc3Rc+jWw== 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=T7GY93biXr0iRWWa3tBmacZDL9gYHMReCiTAYJDu0qwhA865bINC2kSGReJd7JmCfHlw+Jc+DSJmnqZSTTFjACXpQx5cgKS//YGZ5Az82Y71hvx/vIn+vxapP7QQsQz2L/XUMQnKQRWbxZzd65tVK25jX6BVs9oDtynmwrJuM10X5JMilPWf1gTeExkvvPQ5nuIcmclsKfN9IxdS0j/7+7/u2Af1Na8XQ34FBRh5KMgibPGhABfnpaeYIG4kmiCxBqWoSd7z8KQ8CULRzblpfSnx/xgV3mdnHwQg6SoF/lJIEMsL7f0/WxKsHXV61tM4qn53fZtG++OGUPDbLg0J7A== 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=msyFSZBOG5wADCUIJTrWazCq5JkJkQHgfs1Z8JhDbT6F5WaJwdyNtVU48RyGI/dCNQ0G9FFisEtFoBw5amaY+6/F3drksJo3lGLbeQ0PurjByoxikXP0afeHaJqyKbJqizP4hxgpldsd+PPYWNHcUMxM6uAwaRu/UeGcNcrbfI9xzoalBDtDuGq8X6vsfN8p/FfIaxG2pWOzLVBRZZBrccQxbGmAPBxJY9W0N7BWA/X4K6hWuiyR1SWZ0Ww4ppqd6PUvPyNiUhHyXlvJhWJHfj/LKnGbTlqXUNcoCqre4OFeSC4E9a+sxKq9ujwJKKpSQ2s9C2YollSWy5KFF0Yuyg== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:25 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:25 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 15/25] net: fman: Remove internal_phy_node from params Date: Mon, 25 Jul 2022 11:10:29 -0400 Message-Id: <20220725151039.2581576-16-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 7b9eb516-f7b4-42b4-9eb1-08da6e4ff15a X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3PYlLBhbZM+WB0WC/EPJWwHuHbBcw2GriUzQMf8QvKo2SSNzhgytkb95uPGUXdZH/rgz3zEgwI6O19xF0dNcOCHUz7uZ2z3CchsZPYl0gaF1A8ZSBgNSTnkTEE+og8QAn1AXWfwPPQsuM2UQUD4MdQclhSEmzB2DOA0LHrSipFP5RTryfNVbi9J7upNcOmiVscM8iWlUKUVHbrj3ejt4irzhaBZNcnjtOex2nFZeH0FBRXnZ95bPJTRmsyTuxjrjkwjyeRArrMDD9ZAzGKvmXgfH8Im9taa+2ZlkKBspdslIsa7hYisS/lWwdq5/FQ2tf8IEZpI11WeWPDDdfRj6GvdqZ9+3P+Y9KpL1j9ozuaihNqAl3E6mSvJYM6cDpLGBOBSjh60KAV7unQBxGBjiJ/9YK9JNkNfxfjVm5AHRY5sgw+F+aoMgJsC5jsAOcq5MIt3FP5oWQP2F1MIK1UKcOzUKURQ5g0VO44u92J92ni5KkfUSEAKtwVOxdI3IL4iltkDA4yUWRk89vyXbpBXH93h+pztPtpZzKk2yIP07d61e9l2SjEH4rVCVS3sUCWe2p3iuL6PuhvJxuWE5As0KtHG50gM7SrPZ31npR//6vD2N8bM6A2CV6MVSMbXgwehr3ujc07fagrgnONwtxr9l4RlQaOQZrZ5NWr3MsXLVc8dXbtmnFQfYCxQX1jb9b63ef7toDnK+096EsVtta1Y3zaz3Amynh0kHUoCNrvLnDM5+/55C9iFhPML6gI7Cb105esBWGwG8+lIiJkIWG3XGef6lqvS2XWaAfDKsGgzWNvg= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mBKElNbawYZJH4lycEN/aJeC82XQC++L2ipW/W1tEUXnXQd7iQERoc5F6A84v9fzbBPE/emWLfHa67xSoYKH5WZGNezTmK+lkmJYIO5+58uNpeadylKvtEeIguy4Yrah3c8PLZ/gnYP2HTmp+J24XxxtYoq/kLRVYULpjV0dXKgjpGXTQDFdPdt3o7dCcQiKZkrO3a5Cq/nZdRXdl0t+10DIg/sSeZgXAuKVyLeQHl/hmSbPygAQAMRfeLrjmhN4momDEBfpww//oWtrvBfMznFl6Rx+Gl5ikqA1r9cUMnBkcICrvP20XIgAxQStVvZHgT9Ww8MFHac1/NasEu+vdYTzrxe7LfTStDRvbCxaN8953PifCbcaw68ZlwXb6FjdoWOwfrwhDv75qoeH99Mv5fcRQjGGXSdvM5GVNxpNnaEeTubAE7fA19wd8vuv26hToD4seeWGmj6gRVRoN0LNpLAZHa0ZnSvxfuV547KPfmd+WmzZt40SBcBgTNeyFKlW2MKxwUf2Pwr9qrjcCvTM8M4A120LVkciglEUwsjfPXqqzpt+OBLl/Y5Ao9veNhU8op++emffvLPchn0eXqmjhet+9CEKCTftKibKPISg9sRXXZnIBEf4cKPdYy+HZVrsb+nVMRYfBFAWw2Y7u69ocZgziLRGzjpQRxOum/XEJxvFcqcCnDasTpyC1IIQGaoD1wV2HQdmMxEmTPlWoynySYQW7NhhMfVzIkifgU9/p9Dsjq45L30MbhW4G/gtzr/a4Pc4nWQLuhxgmgutTWZ+BBz9E67bMBmdBNj2KHdXkoVKMaYCwxOVqkZvpMbp/uPAz2S0USDnzU4Bd6PIfDxOCQa15OMJ/0YnuT5x3KEvbV7hKRCG/cZLtqII60YoIXtzPtmeqV6Xh4p1sBBimGQ7cQ9MZnjq1zrj7N4lStwbEa++wNzGqK0B1Gd77zLP+F4M6KNxYnq3EVBnhBeZvACHl8qQAcJiIn9o/rxTlcsfgxlvIW2q17+dmvJji/6hDGRkPGANaz64HkgK2yAyF34E5TGsPL4+eqJPpSXa1PdfYexBdm8Hk+Vo/lkmvE1CcriyyrzVzVsoxlGdWPo8RWGGXFT2ATVB/zuqRfGgHAflSZvDJjJNbiYJMUl/4fwxZz9JTbqew2BcUg2J0d6aWgEKDP+jF0XMgr30cWjfchR58HjtODut5zujjJpHCdYZ99QK073iUpDiq5HIAWtk7I56+xG4OR2cw/hP4Ia9e6kPyXWJlzRoWMP0bZHH/cOPZOtdjtqq1wQi2/Ofrc3WAWv8WVhOIW2rBmGhdIhI9fulvit3Tr7z5GJZvau+PoASVoZ2246pD5TR/KbzsyCbQvVooEcMG0jcRKHDDKvtey5I9eF0NRrGJlsZb6gN/C3RzGTAUkl9ZC49bJq7zmMaQ7Za9l5OQlghb0tcvthtLgyiNmk1BgbULKoS1yHP8zKZ7uA+5rolOd2onaUZWDUDqeZKureXK7Y0Uy7ayMAyi8qnOoR1Ow96CC763LTQw1kaT0S8ewW+S9wUfGF5LlG9VzGuUCXFZ969iHw1vZR5DP/oyjk/QqfN7NidLxdb00BeNzH8fqEX0f04qh4xWn/Xx5cHHw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b9eb516-f7b4-42b4-9eb1-08da6e4ff15a X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:25.8159 (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: b7IJtq7YCzEOlsGGunsUvR5cqOx9zqTi9qPdqF3DdHsz6fyTdeRYP/nVeU06ClermrMDfJKmAnp4LsC66pJrKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928163 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 2FBC9C43334 for ; Mon, 25 Jul 2022 15:13:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235896AbiGYPNd (ORCPT ); Mon, 25 Jul 2022 11:13:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235892AbiGYPMb (ORCPT ); Mon, 25 Jul 2022 11:12:31 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFFE31ADAE; Mon, 25 Jul 2022 08:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MZGwT/C9h9xLcU+TMkmUwdK0mFUExUlyYh5X6CIchoIn3N4XscbJQupgtOyZPjox7oIxsl84dU4iLS/EA7HAvjdpRrJIeMLb9t4Q/xueAIIOgDwSXHpuXNavDyVaLCmbb6w330fE+DbOHYyYu5yL2rw2TpAV1QxLrJwdr4BUZ9Apy4Ces+I4D21iLCAo2hBWyIZ0Hl1VYOxdIVbHbaDbL+Ap6V7qi1MoJEYkggD7m4wl9y1Tqm1w3zee8k0LsBsp9BasPI63BenCy8EJWIu9tX9rth+7cEtyUByQ6IFqWsCs+lk1U0nVqwcJtkX1QHZ7IME8VncChVl0N8uh6BeY4w== 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=IFUoxCd1/5Qf9OqwfZpWi/6s8mWDQmSJusmMIL/C7yBfzuf3YgEeXqZy+CHdptEQfny/cWmAeEy/SjT1d323EtD7/o9QOJuxXa6jtyBi3AflkdNRz6/Qg/RgZ6lWesSoByqXu33Ps8utXDQB8D/Ea46hY4QAx4pdXUfa7fcD9Dtrspo3tRAogizDlOVlUS1VDxrlld+FSZ1iXjjsdIxQKWniHFMGRKFhT2q60uXG7sNmqshYh/qqXct0bKTGbsuAurFqyQVeE7Rit5kWTk/RE5MCNRwi03vDUytLRJKy2cNDkTacmtr/RQRH3hh40de9EA4D5DrxJ1I2ksVAelWlpw== 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=ocu6NGEVhhQqnNvIh083J+ddRfbsXh/BfUU4Phy6w212BGA5UKfMD7zcv4umhtDIfqkkhYqZYDKdgU/50XixDhXYYfMkhwsSR/B2LujBCkK/nDj7B+WHiGfqbQWdVRefKv1SrFt8MosO8kTlTgfpVyrI3RyYUhEBOBLQA91ESJ3gCt1F/9a78oCNUSEWrhA+MigjTCFJlzSIqfBkFPNkHHRgP2qpN8SaOr2IExay62VRPn5oNfLnu0jxYZT+mC0XwfeFctaOQb+5c44tJpXVn9C/VVZrDu9IX7iiJO4kXtd2WDUgFsVs0tLwoxPy4A4eRSGfMpjDZ7ZvVySiJoia1w== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:27 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:27 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 16/25] net: fman: Map the base address once Date: Mon, 25 Jul 2022 11:10:30 -0400 Message-Id: <20220725151039.2581576-17-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 473f0ff2-17c3-4e88-2af2-08da6e4ff26f X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IuktGEkGVslFRTeFBZ1RqJCxY9q+ybeH3DVlZakX2q5bu9FIVFkohxxA8r6WJlmGjb+VHncF3fKXCn5MFfSQYQskOjmtVkyD6GptPi9Y7YV/OPpnagZ9f14tmofER/eAG5rd/ye77WEYcRpTyz4gLkUgutljqfaIP6ukaFqxMIHrjnUVwG7afJljiMXPNheHpb4WPWUW78L3gakVi38f7QszB0SV4Va0SNMxWB13QANjpK722EXX8r5JzXrjCXbcLD7PPPXhPj8FcuBBMTpt3ynQYdxbSSf2ymsO1xMuMOvtWvqTVqcQyv8TGEoJae6vpISrBEqvd/670zaIp9fg6zeX6F2LfDjo26XF/oI0YosRWuSKEhIDZuZqVK0mpmBb+5Yw63mA5vdOABh4DrD2zJQ2R9D3mxo3Na7GMab5sezAh03HTPTFnPTcO+Ymg3z2Ks5cTIaebdw77YW9AzCvCr50C7pYZhgJFQU9ria/7h7o/M3mQ1j8G5QWrm+bq/FDEpK/ngHD7HV+gXxOMXuCEEr3MTk8mHgKHVqVKixO0lG10Dn/n8Ve9vg8vKq+NandXsB2hBC4Xm2nmxFrzU50aEAiwNGYKC4z4tqTRia207idS4GlgSWqYIUmWInbgUGuCajBHkDueCNrL/vJPSk1Jv3dBwY1rtJql41Ol61ujVDp2ywj2iSrh8B2ZJGnvMmDVWygZkD1tpcwWDsbaoX24xzRUF3D9pZdNIPApgMgR2BDJjVj5fyRQvrEjTohf0UfoeNBR4hW85avP7ZRaqINNqSc6DmfNSQ09Ze6czWTIXA= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(6666004)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mCYthsRXUb3gaYH0ta76dwp5JkZC5XJxJ7Ppkd93L8dW646xDSI09qtYJ0jMr2kldpcNNH1Z/sJUflkDBnQKMNo7zT62z2YlYlFcdEFryPvH8ywX+EXEsL3CoOfumbBfionyhZEt73rp15OYPHR/dXQxeZ4rVd6MDtGT3gVkMLy+ho1Rkh5pLtp13GWUrEn3dH7qm4/z0GdME6RvLkOeD0ahniyT9vvESMmQGatSu1TUu8MSJULNou38TA1zPRCCwIGpe5JEB74JU+ipmS4XIpJ4Fi6N+Bi5z+Sgmt1+h/vxvqSUapPk4e/2zRnQHq8kJ9ZOON7RjS9r5GhN4vVNum85Wf/ok1X2nwa9GUw0vTxSnLuDWYMe8cAVuHDhn6a8H/TKeOGVik3Ae5iWlpgz0Z7awEUHflJ1ffh3uoufH5fIoI0ibzaOW2iEbZJ+ZHWF6HMmMvXztgINUgDQYUqtfUAoUCRlGg8k0F1bcXdO+M0+parGxLTU4HDTLcgAI/mRrDhoCLEdlCvf6WC+HGQi9of3DtC3eUgaQxt3KoB2pKjWJ4dnG/p6MalwBZAbI+fVvXj27RWTBoktZpL+XIhisA/MGH+ELts+jtir9F3Qa2ZV/cPPTN6WCdafNKKLEplwWTZdLIwjszupnYZuqBaRuxaFY3uFDPxhyL9oMD/EdHwUhCnPdxl13zdK4KdCcdtYvKhXrTAGA54DxB+A1xVZxNgnFQExL0JoWM1kYQ+SlxIOdXBEOazHDIIpY9+9GC9P8PwPyIoFv+zU3BuZiOuRq16kk7dGqkmN/wPa/DtZx8iGNR3P46GUohEGOgkcnoTpmq63SxIdCKKCA6a/QLPOqGRCwHanbypLOJpzbfSzeLx99VlZ6hpC6n6VOGHu3bCxhPJCW7N8SXLT/ir/eeh5I7rtJJh6IgtIWLFyWhaAVd9grn45hW7S2UzPN1yy5S6yQIGvN1ZcXAggXnscf5SJEb6v8e3OC22ZvsIvrOpiJgaIX1I9Wzj2FZxGdGMQF4KqhZcS5M5OwLu1y7dN4ZCWdq1xof4EkNW++ZBBi3dPxEuFF1fd8r8qPMhPqC1ZUc/ZrOx+jVpEgtuNyIquW7HqA+ustFho0+xCNHs240Aedq6obNS0otxFrXzFbu0Ope83rLPcsIh94vdY16ceJdK4uKWZVg7HxuuXQG4ISZTiHhpuJlvixbuXpYrVjMRDuS6fO569l5eg0St4WA08txYElq8vjzw3DehnJXBrnvLV4zFwKEG+8xkTZ5NdDShDnFZHkbuNMsjgqXH2+5rkm0hAZtxNOgSFpseuHxT2pzwPDeON/Lx4AeTb/6l/sL0+KSA/woOwHOE8Oy/yRaN1Oa0JYYa0Dr8vRar1LshVooUfKhux84bFPRNIbCKNcMYrwBS6x8HddGuDXK+orKlCCllhdj5UN7m7Wagi9HJhG1fwOrxGLsxaFa1PCJWcR/nRp9PlIs5dv931FPypAwPzaB2T78eL4qv11fGtRyxH3K64dOIvXeSLFdupOUubZJeWkzn4WxKvE2iAC7ju0QZqODzm7CRrRNg9oXwmgRSNYNWoXbhJtpgc7EfPBtfGuE20KOw5IU6unWtaHXJ2CboCIeMKkA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 473f0ff2-17c3-4e88-2af2-08da6e4ff26f X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:27.6908 (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: wNl46yS/n7FsI1+2ekvFK9FWhuOL2Ouny0MyFvGk2kKlpZjydw25ghIBfLd2q1EbnCHlGuR3SVKTHigFP5xJ2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928164 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 A98DFC433EF for ; Mon, 25 Jul 2022 15:13:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235903AbiGYPNf (ORCPT ); Mon, 25 Jul 2022 11:13:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236095AbiGYPMt (ORCPT ); Mon, 25 Jul 2022 11:12:49 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130075.outbound.protection.outlook.com [40.107.13.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 198321ADB2; Mon, 25 Jul 2022 08:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FA42Kjjx2jwEVZ/EpXcIaE4+e2oGjPiZ+Xpq4ayo9wtC5m+nt+4DQ40AY7UGNq+OtuSPv2U1jflVUsLUfekNgLOPEBtCsqoPSVzybGwu6P7+Cs2piWDQS9mLTIJ1lHtc3wEEIrR+W7tSDOFbQHYIeGzn2XKig+hkkA3bGQVffze0svTMzReYYO98yvRCcy8Un7+tnwUEYF6UOvFOBrCKX1Sw6JjFlYdFhuI83OnchcHPnucDjLKpoXxlaOoq1E2WZGoyEy6nd9gC1zSjAEgPZEX1XhbiT7XQze0vyCbQp/V78wp2ujGKPD1ApVx7dJVoIfrtbQ7Lw+9YCfOZhn5fTw== 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=HsKNr9Uu6Ew9iU3ItD5cKHrYxFwAx8UvDj29ulZKPw3egz3IZIE41F4a50LUd+L798kI2txrswYalwCRmDRpazcl70w9hmfwBdl7mLg0FvTNoTSNE1Yi9Vpa9wvAZCpqnEpOYxPNKStYOfQpxDbe9/h29+DBFbr+gxA8Z3KTVXjiiAsBM1Kmv01j1aopNLTZoqncva6MDJaRB15+ERfpRDYBOqldb7/uHEe1YPvLxcaHnAxVYiqQT705YZLI6vd5HJo/pUk9vvcsBKbjXyR0LghM3rQmZuOKd/ZaZ0IOCEG9yoi/pokSz4QlvhEwtmfY5yu79PngVBM4MeR2AkaK0g== 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=d4DaOvRgBfYEqup8k3JG70F/2WdYScySx0jjriba/IakZxXd0UwsEFiKx4W7uxl0OU+rgx/5GmuSunF1zRhI3I4of9NNYAMIcqjdfAfc4nVA6hieR/cyaiARiIZUR3yyTXYaZRO2qwhgC/9s5/L88Re9Cdu0iAmoq++67xKgrqXjIW2zyB8Yv1GqMw0amMR74eK9CWfNZXpKDeetpQsYv1sjA0ddyxoNRJk1oUhoBgoMOZIlVlyjcFLeGWHKAndyVjDBFGD3qifug3NOvoCz2Mioryc7GebUUlPLqYqNd0p2EfoZY1qhlQ+J9Q1yaca4BjSlN6l9uEd84HRMd2ulxA== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:29 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:29 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 17/25] net: fman: Pass params directly to mac init Date: Mon, 25 Jul 2022 11:10:31 -0400 Message-Id: <20220725151039.2581576-18-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 8466f958-a855-4c35-198e-08da6e4ff386 X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n9jLQ9yBBXWpGn5Huy+qwzL/xJ3DyMv9o1tCAkrDuNtgBEwgOxpkmQeSbLqNyOgi799H6+eKhZkdV3qUhdeOWv+p3EgdXOV/O7m8qmSRsKyhZN6/SNjutGAsjFM3SGvCNcAqcETc75pnbiY36aEuZivULB/sCJQ0yMXjwZCuglSws023nboBXziJvs7XFUJelI4Bp2c8qjK4FdTWf3Ka7wgxNS7Zdb1ZnZgDNfojFnRw6p5Z/xr/r9UXDjK/nBoQ4ZC9LB+KDhkxpvS2Pf6/j+LQkKADJwx12TUtDsKFcOuYaca6e44SAGATkvzesI8dw0SPCYxGPGIsih6kpYuK/dLUqRINtxSBIuerfgGOLG1P/hSpvFt15uoQzZcr3RL1XvaomrhbNVcZHkpl7P6C9EqE4dat1G86tvrgw9dwUZsrmlqw8Cy6WvXyk+r3Gyb7lFtgWB6C9ny7bqy6+g0dhxMpstMp6L2tbNUZByvw8DlKRUjFhk9bc/X7NAfFhV+wtJmHhaTXg+rrUDKMC6zY5N/eIJLp9O+V7dFy7+63Eehpc4fwGtnJCRhbRXNl3bca1kiGz3hnNqBUdzSjCHMq0ZCq45qENrP1L9Ubs+FcOc2CYjPUVX1Q5P0Q78NiKytgWqO6EaNhUY9uq8MT5yRN7aXfyR2GOWC/QzYZSvnrgftB93tbjYDuYvipt4sGVSe6xsAE/++8cZ93JdoB8yVPjwnbHt8hhXiZ0XFCdpSQEPv7e8DdSLZDBImmujwg/CMk0OoWzzcFfhMbTbGaKEtE010V+Q9aQfjOSYWOULzVhvw= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(6666004)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KpavI02b7RF33XGNgLOUuYPXrPevmFx0vqRRqRc/EyQZkhPQeBFwrbrD6kiRe5CQtcCxgsc72OF3lGlDwpPFAL+f5YrW/1l7fknSOdGNna+cYNQdOOaJ2Cm1B8LRKK7oBA1D8s0si25Mzldax2uzvGj++KEvz+cJyFJCpjXs78bm9bi0zB6vCF6SuLg1XwoWD5SmqGlW2UXH/OnOldEpbwB75Ev+8BqpGKzmi5dj8D7dYFTSFFxPxICeGIcbIO9VNEKzKXzEGYB1YmK00kGlsT5Gx/122y9+Itxak6qIfaW3KBlXFSrWBy7Jxr/tgloVMWzHM+IQMEYKLd4Vk7n/LGTtZxxzEQJKehm3FnhN5PIoiHdaNwWmqGpkctqzMusoePftjrmNk8hbclAvwG6K1wY9vrgHI6eGL/addHFl00G+g6D+aN4tBHWkgsh8BswX7IF+UJ1lGoxSzN6znOV8D2DlruoopdmkNu29b9CfmVHURwOwEj3CDuKEoxakOi0ZLcXQmW5fpcL7bvLAH+SyOcauhoiHEeYILise2IK48nb8UtD45RXhp4TXrwViurZpEf2rHdLcNoBcgpt40z0YWcuvhOaFlq3nr56b0kN2V0tBzvMaK8teclvRdw0Wvx3YEzQzEH6zuhsLH2R701EdYiWPlYdSljDvMmBcxicK0+la1rlL/N/tUvrI5Xfs0cyDL6bi7f/25SDd/lK6y3/6746KOgQJe0KqA4fQpQf49bM2DY07GWy+CyzI8bA3qGg+0/ifnNl4jeqA6nHcafQETTBv2epjsPXB7ZeAhw3cZpUQBEIsAiBv3ovdw1VHTXn3e1HjkkQnneurchjLNrMia+Qdtu5pvFkZbamz9FE2PG0vMzasBo504Nzow3s4kzHbWYOvxwHMGyzvsiX+s8PAnapfxbeKAmRHiAUDnA1pThsCCO/pkvnvxe7/uH1IKlvfVYKS5W2jTa1/2ZduOBIolXP/D4ql7g0idC0aMMLPlA/NeffC7FDNQNqjnPIcNfZ4GrQ23X7xrsa+he03q7oSnjWSxzdHIZxV3I6fCx1u1P5ez4oBmNjIxzDZOUlVvH+3f7VTTlvQ51t40hDLfbgc14+A7EGCVZsITOCY74GEmnShn/ANWWtC8hvY0dotLNX6dmm/XfBbQiCdk3P6/+e1SSZ7/CEB6WsgvRFj2go+sVbHW6k2f/fyyHCuSqjqzaIXP8xzOoDDmPc3ceQBdZgrYwaSXrYxRLTxDnYn0E4jvzlzSul9cQAPfd+gT+lP5UJMeNVGlayfKlC2w1K0jrGRs4cYtk2R1PXnrBoW4m48so/qWMhdQGw6B1ngrMWEy24mkSmCvT3yzbni63BchlD/Q3oheJVieVOHKxUXEZp/Ubefbly9RS6si3AIWQumR1yMK8Khqn4hmh7ox10ErxjmGUit5IoHd91rqYfwp4Rm/FVNEJ++NzQHmoVieyzN7l/XmNp8s2Dlsk1VW/7dMNAuDEnSSzKC2TIILpiagZl0wRn/WKrV+TToOZUeiH6NAeEs0eIXdJC7N8Gi04BFUvZlYKYbff5Z/zgAgXpzxGmgO+iuE/ObTbJ21OZXp74LNbO11xvjW3il8PhM2NYFaTM9qg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8466f958-a855-4c35-198e-08da6e4ff386 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:29.4563 (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: 5yGqgK1Ar2Cl6TsffZyJg/tXmlsM/mN19oYbWrPDHrXEqx84qYHQKdHSdjW1Bpm75IjUOrfclACOgoir2oUA2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928165 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 91B16C433EF for ; Mon, 25 Jul 2022 15:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235852AbiGYPNv (ORCPT ); Mon, 25 Jul 2022 11:13:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235922AbiGYPNI (ORCPT ); Mon, 25 Jul 2022 11:13:08 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C2971B798; Mon, 25 Jul 2022 08:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C6wQQzTjESDLCswkMF1Z5x1l6CeE45k2hOaAZNW/5LUkdhRdfRG1lrHkli3Tg4AXrp7bYOnwIgzVAsQBT6DMpU26p05Q719p0fe56kk8HcsDcMx0QNIE4cuMHJCYA/f5ouQsKJgriLLs1KPlW9n6U6uV08zlVLHyWThb0y0ihn9sueMOIy+vDLX1acskCIP4tePge7lMq2b/bzqSrewy1BZO6mcyNFcrrzt/CUwBZ57+rwWFMUChd7geByZJvydVZ4ByTIAjRi1hfUk8j42E4y/fHa0AZWcwSnzWNtdm4SlmN5aeerBcCW7ly5K/FbcGZuai4BOuAeQ4SQFaPmhRMQ== 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=DP2tXQ47sgRe2fkOJigVW4S5KOKcvxp+xJM7YSIB2Kega3ld6AcP52oJhfOeFfSt2UqJ42y1eSicq1mnYjmVb2mrwPFnSSmdlp1J5ng89sbFz/SuMROmJuWYP04xY6m57toVvU4MM8ay+DyMJKUvt1H+0Q10RNzaVsGycejozdQE2Is1oeAorxkB8x9JdRlOWT6eKQLaEe9XR0FBapfBsBa/aa4gAcYaTCBc2f/kfy83m2kuFUbqvp9Vh/qqbdT9HdHlLp/SgN9OluiFZQ4df8XZ4lyi5Eh12cx+zYPVnvmcdjyyFHylPTbgoyHbVmjjldqn1OKkHKhLaQkKn5Wptg== 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=lK+T255Dd44hvtu5abdhCbEk1K4Gzx6HXPGoFP6ljc7WmzUrherGIqBngHYBBynQTxxHyM/Xi8YfKzidye8Z/Y8Qlsk2e6oU6fgQMZc0yv5HhE32Elp5XLBa40YIjP++pdCqthjV0pKx/XqKELzFWcJpVLkJLBl5+tkmGoIx02kwm7rcXVHeNqfC0UYSV35hYVbk5Q7Uf8nlG7AsrZwDSWCQTm13HvnfAFVxmhFExQJRLiIrI2xiLZ9B8Xkx4nbKFizNVFN7EKBRu6YMXeKU9oHaXt8dsAdWvIg2IenzoKsCU8EDTG3r561tQjYZfoqhFCSnoDJIDTImDGsPeBa/xA== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:31 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:31 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 18/25] net: fman: Use mac_dev for some params Date: Mon, 25 Jul 2022 11:10:32 -0400 Message-Id: <20220725151039.2581576-19-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 86a9991d-3ce4-43d5-7ede-08da6e4ff493 X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PvWVOJqDfm/nK+a6w3gq8A0Uoj5YFZCLi1//aUXL6bFBwTO2wpEi0BdTyjdHumefLX2UtOHxx6Lea/XN/YxqdjeBLcytXNnboTr363oq8eQwTBzKzoATN6ZqCariNwOE9dGTyPKmk/9YMnUjM893R/EKExqsvkfqhpMDdk9+a/69530FO6k9qolzoDpe3cjVlIj8bxWMWWx2K1PkEhVyxeYSc6Cj/eCPyHrTJSnQnFI+IS/bGHkcSE9vEMSYUUGnh++WcfaM7hEXW9G+dUgZnfidvlzbG6irvlsLTFGoAM5kyamJWHjfxcWO9oxT0mLqeKKmkK81DuC6BLmRXyCz3yui5DIEI7DnigCjzpD1+05Dzj8VYPEhOSaWSiuV475Hwb7hwAeovxn+l0ZZKOXZ9E5wH4PjmiFiX2H4TNPnH+9v0tiF7+VEtqoytl7ZOL7/tP/rZA7YPmaXwU1yojBstaYZ0xd0mua8AQreXsRPZonHjfKboOKkTHusjpK2O/mxKKgbawxYYJBlSCn1pSW4maIGstb32KfvJtCJS2xbxQcj1Mqdrt4j0okUOFG68M+xwJhNmImd4Tv2ahIrT1xCtSQcTUTQ8gb/DLdHEpuI6lFeJ10grILu9BsmX05B4xYjU/tkVyuFjHNOFaz+7gRD3FdIkhqdOnJK/R6tl+pVYZQdGM5vjr1z5Q6Owoj0O/IUKWd2hhi/gFFYbPTTbME2z/RFdhLk8FDxhM5jE4Rn48qI2ftFLrCTpwRuHLMLdwe9GwrigY7/ydxpFhI2zIbO8IuD6gI1lhCnDhqEzX3LxC4= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UkQj+8DecIyarePBVCwWvo1o3ZEsJx8DekpzqVDWfjuqBcl/pnfa8DgJuQUb+3UkSKf6hDqe1mTzeCyHzpBikC9uGFke3O/MKLA/JVkFiGPUoWISjvtdm2ym79dxWUdXRgGbZPTt04UfYqHiVJjQT0e+RCXt1h/Wjz/Y9nJ2aiWICkFdww0sXpn4MybFIJ21h6a+0JnuZQHpFtKFsGHmUHVmXeogmPYyEzRo1B0/WTlQ8SbkHGMinuOX1DicU1UsQVj1I7WjIlkQ5Zn/R13XHm2iUb80vtrcy2ct3hyK//qdi03kbllsOrpNYTmjmwZUMnhTJUs8Qb1ccKKlj5Q2lHpbMyW0o0WRHe5TJnZDIX6fZK2H/JdyVPRu1j4YTA8wYhBnUUydJuT2Zy02O/dRVgOqrprPwG56mBKks9XH9pb5Ligz7kXA7IbKYhoWoxftpUFcR3VKie+t8B1aH77tg5l2rjNuIhuwYBLTa+9Rpg+Vu/riUXsJUd166QM2PUu8k14otBt28qi5A0duwGpF3MApFUSWPtjeivrhtZGYN7h3/F0LYo0/+fqSJqpw2wLhBPLS7pbJOJMMtDFl7RIh2s5VjF65L3kIRc4UPzW7LD9t7ZL7My7Fv8j1ES4H9StF35Q6mYNsqNx9aAkA4T8sPmZvzD8ROMOGSl/cNrX9sqRN1QaCMBB22ax4HBXjIvXO4rKqngdYL05ieQI6sd8a6cGgwy/9sw82Q9udAeFcF1zvXhnsG7mb4QoF9OAK3NWEjpoIlguIl7Nvr2QpG+3mB1daW9s2muOgwzUu9wgxWqkFtfCcp6ablPi9T5FaNXhsvOrErXWEwZHv5worMJQcpkt+jTnaSIOzinmsJVpy2eKcz9+hViJls5s39h+vozFlO1gv9mKxVY5+1dPt0WN8EJ4B9zqg/3S6X/DsaEtdeqBFwSDNSb7pBzvRLrRedwOxgJ+OiUUq4HuLwQMMn1ArbEu0swzcBI5ERlLuGmWmJ3sNEAVByZfdO9VPb1f//jOyJOSVrl/lLUFAIWBKi3+WFxJR8gn0U2rnii+NCmfzjmmDB9AR32ctdAc9vJ0XIeS1v39weItSIAY6bj86er2JxtsMgbCDnSviH8YkH9js4K5KKod2Z+toJ4sgUg6RAdVzULW5ypzr+t2V1E5uqahV9nQD+iYzxfpw07loTJ818uTVGKUBS7Xdd6V1VVGF7+jSzSCmYqlsJR1659sC4hhBg4ENg6mnAY3ZTAyx8fnUPa7/275awv6qOpXpUB5KqsWHjrVd3zeABiFH/vqwvC55B7yz5ZpgmUUy0TTdBgz5iVOEXxMCHJTBu5lVlAdJDTQtmqyOVa7IZZ2kE3J+2sVqCjwEYfDhTBe4/EKgYuy7bujVf24WmBA6bvk+ZWtcxp1Uf1UpWvFXhLDRAxP9eWdLeV7CdO0jPTMp6/n32p7+0FBzZl8t9hQwfASnDGHCVolZKc8gXRX8REusl9UHTP6I3SxEazcejF0nJQ0P3uKNPzOVyOHNpx6pvSWmK7MgDzoZsV/FFtnMzYdYhJezdi90PrOOSJNLzrdWmPwkb6sQJqaVS9V0ZtB+FvnFRWrS8bLoxB3bi91cDQtQdNI0ACkbaw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86a9991d-3ce4-43d5-7ede-08da6e4ff493 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:31.3156 (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: ScN7c52vEfa5lG4bt6uh66LuAOd342p6vMkBGScifhTvAQzTuzt8KRBiLJUWln3D2NQXRZ4vJarfI6rCmWYPQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928166 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 31A9DC43334 for ; Mon, 25 Jul 2022 15:14:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235888AbiGYPOB (ORCPT ); Mon, 25 Jul 2022 11:14:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235981AbiGYPNY (ORCPT ); Mon, 25 Jul 2022 11:13:24 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130075.outbound.protection.outlook.com [40.107.13.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 686951BE93; Mon, 25 Jul 2022 08:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YkDNgMzjXgXvBCPg9x7c/Fbzzn6AXOJCOUTAlvIe9r8A7HoRicBX2gK7qwFbGdqq5FNwucXemP5BH0ea/sJvnU3g3Ov2swixIjqPXezu0R0E0L4xmyZsmwqu8RdtDiwj3tIk6UnRimLy4HgGYir+hdzLd20hpTl9vzu4MySqfWINC3oOz7ZnnkZpuXDnoIJdS6mmtLyR0TJGbx10w4Apn86pYFv+nTXsDkZsd9gdi7ZItMgX6A4yuC5qkroxzJsC7TvLciCr1NliHIGZ/Uh0hWBhYtYrl3f/ACYdrdlLjK+S+f8YtrAZVoxpRPrO0ByobUkkhmr08xHtLFpaZ+aMyQ== 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=e+dMKIwrqHzljlB2DY65R5hgevqD9kSY4TTKjL1nrt+Z6W3QqWs6tmlL0e6L1Xr6M6ePXea0+Xgi5k/SskNXHbt3PM67A1LbJvym4GIs8jeA6xTWWLgGrzw7TQXNFlDaDy+PVpgf4jxj28Tn6URVgILCs0VsCtU6pr/UnOA8+hC2rsgHuJYQeCrNQB0zqCve5jI078KlyTHG7UOqmenxDJo2aQhPY64UnAks1xeWEk+owxGjN+zw/1d1rG6+1xtlaEgkodatYouF6W5IyT1tugXvbQT/QsJYA8rKUKyMNp4FOsIdxfu7GKDT/lt7rN075pxNe7MNLvagYn9j/evLvw== 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=S9+2UYRobBIoLbglw4gQls38OmgdYh7akp7t/oRuHkPW7AwDtXC7LnvaJVSvCQmu2abHoIbOKqQSavl/p7wwQlE1AF9QhxDOwGmwoyFIIAqad405e5rKz/PI7I5LLo77mz1nUv1RxnKT8iT2i6FP+kmfzLlSK4G4luEnLaApGF54tkJDZv2J/CmHko2llw2XAixUSN+T4c4ESQY7cu8WMC3IFQLB+gPP07Z38PU9w+JaoB4LWfRhdnis3GbP/0K224j4KvsQahIfHykf05UDbBtCh/DqQELVmUe52Aqu8GnNbe45qDxh2l1zLN9wkbz3Fv24XhJw3ixuu6nYpSrEzw== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:33 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:33 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 19/25] net: fman: Specify type of mac_dev for exception_cb Date: Mon, 25 Jul 2022 11:10:33 -0400 Message-Id: <20220725151039.2581576-20-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: a9fa7e21-5c4c-4351-3215-08da6e4ff5af X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 95/XWpIES0h2bX8uBqoOsmgrOT8BEXRXf1c0bMlaQk1yxvefwFEmHoJJhCSKkaXkGRYlC+dM28BFGvvHVapEYHoH9yszcbIjqb9VdxSHRM7Ahm69guCsuYMxZx/1IQM7GWvzXCLoQwOxF2MiNpUSjG3d+XFbG/ckNGzubpw7ouuMu0aQUpnMmHAty1IqKH2MbxrDArSjTZlAOHpjsQXNb1fyw9WTUqiEelAYiFDd7DfaQDU94gDJgPvGRzEFhTf2ptXkPpFkGImzcHAzBNQHvDZf8RzWT15Fhak9R1mwvl8h896te08QjPuKj23LNdO+XRPmZXxlen+yAPX2yO3ZGUB68ok8bttt43DQhsfGzzsSpdEWFIUfc+uDc0fFCnnm82bLYPrpEXodRIOSvsiWGaxfdZQaesKDuUE0r5brOLoFVrK3KKEL3+n1tyy2EAKNFctesDWpzS4fPiqBpZ3Kvblimh/we4T0tF0xPE+b4dYfU9nwyXiNMKmjAhctdLq9H2SsVCgEoBFDq4U9k55bwe6jsIaA3gH2jRcgfb+xiYX1963D8Tty0tRFpUlg6B835hJBvxEdMFzubGTh5r5xA3natdKPHjltEDpTCyVgYCpen01WxJwDriTVY4ZZNPAqz1CAirQfq10bq3kcbJ3m/YkDh+ibzWONFP7vo6yOL6lt/Tp6Ymi5ClqS/OiVNTiclMAvjdcg2x8BILjZAyonZDw0gZmVUuJBMXsCKFlNIngTGGwda8iw3DnIn/cfEpua8P+XaJkB/stcc4R4I3LsNd7Oq8nYTqOfcEz0SeFWqXo= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9IcOB3IiRsm4kahgWzQKp7yBOYe5x+giJO3gUofN/A0pbH7wYCw0kHamwIQYg6sqJ2LJwWlf0IjxU0438Iz1TZWj0mHsjVbazmC8SsiyjbMD3ymm0dhivVD8zJRh3cZIFZriPkfiexZGSMyCO+oP1uQcwyX/sNvhS8iAIgBEeRTy2nmBuqryeMx1T9Ir2pp6pLs59Qj/1pKQfacvlrMc1u0FEsFEd9LhM6tv2mgP/d08iLx55I36IXZkkeN9x0D8LENhtDKu9Xo+BLFEjtLdH4EGVeO6bPpaUtQizKcYA5zmefd7ZkT1G5SVpq4r4gr+T9ml2D3vN5934kOMNc8rHHxKThLGsLXZji5Rc3kWk0EneFp6UN66pHIWWQhfvgSVejNy62vgP+dk2Sm3yCjbVulQHmesRWCCh8z+KYMvNvRB32usl/1EnbAp2fgy+pIFoQAng9pE+rt1Va6qSy5Bt3APs1PiEhCYRrkB2oEhXZ8nSeNJUdqKdA5xkfi7cgDzYaUaKO16q1E6FIr/3h4EuFvMXpCxEPHq8xu7jWG77FBJjVk4nDp/o51sXvueYY2BDR+HNNNQg7QyCh+nnbUrBvAxcx8rAwcMETaaaMXbc55YoVNLctO+NFmbLa7cn2hUyKUk52kZD8qXE2/dWwFPWkseIrlmIpABLaEi1VXHoqPCyRf8Xp5fa2xxo2BfEwMg+qIAPQCKX9uJdAJyNRa6uRPcQSnZvC7ikpYLeJdkfMzNb5uCu89c0sEson+ecR8zgIDO8VeUIxJ3ea3oVQ5bKKpBMSPSsKhk7Fa+V1qDfoP1wj76jOhtTiUQSoXF6GY7cg5muRjvMH1iTvpET5XYMxY5gVDdlJy9HX2t9MSqd6c5zyUx4QjcPJIsWlqecJ8Q7uDy7SuJNlfGW6ylPkXTAFo8CUL36qmS7QjHxUpR5e1qFE724jZthLLlTzYROK84keihwoOzHN9cIHpA2MPDRlHZat9YEExcB0nsWhlVfew2dX+OhncBfVk0VolwBbOs4KoGcY4ctXOz5mFJxrWUQDx1NtAbYVxaL7ZJneUdoLh238Gw41lc+tTsVWq4Ltvv5Ew/MGrfjtZ9L/ILfirLrWuneEUnTGQDTGlE8TDS/C8c8b3ukV4kGu4zp3L7apaJdH5LO4+DzkWyO+vNB5bj9BS+xLyDD0nYePlT1vMJ5lK2dVNOk6dKZjnxvs1M5ZlAFs0I4W74LfqT+RU594OIttEoVsDmyF+puCgMIiFFxFJ9MbFbS2M0GT61svNvrLyMXRt2oIhJIDfPK1zd15w2+iz+o2fBcVNGDeTHIf8Icv670lRXbUD0keN8+RTzd6e5mDGZUkVEA+ag1UD5/tKK0cB6uGpu1NNI1YYvd4vhZuFV31CLvx7gJfY0cyY7OyEdbSF9JHi1FPnYjxz01M6da86S/SPBGxBHcSaG0t1gBf0WnQj3wETFLwfFds3OlBF50vSqLX/CGtFoar1WPDC3qUZfauPw4th1+s9XCjU5h0l6eSah7ympZJURxWXviMaX/yPZaaWIB4G/3vJILLdhu/lXIF8SM7fH27b3jaZneg8Ru34LDkA96kC5Z/732ouJJzvQtQOfsgYIfTdsRjHcFQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9fa7e21-5c4c-4351-3215-08da6e4ff5af X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:33.1280 (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: v6k/RZMLXov+cfD4tI6KrkSZo2ffj7fVRpEtCm5xdF7Z17TZE8ofj+ziYI1IQz9LoAy7bI3vQfdDTEs3QQynDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928167 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 42C02C43334 for ; Mon, 25 Jul 2022 15:14:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235810AbiGYPOR (ORCPT ); Mon, 25 Jul 2022 11:14:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236038AbiGYPNd (ORCPT ); Mon, 25 Jul 2022 11:13:33 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 348BC1C916; Mon, 25 Jul 2022 08:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RksUMukzD2qWaDHmSybo2oq31VA9T1GmNKue8iGV4ml56IDhoO1wbZjlPPjM2tgEGekNj2w+5dV1n+9vd03xy2D6PEq3mVTUBlmL8K1FJo2BPrl7cwwre31i3fiJkSZlss1IGCoJCf1Na1Jcr4rDB3vDSvFfu6I0KChqfgN+9Pd4S0zrpBHhbF+dDLHG0bS3HrLMGTT7k8ve6mWGeCV2xSGTHzu48OWrAp/wLYLFtdubwljwbvq8LC+NQpyNdBVntG3GFUbGXFXBx5sSyl0friuSAEOb4y09zSkYRD45zN3DVUKntr16CBZMEpUmeWP1DEi4VxLghJw9JUnEwsD1OA== 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=dnrMksz37jeQ1QazZXnO35A47VSXkdd8mkmQqHFP1d7phKtA47Pxg9eDyjCRyb3GyR5/HHYebuX6cnabJFYX113RuioJvUmGMJ3pfpkj0+8D9b5ExxhPs3p7wRRKSuNkCgb9xuqjpIvMzZpEvPAm63pUr8zGcG4I1TTpplTLlwqaz0JgVv4KHQSWA7rhdd8l1rfGNg9sh2t+MX+HTTEM15pJakbP4qKtrA5GfBlZgJrz8minD/9RSSVDSZkMBesba1QIpSkf2MEVbZXOTLhB8NCsjKvGCW19y27KAoCYmhsnAhO7C7ld5iol7ZKqkd+cjNDjaCClCvu+K91LGmjEhw== 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=KZf4plhVNCCSlpLgYf9xqFH13sHDZeCDkGjrEG2juhHMN9ORg2K+h9DViJ3dsWIkUIHh+3DKny+UlIIB5IwUz7q183d9JpZK0Iu2IGpMDgY+GYqSt43yaqZ5UQvvX6gxVr5Cji26NihqSdyhib1WjBDt76w5+4uejAlksDiqObQQhdmMgf2ngoNZ4P16BkRCBlWDJ7BJhx+vK2bL/nbsUfPRk4aZMz8Mf217NjD1G4Rp9k/0/J6ZN40jfer2hgd2d/WY4AqNJxpPcChA3I1+vRT509QpcH7ikfCWX/aE2te09QP9ACZb4uT15z0asLrC2+wbonv2ZgiDpkefqoAB/A== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:35 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:35 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 20/25] net: fman: Clean up error handling Date: Mon, 25 Jul 2022 11:10:34 -0400 Message-Id: <20220725151039.2581576-21-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: a49599f8-d676-4921-e548-08da6e4ff6ca X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lCXwuiQjvbbWP0CsWXQGW+L8337Jldga4Mur5e1V0Q82c66BOp/i1bOMy6VGr3RLuDkx90pv2IYA8kn2etyH+HDs67FNUeWMUVkzAC8jNsOWt5S85Zg8QAXerd2VnYsNTMMBtzNpB029qRaD4MK/9ypGXqwQuXVwbyVfMUmwdm54bJNfg2mX8PuLEjHxSJjYq+pAmMrXXSH+7h45rnb7yFIXXUH2EWCvtx05KW0kybbGFc+m2raEm/fH0KI6ErgaQ6IYtMYQZfzlyPKxle9yC4v/yHUeGG7E9I/9W0sIn20bTlh2+ygZhZ4Vbrs9AblrOMxzi1Hh+UDtsJRMusZ32eB1quPPSHM4ZQhKO0+HdoXqNiINBsFINgrCFnnMyNGC+Ly5CBInS0qA7iTM/LdbLt7t+pSSdjzu99a4ZDwvleeYM+dq4R7dsTTpnmsFbZ3MbFk1f6llZupPAwv85Rb1uW/1QT9JQMhC48bQXvyLHbgfMAyZ3DbiKl06ZjoEM+Uv5zHnxYQoVN/XbfXCm9yIrRHPnaw+ABTYjSOAg4TlnFxh6OWsV+xb/yWe2N5tiTeD2v2zLWpGNmBXoyDxH9xSQ3TghXV4ncah9JqwvNLxN9MMbCJdXWZtLsoi2EK9x1Yg8P6WoqGwLwrEutVBbX0u83AdRbAUFApOU+CTr3ALpmfgdcU7GhP7ASgS1LorttpDHQlFV9udhOgXnRat4z+aHF5Ecdb9znytLMI8Ju965k+l+7stRog/CtC+3IJuy9UHSOFKNXMn7lumtvBnjjXXZk42SvMfA9Nyw0TTh+eXEnQ= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Hiqi9/UjrdI7QDOU/bgBoqUEW+N8/H2kzOZdu8t5WNMaVK9f7zeDL32G151CYdRE6Lyrgv6UfBSHYkzSzydqFIB/y6DQLB0ASE+zY4yvGqR3TTMV3fZpOE1NX9J8PFT1jFp/pP/QjezuTXSnMr3FmLHRQ8mil/mgqXq1NLnKo9k7pEsOCQbYULuZCam9RElNqFxZG8bCs36e2EA6t775yg3k7yh6ocw9UPAGvq6tA7jbRKdQJC4Vg1pS23CupAiAqYzCH6DJ/pEkY1iZXyeRa63LEPhoi6cdPjXeDtkC1R0kSJ/BP+0DmTS/w79YgchVsKXgEub3wifnyipiLs5lXPb7wGNEDYfmv8I3ZAQ4e+lD4kS5tITFIwIIuA6U1WhLO9FMGKZQ+cHhZR8JZryfzqsZFoyQIA5RhzHc7cceuUH0VCcxYVNKUkFy9BZcn/UmpFA3DqM2ssFeaS6zt6Dlb0AeeFz/sy1vyAwyNKMji/YRkDWfsv1jESKQLq9uFaEFZ1TkQFN33dAISapLkZm/QjNLQczFVFVID4BbCz7xTp9UU5+ovP6fArP7s/cJN2BZglFjUeYvTVbnWRNjDVPbo5LpeAIhqoSNT8QBF5FE3dBDu0x+CT9U1PmfYDcxqUCWxUWveJPz9cH7Fqh8wFgwQdS+yU8I8FysVSmHv9c7rokUfCkmVHpP/wUlQBHtMNsacEmUk/quFH6haGLMX1AsTbF6qb+OTgozxwmtHehWyaiDM69OreSiFe00+buzN4QoxP9s2ev6LSCFAjYMRB1LiwyKSwekyIoIwW2jnmR/nFDSeviaOEv99R+mZmGvJi4YYP2QMCRqIjNjqelw/1Wm+7+7wW4rMgjF5fw3VjPXDxJG56HIsHsrJ2eMdUHdepEWST/GmrSQ9AiqcebQ5ZtrHvC5WiPPjexbBenYGNXIsFHk9Gt72dPYPMWFKkZyZn9pr3+emvF9B2uhWte4FqQ1hYbsf1xl9PipKST+y6s/w0RV45NeEceys3puDUHiqmaKS0P7SiduKZeGbXp8NteR4pVWprDWfaIYdVRKHX2XoPkhaey7K+wDPSzUk6Eg7OXRCvtFXUYw/5mBYn0hgvAGepOSokmgVQrOrH4fPEF3PQVkf7/ZsfpDL75l4gSwNo1ogDyeihXyI9M5n5SylIvYBTTRMm6kiHmBqSZMmVditjWjn7DLhQA96wk9Q1LwjJgbshz2QqSUil3W1NI9pL0wXLFHqES9x4DchwQ0EsT3Q0gMgBjHHWeMvFMwaaXhHSxlb16QHDUTFh6fyNR95qiJiSOKq0WZ75fRmLMQyNs3CBGCllVYxJX+QKoH7Wj1fUlk/OcbukmpY75ahmWjNp7FIEpS37VDUubbeBBA1gmlPRIdXbMCYqFvbUNGlYLEPDx7oDJF+6IzITuR63sk+lX8ba6xGFX+wGLb/RcIHog+fE+B7sKuFIkw1s/zKZ/tjXPmFGi+q28x2Lxd7kmhIPHrEor4xUmuVLFSPCTxbES+wZ1T/wwOxPy4qIk1VEPSkuk7TNhC5lq8PihUKvFuU7n/cs/8uRkUHtmKI5FcZjU6NpMrJkRkwbE5/z+5xZylDo3i3s6fK/dsT8gHGuEfOY2YSg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: a49599f8-d676-4921-e548-08da6e4ff6ca X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:34.9404 (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: 47yl723nG0ElJ6LY1L2b9xcu37aZg1dVZY5dAJwuWR1N4QhNDwZSAGZkga4mccraAIVrWw8ZDdJoosL4bchUGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928168 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 47307C433EF for ; Mon, 25 Jul 2022 15:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236018AbiGYPOT (ORCPT ); Mon, 25 Jul 2022 11:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236176AbiGYPNu (ORCPT ); Mon, 25 Jul 2022 11:13:50 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130075.outbound.protection.outlook.com [40.107.13.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E54501CB18; Mon, 25 Jul 2022 08:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHfS33qVY1IGKdpgK6MR/2zh/sBAm9RxvxRR+vlc+qxwt5A36UpHroX1Rzn/dDJkpQsEoo7FgeNqjb2G5gAeRhLUf32/ThwDV1cTeGAzq9XniLW6SD9wVUinC2fpDt2uWYsIRX5R8W9bZmj8LcIBijfzuDfLUPFWPgy9SY3HdKNbuNpffSibig5ZHHaT0plG/IPqZiK6FLt5DNR7krHjJdNp6JK58oo0VJJ3K2YA89njonLDxCtkLUDg1hVVgyWg4WSdn+zZQKKoqfi0j33iZYG3ibNCW4tkQNws5NHVgZGy+4apwmWfHYPxTVCcLoGo6phrSzqw3lsIju0/C+gaCQ== 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=KJLzpE1EjzKd7O2d4nUeWqjNdefM/1ql/U1BY2PJJRnjw8QfCT4ohZ9ab207LyWpcnPtho4iq9tj8NglV8azhP8WMpstjjIN/Ix1zktXqF5zcn0dI+MZGIGbEMR8sLQYv5Z1TZFLeLYnucYd4pBBS5I2E3qgNPFxgBAzE3oPKil4gFiEqcABT19v3w8l0gWwMvjDZwlqmkFrOhnr4KROM5Z/PA7cTH2zqHZPysD4+GA7SykaRtFUVv6sGG/jii0Vh0YyU0XtOhCFu3tMFflIIxMtcZBzBu03+aRWNEgi6CMNhs0mJB7PEZgVVJltCJkydFJDJa+W/gucl5N11RW//w== 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=fbdiUgTtNiCoFMp3J+8rq80iD2n9OEoGGIFaYwYIAMM1bOanlcIi9SYtkVV4mlMSlckAsS3WERe2i+bTvxoS0tNBLSIiTnkDiArHdR7pBdB6RlzGbj4SmwnhiiYv14m+N6/JcnBNJFdhPrWpkzxFtrSl6t5Oqnoh5aK16V4TY5YG/J3f0muBctMVxeJkuuqIwTy3ThjyP5UZ+cvIccSgJMEhJv54yh+82lNdjK4knIXU9QsD4JaTWhs5kTQ4RD29kakIJ6VGe/8v9tnZCw06awsiG7FbCgBUTh/EltxFf6z+WGs3I3S3+1kmlrIZ80CndMyVNkRvrN8IpA3vMfyITg== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:36 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:36 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 21/25] net: fman: Change return type of disable to void Date: Mon, 25 Jul 2022 11:10:35 -0400 Message-Id: <20220725151039.2581576-22-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 4412de39-12fe-417c-acf3-08da6e4ff7da X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F1DOrHlrQorLLuk2gPClhAFt7H+yv3uqE+5lBd9nfwYHZilCmoeehaAA1DFHqTiUKpfyuaz3bdJ5KiCZAl8BPMCDajnMNzKu5iSIrUdmVehBpZuXzd8w4hz9JuCdOmXFyncwgWs5f5TwHied8H3HudMBVurGuTN9vbL+6p13dcMGHyUKFeL8rct+ftgjpYchOwhqmc7VxRh6BdDBlMWen10L1Md2alVdsLp+AprtKVxwOHvJnkBU25RgE5dmvZV4oXYGkCAyDepL3b78cWE/JQO7VEl8Un2aERbPYAplrhmZVvugELoYuk1PrppXGudHOxj52BJ1U1qMxkjOg4yJ+vBjIpUPMQuUy1KBhL5XKro8QDgM9JTCU2dMl6WXfVCss5Hy7JrjIl3pOnzDKQJ5e6DUIwlwxbFwQWeveApNgkg3lLKGhqXRcw89N7Kqf+7a+APX2Dy3rLml0jmy2lI7cyFe+wr4KE6EirWGuDhs7bXhvXTGksYbnHsZQUD1bFgJjx2SQeMAYmY5bIuKDjeYFyK6WNX3lREB5I8TqaYUEOKvQkc69u4op5QYUY8kDT3FbmpFy/rLna8GZK3NdPOx5dlD6Ks2m4nTSS/gYFv5ZNYkP0nHYutbrjMKdkVJdUJYv9x0WInZt031rkevmLA01UCNQBzYItiKhSJ4dsG71KzSZxly09P+H47uxQMUJK0a65LgfLG2nSA30thZ4LqWcMF4lLk57AFMZZm/6ywqNhNwmXjzayVZtsFJPQEwKOufh0GzKIijHVmbfF2WApb3G+C+QOEBeSBtXMwKBybCUHA= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: c/3l8I6G2af1kHCa2d95LEczKHi76M0gyyrSKadM4EHyfRz5zIFowZaQjA4X3S6oLLFdC39LE2mFj8cJrC1dovTI6miW+691rhBPkLuxESeOGX8/0JkPzuf8++/O+TvPmX613lIujzWXOxKJpyeZPyYemiPZezyLjvLQRSzohkdCtDhb52FUa8qq/t4Uc67ctjJQYvqdIcZV4slKh2ah4k2L2rL4K/tQP8vSXa0HlfwVpijjUdXlq1TXg7kGSK9tnx9uLo3ekVidWozJypBuK4l5mG/owaIqLxzf4faWZ8qSsM52n+y35hfgSnoWOkVz8hJAE9Dd+HdJ0mUKxZIJ9VRpPl9575NMNAJU0vIhH0cbcWnEe/le2ZhK+H9p11G16Kpw2ZU168SlZSK/eXgeLjKGYZh+3KMIrOk3vAZLbqh17ur6ZKD+IsoBen9EEkPv1wFasivbpdxYvlNRiIOWDHIcxpANriI+vd4IieIsR6UaeerP5HQXrrw+UcnfTeOrNficbY84eUYUgVche7OsA8PGp6QzWBYYrzwaQBgHevjT4j5zFyXyzKi7a4C3upzeE3vAuDb8N0ncGKpdycn8aVnoGUU2FVmwoCNec3cF9bbKnL/yVt4of/EKMo3WmYXq/IDDMRvvNAaDgw8LWgUeMCLO0a3LW/oc1thP1R114kd/SbDw2cIjPJUwthkFJvD5uxRdMWaQkpAwRlXtvWNQB+4ZwCS7847/PHqVG27YaQ4gG6USMmrwN3xvtxjebGDIccmFubb+1hTpK/AtmABifwjZTUoSgJ1okOiSoWlN2tsaemr7jO8uj3Ou4+9wSKgUgOSLoFtRKn8xgkwXP5sJEEZGr4JsHGnHnjnv8R0xLwKU74XMODztc4fjurIYONCCIQWiNvQa9cu2VuaCH1Lpw7m7wsDQHpOeDpuxXfglL0POm8oDxVFoEfCKyhGZg86FPoCXpVDi+TTP8GwJXeg8CTLQVzU99V3fovuw97iE/1PG/v5vBDN2XfUGlOnyJS1vHrVtthVOUKZf0ZzBruOdk5NNa+lGK4iCBwOPXZDN5/9t/Yy8dpf1lWGggM57W2nfa4km8JzVxFWSP84JHIqQixveLyAvZ9RhsBSsL4q9HQCgaAKVvt/5XKWNk+cyALCdrwONnEVFMUxAIHluEV+nC7aQeyAqeTKCtLs3uKQdO0Hi7Eub0lsawD4MQJeCF/dHtq8zcIMjOmqRDOtJksFtYHXL5yUGwzgZ0Ojs27IJDtD8srdk4aBx0u+n58Fx2CMOylBqhScO/USuufLW0vCth/nZFLCCl1RmJp1EsLufF7TrMmAPOsdWwAV0UGzr+fGNOQg9YhOvSY4I8Jp8B3b7UNQkLqYJUPLdzi/dLWM4IlvbaRJm0E6exv+b132wigPwI0A5jGRt2vj3qH9yhfqGtNviI25JmVW8fqYY3tomR8LkLVSNoHwglVP9lunyoWIj2cm6bdLtJ+IDQ5u8CCU+8pbtnWURJftJ5isuiEvON4eNQTW4E9Y1T1fatsKqWOawWaSNU7sB/SwE0oA5RrPQ9Cyr/9MLMu5k2YGIg5OLn6+/N47kzSaWGg+ouwMZ/m1nM6ka5oy8Y65ri/sSJj723Q== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4412de39-12fe-417c-acf3-08da6e4ff7da X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:36.7371 (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: 6/ApFkPfrJvjEU5JEzGUmzlUR4uqLIaDsjUK9XetJNWm8DYmBxRicwTFXWcoNIyphsERQxx2RI+fU9l/c1yoiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 Mon Jul 25 15:10: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: 12928169 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 D92EFC43334 for ; Mon, 25 Jul 2022 15:14:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236215AbiGYPOu (ORCPT ); Mon, 25 Jul 2022 11:14:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236236AbiGYPOJ (ORCPT ); Mon, 25 Jul 2022 11:14:09 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0BD71CFE9; Mon, 25 Jul 2022 08:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PgY6lATKK6QuLZI5h0V1N5X99h2M0akkY+TXn3ZH1qk1PzuPG4BPP+1JYRcHoiL3T4RfUzzNcHJxRq9sS+SwqqalfF7Mo5K5hRwmpRBD4IWfntPD4Tid3OowPY8U/tMvkR7Bw6IQGDanwFcAh16PzLJykoC2a9q7klux5ApcSGyjBFRa6ATdNsu4MNQlWZ5wywYdA8YLtPIek8cB38cbQUNGK4ONc+1PWQjp+59VoQwEmY0x+oqtJTEXYVJUwPPvdFo0eDMn7z3vWt5iRRRbaqfqigEw/h0/AUQmUyZgAXS20DAuGJ0qDIaugA4aGVEoYc//LIixp0ymta42dmUUwA== 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=0xAMr2dOIXZXZY3f2SCd8tPIKgnvauVh4jSJsISHwSo=; b=WC0DNC0PI48lW8DaAHcmbnPq1YBmZlPCHMSq0vHrAMjXnpHyHUoOit87EeAZ+M56CZFzGqwNACVuHdJxhOyqTsa3E9k4qll29/F1hLh4SCZ9g4l5ml/XMAGfoSpMuH2OpxZKyr2N+in1bsra6AleQ8fStOvZpbBLrkthKjMhmu8jWHdd2tRiTdXVVqxOVVpMLUXvdTsOnMTBkjDxSQ04+PKEi/4IPYVM03h1uI3Bv0sk7SemCAp2PUg9PhL8Et+tMujGZvc7XevbVdl95m8AOnKjW+EzvW/Dmk0kpAOLT/ja6IqRKE50kq/CFuD6WIZ3D8wHRLvNPbCppn9lf4mn9w== 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=0xAMr2dOIXZXZY3f2SCd8tPIKgnvauVh4jSJsISHwSo=; b=CY7CrGyF0MfvqmvT6vsB93e8WWam6Nj0ehu+Nzsx8CIgIdeT/SQZMW/X9/7EVROO52QfsOq0XaDi1sm+QgjZZX2LJEHaY9o11S5HOFt9yO+hGyW2iGkDAncd/zF+xwZ6E+4f9KSEtPjs4N/fWSikBoPpTkV9JDR2d4Q6x0y1gtg4efO3HvR5df+ryV3u1UsY82PzV2Sb0Homl2YWRDKtXuHCl3PwHydc0UWcyrK7ZoI3N+tsUVLNMj6F0e7Gw71mm/BG6ypfIezw7UXgt2g4LAhzGlgHTZK4zzacG7Htnuxrc0Ouqod0ox/foJxOyZFNg2aWkZqJuFVw07Y9DOyz/A== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:38 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:38 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 22/25] net: dpaa: Use mac_dev variable in dpaa_netdev_init Date: Mon, 25 Jul 2022 11:10:36 -0400 Message-Id: <20220725151039.2581576-23-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 0b34f19f-a48e-43c2-9b84-08da6e4ff8f1 X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 715yeHiTd2En1MJr9ysy4s1ppWCmCpPUSIrUVCWbic+nmCVqJeQYpoB1l52rSpRvYfzPXaB2wKUrxPD1LiJ1I1/MhItal/dPM/igZHrcNwC5QnJ6+Rnr0IK99599BWDkol042w/N2pkl2lQUNBVjGWI3CJGHrvWUE4DmKnP3huWVHGqoM8K/JHVoFgoHd3y8aUOfJjIOH/00L5ZHGna6c0/s0YOBOdHxS0wE7JQmDb5CgVqJXXInH9XDUulLV5pzLcyUQukHeb0O7oXAWF4whNA0Mos9m4Ftn2/z5Ljkm3a56C1e+xwPJooUIaB6qLhNhUr6Q3jPdkJ3usHBkt7FSW7z111GywNt5eIRZPDH3KLkSiNrQBLz+/yjYrpHl+jB+17eXK4JKpdoSdfZ2nzGSIVn23l4pmABstoF41DWRsP0wfcD3zSqopvXg8d6HcMr6P9gi7qNJs0WCpm5K7CL9xEHXUpfyWTeiu7gS7ZTfqkfTF0GGjPTpCrLoFrPRXayl9hDv27COGZiXox3ytGedEX9FBhegKmLzH7W1pwWaVDp5o9Il+O5NgsCde22xYDbmr16tLfu+9Wd4psjI18RyK3y6B4lbFlJ89PPKYN5Yldi2B7EDPu7YoYNTUX4YDSGajfBHx+sCXR3REZcGt3z9paSIYSi7DgT6jK+AQvZATNJBZUdXOBLJQ4/QgcHM9q94ZlPeh2/xRNKyTRgkEi3SAyIRIcVgMtPmQnUhcPqLGSeCB8khDWtVh07X0qkhSeL7Q3hKEOtTIaypDIvutzpQM+GCCErajNygak+GVMdeIE= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(107886003)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EzxypGXWSy0AXAdyHR8kdox5q34MAxuKZ4ra9qi8idbGJ5+h/cTPSZdWGcyz2ij4l9zRm55x44KJJBEu+DGA15jUU0vqfpK5fRQP2bzragA4WJ2ckz0u3YEHUVcX3WTZzjqhJFXaglc8icdI6jqIY2dUEjxiw+mh8NRErCfhs06k3/7bnwa6SjOTqkLanFZkZ1FuxlIp0z1ud37DppmxMjc5PSx0wLMgpu8iu+kvWVj8Wv4AbN+nSTxqD0/hvMIFx3ZT3TWGaDgFnZB4wCyEzX+qJcoFrEJkJyRs9Rmn3Uvy7IOWJtl0ct7oCAGjBJDVGaGZEs/y8sSYqW3GI7d3uERtjl7Eict1zGP8Iidkun6CKFBhGKlE83TnVgzHUBAQUpYIWBQxK+/KK/TYhLR81vLnLfUaIq9FCGr/VfiRvXQPbIIo7Xv/sDx3snBsIdYVHbl/scjTvB4GwZLV9y/F8uuy8LReD1Ar9bR7ZmC4apdNF4z7mn8+vRuDtWvPGqiFJsuQJNXBOeiCRY/Yyonk6uHjLCuGmq8Tmo4TPAAkfBSaZ+l1h47qYS1bi65jaizLQAknXMHBI42WFRm3L2Eswrn80IZFMVL2AXu4/DLhp7tYsuyr7NCRbRGF86N0sZhk4mVqFLhTYK8ns7nZ3JfZ7xNukucac4Jkx9rtLQzYeB4T2YFduNAHTJVwxvbT6vBabiUdqYPjLtj/SMrcAUhrdZcIL0wUdVVjZqKsH8K8gTb4himBnL4kAiI1mmTzkYriOtmnihQLeoRdm7ZFRnxr6vQmpZWqM2KAm/oJWvCETEqu6Mj4wZVB9r5cLRxMHTGUQa4WjU6QBiVffbiTlqIYOIlYNAi/9f+Q5nGFvAaMCwKTCU+GwO/B7Kn+81THBuTCJ95nGzmW4ix0wOe4j/9Y4W55RH0MmYCueOnpknq+ImiSYY66tHIYvel5JJ2+NKdlwmuCSa+NHnzCrYO134xIjdLedaaGPMmMOS4YIvRV1q7d9DtIOtbzTHn9Bl1ToPtKUdz0QC0SMTBG5cwTJSv+4caFGmBrQDwNRS2PPLMVCzienbTJFXUxq3hVDP76u/bhlwVJhV2r5t4S5tmVSnXWmHfQI2wHdFRjUEFg5gEAVt/fPiSiYkMw4bbhKtRWS74TayccFxNyL6XIpP6cTwqe72tZPhcM2c/GRrMpnbWx+D8ZuLryJ6QRUk7SqAQcgUOT50/z6R4z7Id4YIftLxmTksDznAIlnxgIvIGd0NqRnjDbqqJzzUE7OxdQwFT9Uo0fP2hWnCEVLkc/hiq6wCpjEJK8pt+XWZIKJm0gP1PAqweaMpo4vPa0jI3G9J+EsUfyqqmbSZzvoTOQvjIr03JCAoyVhW7xgpjWQiFFoB2otLXNWQbcoTZL3Hay8I8Iyl23Kd4D4l3AYo/nvpQEmCE1Xxl3bk8wiOrix467n8sLNAHWc4sgl9AFb+JuqN1RIDGT+zQKKZuW3eSYXE1yrwpI+1T/JA0TK4X9x6JcC1mMW8FJer1dUwGdo7N4kSG4fZbyv7OVQqQUonJ3VcajaT9FJREke1CjUFR/m6Kwr77reAmJ7+TtP+Bli7iDOy/F9UzfwvmxwDF0Ep8OsBC7aoS83g== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b34f19f-a48e-43c2-9b84-08da6e4ff8f1 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:38.5807 (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: TQsFXMx0wZzTaCLZ4uRaCO31dzfw6ZcJ/8TOzzLSPgCR1jvO66jrX40/eI0Cs00Tuxij9G42vtYITS+5bnQ2ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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 --- 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 Mon Jul 25 15:10: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: 12928170 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 6FA05C43334 for ; Mon, 25 Jul 2022 15:15:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236269AbiGYPO7 (ORCPT ); Mon, 25 Jul 2022 11:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236292AbiGYPOP (ORCPT ); Mon, 25 Jul 2022 11:14:15 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130075.outbound.protection.outlook.com [40.107.13.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 021E819282; Mon, 25 Jul 2022 08:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T78+QRDfL8wdIPHsRWuql++Rn+aU8A/yf2OEpJJZPsRw4Mn2cZiTCoRLQbbofySrA1ykP3tGiHe8XzmkjVS4W2GavvFltvMDrzfP1E8LXh0RjyXqJrek/DsKSoZmYsTXxpuLEA4TL/9p/RNvl/Eu8pt9W4SgDfSZsTpmPrCpqO7sh6l7jZV3AjaXHPmSpPjIgmRgZq5WmguXv/2vrYPTKhs/ECrFJyTOc6XAYJy1oGWSz329uw2igyb2VY8ouAac1aeMINOP0DPu5GSDp3CyOo0cz0oEVFTqZ+O1j5jfUhqawIPlpg9ae/v7RzgPImNqeC4fnkZS8eQysyORyYKYyQ== 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=VltbbXkMZZ1BVJKkWZ5CEjPZSUiOFfYs/gD9klz9vqv2zUzd7iyuM2Bw8EbvAKZ2293IAlQnV99ndkir0wEQJYSavYQNaQUJuwGHNcEL8LbLUklNDlelwngCEg7KK0IuskVXJZ7G1urPzU+2RFCaSCoJu72Xhk+sAtJQR/3A1cbo4tQ4kgdJHOP9D5pxyZFDaIEPT+1G6/2RANh3Wv3x+kp/SGOL0BvwnL5lyVtTJ0RJ6tRLJ9zH1MFd1LU4nA8mE/N03yOpvLQEDlRkgpG7L4dEiYwsca7kWQRx0BOOTvHEtLahlqBj9TWs89oFHXFEKgEgtalHGwfKr//6acFjOw== 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=xpPTrrqnvvLMDQ55olY9yA5jq9rz79oGKV6kWPPw9tpyFpCHXeo2o+PLTfmMLSXkiV5FdLLssN6Pia2Xo0YLtpF+w6yPtDjEjEXFbrz1FrbYXSwee3B3wr5ZKqISvsNLQK72UEgA15h7ogS8XnIt2W/Wz4HHC//nOJgsWJswS7pXL8Pd0oVmjqGeA1XZgUX7s8inchn0MXScdo9aLkxfQBHVZL8EtvxFLPnVtR+w6PQfGB8KxcFjZrSVexIs3oAAGDku8US6rJW69d5/vNc9JBC6NUtyf5XjRfPUh52gXOtBzeclKC8Bscml1paYloFQ0f1TwNA4RhRtj2KEesBKPA== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:40 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:40 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson , Li Yang Subject: [PATCH v4 23/25] soc: fsl: qbman: Add helper for sanity checking cgr ops Date: Mon, 25 Jul 2022 11:10:37 -0400 Message-Id: <20220725151039.2581576-24-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: df88cda3-1c21-4d5a-fef3-08da6e4ffa1d X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1EnW13eFRzfdCNNpQ277WrHRV+teiF7/WU0Z900yYUk5PZdd1T7a10dJw38CXQfDoILmh9XABSf58rHnaXTL0L6j2D2U4QbkeS/7TUvUKBxbQC76AAvgyMV7V34GYpfu+Ky+0R6V9JHFh5tkzbhdK02NCHojJOQ8Z8l/NR+U70BuKwBvQ4I3Tgt51PKmvTM/MSBgFdkIvz/LYXs2ZOyPFSgWtKzokiw84Ca5bxiQJTCqigB/6JXYz45W8CMXacYXXeMV/DnWac1zU1ebb59mvq8Zfxzl+4fVP5g87uL2fMWUFxtaYQvU3vyZLDyDboa0QBviMLGlQ1N96AzHnf4G71gcLTC70RCf1I1S2DPQVsaGcHcNA/xpjB+EnGMHdvUmP9vfjaH84Z5hq5lUif8FovdK4qwHdH3xA20Ove4uyTUrkE451YmwtGNLRXYU2pwIHSiFCyQ/jAuhcOzAibnkeLmBfMUCGDlYbydzgf3fZxWX7eqEKR7WtuHEK5qosvfKkdl3912wnVoq6CxQXwrWkY3ai8HwhDqZdGX+0OsvJRJL+ZXEwR4KZ5xh/IYY/LzqMjlQOBDn5/NsGziLTQoFhxC/p17DtdmhTbMv/7D8D5meJFSm7U4vZEAL0UKxjC5pH3txvFXGDbPLAwr4u6CYG77laUSAmwKx7MV/xkP/0ey+NTsPNOhTZKXghF25u2qcmx3fkK7aZmv7urTvw4v1HJ6rPO7qYLaYN+KpOaqDia9YPaBT/i/qBaoDOAv/sOrqcisR7JmHyHf48ZS8FYQVhd0W4rwusFuFTdqkdlLfJi8= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(6666004)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BZIPzoI46sfDdC9XcpfokmvCM+nRn7hGjlE/C4Hi9ioqMivb4hjGAvPupnuFyjV02wBZjP+KJDo1J2yzXlTt5O29AOSMoni3M0oEGfdX7dOaks1kG9qD45AWpvo246hSmvRUwscnjLdv5j2u11Bx8YMBjaHKB6cUliMYZZp0v/+HC/VuIGv8unwEYbxPQE0I/S6VeWTa+dpwPXUNMVrblqNp6gFnd8ZoJs+07YpJrxg6gEfMCbpLwW+gp2tNBor0rq/S7xbwiqlZciRHLhqqckl1bs20VUNE+lykceQ9LnqARcHOVDY52Mw67vZVNEAUr7fsSBE2+4nl39VgDzSZV6FKYT28d8qIMPa9aObKkTENMn008mfPM/ngo79ySByowuuzD0zBsXPaEE8SPP1kFjPsB8cfNHCUboRvRh5R/0lbLsV5Y60Si4Uyt1lRDIW5BixCJ2YHqde/QjMuHjEF+HaT4y7h1AVtG+bl0GsOm5Im74hfPoViokW15BfQNMH3ooje1enAEPdfUwFXtFakwZ8jGkJN22jhIAYtPycop2INl14pjJj4azX7u2XuwLrR5dkwOYFXhyhHXDMMvIl2JRny+gwaHwQ68d7p64D+4xAoo0fiR+f8+vk5FfR4BNgl9RlQVzYCwcinhrAllUYQnvauLZRe0WBTjQtyudga8PoObUJlXJyxqzy7Fvyn33N76k6GYabG6r0SrztaDv5CR59QBVESGQ5NAs+6AA3KaiXgmA6ezJFK4TIoNpwUFA5HvEFdF30GhaJ/YTJwgVR7Ke/T97gOJLL7Z5aGeMTZd/5hnCHoivc4beanikIL2itqOuSu1z8SVu+P83Oq4pFMNy3AKECfa0hEoLHhZMy+lXB2wemCehSZQMFUvgeb22kPs+VUsdlNLRpXiOXtwzutPeH31kwhVW639ZCz8QlcBnwTygcr/H1zJ5KHTGfbcQ6QHNE4fw4rSeXnliJ1Vy1vTeVWz1y3ZkhqDexcOooP7nLun3g4TyIIuyTs6r4ZmNBIRnYTPMyopz0ATT328lJdZ58t61DPH6HT/M6caLqqt7P7yA9zAs8nP+8wp35rlhStm9By46OuEtN/Bh1yNrXytyeRB4S8s+csdd4h+zSRAC+Mz/mNce8LOK7UY8ZTb10KFw5lOtLUJkAdsraOLlBIu25LiFw0pn0IDIQpVSZ2V/i7U8iZpiIgaxmoGU51qf3Qs6FC2odBmKO5rG2o0pdsA2ldTL5tenVWNJpnlTn6MfO3INdMt0UU4d+g/HtLemnCJ4JfMSwXnj5WnyJ/Mh9WN/IzYv7ulZctzeh07KGx7b+J418AYV2+xaScpIxVyeihelS4DmwkYCfC9f9PaguDrTpKn/1yF8FuFZJsEIxS6NCFxtbTSlQswEGuJR5PUntdCkDkvMeV9L0e94yvU+mXkcXCB38OEcX//rpP5WHnkRY7+NpJF2SpNSJMBqLMS20mqvTYzimf3GrmKQbih33Y6o3WUMzthfgOqpo/L1d571Bot5WZQui2+VBWyqws8UYyIvIfImc6vYQbmwpNAS+IGji7Ujqn2D0SZR96SVoIISff51LKnUHg+bu69ULhwWYafXZ6e1E0XSVOeuEV+ak17g== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: df88cda3-1c21-4d5a-fef3-08da6e4ffa1d X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:40.4869 (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: 9KpfY8HkkxFx4na7fOzrTh6BsTThQrHUoR/w+7D5gb5ngX0mzzcT9/QnQYW03pJmUZLJz4zEeVyod9Fb+sFDdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 Mon Jul 25 15:10: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: 12928171 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 44116C43334 for ; Mon, 25 Jul 2022 15:15:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236170AbiGYPPV (ORCPT ); Mon, 25 Jul 2022 11:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236192AbiGYPOs (ORCPT ); Mon, 25 Jul 2022 11:14:48 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D92E01D30E; Mon, 25 Jul 2022 08:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BNbm3KN57kiFp4D/+nqQ5E0Ye5oQo3ejTL4GFAiMSIFmFwHrMk17YP3EeB4DIOC35tNO70SKvR5DtMcEgWUpW8RzXdUUmtRpfUvOhia4/xkmyXuEtKb8/Xr/TrvXg2czeRUjTv2wjxwQMEkHpdDFTM3R0gg9HFNExSK0NOQHKl0FfN3wKS+w8Ea7vIcEaD9VgtsEmcWwk/R50rMY9UDNd82dRy9UFb3geFfmL2kWMuIrhShnlT4o9dLiwJlwqjef4Z7U/jg5zsLMjEGfixBl+4xlSOZdcTs4o9jUUsGcnSuifAN9ev4cdpch/7gRgh8BxAD9AITGkKzNba1NRLir4A== 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=IjCChOlMfLhau294qQIB2w+owVCJq+s321YA5C771jdLLngzGwgZIn174FwqHrMQPe23Vw9swcoGh1ho8ohC12JmFgN2MDmnXe0tdVaPCLsgMRjeyPTt0bUGJgoO4tzFHMBcdpzHG+3u1rNsRiI93AYGhwsqqVcT47+BeADaCOyx4pE5zUOKqMVjyKaws9cApY78yu2PvM4ha3aOx9pDfXTWib5KYwgkdu/vZ9CUY+4IhLSwP8uKBGrVECnD6Jiosxr3KMKvnfQaP+nsR0krY1YyKtIvJAaQq69MCHe/QNhX8QIGXsGSJVF1NUXHf/xcQIakvcfDHNJ7aTpnEF00XA== 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=d1viq9uteUnYi7iMZntXRSFBhD/r4bJLIC1jeXEuTeyjWp7k+0TKQ99e4ap4SiRG+g6oHEo+qaREUWRUbDqwexv1CW6Gx6/JeEdBD9uOII5IT+RFZg8AI3c3ZqgOsl1S4OU90sZxrGXDnoevRoPBOgHqDFGvluVvAhYK22kISQZGSC+f1yxy8wZRKA3pIIpfyUaxFP1vPC86Ri/C5GHZJYXTNDRIpaR2gWSoiKriUU/QBwwzVzOGsQAjD6cgKYpTUeUIajiX6z4WWxBKzvYl9TNXh5TOzKwWNbg5BG94TkooHpXQIzZBtJmg5NkEBY9cGcjgJvYiPI4D04Iw+fVNVQ== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:42 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:42 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson , Li Yang Subject: [PATCH v4 24/25] soc: fsl: qbman: Add CGR update function Date: Mon, 25 Jul 2022 11:10:38 -0400 Message-Id: <20220725151039.2581576-25-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: f6d2a981-299a-46ed-145f-08da6e4ffb3c X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: euBQRCzwxnvTpmfnVDYHGBkaHP8EVq9laDOlWDWPoZM6hUJy45qFb+d88TR329LlpASlg9kwAkTrmhgYVmwZxhSsVevLw1aORH/5BweOT1DrrKFY9ORY/qytXIfHZ4Lv6rNrs2CNy9CdwIvhEtUXkuVGHCgnRFo/sl3U32ffGnpsNtf0VaUVPLSmZwE0czCHEvXDj11nzYZ1hT7wuzgx/zUQoBQLASSvkZGxeBZo+m2FIq8gZ2AM1g3sjlRu18b0kqCokX0J1+Go52cRNclcEkS36PJUC+SdanGe38l27vdxmWKKl8pwUtvwExFzOs4SXf24UWDxN3hqvgOgMEBwq2fKA3d9u3aVwaJguthaI0YfNyG/NHbIdEb4RwcSO/yCa+kKVsK1EfG9HpMRqEuKJ8qD/9ygoNDe59HSCi6unGom2qNPhRNId/6hvL+pJEeAq2R77Jqlo/ACWM1jxXUZxma5v+WMuvTASDK4rPi9pdCs+PKnofWai2vpGkUErIsbCywOJqe1dAbj9sdEIxm/0Isu5jbR36mwRDqsm9DK0ivHP2hvkwg0oBqPSzIa66L4KQZjwBTtCRwiVhlw9X7Cdg/dNb4QLdRv6Sn2IgP2OOsInQoCQPig4XbYHSw8YoR8AsNZ5OeYwCe/+mEgw389R+i4anEFTXQztUt0ZFSzVvYvdR9hixUjgkQoisHudzL752oHYEQ+/oQ2BNQHZrsYY4ubf/P2a69ltKFZbRxbYrSoCxbNKaRCDa/LxOhGE0JoD+ZGbrrQSrbzR/JvimQxpmrDep2LBuBaFkssGL4Je18= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(15650500001)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(6666004)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /f5GchLw+zo/VRQnUtT4bbJYPqnRgrpTrTkPxm1ZZJ6LzNcA2RLPKxaYqNMIT1etHVS2oqq4IjgVlqISqfs0K5qFaEAeL2ukFYVSJrUjDE7W25runWKKrn4CAqFqesj1mlq4TgES5qcZ3LDY6Hpwzpkqc1PilU+zU4bbOQX18lza7fuO8c9w7YlxNCDO/duf0P8ocJjFUURQ0WFmfTP94SDBJA0PaQEZhkNuqtvxxQOycvBQYDqSROdBiqXRsJIBiKDUKUxOgHkcn5ohgXifr5lvYEa7wbbXt6ObKQmpLHX3lCgsv0nbV9NHnB/0alarFaoHiUXjqZPQ5rd5lz9Gp1nHPJ25GBrlgAcLYceN4Zci7cCfBBc7WlRyGvD76qvcHqiYnndCE7jDhirdUD0zxsfT+3o//dKkgDxITp4nQU3Ara6iMXNRTvJA3rmmQBXXQjA1dxmY+0Jw1S+rZMOeMRXQbhXi36XShtJaiu0n+suPhHIGxGFJGwYy/KAytir5U5ZOajTiobLqRw7TXqX8twofAzTdoz0iM0hh7SIdinzOZo91+EqSJWueEvWFCK+fOBjG+lEs4x4NfRq8or/zKQy+e+jV1q5hAxbD3fuYnKUZsFyLwvUyJR9ym8L+VqgKmJhFFPw/nQqjGzcSG9HG5wmAl0UNutjAGNv7tP6aWtR0J26TsxaToJhkJSoqweE/21npTdKWLckfPdf7Td7IJNMJ8mzhJ90R9QOc8soSaZw4annh291TPQDe+lE4Etc9fZlJAmp/ltQhglZtKwRGcN6UlxHK8YQACFhF6MRXX08rOWNz+Z4iaaqBmgtmMyPpUKTzjBEsXSLW7ScshrQ6G+8Kb0TjR2c4tdNkyvpkbXuNz0lU8lUEVXnLmRvdSSxyYwEfdTL8SyvZLS9jZ46J4iN//SOi6uAZzuryR/nBYzQvlnl9P5513UmeLEqxUk0QJsgODbsEMyRQQ3ewtj0wosyYArPkq6KXStm4a0/bhJVhNVtxZlhVR22V4JTwimXuwDT8S7UQXTQ2qtTi5q+l4CQsSSGnv7WbHtN6yQcQKPzzICMSx8SnuYKDY71wNPpQQe2c6S4R0nUrIUO19gs4vBsLcX8MynuPcYAE1nlM4yWelP87HrEfoEvUQ8wiYNv1irzHWU/KHSPgxP+6vEp3+KIBc9zLbGUxgOsjKSHjAaWlqCHEX2adb6MoAefOSj6yKkLEb/tgt+KS/ijkeGSTxumRsqvuzGbF8NHcas1+cRoGlsCSoBl0o535S2aJFTZJ5eRefNF87jT1NHuokoiJNrlS8H39RiZwHYUs6WZ3TdX9LyJW0qTRl8hyu1wc6dVlKIzMSutJ10HBx8St5L2v9UFWGtVkSgHGZfKHc0s6Z2TW2APIas5zDrYUH6sxIa+aR1eRI5t/TD8t3wbldr3i0IX+Kyfx34cGYmQr/V2BKuGz6dVXWpkvYLZK4M+2JeEwvDtB+rfeXHg6z9H2toW65PSl8r1P5kogQW5mTCfC3Sw2UY6AhXMolXhp6KkWKuau4sCjb7IYAgqP9uQM5aMN5UwLyvWzKY0zEV/5BcQAesv+BGjYs+ITIGoB6TO9+p7n6fliV1SVoA+hgQeP3cjDSw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6d2a981-299a-46ed-145f-08da6e4ffb3c X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:42.3774 (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: aHHdup6OzcWyzH80ehxL0rvyGXSAVULX46TrBsX7ge2UmiJ85df2Q/6X9D4cX+Y9GwspTekHAQi8AZY5dICTcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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 Mon Jul 25 15:10: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: 12928172 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 9D0BEC43334 for ; Mon, 25 Jul 2022 15:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236197AbiGYPPW (ORCPT ); Mon, 25 Jul 2022 11:15:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236204AbiGYPOt (ORCPT ); Mon, 25 Jul 2022 11:14:49 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130075.outbound.protection.outlook.com [40.107.13.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA3301D332; Mon, 25 Jul 2022 08:12:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jC8Eb9Ndy4VIVc0ciooPylvhL5xlcESmW2r1YJ0C6VH1feZm5ZIXjLuZ3cOL4bBCCAJK1jrVKBFSUzKu7Nij8ETNxYAO7U7p4X3oFNvf8AhCBF7YGQOswBf8oCVbw25aexB5yZAlxIjfg/7LdBvx6iwAxQv4OySGkplZ331klkC7YnP3uaBY5GHsz3/XYBNCWawSUAuf91Eay0bROcgriCtiEBr9TuY58yuSOo96sTxVN1TZyCFOtu98DZ0VGCOChJ/mGbbcj+db6Kep5U+dYEwRpnG+PqOvrwUpXNR/iZ3bhTEAPnfzx/PMH9yXaW4skejPQhvasRdzlkd4uMA8dA== 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=W3vp97dXS2dDWAjQp6qGCk48FbXl+VSCdypdMEq22+YcSgakDHNrD6oe9qBuO6LUtvwRqm2ipnSqIs9TzckcF74Gi6xKbnRyE7miZTKz11qjWn1lMKncZF3Atb48g6I8VYzr899QMPfBB8S9V0Tb2gMWAfNtYU8lS6Gp7Rdsn5Lzv1/Wyb0KIYgkCNePUMGopjwkwfUB8HI2GG78RYKY96OgMXWqqy83/rIp+gn3nPg9H6gGeVbPDaPF8M5cYw/9rTeyG8RWdQDsM2V/Cyi+R5RAElbdFyb0X0b5VkjZ9Xc1Z7Ngm0iOAoJA/WTrzFEDtzvk3gcn7piZs4dIpul82w== 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=GXvUeNlPiT1ApW95/G+OoAUdCzuwqBa5e5yVniYi6H+qdbS2MtJl1EyugFF709ZVYGk90sXnCSjRzTqdZ2v1E/3LpMesf51eSTdxitf7AI+PQ2HDBj3uIsmmDUAOL1+pmiNxUFDxGMni5ErPei7ldWlSfmRDmeK4St48aiht4F2ZmuKdJBcnlZYz0+Xj+Qh3AFldqDY//FO3FLzpqjRC9t0yoyNN/mnLfrSpw3/fZnUsZcC1+upH1Squu+ezqzgGsKolWHkca915ay34O272SXT3wnilG7gfh/FjLDwZCX/SW6tYO+Xc0LXj1hpO1M8e2kXgivWumNwO72lIYsiJrg== 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 DB7PR03MB3723.eurprd03.prod.outlook.com (2603:10a6:5:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Mon, 25 Jul 2022 15:11:44 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:44 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson , Li Yang Subject: [PATCH v4 25/25] net: dpaa: Adjust queue depth on rate change Date: Mon, 25 Jul 2022 11:10:39 -0400 Message-Id: <20220725151039.2581576-26-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) 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: 0dbc1cbb-3144-475b-50e5-08da6e4ffc61 X-MS-TrafficTypeDiagnostic: DB7PR03MB3723:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /kkuuYPOJRqNFrMqtROQOLaW7oQIhr74uA4q6JbysnLmkgIGf0i/Z2A2WZhfihPM67PYQ+r0c/IUJ+DzmE2eU6a6MkYTLR6coeT+0kWk0Luflgj3MC4CGj0z76/Gc9V8qySmqLqZEBrtrgOMykg7pEJmICmxeSMhbqOeNYW+wCG7YgR4TLohsDRRgabbjgibI80JA2UwX0wkwaFdUO2Z21NKKcQTnmB1y8BCCqcAm2Pdnoa6V2WAv2zMEaarq6tMopVmj7kB4Qr7XAisw33tIxsLMZQceZH7Lz+QRWIDgE2D8eZHS2zXtWZBN7e25ri1+PGBMvhwZq/meBVoHjsEhL3Uuss6YUwdlZ2EJGrms38x6HCorOUSkqf739wtlVmEa4Z/5Os/VsJpjPAOlZhA976spUnjOaPiTVYgU7h6BYsuiuc8g8pQ4s8+U/9g66UodD2xPtYK4isH7WiFY046PCBx+jUKM9OgKt3a2qTo+7UPqn8l64rPQDpPB3biPN08JkpKtaY+jlnxmZXEOX/fVCjw6y5KnVoFOmr3KYBGkwr3bgFmxgSXn5fisIIlAE/xpyGOoDL07jQgvYY57Jm8QZQI9qjXr5IuASBw/k9Tf3LBlWnSDXG6yb6rkAs5F8z5ima0OcahxCc87gr7HKBxpRO7yZuirgHumxM1IdsO9vcXpQOjDPbCGJE5tYn06Qst4NCDB4U9Uzu0NJANV4rI23w//bJwBLwmLfMKxxpVEuFPmM063BxSOLsFPTHkJF0u3xz+ScWaZ1mEB7K42DEKvDEOJVIxdHnKlBoycKsa0QU= 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)(136003)(396003)(346002)(39850400004)(376002)(366004)(186003)(6512007)(2616005)(66946007)(1076003)(316002)(5660300002)(44832011)(66556008)(4326008)(66476007)(8936002)(6506007)(7416002)(52116002)(54906003)(110136005)(6666004)(26005)(8676002)(6486002)(2906002)(38350700002)(86362001)(83380400001)(38100700002)(36756003)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CA1vibEQi+6AZaDHV9k+yure4wk+N+3uR9DS0MghHP9jZdoiwhAqQZF69I42BSIvbq0oDnF9O4qoW6c1ZlQU32yI57fQ8emc/6oeGXDJhDTOL5TmPerTBLNJWfsPwIrqrF10i15tTXOTJ1Gmkn+vBKi5MOBBOUS76Cc8Lceo7N0YAr5AWnOCsT+Qsq3LnDyWIzj2jRs0Bt9IHSR36Xuqe6v7/0Lgn8Dcqb/PKKeQUKaEEEleJk73MRcg/rv+Pvv4Y7EKjdOqdiGQNMEz92Dy+FVDRDMUpG9cFy0p3wRH/vDdhmwiNNnNU4vr9zX0kBC4m/+npctIddif2yf2cceQK7OReX84JeiTHoa5Gd3lmFwnFvgvheoaJkguD3gbS9ps1UeeZfh27chrTP3gzTJX/zFx6nfdkdLVleciCDhV3LsUoGLn/rN7+mkyVVN4WBVI+iwLgVyV/1nnqaYLOC0cnBgb2pP+if0yiVr8760IFiKu7AAkOWySc5PbumWYXQwAV1shFg3sIUcMsWL1w522TyMoyL4awA46HdrldgYiNxiZq4FRhVcMJChvgyJkYIoqL/LiFSxXAeyRaZqnsE9FHWB6NkmEInnoHFrDRrCx8Eqpc7vEd0ejmdY30W/hZ/YWANBd0kctMiQzEkx8RtZL5kWvGBw/LbsUEL44tDmMCpgCNF+RPi7zk1gwnvNBs48tgmXQddECJU2ZEJ+f6GIyPVJM/Uwm8wiYnb5Q51/PG15x40RMbQvD86MvmDpAMk+zIW/3/NJLRwNHhauAAEUFyKLgl/CKwJT7aoy76ODwz5syvCSLDZscHxO8/syy8wnvcQ6CUJqV9VV6AWwRp0mGhxtdBc7Hc8c5heTR9+8VwPcK7816XJyz1yAbcKT8ongYNK6r8sSA334vdwh9ra7xoLNk8K+dTWpoQNobHB1xSepW5kYc6Fd4TvA99ycHM1aNtfaEyX2/1bK66hm3vlexP0dAB2PLe+oTXO03wHIsPwl3J3Fwe8VaUx4hODjtYEEn1FOltrm2sfjuxSzJY5RmydQG9HbrWg3kXTmp3jFNgPlpG4uLOjRhzMhq7RQnmiZy/yU65WM+CcZ+FnQydt2TZj6y2fkqVYRK31aY/bMHZnNnmaUGAIuC02oHFTXNE/cwlzHqbI/GN7fNYq28bLAjKoA+TGIGnd8G7xkO4cZyYWTWAk8dbLSaQE5iorL1TmN1g5qnDkGHKPMzXP5+rSyn1i+yQzX61/l92/PZtuL2tjkMUFc653QtJrX6fCAEAkxQC9KTFWUg/HJAd9HjioVxo6XbcvZ6ousf8AW5E6CUYO2eV5KIWCilw5Dg3PtQyMOwFNe5euN1zHNEA79JDFACOU3rgF5wsR8Jfd7wFIl8Y10Odc3b5xzETLHZJhhFm6akz7NjGMIhvszdIl5ZbZcQNXKPLFaCclz7+Khwpr4DtrQr1SmUMaOKaZzlWbxxB9/T6Bkp9dFF/c69+o2qRB4P0leNmqE+YLZ3bOR7nCnytk8PqhNBj8jrfhFL/rYzScF9vqyH7F8Z2gwpJ1Z7z+gZS19vUvVm0X+jqc7ILigxIEaYuGBFOsk+3dwty+/YhI0p4gxjjv7SPvS7I1ypsLgePA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dbc1cbb-3144-475b-50e5-08da6e4ffc61 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:44.3929 (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: 0W5sY49ioRFsnqNzEEgF35m0wrVCPBsetM/pxOW+JhN58TByk2B3XgqUB9qwQdsR4+1TwaJND/pYH2MZDW7okw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB3723 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; };