Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2723043pxj; Mon, 31 May 2021 09:07:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLEbTZRiNHGCPv/szh9I7Y0HWRWNZYkdyxJsrc3hk2Ul3hWmqjNr0hk1UI5S+pMB4fXrD3 X-Received: by 2002:a17:906:1dc2:: with SMTP id v2mr23988374ejh.8.1622477246655; Mon, 31 May 2021 09:07:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1622477246; cv=pass; d=google.com; s=arc-20160816; b=DHQoNfZosdSlWW39hspmp1zuVG3mgsXXkbU1jYQnwb8hxsSf8Nq+/kcu+r26g6y6ka B88n5Oq9aVEcyMJMN0+g0NOWOKDVkcVN2+pAzW+XU/jjfQLKqfUHR+U7Avf7BFVUldtm 6bjo1RpB7OFaoyhe7qWFYBHuQHp/C+9p8PUolpPBlJ2jhPSF7dRXSbcICEnlZdDwhF1u dKNwHMNy5IZBBN/6toIwWb34Hz9K2TsVHANqn5nEzQVb5eVvNrca4v6UAE+UQad0awvU ksILhO9xP6cGdMjb+sn6JJdxSrSqxCc85l2s5xC4iUQ4vkyd2MdSB/xMUAVq9b4azLfi ENOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=v8bp5vVsYCRNZgSkqz9f+7TdXrBaQ2RlSE6aJGIpDuw=; b=LF/+xjFzLowEw9SCOd7yCHD+6yLH4ktq6vz78+sM7tIMbtPnYsOpnJ/D5UNV/qONeE 9+tvSPnvfARJWN06Z/mXuDVyAqJwhQo9WvJLaH1hr2NGPurZULGme1V/gLh1Hfl4Dnq4 iQPjPjnBMKjzXKkAHHPtvgeFSUwxzkX19cSt09VbnWEqi6p01PXXS42oDFSSYOEAWfQN 6g7nlJYeDYeWgyAfHErm/WgNCB2/3H7aIeeQ/kj422XniRczQq9/mOOMvbBy8F8McwPL H5ynRwkWFnKt6UbZ3LuNv7JDfQ9b+zS5+gVN5Inyj3iK62wSKS8MExBWrYiJOs4RUmF4 U5vw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@plvision.eu header.s=selector2 header.b="qS4C/z1U"; arc=pass (i=1 spf=pass spfdomain=plvision.eu dkim=pass dkdomain=plvision.eu dmarc=pass fromdomain=plvision.eu); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=plvision.eu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si3789622eje.551.2021.05.31.09.07.03; Mon, 31 May 2021 09:07:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@plvision.eu header.s=selector2 header.b="qS4C/z1U"; arc=pass (i=1 spf=pass spfdomain=plvision.eu dkim=pass dkdomain=plvision.eu dmarc=pass fromdomain=plvision.eu); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=plvision.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233401AbhEaQHm (ORCPT + 99 others); Mon, 31 May 2021 12:07:42 -0400 Received: from mail-am6eur05on2090.outbound.protection.outlook.com ([40.107.22.90]:62668 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233550AbhEaOfi (ORCPT ); Mon, 31 May 2021 10:35:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O+yAnc74zxRl03p83g5z3k7zFO8vTN65xeTZWcT7X98t6oAUVEKbPT9UFJQUJ6hKijN9CRvLOYqQSF9pl1xOamy9tCsCJx/C6Vh0oxOXiQYFn567fuQG8PzH1TMV8fNRPluktDuKMcJN5reZsbVlJrR6laVaCOYJMeMFTFEJw18+cDmbQYzu2z0XAc5CBzxXtHRkG/kQYCm0liQBexGQm7EvtTgqBWG8AwiBpNWCeSK3v/C/7XNNr8XbMjZNmf2wmyzAx045I1gO9umSxSeymVqWWqwThKJKICD6S1xPp+Er45gOcExSgWVJonHkHxBbiEqeeEG7RqOqWlkac7eGNw== 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=v8bp5vVsYCRNZgSkqz9f+7TdXrBaQ2RlSE6aJGIpDuw=; b=gZGwfonV1hZgeJ15FTkyMhbF/rueppwUwkYWODEqDWN6ekHcuhelvH/nAR4Nyj1hjjOt54/7KXI5DNcg9wI6pN4akcGL3iH3kvI+W9kUc9FD93OnaxH5k99k8efuOTBqu5MF3c1U1czNeZmVSut15LDF5MLxFgmpcYR2Z1PjOvjwRw83k0QH+LCrj2+c2ghC6mo+DXtbhzgGgRMknir1M8y8Mtmw3ROMujeZ4VP0tdZWol9OpfpBRRFaTuf7UN6F684LGzvxQw3Ryy3G991P685IJuD19ro68FkjwooKG6Y6g0t1ctPyHlXJy8fuNcxTLGDD1DHx/jHBFH605Jb/3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=plvision.eu; dmarc=pass action=none header.from=plvision.eu; dkim=pass header.d=plvision.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plvision.eu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v8bp5vVsYCRNZgSkqz9f+7TdXrBaQ2RlSE6aJGIpDuw=; b=qS4C/z1UObBrKxmSoE/iJJsBY928igPZcKyBk8+QPu5NVNHjm+PO8un3dwtYdTLuhIUpaE5ee11nLlJL+gGQWAn1NxWLGM1JS9n9FCtOgY842JNHeeBPRrCpnBlhg7xfsHpnav00kVOihHko1l1juwYQXlBXgv027+StGQZjDhk= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=plvision.eu; Received: from HE1P190MB0539.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:56::28) by HE1P190MB0459.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:5b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.29; Mon, 31 May 2021 14:33:25 +0000 Received: from HE1P190MB0539.EURP190.PROD.OUTLOOK.COM ([fe80::edb4:ae92:2efe:8c8a]) by HE1P190MB0539.EURP190.PROD.OUTLOOK.COM ([fe80::edb4:ae92:2efe:8c8a%4]) with mapi id 15.20.4173.030; Mon, 31 May 2021 14:33:25 +0000 From: Vadym Kochan To: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, Andrew Lunn Cc: Vadym Kochan , Taras Chornyi , linux-kernel@vger.kernel.org, Mickey Rachamim , Vadym Kochan Subject: [PATCH net-next v2 1/4] net: marvell: prestera: disable events interrupt while handling Date: Mon, 31 May 2021 17:32:43 +0300 Message-Id: <20210531143246.24202-2-vadym.kochan@plvision.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531143246.24202-1-vadym.kochan@plvision.eu> References: <20210531143246.24202-1-vadym.kochan@plvision.eu> Content-Type: text/plain X-Originating-IP: [217.20.186.93] X-ClientProxiedBy: AM0PR04CA0036.eurprd04.prod.outlook.com (2603:10a6:208:122::49) To HE1P190MB0539.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:56::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc60716vkochan.x.ow.s (217.20.186.93) by AM0PR04CA0036.eurprd04.prod.outlook.com (2603:10a6:208:122::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.26 via Frontend Transport; Mon, 31 May 2021 14:33:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32f730ab-07ba-49e7-1d72-08d924410c7d X-MS-TrafficTypeDiagnostic: HE1P190MB0459: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G+v8XAz257chLszrR7uCWRKoJjWxquN39g5uf3KLQL48B8j2ffcWQcFnNX1a7vvTGMlw6R/bg0dmLTV21OFA+/TCuxD+s3Oi8Af8uqladj0kIJPNJbXgx7b4gLXsOXQcSc2Z7Fn23tGRb6b5Rb1hayZA4feG/mjMk9YrSFE5QBIWc9UEB1l5cmGI8Q0828Y3V+Da9mJQ/hEM7Qqj3pNzDT8/8vTJ9gWq1JF8/+l2CAbW2Du9l4jy0BeYFgE8zACspZVl48NZ/JTipnk/GIFrk4uI0u1KoXnDWWwMRz+FUlR8oLEasrzO6y1XGtBIj6QwM0CndQjo+4U9vcWAcnTiDRJlqP2bq9i4dZN6Xple+W3CMfUD6Pko4Ws7U/zuAlJy8Re8KhaR5sQJzUveLSx+Ftk6KZB7QRnrBmSQh4IdwLKiHoweS8k3lcx2yp0WWChYlLn7/f59tuHg+6C9sIkzbVxmOuhP7ib/7ZNr2+5JZO/y66NlXh9mampACYMP9V0gKMgk4eIEDYf0NOK0XDPWLpDs1ZhZAep1DKMeeSgNti48vRjpU52IJwQsU10/HjgI0oSIWE2WNKTbnJpmciw/+wONjmiZOnjjlbvx/ybC5LNX9btZio21Ghrvn15rn+vE06ITswSwlkKfXXm9rtGm7w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1P190MB0539.EURP190.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(346002)(376002)(396003)(39830400003)(136003)(366004)(16526019)(26005)(5660300002)(6506007)(8676002)(2906002)(6512007)(6486002)(38100700002)(38350700002)(44832011)(316002)(186003)(66476007)(54906003)(110136005)(478600001)(66946007)(86362001)(66556008)(2616005)(6666004)(4326008)(36756003)(1076003)(8936002)(956004)(52116002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?4RKS2OeSbbS3Px+4l1gLwhw7nylltweimQLlazQIodvp1aewnG+5trQ4SJ29?= =?us-ascii?Q?4fLQmLXRRHUEDAfgXuiztw13UY5XMC6jRkXJIK0ZM95J8C1ws8+iGwPJTZD/?= =?us-ascii?Q?xsuDL1AW5NLM8A2dnM9CqLp2NyF1+A770g2qxWzHqly2D/JfFwX5cgp3W3Fu?= =?us-ascii?Q?ElwPUMDY6HhN0A767hDR5XHseS0OO5sOWaPocrbp1sqsJwm/UM2A/g+Ft7we?= =?us-ascii?Q?aKl+pSIM6WQxjXDJThKbv2jf/46giEeWRG1Be+gPqjNb2PQmXyVOERzqWNfQ?= =?us-ascii?Q?6rURST76GC71FYIJanS/mFeKCDQOyarNS1nQMLyRROXgYz02/UeMMBTUQTJv?= =?us-ascii?Q?jIE9dFbuThx8aj7vRp/4k1AnYTxNOkfPyeuKcWaqlB7LVtaSsJuK7KssfZfM?= =?us-ascii?Q?ek+WsqfexpkIEumC+EPGb7gVX8KZAsicbl+SZ4/HROl2VfUN7NPgJSEz8NTk?= =?us-ascii?Q?iYjRRKm6vyBYtgLrnlc/2ezi9EJIOjNHVDbNx2/ivX3dicys76dpQuL+i9tH?= =?us-ascii?Q?8pxFiSH9qDVExQ6vla49O2SLIbqio4KA4mbn5sBSWggNs9MGkp/5g6ktRPYX?= =?us-ascii?Q?SAPKFHybNslVqt92HtzRxhBUSfCVEaLi2jITs1l7CePesNYqipymM47fi4pp?= =?us-ascii?Q?J5wytcBUvFlZXKgp5zpnv3uCPt1jNBXeMVovojie0uesJ75FzN9GS9I637+D?= =?us-ascii?Q?0PO5zYIvtvJ8yfsn3i6emFG4AKyqoucszt/uz3/yLyTelMSedXL3oM7r1Lso?= =?us-ascii?Q?UfbcvawWfv/TZF6ZkhkpJO+7B4IFhcAuN5ASzoAcM9FvGCRYc7NJA7pDMBv4?= =?us-ascii?Q?nEGi85Bpwr3YCcOkcpZZG/S0YHb6Iqam+LRSw/tAPSyv2YzcmGOXwI9ooP+C?= =?us-ascii?Q?NzZ/GqaR5LKhfylCOX/v7t6qAabBwysln1HgUYB5WB74Pac1c25t6Q+SbBhK?= =?us-ascii?Q?uDkTKyXlGQorxTrg2LUR6N6ObNSqkZe2R8Afe9PSqkwVqREEM/H8jaNOzw8K?= =?us-ascii?Q?g/ui2HCHEVRgQWx1uwxFihuJfarDwCwg36jNi1Hti7h6JKTxNHhpWqFddIcm?= =?us-ascii?Q?7ly2Dvr+P9GFe6GJMr7Ve0mDl9VMvfzh9VnY0SFsyvCLsHpeFKMnSWXNKMbc?= =?us-ascii?Q?m11qWtbeJZ/QPbmV2/rBaUH5y8OHu0kvOtKjYozEPA4P5TtwUYyxAQmzQJPR?= =?us-ascii?Q?8qE0gCruaufqROx8wsweSWws/I8fjWv8WjglIPGdR9sil3dJbTPq5+cC5OSU?= =?us-ascii?Q?BmOC7F8iO6EK65A3QUT+lvcehLNQDJIrz+uh08hc5VJ0eq75dnRCuNUauRDC?= =?us-ascii?Q?ijhlAlKmhhvnHZSMb+pW332l?= X-OriginatorOrg: plvision.eu X-MS-Exchange-CrossTenant-Network-Message-Id: 32f730ab-07ba-49e7-1d72-08d924410c7d X-MS-Exchange-CrossTenant-AuthSource: HE1P190MB0539.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 14:33:25.2684 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 03707b74-30f3-46b6-a0e0-ff0a7438c9c4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wLiXfCy60gbRX4twWPZjbtku70zeR4CZF0QqI+/85DRXZ6XkaHmxQAtk1YckXPpCOuQBvSCUfNxu7pI6yw1m1TUVPts0yyl+gs5QrYGeS/8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1P190MB0459 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vadym Kochan There are change in firmware which requires that receiver will disable event interrupts before handling them and enable them after finish with handling. Events still may come into the queue but without receiver interruption. Signed-off-by: Vadym Kochan --- .../ethernet/marvell/prestera/prestera_pci.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_pci.c b/drivers/net/ethernet/marvell/prestera/prestera_pci.c index 298110119272..dba6cacd7d9c 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_pci.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_pci.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /* Copyright (c) 2019-2020 Marvell International Ltd. All rights reserved */ +#include #include #include #include @@ -144,6 +145,11 @@ struct prestera_fw_regs { /* PRESTERA_CMD_RCV_CTL_REG flags */ #define PRESTERA_CMD_F_REPL_SENT BIT(0) +#define PRESTERA_FW_EVT_CTL_STATUS_MASK GENMASK(1, 0) + +#define PRESTERA_FW_EVT_CTL_STATUS_ON 0 +#define PRESTERA_FW_EVT_CTL_STATUS_OFF 1 + #define PRESTERA_EVTQ_REG_OFFSET(q, f) \ (PRESTERA_FW_REG_OFFSET(evtq_list) + \ (q) * sizeof(struct prestera_fw_evtq_regs) + \ @@ -260,6 +266,15 @@ static u8 prestera_fw_evtq_pick(struct prestera_fw *fw) return PRESTERA_EVT_QNUM_MAX; } +static void prestera_fw_evt_ctl_status_set(struct prestera_fw *fw, u32 val) +{ + u32 status = prestera_fw_read(fw, PRESTERA_FW_STATUS_REG); + + u32p_replace_bits(&status, val, PRESTERA_FW_EVT_CTL_STATUS_MASK); + + prestera_fw_write(fw, PRESTERA_FW_STATUS_REG, status); +} + static void prestera_fw_evt_work_fn(struct work_struct *work) { struct prestera_fw *fw; @@ -269,6 +284,8 @@ static void prestera_fw_evt_work_fn(struct work_struct *work) fw = container_of(work, struct prestera_fw, evt_work); msg = fw->evt_msg; + prestera_fw_evt_ctl_status_set(fw, PRESTERA_FW_EVT_CTL_STATUS_OFF); + while ((qid = prestera_fw_evtq_pick(fw)) < PRESTERA_EVT_QNUM_MAX) { u32 idx; u32 len; @@ -288,6 +305,8 @@ static void prestera_fw_evt_work_fn(struct work_struct *work) if (fw->dev.recv_msg) fw->dev.recv_msg(&fw->dev, msg, len); } + + prestera_fw_evt_ctl_status_set(fw, PRESTERA_FW_EVT_CTL_STATUS_ON); } static int prestera_fw_wait_reg32(struct prestera_fw *fw, u32 reg, u32 cmp, -- 2.17.1