Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3790289pxb; Mon, 4 Oct 2021 09:38:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0RB9VrDgRlfpm/23BUbtrBu9BX901theHIwKLyUhqm/Xg/NkPiAsH7SZZW+tfH4ZA2lHR X-Received: by 2002:a50:e0c3:: with SMTP id j3mr19389737edl.97.1633365536128; Mon, 04 Oct 2021 09:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633365536; cv=none; d=google.com; s=arc-20160816; b=aSMOthoGJXqIM4LX2nEP8W41B3SNMyJnYUWtCc3SFmyP0fLVW6Z0ovtZwtdSlWPr8I z2uyb5HEXTRsIrNOnmlWJRcMgwiY8ifuCbD1oPm6E9HfsRj0UIQPgQaFSqa3QlgTExV5 Nf6qgGYCwXG+iDZO8C7tOZ39W1eesVDvmTSxCFr4qFKRSkYdirUJp/FbXijJeGCuq5GR 3whrjxvad0C+uFIQ8PHPBglboav5xct30MdfZZuBC4K6lqCugbVYvvggun8qgS7NXrXb xg31ruKIHy1npIm8fM816eDEbW3i189Sp4UaLUapszEAeIGqwLlqNVo8PSmui6cfIsts 0Lbw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dJ0AuCMfsazJotCiK/x60vWEKBFZ6dsLHfui7DXLrs4=; b=T1oVrdz5FMRebsk6lPdWUhqFggpRByyuKJ6D1Qx6MDxK+v4shk3hqsVlUNmBqBZDIe fVX4kuYWRtaRXgEqaWN6c/4luRQEbpfioZtp1v2tLGDLegDtLMz1k/KoFL4voTs/InRn X5pdZxGpWfHOMafdiEGSm2RNFQhxaNXl3RsK46VmL5gEEl+zDx1Bzqa2IYhUkLfI3LYh 923VX1AACDKR3ObHe2m9iXvJr75b/atU7jZ40zwlS2XZoljtKR/PZAdgkNOHeh1RhSrD 4yZFCj+mU+CSAeu27oYQxGXWbDUSv1dml7IHn1pnBQn/JylMZmnn+kYDcGT5rIbyTnZ3 HgOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FiOsdRbW; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si312579eju.533.2021.10.04.09.38.29; Mon, 04 Oct 2021 09:38:56 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=FiOsdRbW; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238146AbhJDNhH (ORCPT + 99 others); Mon, 4 Oct 2021 09:37:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:47290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237389AbhJDNfP (ORCPT ); Mon, 4 Oct 2021 09:35:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CD8E163230; Mon, 4 Oct 2021 13:15:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353351; bh=qUyqRiL9D71CgTgOkxHhi3E5zzNyTsMJqzAA+/VsS7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FiOsdRbW+4ifxp/X3GZ6VHKu04cWfHQCULYBgP5zfjq6Q/Iddu8w8xGDqgAPXq+uU 9WPV54NCel7BmnZoR6FV85qtptlCcrF5lmdOgTXy08qw14clu8ccY84D89fDPxFlqn PLKGc9+MpFuq2wgBDj3SzsEfIkL3BA4T7mzBJEYI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wolfram Sang , Geert Uytterhoeven , Ulf Hansson Subject: [PATCH 5.14 062/172] mmc: renesas_sdhi: fix regression with hard reset on old SDHIs Date: Mon, 4 Oct 2021 14:51:52 +0200 Message-Id: <20211004125046.994170864@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wolfram Sang commit b81bede4d138ce62f7342e27bf55ac93c8071818 upstream. Old SDHI instances have a default value for the reset register which keeps it in reset state by default. So, when applying a hard reset we need to manually leave the soft reset state as well. Later SDHI instances have a different default value, the one we write manually now. Fixes: b4d86f37eacb ("mmc: renesas_sdhi: do hard reset if possible") Signed-off-by: Wolfram Sang Tested-by: Geert Uytterhoeven Reported-by: Geert Uytterhoeven Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210826082107.47299-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/renesas_sdhi_core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -582,6 +582,8 @@ static void renesas_sdhi_reset(struct tm /* Unknown why but without polling reset status, it will hang */ read_poll_timeout(reset_control_status, ret, ret == 0, 1, 100, false, priv->rstc); + /* At least SDHI_VER_GEN2_SDR50 needs manual release of reset */ + sd_ctrl_write16(host, CTL_RESET_SD, 0x0001); priv->needs_adjust_hs400 = false; renesas_sdhi_set_clock(host, host->clk_cache); } else if (priv->scc_ctl) {