Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3390936pxb; Mon, 17 Jan 2022 19:25:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrO5/Q51FDGJxh1cEidjg7fwUjJIX7nZudRhA0q09Apar/RCSqVIp/Nkuv5IqNdTTb0RN/ X-Received: by 2002:a17:90a:db0b:: with SMTP id g11mr37898812pjv.46.1642476246854; Mon, 17 Jan 2022 19:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642476246; cv=none; d=google.com; s=arc-20160816; b=CPmGJe1XbNpNxjxYv+NPd/+os573CXyOePxcPEDZ0+J44mBoXfLtMLVo7s9LXWxU3A 2jsLi9ZJQvR9fNxhkvPZ+BEylr0009kmiOE3j7HQVFzCDF2YGJRSq8Jvnqw+tLwOSmfG 67PNVvJylpnlp3gTcDTeya4lIEfrElEvrqeBw/T6qEPV9x3hmcukvIe2a1bEtz+Jrah/ rWIk5n1yLwO/C7Oypk//7LWIQ5Ugs1Ulbk0zb+KSMDAp5c7Ikvqvo31E/ECZuO4fL7Yh GXmLkQWrPamCGileJLq/Nv0uo9pPP5kgUSv1KvK4R6+wpszXYQQNUEjo1mkuVso5svgG zTFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6hTq3XecUKVfGMne62zsRKSF+oIFwfNB03Fc6JLJCQ0=; b=0T1nWMEHfXT6+ngnlPmKlxScFdDiJHMZeohsEtMwehKOStsBeLL9Z7cORsyjXXa5sm xNVqEIbqQXhOSQSRQhRa3b3ZVCKpl22bD2A9SSRbIt/lCDdnBhpMLvF/b/QHsVprSM3F SXqfL64c9xUxpa/fiHw57zGIJ/BZir8dGXuoidyf5K9CkN2sN7KldpJ7MhY1uWkb1poV 6P7Po0tvQkLedPhd/FKorYXCe/yItBQgZANy6//8OLmZrM5amYNivbyDU0ZujBrzWn9a lzWcTpkgpnRHT2Bcg1+GIOhk5cTpiwuo598IQe9m7Q+XhPdJjSytDgDV4eSJjVr25isn YPzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mGC8YnLd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si13791811plo.332.2022.01.17.19.23.54; Mon, 17 Jan 2022 19:24:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mGC8YnLd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345856AbiARCcH (ORCPT + 99 others); Mon, 17 Jan 2022 21:32:07 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:43884 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245275AbiARC0o (ORCPT ); Mon, 17 Jan 2022 21:26:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 95AB16114A; Tue, 18 Jan 2022 02:26:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF1F3C36AEF; Tue, 18 Jan 2022 02:26:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472802; bh=Ie4qdRRo3GQzYifj9cDxbYRfZvg5hjiq7dfpnsXoKsc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mGC8YnLd52t8iA9ndiDekE6nhqnGQKv//6UJxUQ13ew2LDYDFCy/nj9fjXbm0YcdG rRLEEAEvvJn0WTtm0DUWceFmg2YOuKOvwpa/G/kOaeUBcD2h+yY4VJ5P/AEeItBK9m v0jlzri69xecKzZV4sgROPKXGFLax60QwJUWAnOZCVXWkFwx0iePsUdZiyfkaWbdJT jLl7HvNmnNqaMP1xF+ZLJS9kcw6IqJgJNt1IaU3gG7WLGCF5LigxCXEqSiyYLYvRgJ cHLxsCMRnk437wCYAifh8R0it1rIE2oaTeybxt64Xny6Tdjl3QWrL6vGBi9Jhfbtvy fE2xXh5YGlh6A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ulf Hansson , "H . Nikolaus Schaller" , Sasha Levin , tiantao6@hisilicon.com, kwmad.kim@samsung.com, linus.walleij@linaro.org, huyue2@yulong.com, linux-mmc@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 138/217] mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO Date: Mon, 17 Jan 2022 21:18:21 -0500 Message-Id: <20220118021940.1942199-138-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ulf Hansson [ Upstream commit 8c3e5b74b9e2146f564905e50ca716591c76d4f1 ] The mmc core takes a specific path to support initializing of a non-standard SDIO card. This is triggered by looking for the card-quirk, MMC_QUIRK_NONSTD_SDIO. In mmc_sdio_init_card() this gets rather messy, as it causes the code to bail out earlier, compared to the usual path. This leads to that the OCR doesn't get saved properly in card->ocr. Fortunately, only omap_hsmmc has been using the MMC_QUIRK_NONSTD_SDIO and is dealing with the issue, by assigning a hardcoded value (0x80) to card->ocr from an ->init_card() ops. To make the behaviour consistent, let's instead rely on the core to save the OCR in card->ocr during initialization. Reported-by: H. Nikolaus Schaller Signed-off-by: Ulf Hansson Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/e7936cff7fc24d187ef2680d3b4edb0ade58f293.1636564631.git.hns@goldelico.com Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/core/sdio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 68edf7a615be5..5447c47157aa5 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -708,6 +708,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, if (host->ops->init_card) host->ops->init_card(host, card); + card->ocr = ocr_card; + /* * If the host and card support UHS-I mode request the card * to switch to 1.8V signaling level. No 1.8v signalling if @@ -820,7 +822,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, goto mismatch; } } - card->ocr = ocr_card; + mmc_fixup_device(card, sdio_fixup_methods); if (card->type == MMC_TYPE_SD_COMBO) { -- 2.34.1