linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alim Akhtar" <alim.akhtar@samsung.com>
To: "'Chanho Park'" <chanho61.park@samsung.com>,
	"'Avri Altman'" <avri.altman@wdc.com>,
	"'James E . J . Bottomley'" <jejb@linux.ibm.com>,
	"'Martin K . Petersen'" <martin.petersen@oracle.com>,
	"'Krzysztof Kozlowski'" <krzysztof.kozlowski@canonical.com>
Cc: "'Bean Huo'" <beanhuo@micron.com>,
	"'Bart Van Assche'" <bvanassche@acm.org>,
	"'Adrian Hunter'" <adrian.hunter@intel.com>,
	"'Christoph Hellwig'" <hch@infradead.org>,
	"'Can Guo'" <cang@codeaurora.org>,
	"'Jaegeuk Kim'" <jaegeuk@kernel.org>,
	"'Gyunghoon Kwon'" <goodjob.kwon@samsung.com>,
	<linux-samsung-soc@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
	"'Kiwoong Kim'" <kwmad.kim@samsung.com>
Subject: RE: [PATCH v3 08/17] scsi: ufs: ufs-exynos: add setup_clocks callback
Date: Thu, 23 Sep 2021 09:21:55 +0530	[thread overview]
Message-ID: <000801d7b02e$5c2bd680$14838380$@samsung.com> (raw)
In-Reply-To: <20210917065436.145629-9-chanho61.park@samsung.com>



>-----Original Message-----
>From: Chanho Park [mailto:chanho61.park@samsung.com]
>Sent: Friday, September 17, 2021 12:24 PM
>To: Alim Akhtar <alim.akhtar@samsung.com>; Avri Altman
><avri.altman@wdc.com>; James E . J . Bottomley <jejb@linux.ibm.com>; Martin
>K . Petersen <martin.petersen@oracle.com>; Krzysztof Kozlowski
><krzysztof.kozlowski@canonical.com>
>Cc: Bean Huo <beanhuo@micron.com>; Bart Van Assche
><bvanassche@acm.org>; Adrian Hunter <adrian.hunter@intel.com>; Christoph
>Hellwig <hch@infradead.org>; Can Guo <cang@codeaurora.org>; Jaegeuk Kim
><jaegeuk@kernel.org>; Gyunghoon Kwon <goodjob.kwon@samsung.com>;
>linux-samsung-soc@vger.kernel.org; linux-scsi@vger.kernel.org; Chanho Park
><chanho61.park@samsung.com>; Kiwoong Kim <kwmad.kim@samsung.com>
>Subject: [PATCH v3 08/17] scsi: ufs: ufs-exynos: add setup_clocks callback
>
>This patch adds setup_clocks callback to control/gate clocks by ufshcd.
>To avoid calling before initialization, it needs to check whether ufs is null or not
>and call it initially from pre_link callback.
>
>Cc: Alim Akhtar <alim.akhtar@samsung.com>
>Cc: Kiwoong Kim <kwmad.kim@samsung.com>
>Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>Signed-off-by: Chanho Park <chanho61.park@samsung.com>
>---
> drivers/scsi/ufs/ufs-exynos.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
>diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index
>627edef4fbeb..2024e44a09d7 100644
>--- a/drivers/scsi/ufs/ufs-exynos.c
>+++ b/drivers/scsi/ufs/ufs-exynos.c
>@@ -795,6 +795,27 @@ static void exynos_ufs_config_intr(struct exynos_ufs
>*ufs, u32 errs, u8 index)
> 	}
> }
>
>+static int exynos_ufs_setup_clocks(struct ufs_hba *hba, bool on,
>+				   enum ufs_notify_change_status status) {
>+	struct exynos_ufs *ufs = ufshcd_get_variant(hba);
>+
>+	if (!ufs)
>+		return 0;
>+
>+	if (on) {
>+		if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL)
>+			exynos_ufs_disable_auto_ctrl_hcc(ufs);
>+		exynos_ufs_ungate_clks(ufs);
>+	} else {
>+		exynos_ufs_gate_clks(ufs);
>+		if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL)
>+			exynos_ufs_enable_auto_ctrl_hcc(ufs);
>+	}
>+
>+	return 0;
>+}
>+
> static int exynos_ufs_pre_link(struct ufs_hba *hba)  {
> 	struct exynos_ufs *ufs = ufshcd_get_variant(hba); @@ -813,6 +834,8
>@@ static int exynos_ufs_pre_link(struct ufs_hba *hba)
> 	exynos_ufs_config_phy_time_attr(ufs);
> 	exynos_ufs_config_phy_cap_attr(ufs);
>
>+	exynos_ufs_setup_clocks(hba, true, POST_CHANGE);

For consistency and better understanding, may be PRE_CHANGE?

>+
> 	if (ufs->drv_data->pre_link)
> 		ufs->drv_data->pre_link(ufs);
>
>@@ -1203,6 +1226,7 @@ static struct ufs_hba_variant_ops ufs_hba_exynos_ops
>= {
> 	.hce_enable_notify		= exynos_ufs_hce_enable_notify,
> 	.link_startup_notify		= exynos_ufs_link_startup_notify,
> 	.pwr_change_notify		= exynos_ufs_pwr_change_notify,
>+	.setup_clocks			= exynos_ufs_setup_clocks,
> 	.setup_xfer_req			=
>exynos_ufs_specify_nexus_t_xfer_req,
> 	.setup_task_mgmt		= exynos_ufs_specify_nexus_t_tm_req,
> 	.hibern8_notify			= exynos_ufs_hibern8_notify,
>--
>2.33.0



  reply	other threads:[~2021-09-23  4:21 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210917065522epcas2p2c9c7baccfc82b3798804c351dbf676eb@epcas2p2.samsung.com>
2021-09-17  6:54 ` [PATCH v3 00/17] introduce exynosauto v9 ufs driver Chanho Park
     [not found]   ` <CGME20210917065522epcas2p49ce06e9686c9b6f5cb1dd16ca9d82052@epcas2p4.samsung.com>
2021-09-17  6:54     ` [PATCH v3 01/17] scsi: ufs: add quirk to handle broken UIC command Chanho Park
2021-09-23  3:44       ` Alim Akhtar
     [not found]   ` <CGME20210917065522epcas2p4ed13768faa6aa6d33116606e2601321e@epcas2p4.samsung.com>
2021-09-17  6:54     ` [PATCH v3 02/17] scsi: ufs: add quirk to enable host controller without ph configuration Chanho Park
2021-09-23  3:48       ` Alim Akhtar
     [not found]   ` <CGME20210917065522epcas2p26f56b37c3f7505b9d0e34bc2162fdbbd@epcas2p2.samsung.com>
2021-09-17  6:54     ` [PATCH v3 03/17] scsi: ufs: ufs-exynos: change pclk available max value Chanho Park
2021-09-27  5:25       ` Inki Dae
2021-09-27  6:46         ` Chanho Park
2021-09-27  7:11           ` Inki Dae
2021-09-27 11:08             ` Chanho Park
2021-09-28  2:18               ` Inki Dae
     [not found]   ` <CGME20210917065522epcas2p23066a1bd5e39ac1931d7e38064fe23dd@epcas2p2.samsung.com>
2021-09-17  6:54     ` [PATCH v3 04/17] scsi: ufs: ufs-exynos: simplify drv_data retrieval Chanho Park
     [not found]   ` <CGME20210917065523epcas2p3ff66daa15c8c782f839422756c388d93@epcas2p3.samsung.com>
2021-09-17  6:54     ` [PATCH v3 05/17] dt-bindings: ufs: exynos-ufs: add sysreg regmap property Chanho Park
2021-09-22 19:57       ` Rob Herring
2021-09-23  0:47         ` Chanho Park
2021-09-23 12:39           ` Rob Herring
2021-09-24  1:10             ` Chanho Park
     [not found]   ` <CGME20210917065523epcas2p477a63b06cbb9f5588aa2c149c9d1db10@epcas2p4.samsung.com>
2021-09-17  6:54     ` [PATCH v3 06/17] scsi: ufs: ufs-exynos: get sysreg regmap for io-coherency Chanho Park
2021-09-22 19:55       ` Rob Herring
2021-09-23  0:39         ` Chanho Park
2021-09-23 12:26           ` Rob Herring
2021-09-24  0:59             ` Chanho Park
     [not found]   ` <CGME20210917065523epcas2p44a9f121c18e0f3a5614f980c9eeffa16@epcas2p4.samsung.com>
2021-09-17  6:54     ` [PATCH v3 07/17] scsi: ufs: ufs-exynos: add refclkout_stop control Chanho Park
     [not found]   ` <CGME20210917065523epcas2p1215e9f56482339ca8a9346a0ac2bfe23@epcas2p1.samsung.com>
2021-09-17  6:54     ` [PATCH v3 08/17] scsi: ufs: ufs-exynos: add setup_clocks callback Chanho Park
2021-09-23  3:51       ` Alim Akhtar [this message]
     [not found]   ` <CGME20210917065523epcas2p15b648b88af85252fe12ff8026307526a@epcas2p1.samsung.com>
2021-09-17  6:54     ` [PATCH v3 09/17] scsi: ufs: ufs-exynos: correct timeout value setting registers Chanho Park
2021-09-23  4:14       ` Alim Akhtar
2021-09-23  5:47         ` Chanho Park
     [not found]   ` <CGME20210917065523epcas2p39e18203beafe9377e9dac819f01b804f@epcas2p3.samsung.com>
2021-09-17  6:54     ` [PATCH v3 10/17] scsi: ufs: ufs-exynos: support custom version of ufs_hba_variant_ops Chanho Park
2021-09-23  4:28       ` Alim Akhtar
     [not found]   ` <CGME20210917065523epcas2p3b178e3d9d2d4db628f597732be9c6856@epcas2p3.samsung.com>
2021-09-17  6:54     ` [PATCH v3 11/17] scsi: ufs: ufs-exynos: add EXYNOS_UFS_OPT_SKIP_CONFIG_PHY_ATTR option Chanho Park
2021-09-23  4:32       ` Alim Akhtar
     [not found]   ` <CGME20210917065523epcas2p2cb63cd8924be44e6eaa42c7213bd15d4@epcas2p2.samsung.com>
2021-09-17  6:54     ` [PATCH v3 12/17] scsi: ufs: ufs-exynos: factor out priv data init Chanho Park
     [not found]   ` <CGME20210917065523epcas2p4fc1be41c739361dd6ae9d167cfc631dc@epcas2p4.samsung.com>
2021-09-17  6:54     ` [PATCH v3 13/17] scsi: ufs: ufs-exynos: add pre/post_hce_enable drv callbacks Chanho Park
2021-09-23  4:51       ` Alim Akhtar
     [not found]   ` <CGME20210917065523epcas2p47156d9fba5b8d8a5e5908ccdc0ae1655@epcas2p4.samsung.com>
2021-09-17  6:54     ` [PATCH v3 14/17] scsi: ufs: ufs-exynos: support exynosauto v9 ufs driver Chanho Park
     [not found]   ` <CGME20210917065524epcas2p18a720757ef3c4fc08d4bc8d16f9fe7fe@epcas2p1.samsung.com>
2021-09-17  6:54     ` [PATCH v3 15/17] scsi: ufs: ufs-exynos: multi-host configuration for exynosauto Chanho Park
2021-09-27  5:31       ` Inki Dae
2021-09-27  6:56         ` Chanho Park
     [not found]   ` <CGME20210917065524epcas2p3929f70cb0b62e6ca85a6f4814b61fae1@epcas2p3.samsung.com>
2021-09-17  6:54     ` [PATCH v3 16/17] scsi: ufs: ufs-exynos: introduce exynosauto v9 virtual host Chanho Park
     [not found]   ` <CGME20210917065524epcas2p455b2900227b6a20994bec4816248f2bf@epcas2p4.samsung.com>
2021-09-17  6:54     ` [PATCH v3 17/17] dt-bindings: ufs: exynos-ufs: add exynosautov9 compatible Chanho Park
2021-09-22 19:58       ` Rob Herring

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='000801d7b02e$5c2bd680$14838380$@samsung.com' \
    --to=alim.akhtar@samsung.com \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=chanho61.park@samsung.com \
    --cc=goodjob.kwon@samsung.com \
    --cc=hch@infradead.org \
    --cc=jaegeuk@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --subject='RE: [PATCH v3 08/17] scsi: ufs: ufs-exynos: add setup_clocks callback' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).