From patchwork Fri Sep 2 21:57:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12964754 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 C03E9C6FA82 for ; Fri, 2 Sep 2022 22:06:02 +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=OD6KMA1ethnCta9iwTOY2viG/ClNE4EiCxi1wc3HTZI=; b=QokkEezDU9wW0r ZHA7PxduYArxai5ywiSTXIOaHuezSapUuE3Ti/s7H8AFx/nuD6tUQ6GhnQoOIi3cJg0jYbLC2as6R xM3CpVfqaMxSmDbLBe6x0yt5siv5TUzsb3teT+9zdscOk8xUEqecItNmGXGihzUhnn+OQjruGWq5A BEAPWrZMFLrY2cOH6vhnzJUGiD5rzkc2WkS0Fy1VQnN2bGjiG0DUppMRnM4Fo1kw6kP+2Kq/EVcYn +3Q9DP/FMddAJyzX1Nydv3kCIxhqGClNTaZBcWcKjsRL3N5jr65dYUQj+/wP87twzHbFajlJgP1rT KMieDU1PqhO2Y+ssJNVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oUEm8-00BmGC-E0; Fri, 02 Sep 2022 22:04:33 +0000 Received: from mail-eopbgr150089.outbound.protection.outlook.com ([40.107.15.89] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oUEg4-00Bdr6-0z for linux-arm-kernel@lists.infradead.org; Fri, 02 Sep 2022 21:58:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hVAx4+wSDQZbuBvXgYqLeIRHSVbqUcGcrmi8HFO6SpSY8EVhUt5uqbEIsXL96uV29wVJUwep5LblxC5ztSlYxON39WqCjzP6anQs7K4/AuEKbu2e6QL2s9Q2mix1PkfVAueQPTTS65i0nCD/QuLcWvn1PaPabtuUea2oZsO8AAZyyJ567QBmFtUDnme865ZNrONIszEHUfv4ixaQp7u5G+1+iqDhPizfXVGXWQcukWHCAMDOTFBRtQ0QXIP0YqPyTlTSGEBmqUmljWk4xer/M22T7mUaxViyrac8tPx4A5KJFIeZYlLUPrSsBI5SOU/N43S7FpRgAwaI9No2HbvW4A== 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=DPJ9aEZ0tCyCtwuMuwv2HSxodcvXZItyWRtXwYebUDY=; b=iqJPvLUEShMwZogzAUtbv0i3v7+rCKLfeMYcCbU0Sh+8opTpFr0Xv4sB/MK7e45N1Q/4k7r3jqbMEkTEno3nRC02UE+wrfN8hmyIjolg0NwFf3oPCILBAq7OfU/jAvxULKHqXzeecaHRMLkkPtvlTpgtNxP/OPlEPefnU8/+6aCjtGisGkk1Uusz1cOnA81fNRHFVAZ6CRmeHvBeEtEwUaBpzLsdOUFKSl56OlrjPMu6LOCPrVqC0Cr78U2CUmQk1gZFJbbtgZDvcxMSFK4sAmxy1/BTcX4wcSELdqxMVZrpE13TRBOnMhxGnafIcmOHrFFiwHW22+2OylOy9uhgbQ== 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=DPJ9aEZ0tCyCtwuMuwv2HSxodcvXZItyWRtXwYebUDY=; b=zu2vU3euAbW6SSmOT//0dX96aZX5AusK0AKHgyEP04LrzdHLwLZnTGwR0iVdjEn6DSBQT9/QpEMzb6Ye6ttogDKMnHHrT9A2YhwHHPzdApKEH0A23XJFO+gNxRS8WiC8sQEmOkU+mf0brWbyQrcPsxjNYaE/ObeSQ5+7dY27yXF2JcdVCu3l9wW+Q8J+Gs3mYEBrcnk7uPUPITwaYwN1aVn7QxEIeSTBE6kj19TvpVt7kjZ9UsqlYr8x3Ve4KgSACsUgW9Rl/gddgIM4GfMRXREfk60TXhc7Pin8v39aaOsR5VwRVIRMSKJdnmbKq3FyBK6eku/i+T3/Y3oX9LDaSQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM6PR03MB4085.eurprd03.prod.outlook.com (2603:10a6:20b:1b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.14; Fri, 2 Sep 2022 21:58:09 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5566.019; Fri, 2 Sep 2022 21:58:09 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: Camelia Groza , Madalin Bucur , linux-kernel@vger.kernel.org (open list), linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Sean Anderson Subject: [PATCH net-next v5 10/14] net: fman: Change return type of disable to void Date: Fri, 2 Sep 2022 17:57:32 -0400 Message-Id: <20220902215737.981341-11-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220902215737.981341-1-sean.anderson@seco.com> References: <20220902215737.981341-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0315.namprd03.prod.outlook.com (2603:10b6:610:118::15) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a159ce17-7811-4988-4b1f-08da8d2e38e5 X-MS-TrafficTypeDiagnostic: AM6PR03MB4085:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2mveDSjxZP+mYTBWNqj4XARFkNbVGqAmmEChCN7X4zlqS9Ck8/j96oD5X6zHBcyMPX4AJu7o48RaL2fSgfpU5ARYnJQtbAM+VZrEACJQcTHHl64pgP1uGTYW6s2HPNux09c7QAfQT6BPwJGz/x0Sr1BkiIm1NLJqiARgU3ZdiccEaN/H0fXK4tjOSEr/mshc7ZET2IskfZ1y33XKZiaN17EajJmzBC92nqP9JLr/mmjDciWlT66VSK5JSYDGOm/6x3EG2qx8YHi2mFAF1YEv3v2UOjLIbM1wklK9eXHniRStskU89WXai4NhwQuMVb91fuT0MKq6SXx8c8TAvWg2jdKs176UBvZNrgrqVmG0RAuUas5cFr0I1AoJ1VmxwThBUPYckjzx22Birfx33lEGrpbVaEnWtV2c5HsKngSgDrg82+0uqGmgQAbWADsSeiiNP9Kj7iCcRMHxe4Kxcr52SgxPBNhPXGGlamrcUoDCIRZtx5ubo9eCa8JWPXoJKA3qDkYPWovdwVN5VAHxvN2giII3SMfTy7GQYDBGyfhPNFdbRFv5e6weEMQ9dXSBJLlrQp50DbA9fcHGI0AzOnMF6j7b0HHiWACNX1dAqqez0InxDNDqWvU265W7ZpWvOzOxK5n6h6JZu7CjgBvwFWpEccTQlIEfFh95iyR1K7MaQYUJ1AWNbjjEc3A2AwvWaknI0rIef7C+S+jbEVSPq1QGdk/bZ3E9nRScw6/7FEDMS5OF1fLBH6RrVcb+osQxNgYf X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39850400004)(136003)(346002)(376002)(396003)(366004)(6506007)(6512007)(26005)(2616005)(186003)(1076003)(7416002)(44832011)(52116002)(8936002)(5660300002)(86362001)(6486002)(41300700001)(6666004)(107886003)(478600001)(83380400001)(36756003)(2906002)(4326008)(8676002)(110136005)(316002)(38350700002)(38100700002)(66476007)(54906003)(66946007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zfCmFpCxulvDi/XP05hOxoGiaHsBhMK+cv57gmeboEnPvif8AY3psS4mw/G3WnvokJxGnjGyUxrnWmNGvS5b+fEG3n9DA7Os2PlhGGV2qeIhmSJ6IgWS1UrnpM0s3WcpqMiRfGtnpgEOB35fb+/2RdvwAEya9K+35MvYvEJ+TmQWilEQnmtq4p8zXqrmtMZBmrTgC7TUOTHj+ECKyMtlgDg1FvXnfoym2O4pXALNYGnWsJblgzoMpFKZVAkmqe0z+gP4DzdoxYBh9f/LNq/QdARBJgwwJRBMqP5OJ9aFWVWXOi5b7inv/rSDjmVEz4abRTBMCVod0UqRfNgi2t337psYbN9NToyMsHV/iufbyuBvuMLHy9muDo22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M0iKbjTLAlfvu7bLhxzfca2KroA4q/6Bfb+3hn55HDKv+WE7gBu/mvRCK0IOnvPCjK+5GozMuxRRpRAn0ykUJ8/T/zzIUcmRxrugFUHCtg+CGfAURtjhjZtijWGwW42JOQDMFFIx8vJS2ex/FPAsQ02vc0OTipJ+/7BjQ== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: a159ce17-7811-4988-4b1f-08da8d2e38e5 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2022 21:58:09.0628 (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: DEdJNS67+QwAJdMD2FnoLGKpzXC8F9bRGPnDJU35kyn4LFc4/f1MY2YiTyL9XMzjQ7kAoQcEl4HDpSN6lcFDCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4085 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220902_145816_100187_68CA9675 X-CRM114-Status: GOOD ( 13.19 ) 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 0e0d9415b93e..fc79abd1f204 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 0a66ae58c026..1b60239d5fc7 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);