Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8864744ybi; Thu, 6 Jun 2019 22:26:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVwO4vM+2sj84Ft3f1shaZ7LamFpde3MYYiigDUvkcyLMr/kinLGg/ef5iRHed6HjLAlcr X-Received: by 2002:a17:902:683:: with SMTP id 3mr49820732plh.209.1559885194244; Thu, 06 Jun 2019 22:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559885194; cv=none; d=google.com; s=arc-20160816; b=Ui+pRxiDQwEGCIwfecryy3OeJBOQ/HL6PzJG8JhFGbKKsj2t+6W8bQadCoW6Xtfwsf Xg3FmFnWicJ6qrxF6J54nysN21odGMLHLOW9XUmFfnzaeoakjuiaTXRIjqeD+F9ixPV0 7QNfiT6FJjjxA4Z5lV+oUP9Pd/K7xeIwCb38TqsSv2OMQ72kvu56b67wII4GaZXjFM5c 19aGrKNKxKO7Wzl6c4zJKOTfMu8ssfCmbyj/uwSyQN4XOZwAnRJonqCKwkCyPtdrgIqu bmoRIzXYu/j+YBZWWTe/YsEuaBmrBf+fgtvfO6YmSo4ztlm06Dwr7w+LGnPU5nko63MY nHrA== 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 :subject:user-agent:references:in-reply-to:message-id:date:cc:to :from:dkim-signature; bh=X+VdyBkwWBj+A8nZ9fuV2ga0Yg8bfWjeExs0duLp7AE=; b=HTi9C/uVfNF2D7jZbdV5NVxKuPSTLSZ6mW32D7YfGcIw6U64A1FTtOhHErt7EeS0bm WMvQoAv6JLs6z8ln9WHWNvKK+L/Lu3OkKibNYdC83zHewPSXXTASI25AANqTclAWAhA7 3ywUe3S6bO07yOFERD+vGp2AAYiSP1/yowSGJrmqkxC8/80X1BRJ/hy2/44mRCcRNKNr lNBMrR9qwEM+goyh2NdwEIwY1ddM2q3zqoZSJrk2AETWH6Y1fgTNIY+TIMpD/4NlsAu9 T65Mn8fTMxPeyaH7rSnZh4lJS2lBUIgOl9obuONqPGdswkF+3wwI7TjyuylDc6aJ1ElJ Y9yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=CxTTI0De; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si837992pjr.109.2019.06.06.22.26.17; Thu, 06 Jun 2019 22:26:34 -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=@broadcom.com header.s=google header.b=CxTTI0De; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726609AbfFGFMt (ORCPT + 99 others); Fri, 7 Jun 2019 01:12:49 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:38184 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbfFGFMt (ORCPT ); Fri, 7 Jun 2019 01:12:49 -0400 Received: by mail-ed1-f65.google.com with SMTP id g13so1142803edu.5 for ; Thu, 06 Jun 2019 22:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:date:message-id:in-reply-to:references:user-agent :subject:mime-version:content-transfer-encoding; bh=X+VdyBkwWBj+A8nZ9fuV2ga0Yg8bfWjeExs0duLp7AE=; b=CxTTI0DeptWFatbDZ0NKQsZsgCfYyHcMdaLCUqWl6S/Dn4R30qrCY9CJMCDiu7VBH/ rAFskPH7JRikj2/iwuLfUpyyppc2bj8wLBxLui+oJ0FA3tRDVdWE+Z97A5pqBRz5fyAz E0NCsVFieCa7eiCBQh5lu4RhZCi2GE3zgGOg0= 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:date:message-id:in-reply-to :references:user-agent:subject:mime-version :content-transfer-encoding; bh=X+VdyBkwWBj+A8nZ9fuV2ga0Yg8bfWjeExs0duLp7AE=; b=eXk8W1TffiR4CrkTVnPL0oK/V4PNxK19I36lZ8wkXEDTrEDamapGVDhqEz0uaZT3Af iPGyFn4Vq4QnPL+RkJhzT0hkt9qiKc4EY7AC2ieL3w2I422kYlqraBhmFZxzUm7sLd5R aPGXl5lZdZ+dotN7t7AFtC7qJ5udR8vxM3E2kiRJP0y/P9mzu1Q+rwQrcZPjttwUeclW 7Mv2A5vg5VJvTArDeDf1l1R0USppdmQpf293/+5YVXAb09gb23iXXJ99TZFcBjPhP6wn t37HRK17SOjfcFENOBLo+EajDd3kiqF9q29M0RYhA+TSAzdZvIuIk4uQADWt1fHYue5P FLZQ== X-Gm-Message-State: APjAAAW0+H8FYiEhmPApQE5x0X6NIjX8N5nnHqVdokInL1Dzz97ORzVT o1HxlyjcWgS4cFmqyEbNU7L4xA== X-Received: by 2002:a17:906:1cc6:: with SMTP id i6mr34091753ejh.100.1559884367150; Thu, 06 Jun 2019 22:12:47 -0700 (PDT) Received: from [192.168.178.17] (f140230.upc-f.chello.nl. [80.56.140.230]) by smtp.gmail.com with ESMTPSA id 93sm234704edk.84.2019.06.06.22.12.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Jun 2019 22:12:46 -0700 (PDT) From: Arend Van Spriel To: Doug Anderson , Adrian Hunter CC: Ulf Hansson , Kalle Valo , , "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 Date: Fri, 07 Jun 2019 07:12:42 +0200 Message-ID: <16b305a7110.2764.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> In-Reply-To: References: <20190603183740.239031-1-dianders@chromium.org> <20190603183740.239031-4-dianders@chromium.org> <42fc30b1-adab-7fa8-104c-cbb7855f2032@intel.com> User-Agent: AquaMail/1.20.0-1451 (build: 102000001) Subject: Re: [PATCH v2 3/3] brcmfmac: sdio: Disable auto-tuning around commands expected to fail MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. So I want to disable device sleep and trigger retuning through debugfs or some other hack. Regards, Arend