Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6498278rwb; Wed, 18 Jan 2023 06:03:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXsVjeIwLEGZXsP9pogjSAph4so7pA3WoAkB0YTBpWR1d6bP50L7Aiq3kBMdfcvUZhGr6O0L X-Received: by 2002:a05:6402:28ca:b0:499:70a8:f91a with SMTP id ef10-20020a05640228ca00b0049970a8f91amr7561318edb.19.1674050602861; Wed, 18 Jan 2023 06:03:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674050602; cv=none; d=google.com; s=arc-20160816; b=o1k0Y2Wi/dviVakYFLDV4+Js87ZyJo/UT2ylY8avWLoqP3tZJZawn56Y/q8NLJwH1e 1ztoxsNUZycPlN0UA6Y+zZuKL1jxwCrmDaFt5X7I8yrRXfW7SMcyl6d0C3RCHTy3o4ho oFeS/4wEW9bJ1c80K8f7Tj3cCu3OhrtEKb0Xv5Csp4StZoZ7iupCrHG8pNZncgQjvSMK y6CdAeuVW+T0vC7Yva9rFWRtmulxpnLTFfPsjGpC8I1IeQ7RbPkDxIcEV4ueyxRsPvTG yAORvP3eR3cvIq9KoyNM3284cJ2wNh0diQcF5bF2Ua11nPaEat7P+J1vs8oovrWMEgTi un5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=r/MdaMfGpngTvDj1TEFnHjyrcQTvG4jCt3QryBUQJFc=; b=DWyG7mlUB+uAQ05raDxFaRwcDe2R2XQh4E1s2eiZY8hLkexXvceIcS4pEWYRftMkAL kPO7EJ+ug3MRMtHI87oAFVdovrGRac7A+duMBIOeQf3ohdG2h3jWYr80/drN0vf7J+q2 +azJyADY6wCRLsp3HkRH/qNeEvg17tGq30tuJtCugIUBXMsoFZ+2/JQBevcb19/+AKm9 WgKRE9irpataEzHINGn5p15bAn5dw7pMzNxrzIR2a1w/IYL1x5qEssTNnap6jBOmWpr2 SAvyQ1jqmyNzpcIvcb3HKMkMxujWO5gS9txh+2aMv/OwAVGZvlt9BQYJlWe9te41KtyU pj6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@streamunlimited.com header.s=google header.b=ZZupgezh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=streamunlimited.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l4-20020a056402344400b0048ff7b3bbc4si33950358edc.405.2023.01.18.06.03.06; Wed, 18 Jan 2023 06:03:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@streamunlimited.com header.s=google header.b=ZZupgezh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=streamunlimited.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbjARN7G (ORCPT + 45 others); Wed, 18 Jan 2023 08:59:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230496AbjARN6E (ORCPT ); Wed, 18 Jan 2023 08:58:04 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B6A554B0C for ; Wed, 18 Jan 2023 05:33:06 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id mg12so10925143ejc.5 for ; Wed, 18 Jan 2023 05:33:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=streamunlimited.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=r/MdaMfGpngTvDj1TEFnHjyrcQTvG4jCt3QryBUQJFc=; b=ZZupgezhFoK3Ma5R4scdDL1xnc4rtd41/9W6aJRWZax9QBq3W0G3zCGVJW0U42iCYd 4KvJbYbw4CQi67BClvaNwX37mzcqLlr0nmJnmb8jvbyaQXvQkAtNOap+C+bD8nXs+OR8 3toqCE8yeR4NEL9Ne0r+XcH19jWXeAMlNKwv0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r/MdaMfGpngTvDj1TEFnHjyrcQTvG4jCt3QryBUQJFc=; b=HLy/iC9X/UofbvMTVjkMhbYzDmlNJux2yA4/dgmCGHngKM1ZhHZDrmOMsO7TeJLJvW TgnZEgYmPTCWSad0UL13kJlz8wbHTCHHMG2+rCUNOsHpq2wMqWP0eqYDpgwx4sjIRSQk ISeTb3BTFQs1igMrtff0kqna6JaI0IR/6EDZIh7BKKNNFkA449k/gQxyNjfNP44CmnnD yiVUNf6yulEA0mDLj5vdGW+YZStaMC4jQ68lqIr7d9eGjWZ60rNqopqIWLBvlzOIwyXD 4v9cGSWGOlI9fdOrvLqF1KaHL1XcYS6gRlbyVhPDx3+eM7NSfFV9VUp8/eV6B03Mriki AeEg== X-Gm-Message-State: AFqh2kqiz8iZNyzCT5Bs8lYd/k3mIkRX+QFyTwO+8ebOEQb4A+Df/bl2 pZyEH32F7BuPikyN3fe37LCF6c3fD1G3PFcXbbwqJQ== X-Received: by 2002:a17:906:7109:b0:84d:1502:a8b4 with SMTP id x9-20020a170906710900b0084d1502a8b4mr553373ejj.295.1674048784788; Wed, 18 Jan 2023 05:33:04 -0800 (PST) MIME-Version: 1.0 References: <52861a84-0fe2-37f0-d66a-145f2ebe1d79@gmail.com> <20221214134620.3028726-1-peter.suti@streamunlimited.com> <7c4aa0d2-d8e9-416b-b2ad-f5c3c8ea33de@gmail.com> In-Reply-To: <7c4aa0d2-d8e9-416b-b2ad-f5c3c8ea33de@gmail.com> From: Peter Suti Date: Wed, 18 Jan 2023 14:32:53 +0100 Message-ID: Subject: Re: [PATCH v3] mmc: meson-gx: fix SDIO interrupt handling To: Heiner Kallweit Cc: Ulf Hansson , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Matthias Brugger , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Thu, Jan 12, 2023 at 10:27 PM Heiner Kallweit wrote: > > On 09.01.2023 12:52, Peter Suti wrote: > > On Wed, Dec 14, 2022 at 10:33 PM Heiner Kallweit wrote: > >> > >> On 14.12.2022 14:46, Peter Suti wrote: > >>> > >>> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c > >>> index 6e5ea0213b47..7d3ee2f9a7f6 100644 > >>> --- a/drivers/mmc/host/meson-gx-mmc.c > >>> +++ b/drivers/mmc/host/meson-gx-mmc.c > >>> @@ -1023,6 +1023,22 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) > >>> if (ret == IRQ_HANDLED) > >>> meson_mmc_request_done(host->mmc, cmd->mrq); > >>> > >>> + /* > >>> + * Sometimes after we ack all raised interrupts, > >>> + * an IRQ_SDIO can still be pending, which can get lost. > >>> + * > >> > >> A reader may scratch his head here and wonder how the interrupt can get lost, > >> and why adding a workaround instead of eliminating the root cause for losing > >> the interrupt. If you can't provide an explanation why the root cause for > >> losing the interrupt can't be fixed, presumably you would have to say that > >> you're adding a workaround for a suspected silicon bug. > > After talking to the manufacturer, we got the following explanation > > for this situation: > > To which manufacturer did you talk, Marvell or Amlogic? Amlogic > > > "wifi may have dat1 interrupt coming in, without this the dat1 > > interrupt would be missed" > > I don't understand this sentence. W/o the interrupt coming in > the interrupt would be missed? Can you explain it? So the "without this" part of that sentence referred to the patch. Which means that without the patch, the interrupt can be missed. > > > Supposedly this is fixed in their codebase. > > Which codebase do you mean? A specific vendor driver? Or firmware? The vendor driver from openlinux2.amlogic.com handles SDIO interrupts a bit differently. It uses mmc_signal_sdio_irq() > > > Unfortunately we were not able to find out more and can't prepare a > > patch with a proper explanation. > > The workaround is rather simple, so we should add it. > It's just unfortunate that we have no idea about the root cause of the issue. After doing a more long term stress test, it was revealed that this patch is still not sufficient, but only masks the underlying problem better. Reverting 066ecde fixes the issue fully for us (verified overnight with iperf). v1 and v2 also fix the issue, but v3 does not correct the bug when WiFi is stressed for a longer time. And therefore it should not be used. Could you please give us some advice on how to investigate this further?