Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp891442ybi; Fri, 14 Jun 2019 05:12:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzeg5EHK+lQs1Rd9+KA/oUFURWvWiMCqFpVp+fc3wHGeWc4N0TJ/9dhIzZUgKGbXNwNsOW+ X-Received: by 2002:a17:90a:20a2:: with SMTP id f31mr8881986pjg.90.1560514340940; Fri, 14 Jun 2019 05:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560514340; cv=none; d=google.com; s=arc-20160816; b=NJTS2UYZCKIGB1RBd5eiMX1xvDixnS676TyTi0GqxJ/nnx5MKaowAtn/0GgFdYUnaY lhNXuFd5+JuRszGYgiiQhSWkDjtdx+ZnuXkSGjCDdcQSyDjAAKi5wvnnQuuBdk0oKxxD J/jyV5rHZ6YkWfVy+t6HZLtkI2g+zuDzP8cm6zGiyZ8tgmRachebKXhTz/Mq8qFxsVwe qAeOcXy3ptzgob3YRjzmrDvCW8DeovrqsWWdlV835lqWi+nllByApLbNLcAxMlBlOf7w l99Ws6mkQqXCdkQwnW5nUP59EkDAm3Qr2vMJBUgUq1l/BDzYRgfaLzb/HTgSO/paYmdZ azrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=F5D+HakwAE2WgxfHyzl83ZwTB437sX3wIDlJ8qrfryI=; b=dBdDg6tythkIS/wRO7Pu1yoi06SLIEehCArz1XN5gxFNvwWSF5pX0yM/HkG2ftAeVt pFGyYMg471Oa//nog4C+hvoYpqXTT7Kim5KtA0HqfeNFjlreV8KVhkAXryqGS0tPQQvW PW3Halo8S0Qsy/yYtdzV9izZEw8um/GxqSkharzTKcT1pSKrGSzMNyGLQ0dl4CA5JmUA Xn9KZFNvHcubBsUnu4ndlZEvmO2MWi5nUxR1EMyhTcU2xF4VeoA6Z8oe1+GPd6P4sqmN QCUK+p53Ce6fOxLmouGg6LfLc14h5BgCmxG4Gvw2bKPODZhjHJfuVsIfn+hIKTfY3stE fjFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="igk9dt/v"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y84si2373027pfc.33.2019.06.14.05.12.03; Fri, 14 Jun 2019 05:12:20 -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=@linaro.org header.s=google header.b="igk9dt/v"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbfFNMKY (ORCPT + 99 others); Fri, 14 Jun 2019 08:10:24 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:35697 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727217AbfFNMKX (ORCPT ); Fri, 14 Jun 2019 08:10:23 -0400 Received: by mail-vs1-f65.google.com with SMTP id u124so1618108vsu.2 for ; Fri, 14 Jun 2019 05:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F5D+HakwAE2WgxfHyzl83ZwTB437sX3wIDlJ8qrfryI=; b=igk9dt/vAQdzxT8QzdZI/Ievysa9xK3WPDJK4vcC3mDYTCNmuMk9blJgU6OL9Yc0dK Tio9BFMzxl///10xMQOIVDRbhF/nM/Hlu2UzObSKzWbdltAQYn565CyrftqwwoLEd33B Cr7ROv4Q0dHUiigBi2fHNGkoZUZUg1UIePaijaE5FoQNP4Rj7BRVnnrvi3b8R3WX/hJu CM8fh8LGVg8luPx2wjcpony8vE0jjzt/t5njqGuSo/mVk/E4Zw+RG33ExdPs2KeVtCjq cOiCldbH6KD71Pzci41unZHGuT1+Ngh7l43T59JmGfcQNXWayyQYrKADlRuNeU7nV5CB 2Apg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F5D+HakwAE2WgxfHyzl83ZwTB437sX3wIDlJ8qrfryI=; b=hH3bqRhOP0hzZ0FiD/QDMgcnBzukCDn6CdT6HCVkTEbQi+CptGkOVe16+u1BKPZDe2 7yw3NJHY+dDokRqv+fsrdeh+dQAAskwDqqyrrcVbjvkxyjzQVSPx567M3z4kwbBEXJiv 0sPIvzbCgPQaycmlE67O17SLpSQK37WTy2w1NphiSwhisiGWWK2OERQdOo9dLBAbwCKk tHgnd/LrWaPMO54YIHWNrit0GyfEedSk+Fps6qOhrHARFJDvn5fO4T3svGMX/9VAJGEl /cf67BKY1V3dytpYxxNbLyeqOwJ6aR28A3DRvmO31/FOq1hmIRvIDq2r9PcoBPgDSlFt ubZg== X-Gm-Message-State: APjAAAXd+cKsscFSkjRCGSJUkqkWmZyW+KXDnAG3hJjRl+CUY07iMt33 tEzztebTint4sKh5dk94q3rekGnSYoZ/W1McB5UC5A== X-Received: by 2002:a67:ed8b:: with SMTP id d11mr52752594vsp.35.1560514222446; Fri, 14 Jun 2019 05:10:22 -0700 (PDT) MIME-Version: 1.0 References: <20190613234153.59309-1-dianders@chromium.org> <20190613234153.59309-5-dianders@chromium.org> In-Reply-To: <20190613234153.59309-5-dianders@chromium.org> From: Ulf Hansson Date: Fri, 14 Jun 2019 14:09:45 +0200 Message-ID: Subject: Re: [PATCH v4 4/5] mmc: core: Add sdio_retune_hold_now() and sdio_retune_release() To: Douglas Anderson Cc: Kalle Valo , Adrian Hunter , Arend van Spriel , 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@vger.kernel.org, brcm80211-dev-list@cypress.com, "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , Thomas Gleixner , Greg Kroah-Hartman , Avri Altman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Jun 2019 at 01:42, Douglas Anderson wrote: > > We want SDIO drivers to be able to temporarily stop retuning when the > driver knows that the SDIO card is not in a state where retuning will > work (maybe because the card is asleep). We'll move the relevant > functions to a place where drivers can call them. > > Signed-off-by: Douglas Anderson This looks good to me. BTW, seems like this series is best funneled via my mmc tree, no? In such case, I need acks for the brcmfmac driver patches. Kind regards Uffe > --- > > Changes in v4: > - Moved retune hold/release to SDIO API (Adrian). > > Changes in v3: > - ("mmc: core: Export mmc_retune_hold_now() mmc_retune_release()") new for v3. > > Changes in v2: None > > drivers/mmc/core/sdio_io.c | 40 +++++++++++++++++++++++++++++++++++ > include/linux/mmc/sdio_func.h | 3 +++ > 2 files changed, 43 insertions(+) > > diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c > index f822a9630b0e..1b6fe737bd72 100644 > --- a/drivers/mmc/core/sdio_io.c > +++ b/drivers/mmc/core/sdio_io.c > @@ -15,6 +15,7 @@ > #include "sdio_ops.h" > #include "core.h" > #include "card.h" > +#include "host.h" > > /** > * sdio_claim_host - exclusively claim a bus for a certain SDIO function > @@ -770,3 +771,42 @@ void sdio_retune_crc_enable(struct sdio_func *func) > func->card->host->retune_crc_disable = false; > } > EXPORT_SYMBOL_GPL(sdio_retune_crc_enable); > + > +/** > + * sdio_retune_hold_now - start deferring retuning requests till release > + * @func: SDIO function attached to host > + * > + * This function can be called if it's currently a bad time to do > + * a retune of the SDIO card. Retune requests made during this time > + * will be held and we'll actually do the retune sometime after the > + * release. > + * > + * This function could be useful if an SDIO card is in a power state > + * where it can respond to a small subset of commands that doesn't > + * include the retuning command. Care should be taken when using > + * this function since (presumably) the retuning request we might be > + * deferring was made for a good reason. > + * > + * This function should be called while the host is claimed. > + */ > +void sdio_retune_hold_now(struct sdio_func *func) > +{ > + mmc_retune_hold_now(func->card->host); > +} > +EXPORT_SYMBOL_GPL(sdio_retune_hold_now); > + > +/** > + * sdio_retune_release - signal that it's OK to retune now > + * @func: SDIO function attached to host > + * > + * This is the complement to sdio_retune_hold_now(). Calling this > + * function won't make a retune happen right away but will allow > + * them to be scheduled normally. > + * > + * This function should be called while the host is claimed. > + */ > +void sdio_retune_release(struct sdio_func *func) > +{ > + mmc_retune_release(func->card->host); > +} > +EXPORT_SYMBOL_GPL(sdio_retune_release); > diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h > index 4820e6d09dac..5a177f7a83c3 100644 > --- a/include/linux/mmc/sdio_func.h > +++ b/include/linux/mmc/sdio_func.h > @@ -170,4 +170,7 @@ extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags); > extern void sdio_retune_crc_disable(struct sdio_func *func); > extern void sdio_retune_crc_enable(struct sdio_func *func); > > +extern void sdio_retune_hold_now(struct sdio_func *func); > +extern void sdio_retune_release(struct sdio_func *func); > + > #endif /* LINUX_MMC_SDIO_FUNC_H */ > -- > 2.22.0.rc2.383.gf4fbbf30c2-goog >