Received: by 10.213.65.68 with SMTP id h4csp385852imn; Fri, 23 Mar 2018 06:48:27 -0700 (PDT) X-Google-Smtp-Source: AG47ELtBfKxZymhmV3yqaEh054WCKO4gifSISXnPytyHSNEpe8Frkhr61BfgQLrL25wAJW02Cpx1 X-Received: by 10.101.92.138 with SMTP id a10mr21131054pgt.129.1521812907717; Fri, 23 Mar 2018 06:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521812907; cv=none; d=google.com; s=arc-20160816; b=TRb93cLTL+pWgHBu5/I9vhsovP3fU2N2ZsCPkyWbM4wSWuljHHmdd33ErV0JevP8Fu UU9uEsfJr50I399jcR9OAldYD2LqIboM5kPfKMajHU0SA/A4hcoQ2h0sWVxlPaqyVLBl TUNBKmknL/YuzjlWX3Ufg9XAZKLotje/W79bomjsjq3nh7MVA0H2CIPy2b1TQgMidsvY ftaZEudkfYOGJZ8f8MPy/aepiMWh4/xkNKz71niKDRoa10TH+SJRrc48wya7qBNwl2st Gvs+Cr+SOr2pANOSeuPLZU8TkrY16TQEh1HvKMh00H04/UhU62Tw5KTtmwnFQispUEQl 30XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=KJUQovgkvxx03/hptN8engLvstAmGDy0wR4pGwHjd+0=; b=b+GSWZbwyqNIcGWDaLf5BFdahdYiA38lqbWX/fTXq6498kycCaMIuC8GLxXAywGo+C 5dPNIp1Q5SbQIoqHIqNLKnjn5g3U9CpQ8G3Sjb/kQxuJTGb1SnaP8F7yDY/BQhcYgLCG CeGvDCuL9NC6l+xr180GDYDASsEXP0jvkOjATmQI69M0AG1RdN6nm+mIBtFZ7SBPYL5z U2XyJcxyvV4FjTJBKfuO5XbFZve/lDcipaRMgx8Hgpy7Pl5eAndmOOX22AC6QywP3WVa 82gwC4XqGTY8ErCp++rODMY6URDvCpCp9E6BTSYURHVzfngjHfx7InznLz/KN1s66LWU b8KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=G/amd9E1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si6094017pgn.564.2018.03.23.06.48.13; Fri, 23 Mar 2018 06:48:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=G/amd9E1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752995AbeCWNpk (ORCPT + 99 others); Fri, 23 Mar 2018 09:45:40 -0400 Received: from mail-ve1eur01on0062.outbound.protection.outlook.com ([104.47.1.62]:10935 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752826AbeCWNol (ORCPT ); Fri, 23 Mar 2018 09:44:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KJUQovgkvxx03/hptN8engLvstAmGDy0wR4pGwHjd+0=; b=G/amd9E1/PSYsCQw8FdX572YwQYxV2FpVQSOYY9m+kNaGNCRLFyTZ3VGooPB4IaCNq5aJEz7dg4PToaiv2rIi6Ve125HLNavYvsqzYnKEsi0GxLsEgDycwY1m3XKu2vDF3I70MoTCAgnTdxF0+R/Ff4Nq6zyUmuVuhA2h6Xfkp0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ruxandra.radulescu@nxp.com; Received: from rhuath.am.freescale.net (192.88.168.1) by AM5PR0402MB2690.eurprd04.prod.outlook.com (2603:10a6:203:97::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.609.10; Fri, 23 Mar 2018 13:44:34 +0000 From: Ioana Radulescu To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/9] staging: fsl-dpaa2/eth: Change link settings on the fly Date: Fri, 23 Mar 2018 08:44:10 -0500 Message-Id: <20180323134413.1532-7-ruxandra.radulescu@nxp.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180323134413.1532-1-ruxandra.radulescu@nxp.com> References: <20180323134413.1532-1-ruxandra.radulescu@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.168.1] X-ClientProxiedBy: BN6PR05CA0014.namprd05.prod.outlook.com (2603:10b6:405:39::27) To AM5PR0402MB2690.eurprd04.prod.outlook.com (2603:10a6:203:97::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8fd8bcd1-a1ef-43ae-faf7-08d590c436d1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:AM5PR0402MB2690; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0402MB2690;3:IOyhY7a/xWEKWjdALGYUp5ahB3njOL5/XTGkvb7DJv28o/nJuQkihdpfDnKGDQVg3xrwoThqP3/xPdB0KDl7YbQj6SpGKgpt4AKgL5EZxegOK6Wb54K58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MQdMnLWXQ4LtVzKUQ0IsDhgkR4Uqew+2HRij6uhPvtaXyR9p/XBdQ3d1PjoCRV8/8yfGjj5xXMtM+jFOJfGH3GCGvUlj5wbyEJrzswzepqktNw3CHkpN9b346SjsU0W6Mi9wFD6a+WeyUgwq/+bz3KwXm9ewtpmHKjAPxD3TVy6ipF6qFjhWMyvHzvGRd7RRiA2NGpza6xND5GaAlC9WV2pp1v25A1EW4Ts;4:oMM2IISzun5TcmigNKKQNo21V4VGa8/HeitWR5JOAXMtpNtw9uqbDyyyzTcDmmTYnjOINVKVwUfkxcoilK4msqdpv2i9eCILmwL6VWdZH64LYzBpgvVp8tM5bv6gPHPfCM8M5xOy0n/mxp0HN51gpmwpXZlfceVh+7HBgLyjlfjNvH+4zcuCY+hrxLRDIodCfALCUWcMDxrbulSBLDdR5H1vOVpzzjObVs457+0sReMmsfC3p/eer9wJy2FuKOGE9JoZi1HIUcwvOmEQ/IjqCoO/yvoMGWZxgCp4N06TRSOgJxQcjlbxy8I1BdzQ2PR4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011);SRVR:AM5PR0402MB2690;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0402MB2690; X-Forefront-PRVS: 0620CADDF3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(396003)(376002)(346002)(366004)(39380400002)(39860400002)(199004)(189003)(50466002)(25786009)(6512007)(6916009)(59450400001)(6666003)(7736002)(305945005)(5660300001)(386003)(6506007)(81156014)(6116002)(3846002)(8676002)(16526019)(51416003)(50226002)(1076002)(446003)(2906002)(36756003)(81166006)(76176011)(186003)(66066001)(86362001)(8936002)(52116002)(4326008)(316002)(53936002)(68736007)(47776003)(26005)(48376002)(2361001)(478600001)(6486002)(105586002)(2351001)(106356001)(97736004)(16586007)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0402MB2690;H:rhuath.am.freescale.net;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM5PR0402MB2690;23:kNmoho5ElCIZf5aqlNEUf8SJnnbqXaddoElCwae?= =?us-ascii?Q?IWu7yM9U2Z0uXnv1/uEqnwd3GBZMu3pCPMwFdL8RShKq/y4faPwdjsJFNNlR?= =?us-ascii?Q?wVUUNOLlSll2RERb1V74vPbKPAMkEAfbZLu9MzBmoqmInT4ZnfMvwpYf6Evi?= =?us-ascii?Q?aViAFXMsnsKDZ/Ga7JxkYCJAmQBmoO17lT03JLuNWsaqODN0jE1MjPkEuWjd?= =?us-ascii?Q?OgGShNjYc3RaApW5c4hB9xWDuDY6OboB/XQVKWjXXgcaaJHnZNO7cpgg7Auw?= =?us-ascii?Q?5/rcEXwjfmuRCfqhHD+XD0tGStAI+VLIY1fogDIAktFjUu+zHK3gH7hprbgY?= =?us-ascii?Q?bo46bCD7nLwgELoHjUSJrpg3FUfDrY3NGbp5pNKR6eZAzXx9dsHcP7IqFmc1?= =?us-ascii?Q?5rbydERDQDr46MCRLg3TRSP12hqBWrDEXBzXpoagOliZ13UkDBlsWJ1+eYJd?= =?us-ascii?Q?XrdfOO5F53Ovf7M+ksxEMJcx1Mz2DQ9hdqdjw2v//LCKdGj95ZqHkmA70FHB?= =?us-ascii?Q?LQSA5oo1hqT4JXmW/GGr2cF3oZvdpVvjQLU8OaCcpn80W5NOy52qY165rO3I?= =?us-ascii?Q?xyHvBo6O+R92/daJ6Jsc7ZhHvzEmOkryGcA6L/CCYfG+/clT2LJe2nPbkpk9?= =?us-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Xjzk6m90ch+MfVleN5fTaGeeKNprlJTtkIkRyL8txMWwRa3If362MAGQQRpBm7+57fUhZsbuKuye7WSY14RJ7vp2w9PyHkd9FBAnqx6blftQAk6VFpDySR2nTIFZsQOxuLA2hdxuP5XVtN6lSnE0lJIqq/nvrei+nk2ocZn7zdReTDVsAGwr7ZdVqLTEJ3tNf4l+3u75gHCwHIliGDCbBlld+XhZCr92Eh69QWziZeEdWs8iggVHNtP4ALUZVxKlSVoeRAWfBAp4ZTwGGMvA0IdNMoIKKbKy+oIluGW8Zi77zZfIrWcEEyH0aIbvLBCmpg1G6NouUAJWec5nFDDmdw==;5:gobvEJ6QDTrmb93t768wRSbb/pronSn2I0zIylfZ8DCN9z0tF1tLRiimn6CFBkLjHEA9uT68/72ICF5MGwYUwZ4EkxBUQ8RQqRGHFfO28dM/i8Fo/6RS5JS9gSls//MlO1QJ+MT4Uw1l8y9oq7Ren2KJy0Iiy3oKwMRTUNToKbs=;24:sk36XI3ZxUgIoTYF0Wfek8WtOlcbemr+c5dhehAagpLkr1ynaB9EWkwRd6+GHLTG8aKkSKZbQWBrHcqp9GZn9pMcEnsuGmcVlkDqDwOnIXY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0402MB2690;7:zoMBNZGuKK590c5mNuOJJGUcQ3V60RIYoudhyZCF1ebpSvNrLhYD5yFVSHOjryuPuUGYa9Z9iOc5D3MKU0SKB5HvfQDEBm+UdbpdHa05ep7fEZbJ6yziOn3Vk1QzsZyJBV3tJc07a7gv05YrEQFJ2bIa7Dh9qhhVsK1JVevwibxUbCC9TwsHrZ6mmBeNnH2CKYGvovdg0QzdrhsQ1mIAK4oLCPpN7Vir27MmMX2LFCZVvfSWf1At/0rGU+ybGgTy X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2018 13:44:34.1236 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fd8bcd1-a1ef-43ae-faf7-08d590c436d1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2690 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Newer MC versions allow us to change link settings while the interface is up. Only check interface status if we are using an old version. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c index dfbfa94..bfc8b64 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c @@ -119,6 +119,8 @@ dpaa2_eth_get_link_ksettings(struct net_device *net_dev, return err; } +#define DPNI_DYNAMIC_LINK_SET_VER_MAJOR 7 +#define DPNI_DYNAMIC_LINK_SET_VER_MINOR 1 static int dpaa2_eth_set_link_ksettings(struct net_device *net_dev, const struct ethtool_link_ksettings *link_settings) @@ -127,15 +129,16 @@ dpaa2_eth_set_link_ksettings(struct net_device *net_dev, struct dpaa2_eth_priv *priv = netdev_priv(net_dev); int err = 0; - netdev_dbg(net_dev, "Setting link parameters..."); - - /* Due to a temporary MC limitation, the DPNI must be down + /* If using an older MC version, the DPNI must be down * in order to be able to change link settings. Taking steps to let * the user know that. */ - if (netif_running(net_dev)) { - netdev_info(net_dev, "Sorry, interface must be brought down first.\n"); - return -EACCES; + if (dpaa2_eth_cmp_dpni_ver(priv, DPNI_DYNAMIC_LINK_SET_VER_MAJOR, + DPNI_DYNAMIC_LINK_SET_VER_MINOR) < 0) { + if (netif_running(net_dev)) { + netdev_info(net_dev, "Interface must be brought down first.\n"); + return -EACCES; + } } cfg.rate = link_settings->base.speed; -- 2.7.4