From patchwork Mon Jan 18 16:17:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12027637 X-Patchwork-Delegate: kuba@kernel.org 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.8 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,URIBL_BLOCKED,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 869F9C433E9 for ; Mon, 18 Jan 2021 16:21:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 600CF2225E for ; Mon, 18 Jan 2021 16:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406630AbhARQVI (ORCPT ); Mon, 18 Jan 2021 11:21:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406349AbhARQTR (ORCPT ); Mon, 18 Jan 2021 11:19:17 -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 60955C0613D6 for ; Mon, 18 Jan 2021 08:17:52 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id bx12so4197461edb.8 for ; Mon, 18 Jan 2021 08:17:52 -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=u6l/vdhWSH4TgPbD8YeBUASOer/p6FTuLSeoTyml9Oo=; b=ety6rXeVJ8E+4SE1UwNlpJgYeSumZ+KnSfZe8o2ehD4BLsO6qIbyg3LuY/7+s7YIxy 1T8C8n1iwLjJgMCtByDaKkcQ+Yxn4AeAkmjHAuLP4JuYQ+XoQ7bZDZuLeYWHuqYlSMAZ M5XiOxr9g9L9uPWVz4tEsE5LM+sBAjGiKaZBf51+54G7tz+XsuZvAAMhSJuG80e2wnbp ZhPXWf3MgmjwHhqmsklMhPTHI/uUg/KmvY4YPT975VmjVsGh0nvSEzPwMeFJqc/UPPOz QRGB6aLKWEIKT1uJGAZR6jj/R84JgS1qb0n7WeQnrQ0kXDeDMsn9hqwUl7qFK7aPNufr w0Ww== 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=u6l/vdhWSH4TgPbD8YeBUASOer/p6FTuLSeoTyml9Oo=; b=J6v9BSPTj4KFcLLAPKPatYDU+ePq4vEjnh9IxxO0N/cm8s+UKkbCtwan6uvWWKXdyX nGcK6c0HboHeb7avejWAW3Bf8n35c0Bcr9gHx0j8n+T7nT3yQ3WRpWS8xsORVK05Prg5 3Bgjy7QVqma7lGxQyWZcJ9ZZuBhXPh09v9hMcSkoicyiaGrS3l/Y4NKs2hZqTOdxugTq gQz8UftnEBES00+uJ7vB05Cnkh/RQ7JPv+bSnntrqXHTQRjo1TpxGV4k42zhYoawZDjv w6GRM+Ik8/OBYeH3uvSLwpp4wxtiIK2zxClq+xmeQA1SRYUqYEa1+f+GM3CM29hQhaAO KAgg== X-Gm-Message-State: AOAM530n7x6JNsNl5brleKh9vuFpkEHuSTv7O770w3isRNwo/JHuOnPQ jDEOJjRBrFcqGDF7XozsL/k= X-Google-Smtp-Source: ABdhPJwBq3t7ndObKB9A2JvHPvTQ6zK65wakmdXswKSaKz8QXSAfhTg7oVwDPRWi8+5dHEoqe8yEdA== X-Received: by 2002:a50:d552:: with SMTP id f18mr193921edj.168.1610986671111; Mon, 18 Jan 2021 08:17:51 -0800 (PST) Received: from localhost.localdomain (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id u23sm6093781edt.78.2021.01.18.08.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 08:17:50 -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 , Alexandru Marginean , Alexandre Belloni , Xiaoliang Yang , Hongbo Wang , Po Liu , Yangbo Lu , Maxim Kochetkov , Eldar Gasanov , Andrey L , UNGLinuxDriver@microchip.com Subject: [PATCH v3 net-next 07/15] net: mscc: ocelot: just flush the CPU extraction group on error Date: Mon, 18 Jan 2021 18:17:23 +0200 Message-Id: <20210118161731.2837700-8-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210118161731.2837700-1-olteanv@gmail.com> References: <20210118161731.2837700-1-olteanv@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vladimir Oltean This procedure should yield the same effect as manually reading out the extraction data just to discard it. Signed-off-by: Vladimir Oltean --- Changes in v3: None. Changes in v2: Patch is new. drivers/net/ethernet/mscc/ocelot_vsc7514.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index d4cf6eeff3c9..76fa681b41f4 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -701,9 +701,10 @@ static irqreturn_t ocelot_xtr_irq_handler(int irq, void *arg) dev->stats.rx_packets++; } - if (err < 0) - while (ocelot_read(ocelot, QS_XTR_DATA_PRESENT) & BIT(grp)) - ocelot_read_rix(ocelot, QS_XTR_RD, grp); + if (err < 0) { + ocelot_write(ocelot, QS_XTR_FLUSH, BIT(grp)); + ocelot_write(ocelot, QS_XTR_FLUSH, 0); + } return IRQ_HANDLED; }