From patchwork Fri Jul 15 21:59:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12919861 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF45EC433EF for ; Fri, 15 Jul 2022 22:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NVWuTUSXczCLS1Yadut9ZK4a7dfhcLPPFnL1sNfoQCs=; b=fOZZwSjVGCL3Pa yeF5wqgPBb4Oq7cB7XMiEaLZTR8hFPwLeYy9zgfKwfNPudX/406ZM0bDM6XGilvrss+HmQxnS+7tL KLwBk0lfAK/lb4q7cgkFuNDOabwaUv8v+O3CJXcoUxjkt8j8vvxHEeEvQVWApW3AtCcPNxt4MUrDi GsL7YsgLS58dlz4kin2jsQi2RP4yyZ6cikLk2EhnaViih5r2aHjwCn0QcjfCIQ28D9ONG7JEDHTRy zE0ATk5FCDEa/H/D05aWmgddvRpazAXkya2/cEkYtE/5XaQCP4mdd1U6HHHSGEax8prSDFNSdTy+O 0cK6QFUiqQIzuz6ovUTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCTzJ-00ApxD-7M; Fri, 15 Jul 2022 22:40:46 +0000 Received: from mail-db8eur05on2073.outbound.protection.outlook.com ([40.107.20.73] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCTNP-00AbaP-9D for linux-arm-kernel@lists.infradead.org; Fri, 15 Jul 2022 22:01:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JTqpAX31rGdkgn8yt1iedgSNTbF0tPX/dotEMTKTEIvWiz/7Pn/834Ur1gXspV+wKgdaH43S9+HVy7oqj29GdNtudCjFQCYgwLXSKJ0jufbrSW7xPb9tGZP14COdvvct4Wp+BkB0wZovYlZ1nzw3myp5CHzQwRCUuoj2HkbtBVjXN32Urgit0Pm5yll+1Tm/pmLNSk3MhSabWRuRn5VXVmWA2r0as0W8iXhPYfbF3ZmC4KFeM9nsGt68YiYaHhVo/JekiXZMU8TFRUl6i8pF5vlfrHlmLEsEoNlI1TtrJV72xfhbum6SZro726axaI83n9BmboavMMguAtb8oh0yVQ== 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=r8/eM0tio6WPHOydqQD2/9WPF01qGFSIswsP2saXMAg=; b=TNF7mXNX0ZaoyydizbpNcw0MuGw305B+lF4urEqI8uvpRxjMJRpOe4eBLzY39JfiRhVFV2ywyEUKswkcSHLN2E90WmSDhMhZUKKjxtPvK0/2sI99hscFH2qbjjvI5jFH3v4hq1NHatgPzTlmUqS+VOgHrbP02MYV65jnKkdojP5iqtmIHD8sBzTkA4FN6hJeNRu4v65Q1flCUccAE0cIPK5HmKUu7653MTZYxCyVSyDgI2L2bRrU8Wzc0iRu25GB7ICg5yR3ZP+e7hIFpZd1GE3tEuXPAsyqcNtPoqZrGQ+bgDFp32+9I/sKqiiCbrwGZPbJREYjaMe+uHgX+FYosQ== 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=r8/eM0tio6WPHOydqQD2/9WPF01qGFSIswsP2saXMAg=; b=1ofx51Cc81mpN7FW5o8N827ROyeVggGQXVl2AC6NTEgdvDpljcuyV5lu/wKshARwUG975oVp4a6+CemuYZdDsKJ7F6EOCjjWEPNlhJ9nE2OH/8gJLOilA9QGGB4dbLQCS+UTOup0AakH1SPINmdGY33VAfTATT4uRYl7qD4Jjg8huS7to6cEP2LSgejJWHVeiW9x+wlJfFBsonmiYp1GaSBfgEHeFnrhgqEad9bNyEF0lM+Kkx208hYdbImAiRsP7mPjpcBBNBCW5f8UqiOWsMqPIdG0LxI+x6lYeFRj3DCDQSJW5iCO8VmnIdqbpJ0CZ/o6TrPl+ENTRYO2DaUomg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) by HE1PR03MB2857.eurprd03.prod.outlook.com (2603:10a6:7:5f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26; Fri, 15 Jul 2022 22:01:30 +0000 Received: from VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::5c3e:4e46:703b:8558]) by VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::5c3e:4e46:703b:8558%7]) with mapi id 15.20.5438.015; Fri, 15 Jul 2022 22:01:29 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org Cc: Paolo Abeni , Eric Dumazet , linux-arm-kernel@lists.infradead.org, Russell King , linux-kernel@vger.kernel.org, Sean Anderson Subject: [PATCH net-next v3 34/47] net: fman: Change return type of disable to void Date: Fri, 15 Jul 2022 17:59:41 -0400 Message-Id: <20220715215954.1449214-35-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220715215954.1449214-1-sean.anderson@seco.com> References: <20220715215954.1449214-1-sean.anderson@seco.com> X-ClientProxiedBy: CH2PR10CA0009.namprd10.prod.outlook.com (2603:10b6:610:4c::19) To VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 91f20521-056f-41c1-ade2-08da66ad9235 X-MS-TrafficTypeDiagnostic: HE1PR03MB2857:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GOglLQiJQGw+KT//zFjtN6Zmhr+ysE5Pq9kAzp5L74nQidZhJyqBG72OxNE6huuPm+tECfMnNkiGqllMrKmMCIUKHVDAJCt6HanLs2CC+mJpNepQ42PtbEcCpcto0fNEgidiiKMm7j3ulj/I+/i4N5Nh4GbGjjgwOwvPpka+qBJoHfEtVP/odqfDF6DhRgT99AOEeKPHv1g/DZorZxTbvsTFo65Qgilz12Q4uh8Dy9v2MiuhzDIq4Oygow5DRMbk+WL3r2xtWsfjylVHWCqTsM4kxcm+QO5zjfFLQUwGT8OYEWRwP/vJRbEKW/f7wzLDGh+dyfdot6Z24htSX3ymQQlWJsgEdVrVhIsObf2+iStRh05Q0z7FRk2ZGtVKg6k+BGWJl2hdrSTgHxi8iJ3A2jxoH2VuiPFJ5qLdQu+xl9X20QUfTuTamD0wM6JRhsbEaOASbZ6LnfFcofFA5ooTAAaqGNwNT64fVcWB0YX0BnbAaUnDlTpgCWmAaPsMn3rpZXKX1ZF72m162i7vJPK5e1kezn3eI0pPq1kvihyj40Qy+/0uQ/xYSA5E7CaC739PXaSJJDTeHqiMvKhyOkAbPpM6pwzoTzQL+H9pIn0gSIro3fliaQo4uYSy0/HsjQX+jxcPn4VJYGWtfLR8yzqh3cgDzUXUREN+GElyYUFKDGRFqGMAiucIvAlk2LlVfjrRik3a0fOT92tXeiWUzGeR/auX9M39D0SAoPVSMBE1BnFLGJyUvSjdXfyi99r1BcOGGdmKeDHIT/XjpbOFj4jTHzGbKjsk3blIncWmYE2RIr8y8U/dUXdh0ZHC9LK5y8jz X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB4973.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(376002)(39850400004)(396003)(366004)(346002)(136003)(316002)(54906003)(38100700002)(2616005)(186003)(36756003)(2906002)(6506007)(38350700002)(26005)(1076003)(107886003)(86362001)(110136005)(5660300002)(6666004)(6512007)(66476007)(4326008)(8676002)(44832011)(66556008)(52116002)(83380400001)(8936002)(66946007)(478600001)(6486002)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: roAsmrGulKBtbI/awM1l7T1jGd3hud/I5ZMw3tg4AoKnNwM93pZO7midG9SqQ2FVW0CQeMs5fMelEdLtt0kAFxpUC2pwCa2A0AJXfiXFo3qXSLyTrTpDwlF0/zMI40gOWnXEDM/hLVEPr5zTzs5YF9PNv2SFYragjP1BtuP5K0j25iL3HGuf2D8b8Y2Mc8j1l6v7KruP3kFph5GPy7Xkb/aHyt+SOoSIKWz7r3nSQbXJH1h6kMKFwidebiAfOaYAsiFMl818qoC/fwIFbkVIdcs3LvQq9mQWuCrWjfi//6yHQgTUqPF+OA9B52d3TalLDLq1c9Wg/uZUFrlpAPRxV/kbwXqmgtkOob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zMMAtYvceMikgAX35bGQYrZk9MfJlbP327PJtWunnNpkM6ph2U/7T9vlo7im+uet3uhM1V9PwQFAhdU2DqOZZ0v2z5sufO0/VGFgSFvZxkYvUInkiRSQT64wPVnaqXd8ks0N0b+L/iLumJsd+vEsAWKDc//wbxIshfyyEe6rLbwBhC6A9tHXTMhz6JCJuwQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91f20521-056f-41c1-ade2-08da66ad9235 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4973.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 22:01:29.5650 (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: FionsTiKGwG8h72SlEriPZfvdBalz5otNHsr0InaQ2e8ae0cBDWBbhf5lXbmyPr3sXL0wYeKkDDlQpE5iqlBdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR03MB2857 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220715_150135_387743_FB646FEE X-CRM114-Status: GOOD ( 12.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 02b588c46fcf..d378247a6d0c 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);