From patchwork Sat Nov 9 10:30:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 179015 Delivered-To: patches@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp4014764ilf; Sat, 9 Nov 2019 02:30:56 -0800 (PST) X-Received: by 2002:a19:911c:: with SMTP id t28mr9286420lfd.84.1573295456537; Sat, 09 Nov 2019 02:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573295456; cv=none; d=google.com; s=arc-20160816; b=jiwBd+KVnJrcPZlX9wQbzv7/2tQ2Iz7xS4UGhjiI8vh8jsr8+k+OSlnt6gTHhfcauq Zuqe4mmfhdOnwIB5oxrNasAQVxTsfuFpcoIe4qRinsO2D6onb8Cd6WwFPRgC0JHY24EH uDS5QR19I+nBDpk5Ri3xomMF0eDLaDAOo4rjqvdhMWCX/UPp4SGXPlCkblEbl4zIzYbO DEbHB7/6TKwZrh7jg/XN9+YyfKLxocsTXNLiT4cBGlso3fgnYQ0qh9RH982lkm3pzfSC S+PoVtkI+JmZzHqMoxciZKEj44oi18QvmuCf0s4KoUmg/NujpfUYLgivwu2nlhgPvUBQ 6fDw== 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; bh=giXQo2xxDTnIsnD5g+rmFtpQvGPhSmjYXWzjIJmpNQE=; b=O31ngtEXBP1cAhdzy4SpgvMBujUYGwJEoLpfPGotDETcrFV4M8FbbdiAQ4N59qg6l5 4+soCqktsav4bGXsFK5bp77kyyPNwHUG4EU0BtlId2Al37YgkQaF4Xi+lBf8OH6Os8ws EassV4tSa/fntuAhAhwFyYjnfjPvPtjCG1ROw5ZoKvhPpoBh0ML3ruO10G2WSxJzjm/P uueSMNF0whTP3vFRyl+LQCWhkRdZgvbM6AcqenzBUByPbkxbKU8PaCbTNH20nPKL5uvq eMOErYKeRKVAQcSFe6HkkrCRknxVdiuOAqJfny9GYv/Gk3wmUG21+raLWSAYMt2EXWgV Vovw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HxXCyAb4; 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 u25sor2723922lfg.10.2019.11.09.02.30.56 for (Google Transport Security); Sat, 09 Nov 2019 02:30:56 -0800 (PST) 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=HxXCyAb4; 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=giXQo2xxDTnIsnD5g+rmFtpQvGPhSmjYXWzjIJmpNQE=; b=HxXCyAb4ByowVJPfX56XTHtLM4YkZP0pqMlRGsNsQCZAGPgSKUXyu4veTJEvTNMOxR TD5EDlvVqDv3D5roDQ2NH4ZP59nV+XH/UlwZ2ttMdp2zxz5o+X5vDTUbG+Iizg2HdHEF tLK5yzRpiBLmTkxvomQPh9mmYfh/VyHwBqC0RFWse5NSQLNPNPdqcChHhxrFY16EaAPg jaKvW7S+Ydy+sj5ro1juHSrT7IgQuCg2e19arZWp8viP1yRa3hXdlZNDIIoIklKagOP9 KFp+515CpIbGpXSf4aslSGHi9didLOO5v1lWd2Es2+LWGEIVlQe5etuIy45UNdp0e+wd g/Tw== 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=giXQo2xxDTnIsnD5g+rmFtpQvGPhSmjYXWzjIJmpNQE=; b=j//jth/xWB3F8QTHgOiNDwVvjB5bERR++FJrB7lKwAu7CWagVavdxvM3ZQtQNPFp76 cxpv2ggnkyTmNYx08FeV68PVyqXqFesg7OG4JONX9OuV9RhkKCjAESOUeMkRrN6fuAzg tSjffCT4/N0vcWXNY53zvklZo8XMOPRTehlm4kBoHz/5/AeRRmyBv26IRP/TEPl+0I6/ RrIZVtES1AsBbQx+WZ1v9r2hTCI7penwYoCfmgeiApC911qpqqiZC6+X0rG5MnmHxG3i isLWeoBqktIAem1IxX7wK3qAsnIY3kfhpegkUjw1BYj27ZrZ45r3DUHC75K1VKulDcI2 Ymrw== X-Gm-Message-State: APjAAAV2zVhN6lcOt39MNdcuog6H6+/YvoKUBjmO3SrXwh2aIHHLDiKk 41fnTvHWUN7EqVS2hYX7Qo1/gPP+ X-Google-Smtp-Source: APXvYqyX/UqZ3rhY81QQSQcYGqC1oNmY3h3hWkpLY9DIINrq+fNE8trFZ1avM4N5eH0qDYLmgowhIQ== X-Received: by 2002:a19:848a:: with SMTP id g132mr1272484lfd.62.1573295456040; Sat, 09 Nov 2019 02:30:56 -0800 (PST) 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 z3sm343927lji.36.2019.11.09.02.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Nov 2019 02:30:54 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson , Matthias Kaehlcke Cc: Kalle Valo , Tony Lindgren , Wen Gong , Erik Stromdahl , Eyal Reizer , linux-wireless@vger.kernel.org Subject: [PATCH v2 0/3] mmc: Fixup HW reset for SDIO cards Date: Sat, 9 Nov 2019 11:30:43 +0100 Message-Id: <20191109103046.26445-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 Changes in v2: - Add adaptations to the mwifiex driver. - Keep existing syncronous reset behaviour if the SDIO card has a single func driver. It has turned out that it's not a good idea to try to power cycle and to re-initialize the SDIO card, as currently done through mmc_hw_reset(). This because there may be multiple SDIO funcs attached to the same SDIO card and some of the others that didn't execute the call to mmc_hw_reset(), may then simply experience an undefined behaviour. The following patches in this series attempts to address this problem, by reworking the mmc_hw_reset() behaviour for SDIO and by adopting the Marvel mwifiex driver to these changes. Note that, I don't have the HW at hand so the the code has only compile tested. Test on HW is greatly appreciated! Ulf Hansson (3): mwifiex: Re-work support for SDIO HW reset mmc: core: Drop check for mmc_card_is_removable() in mmc_rescan() mmc: core: Re-work HW reset for SDIO cards drivers/mmc/core/core.c | 12 +++----- drivers/mmc/core/core.h | 2 ++ drivers/mmc/core/sdio.c | 28 ++++++++++++++++- drivers/mmc/core/sdio_bus.c | 9 +++++- drivers/net/wireless/marvell/mwifiex/main.c | 6 +++- drivers/net/wireless/marvell/mwifiex/main.h | 1 + drivers/net/wireless/marvell/mwifiex/sdio.c | 33 ++++++++++++++------- include/linux/mmc/card.h | 1 + 8 files changed, 70 insertions(+), 22 deletions(-) -- 2.17.1 Tested-by: Douglas Anderson