From patchwork Sat Feb 13 00:14:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 382680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D1F7C433E6 for ; Sat, 13 Feb 2021 00:15:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71D3164E00 for ; Sat, 13 Feb 2021 00:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231317AbhBMAPN (ORCPT ); Fri, 12 Feb 2021 19:15:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbhBMAPJ (ORCPT ); Fri, 12 Feb 2021 19:15:09 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5FAAC061756 for ; Fri, 12 Feb 2021 16:14:28 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id df22so1867084edb.1 for ; Fri, 12 Feb 2021 16:14:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PsP+HVEooPaJHcrMMWVKuGbQNjneesUyAcPxm+EshNw=; b=BfAN/k6c38X0HiXDe7qYDENmd0p7MHYerIfBQT3aGadxF7RG2tMaweZAjSQkufZOKm IkF6Ozc4Xdy18x4ewhSgj21J1DjQo7Zw6pw3x0fkHhZkmVOSc2uK55GCMCjHAOOpRLyN LWNOhBDBkuJsdBAOToXPUDjRC4FRGkzySwCRUxCiet4G0fmrWYWouwVPrQfg9jlUA/62 leBQ/gvEtRhhqpMs7wQnFqtqujMBoLF67DiDhXcNTOyvx0a2BfLIg6A/4yh1YqZnplns /0el/Ov6Rz2PJxnQjwAlWXFHiXKvdwqqXAXBvp8M/h+D7Iyecxu2npLuAkIm3/NTflvo SOGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PsP+HVEooPaJHcrMMWVKuGbQNjneesUyAcPxm+EshNw=; b=sdo/2xFqXZ8C6fTIuzp4SoV42NOwF2PpG3oBT0hvHkGC01NfG3J1cIq61iZCYVznC4 IxPgKyXn0lfn1rqfvd85VFg7pYiTNcPzn9B0IHPurFCKGK5Opu4rIc2wLPwN3EibZW6q 9ZhCYyMSzL8J4Vga/IFfexsCKvzol2vBXO2CVSzBGEQkMuL5UvwzJuhzX9BkmByzQQkY tAwAO4Yp/SEaVhA7kL5wFtGrapxIdY6HiGVnc9ViPcDMLbBFPCPG7iKN99v08ZDOaKe4 ONByunQE5HNIbSMc/X4wIa4bThPj7XiC7TfahRpjcphOszIx7RjILJ9B/8G23MxGHXfu P9kw== X-Gm-Message-State: AOAM531dN2vxqslbyl1kY2fLYowO6sqEzwGcIVQSCPFQtvWWcCG5ZBwP GSsKQEomjRlOz5IISPsMhAc= X-Google-Smtp-Source: ABdhPJzVgZI1/po7LFOOO/UpL/eaqDV6QIMFaojtkAHXETvzGLJaCWs+tR7oJfvCV0x+ZZaun9+KBw== X-Received: by 2002:aa7:cd51:: with SMTP id v17mr3230165edw.194.1613175267398; Fri, 12 Feb 2021 16:14:27 -0800 (PST) Received: from localhost.localdomain (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id c1sm7015606eja.81.2021.02.12.16.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Feb 2021 16:14:27 -0800 (PST) From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , Vivien Didelot , Richard Cochran , Claudiu Manoil , Alexandre Belloni , Vladimir Oltean , Maxim Kochetkov , UNGLinuxDriver@microchip.com Subject: [PATCH net-next 01/12] net: mscc: ocelot: stop returning IRQ_NONE in ocelot_xtr_irq_handler Date: Sat, 13 Feb 2021 02:14:01 +0200 Message-Id: <20210213001412.4154051-2-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210213001412.4154051-1-olteanv@gmail.com> References: <20210213001412.4154051-1-olteanv@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vladimir Oltean Since the xtr (extraction) IRQ of the ocelot switch is not shared, then if it fired, it means that some data must be present in the queues of the CPU port module. So simplify the code. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 6b6eb92149ba..590297d5e144 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -604,10 +604,7 @@ static irqreturn_t ocelot_xtr_irq_handler(int irq, void *arg) int i = 0, grp = 0; int err = 0; - if (!(ocelot_read(ocelot, QS_XTR_DATA_PRESENT) & BIT(grp))) - return IRQ_NONE; - - do { + while (ocelot_read(ocelot, QS_XTR_DATA_PRESENT) & BIT(grp)) { struct skb_shared_hwtstamps *shhwtstamps; struct ocelot_port_private *priv; struct ocelot_port *ocelot_port; @@ -702,7 +699,7 @@ static irqreturn_t ocelot_xtr_irq_handler(int irq, void *arg) netif_rx(skb); dev->stats.rx_bytes += len; dev->stats.rx_packets++; - } while (ocelot_read(ocelot, QS_XTR_DATA_PRESENT) & BIT(grp)); + } if (err) while (ocelot_read(ocelot, QS_XTR_DATA_PRESENT) & BIT(grp))