Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp976295lqp; Thu, 23 May 2024 05:59:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVet96IOdZnnia0Nl+fAi3kYgiPbM5hJeTFJf8SCeKOZhpklun8DsutblNntVxoHzM+MZYdqFJUlnSu8Ljw/abQYZqkN2Rr3N1IdxYekA== X-Google-Smtp-Source: AGHT+IHejylbGv1W8SZ/vk35cEzHlH78n5KGbUXJbJr3sqyKywPBKpZJWZdGSwVbZg1CBlSQENTt X-Received: by 2002:a05:6a00:4b53:b0:6f6:76c8:122c with SMTP id d2e1a72fcca58-6f77279b7e4mr2911874b3a.16.1716469162731; Thu, 23 May 2024 05:59:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716469162; cv=pass; d=google.com; s=arc-20160816; b=0BLRn+HyU4TbQKLmTJ2JPbDqEdeQRF2PmcJb6A4A+DSm3JnXQSuildjiI+fgdf8BRO a0qlzFwRQ6kYt8PfYI85Qtd9pOjlBI68UPIN/c2gSkdeR7KC15n8cdlP9YU2/uXq26vo IdI1JUs7yaalwP+FSCZou/HSyHFbiINiVFmmKmeAg8qXpDhT8HCTNF789M77Mh9dm+Qk jEOYsRVi49qt/FnPaLE1hq5bOAXW6L7Wt3fgX8ix6Wb0saufDdfDaN/C0Cm42v43CH72 f1noY1oWGHjxA8NkTosG+cbDp3cCeN0sT6pU5e4pl75ojMDnaiz9LxtrFUymjUMNQ7n+ 4fCg== 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=sSPpG8RqhciztPGmr33x9+pFqpwh+npDMTTlTVKNqDo=; fh=X0Lb6G6jJE8+QeYtFGxv2g5f8eI/IotqH0fFq08ifqY=; b=0fKCkl6MmUzv0BD8OkrgyupqyH6YeD9aGts/VCMshdd4HCxF9aH2/zLGfuHWTFAgBa hCS+DQQS/V+ERWEI2LK5C0rFEZu7XHkdgiU7RKsM3kHW1bpEwWaYVROdOAVyfXa/2fYK ZDpNClEtTDXxerWE++O3mcJIHBKuQleFLyxklaeKznx8y4mF5/oOCYHIrABq1KLhgjVD KKmeGGC2A2sHU1NJacorT+yiVhFrTh/Fy+mQUnT9mgvQlSmtgIWyOnvMuUB/azT0vxSq jDihgNdJqFEISgp1WSCiRRsJZg6g5kXu9J5r44G3OTke8AwziJ7YJbmVOh+ImMmRww1o 5PUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=dlhGgJir; 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-187525-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187525-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b41a4esi7497845b3a.312.2024.05.23.05.59.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 05:59:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187525-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=dlhGgJir; 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-187525-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187525-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 63275283D43 for ; Thu, 23 May 2024 12:59:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE5AE14A4D1; Thu, 23 May 2024 12:59:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="dlhGgJir" Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (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 4C0C78174C; Thu, 23 May 2024 12:58:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.144 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716469140; cv=none; b=s5KqFV5a82WfVwBCKKZgcyVjUc1anM1xRN7jQ937uuou0FVrUDsbCNV9gb2I+0/QphELZupY26jHvUlAlHWF1W84uNhhl3mxxlnM8uKxR50snidYO0jnLbmBxfPORf/gGvn6A9XkK3ewL9x0MtDm2zVO2watoc309cFM+26IjpI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716469140; c=relaxed/simple; bh=weEYl6VBPgDFrEHa6UzdQDJyfa30XR8+4PkfKpY9u+Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kqF0xs11iffxenFmYZg+/0HNY3jQSKxv0x1Y5uDm5WdEbuq64natcwWxgi6SU81jWCvf7tK+ZTpoR0EHuX2lFCmN8awXuQw342NN6+cRE5FZF17HkH1xPIEsYz3KifOGukxC8Gl10gCDznQzEvRypZJRQdr9E5qZJRYa24QmSLw= 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=dlhGgJir; arc=none smtp.client-ip=216.71.153.144 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=1716469137; x=1748005137; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=weEYl6VBPgDFrEHa6UzdQDJyfa30XR8+4PkfKpY9u+Q=; b=dlhGgJir30MMqZGucwod16iet5uuatM0YBu8BU41w0PZaQn0pqFjprX8 rckK2gntWx9WFOsQQn771LHZ66KyVcvt1IX85Oc5hPQLj3nJm6inkjuLw 4o2kQFhcDML3aNSRi7kboT4WgJLvHB5JMWbt4hMVn32ddMZ1xQe6xM4Tu BRJ0mWbjokdpGIwSCu2YRBTVxJjqqZtSxO0MewdUO3e0AU/SdCzydB6lV nTWOGwtbK/Cv4GaL34COaqjCtDju2+lyZsjfAEjCjOHCp21NqgKH+KTyj pyG+29jsTP+ubf5HJnPn9uA+LDQvSgFthF/ptWfgn8N2YJkpvYVNmbLY3 g==; X-CSE-ConnectionGUID: 391sdrR/TUygf+bO//3dvg== X-CSE-MsgGUID: sRq+viBRSWafHCaIG9zgkQ== X-IronPort-AV: E=Sophos;i="6.08,182,1712592000"; d="scan'208";a="17902276" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 23 May 2024 20:58:55 +0800 IronPort-SDR: 664f2ff3_NdXhDMeSlIPBASy7p/qsdtaNZyUM2ng44C2/ImtxQRtTm5N cdJMbeNYFw7yU9s85/iU6z0A6fWqTSlo96v/IgA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 23 May 2024 05:00:51 -0700 WDCIronportException: Internal Received: from bxygm33.ad.shared ([10.45.31.229]) by uls-op-cesaip02.wdc.com with ESMTP; 23 May 2024 05:58:54 -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 v5 2/3] scsi: ufs: Allow platform vendors to set rtt Date: Thu, 23 May 2024 15:58:25 +0300 Message-ID: <20240523125827.818-3-avri.altman@wdc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240523125827.818-1-avri.altman@wdc.com> References: <20240523125827.818-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 vary 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 7df8bcacbe7e..d8e0e80d66a5 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -8542,7 +8542,10 @@ static int ufshcd_device_params_init(struct ufs_hba *hba) goto out; } - ufshcd_set_rtt(hba); + if (hba->vops && hba->vops->set_rtt) + hba->vops->set_rtt(hba); + else + ufshcd_set_rtt(hba); ufshcd_get_ref_clk_gating_wait(hba); diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index d74bd2d67b06..495b50a72f9f 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 + * @set_rtt: 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 (*set_rtt)(struct ufs_hba *hba); }; /* clock gating state */ -- 2.34.1