mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: manivannan.sadhasivam@linaro.org,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>,
	Bart Van Assche <bvanassche@acm.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Abel Vesa <abel.vesa@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	Amit Pundir <amit.pundir@linaro.org>,
	Nitin Rawat <quic_nitirawa@quicinc.com>
Subject: Re: [PATCH 2/3] scsi: ufs: qcom: Allow passing platform specific OF data
Date: Thu, 12 Dec 2024 15:13:03 +0100	[thread overview]
Message-ID: <00847cb8-2ead-4d2c-8b30-a9f8d8ceeb76@linaro.org> (raw)
In-Reply-To: <20241211-ufs-qcom-suspend-fix-v1-2-83ebbde76b1c@linaro.org>

On 11/12/2024 18:40, Manivannan Sadhasivam via B4 Relay wrote:
> From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> 
> In order to allow platform specific flags and configurations, introduce
> the platform specific OF data and move the existing quirk
> UFSHCD_QUIRK_BROKEN_LSDBS_CAP for SM8550 and SM8650 SoCs.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/ufs/host/ufs-qcom.c | 13 +++++++++----
>   drivers/ufs/host/ufs-qcom.h |  4 ++++
>   2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 32b0c74437de..35ae8c8fc301 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -871,6 +871,7 @@ static u32 ufs_qcom_get_ufs_hci_version(struct ufs_hba *hba)
>    */
>   static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
>   {
> +	const struct ufs_qcom_drvdata *drvdata = of_device_get_match_data(hba->dev);
>   	struct ufs_qcom_host *host = ufshcd_get_variant(hba);
>   
>   	if (host->hw_ver.major == 0x2)
> @@ -879,9 +880,8 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
>   	if (host->hw_ver.major > 0x3)
>   		hba->quirks |= UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH;
>   
> -	if (of_device_is_compatible(hba->dev->of_node, "qcom,sm8550-ufshc") ||
> -	    of_device_is_compatible(hba->dev->of_node, "qcom,sm8650-ufshc"))
> -		hba->quirks |= UFSHCD_QUIRK_BROKEN_LSDBS_CAP;
> +	if (drvdata && drvdata->quirks)
> +		hba->quirks |= drvdata->quirks;
>   }
>   
>   static void ufs_qcom_set_phy_gear(struct ufs_qcom_host *host)
> @@ -1864,9 +1864,14 @@ static void ufs_qcom_remove(struct platform_device *pdev)
>   	platform_device_msi_free_irqs_all(hba->dev);
>   }
>   
> +static const struct ufs_qcom_drvdata ufs_qcom_sm8550_drvdata = {
> +	.quirks = UFSHCD_QUIRK_BROKEN_LSDBS_CAP,
> +};
> +
>   static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = {
>   	{ .compatible = "qcom,ufshc" },
> -	{ .compatible = "qcom,sm8550-ufshc" },
> +	{ .compatible = "qcom,sm8550-ufshc", .data = &ufs_qcom_sm8550_drvdata },
> +	{ .compatible = "qcom,sm8650-ufshc", .data = &ufs_qcom_sm8550_drvdata },
>   	{},
>   };
>   MODULE_DEVICE_TABLE(of, ufs_qcom_of_match);
> diff --git a/drivers/ufs/host/ufs-qcom.h b/drivers/ufs/host/ufs-qcom.h
> index b9de170983c9..e85cc6fc072e 100644
> --- a/drivers/ufs/host/ufs-qcom.h
> +++ b/drivers/ufs/host/ufs-qcom.h
> @@ -217,6 +217,10 @@ struct ufs_qcom_host {
>   	bool esi_enabled;
>   };
>   
> +struct ufs_qcom_drvdata {
> +	unsigned int quirks;
> +};
> +
>   static inline u32
>   ufs_qcom_get_debug_reg_offset(struct ufs_qcom_host *host, u32 reg)
>   {
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

  parent reply	other threads:[~2024-12-12 14:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11 17:40 [PATCH 0/3] scsi: ufs: qcom: Suspend fixes Manivannan Sadhasivam via B4 Relay
2024-12-11 17:40 ` [PATCH 1/3] scsi: ufs: qcom: Power off the PHY if it was already powered on in ufs_qcom_power_up_sequence() Manivannan Sadhasivam via B4 Relay
2024-12-11 17:40 ` [PATCH 2/3] scsi: ufs: qcom: Allow passing platform specific OF data Manivannan Sadhasivam via B4 Relay
2024-12-12 11:06   ` Avri Altman
2024-12-12 14:13   ` Neil Armstrong [this message]
2024-12-11 17:40 ` [PATCH 3/3] scsi: ufs: qcom: Power down the controller/device during system suspend for SM8550/SM8650 SoCs Manivannan Sadhasivam via B4 Relay
2024-12-12 17:51 ` [PATCH 0/3] scsi: ufs: qcom: Suspend fixes Bart Van Assche
2024-12-13 12:28 ` Amit Pundir

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00847cb8-2ead-4d2c-8b30-a9f8d8ceeb76@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=abel.vesa@linaro.org \
    --cc=alim.akhtar@samsung.com \
    --cc=amit.pundir@linaro.org \
    --cc=andersson@kernel.org \
    --cc=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=martin.petersen@oracle.com \
    --cc=quic_nitirawa@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®