Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp82698lqo; Wed, 15 May 2024 22:52:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVTV0D47l0WKGf1cosGhuM2zL08vb6p3ufZUVg+VT0tUKCEMcL93SCeyTiGQo/ISWy49gqpKa29zF1kCa/TqrJQwIm6R4zxPBi3tEtL5g== X-Google-Smtp-Source: AGHT+IG10gtxe9dgOVOZLahoKTd8sLGd4Q9l3AuQfEWlaN/A+MdErsu7FK8d4WcU4PzC9c9oZaR2 X-Received: by 2002:a05:6e02:1a01:b0:36a:254f:fbbc with SMTP id e9e14a558f8ab-36cc14e1c7fmr203152115ab.32.1715838740719; Wed, 15 May 2024 22:52:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715838740; cv=pass; d=google.com; s=arc-20160816; b=jtBcup7yX1jWopZXvxZz/psu3S9pu6kKV2BFmNJVcjySJ5uI4GVdigI44nMZNxcUVM XJz+zZpOxw7Q7zWo325a13qd/NZ/LzmJjhR3tXg+aGZ+FclQyulbqONLEVXjfRSbkI+x aPhLEXw4nqR0G/6NZMNDAzc1hmFlI8v84A+vpJxbnrVUpA3PK5t2CHgh22yFgkowsbJD klLTkZ9CHuYmrkXcthCzrA4CnLV0LyyOenD8G0cOhShT71Lh7VK8biDtsRkO6an/452w sQqybXrjpAjr/IX3UuPA6Zg2VooKdci1VMwLZk4ERw8VNkuoy0Z9OHBvbuxUU9FwPC3+ nd6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:wdcironportexception:ironport-sdr :dkim-signature; bh=lXn6IfWL9HZL/iXrwToL1z7Vuyc2tYfK8WIOp0TS0/Y=; fh=X0Lb6G6jJE8+QeYtFGxv2g5f8eI/IotqH0fFq08ifqY=; b=McbU4QPXBkyYVJ3sZBsmv3GJxLMVwICJqx1ok0fF8azleERwkAZ4raofgueVt3lc+z bu4H7BBofblVaDHFcyiiFUAU6hVIGRmlPaKEIYkeMTmOtA26JzAfJHRoZH9qR25ofvyd Qf4MJqP2S5rDanyjotL26bN88mL0de1xzyLESDtaKePe23avoKsemW1otJph9cFm6N78 2BYvIcHozQAnxjndwjyLRPZM3T1Z+P+RKXqbmBTh69obM1CaiCJ4tUVeqZJzXlp2MV8/ kom7vsnbSIRPp/ir8zZgjEBSgRIp6mIy4kutbW+9gJzkLlnPAz3Z6wzbhMTBU/O6aWG0 8gww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=ei8vkge8; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-180658-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180658-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6341404fa7dsi15740303a12.885.2024.05.15.22.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 22:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180658-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=ei8vkge8; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: domain of linux-kernel+bounces-180658-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180658-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 59697281554 for ; Thu, 16 May 2024 05:52:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBC502BAF7; Thu, 16 May 2024 05:51:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="ei8vkge8" Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6470929424; Thu, 16 May 2024 05:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715838710; cv=none; b=r9qDTjeGY3tZjiBeet5lA3flcpB+L/tVYctUDSdqMs3wyE3MO33dX7Auqdxj4ThLjvl1AFuChfZZOtWIS8XLkq//W17+/OrUBj6SgYpzAAtwb1fY5BjGvzYR0Bc3gpTZoPNewYIgCJvfuuFuYUyAijmWHPW7/B1T6pxZCWoZ2V4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715838710; c=relaxed/simple; bh=q71DnC9S45cHGSP7aHjDfuajgF1C8NzvZXMKmM3pLNg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SK7P9E6Km2tyQW53RGs3suu9+/rIgOXYwvC5fClZFphhqm1ib1pxvgo7KmSGqkA18i6KQF5Xh279itV7cjrrjeofGYqH8v6Xp1ZkGmZpMdTeCn5LxUUUcAOsLPC40We/70AwZJNcOxG6UqadjeFuyCnFrUsMI+Yo8cZ+w07uQQs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=ei8vkge8; arc=none smtp.client-ip=216.71.154.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1715838708; x=1747374708; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=q71DnC9S45cHGSP7aHjDfuajgF1C8NzvZXMKmM3pLNg=; b=ei8vkge88I0KR8jMXoZDPChNXMO+LXO0kcPfBvVTehY/rbu9k6TuTsyf iz7q9l/nISrUg6CmTtQwJ8FT7DeAy7Y6YuYkLhyGRByH9mtHrIJDb09h8 FkHQGy1uNx+7OtWwoIpbzFRmZD9YNLxKyilyBoTlflnTAkttUKgR2SRTA qxvGlu96TWgNfFZX64RVNbfQiOYAy0Cdjm8gbfcFCemZaDmj5dJCFjYmw jqLX/yXbb/eEI10kT6tzKNEfJK4DesipWLAnRGVywH50yIYXrVEDHMdMJ fGazgVFF7JQKG5e5COxGmd/tikt8rpWHNcu1LxUyboK9lCpP4AxhlNnvP w==; X-CSE-ConnectionGUID: oX3FVi/FTxqfMS2btVSf9w== X-CSE-MsgGUID: H6oDOhGLSG6k9rOikp+Avw== X-IronPort-AV: E=Sophos;i="6.08,163,1712592000"; d="scan'208";a="16457576" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 16 May 2024 13:51:46 +0800 IronPort-SDR: 664592b3_dI9ZHyBQ7K9/ptOZjIlTIbpM7BHPe08YCxd8kvRghQ2viud HoMp/vdoNfkoiWUG0XdYQZIUKXfwF5KlJaH67Jw== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 15 May 2024 21:59:31 -0700 WDCIronportException: Internal Received: from bxygm33.ad.shared ([10.45.31.229]) by uls-op-cesaip02.wdc.com with ESMTP; 15 May 2024 22:51:45 -0700 From: Avri Altman To: "Martin K . Petersen" Cc: Bart Van Assche , Bean Huo , Peter Wang , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Avri Altman Subject: [PATCH v4 2/3] scsi: ufs: Allow platform vendors to set rtt Date: Thu, 16 May 2024 08:51:23 +0300 Message-ID: <20240516055124.24490-3-avri.altman@wdc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240516055124.24490-1-avri.altman@wdc.com> References: <20240516055124.24490-1-avri.altman@wdc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Allow platform vendors to take precedence having their own rtt negotiation mechanism. This makes sense because the host controller's nortt characteristic may defer among vendors. Signed-off-by: Avri Altman --- drivers/ufs/core/ufshcd.c | 5 ++++- include/ufs/ufshcd.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index c472bfdf071e..0407d1064e74 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -8312,7 +8312,10 @@ static int ufs_get_device_desc(struct ufs_hba *hba) if (hba->ext_iid_sup) ufshcd_ext_iid_probe(hba, desc_buf); - ufshcd_rtt_set(hba, desc_buf); + if (hba->vops && hba->vops->rtt_set) + hba->vops->rtt_set(hba, desc_buf); + else + ufshcd_rtt_set(hba, desc_buf); /* * ufshcd_read_string_desc returns size of the string diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index d74bd2d67b06..9237ea65bd26 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -329,6 +329,7 @@ struct ufs_pwr_mode_info { * @get_outstanding_cqs: called to get outstanding completion queues * @config_esi: called to config Event Specific Interrupt * @config_scsi_dev: called to configure SCSI device parameters + * @rtt_set: negotiate rtt */ struct ufs_hba_variant_ops { const char *name; @@ -374,6 +375,7 @@ struct ufs_hba_variant_ops { int (*get_outstanding_cqs)(struct ufs_hba *hba, unsigned long *ocqs); int (*config_esi)(struct ufs_hba *hba); + void (*rtt_set)(struct ufs_hba *hba, u8 *desc_buf); }; /* clock gating state */ -- 2.34.1