Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp142982ybi; Fri, 7 Jun 2019 05:41:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzk+lnnoPKP7+XNDd056kT/FMq3iB5iycc528PJ6ga8KAmv2oAQ73hStG6jU+NCfFXYwcXL X-Received: by 2002:a62:7656:: with SMTP id r83mr34122944pfc.56.1559911285828; Fri, 07 Jun 2019 05:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559911285; cv=none; d=google.com; s=arc-20160816; b=XKH0UAJZtFckkrNcC3a3Ga77nigMFS5fMr9OJDMobVla6E9YgGyHuSQ4vUKvt9wHWa xJyXNrBmdyKBf7jQ47p6wUm/sNqUczTx5hxzF1H8ojGeAiYG5Y9hC+38VZF9NZyJhryt qYWB+tK8MqrWfkAD6DD9OZQGnJnfjJuwHrLiyx9YU4ZfYXq4nu1UfH1UPif26kHECksG YCGxszDRoTjrI3O1YC7CDvyvQDuCRSfZue3iGFowprjEFT7sCw366lIWpJhkYC+Db2qT vdc4lUXy+LEMq4s+vG3aqeW7g99iBggieRXP5uXVD9LnIldz5xfCqn3DSnBDVjYDInas BdFA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=GsbwqwNiPgxZV2POQavzrrWG5lyYMUx/HV+2m0o8j6E=; b=tcHbSFbReGzyd+DYpBfTZSHqLSZhrbKaXsjO+hhFxjXvR+34WtwRozWa/9VeFPYS0v 0I/CCsd55kkeCoxy1vgFFPZQCRFsNN2oLi96VHT6NUI5OmiuDQj4QDMYfEgqu9YQLjtj 4pVu5loObZoqLFU5Ld9FLNm/CS7hgn7pJ534PsGcWKyq/HO5csMID69UW6D5svnNjvFM 3LZQ7TyS7OPFA0aVj5X1hn2fa6+KrdCSxA55ioPFvWE4no78Sgoq0rnOihXbFZFiBsEv e5Rz7dj+/4+TpBwxd0M5dOEwIcFrE5Jzy07o97sThkVWTU/xUw9KQ6xpbkYedljLwEAM 7bFA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si1657564pgr.419.2019.06.07.05.41.09; Fri, 07 Jun 2019 05:41:25 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728690AbfFGMkE (ORCPT + 99 others); Fri, 7 Jun 2019 08:40:04 -0400 Received: from mga11.intel.com ([192.55.52.93]:12214 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727102AbfFGMkE (ORCPT ); Fri, 7 Jun 2019 08:40:04 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2019 05:40:03 -0700 X-ExtLoop1: 1 Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.198]) ([10.237.72.198]) by orsmga007.jf.intel.com with ESMTP; 07 Jun 2019 05:39:55 -0700 Subject: Re: [PATCH v2 3/3] brcmfmac: sdio: Disable auto-tuning around commands expected to fail To: Arend Van Spriel , Doug Anderson Cc: Ulf Hansson , Kalle Valo , brcm80211-dev-list.pdl@broadcom.com, "open list:ARM/Rockchip SoC..." , Double Lo , Brian Norris , linux-wireless , Naveen Gupta , Madhan Mohan R , Matthias Kaehlcke , Wright Feng , Chi-Hsien Lin , netdev , brcm80211-dev-list , "David S. Miller" , Franky Lin , LKML , Hante Meuleman , YueHaibing , Michael Trimarchi References: <20190603183740.239031-1-dianders@chromium.org> <20190603183740.239031-4-dianders@chromium.org> <42fc30b1-adab-7fa8-104c-cbb7855f2032@intel.com> <16b305a7110.2764.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Fri, 7 Jun 2019 15:38:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <16b305a7110.2764.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/06/19 8:12 AM, Arend Van Spriel wrote: > On June 6, 2019 11:37:22 PM Doug Anderson wrote: >> >> In the case of dw_mmc, which I'm most familiar with, we don't have any >> sort of automated or timed-based retuning.  ...so we'll only re-tune >> when we see the CRC error.  If I'm understanding things correctly then >> that for dw_mmc my solution and yours behave the same.  That means the >> difference is how we deal with other retuning requests, either ones >> that come about because of an interrupt that the host controller >> provided or because of a timer.  Did I get that right? > > Right. > >> ...and I guess the reason we have to deal specially with these cases >> is because any time that SDIO card is "sleeping" we don't want to >> retune because it won't work.  Right?  NOTE: the solution that would >> come to my mind first to solve this would be to hold the retuning for >> the whole time that the card was sleeping and then release it once the >> card was awake again.  ...but I guess we don't truly need to do that >> because tuning only happens as a side effect of sending a command to >> the card and the only command we send to the card is the "wake up" >> command.  That's why your solution to hold tuning while sending the >> "wake up" command works, right? > > Yup. > >> --- >> >> OK, so assuming all the above is correct, I feel like we're actually >> solving two problems and in fact I believe we actually need both our >> approaches to solve everything correctly.  With just your patch in >> place there's a problem because we will clobber any external retuning >> requests that happened while we were waking up the card.  AKA, imagine >> this: >> >> A) brcmf_sdio_kso_control(on=True) gets called; need_retune starts as 0 >> >> B) We call sdio_retune_hold_now() >> >> C) A retuning timer goes off or the SD Host controller tells us to retune >> >> D) We get to the end of brcmf_sdio_kso_control() and clear the "retune >> needed" since need_retune was 0 at the start. >> >> ...so we dropped the retuning request from C), right? >> >> >> What we truly need is: >> >> 1. CRC errors shouldn't trigger a retuning request when we're in >> brcmf_sdio_kso_control() >> >> 2. A separate patch that holds any retuning requests while the SDIO >> card is off.  This patch _shouldn't_ do any clearing of retuning >> requests, just defer them. >> >> >> Does that make sense to you?  If so, I can try to code it up... > > FWIW it does make sense to me. However, I am still not sure if our sdio > hardware supports retuning. Have to track down an asic designer who can tell > or dive into vhdl myself. The card supports re-tuning if is handles CMD19, which it does. It is not the card that does any tuning, only the host. The card just helps by providing a known data pattern in response to CMD19. It can be that a card provides good enough signals that the host should not need to re-tune. I don't know if that can be affected by the board design though.