From patchwork Sat Dec 5 19:17:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 338713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7C48C4167B for ; Sat, 5 Dec 2020 19:22:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4F172311C for ; Sat, 5 Dec 2020 19:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727953AbgLETWX (ORCPT ); Sat, 5 Dec 2020 14:22:23 -0500 Received: from mail-am6eur05on2101.outbound.protection.outlook.com ([40.107.22.101]:29825 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725973AbgLETTI (ORCPT ); Sat, 5 Dec 2020 14:19:08 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MnE0bVK1Nv0U7j9TTmn7cEQAAwSSmYM2/MT3Z02rk3R1ePtjPTOVygEzh5lRuPDs1jEhfBoqTJolchzN3P9ipd0yO95qnNjxSCu5wIeWh9Bkoui/zqCElEdQ5Ta136BLRUw0wPVrf/X1rfvQplR9JweRmbgzxmT6qYHX8d+KiK9lJChQf8ZNrsvFR6sFLJDgJ6JFpAI6/lc79aiQmAeiu9chSNIf71634Q1V8wHkK62iSdax7zfbuzxGHesOG8EOmbt9Xna54TSGEbBoyezJuwo8jeLCrBR+OGYpDvHk+BNXE3NSFPGJ5/0CcP2ORJ/L08irslSjah56onZWgZfp8w== 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-SenderADCheck; bh=rKYTTJjfAYq2SHbpf0pgwGx+PpevNL4ulj/gk7Gdwr4=; b=YybYd/QKcYXzpxsH6WAuoQJ1aP+HeAPF4swfpdpFSP6GBIhgToX29tWfIi2t6bujAAUCoQaK4ZnehrN0e6zBWGI361d9SnuqYFMbY3Fkfz/ZKuCE0rc9ypKhzt6wU99L1wuL39vW3Mi/6M/0cnSonajJU1yOvM4sTDWEpRLVJKIUkoDdIuPyFgm0sH7n7uvxXUCxCJ8NNALjDC9JLpEp/CFp0J5EDUnNh7exd5Bk0/UulAQAIywrjfjTZGYvKa+X7FWl0WSWbDiPIfog4pjjkL1zEjv0BWYMCypFWnAJNbm6sH4aen5naCABGxw0Uj1+7N3+4dJcxobBJhPBmwnxFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rKYTTJjfAYq2SHbpf0pgwGx+PpevNL4ulj/gk7Gdwr4=; b=BFWn2pGWVhht7Y+aMLeN2dV3aEIdqdPVPkBKppCYlLxvQUIqXhV1TB8ucKVKKnHoZ19NtXJn6JqDrCFyF9QSdbaGIr7cxmXPsVi4M57HNEZpnhoc+rpT/ra76vA4T8yT4RtXhEqAsfnu/jdwkoncdzJ9V/CbXgkMuv9fzmiBALA= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:18 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:17 +0000 From: Rasmus Villemoes To: Li Yang , "David S. Miller" , Jakub Kicinski , Murali Krishna Policharla , Florian Fainelli , Vladimir Oltean Cc: Zhao Qiang , Rasmus Villemoes , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/20] ethernet: ucc_geth: set dev->max_mtu to 1518 Date: Sat, 5 Dec 2020 20:17:24 +0100 Message-Id: <20201205191744.7847-2-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 55ed57e5-51ce-4b10-7060-08d899528567 X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uX0ygCh4xAy1OsUAKag9n7X8+icikxLzMJh9bcCUTmCx1QrIIX/PcnRt68TUxa2hKm66K73QquHNDmvMqTlAtkvFVfIKplU01Dk8V4BCv4IVOoS9/GVD7q8cHbLB9I/CZYfVqLkiJW81UNI52bWg1VtzJ8m6k+k0cnQ4zDlPCfk7IBkP/350wzDTbq7ufCORNewwhfULCcY+5uifv8RBZu9G/RNbT7NmCUcgLtqkXlc0JETKitC/cnHk9e+WgOVnFv5Yb9ry+7F4bBvSMcBBVAL5eU2CB1f/uUVPDEV2+EyuFqCxWBfTjIYwhacfC9df43yD5dqcZHN/REcf+/snWw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(6666004)(7416002)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: +KnOMDX2SE8w3VxPbTCxSFRExjqaxMD5y4FpExYaT0Ym7+6YFloEi17/1nTXAwN/bnOEL4ObZuSESci7F1yJMn2+LDpNliha2l2pWrR+vkdrFyNveFCwGJ6IKV91dZ6aUwq0KvFhLbH1UbKTQpC6KNhckBwUGSicPfRfbdz6ZeaDM6Pdjyql7w1uzbQLbqnwEspQ/VyZnnbRY/dLkfboYRbpwvV3yF3bV1lbMRemupnyiFBje5+71Pk/T0AclStWJO473ADOJsyFTJs+zwdPPiGoXm3bgiloPrd120AUiVak2JMxOXWpgWmS1Dyj1QWzvYT17ysSFL7bhtNCbyY26/5qo9zleY4nADPfzMZNkS9MCcj1jSGN0odC7OntmubgbHvlKBZhVz4TBxC8DKxFSZyVGRwRdR32udg67UqxIeSS7maOwUOMiuo1lBmivUnuIEPb8CsXLHO/jO4N2RAn2UNNZBSzDUu/6oNPF9hPYW4YpSSg1cBiNrJ3qQi1E7arihiPFonS/Y1ajPOfeEWy2xXXekZHRj11mki7V500aeyqcEJfMIWI/MnL6eRBW0SedZVZS6nbvwB6rstgQggll83GQRnTL7S8Py4kiScBXRN1aXjpQBdcoRsRjqUYmSsUWmZ4mMsZfVt29PVOC6UOfdvPZ9F9mltxHsxtzewH6Knauk7WYzFdt/I7VAM175yyxbZp+gwZApQIu3iDuX8gTz3k2/UtNAV0BvAZlGQWi2zW9YUiMop3iFqeSU8HqWn3VZuVHrQKTAKXv+lzXpxPNwff1kyuXY2tlnPHvXWY75e3MT0ORLLD/Ohh0niBKau7q1wB+fViqRVcBRvddDSVcS/dV5iBsAZMcEU/MUWO5b0lzUtv5Ris9fSprLbJfX4i3I0Ema8lMS1JL+pVXQNrwb38LpHCgvK4iW/RozWsrghpJFHKRJ6KDnPskmwBYPnFWMad449kfh6i/U5DfixTLy2iyIEoR5aKVqqO18JVipVGm7zvLcucqqWQaPnt8xxp X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 55ed57e5-51ce-4b10-7060-08d899528567 X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:17.9070 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tERVoIkKN6pLidz+awmXi7a14UAzx2Z0V2iAwbFGsfSb69x8pjAFfScf3kpdCCgGJK8aFxrtnQDiVrBB+O/rkA0E+1wOTAGEhbsqg+r7rFs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org All the buffers and registers are already set up appropriately for an MTU slightly above 1500, so we just need to expose this to the networking stack. AFAICT, there's no need to implement .ndo_change_mtu when the receive buffers are always set up to support the max_mtu. This fixes several warnings during boot on our mpc8309-board with an embedded mv88e6250 switch: mv88e6085 mdio@e0102120:10: nonfatal error -34 setting MTU 1500 on port 0 ... mv88e6085 mdio@e0102120:10: nonfatal error -34 setting MTU 1500 on port 4 ucc_geth e0102000.ethernet eth1: error -22 setting MTU to 1504 to include DSA overhead The last line explains what the DSA stack tries to do: achieving an MTU of 1500 on-the-wire requires that the master netdevice connected to the CPU port supports an MTU of 1500+the tagging overhead. Fixes: bfcb813203e6 ("net: dsa: configure the MTU for switch ports") Cc: Vladimir Oltean Signed-off-by: Rasmus Villemoes Reviewed-by: Andrew Lunn --- drivers/net/ethernet/freescale/ucc_geth.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 714b501be7d0..380c1f09adaf 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3889,6 +3889,7 @@ static int ucc_geth_probe(struct platform_device* ofdev) INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work); netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, 64); dev->mtu = 1500; + dev->max_mtu = 1518; ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT); ugeth->phy_interface = phy_interface; From patchwork Sat Dec 5 19:17:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 338721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02ED8C4361A for ; Sat, 5 Dec 2020 19:19:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE78223110 for ; Sat, 5 Dec 2020 19:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726609AbgLETT2 (ORCPT ); Sat, 5 Dec 2020 14:19:28 -0500 Received: from mail-am6eur05on2119.outbound.protection.outlook.com ([40.107.22.119]:7011 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725902AbgLETTN (ORCPT ); Sat, 5 Dec 2020 14:19:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QmA+LdE07DiYu4+jLA4oAJDXT3IVqG/ItuBd1H0MjsiXeimi+eDSXgHOM4Q8sGQGGkXm9nSusRq9bWMjfLB0wtTyDFtsgBHlNlxL0x8v4qj0zDFtifqjDK/t6gEIeOZpgbx5M/W20ZgxKEWIMWegCU0DJdrclzmNtpIc/Bm9AMluR3YIkzMaG2N+K4uCk+YdqYDHDGV6Sv8vE+2eyaH7lQzRTtQyVccrXEL+p29ayJWcj7EkHDZvEN8MA3zi7zSWY+8nGxHltAKrP7o/8g1azRKYpWGQprgG1ICbceniVXon1GG1LOKDhr/7hbZBNVJLbcaWbCtIe/pRjSltlfAyYg== 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-SenderADCheck; bh=gkCRv1cpcMBcINj2tEY21IZ9I/xHKv6lZzxZhPcmuQ8=; b=eOPhVQE09MiFiNMoqCK0qqWWDpHhWGyFcU+gmeqJW7K8ubzhdq0IqXSEdQVxq6GNtnES2QEXtR39xh5LXza5aXw9pa4mODjpR3IxPHMv8T1MCxl3reabIMH4iJ8kL1AZ9F7ktqJ/4pLd3Kc8VrQtcoYuXrYfejoT5qS0I2iXepV40WD0NhZnZosBtyY6GbWd8W1GoU0VgIDHFuR5w75OvAp5FznvvTnoXFQ+N3lvOyW6/bd512hoRRMRu4gZ96H9y5DZZkjq/zj3lKwTqPjPu7MfLImBpG035FothsOQjj2biNK0oxlQOhblCrOKhpkfQ1keqnk5VlozVRuw9lZyBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gkCRv1cpcMBcINj2tEY21IZ9I/xHKv6lZzxZhPcmuQ8=; b=AUjYELBVrYzDRgi08nkdrh/aYR2hxxVgVVkCaTgXb2P2FKqz2s19sU2bjM9x0kcunlu1OAxNWyHexg5mdKxdNopMx/TFprB89VxagypfU2mLePVJMcEy95hXRncRFB0bTYh1bTmXveHowRDj/TUBbgoqBFBje36E53v/BZ1Fy5k= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:19 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:19 +0000 From: Rasmus Villemoes To: Li Yang , "David S. Miller" , Jakub Kicinski Cc: Zhao Qiang , Vladimir Oltean , Rasmus Villemoes , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/20] ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram Date: Sat, 5 Dec 2020 20:17:25 +0100 Message-Id: <20201205191744.7847-3-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e10cf3a-404b-4257-1478-08d8995285f0 X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ATMaDT22gB8Ew51QMzugKcQbRAW8dGiYru8ns1Z5BiPrafWriCsaMxzz9tEeeTsrgQCCCGakaCI88PYhUN2aZY95WoxIk7dhvC3I7lBzmWZdWBy1KAzptDVpqmVVTuASj74DihtQFXddy67IpQTwzbWB/VRPHR+C/1OC6KAxntgZ7aPbRosTLkMW0j9HMYyF7GzruQmASleZGGpLcgLkqk5BKLFyTxXQdzH8zlLRRHy5ULhaogEtqPliWGqZUzjspd+bd5PCQ1uuAZaj79tSoeufLzrSXBGtQ1nLG3QMp0ls18VBmCUcwVO+qpXPZFkh70zNphKbjTktg9S5ENoRBw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(6666004)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: It94mAI0AKYv75w+TcZI0Tm1OB+q0FFPUQITyfzdN9zkHWEXm1Nh2NU5QtkJu7ZFGUEXRf6P2lug2r4vUAvP729yoGm+1Ue/cTbec9W/it39alG93cuf8yj6Mzi7YaJF+y8iKCkQ77WK3GY8GMPmLisW7+49w+2aeu+XXHq8AKqLBhF2CNMNkKj9bnvLVcJju0dBHoJsuaDP5GaBrKD/2cU86vSKmOst2QwjZYmZ5vQmXapxFquAg7p4/7ZozcxqHGPqzk3E+99TkgKQTMjclrBiaT16cZsJyTd3T6yhhZHpbZ0/HaL1wUbbV6FqvuX0mvYdTxHxqes6IUSfpSUSnxYorNX4zti3yyLR5xYp2lsX9oU/hfJX3v93izSTxeYIBexHQxnNR9dUKsX8X/zJKe2kFqordQoiCrZ5Y/veD384whAd+EH25i6kNlvzCPdlgMd2oW+9wqsshhJyLQ9hG5i4HJWSsei7/6ZARUn7uVeshb33k7GCTwRkH9vwjcQ/icgOZOOCbwkET1OafcYab9sx8qjEDwdHaZmqxF6xhVrHB2GklpMcAuPx0MfP3K3jV+Pjcf4jdsln3SD/HQIkjw/qAdUCzZ5vYlAqRYg2D/Ie3W8SyaQYVhSQvhRhapckYlS/akd4ip5F5Suu+y0uvBQIr+gj4KuAfrUXDNCooCQnqPkbCqaVhEfZ/L0+Pt/TAfWtkgxLBehdgWHTw8b8aoRg7sWqwyncX8M63DEbhYIBXd8fCod+RtOYEXAfDEjnS3b7o/Agj/BiNrclkjXTSLlHtJZHKbPkeDB+nOV4Cu4XM8EMVWFxtAa3fzlXgCDd3bI6pvE46h2flQIXy7OcXAd9OuQT1CL/noAfPOGbQUZfc2s8DQhFNwhs2WFuXxamJOK5jB9p+GJFiqMlljAqUWeFPCGqiEha0VpGQcbPy4vS0Etg0r1zy2LiiUt9HJHdIlKB8iAPt/5LSx/nRXLYLBgqQjxpe9VzexFIQgMbF4ktMRf+FOr9hlButxByGYHf X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 9e10cf3a-404b-4257-1478-08d8995285f0 X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:18.7666 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RAV6oK+KwloH6S3mzDO7mac+Ml0OzKbEny5DncCFVubd//qRnwmgQHX+2RRPfX+rU1SkA8KISh/n1OLPx5ICsc5/0zFc+2hjK4OHpIzpeZo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Table 8-53 in the QUICC Engine Reference manual shows definitions of fields up to a size of 192 bytes, not just 128. But in table 8-111, one does find the text Base Address of the Global Transmitter Parameter RAM Page. [...] The user needs to allocate 128 bytes for this page. The address must be aligned to the page size. I've checked both rev. 7 (11/2015) and rev. 9 (05/2018) of the manual; they both have this inconsistency (and the table numbers are the same). Adding a bit of debug printing, on my board the struct ucc_geth_tx_global_pram is allocated at offset 0x880, while the (opaque) ucc_geth_thread_data_tx gets allocated immediately afterwards, at 0x900. So whatever the engine writes into the thread data overlaps with the tail of the global tx pram (and devmem says that something does get written during a simple ping). I haven't observed any failure that could be attributed to this, but it seems to be the kind of thing that would be extremely hard to debug. So extend the struct definition so that we do allocate 192 bytes. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h index 3fe903972195..c80bed2c995c 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.h +++ b/drivers/net/ethernet/freescale/ucc_geth.h @@ -575,7 +575,14 @@ struct ucc_geth_tx_global_pram { u32 vtagtable[0x8]; /* 8 4-byte VLAN tags */ u32 tqptr; /* a base pointer to the Tx Queues Memory Region */ - u8 res2[0x80 - 0x74]; + u8 res2[0x78 - 0x74]; + u64 snums_en; + u32 l2l3baseptr; /* top byte consists of a few other bit fields */ + + u16 mtu[8]; + u8 res3[0xa8 - 0x94]; + u32 wrrtablebase; /* top byte is reserved */ + u8 res4[0xc0 - 0xac]; } __packed; /* structure representing Extended Filtering Global Parameters in PRAM */ From patchwork Sat Dec 5 19:17:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 338720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BB68C4361A for ; Sat, 5 Dec 2020 19:20:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB25723110 for ; Sat, 5 Dec 2020 19:20:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727060AbgLETT6 (ORCPT ); Sat, 5 Dec 2020 14:19:58 -0500 Received: from mail-am6eur05on2119.outbound.protection.outlook.com ([40.107.22.119]:7011 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725902AbgLETTh (ORCPT ); Sat, 5 Dec 2020 14:19:37 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GVX4UIeg9/Rx4dAPA1Oin8ZM7hI9frhCY0J6HOB7LKl0ACzp8q+G3iD1mb2UcVmVGax2Ord74hm0sZMuPqzG4IE6akVyjlG5R8FCo9pBNUJqQtS9WkmTNFzKjsFt0rvfwkvEeTgh0pfDDNmMcWGUppzODGtJO+4MsDQ6eRQ9oPmC9/bt196ZoMJKLJX3A8JlAMkCfoASpsIDyU7TI3ow4zJIBV1AiIRrqPIYYQpyTj7Db/36d60V3tH5IYQ9OXggV6KFCO/t9cVbYu3bRFWhK7ZMYRz1CW4r7qtUwlKi2RvJaUr5hfKvqtTW0lv3KhGRYjnIg07jARtymYBPA4GJ4Q== 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-SenderADCheck; bh=/nFx5CL8o/Bsv7UCujawuGddlmBUO91xAOUF5SEfX9M=; b=JvCxrZfe5Nu7dD05sdDKw6RZm1iafQXE64suuN7eamlwKb2/5LAOEuOHQ5mLB17T+Mou4xB9SFYSINeyJ6Hq6PQpACFN6a2ptG5WvfccWU14RizPGSgU39ts7dQ+JNHt6XsjVnMBGPaBbdyWdBVH/F2ETLefe0sFLLU8YKFWnCFIHdXabc1xO/91OxN90iMVgJB09xIxMsdfpe1xQt0KyGs8fwYe9Dg9JnylxZc80+QmSAU+L4qokJcEFWiXeOpyY4+ogHxdLIj0vZPs1folRwRLcDVOzyJ7QhH0upjiVlaS7Fpq/WkWmMRH0/p7y4J2+ih83z6H6pLW4l1Cnl+6zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/nFx5CL8o/Bsv7UCujawuGddlmBUO91xAOUF5SEfX9M=; b=Bg1PgkW7s80kpuY/Lsj2k7+6X+NHxjhwT+vEGrOC2KzrWnXaIfNJOqtabkpUUlhMxjqOM6UNI8G2BHwMiwMbfU/fVtZk26MoiUYt2hoGZEfvIcMtJ+yeak9/sEqhZnvVy3JTFknixGhlTFYtIO7AqNIfNkQjOpdleJy2kK+iNJY= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:23 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:23 +0000 From: Rasmus Villemoes To: Li Yang , "David S. Miller" , Jakub Kicinski Cc: Zhao Qiang , Vladimir Oltean , Rasmus Villemoes , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/20] ethernet: ucc_geth: use qe_muram_free_addr() Date: Sat, 5 Dec 2020 20:17:30 +0100 Message-Id: <20201205191744.7847-8-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 91a5f2bd-831c-403d-125a-08d89952887f X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lsCRh38ZPo4z9zQ1XXf1L3vtyXYuBkE2YvBHGzjcoS6z8TXsnn/za6TveTXmNkbT2yujh3VGAw8S7jR3UbBVcH3FU49sn0iI5/TFK6kZ18skooKncQd4qVybTexpMfGvMJIJ3xUM7IMVgdt1++UJ9nNDiOEKi5mUXdJEQJ/qbSGYRKNL5uFpihVN6aeKEpguz2JbNNiFbLL2k6PUO/rcccVq8nqQrEVVbFbbpT259w0gCftm6D0RCsvegOSJ5kDMClUExAgkMJgDvrgq9nzj/jRotk1FvrPOauXg8QNE/KFzljaUSylNklfb/nB5eEENv4yc1Vu3hE88W1Yvjfm4pw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(6666004)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: HOUCAeZP71rfnGVkSi0/9Mx/zwtAavh5xZWX2vy03pJ+BpnAE8E5WNxg1zoVnUPtFrHPQWhDPHhSawXXZFznTY46Mp/4y34DdGZDHtjyewpaSd4U705KMkXvGhZJg67quxJ8iCmuphRrc54eGTYjWzNbzCfLgOcTFeaEBPMhSzkr148OQMjvBBhP9bsmVVEOdgTfdXAkp1UBE+hKGdAHibdiQnYv8bk0Qz1Jdtu6KpnBcSiOxTJ+tQpSmjwwSsLgyqjEN++TvOUec1RxLO7AnV3D5uKkU0rGZM9sly5DCw//kQ647NBQWpggt25fNQL0Ahxqe9FruLxbyw9MrQhUu81VAH2i6rDG3jysYdxkAN84+tipxU3KsJRVLKmh/divlsAr4/IfS0bkBNDAHriIOMi+MFCm3xQIiueKYtkIgb0c/EyZWYttF51h0K+0R2K3jSBNlBtSfRZpCzxSAFx/MME7Y2UF3dsiibr1YJ93mB8G4oJWHR5yyxFc1z8vDgMt8dJOUrC3PlH2HLCXA/S9MkOacwarjkrbG1dpBYvUAOX35FSptqpD9V8IuzsFpPXRgVpjvP189z78m5LLXmKoX6Fyi0qRjkl8PdjTRNKFitpeT1dFZL//KNsynnArxYN04PD4jVavHYi+kI/BL1Sv9j+UA6E/ZVnnTZFSA98vpvO1HGpDVqckB1rjAGMcAGjycpq/HU/fIe4nH6x5HuugJE5bNC6/LmpksNfjOIgTQoQcFgk9MFCRCQUttYMqAmYSYrYVhoPP0Gsy1S2PbYEqMmfVcNT98BnwTtQ57xV0WYsR8bAYCvEtOYubHjTdhH0Fkv+8zFlbLgLU+U29QIOMnO0cgZx46S9SIbMPR0M5r/xX33AugtW6cloEqVMlldX4C4gdXec0xSP5LskG0zzQIA+tZX3h1tgNcNz4fQHYZV5jpi2075ELG6gDuhva7uIXLenO1Qls7H9l8tHonRQOU5NOaNIqS3+mckAD+A0cVEnfXxqUCsE5OjRlCLMyPkmy X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 91a5f2bd-831c-403d-125a-08d89952887f X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:23.0521 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KFwjY2lnu8a73hhYW7gFuJ3geAJauNH5YhkH3sMJuVQxNNwThh429NgsCKd9VrP7/wgMz0N3Ula84Qfar+jwhZbxswhpvUieFX/QEq9Kcxc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This removes the explicit NULL checks, and allows us to stop storing at least some of the _offset values separately. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 77 ++++++++++------------- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 6446f2e562c9..bbcdb77be9a8 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -1921,50 +1921,39 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth) ugeth->uccf = NULL; } - if (ugeth->p_thread_data_tx) { - qe_muram_free(ugeth->thread_dat_tx_offset); - ugeth->p_thread_data_tx = NULL; - } - if (ugeth->p_thread_data_rx) { - qe_muram_free(ugeth->thread_dat_rx_offset); - ugeth->p_thread_data_rx = NULL; - } - if (ugeth->p_exf_glbl_param) { - qe_muram_free(ugeth->exf_glbl_param_offset); - ugeth->p_exf_glbl_param = NULL; - } - if (ugeth->p_rx_glbl_pram) { - qe_muram_free(ugeth->rx_glbl_pram_offset); - ugeth->p_rx_glbl_pram = NULL; - } - if (ugeth->p_tx_glbl_pram) { - qe_muram_free(ugeth->tx_glbl_pram_offset); - ugeth->p_tx_glbl_pram = NULL; - } - if (ugeth->p_send_q_mem_reg) { - qe_muram_free(ugeth->send_q_mem_reg_offset); - ugeth->p_send_q_mem_reg = NULL; - } - if (ugeth->p_scheduler) { - qe_muram_free(ugeth->scheduler_offset); - ugeth->p_scheduler = NULL; - } - if (ugeth->p_tx_fw_statistics_pram) { - qe_muram_free(ugeth->tx_fw_statistics_pram_offset); - ugeth->p_tx_fw_statistics_pram = NULL; - } - if (ugeth->p_rx_fw_statistics_pram) { - qe_muram_free(ugeth->rx_fw_statistics_pram_offset); - ugeth->p_rx_fw_statistics_pram = NULL; - } - if (ugeth->p_rx_irq_coalescing_tbl) { - qe_muram_free(ugeth->rx_irq_coalescing_tbl_offset); - ugeth->p_rx_irq_coalescing_tbl = NULL; - } - if (ugeth->p_rx_bd_qs_tbl) { - qe_muram_free(ugeth->rx_bd_qs_tbl_offset); - ugeth->p_rx_bd_qs_tbl = NULL; - } + qe_muram_free_addr(ugeth->p_thread_data_tx); + ugeth->p_thread_data_tx = NULL; + + qe_muram_free_addr(ugeth->p_thread_data_rx); + ugeth->p_thread_data_rx = NULL; + + qe_muram_free_addr(ugeth->p_exf_glbl_param); + ugeth->p_exf_glbl_param = NULL; + + qe_muram_free_addr(ugeth->p_rx_glbl_pram); + ugeth->p_rx_glbl_pram = NULL; + + qe_muram_free_addr(ugeth->p_tx_glbl_pram); + ugeth->p_tx_glbl_pram = NULL; + + qe_muram_free_addr(ugeth->p_send_q_mem_reg); + ugeth->p_send_q_mem_reg = NULL; + + qe_muram_free_addr(ugeth->p_scheduler); + ugeth->p_scheduler = NULL; + + qe_muram_free_addr(ugeth->p_tx_fw_statistics_pram); + ugeth->p_tx_fw_statistics_pram = NULL; + + qe_muram_free_addr(ugeth->p_rx_fw_statistics_pram); + ugeth->p_rx_fw_statistics_pram = NULL; + + qe_muram_free_addr(ugeth->p_rx_irq_coalescing_tbl); + ugeth->p_rx_irq_coalescing_tbl = NULL; + + qe_muram_free_addr(ugeth->p_rx_bd_qs_tbl); + ugeth->p_rx_bd_qs_tbl = NULL; + if (ugeth->p_init_enet_param_shadow) { return_init_enet_entries(ugeth, &(ugeth->p_init_enet_param_shadow-> From patchwork Sat Dec 5 19:17:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 338719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2855CC2BB40 for ; Sat, 5 Dec 2020 19:20:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 002552311B for ; Sat, 5 Dec 2020 19:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727363AbgLETUX (ORCPT ); Sat, 5 Dec 2020 14:20:23 -0500 Received: from mail-am6eur05on2119.outbound.protection.outlook.com ([40.107.22.119]:7011 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727223AbgLETUL (ORCPT ); Sat, 5 Dec 2020 14:20:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bVS1023gQ0dFhaMYIHFWk5R78t+ilfCVU0OqTlUfw1yS7Ssil0iFKyOIN4rUlbgiTdkCnWT+ixjB+JNma6KtGgm5dEft6Kf4uLi9Iyt3ewvcsf7GDLUNltV2BSApi3fxSwA+d62ZCmBNDA1rq0lxvAIvFoO5KUUenMiLfqjyikOCKFM+9c+myb5w/klGdhjUDaxcMjJAj2xGQ7Qzr05djYj7kyeGgasoi0dyXTyUXG8XMJN2BO9lxkws2chMKBqfatpmXXhjcMgN1waLixs21Auj6ShGs7bnpZSC/zVJVayhaJZKZ+6xJd34KGBCOK978sSAKyjNxADyvfK3Nf0SXg== 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-SenderADCheck; bh=5zKBHs8LCaE1OWo6oLZhEwPWsaWUQu0HqN4yiGP2cbA=; b=NDxz54P3k7XgpA1ntZYz7NllFLyew/4HQ7yOscG8eoR6SzBWqKcaizbyiouHsacvxeEz3c12oc79XkroNlS5SgCczWo316FaY1m51HOLMB3nXE5xkO11pLWg0tmKGiv4zGULrvn8JlaF3yNAFBjmpit8VETvmehyR7mZw+QqMI86AC/aCSW+rs0cXVTJiwznpr8v5guhLjD2nqWVgdiNN0Dq7BsyqpYG4A4p3LkpuX7qbEU0p7WrcbjRkZsjjNC6nx/DX2B6vi4L+XFT4DnKUkcZDvbuv6agbfM9QYGCvAzbq6P0vV5hPM/AryB53toxM8V6JLceNJMjBCx9gh8/Nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5zKBHs8LCaE1OWo6oLZhEwPWsaWUQu0HqN4yiGP2cbA=; b=ikZ2/JEaqHPLuw5whrOoVJQfV/pv7MtZTYlVMZQWvdwbXYk1PyguZCjA1eNmHbVhDdedF07qYUAVdafeafo5szUqQGeyZiIGGIbW7u1nceFxysNAZjjPZDTsUd/Tzsrsf5BGSX6YrN0YyYinV2fkKQXOCsb6UfvXJjJ0Ak9H65I= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:26 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:26 +0000 From: Rasmus Villemoes To: Li Yang , "David S. Miller" , Jakub Kicinski Cc: Zhao Qiang , Vladimir Oltean , Rasmus Villemoes , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/20] ethernet: ucc_geth: fix use-after-free in ucc_geth_remove() Date: Sat, 5 Dec 2020 20:17:34 +0100 Message-Id: <20201205191744.7847-12-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c1827fa-d0a0-4c3b-e84d-08d899528a5f X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lcFWVYt250Oxn3E+1pY7hfTuMNxjU2G8wwQ7qhqCdy/uGGzADVFbw2b2WLhaX+L6GPw8glpERLHWcGx77Kd5gUkvdUfdzuwphcdI1avQukB22U4A6O5YoV6Psffz4sLTuf8yfY86KeBqu2p/luE2I6Bt33zB4moCNSETIL9Ag3GCI6QMMtKq7AWXD/xTL3Y1OvtatjhA55zVSj1Hj8VuL47ih68xsZBQnSMVO1Gesfv9RrTyyzaCzHHe7Rr1d193N0ttQOK3HB1FsTkPNziaOCLC1v0kTsqEs+yHBXDxmMJJ9e7aHfa6sOjYyY7CdeojotPq9uo2dtYdayxtUgMngA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(6666004)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: zq5B/zpr510dEv3tvndqlUb/2jGJPB0HeuAg16cIc02le5QLcRxsKccmwS+fRoz7Oni0jhwzbhegHxg9r8Y7HzAQ9I0fET7hDfR0/BlA8pcEDwACTYUB6adg6D5lNVi46uUH2gpG3SmJfjywjSF+o4albNRDBmib1zsIiNzs/qN5agrKTKetfK6uJCRoWLhhu3s6G7nureWTSXaEZ2HIjZVD1NF+KZzc8BKFoY/GjE0RfutWWUCoISF7USO9h4cU22Vj0Y8GMRaP5t+QqmBulf8ebMb7ZMntP6OyRgDo9qAH8Nrlo+Xf+Ozrsx9bZp3dAuN+FH0xW/95ycQkNMhhESGXq/m0g30ebgqTk8KNDFf9qp4xXup7bVijqBJ1Anx7Gn0LVk50av80qnTSWZRZBLvcVPCbeZPpFKefoE7qt9gJqCOkD6xC0koxjnqlIzH6p1FkU+RpWxOmYbYTADN7O269BrBm6yrLbBTfXuElFRtHMc/a0v3Mx6YFrQXFbz55GkW/g0zdYrNfAUu/kdTJrmEFFtU1stxNRRcgoiBFZYqzNFZVirINcPd1ie1OZYwf76Cth9rFrBpoQjV9G3cuJyD2TOz6LQTciO1gr8A+Of0ZYOJLrh3sARwDD5qjOhL4NW2bNsI2wbKQoxM28AmEMj7erk9kELPFrWhcoBKlkL7sNZkMzXywPGJny7P7MHVWAhiEs4VyiqDln1FyDPRRRjfljCwD9H0dwyfRt/TJS25wLfmThP/S/39kwO8bs/++ihQiZ0uNQ78Zi4xOTk6e64Lfxg2+OEBaiEjr/iBa3zzKGKn+FfzxS5n4QXQaop/DTzJGzhW7x8Iaf9+UuLrHYDfEwOIm+3+r+eYbCktqnr9hj8cAVc8ksit8XsiJ4aOZdnaFvKspONwPCJOvU45iefZteIMbZTAac70ifHsZ3nfn0+u7sa8MEJvWKE2Y5AEdoMQUzW+WZ7aUVX+vUnQw6T0Vq64riXbuyXbASxU4f8MQdBNXxS/fAkpoIeQiTJ1I X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 5c1827fa-d0a0-4c3b-e84d-08d899528a5f X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:26.2503 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: J0CwB1I+xbnFBcHKL1JlGloKN2nCVj/eKKIA1ONnowqDiufxgUmCGPsJBJmJtr3xjXhwrcQICMYzU9bmOzEonWJjYgc/0EndPPGV7IGV5eY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ugeth is the netdiv_priv() part of the netdevice. Accessing the memory pointed to by ugeth (such as done by ucc_geth_memclean() and the two of_node_puts) after free_netdev() is thus use-after-free. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index b132fcfc7c17..ba911d05d36d 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3895,13 +3895,13 @@ static int ucc_geth_remove(struct platform_device* ofdev) struct ucc_geth_private *ugeth = netdev_priv(dev); struct device_node *np = ofdev->dev.of_node; - unregister_netdev(dev); - free_netdev(dev); ucc_geth_memclean(ugeth); if (of_phy_is_fixed_link(np)) of_phy_deregister_fixed_link(np); of_node_put(ugeth->ug_info->tbi_node); of_node_put(ugeth->ug_info->phy_node); + unregister_netdev(dev); + free_netdev(dev); return 0; } From patchwork Sat Dec 5 19:17:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 338715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6737C433FE for ; Sat, 5 Dec 2020 19:22:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77EAB2313A for ; Sat, 5 Dec 2020 19:22:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727894AbgLETVs (ORCPT ); Sat, 5 Dec 2020 14:21:48 -0500 Received: from mail-am6eur05on2114.outbound.protection.outlook.com ([40.107.22.114]:33377 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727233AbgLETUP (ORCPT ); Sat, 5 Dec 2020 14:20:15 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LsiBcEYWd7OCrnmZlbSYBUpDXSlKMyDIjloBy2uW6pOwNgbMtkvqablPY3I+1cUY7bCawyz9Wbmj5j5AzW1Wps8Im9Q0YDKqte2gwcDVQzP0X+A8uq+y7Ui+0l4tlLKcICmMBo/QzjVXqDyHBU/YX7izK5oYJ7aYjVfEMiVoR1coemXNz7XUB3aEOgs6pL6/Jq5cDVKaXPIYsA/d//GD+latj5IrM0GT3tdjoaGc6mLY7S3DdEvHsAiHJfImgdBDxXFp1W0NkMncjs8F1H8zISl8OBXxGyzr3Dxo08iJYhTJYpC8eA43gdHB/aGFL/itlXyQF0VH2FBYFR7ygVFE0w== 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-SenderADCheck; bh=0K9ynC7FpPW3bXeUagPupFZFJ+6QApjQ6dO9f3UY+c8=; b=e/kRJDMzBSLDAx3dArgjw0epCQr8x/VgdY9JXL/iohr9lUkwIyasK9U6mjZFIDGxySg+WZFEbvjNUmNafbN6SiEB8G6vzCTT6BGg/7lzxppKvEOO5guYH0TqxVGlw65WJsDU/9QtBL+QzYkAedlQuUEMTOv6+P2p8sOSGM8HM9/VPPbrBmpXS5AoBSEdEfU8S/yDluZtQKRJxu5b7np1GVFvq3K+6jWWLEfYRbTNfQOslpQ0g43rc99/4OUsl4oWVmopKTQ20uNP3x0zetyrvfRq7zFnLnMcimouRzWQ0GjsdO3fHoDtsyuIUM4A8falh9e91TNMUP+iQxtVQe2dqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0K9ynC7FpPW3bXeUagPupFZFJ+6QApjQ6dO9f3UY+c8=; b=LmEA9knqDB5v6KtrJj5WzPNBFydCwFgAwEA57p0k1VAthx7Sd1h9mb8VCBR12CQ9XLOdm2XoEtB/KJ484B/Gz65KflUjyGbENsQrjiK+Ac2Y4OQO8ewL4w28jEmtaxjtQyYmP5iMl4DuaYpTDv0Vk28luPnoHny7oQUctGEolk4= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:28 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:28 +0000 From: Rasmus Villemoes To: Li Yang , "David S. Miller" , Jakub Kicinski Cc: Zhao Qiang , Vladimir Oltean , Rasmus Villemoes , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/20] ethernet: ucc_geth: constify ugeth_primary_info Date: Sat, 5 Dec 2020 20:17:36 +0100 Message-Id: <20201205191744.7847-14-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c96650d8-5fbd-4f8f-f63c-08d899528b8a X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:296; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x2XV+HXFsl3gwwtIMr49e22q72ItTHKjKG+XjPR5+3S/pMFwAB1cjJdG0VefcBg8qMxGT1YmBWn47Un0uAY3sJ7tOSKtExbz/0kMX7Jd4taTkelQEqoNTv/qTsw1Q4eAUYsgI0aNt8LdJ63dHysv5+HIlWo1o8pmGToPCBalnhHEhtQSjmNgOU2gNXJo709el7QxMlttS/LeDvJX25e7B4bNnJ5O6z+hIMzXlMBJSJnoc5aKvdXwr9ckXkaez56RXI6AP5WjfzHE179rjyfH2ArKDS8dcugIyov1vCuG6MgPeNXhXNAfTRhuG6G8WC3XoO422+tldQO+PBSFybHkBw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(4744005)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(6666004)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: lY+XTcjuBM76HJO91MK6EOs+yk9T+kzvrE/pNbwdJwoAXQppk+JulH7KH2xPhMs0uFrZorKp0Z1R9b+n9SOCuGnRWIeDE3vWbcK8ajjxAvOZpH2cDEj2yh1tWMM4HoGe78KhcaKKMELP+owt6LegGbK85uWOgENCtZ3Ortj8Z6ELxnc1OzMVjoJYFWDLg3CcC3mNgEQV/AB692glIEdRRYt77lPVhbnUVWkV9aqtFodyBbC8Zgijqh6B0qIL7w4+ArQ0kmWlX5dtlTafjE4fFynWf4Q53ozczE4JuHhpjNjgTUhKmNOySHA62yhdVTrUcWewiI0cgEu0QQFl3zfqhyzRoe8OyQEsFL6CeLvj+8RSv7Vc2nlFw3UDPrzehJVkXGFeJSpC3GEUhNA0sHpJkv+xxtx5oJG6REkLopt1KBx+Omb3Ri7NxzaC9zOL/Y0dR8KUbaahKgbjAnj/GFMkO0agQdxAPR5CeC9CFRp1+92+xUyD+PFFtRfSWWs7ptm+1gxICLqC4zvyvaCqr6O4HK2DB0kkcErCEt7muR0g4PAi8XdbAH3NWZYzLUnnZmdxLyLuEjBCdiWzGI94RuSoexF5ZwAX+QfaFH7fcBeiC5pjKBvIQIKW1KARFgPxLRbPoJ6ipRYNnGLCSs05g5yQ6F7fKDTsx/DtFm7y2Fex7uy7fUbn4briRqzs/WKAMODNEAXzzNkatMCmNddTFPIrIJUeOp+fv0fyouyCDMH7Bq2TNZjH9sdaMJsxpfIgUIZboxUkVK8Na2X4QqpEHeatH3kqkFBvgWOkrGFar506WLnEBCg1xihWmDqSr69YBWBVbd0wKkqHlhMsBEHJNxd9xeN2x/zRK9FQ1lDz2JVBDZaFV3iumfqBhxCJcWrJHG/B7kARh3NFcmZDpy3QIr0mr1WKdRMWq0sMGf0IIBOpJRutcBhjIKf1vHD7A9tcjM5w4/vb/hGOor699/3dIy0kN6CZVH7F1EzwVFhwJzvFgpz52MNXyK280Iuh9lrvvK9Q X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: c96650d8-5fbd-4f8f-f63c-08d899528b8a X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:28.1752 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mS/40pqb/q/ijE4bvbXlVqY4K/iOg6r76W0JJTEboH+OKorUZRlNQCMro3ZsP7TUNdAn1SrKa1AqLA+QUttl3ksi035qMwqQea/TWYRoq4w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 700eafef4921..a06744d8b4af 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -70,7 +70,7 @@ static struct { module_param_named(debug, debug.msg_enable, int, 0); MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 0xffff=all)"); -static struct ucc_geth_info ugeth_primary_info = { +static const struct ucc_geth_info ugeth_primary_info = { .uf_info = { .bd_mem_part = MEM_PART_SYSTEM, .rtsm = UCC_FAST_SEND_IDLES_BETWEEN_FRAMES, From patchwork Sat Dec 5 19:17:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 338714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C49CBC19437 for ; Sat, 5 Dec 2020 19:22:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6F4123139 for ; Sat, 5 Dec 2020 19:22:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727861AbgLETVp (ORCPT ); Sat, 5 Dec 2020 14:21:45 -0500 Received: from mail-am6eur05on2134.outbound.protection.outlook.com ([40.107.22.134]:19809 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727218AbgLETUS (ORCPT ); Sat, 5 Dec 2020 14:20:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HsnDaHGkk/uyCsHZkLCLqCXbPhTmBHVjyI//amBS+8UJAZnyjVW88Jdjcxfm0wf7bWRPTWwvDpXYkMuCkhPuXyHkmWYNspvBN/gZM7S1enYzOn9NQAj3CE1zyv8kRJEEfHY0EFNE8uzcA3OHsaPrLzvNIiYX7rC4GWrpWYsvhaUb68JQ1PrCJkEyvb2hjLrAoRlgMpCRnpJoXkQzuq0P/pfqs2RcO3iljtVWuAcIMstaSNzYo6bEf4VQ5x/GfuFv0bs096zmqxKdyedlmdsnQk6UTfYEDSDrLmaXqHPogA0TuBAmcF7HlcETWUYceJABlnxR6CUvy/FuuqA9RqWA4Q== 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-SenderADCheck; bh=LXkO9S05fdZQNu+ImhLzBsKq4426rJzgFtggpGQd9b0=; b=DC/tD+2UVFkELgstrjB23yfpGlhomMpgq+k//SsAaPTD1HuGaZnvhVFUdqVwW/ctAJcxiv6a2BmBxAbJpFkRSnGDaBQqstogmRuYEuh7Ygo3Uylmkfp3DluSw8zyOjYdQTCnvKboMv1GH2PtyVvZ+oEX7s3inRqMdDhvwJ8hzT1RdToM06TxF5Lvn90yho/wvzRL4YlGuNGgV2yhMycX44uWCLzOfsilvY0/y939glv3iTVjR9+3GELGGaYvxcqW6ugd3wCpuPGQvoYPM5z6EqahqcVJcRLWJNtbQSSJjC2iwabsBldeZRx5voDe6mOchzN+8ubQ8JTeSlaBuFGWJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LXkO9S05fdZQNu+ImhLzBsKq4426rJzgFtggpGQd9b0=; b=OaFZcpP8mbW1MvUQ5HqhFmEwxqPYPMgb8u4qhHqRzJFzu/Zr64web5KR6ZRFeD+A8kqVyiGsusVrv7tsbjxiaWT+rWcFMTvc4pThB2CzDK54G1Z99AVYy26UYYohLQLFJ0dNhBWBmMPusRyPjRTeHxklAeesTgunFXdPY87XwMk= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:29 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:29 +0000 From: Rasmus Villemoes To: Li Yang , "David S. Miller" , Jakub Kicinski Cc: Zhao Qiang , Vladimir Oltean , Rasmus Villemoes , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/20] ethernet: ucc_geth: don't statically allocate eight ucc_geth_info Date: Sat, 5 Dec 2020 20:17:37 +0100 Message-Id: <20201205191744.7847-15-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee0a046b-c2ae-45fb-faf0-08d899528c02 X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hBMw0SbJYBOesXgOtW/bLmW6wYsXQZAo9nCcpKHIwpj0c4g3FNPhUFTJY21n+FWPSSVSbOlweRIgObFX8DDo8vSmrhizm3n87QNE/YlR7m8gH1kHXtjT7AguHCQu3x2DwqiK3oPej8lXD9NLcQr3DDa1+EX7sbjSzLAhqFX+ERRv//8FbozCJrXEUAtdWZu6CseynbzNflHh8nCCiCZn9pYlXGR8ypIUBwcG/gzBZlwUQ1V5jiyIYhmKKulCOHfYnZ+sQhybcWmtm3Wcyd09ymheaN//jE/ClRxk6r50wHP0xH49N0FPd7SWZeluL+lu/OWm+XybMA45gRp4uHlQ3Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(6666004)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 32UppUUv6iz/0ReSezwEkLNuWXsmyqmAUUneYmNKZDbSa47d8CGwBeMrzQRJnMgDNazAp/0tHQFBmU5Tcm82kctbXsB69VEzSko9Y4pew8W9+EcJLOeJLKK2wi7uXpZka3I2svOh4MbJIGZmzyjdE6/YsYFq5EgFtMktsIvMLRnm6eL9d1V21ctc9fRjTWn9h4SRsSnKLe+pu7IWeksx6862EipblC91oyTatgIu6ozaXsy5q6yDXxzftdDcpzLHTnzFF3FWT1wUKXuqB5G5f9Jsbq/bKPmvX0QlUs3C3GGAV+WYVWphvzZH2fHdrOFrNUZlTVj1wwriBxYGwBn3+DkevK1WlgCVSnHJfRty7QvkPTABZQCcV+hz1lRDHKrouQoBt+HMutD7jgwrnjKQJcLRJCds9R3cFGsVT06kdMSJwg6CiWNe6Oc+bHgvTDKH9vitmwt0JKqX01qtY1Q/uzD4+kX6hLAxVWZl3fcGF0BivJ29Ugoq9YPplWu3ykGKgAth8jb6ub1oP7cX/YMASp5gquRuXjgsFHNfBS8TujvWcGcSslfiP9woSGKB3Ho3E0sow2bVZUoHcBdCkEpF1tOfwP1ndD5DN8dZDRv7pJ6mlupnGpt6vNIExotMhgF2mYRJKuO7rb185PQuZK2ywCR2Yom5VtsqFnDy9N8vh+3rfOcaRV6gyOi0zB5dWYh5WMo9ttjMyD7Z134V40qAMKruD97JXV4hDRxTxB3XNrmZ9t/Pz9ybnSthXr0UCGkORsAZexwmL6OmICWqucwaSc1+zWN4UpzOHZ5J01WIGRr/lVHP31tuQjNsoPLk/MkvsLvNxnxo1AxpPA60rfxn3hUQuhMIEkO86rb8JkEAvt7Cg7+PuiqDEmK5XdVZ6JfKIeFnPqx3uQY+wnRQuBd1K61E4VpQUZjy6SDVDdS5iuWW3LwzFLrmMEnOZvRSQQpVd8jGTc+H8jVFnHe5LTkf5KjzOEuCq+UJhmmjOOD+ZxwBJCEPCl2dhlhDf7olTn7I X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: ee0a046b-c2ae-45fb-faf0-08d899528c02 X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:28.9488 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HkyEaClC2PalthrLqJGbGU79xJKOylbVHpUsGTNciY+fx6IEi/fLGSenbmO32M1XctFpnikkIPNl3LV9SRqCmzOiJKPNsx/gINfiOniLZD8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org struct ucc_geth_info is somewhat large, and on systems with only one or two UCC instances, that just wastes a few KB of memory. So allocate and populate a chunk of memory at probe time instead of initializing them all during driver init. Note that the existing "ug_info == NULL" check was dead code, as the address of some static array element can obviously never be NULL. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 32 +++++++++-------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index a06744d8b4af..273342233bba 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -157,8 +157,6 @@ static const struct ucc_geth_info ugeth_primary_info = { .riscRx = QE_RISC_ALLOCATION_RISC1_AND_RISC2, }; -static struct ucc_geth_info ugeth_info[8]; - #ifdef DEBUG static void mem_disp(u8 *addr, int size) { @@ -3714,25 +3712,23 @@ static int ucc_geth_probe(struct platform_device* ofdev) if ((ucc_num < 0) || (ucc_num > 7)) return -ENODEV; - ug_info = &ugeth_info[ucc_num]; - if (ug_info == NULL) { - if (netif_msg_probe(&debug)) - pr_err("[%d] Missing additional data!\n", ucc_num); - return -ENODEV; - } + ug_info = kmalloc(sizeof(*ug_info), GFP_KERNEL); + if (ug_info == NULL) + return -ENOMEM; + memcpy(ug_info, &ugeth_primary_info, sizeof(*ug_info)); ug_info->uf_info.ucc_num = ucc_num; err = ucc_geth_parse_clock(np, "rx", &ug_info->uf_info.rx_clock); if (err) - return err; + goto err_free_info; err = ucc_geth_parse_clock(np, "tx", &ug_info->uf_info.tx_clock); if (err) - return err; + goto err_free_info; err = of_address_to_resource(np, 0, &res); if (err) - return -EINVAL; + goto err_free_info; ug_info->uf_info.regs = res.start; ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); @@ -3745,7 +3741,7 @@ static int ucc_geth_probe(struct platform_device* ofdev) */ err = of_phy_register_fixed_link(np); if (err) - return err; + goto err_free_info; ug_info->phy_node = of_node_get(np); } @@ -3876,6 +3872,8 @@ static int ucc_geth_probe(struct platform_device* ofdev) of_phy_deregister_fixed_link(np); of_node_put(ug_info->tbi_node); of_node_put(ug_info->phy_node); +err_free_info: + kfree(ug_info); return err; } @@ -3886,6 +3884,7 @@ static int ucc_geth_remove(struct platform_device* ofdev) struct ucc_geth_private *ugeth = netdev_priv(dev); struct device_node *np = ofdev->dev.of_node; + kfree(ugeth->ug_info); ucc_geth_memclean(ugeth); if (of_phy_is_fixed_link(np)) of_phy_deregister_fixed_link(np); @@ -3920,17 +3919,10 @@ static struct platform_driver ucc_geth_driver = { static int __init ucc_geth_init(void) { - int i, ret; - if (netif_msg_drv(&debug)) pr_info(DRV_DESC "\n"); - for (i = 0; i < 8; i++) - memcpy(&(ugeth_info[i]), &ugeth_primary_info, - sizeof(ugeth_primary_info)); - - ret = platform_driver_register(&ucc_geth_driver); - return ret; + return platform_driver_register(&ucc_geth_driver); } static void __exit ucc_geth_exit(void) From patchwork Sat Dec 5 19:17:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 338718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C33F0C433FE for ; Sat, 5 Dec 2020 19:21:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 884F823110 for ; Sat, 5 Dec 2020 19:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727496AbgLETUw (ORCPT ); Sat, 5 Dec 2020 14:20:52 -0500 Received: from mail-am6eur05on2101.outbound.protection.outlook.com ([40.107.22.101]:29825 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725923AbgLETUg (ORCPT ); Sat, 5 Dec 2020 14:20:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hB0jYpZThjDi2jonEa8g/kCVLkMCDwwcQVCx+5twz4us78WsuiihX1K94ZX2vFx8WdklrkK6PLvTEJ2nrpWBxtzgXGSvOKO6Z4b1TKkLBR/l6xcyeG71CQ4dgIfazjpmlvKDdsCJKrfBpUcJ7n8nqeealovJHJX/tZoHzMCAw52EHalT2fOPPCrnZbTrkP0/mb/UbawUkL+d9XIAN/UeMdqrK6sACTLkZSzjr178XJApHcAYntDRKNsmq3Z3fzqg3BYe7GVkrSRrPyn6RLWxJBFuMdwsaieDuRpetp09e6LrHkB0Oc25xRhPxPOd6EQCK9MiuvAFDxBfgBjMtbXoCQ== 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-SenderADCheck; bh=jkDQ5X09s+B2qH7fCsAIyqj+eG/eg9qMrfZw00etq8Q=; b=M8TQYo07y6T7LR7ngg36oGDUUa5jGxweOHPIbgwGgJ97raO+pA75IFV7up0Kq+w8MiIIdaU9B/fBCrY26WGdg8282/uHhfe5PqXYIIv4R+4Yga2bIKdcgoI21pRZMnLWUKxRnr5XyUaJlwPwHcNWlcT9aPbPpt+HsNyumeM0fV1Ti3b2aFWfIT2nVLYbm4uZMlhvBLvaS8ARcs7ixEcqSQe5fak8TMbsgqsNhxH9QopuKj7RXGWFRJMMSAnhoyP/08Tou2LL7WiNXJ3rs47giIV8Pr4kfnexBUnrgPQ2df2QEleMWN3mPOHO9WDk5RMg9wQOvJBsySOxIkrbnGbIZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jkDQ5X09s+B2qH7fCsAIyqj+eG/eg9qMrfZw00etq8Q=; b=PEGubjRwGw13j7ZqtjBU0R7WuhLd+98kwNJ0ss6OFG1kAJ0kJgODBv4WbfN3cNP5dyoUzKp57lLJwQdfUefRMkRKDqgyznw+prqRDThg94p/9ndzPCCCT5OHdDkS09KWHh2EtAsOSTs10rvDXohh9MbPzYd2/w4Dhktr28ShGQw= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:30 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:29 +0000 From: Rasmus Villemoes To: Li Yang , "David S. Miller" , Jakub Kicinski Cc: Zhao Qiang , Vladimir Oltean , Rasmus Villemoes , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/20] ethernet: ucc_geth: use UCC_GETH_{RX, TX}_BD_RING_ALIGNMENT macros directly Date: Sat, 5 Dec 2020 20:17:38 +0100 Message-Id: <20201205191744.7847-16-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fba62702-cacc-4c8a-32d2-08d899528c87 X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lYyAmP7CMOEEtYTEOFllZWHYGNplZintAMms4rTP1r5HFAx7lIjpbxa77T+M3B+mtgmLNgHyR+cimfvkRDB9YNVZ8LmbWT7neX/hnxCRa9ERXv2ezANomrGDEETd8chMO8Q+H/3NGEPEmHKKZu5nlBUNVj8I8BmMfNIAJu3dK1tfl2ue47hOhxTM9jfShT/BqjwpwWglwOwNAf6Vd0am/egdrfHWhIEbDQit7QhPSUNwQnJvJ7gQtWbPSw+DKvGy86ZnOd4Ni6VRcpSJzHwC2n2OwPQf4lzpJTCA9X4p5Mt4iSZ/ALXfZbj8DPeSyjTo7WDx1l9Sqtsg+47m7Y6WGA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(6666004)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: QPbwrFyDUnf3nAYVrkOMpubxw97rJfn491BNO/sqfWWCQFXrOkx+RwDHNDsCMXeW9BSXHSzBu6HsLMpy+GUSHEEkvTrPunpaPY956Lk3Jn4tcgnVOKxLW6FGRtWUaUkWY/fIzJAsf0AIfzBXFztVKq6w8aMIx9QzSluuFwC9ZiTA+zTh+xBVdB9wzI+5U1qqvHJ//opep5hvM38r8nxG16jFw2drYO8MRSrPLFiVCCgU29Mtcch9QKkC1PKn+GpOBiw0a/Hc2/9SiCzlQ6+afgPWJDhJG31XI+8j2bZvgUAWiQPej/BNZxIWlhLzH7wkiKJqQfokxwy5qGqFOhPYRQywchNFQXM/EQzHvU9lgFbhBhSE/E9hnhRdMyl6+4ThOWpReEvTOyJTHdjhXhScVFxxg4uK22Jr5vy1Yb7Gxtl9bTG33tPPdSoqUoobC3QChwHVt477aBktwo/6rHpTerU45BPOaUjaEX1wmnqDBfK3cY/4xq5KDfqT5GJOfxO9EwGFkW+q8B71o66bzfAJxyEoYC7wipRfN+ezizYE3ClzlcLjoM0t/gxqytA1SQiWABG+Y0aSRRSMIKC+gb+VXvbHjp9RTjyzeF8Lnr5gGpHTY1agD2KQSclIHCfQE8iyO8K6dmp0+B+/w1IBjHvi+Et2Mx7ZRY95mvvtCjAgOTwE+PRVn1rQ757Fvzg1R+ywCjEErW3R7Dv8V1eNjmFXeNQRlqfd0OR4APrcarWkbg/8UBgwbOevNxesvS3zSgQrH7ezrGnzjlXyMjue/0SpMUeLxAIFGRXqt5g+iztVJE4MeRxw4Ooz48i2NvANbhIuTYGHK4HjMlwbURr4cpu3A+41Verwgc7mBmhB5qK9wYSpMaokRfV+H/MpYgI6UcuRnPjYHMVT4FtSozv7+6objwwMXoc8G4uu6mms5KTr2k8TGLShZA4UEzUlS/9T8JpzlNHlynZcHNw/BaCbyIL/x3zID/ndniUVTZgcJsYx/voDhiwd1NJbVpaf7xzxIqGT X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: fba62702-cacc-4c8a-32d2-08d899528c87 X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:29.8323 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GdHj0hxns1V/fLkc4cG/FjV/csj8iZZZfB1OngCp7Jz/7yEc91vJIudbc0rJFsEZR87KutUEv4S14TYOS1gFRk3GwRgFHI7RaQ1Xon33/iQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org These macros both have the value 32, there's no point first initializing align to a lower value. If anything, one could throw in a BUILD_BUG_ON(UCC_GETH_TX_BD_RING_ALIGNMENT < 4), but it's not worth it - lots of code depends on named constants having sensible values. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 273342233bba..ccde42f547b8 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -2196,9 +2196,7 @@ static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth) UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT) length += UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT; if (uf_info->bd_mem_part == MEM_PART_SYSTEM) { - u32 align = 4; - if (UCC_GETH_TX_BD_RING_ALIGNMENT > 4) - align = UCC_GETH_TX_BD_RING_ALIGNMENT; + u32 align = UCC_GETH_TX_BD_RING_ALIGNMENT; ugeth->tx_bd_ring_offset[j] = (u32) kmalloc((u32) (length + align), GFP_KERNEL); @@ -2274,9 +2272,7 @@ static int ucc_geth_alloc_rx(struct ucc_geth_private *ugeth) for (j = 0; j < ug_info->numQueuesRx; j++) { length = ug_info->bdRingLenRx[j] * sizeof(struct qe_bd); if (uf_info->bd_mem_part == MEM_PART_SYSTEM) { - u32 align = 4; - if (UCC_GETH_RX_BD_RING_ALIGNMENT > 4) - align = UCC_GETH_RX_BD_RING_ALIGNMENT; + u32 align = UCC_GETH_RX_BD_RING_ALIGNMENT; ugeth->rx_bd_ring_offset[j] = (u32) kmalloc((u32) (length + align), GFP_KERNEL); if (ugeth->rx_bd_ring_offset[j] != 0) From patchwork Sat Dec 5 19:17:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 338717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BAA0C18E57 for ; Sat, 5 Dec 2020 19:21:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 026492311B for ; Sat, 5 Dec 2020 19:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727659AbgLETVH (ORCPT ); Sat, 5 Dec 2020 14:21:07 -0500 Received: from mail-am6eur05on2119.outbound.protection.outlook.com ([40.107.22.119]:7011 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726791AbgLETUl (ORCPT ); Sat, 5 Dec 2020 14:20:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ekosH0nbvP2bQzAvj82iyz1Bg5mGtqYQl5D5mpdVcrOOE9aIBKP6hBk+fqN9C91efxclGWjiMMlGJ7+J4maunVMW7CTbt6V8kizGaNF9d7mNLw8s47DI2SiN6lPwgMT1t0Rx/JIoGudwS0MTb1zf/Y8zKH5AmjFdroI487DC7YnOwN+6vLbKlVes9I3KYZrwsYkk7nYVMJK+5PRF8WO/OUFySYmoVm8m5V4JHXsw0CdeJToOc9dIQA9v7XTO0v1rx5NKVIqu+fHqwno0IyVns8Hn/WAIBYpjWXXqmuSRH6l1kiL1xyeXNX05PwktTIVZqUBtAfzbRePGnflDYIxa+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-SenderADCheck; bh=p5cT4lWb1TOoDsBju+zP+BzDu+mFtQHaoAEkftazw2A=; b=P+0HBHf/DFl5YbxxeUdKtBKI9ehGypA5EWVAMEw+QEIHKMdlsVyi8oxkWSodu1PaQv8ovgW7RDHHzBOZ2aZy8D76F3MNm6IPztHLviKUVRrzFvSz5G+IwLD5svmWdHDaVYRrvBflmWxkzZQ+IytrpDwy3/VEs8l+/TE8+dblO/tse1htWFs2r6FlPgOi/Yw+lczfduZHYhGAu3WblYQbyXPLLcqmfeY8kVDjnZirMIIJ+AlqDnEMMp+zNOKdghjZzDh+0wOENG+zGgyHWZuc7dWJoNKfnCxi5Hn46D5lXXFofus2l1U3V/HH1StgyyvHZbQaofOSVHHdOmrvPJpmvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p5cT4lWb1TOoDsBju+zP+BzDu+mFtQHaoAEkftazw2A=; b=kpnHeiJnC+fkPyqQ8KCdDAOTf/D0Yhsxfw2+K/JVx3u9I07y6jPtmanJOm1DvNRJAQwl/FbIW3N4OKD5VpUIlFpvSJp7tlC/7wpUeEaVwpKTT9xfYOlA6Ga4vMsvpx4vqZqUFOTKBICThk7knqDew9TsCV4qNdMFYRY9UXDgGdA= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:31 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:31 +0000 From: Rasmus Villemoes To: Li Yang , "David S. Miller" , Jakub Kicinski Cc: Zhao Qiang , Vladimir Oltean , Rasmus Villemoes , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/20] ethernet: ucc_geth: remove bd_mem_part and all associated code Date: Sat, 5 Dec 2020 20:17:39 +0100 Message-Id: <20201205191744.7847-17-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 50ebd930-5c7e-46ac-7467-08d899528d3b X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fmJecnkWEd67/z8T62dy+01LsbOoGK78+RWZPYjAxPIREJSco6tAhdaywDz+M2X5rogiExNsLeefDAtX0UoJxALWiXg6mmHaai1Bo6l99S3pYMnkqu92wKcN9A1bRzW3pQc7ZdKU7MdR2R4VtcRhs8hSh6K32wQOQNvoH3JO7Df4CICAMG5txIW0YZK3O0cUbpzvkw2J8rI7RPx/QDwkCAQqWRuQTVtW6pxbYnW3vFBuGlj3wluYhFmrUvCPzx2Qrh7GPEpQS/+kgTLN69wjwo8nk7dFJ+CmxS6EhedF/JOxLNO6bHbdnPfJZZobva9wXo6HCmmnqN9H3Gke/IUq2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: uuZQHVKQpRG8HD50dFELlBhFP0TP6N0Lk7wqcFWFUAefODgB5+Ab8v8tWpL08X1d/OfAm+yvvN3ywWka/afuxDHqBKYQ4TXbC61SeJedtCw7Twe282ZFZxYqCrCjQxmf/NdUOiH0P6khO7pUK5YzB4Je/OJGDFi/9qim84o7+gkzF63FiXItPlyJ6ASmCpkfrL21mJc+96YmXWwoBiUX1l7ZlKs/d7WrVhQUoPXHdZka8r2M6f9/uq0nWWPNx1CgvFBrZt/Q9JoQEK05zlUT0l7S+gyURpnAfVUyaXLP3EXces4Joaa/cRN2pmkYdz9Pilfymr8s033qQi2O+wrv/CgR46s7RM7R/RmPOIrrhXg+qwWqL4Ik4WAu5nEqBk+Ko/x4Qnrpn1KkQSc4a2+D4wfYZCQZnyGT2JRtYO4ksebKV8GJkWxASI3f3bfXVpmjdKOzwnuhelj7jnLh/j5rBbBhHtGaGw2TR/To+p3WrXQvwpRlYWocwCNcaiEHEoutTOP+AFFpeHEqXd8TOthvY0KeLzjF3RiTMA9n4nNrKcYF1NzfC+G7qfg/wRnv7+IE0oQW6uMYWvyBvf5WzdjMIwjIiVGPCJP/WJYsQDClUx1UGP+TqUS4BlklhZtxdMv1KXZsqCCThisbJpEHyBZQPUlyGzTVULHeXV4rSwSGcF/iMzQt95WcIOBv0vPuwpifjIGWkP1CIsrmKGYcYp+YFqU6b9eKIb3UmYkR4eFLIoc4EwMTk5RXxqKrdNPN9zrBRGMHqwYB9J0qslWuE0UjlWJV2OdzsNblG5y20JP7Q+3dBvIVWfuP15chGnUbGWV1MdSP7b64cNMal5FqHrbj/IjKPDzxtARb+qImfzARUSf+uYNHPsEC9yz2dADSkd+E9hJe6IdRtHuzI/fHkmQJVtvD+hi9rxmB/KyxOOabwfCnlDazPB9qb+S+omNwB9HHyWDecbimeMNxT7Rou2sC43f4k5p0eIcULLlV8i7wf7+TP75JIZI7O7ZCWNH3cHU+ X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 50ebd930-5c7e-46ac-7467-08d899528d3b X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:31.0496 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lTCez1hgKvnAH3OrDYzfaOT8PDkI/jpWqOAnXGP5uerz3bMvrLzS667SRz4AYHiyyk/WRgnkuUmWOCMVxbs6KYQ9YgsjJfYvxYi12qbsDq8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The bd_mem_part member of ucc_geth_info always has the value MEM_PART_SYSTEM, and AFAICT, there has never been any code setting it to any other value. Moreover, muram is a somewhat precious resource, so there's no point using that when normal memory serves just as well. Apart from removing a lot of dead code, this is also motivated by wanting to clean up the "store result from kmalloc() in a u32" mess. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 106 ++++++---------------- include/soc/fsl/qe/qe.h | 6 -- include/soc/fsl/qe/ucc_fast.h | 1 - 3 files changed, 29 insertions(+), 84 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index ccde42f547b8..c9f619908561 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -72,7 +72,6 @@ MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 0xffff=all)"); static const struct ucc_geth_info ugeth_primary_info = { .uf_info = { - .bd_mem_part = MEM_PART_SYSTEM, .rtsm = UCC_FAST_SEND_IDLES_BETWEEN_FRAMES, .max_rx_buf_length = 1536, /* adjusted at startup if max-speed 1000 */ @@ -1854,12 +1853,7 @@ static void ucc_geth_free_rx(struct ucc_geth_private *ugeth) kfree(ugeth->rx_skbuff[i]); - if (ugeth->ug_info->uf_info.bd_mem_part == - MEM_PART_SYSTEM) - kfree((void *)ugeth->rx_bd_ring_offset[i]); - else if (ugeth->ug_info->uf_info.bd_mem_part == - MEM_PART_MURAM) - qe_muram_free(ugeth->rx_bd_ring_offset[i]); + kfree((void *)ugeth->rx_bd_ring_offset[i]); ugeth->p_rx_bd_ring[i] = NULL; } } @@ -1897,12 +1891,7 @@ static void ucc_geth_free_tx(struct ucc_geth_private *ugeth) kfree(ugeth->tx_skbuff[i]); if (ugeth->p_tx_bd_ring[i]) { - if (ugeth->ug_info->uf_info.bd_mem_part == - MEM_PART_SYSTEM) - kfree((void *)ugeth->tx_bd_ring_offset[i]); - else if (ugeth->ug_info->uf_info.bd_mem_part == - MEM_PART_MURAM) - qe_muram_free(ugeth->tx_bd_ring_offset[i]); + kfree((void *)ugeth->tx_bd_ring_offset[i]); ugeth->p_tx_bd_ring[i] = NULL; } } @@ -2060,13 +2049,6 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth) ug_info = ugeth->ug_info; uf_info = &ug_info->uf_info; - if (!((uf_info->bd_mem_part == MEM_PART_SYSTEM) || - (uf_info->bd_mem_part == MEM_PART_MURAM))) { - if (netif_msg_probe(ugeth)) - pr_err("Bad memory partition value\n"); - return -EINVAL; - } - /* Rx BD lengths */ for (i = 0; i < ug_info->numQueuesRx; i++) { if ((ug_info->bdRingLenRx[i] < UCC_GETH_RX_BD_RING_SIZE_MIN) || @@ -2186,6 +2168,8 @@ static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth) /* Allocate Tx bds */ for (j = 0; j < ug_info->numQueuesTx; j++) { + u32 align = UCC_GETH_TX_BD_RING_ALIGNMENT; + /* Allocate in multiple of UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT, according to spec */ @@ -2195,24 +2179,15 @@ static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth) if ((ug_info->bdRingLenTx[j] * sizeof(struct qe_bd)) % UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT) length += UCC_GETH_TX_BD_RING_SIZE_MEMORY_ALIGNMENT; - if (uf_info->bd_mem_part == MEM_PART_SYSTEM) { - u32 align = UCC_GETH_TX_BD_RING_ALIGNMENT; - ugeth->tx_bd_ring_offset[j] = - (u32) kmalloc((u32) (length + align), GFP_KERNEL); - - if (ugeth->tx_bd_ring_offset[j] != 0) - ugeth->p_tx_bd_ring[j] = - (u8 __iomem *)((ugeth->tx_bd_ring_offset[j] + - align) & ~(align - 1)); - } else if (uf_info->bd_mem_part == MEM_PART_MURAM) { - ugeth->tx_bd_ring_offset[j] = - qe_muram_alloc(length, - UCC_GETH_TX_BD_RING_ALIGNMENT); - if (!IS_ERR_VALUE(ugeth->tx_bd_ring_offset[j])) - ugeth->p_tx_bd_ring[j] = - (u8 __iomem *) qe_muram_addr(ugeth-> - tx_bd_ring_offset[j]); - } + + ugeth->tx_bd_ring_offset[j] = + (u32) kmalloc((u32) (length + align), GFP_KERNEL); + + if (ugeth->tx_bd_ring_offset[j] != 0) + ugeth->p_tx_bd_ring[j] = + (u8 __iomem *)((ugeth->tx_bd_ring_offset[j] + + align) & ~(align - 1)); + if (!ugeth->p_tx_bd_ring[j]) { if (netif_msg_ifup(ugeth)) pr_err("Can not allocate memory for Tx bd rings\n"); @@ -2270,24 +2245,16 @@ static int ucc_geth_alloc_rx(struct ucc_geth_private *ugeth) /* Allocate Rx bds */ for (j = 0; j < ug_info->numQueuesRx; j++) { + u32 align = UCC_GETH_RX_BD_RING_ALIGNMENT; + length = ug_info->bdRingLenRx[j] * sizeof(struct qe_bd); - if (uf_info->bd_mem_part == MEM_PART_SYSTEM) { - u32 align = UCC_GETH_RX_BD_RING_ALIGNMENT; - ugeth->rx_bd_ring_offset[j] = - (u32) kmalloc((u32) (length + align), GFP_KERNEL); - if (ugeth->rx_bd_ring_offset[j] != 0) - ugeth->p_rx_bd_ring[j] = - (u8 __iomem *)((ugeth->rx_bd_ring_offset[j] + - align) & ~(align - 1)); - } else if (uf_info->bd_mem_part == MEM_PART_MURAM) { - ugeth->rx_bd_ring_offset[j] = - qe_muram_alloc(length, - UCC_GETH_RX_BD_RING_ALIGNMENT); - if (!IS_ERR_VALUE(ugeth->rx_bd_ring_offset[j])) - ugeth->p_rx_bd_ring[j] = - (u8 __iomem *) qe_muram_addr(ugeth-> - rx_bd_ring_offset[j]); - } + ugeth->rx_bd_ring_offset[j] = + (u32) kmalloc((u32) (length + align), GFP_KERNEL); + if (ugeth->rx_bd_ring_offset[j] != 0) + ugeth->p_rx_bd_ring[j] = + (u8 __iomem *)((ugeth->rx_bd_ring_offset[j] + + align) & ~(align - 1)); + if (!ugeth->p_rx_bd_ring[j]) { if (netif_msg_ifup(ugeth)) pr_err("Can not allocate memory for Rx bd rings\n"); @@ -2552,20 +2519,11 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) endOfRing = ugeth->p_tx_bd_ring[i] + (ug_info->bdRingLenTx[i] - 1) * sizeof(struct qe_bd); - if (ugeth->ug_info->uf_info.bd_mem_part == MEM_PART_SYSTEM) { - out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base, - (u32) virt_to_phys(ugeth->p_tx_bd_ring[i])); - out_be32(&ugeth->p_send_q_mem_reg->sqqd[i]. - last_bd_completed_address, - (u32) virt_to_phys(endOfRing)); - } else if (ugeth->ug_info->uf_info.bd_mem_part == - MEM_PART_MURAM) { - out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base, - (u32)qe_muram_dma(ugeth->p_tx_bd_ring[i])); - out_be32(&ugeth->p_send_q_mem_reg->sqqd[i]. - last_bd_completed_address, - (u32)qe_muram_dma(endOfRing)); - } + out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base, + (u32) virt_to_phys(ugeth->p_tx_bd_ring[i])); + out_be32(&ugeth->p_send_q_mem_reg->sqqd[i]. + last_bd_completed_address, + (u32) virt_to_phys(endOfRing)); } /* schedulerbasepointer */ @@ -2784,14 +2742,8 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) /* Setup the table */ /* Assume BD rings are already established */ for (i = 0; i < ug_info->numQueuesRx; i++) { - if (ugeth->ug_info->uf_info.bd_mem_part == MEM_PART_SYSTEM) { - out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr, - (u32) virt_to_phys(ugeth->p_rx_bd_ring[i])); - } else if (ugeth->ug_info->uf_info.bd_mem_part == - MEM_PART_MURAM) { - out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr, - (u32)qe_muram_dma(ugeth->p_rx_bd_ring[i])); - } + out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr, + (u32) virt_to_phys(ugeth->p_rx_bd_ring[i])); /* rest of fields handled by QE */ } diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h index 66f1afc393d1..4925a1b59dc9 100644 --- a/include/soc/fsl/qe/qe.h +++ b/include/soc/fsl/qe/qe.h @@ -27,12 +27,6 @@ #define QE_NUM_OF_BRGS 16 #define QE_NUM_OF_PORTS 1024 -/* Memory partitions -*/ -#define MEM_PART_SYSTEM 0 -#define MEM_PART_SECONDARY 1 -#define MEM_PART_MURAM 2 - /* Clocks and BRGs */ enum qe_clock { QE_CLK_NONE = 0, diff --git a/include/soc/fsl/qe/ucc_fast.h b/include/soc/fsl/qe/ucc_fast.h index dc4e79468094..9696a5b9b5d1 100644 --- a/include/soc/fsl/qe/ucc_fast.h +++ b/include/soc/fsl/qe/ucc_fast.h @@ -146,7 +146,6 @@ struct ucc_fast_info { resource_size_t regs; int irq; u32 uccm_mask; - int bd_mem_part; int brkpt_support; int grant_support; int tsa; From patchwork Sat Dec 5 19:17:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 338716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FA1BC433FE for ; Sat, 5 Dec 2020 19:21:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B2DF23122 for ; Sat, 5 Dec 2020 19:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727715AbgLETVV (ORCPT ); Sat, 5 Dec 2020 14:21:21 -0500 Received: from mail-am6eur05on2131.outbound.protection.outlook.com ([40.107.22.131]:50144 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727445AbgLETUl (ORCPT ); Sat, 5 Dec 2020 14:20:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dT4sLkbCqCotYnAnXT4zw1CaW9BSg7yPQxnJty/hK/oyCEAQjVNycfGQIz1cXUNwj/dXigrN4M5ZUYQs1T9NkO6faxmYj85JdX6I054V32TPX77GEjcBBoDNvFe3mwPNaWT6LQwVdqfxM68odLjpHrpcEYLXR40EzIdMjzwKvSjotJuShYJ+ZWupQloq0SCicZQpXgwekDjLhRHPQhuEDqth1Sr7h8gimGOqPpvyRuRLxkoCc89VFhaT1oH/5vVFlUipn2XWHc90aw7k7RBnaNB0OOKOjVEf51dU2Oke7d1uLkqdsc4PY71xukvlI5x/sF08tzG6THcCffjzF/DsuA== 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-SenderADCheck; bh=xZ4sPbbjyo9slA0ImQ87wTmVnC8Pn7/hnGEqYEL7IjY=; b=NsxhfMiEa7hTgMGfD0sk9W6mPPszJQO54Axt/X4t7kIa34DW5eVHXRioNuauuU2Zc7WAHXumg8apjvBauYYIjF3W+NFF4mL9VEPLRtZP/QTkuVk6ge+SSP/YOkUDRXIftdtmHYrrfJK0ZGLZF5GiXRc5GJ+AJbcJyF8g5TFql9VU1KEmX2ucVAMXcWluknteSimQv+D7GQRToV9o+wJrd9AUx85tMGDt92Gtye8PERPlB3t6radEQgvIxjCjZCBAVLzv//s6xloMMv2KcIijfZbi8iICY0BG7Scr2JWCPfiiuracgMX8Tj/b6X9ZnA6aYTzluIy05krZnVXWUBs7AA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xZ4sPbbjyo9slA0ImQ87wTmVnC8Pn7/hnGEqYEL7IjY=; b=I+A0wtOdZUTSix1SDtHy+CVPxRH6XWAA4T74D5ZUca4tu3Z53z1fU45ve00UpqhJz3JL+JMsmMVd1BBdDgl6VLdU7bCXSCqjaIDQSNmRt0/JNcIDSe0RUqbQskDjt7GhVA/bb6lXRT5g1v8Xnpod41+aYVA18Gxfo30nMgPF1Cg= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM4PR1001MB1363.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:200:99::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Sat, 5 Dec 2020 19:18:31 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::9068:c899:48f:a8e3%6]) with mapi id 15.20.3632.021; Sat, 5 Dec 2020 19:18:31 +0000 From: Rasmus Villemoes To: Li Yang , "David S. Miller" , Jakub Kicinski Cc: Zhao Qiang , Vladimir Oltean , Rasmus Villemoes , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/20] ethernet: ucc_geth: replace kmalloc_array()+for loop by kcalloc() Date: Sat, 5 Dec 2020 20:17:40 +0100 Message-Id: <20201205191744.7847-18-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> References: <20201205191744.7847-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [5.186.115.188] X-ClientProxiedBy: AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.115.188) by AM5PR0701CA0063.eurprd07.prod.outlook.com (2603:10a6:203:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.5 via Frontend Transport; Sat, 5 Dec 2020 19:18:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ed4a984-a6d8-477f-401c-08d899528dbb X-MS-TrafficTypeDiagnostic: AM4PR1001MB1363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i5SX06HBixAY9iOgPO9T0Ukfhl5JE4k57DEiH0fG5KQxKjkWY2flFl1xR7ap7ixdIusL/hvUp0k/ExvLd3KIqiNFJpB/xhKwioWg2Z0W1Ih7EhjlA2s7o8XxX8z5GnLWyrFJlISokO/gkB1mNsIXIvTtUJCP9C4pJD+1zR8rIssO0+T6x5+kUaST9ByA6np9M/V8VmPjVa0JY1i+hPZDQ3fYIEnXQ/+uNWN4RQWQ7mHHLo5OFxXZwf2/TmtxwDRXCrsvXLmuqfSE7I5IAATck/7ofFCAJWHlSrv9VVne9Bir0ofjY39AL7+dpwr13YSN7UbVBNA1+yIE91AqL4bJ0A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(39840400004)(346002)(136003)(366004)(376002)(2616005)(2906002)(8676002)(8936002)(83380400001)(52116002)(36756003)(66476007)(66946007)(66556008)(4326008)(8976002)(5660300002)(1076003)(6486002)(44832011)(6512007)(186003)(26005)(6666004)(110136005)(316002)(86362001)(478600001)(16526019)(54906003)(956004)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: xr5enkF2jNltvO/n6qy5wAFaCiGJTTE4WfRIEetifIq2rpWYN7RrT69iby8VNZERGXeY+61hPtGIeXv1IPmMuBuCC4JUaIqs36s3Kv+0ZVKV+bmq/7wEYGT7T7u/dE8sjgySkHRlvt1gHbcuO9ORzqi2pzxvBWR0pdx9fGGFHddWwa/2vl6KPBRJFqaDRA1prlHAIFWTHOi9TFNq5kiHwDsJzG2Krj/uL6KzE6qyTaJjmNgTagH4rGW9/Y6VVpqeom4Extqcw3+7j6Q330aHaTxIUMuMuLAFRm5VD6wy9xDggY/IV1AILUwu5n4uBacuAqetYAyJfrOFRx6TDO/SdJGakNl6dFk6igP/CrHomv/3UbUQSG594elh72Fx/j6XMkAZcpCpqLt3+vckMnX8vqzaOO1UV0cy/h6dQxOfPE6L1endo2gd6xOAmFucJdvQ2jBMYdGytImPD/IwEaI4kmrLKp1iUFSoP9M90dHdXtAcqVm8bWOcB1PvjOnmSIFkONMs3URDSfeSnWZbhDznmT4+G5DvggvAKRviYoxoj961XeGi6smu1ymLNR63JTheeOZ4/YAvJ0ewCp819ZchWfSwdNL3s/IPrqWZhDyTA3RHoxaBb75F0DrerHlqW1eNvU0Z/qrQ7ysRxk1uOTnYsKwc+mfrNm/d96207Q/MhPMcekNbEEcq93mPGZ+h+63dVvyyM0NJMTArmqFntyIlZ7KUSfjQt0rVMARBsYk0zMQnG6q9yuUxJZaxFeS8deNcnzdU77t5scq3/aAUEPF/Is0mZvvicbrztI2/3NTLetFJEP29FfjYyPvYkeprPQ/wIew4bym+TEdhrvVIC6RAcjEPmH2Cb6YHHLZi8FGNZhHCaR/7N6/KrtdNLe9Jswqk7FRopvB+V1BMIrg/yyrU6ZYHIGz3dBM7UVLQkCffjIRE5ULVMTDxCO7LHGsHXnE4+s2h8CLmfNO7j/fcG23EMqcy43PJpnd4JUeCkP1LzH2tIX306+qu7m/8cCfZ+VTB X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 3ed4a984-a6d8-477f-401c-08d899528dbb X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2020 19:18:31.8661 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OcLdPfrTiX6Fm4b4Yo31GCT72wjApuSBfxzUl8bZ0px3OvaDxhcdaT0O8g/N6xkNYcqZ92XvHCpCbO47EG4CJ8/hiXYTMHyknFCaYJYBoFg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR1001MB1363 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index c9f619908561..3aebea191b52 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -2203,8 +2203,8 @@ static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth) for (j = 0; j < ug_info->numQueuesTx; j++) { /* Setup the skbuff rings */ ugeth->tx_skbuff[j] = - kmalloc_array(ugeth->ug_info->bdRingLenTx[j], - sizeof(struct sk_buff *), GFP_KERNEL); + kcalloc(ugeth->ug_info->bdRingLenTx[j], + sizeof(struct sk_buff *), GFP_KERNEL); if (ugeth->tx_skbuff[j] == NULL) { if (netif_msg_ifup(ugeth)) @@ -2212,9 +2212,6 @@ static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth) return -ENOMEM; } - for (i = 0; i < ugeth->ug_info->bdRingLenTx[j]; i++) - ugeth->tx_skbuff[j][i] = NULL; - ugeth->skb_curtx[j] = ugeth->skb_dirtytx[j] = 0; bd = ugeth->confBd[j] = ugeth->txBd[j] = ugeth->p_tx_bd_ring[j]; for (i = 0; i < ug_info->bdRingLenTx[j]; i++) { @@ -2266,8 +2263,8 @@ static int ucc_geth_alloc_rx(struct ucc_geth_private *ugeth) for (j = 0; j < ug_info->numQueuesRx; j++) { /* Setup the skbuff rings */ ugeth->rx_skbuff[j] = - kmalloc_array(ugeth->ug_info->bdRingLenRx[j], - sizeof(struct sk_buff *), GFP_KERNEL); + kcalloc(ugeth->ug_info->bdRingLenRx[j], + sizeof(struct sk_buff *), GFP_KERNEL); if (ugeth->rx_skbuff[j] == NULL) { if (netif_msg_ifup(ugeth)) @@ -2275,9 +2272,6 @@ static int ucc_geth_alloc_rx(struct ucc_geth_private *ugeth) return -ENOMEM; } - for (i = 0; i < ugeth->ug_info->bdRingLenRx[j]; i++) - ugeth->rx_skbuff[j][i] = NULL; - ugeth->skb_currx[j] = 0; bd = ugeth->rxBd[j] = ugeth->p_rx_bd_ring[j]; for (i = 0; i < ug_info->bdRingLenRx[j]; i++) {