From patchwork Wed Oct 9 11:21:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 13828243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9DF0DCEDD88 for ; Wed, 9 Oct 2024 11:58:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0G5+DGHRH9uKXySVvDG2zjq1MsEuwXbycCIn4qhJYMw=; b=cdwh1IUuv1tckt9D08mq9qrt1w DELw2mEy6gPsqjvorg8EUIbNDku91nuhlaQcZUtI5xhh4xh9djJj+zsqIxXZpYv9JsTz/9nruQh0o wCSnJ7cnKFrl6r1mAVSXV4QanOjWevpPgOXI9Psgfi/+F+C8u+5B8ol8RVCRpQN9QiweoQL7g7gLi BW2kiWm6lC1yUCy3Cx10+75VBejYGik9LZndv2uSs5RUc2t+7kTkfTZnLr0OT1qzselonGSOIB5+1 qIe5/kJFPh0ZwOtWZj99l1qo5j6js29DOZjeElbSQ2biWeXIwJ3+5zGunypQUHYwNSXRezdB/AcaR EURwHHng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syVK8-000000097VN-35aP; Wed, 09 Oct 2024 11:57:48 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syUlO-000000092To-49Ja for linux-arm-kernel@lists.infradead.org; Wed, 09 Oct 2024 11:21:56 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-42ca4e0299eso59920335e9.2 for ; Wed, 09 Oct 2024 04:21:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728472913; x=1729077713; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0G5+DGHRH9uKXySVvDG2zjq1MsEuwXbycCIn4qhJYMw=; b=cJ9L5KzBtNuSIF4Vxx1154yjiZ2oD72pvK5Nt0ok/gsuGYNDM6MrVx7+3aWT4Sg0Og PN5af+bpmATZdQuH7miIocsOxgj6kCtN2qV06/zyYnIeUWEayKPWX37HGcGQ/dVSFn5H kItm6FFhwG+7d8bDtStlmgI546q7iqLa4/MXhV8d+7ObHFuGj0MR6hu/ovlNZErrEbUG G1Yc8+jUbojrzARlagndGTEtbFMG64CN1HGC3FkbWVlmSGvkj+G0m4Rnt530Cbqjz85V thpyWlJJUKXmvML42v+1Wyzdi6H1nPfwTKqQnYTsjbPocqSyoGU4aM/4wt6dK+yudm0C axsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728472913; x=1729077713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0G5+DGHRH9uKXySVvDG2zjq1MsEuwXbycCIn4qhJYMw=; b=g8FDYZpEhuzYHnhyocK9oBt8yh/B1+wcD2R9I2iDUx+yDD+VSp74MVaAmsLTfCoVWl O6PuMtpZENb4VlRHTPPcQwqSsT9MoYeZaHsU51uv3OSwnSa/Lj9Y37iP0kfVMuLiGpSg Nb4aI8JkGCouiIeAxktlKSYGJpuLRaK4DKW5h1kGwMyMha5oINGlVQyLRyQK1mQgiTxM o7iCgsiG5HDpMpprvd8/XuenD278hEaLZy7SGMVM9t359J/DOD8Xl59xiw/rolFGJ5YS q6iOxjhaH6aSdFq9n/JfZ+9+Hr+y8JPJXISC7YYL8aldzqbhLbhL5VOPXdPa/UpjC57i XJYw== X-Forwarded-Encrypted: i=1; AJvYcCXFkHAXcuvQQpqTX2chGJe1C+MHR+8fOOQTEefI4QrJMJAFvb15WWv7HZIgzM4sMMMXAikRfiXU5ZJUGT0Eqx1F@lists.infradead.org X-Gm-Message-State: AOJu0YwoR+aOUjeImNBBllszHQ2+1u9r6D9+JeIl636ht+pzTgnbG1fX +cUUbMjE2evz2IYlhe7kRkcT8p1rfmeFNhDI5r8WHGapc6nSZ1oK/sJdSnw0oPY= X-Google-Smtp-Source: AGHT+IGDUkReqvpDILvzLlsGK2Z3Cg76lYE/cf1NIlvq1mdgxLrmdCkneJKzCCHIFSebONF2UDAWJQ== X-Received: by 2002:a05:600c:1ca7:b0:42c:de2f:da27 with SMTP id 5b1f17b1804b1-430ccf0859fmr13666665e9.2.1728472912789; Wed, 09 Oct 2024 04:21:52 -0700 (PDT) Received: from gpeter-l.lan ([145.224.65.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4310c3dcdcbsm12331445e9.0.2024.10.09.04.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 04:21:52 -0700 (PDT) From: Peter Griffin To: alim.akhtar@samsung.com, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, avri.altman@wdc.com, bvanassche@acm.org, krzk@kernel.org Cc: tudor.ambarus@linaro.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Griffin Subject: [PATCH 2/7] scsi: ufs: exynos: add check inside exynos_ufs_config_smu() Date: Wed, 9 Oct 2024 12:21:36 +0100 Message-ID: <20241009112141.1771087-3-peter.griffin@linaro.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog In-Reply-To: <20241009112141.1771087-1-peter.griffin@linaro.org> References: <20241009112141.1771087-1-peter.griffin@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241009_042155_053329_9083406E X-CRM114-Status: GOOD ( 13.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move the EXYNOS_UFS_OPT_UFSPR_SECURE check inside exynos_ufs_config_smu(). This way all call sites will benefit from the check. This fixes a bug currently in the exynos_ufs_resume() path on gs101 which will cause a serror. Fixes: d11e0a318df8 ("scsi: ufs: exynos: Add support for Tensor gs101 SoC") Signed-off-by: Peter Griffin --- drivers/ufs/host/ufs-exynos.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index e25de4b86ac0..939d08bce545 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -724,6 +724,9 @@ static void exynos_ufs_config_smu(struct exynos_ufs *ufs) { u32 reg, val; + if (ufs->opts & EXYNOS_UFS_OPT_UFSPR_SECURE) + return; + exynos_ufs_disable_auto_ctrl_hcc_save(ufs, &val); /* make encryption disabled by default */ @@ -1457,8 +1460,8 @@ static int exynos_ufs_init(struct ufs_hba *hba) if (ret) goto out; exynos_ufs_specify_phy_time_attr(ufs); - if (!(ufs->opts & EXYNOS_UFS_OPT_UFSPR_SECURE)) - exynos_ufs_config_smu(ufs); + + exynos_ufs_config_smu(ufs); hba->host->dma_alignment = DATA_UNIT_SIZE - 1; return 0;