From patchwork Fri Jun 7 22:37:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10982897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E962715E6 for ; Fri, 7 Jun 2019 22:38:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA8B2288B9 for ; Fri, 7 Jun 2019 22:38:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD8D228BDA; Fri, 7 Jun 2019 22:38:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6995C288B9 for ; Fri, 7 Jun 2019 22:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730480AbfFGWhl (ORCPT ); Fri, 7 Jun 2019 18:37:41 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46838 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729127AbfFGWhl (ORCPT ); Fri, 7 Jun 2019 18:37:41 -0400 Received: by mail-pf1-f196.google.com with SMTP id 81so1928476pfy.13 for ; Fri, 07 Jun 2019 15:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UkQI8hX0vIUpVc3tfTJ4CpjSb/8p01+g0dvWePLdY08=; b=e+vKvdKnQ/cr5CGuTa5EK01cZ+MfRnMYC41CccgXzHQwKg/POij2RhNAaHeGK5TdVM NYenBPuQyROBou1KlsUskYhDUQCGPp4n4PkvdKpwxUNIuxqAaQD3sMzt3joDkZBHy1C5 6uAsWmd444nBt/Xf4T4r+T1ujKXJx+/0JVRuQ= 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:mime-version :content-transfer-encoding; bh=UkQI8hX0vIUpVc3tfTJ4CpjSb/8p01+g0dvWePLdY08=; b=aM2WIwNZkfNoQ+VXi9d36IbnBXvlED6vbTunCeTZU5wufB1CuDSvAEXq4NOTtj6cFL Hs0v58I4iGIxIUlsIBBkNhryKrY13iNNzN1lff7DFh4KLsIt1Jc65ZXibEMlLh3yhaV9 nd9rgjeOOADL4Y2EM4T8BPgtd383Cf8t/KQARhvetzgPz6txtlHGAHrL6fKKY/1mNd83 2J9vtv1WNSfFU1mFTIyBGpJeZFuMR/Lfr7L3kUt7AHyqNyTYXC9fAxmLKqJIbP/rnIIJ Ln/zygtzY8bDMm5vp1i54bU0a190C8lMi/RQkrUdVvKNwBHSjiX5ibRvp69pbV+8vJI5 MUlg== X-Gm-Message-State: APjAAAUTnbAFQ7RK02U8BapJURs7rgRJkE5CfjE2BXvLN4ch2CsXbeg8 5zPuzyHwY7fW7TsRGWF0xmMBPw== X-Google-Smtp-Source: APXvYqwiSuAGcVzbwTvmm2ZIw/J7BlC5c609f8Ulw7reX7J6HoWIpxjWRSnpfKnbC7g5fUiN6hOMHQ== X-Received: by 2002:a63:2206:: with SMTP id i6mr2387516pgi.349.1559947060322; Fri, 07 Jun 2019 15:37:40 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id j23sm4185193pgb.63.2019.06.07.15.37.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 07 Jun 2019 15:37:39 -0700 (PDT) From: Douglas Anderson To: Ulf Hansson , Kalle Valo , Adrian Hunter , Arend van Spriel Cc: brcm80211-dev-list.pdl@broadcom.com, linux-rockchip@lists.infradead.org, Double Lo , briannorris@chromium.org, linux-wireless@vger.kernel.org, Naveen Gupta , Madhan Mohan R , mka@chromium.org, Wright Feng , Chi-Hsien Lin , netdev@vger.kernel.org, brcm80211-dev-list@cypress.com, Douglas Anderson , linux-mmc@vger.kernel.org, Linus Walleij , Shawn Lin , YueHaibing , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Hante Meuleman , Martin Blumenstingl , Ritesh Harjani , Michael Trimarchi , Mathieu Malaterre , Wolfram Sang , Franky Lin , Ondrej Jirman , Jiong Wu , "David S. Miller" , Pan Bian , linux-kernel@vger.kernel.org, Madhan Mohan R , Tony Lindgren , Avri Altman , Pavel Machek Subject: [PATCH v3 0/5] brcmfmac: sdio: Deal better w/ transmission errors related to idle Date: Fri, 7 Jun 2019 15:37:11 -0700 Message-Id: <20190607223716.119277-1-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series attempts to deal better with the expected transmission errors related to the idle states (handled by the Always-On-Subsystem or AOS) on the SDIO-based WiFi on rk3288-veyron-minnie, rk3288-veyron-speedy, and rk3288-veyron-mickey. Some details about those errors can be found in , but to summarize it here: if we try to send the wakeup command to the WiFi card at the same time it has decided to wake up itself then it will behave badly on the SDIO bus. This can cause timeouts or CRC errors. When I tested on 4.19 and 4.20 these CRC errors can be seen to cause re-tuning. Since I am currently developing on 4.19 this was the original problem I attempted to solve. On mainline it turns out that you don't see the retuning errors but you see tons of spam about timeouts trying to wakeup from sleep. I tracked down the commit that was causing that and have partially reverted it here. I have no real knowledge about Broadcom WiFi, but the commit that was causing problems sounds (from the descriptioin) to be a hack commit penalizing all Broadcom WiFi users because of a bug in a Cypress SD controller. I will let others comment if this is truly the case and, if so, what the right solution should be. For v3 of this series I have added 2 patches to the end of the series to address errors that would show up on systems with these same SDIO WiFi cards when used on controllers that do periodic retuning. These systems need an extra fix to prevent the retuning from happening when the card is asleep. Changes in v3: - Took out the spinlock since I believe this is all in one context. - Expect errors for all of brcmf_sdio_kso_control() (Adrian). - ("mmc: core: Export mmc_retune_hold_now() mmc_retune_release()") new for v3. - ("brcmfmac: sdio: Don't tune while the card is off") new for v3. Changes in v2: - A full revert, not just a partial one (Arend). ...with explicit Cc. - Updated commit message to clarify based on discussion of v1. Douglas Anderson (5): Revert "brcmfmac: disable command decode in sdio_aos" mmc: core: API for temporarily disabling auto-retuning due to errors brcmfmac: sdio: Disable auto-tuning around commands expected to fail mmc: core: Export mmc_retune_hold_now() mmc_retune_release() brcmfmac: sdio: Don't tune while the card is off drivers/mmc/core/core.c | 19 +++++++++++++++++-- drivers/mmc/core/host.c | 7 +++++++ drivers/mmc/core/host.h | 7 ------- .../broadcom/brcm80211/brcmfmac/sdio.c | 18 +++++++++++++----- include/linux/mmc/core.h | 4 ++++ include/linux/mmc/host.h | 1 + 6 files changed, 42 insertions(+), 14 deletions(-)