From patchwork Thu Apr 5 20:19:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 132886 Delivered-To: patches@linaro.org Received: by 10.46.84.29 with SMTP id i29csp6712491ljb; Thu, 5 Apr 2018 13:20:08 -0700 (PDT) X-Received: by 10.46.157.22 with SMTP id t22mr9176941lji.107.1522959608821; Thu, 05 Apr 2018 13:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522959608; cv=none; d=google.com; s=arc-20160816; b=VFTOW5Dot9dN5KhQpyceyMDe0sQKKgXQPksrIFPRdV+V0hndWpy0UJyCvjdRopxLpQ nEj/8pM49vK7DWe56aFEGZmsA+ZEBWhm+wGzz3CNGdswvuT51jgF1K1MdEZsEj3iKquS N/CQZKdsuPkIz/T2i4qfhsRlIxQhLSneIfhbDPLTPfndgl+1eiz4Uhpud06N2oA9urB9 Wa/8bRmFCODsJdw8O4jInS3Yjbu3S3aGtwr8BLSjhysUKLqnggfqnijPdZNPlmr4SeET 9Y9Gqb968i5YRLljSW6gRC5ANKt3yLf1XjkFj44o4qMnRhyWl6QoP5M1tDyTYtwCAvwQ 2/Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=tqU8lXleUmQ0svZb+PAvIvVDXKqGVCNRKYFt/sChqw0=; b=OzyuSOx4vbTVk0aNzuJxPSO3cyK7lxAR7SWuycPXuPDXnjzoLrWaTgAwwArDoQSdgq Gg2iW2xZ48oqsCEMSr+aqTQYJcc/ENWYV7gBlXJ00h90EFNfcjCs4ddRTiqTuVXgijc+ 8uJFYq8Zb1f0ZKH1tfYZ3fgmzQ61QreYG0zIIoSDpYGjc23sJjak/2xOeAJukHYZuNfb deWjW65dvcaSeEFI/mfX8sH4pkW2Mu5UsBRPfbtutcihNteTKNgeOST4LMcBhPCtjYcA 2naCYpCcTeIyFR+i4O6sP8FmvKijICM1xTk4zyQfNmT4ib8Z3IVo+xYWlK34bFJg7hXl IPuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jaU8nuUr; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d8sor2167163ljj.89.2018.04.05.13.20.08 for (Google Transport Security); Thu, 05 Apr 2018 13:20:08 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jaU8nuUr; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=tqU8lXleUmQ0svZb+PAvIvVDXKqGVCNRKYFt/sChqw0=; b=jaU8nuUrmxegcc54TM8gM2/nz9P2STzTe2KTPuLCW2tVjGEkblu5QNy7qv4lYdQ74b zOYrWE7P7JApIBh7feodG0qLi5ymW/HgW4Eo9Upo9KPNJdLl1Gd6+AH6MBFlrg2Qwsw+ /+pY30KHUP8Dohhd9DM9erOKcGk9EzFs5e4gk= 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; bh=tqU8lXleUmQ0svZb+PAvIvVDXKqGVCNRKYFt/sChqw0=; b=FJ8YPBFKw3Xa89GK+dOSDMrBfIhKCTKgoql+RAIdtaia0zFZyk306P10dBQEldxf1G yvUhkCmUuqp5/Df4roMZbogTrFzQFCMnHHbFLEeAtGEbOTY08S0BuZkQKTR4fY61f+m6 807cslXnilLGjmao1Cf4fOJvjMeo+08gygZsKhr3QpQXESRW+VKUbLPbjVZx7ebObSle Gj+skoBJFXqo+FYbDd3SBfu/vo7hrSl/vJ0WFofpJS18xkT6rATvTNTd0o5IKPV8gD8y xIAN4+6nswAoKWodJO5Ehx/wd+y5qxOI6gSdVnbKlRa3kdwiVOxI/4Pfr6Ij92fcAcRj KVWA== X-Gm-Message-State: ALQs6tCkc/Bi5uj5Uwt3QQdVUpQmBll0Z7QfFwpK7SwviTB2COULcfwk lXtfBHdNrJe9522YnLQfVfBqqKMo X-Google-Smtp-Source: AIpwx49AlxCxknNL9eh1uWJy4MFR1DNgJ4cgsfy3MXfapcytmPkn8Xutx7in9UEfOMRdNRyEGDepeg== X-Received: by 10.46.56.6 with SMTP id f6mr15285569lja.4.1522959608566; Thu, 05 Apr 2018 13:20:08 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id h66-v6sm1687533lfi.89.2018.04.05.13.20.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Apr 2018 13:20:07 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Adrian Hunter , Brian Norris , Shawn Lin , Doug Anderson , Hans de Goede , Quentin Schulz Subject: [PATCH 0/5] mmc: sdio: Enable SW reset of SDIO cards Date: Thu, 5 Apr 2018 22:19:49 +0200 Message-Id: <1522959594-3411-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 It's rather common that SDIO func devices becomes loaded with a new firmware as a part of the SDIO func driver being probed. However, in some special scenarios the SDIO func device needs a SW reset, as to start running the new firmware. More importantly, a full power cycle doesn't work, as that would reset also the firmware, thus the existing mmc_hw_reset() API can't be used to deal with these scenarios. Therefore this series suggest to add a new API, mmc_sw_reset(), which resets and re-initialize the SDIO card. A couple of the patches in the series are mostly re-factorings making generic improvements to the related code. For more background to this series, feel free to digest the discussions from the submitted patch: https://patchwork.kernel.org/patch/9857175/ It should be noted, at this point this series has only be compile tested. Help with tests and deployment of using the new API is greatly appreciated. Kind regards Ulf Hansson Ulf Hansson (5): mmc: core: Re-factor some code for SDIO re-initialization mmc: core: Rename ->reset() bus ops to ->hw_reset() mmc: core: Export a function mmc_sw_reset() to allow soft reset of cards mmc: core: Share internal function to set initial signal voltage mmc: core: Implement ->sw_reset bus ops for SDIO drivers/mmc/core/core.c | 49 +++++++++++++++++++++++++++++++++--------- drivers/mmc/core/core.h | 4 +++- drivers/mmc/core/mmc.c | 4 ++-- drivers/mmc/core/sd.c | 4 ++-- drivers/mmc/core/sdio.c | 56 +++++++++++++++++++++++++++++------------------- include/linux/mmc/core.h | 1 + 6 files changed, 81 insertions(+), 37 deletions(-) -- 2.7.4 Tested-by: Quentin Schulz Reviewed-by: Shawn Lin