Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1645788rwb; Sun, 14 Aug 2022 08:38:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR6SRUrdeQgNQy1xNFBwWROyOWGmYgz8Mca7eMLF9S3IJjEcg9HNLfd8jP97qIUfFTAc/YjF X-Received: by 2002:a17:907:7d8c:b0:731:65f6:1f28 with SMTP id oz12-20020a1709077d8c00b0073165f61f28mr7697775ejc.91.1660491489542; Sun, 14 Aug 2022 08:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660491489; cv=none; d=google.com; s=arc-20160816; b=E6oxyANtqi3+Q62bPZnWiqRQ6flS5i+R71coWyIod5lw48taBVpkN5PS9fxseli+Kb b5RxDVURq2W5xy+qkUbKjZuyI5OTI8drJ5bMXafGClOpmrC5f5UTklY1mehYfaO0y7hD fl7xmYuvkhItEft+debZ+nAHFphEb4IInTn42ALk03fit1jrkr1hYa3PbbErJA3Yxmaz 5QSQZ/p9AdPHCmNrxeA/F8Z56HrhUCDaYNZIIR966ulft9GTSroIMZvqAll1VhiqtVbP Y9U8b6FoqzqVjEwO/iwccjG2LSEDj6aX6reX7Yy9WBTZNWDuQuAW2EVRQbtPgQEabDmH b6hg== 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=Nuu5JOtGHTq7XyxdnTIeNYIZN+CMzXmYm0FPjubZ9g8=; b=QtMo5PeANU1isaPfp/AQkrlUlxA/13AEn49P/5xlgRIgkzcaSMGf+yr+sN/6XEQ5bD MDkMXJ/EVpUb4KCdMKCTCPqeBKV1vTs7BKVHx/3sxYz1qA3mZW/UCbSHlBoqmBjwefrs tQ7fT0iB7J6iWrLkOR0wWJ7Xdfm5GbxxnDdoCuf2aV/ptgob8uyWNqxyI+eHwwmJQ8PL vP8e4uf/pwcTMzBjbDaWuAKcSVv7blXZ2SZtHrAptaYSruqMG2f48GiMu+biV6BMxytI WAXMOl3RGR1Sy6tzvYRVLH3BDUvUe2p9cGN/ILa5irB7G/42qwhXmczZTpv+Md04Q/3I L/cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a8LF9Tlu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s19-20020a50d493000000b0043dfb97250dsi6604223edi.599.2022.08.14.08.37.44; Sun, 14 Aug 2022 08:38:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a8LF9Tlu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S239624AbiHNP2f (ORCPT + 99 others); Sun, 14 Aug 2022 11:28:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240303AbiHNP2T (ORCPT ); Sun, 14 Aug 2022 11:28:19 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40823BE13; Sun, 14 Aug 2022 08:28:06 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id C12D3CE0B63; Sun, 14 Aug 2022 15:28:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9915C433C1; Sun, 14 Aug 2022 15:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660490881; bh=Rle9Qq4e/mlWETi+2POIqUErgB4QJ1aHPiH+DiXmeXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a8LF9Tlu7G8tat0HhtyYJnSAnuIvXuS0q6vU8p9YQOT1UpSKvNUUtxu2kg0/goEmK 67mdYuRK4kq1A+U0SiVlxX4F6/ihFX08TZArbltInXA4Inrmua5FFxKXHuXIdyfEZ3 vvJ0wo4qSM5fcQgjbjyAwZfPv3V826/DU95as7EW1gFJiSSZvN/4zSzZ5UwKAOOrmm Rrx7P1RNjgX8zDAzlgGATj19/CRL8olmjBe6RpAmB5DyIxwpx5QCWW6Haz2/LRF5pm vQzjsQD9tuTizRtooz1gaiqHfXEY3xBDK8/5zmQhZ+v0pBCxxvq4hb1Ad3rd5ollLT qnncEzy20wIWQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yoshihiro Shimoda , "Martin K . Petersen" , Sasha Levin , jejb@linux.ibm.com, bvanassche@acm.org, beanhuo@micron.com, avri.altman@wdc.com, adrian.hunter@intel.com, jjmin.jeong@samsung.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.19 13/64] scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS Date: Sun, 14 Aug 2022 11:23:46 -0400 Message-Id: <20220814152437.2374207-13-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220814152437.2374207-1-sashal@kernel.org> References: <20220814152437.2374207-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yoshihiro Shimoda [ Upstream commit 6554400d6f66b9494a0c0f07712ab0a9d307eb01 ] Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS for host controllers which do not support 64-bit addressing. Link: https://lore.kernel.org/r/20220603110524.1997825-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/ufs/core/ufshcd.c | 2 ++ include/ufs/ufshcd.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 3d367be71728..dc5f0dfc8c79 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -2227,6 +2227,8 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba) int err; hba->capabilities = ufshcd_readl(hba, REG_CONTROLLER_CAPABILITIES); + if (hba->quirks & UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS) + hba->capabilities &= ~MASK_64_ADDRESSING_SUPPORT; /* nutrs and nutmrs are 0 based values */ hba->nutrs = (hba->capabilities & MASK_TRANSFER_REQUESTS_SLOTS) + 1; diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index a92271421718..795c8951341d 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -577,6 +577,12 @@ enum ufshcd_quirks { * support physical host configuration. */ UFSHCD_QUIRK_SKIP_PH_CONFIGURATION = 1 << 16, + + /* + * This quirk needs to be enabled if the host controller has + * 64-bit addressing supported capability but it doesn't work. + */ + UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS = 1 << 17, }; enum ufshcd_caps { -- 2.35.1