Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1673619pxb; Wed, 9 Feb 2022 01:51:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCLvFcWMjhOgQ/30fG6YARoqUMIJn5seZCokN+saDeNoVrJSVn+GMEoexHrHv0cLH//QSs X-Received: by 2002:a63:8543:: with SMTP id u64mr1244248pgd.624.1644400262350; Wed, 09 Feb 2022 01:51:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644400262; cv=pass; d=google.com; s=arc-20160816; b=xE+r9UP7aGYuX2GrPzoWH3bYlAewzRXfYwFkN6lwj4yhVtjm3VReoqBwE+TAfbBzpm 1yC6UjXXbornWBBIBBbfT/qPqk/hAkkzel3KoFOUm4xQYJ3287Q3iMDf4zsQ1rL3gjjF 7gsc+vc9ReQ0pOzGbF5e1bLJRQ+sv/SVSa9raaxphRz4lVqDM7p0+0kCpg2g1GclTEf6 uQcTVPr6EFYeS3gW/F/ezObgzcVDTKKYmh6HtY9IF2t5EpDIKzR+qyCjNGwiz4nJIjh7 oAfiPL569BUbj+UfeiO/Qo3rrBpda+KaGYr4wJ6p5Q4m19eMdeOY8h4ddRCTUsPkd5f+ pCwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :envelope-to:dkim-signature; bh=KV77AyTYrq1N3BVVXWddRdBtpYm6pxa59m07DcnRDkI=; b=c4KxFI4NGK/GaAWDu5lOhhfedCjpfGARsvAWqrXvjqWBRNM/XyRz7ucHLLPBkVIJM7 +1M3I8KjFvVvWsU9w56Fvf0Ph8R1ZlK04Cr0v+RwshICepldXtwmk/l7ADtrIHCkTShS 8dws/MXjesfsF6R8w8fJWZr7+SmQJ7b2mZn/SSjSpToGZHb5Kq33+svuP+t2lepeOL6V TLhFuEbcsNGc88e4INtBf0it21+AQ7oYTzgkeh2APrnvqa4kuqG2cOtAFyEoem/J6kcE 5GcW7yKicuLTETDNUrayaA+S3/VOFUg90IxeUirhjfEZ3IfJ/ocgd9xmdsZ5Gzd1E10h 0ZHw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=BTjlklLR; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a10si10686889plh.72.2022.02.09.01.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 01:51:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=BTjlklLR; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25E19E073E31; Wed, 9 Feb 2022 01:08:48 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383025AbiBHQVO (ORCPT + 99 others); Tue, 8 Feb 2022 11:21:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242890AbiBHQVN (ORCPT ); Tue, 8 Feb 2022 11:21:13 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2059.outbound.protection.outlook.com [40.107.220.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00E47C061576; Tue, 8 Feb 2022 08:21:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mgfE+bYbFTTsxBr9nepR/X8C6jsiioi/2wVztZDTFBbK1JR5Yp8skm5RXGwjigdGlEsDxuHjWNuh54XIpYxhoWXwx1gV75RmwJfKWMFKOsUY6+iGLwbFbonYLzeup8bHwD16AjEkGJMSBH1a9VVXSXZpOziypOLVckCe8dVaj3Dmre32EzfXmR1MxDDhhfZsz/FFNS5Qj8MUikncteMYix5efyN8ZdT7ybqDMccLmUmL/ee/WKKOq2JMqK7naOqisX2qH8H7QNuFNi5rM7w0s6wK462Uzzzx1MDf5iIFZUQIJkRPmh9kMA0DfclDLZIJVYlsItON3153OwTYKu3JSw== 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=KV77AyTYrq1N3BVVXWddRdBtpYm6pxa59m07DcnRDkI=; b=TsNKswBdl85+sg7VlnG0ckhQz/6emv7yszVhjVA+mzYm4U/L8MZz8RGHDg+Bajjf90Hl5RhohRnIyNF+ZGp4xarKw5sWpwk04bK4Y7bLlXJmZ8LKhtCvRcv/qQvMWcTgxULu1ZCIe6NzkkQyWarJsLqVxJUV3dZ8cnH8o0WK+31bpGhUjmLRslIbJQLucIhxG48gpxolgVweHfK918LuQCGS3f8S2KUrAbQWRbs3nyzy/WtettQF79KKtphm+WNud84Dqqn6lJIbwiziff0eW4BXSDOMNvgHMYOo6tOG+9jF8tlmGB8n6Hhbx6QMwGArcW1d1Mzk+dFsQY/sSOL7rA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=grandegger.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KV77AyTYrq1N3BVVXWddRdBtpYm6pxa59m07DcnRDkI=; b=BTjlklLRxQrW0hdLRDiKzLS2/VsaFyosEMsTILXpqF0ajFMtknhL0+558kUAHFdW1ej4TET6jYMpjFCWJ6FKw7+tIhH3+De28rBlhDWJduQIrdiGE7pCkUT+uSu9m2ug038CPV2GAMhRxaZWcDpZmO6e3v/QMuZf83E/4UaGiKM= Received: from BN9PR03CA0987.namprd03.prod.outlook.com (2603:10b6:408:109::32) by BY5PR02MB6180.namprd02.prod.outlook.com (2603:10b6:a03:1fd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Tue, 8 Feb 2022 16:21:10 +0000 Received: from BN1NAM02FT031.eop-nam02.prod.protection.outlook.com (2603:10b6:408:109:cafe::41) by BN9PR03CA0987.outlook.office365.com (2603:10b6:408:109::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 16:21:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT031.mail.protection.outlook.com (10.13.2.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4951.12 via Frontend Transport; Tue, 8 Feb 2022 16:21:09 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 8 Feb 2022 08:21:02 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 8 Feb 2022 08:21:02 -0800 Envelope-to: git@xilinx.com, wg@grandegger.com, mkl@pengutronix.de, davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Received: from [172.23.66.193] (port=57446 helo=xhdsneeli40u.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nHTEj-0007jF-Dk; Tue, 08 Feb 2022 08:21:01 -0800 From: Srinivas Neeli To: , , , CC: , , , , , , , , Srinivas Neeli Subject: [PATCH] can: xilinx_can: Add check for NAPI Poll function Date: Tue, 8 Feb 2022 21:50:53 +0530 Message-ID: <20220208162053.39896-1-srinivas.neeli@xilinx.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 47bc9d20-cab7-4cee-0889-08d9eb1f047c X-MS-TrafficTypeDiagnostic: BY5PR02MB6180:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kKCsIs7f0v+QjhgdFrHuJcD6lYk5o62m93I48Qx27bsrgVorn9XRkcuUSljDqbdQAnabDbXmS/VGCd7iQu8VmhMJmk6ZRcylhTUbDWFzOrmtMY46vBaMB7YCNTjsAn2JoHzxW5msQ4L30XhfvEKCzeWx3cxnhBoqg1TYiFxt4+uXUYwMZdnuZVhH5tm+lrZ+Ws4E658kIo9mBx6l5mL/Q0KYv/bcRaSfGxLTvF7uNdTAR6kNFpdNIj04dXnLeEzxhl5SRwPAmsizRENmRw+pU+P2iI1k/IltuuTkn3cIiRo/BQyot7psFoyJdAmmq5v0z/nBs+1Wo5tpoQcxS0FUwyEQipWzvYPbDjIFOrL8dOnoZA+Dq37Z5v8XtTQ1VNzLACUygxqX/9ZrI7yK/Zt/EUky1qCpGMsboJOS9RwNgbi95P+PKPvNf01cdu8WuAKT6PzkXhOJZsHGHjN1EtePkFz/eopxNvTR2nI6EcRzV7q00dLb7+Qy2Xa8XZ+O4g2aCuuXeN1VU1Qg6OsBkPyYD7L690qtxCFKk4V9ds+2gxh+jVbasCSdy1GcvFIeGKTmHHxvgWLsEp0/R0sU8rZ68IfX+0KkN3TkSatCKuzDalTl8g3OZtPOq5OzdhUL67bhBgwc2ubcGwGzv9uRt8IcrpdL/owKN/m6jMaPXJ0Rofk= X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(316002)(508600001)(54906003)(7696005)(6666004)(36756003)(110136005)(82310400004)(107886003)(186003)(26005)(426003)(336012)(8676002)(2906002)(47076005)(8936002)(4326008)(1076003)(2616005)(70586007)(36860700001)(5660300002)(356005)(9786002)(70206006)(83380400001)(4744005)(44832011)(7636003)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 16:21:09.9980 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47bc9d20-cab7-4cee-0889-08d9eb1f047c X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT031.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6180 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add check for NAPI poll function to avoid enabling interrupts with out completing the NAPI call. Signed-off-by: Srinivas Neeli --- drivers/net/can/xilinx_can.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index 1674b561c9a2..e562c5ab1149 100644 --- a/drivers/net/can/xilinx_can.c +++ b/drivers/net/can/xilinx_can.c @@ -1215,10 +1215,11 @@ static int xcan_rx_poll(struct napi_struct *napi, int quota) } if (work_done < quota) { - napi_complete_done(napi, work_done); - ier = priv->read_reg(priv, XCAN_IER_OFFSET); - ier |= xcan_rx_int_mask(priv); - priv->write_reg(priv, XCAN_IER_OFFSET, ier); + if (napi_complete_done(napi, work_done)) { + ier = priv->read_reg(priv, XCAN_IER_OFFSET); + ier |= xcan_rx_int_mask(priv); + priv->write_reg(priv, XCAN_IER_OFFSET, ier); + } } return work_done; } -- 2.17.1