Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp310183ybi; Thu, 13 Jun 2019 16:42:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDfvo8LGeQS7xiFJBdThQSz+Hhswjkj9KsmMszh4OcSytfGUWSnQ7p9cKcUz1m++QHfww8 X-Received: by 2002:a63:7e43:: with SMTP id o3mr33522406pgn.450.1560469348506; Thu, 13 Jun 2019 16:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560469348; cv=none; d=google.com; s=arc-20160816; b=owF7DcEfdzbjs3id/ozKX/wQwxoLIyJkDrI865Riz4Snjnqgh8rJoBlE8BNmZ/fgsm MbTFr/mAG5TA66usgJG0HTpjSjskB7TuIASLKhkw4qpjU+37d/u9nLUWXgDjfE9shR/y a8RBS6FaN23aQKjfrbTVpNyPZqZnqFH2HZ1hBMrpze7r1w6Jx4OshBP1IAZJ+sfXd8Kw 4m1Rm9rOKArIwDhE29HHBYJEUyt+FKbRbAZOW9lHrAO494D9hTeT/cf7Tx3YeSS63NMQ JGPJOmUsxxSw5RbDDgjb9mdytegZ/5LHD6SNVwBxR7XyzOjlOawLLXcbmNCVl+PDGvTM oLFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qJQX+GLD4fwd+GCBrIWjKsA+IAvGAyQwTSeSX2BSMJY=; b=GI6pYm6HRG5H75wJWsjk0yrn6aF6NIR/ks3aso1YtyKY/1PULlbWLW//9RlHsgzCVI Kgu61cqnXnLsqFIKjkwf7g3tAn7SJO4B2s9kVrEcl0AEK0t7z+FVbKAqfA8LCCVSqDIH 9WGiOMRNT32CC+GQ09U8BW7YK3XfERDxL/FnN7H/f26WQ457GTs4oe+IuRuwjwy40la3 tzYPL+nJEwqfwJtiKY+1O5/onZkEzVcbAU6bXn+yKYNn25u1BvPjgQ+gPJJrbGdeKGPe mNOlWQUNU1+Mgho4xaL1ezBD7DLOuWaucf0bCrijsvSxlwK5dA8ZDFAowbbtMGqCE0hd 9VDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LxynRClH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a25si726056pfo.234.2019.06.13.16.42.13; Thu, 13 Jun 2019 16:42:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LxynRClH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727244AbfFMXmK (ORCPT + 99 others); Thu, 13 Jun 2019 19:42:10 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39317 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbfFMXmJ (ORCPT ); Thu, 13 Jun 2019 19:42:09 -0400 Received: by mail-pl1-f194.google.com with SMTP id b7so180744pls.6 for ; Thu, 13 Jun 2019 16:42:08 -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=qJQX+GLD4fwd+GCBrIWjKsA+IAvGAyQwTSeSX2BSMJY=; b=LxynRClHhe6x/JL/spDHqC1iBz5ugcvqw4xyZsmxiWuMKvrTOMnUdqDKFM09vDQEXk g8D28Mk39C+APeBjMzbC1os4SM6ZMn7qrCbrNb3T3fGmWaX7RMSCe+s43sy4YLrsZYAK USjKgfZYVdMtiNjE5ywU7CUZvHRcPUBbocn+o= 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=qJQX+GLD4fwd+GCBrIWjKsA+IAvGAyQwTSeSX2BSMJY=; b=dMd66jn0uUEQzMdznxkarQQFP7gjAbg+5zprPYesIpG0DfvNdnWLH11L4TbgIW5z8M JANaeKqE4qWTcw4OWcyCIiTX9406TmtXaxIzckWsurIvB1QrZBaj9dgbPjljJ+4Zu2P9 RC3lC5Jcaeh0ssIhbtivBrvPb+jRXlsrxHv/bKjrYo7zmWxHFcQqyjPxSU0jCow2VmXb FJWISOyFWsap0Cs8tQXp+wRMxkR4AP2nREvzVusFaej7s4hY9tBX8MQzsgTNcEvbx9SI efZnV2wXKUjZnmEKCUb7b8U5Rt98lTcGpLN4w6sNXXh3SxcKeIN26uLaTJMaUbUhl2qw E0Rw== X-Gm-Message-State: APjAAAWD6ql32U8H2c4zV3+7ap/db5gzBZHAVc5MHZIwJhbgjy9kgkpx BXeDAOW5zDeeEMQbzFLJq4vzLA== X-Received: by 2002:a17:902:2a26:: with SMTP id i35mr51358780plb.315.1560469328377; Thu, 13 Jun 2019 16:42:08 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id p7sm781088pfp.131.2019.06.13.16.42.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 13 Jun 2019 16:42:07 -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 , Shawn Lin , YueHaibing , Allison Randal , Thomas Gleixner , Hans de Goede , Hante Meuleman , Greg Kroah-Hartman , Ritesh Harjani , Wolfram Sang , Franky Lin , Ondrej Jirman , Jiong Wu , "David S. Miller" , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Madhan Mohan R , Avri Altman Subject: [PATCH v4 0/5] brcmfmac: sdio: Deal better w/ transmission errors related to idle Date: Thu, 13 Jun 2019 16:41:48 -0700 Message-Id: <20190613234153.59309-1-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 v4: - Moved to SDIO API only (Adrian, Ulf). - Renamed to make it less generic, now retune_crc_disable (Ulf). - Function header makes it clear host must be claimed (Ulf). - No more WARN_ON (Ulf). - Adjust to API rename (Adrian, Ulf). - Moved retune hold/release to SDIO API (Adrian). - Adjust to API rename (Adrian). 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 to temporarily disable retuning for SDIO CRC errors brcmfmac: sdio: Disable auto-tuning around commands expected to fail mmc: core: Add sdio_retune_hold_now() and sdio_retune_release() brcmfmac: sdio: Don't tune while the card is off drivers/mmc/core/core.c | 5 +- drivers/mmc/core/sdio_io.c | 76 +++++++++++++++++++ .../broadcom/brcm80211/brcmfmac/sdio.c | 17 +++-- include/linux/mmc/core.h | 2 + include/linux/mmc/host.h | 1 + include/linux/mmc/sdio_func.h | 6 ++ 6 files changed, 100 insertions(+), 7 deletions(-) -- 2.22.0.rc2.383.gf4fbbf30c2-goog