From patchwork Mon Jul 25 15:10:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12928183 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 C3640C43334 for ; Mon, 25 Jul 2022 15:14:40 +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=/fOR0B8j9yYWJsqW1+TzmKubAw+H/S8A3qU5pZskNp8=; b=y6tPdQ+Pq5MH1b nOyhqT7c9GFJOTXMUrAwxgRUJ1m2WfYmpNZPf1QihuR+I3L/ySVe1jJmnbHgWmStuXVVjOFSWr0S2 mR6F/tNif+67838yLP7cKDcRKZRSdCR8VPBL+3A1vo0aYuMHNb+zQu5adHLpEj8zRNOTXiFdoQfV6 vSKMHT9Xh9k3quxqMRwqb3nuHuWZmatXkEyzDS3KNpdrPj2cSAevvEnFPeah2apybpCs0iOmRNd0P YABwAFVpAaCqZupYsri3eE43cVe26y3buGbNq3TYYL8l5wg/Eu0uHO9bgo/rH7HXNP34o2IisO6cu zFa/8H4iQdEhe01EV6mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFzlg-00FGqI-Ll; Mon, 25 Jul 2022 15:13:13 +0000 Received: from mail-eopbgr10080.outbound.protection.outlook.com ([40.107.1.80] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFzjq-00FG2V-HB for linux-arm-kernel@lists.infradead.org; Mon, 25 Jul 2022 15:11:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itdSOrI7HJ+EyMk92C5U2Ot3P3qGJGQxn8dy6absoQpjT1sZPFcs80GIDnobmoAOIT/pRMwxKii83CVmyMnfG4tF4+jz5lgYyiI5xSSScf6/oX3QNAHh9gbUMJPqx2KjTT1qfbtGGRFWaZcjKYWdm7plqX9TWGUb3PdqPUnLTZOb5KrVdcZWwzrjEsK/f+5jB7DV27mGIynMUlvOLQi27P4YDkfWyuPgMAth9+RjWHk8urb/BjcqklX5JzirhScT1OH7+7k0w/C+urg6leRDuJSpzCiPxw2PDM35lS1e6RPyPOtfg9OmLR7EvaV95ONfrS6KHNG8d2PbUYf+UXuTEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9L6FnTqvCduyYhxu+YFwE1dDeiGhnmXGiGrEHy0sXGs=; b=RpzL6sWw32tnLkux1lS0yluzr511QMU9x/Ca9Zbck0iztTHhd7H+KcigQU6RjJc8SLgCfMqBDrylrVy6IMfdGxAbyyd2xkVsOxlpYi1LcO4eZhsTfiq587BhAx91K0JYGg46PSL8CIMkapuKn+sH4BbKnv3a84oeWufcblUzpvoDp+O+MHCWvL2IH4/nPVXjm6Pm1DQDPXCx18aSxdUZ45Jaa/bUlMJaD1be6c/IxNqNZi6Ziw+9cAb/bnMCq8FYQXduWFasQai1O3Sre7AIvOsW85/0fYAh5BxjpsgRAKT/6kVWjZdFNzjHSYT2frRodK90d7jBT4ZXR6+5GyzrYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9L6FnTqvCduyYhxu+YFwE1dDeiGhnmXGiGrEHy0sXGs=; b=KyCv3v9J17MZuK2OtCrzWJULdKW5mS41QihPzi6jQBvqWUJMnLnXa0sc8BqXaE5xH459tcRP5sWFg2Tn33d9nat1g2Ia1raWfzGFLVDxaPOQDV+mHgWF1eN5syrLb82qcQZrETXKjh42U6gg772RzAZDggu3N1qQrCv0NOKT3+IzWBGsKqCk8lMU144ybOExU/Yv85yWtvwHss4oN/7YyVXZc6NsCmzxOzUy9xy/iWaXQAX8hPZSxWhfEXgIlEmKFmscR544TPlYr9wBGRSOJBNr1rC0qIzNnu2F2BsynpEMps6NpRnzZXzkj0df6X9hLkIimjkvlpLYhDePXwQSfw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM9PR03MB7817.eurprd03.prod.outlook.com (2603:10a6:20b:415::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Mon, 25 Jul 2022 15:11:07 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::59ef:35d2:2f27:e98b%4]) with mapi id 15.20.5458.018; Mon, 25 Jul 2022 15:11:07 +0000 From: Sean Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Camelia Groza , linux-kernel@vger.kernel.org (open list), Madalin Bucur , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH v4 05/25] net: fman: dtsec: Always gracefully stop/start Date: Mon, 25 Jul 2022 11:10:19 -0400 Message-Id: <20220725151039.2581576-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220725151039.2581576-1-sean.anderson@seco.com> References: <20220725151039.2581576-1-sean.anderson@seco.com> X-ClientProxiedBy: CH0PR03CA0229.namprd03.prod.outlook.com (2603:10b6:610:e7::24) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 476b69e1-ed95-4386-52a1-08da6e4fe618 X-MS-TrafficTypeDiagnostic: AM9PR03MB7817:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nHKistol+IvQogE4IXIYSrkxGKQ+eDsHWeEFDmMAvjHOTZcWu8Ra2b6rr+4CWqEvGNGQuWGBho/9DWa7XW2eMAIqdcefaUeUjPmETLuFLxq8/MrdID2gdHJ+0jAtjqnWtI5W+MowcWQyTBMpTo69vmthfgx0uXFz5jD9VjSoHlf3ZpWO+8LRrYpmuY15bQFYOqh1U9K0E10A00xxFkQCaLLex9IxfuFEYEOw8VMzSpQHwOMpADVx0qlBMDEPDCzGMUL5hue20YWYZ1GuhXcAbsKoVFEA3+m87QsiKffSZgWw3+wFlkp7oj8IqofHhgORUDhYwfTYOsyylJrMtX51pUhilRCOYTWmbGw0EaU/CB/Y1aSjUR5Iu/u00K05/Tdds1toQvUlt5QT2n7EnHAd95QkftfCXgPeDGMCcF6+Crz4FnVSjw+6cMOZFa5EB5lLr8JUEYX61WBK5zYrbd+lTI/sbe3L69fPFodTHzk1b2Yixs+PCVX8CtqCkAW5Tmgki9K64ZrsVVEQXbNXowNhcxM23iljG1Pje+CIJ1Hz2j2/XnlT7WvqcVYA8QU2aDGPMO0gbQpadv+nsiIsbiXFYCxbkIK7XLNttFprbOCJCFOx6dOqtnBCbM9fqfJGDOyi1nCcFHy1Jj6rtoqb4CWhe1gT2IING270ReQs4ysKv3WaDK8w2vc5w7bvmdR5G0ol6f8I6Q6g07r9SwE9X73HfqelZSK0ctO7yRCta0W3T/GsJgItYVsOBkDYZWUgs3POyuhWdni3k8ebpa2eoKpCwc1//1594Aq3/5xh9j9GE+8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39850400004)(136003)(396003)(346002)(366004)(376002)(36756003)(110136005)(54906003)(186003)(38350700002)(8676002)(66556008)(66946007)(316002)(66476007)(38100700002)(8936002)(86362001)(2616005)(478600001)(4326008)(5660300002)(6666004)(83380400001)(7416002)(6506007)(41300700001)(6486002)(44832011)(26005)(6512007)(52116002)(107886003)(1076003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mx+q1kmkmYUKfznfwRl1+tvIU5wZMehMOYmjzabNPu+zswrI6JZTYArHPqWKdiqHxs2dQGt73ogNHJKwo4mLY/NeBwyw/HZ0B1yE4Zs5f7kgyd6XNrBjw6qyssRd0xKE3/pZGjA9hmOqkdrigX7fRJSaRckFlxVF+hoi8x/YlckMQ9jThZoWkUTEOhF42GbYiyGrDAMeTSDdPK8mp6tPGf/3hYnpeQ9eCMR06ibGRKvKZgWSp3vQFnpWzv/Q9RFSxADqC9VLR6Oo7Dve2+MvUtpWWkqwj/oMzVxaUxrLFz5/dXk1YtikCMW3CEyOY0krVi7KOHGaZjc813Pg/7lzmankj7mEC2D7hWpVpSFjV5Rn0x+1x83jfNHIIvcZIUUV3kXo+CeHBedJQ4rM7H89cBKYsRUJ1ASQwjW5fTz3Y7ETM7ojoU5ib5QqZwzwU6UV3eQ5OBrDWKpiimHYOYcaYEtGXapCrMHLRZHTFZT4f5ImSDe8HnsiirrHYlXbAA5QvuwVuw3oEk33TdrtMYJ2LdYNb0nPrmfyEPLB3V4YFwRQ90+27lMEvngugWsqR8csFjKYpE5hp8DBVbOZRPuAveFqzABO3iP93EeYaySb6htVeUeymsU7cY8Be+BAnQfqPvtfDnIA6Sqvcxx6L/gduG/bvUaHmtpvMAjCgQ4ft19zLbHDNgNEzfVd9nM7cLeLaKYi7E+ZdV45jcFycOVOxwLyE4gxx7b+eHDF6AHLp2Rzp6G1mGcgOwt5rSMgmyThmX1kuhUchvwi/5H9COkKDdSqrIJ/WczJ+slpuWPJE8v61T/0Sss4eLgqJIOV0nUYWK75jwNks73V1aVgEBmFcnkk/+4xVMnoP7WYB1dIGAcejWt/AI4u1NiCGB0YA/BEg5ZMR4EqmDAkK3DS3rEl2bbLX5XVHFbmuqKRXT2X5c5gK2Ds+CITvH/LocCOfe3ZdSZE3NJ9Eacv/ltXxb+krEQ0PHefIBXS9SovOGNuIsg5mkKQt6guDL4QwEhXj7ZHf++qVuWMUNSfD+KLhizZh+WLB6zjD6JKnNu0HPsQegPlaekURkGCMmneN4akw175Kz4mobeLH6xo1GHQn8PTDTxsoKZXP1ni5PNW6rVDNt6Ujg201pq1qIAviDbLwGRN512WvPspxD5SgSumrdaynUOV6jfj2lFrjjpeDEqgtPUK3BkC8Ky+6A9/mQIDV+L6dAOeZ3QRfpLd61AobyXeJu2KvyyoL2HyTD6X8JJ1EzUZXFmvCaJZTytiqN2pZbie8g/jdpBIsDGJrVL6tSWzbo0QkKHWvW5VbLkUYu+b9xwWx2kgpmPDEIAdn87mEfanra/OgJl6dW1X1M6Vmanh+Ul4yvwjHAU5H6VXqf3hBjobaVufyzk0gH04hsGkwcGuwRBMiJan/1mc9Tnp8YiJmygbVbUkx4Hx8c9sr9gjDel3e0yYV7t9hH1mzvQkAs31Y/1+z6oTdL3qrboPHTof9nCWs/Hg8Qt+WWOlk9eGbr8/LKzmAKos1EUKCH7dyAU/bmI2ehtP4XbuOKU09MXBiRRCfwE59F+UGWd9Ka/JOmZkJFyXqYu310cdvRA8/Q+VGtEoX4UaPQm+g2ozZB+QDw== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 476b69e1-ed95-4386-52a1-08da6e4fe618 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 15:11:07.0203 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l3ZRsFx2qbGpaBSinImZiS7ZofUBpyHSHy/j8RTPUTvVn7gTVJQOGi4xwCXq80JZoP0CJsxgqMTo/H6DYxqcZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7817 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220725_081118_761926_4D45169B X-CRM114-Status: GOOD ( 18.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 There are two ways that GRS can be set: graceful_stop and dtsec_isr. It is cleared by graceful_start. If it is already set before calling graceful_stop, then that means that dtsec_isr set it. In that case, we will not set GRS nor will we clear it (which seems like a bug?). For GTS the logic is similar, except that there is no one else messing with this bit (so we will always set and clear it). Simplify the logic by always setting/clearing GRS/GTS. This is less racy that the previous behavior, and ensures that we always end up clearing the bits. This can of course clear GRS while dtsec_isr is waiting, but because we have already done our own waiting it should be fine. This is the last user of enum comm_mode, so remove it. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza --- Changes since previous series: - Fix unused variable warning in dtsec_modify_mac_address (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 94 ++++++------------- .../net/ethernet/freescale/fman/fman_mac.h | 10 -- 2 files changed, 30 insertions(+), 74 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c index 167843941fa4..7f4f3d797a8d 100644 --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c @@ -833,49 +833,41 @@ int dtsec_cfg_pad_and_crc(struct fman_mac *dtsec, bool new_val) return 0; } -static void graceful_start(struct fman_mac *dtsec, enum comm_mode mode) +static void graceful_start(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; - if (mode & COMM_MODE_TX) - iowrite32be(ioread32be(®s->tctrl) & - ~TCTRL_GTS, ®s->tctrl); - if (mode & COMM_MODE_RX) - iowrite32be(ioread32be(®s->rctrl) & - ~RCTRL_GRS, ®s->rctrl); + iowrite32be(ioread32be(®s->tctrl) & ~TCTRL_GTS, ®s->tctrl); + iowrite32be(ioread32be(®s->rctrl) & ~RCTRL_GRS, ®s->rctrl); } -static void graceful_stop(struct fman_mac *dtsec, enum comm_mode mode) +static void graceful_stop(struct fman_mac *dtsec) { struct dtsec_regs __iomem *regs = dtsec->regs; u32 tmp; /* Graceful stop - Assert the graceful Rx stop bit */ - if (mode & COMM_MODE_RX) { - tmp = ioread32be(®s->rctrl) | RCTRL_GRS; - iowrite32be(tmp, ®s->rctrl); + tmp = ioread32be(®s->rctrl) | RCTRL_GRS; + iowrite32be(tmp, ®s->rctrl); - if (dtsec->fm_rev_info.major == 2) { - /* Workaround for dTSEC Errata A002 */ - usleep_range(100, 200); - } else { - /* Workaround for dTSEC Errata A004839 */ - usleep_range(10, 50); - } + if (dtsec->fm_rev_info.major == 2) { + /* Workaround for dTSEC Errata A002 */ + usleep_range(100, 200); + } else { + /* Workaround for dTSEC Errata A004839 */ + usleep_range(10, 50); } /* Graceful stop - Assert the graceful Tx stop bit */ - if (mode & COMM_MODE_TX) { - if (dtsec->fm_rev_info.major == 2) { - /* dTSEC Errata A004: Do not use TCTRL[GTS]=1 */ - pr_debug("GTS not supported due to DTSEC_A004 Errata.\n"); - } else { - tmp = ioread32be(®s->tctrl) | TCTRL_GTS; - iowrite32be(tmp, ®s->tctrl); + if (dtsec->fm_rev_info.major == 2) { + /* dTSEC Errata A004: Do not use TCTRL[GTS]=1 */ + pr_debug("GTS not supported due to DTSEC_A004 Errata.\n"); + } else { + tmp = ioread32be(®s->tctrl) | TCTRL_GTS; + iowrite32be(tmp, ®s->tctrl); - /* Workaround for dTSEC Errata A0012, A0014 */ - usleep_range(10, 50); - } + /* Workaround for dTSEC Errata A0012, A0014 */ + usleep_range(10, 50); } } @@ -893,7 +885,7 @@ int dtsec_enable(struct fman_mac *dtsec) iowrite32be(tmp, ®s->maccfg1); /* Graceful start - clear the graceful Rx/Tx stop bit */ - graceful_start(dtsec, COMM_MODE_RX_AND_TX); + graceful_start(dtsec); return 0; } @@ -907,7 +899,7 @@ int dtsec_disable(struct fman_mac *dtsec) return -EINVAL; /* Graceful stop - Assert the graceful Rx/Tx stop bit */ - graceful_stop(dtsec, COMM_MODE_RX_AND_TX); + graceful_stop(dtsec); tmp = ioread32be(®s->maccfg1); tmp &= ~(MACCFG1_RX_EN | MACCFG1_TX_EN); @@ -921,18 +913,12 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, u16 pause_time, u16 __maybe_unused thresh_time) { struct dtsec_regs __iomem *regs = dtsec->regs; - enum comm_mode mode = COMM_MODE_NONE; u32 ptv = 0; if (!is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; - if ((ioread32be(®s->rctrl) & RCTRL_GRS) == 0) - mode |= COMM_MODE_RX; - if ((ioread32be(®s->tctrl) & TCTRL_GTS) == 0) - mode |= COMM_MODE_TX; - - graceful_stop(dtsec, mode); + graceful_stop(dtsec); if (pause_time) { /* FM_BAD_TX_TS_IN_B_2_B_ERRATA_DTSEC_A003 Errata workaround */ @@ -954,7 +940,7 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, iowrite32be(ioread32be(®s->maccfg1) & ~MACCFG1_TX_FLOW, ®s->maccfg1); - graceful_start(dtsec, mode); + graceful_start(dtsec); return 0; } @@ -962,18 +948,12 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en) { struct dtsec_regs __iomem *regs = dtsec->regs; - enum comm_mode mode = COMM_MODE_NONE; u32 tmp; if (!is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; - if ((ioread32be(®s->rctrl) & RCTRL_GRS) == 0) - mode |= COMM_MODE_RX; - if ((ioread32be(®s->tctrl) & TCTRL_GTS) == 0) - mode |= COMM_MODE_TX; - - graceful_stop(dtsec, mode); + graceful_stop(dtsec); tmp = ioread32be(®s->maccfg1); if (en) @@ -982,25 +962,17 @@ int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en) tmp &= ~MACCFG1_RX_FLOW; iowrite32be(tmp, ®s->maccfg1); - graceful_start(dtsec, mode); + graceful_start(dtsec); return 0; } int dtsec_modify_mac_address(struct fman_mac *dtsec, const enet_addr_t *enet_addr) { - struct dtsec_regs __iomem *regs = dtsec->regs; - enum comm_mode mode = COMM_MODE_NONE; - if (!is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; - if ((ioread32be(®s->rctrl) & RCTRL_GRS) == 0) - mode |= COMM_MODE_RX; - if ((ioread32be(®s->tctrl) & TCTRL_GTS) == 0) - mode |= COMM_MODE_TX; - - graceful_stop(dtsec, mode); + graceful_stop(dtsec); /* Initialize MAC Station Address registers (1 & 2) * Station address have to be swapped (big endian to little endian @@ -1008,7 +980,7 @@ int dtsec_modify_mac_address(struct fman_mac *dtsec, const enet_addr_t *enet_add dtsec->addr = ENET_ADDR_TO_UINT64(*enet_addr); set_mac_address(dtsec->regs, (const u8 *)(*enet_addr)); - graceful_start(dtsec, mode); + graceful_start(dtsec); return 0; } @@ -1226,18 +1198,12 @@ int dtsec_set_promiscuous(struct fman_mac *dtsec, bool new_val) int dtsec_adjust_link(struct fman_mac *dtsec, u16 speed) { struct dtsec_regs __iomem *regs = dtsec->regs; - enum comm_mode mode = COMM_MODE_NONE; u32 tmp; if (!is_init_done(dtsec->dtsec_drv_param)) return -EINVAL; - if ((ioread32be(®s->rctrl) & RCTRL_GRS) == 0) - mode |= COMM_MODE_RX; - if ((ioread32be(®s->tctrl) & TCTRL_GTS) == 0) - mode |= COMM_MODE_TX; - - graceful_stop(dtsec, mode); + graceful_stop(dtsec); tmp = ioread32be(®s->maccfg2); @@ -1258,7 +1224,7 @@ int dtsec_adjust_link(struct fman_mac *dtsec, u16 speed) tmp &= ~DTSEC_ECNTRL_R100M; iowrite32be(tmp, ®s->ecntrl); - graceful_start(dtsec, mode); + graceful_start(dtsec); return 0; } diff --git a/drivers/net/ethernet/freescale/fman/fman_mac.h b/drivers/net/ethernet/freescale/fman/fman_mac.h index 19f327efdaff..418d1de85702 100644 --- a/drivers/net/ethernet/freescale/fman/fman_mac.h +++ b/drivers/net/ethernet/freescale/fman/fman_mac.h @@ -75,16 +75,6 @@ typedef u8 enet_addr_t[ETH_ALEN]; #define ETH_HASH_ENTRY_OBJ(ptr) \ hlist_entry_safe(ptr, struct eth_hash_entry, node) -/* Enumeration (bit flags) of communication modes (Transmit, - * receive or both). - */ -enum comm_mode { - COMM_MODE_NONE = 0, /* No transmit/receive communication */ - COMM_MODE_RX = 1, /* Only receive communication */ - COMM_MODE_TX = 2, /* Only transmit communication */ - COMM_MODE_RX_AND_TX = 3 /* Both transmit and receive communication */ -}; - /* FM MAC Exceptions */ enum fman_mac_exceptions { FM_MAC_EX_10G_MDIO_SCAN_EVENT = 0