Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3406216rwa; Tue, 23 Aug 2022 04:21:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR5r+UND/IXAuB0E8DFDV1nep6NrIW2O3KhXECGCvJqz8PTR8Ne00wvyJ/ikWvdEKqAiSI9j X-Received: by 2002:a17:90b:1e12:b0:1fb:6df6:b45d with SMTP id pg18-20020a17090b1e1200b001fb6df6b45dmr1210853pjb.63.1661253715332; Tue, 23 Aug 2022 04:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253715; cv=none; d=google.com; s=arc-20160816; b=pOWTsJwPeMssbrgfDt2N6VPOlyR4T1mVwQGnn7Pb6l2h22/jUwTYicEpIKCsdApAGw J/CceGxiPGVpngceqkm6jHSOxTbQkg8Bq6kyDwQf6w6lB8NaJjikrYkUmWEnJtJ9s7ur dVYag7Vgmkuu0i2NetKNj7o+faLJ5i5qlqjC9ga+ZoC4Ot6SJhastWiUsQ0tsG4Tdl+o Dmy4hLg/Qil13V5xMJiefPIK4DW6+M4nMzyxP6D6TrEHedtpsQTSJtncjpVBwu0GQXOC JaAP+CHG54FsiC7D9uoC20MCgRMRwHdx1AElzsN7DSNZ4E5hSu3bBGwB6uKjs7vO5SHQ oEXA== 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=Gt6Yd5c8f/lbu9mdYe6zk7gb1xleeo2kr4EfE+vO42g=; b=hhVQNskFP8VPFuI51GqlWH18S+rAvFpPVl5/fiEZYa8UkcNCSWporFYtmuIaHFEN2f H9jqx6OPYn3Gu5PIwfnuQ7mzFwUDyiB1daShorxHwr9QXqU9zy1yUEHCvb1viMqP5Mla /z5+NtIfG9v6S+8u0xYNG4dN3JoPUD9cHzssWAG6ShPLBA4AsGwMbIAxokXgHUfJa/Fm ZxJr6TwhZ/uU9MJ5zvTRIi/EMAHzFLJC1d4b2QmLyQ5ukax4fCMEncLP7Qo9hBTSHM3L 3ox3n/PN+bJiOMvbmtkvb3MVkHELKuOuTSdD2U/kXRgfMoRZItuYpVSPWLbe6hjw68I1 +/Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tNGxalzq; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i128-20020a625486000000b00535dfe411cfsi10408314pfb.189.2022.08.23.04.21.44; Tue, 23 Aug 2022 04:21:55 -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=@linuxfoundation.org header.s=korg header.b=tNGxalzq; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348937AbiHWJRR (ORCPT + 99 others); Tue, 23 Aug 2022 05:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349099AbiHWJOQ (ORCPT ); Tue, 23 Aug 2022 05:14:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F30186C2E; Tue, 23 Aug 2022 01:32:01 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5BE23614C5; Tue, 23 Aug 2022 08:31:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AAA7C433C1; Tue, 23 Aug 2022 08:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243505; bh=wvUJ88hrV5QL9tWRPmCuYWJ//YbsY8jZCc5Y1rHvmxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tNGxalzqUB7ASopjNxrQs/EkO/F01E5MlaGZQ8YavBMbVNPelC1J6aRYzzRBHA/xZ KX1+IPhYVvkqYDgBIE7iiMg8tYHOoi6UgsXMyfB/3Y5WYq8O/r4AoN4WipkhZwOfSr 0FN7ScaNm/tD6/mZ7in95PJyv5RdpqHo10REkkcU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.19 268/365] scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS Date: Tue, 23 Aug 2022 10:02:49 +0200 Message-Id: <20220823080129.392779806@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 8d91be0fd1a4..141fff01a662 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