* [PATCH 0/3] change exynos ufs phy control [not found] <CGME20220705065722epcas2p3fad39b3edf1a0fd1789de77997bf5728@epcas2p3.samsung.com> @ 2022-07-05 6:54 ` Chanho Park [not found] ` <CGME20220705065722epcas2p2973795cc88ee436480abcb48435059a8@epcas2p2.samsung.com> ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: Chanho Park @ 2022-07-05 6:54 UTC (permalink / raw) To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski, James E . J . Bottomley, Martin K . Petersen, Alim Akhtar, Bart Van Assche Cc: linux-phy, linux-scsi, linux-arm-kernel, linux-samsung-soc, Chanho Park Since commit 1599069a62c6 ("phy: core: Warn when phy_power_on is called before phy_init"), below warning has been reported. phy_power_on was called before phy_init To address this, we need to remove phy_power_on from exynos_ufs_phy_init. The first patch is for changing phy clocks manipulation from controlling each symbol/ref clocks to clk_bulk APIs. The second patch is for making power on/off sequences between pmu isolation and clk control. Finally, the third patch changes the phy on/off and init sequences from ufs-exynos host driver. Chanho Park (3): phy: samsung-ufs: convert phy clk usage to clk_bulk API phy: samsung-ufs: ufs: change phy on/off control ufs: ufs-exynos: change ufs phy control sequence drivers/phy/samsung/phy-exynos7-ufs.c | 7 +- drivers/phy/samsung/phy-exynosautov9-ufs.c | 7 +- drivers/phy/samsung/phy-fsd-ufs.c | 7 +- drivers/phy/samsung/phy-samsung-ufs.c | 121 ++++++--------------- drivers/phy/samsung/phy-samsung-ufs.h | 10 +- drivers/ufs/host/ufs-exynos.c | 13 ++- 6 files changed, 63 insertions(+), 102 deletions(-) -- 2.37.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <CGME20220705065722epcas2p2973795cc88ee436480abcb48435059a8@epcas2p2.samsung.com>]
* [PATCH 1/3] phy: samsung-ufs: convert phy clk usage to clk_bulk API [not found] ` <CGME20220705065722epcas2p2973795cc88ee436480abcb48435059a8@epcas2p2.samsung.com> @ 2022-07-05 6:54 ` Chanho Park 2022-07-05 9:30 ` Krzysztof Kozlowski 0 siblings, 1 reply; 8+ messages in thread From: Chanho Park @ 2022-07-05 6:54 UTC (permalink / raw) To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski, James E . J . Bottomley, Martin K . Petersen, Alim Akhtar, Bart Van Assche Cc: linux-phy, linux-scsi, linux-arm-kernel, linux-samsung-soc, Chanho Park Instead of using separated clock manipulation, this converts the phy clock usage to be clk_bulk APIs. By using this, we can completely remove has_symbol_clk check and symbol clk variables. Furthermore, clk_get should be moved to probe because there is no need to get them in the phy_init callback. Signed-off-by: Chanho Park <chanho61.park@samsung.com> --- drivers/phy/samsung/phy-exynos7-ufs.c | 7 +- drivers/phy/samsung/phy-exynosautov9-ufs.c | 7 +- drivers/phy/samsung/phy-fsd-ufs.c | 7 +- drivers/phy/samsung/phy-samsung-ufs.c | 99 +++++----------------- drivers/phy/samsung/phy-samsung-ufs.h | 10 +-- 5 files changed, 42 insertions(+), 88 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos7-ufs.c b/drivers/phy/samsung/phy-exynos7-ufs.c index 72854336f59d..a982e7c128c5 100644 --- a/drivers/phy/samsung/phy-exynos7-ufs.c +++ b/drivers/phy/samsung/phy-exynos7-ufs.c @@ -68,6 +68,10 @@ static const struct samsung_ufs_phy_cfg *exynos7_ufs_phy_cfgs[CFG_TAG_MAX] = { [CFG_POST_PWR_HS] = exynos7_post_pwr_hs_cfg, }; +static const char * const exynos7_ufs_phy_clks[] = { + "tx0_symbol_clk", "rx0_symbol_clk", "rx1_symbol_clk", "ref_clk", +}; + const struct samsung_ufs_phy_drvdata exynos7_ufs_phy = { .cfgs = exynos7_ufs_phy_cfgs, .isol = { @@ -75,6 +79,7 @@ const struct samsung_ufs_phy_drvdata exynos7_ufs_phy = { .mask = EXYNOS7_EMBEDDED_COMBO_PHY_CTRL_MASK, .en = EXYNOS7_EMBEDDED_COMBO_PHY_CTRL_EN, }, - .has_symbol_clk = 1, + .clk_list = exynos7_ufs_phy_clks, + .num_clks = ARRAY_SIZE(exynos7_ufs_phy_clks), .cdr_lock_status_offset = EXYNOS7_EMBEDDED_COMBO_PHY_CDR_LOCK_STATUS, }; diff --git a/drivers/phy/samsung/phy-exynosautov9-ufs.c b/drivers/phy/samsung/phy-exynosautov9-ufs.c index 2b256070d657..49e2bcbef0b4 100644 --- a/drivers/phy/samsung/phy-exynosautov9-ufs.c +++ b/drivers/phy/samsung/phy-exynosautov9-ufs.c @@ -57,6 +57,10 @@ static const struct samsung_ufs_phy_cfg *exynosautov9_ufs_phy_cfgs[CFG_TAG_MAX] [CFG_PRE_PWR_HS] = exynosautov9_pre_pwr_hs_cfg, }; +static const char * const exynosautov9_ufs_phy_clks[] = { + "ref_clk", +}; + const struct samsung_ufs_phy_drvdata exynosautov9_ufs_phy = { .cfgs = exynosautov9_ufs_phy_cfgs, .isol = { @@ -64,6 +68,7 @@ const struct samsung_ufs_phy_drvdata exynosautov9_ufs_phy = { .mask = EXYNOSAUTOV9_EMBEDDED_COMBO_PHY_CTRL_MASK, .en = EXYNOSAUTOV9_EMBEDDED_COMBO_PHY_CTRL_EN, }, - .has_symbol_clk = 0, + .clk_list = exynosautov9_ufs_phy_clks, + .num_clks = ARRAY_SIZE(exynosautov9_ufs_phy_clks), .cdr_lock_status_offset = EXYNOSAUTOV9_EMBEDDED_COMBO_PHY_CDR_LOCK_STATUS, }; diff --git a/drivers/phy/samsung/phy-fsd-ufs.c b/drivers/phy/samsung/phy-fsd-ufs.c index c78b6c16027d..d36cabd53434 100644 --- a/drivers/phy/samsung/phy-fsd-ufs.c +++ b/drivers/phy/samsung/phy-fsd-ufs.c @@ -46,6 +46,10 @@ static const struct samsung_ufs_phy_cfg *fsd_ufs_phy_cfgs[CFG_TAG_MAX] = { [CFG_POST_PWR_HS] = fsd_post_pwr_hs_cfg, }; +static const char * const fsd_ufs_phy_clks[] = { + "ref_clk", +}; + const struct samsung_ufs_phy_drvdata fsd_ufs_phy = { .cfgs = fsd_ufs_phy_cfgs, .isol = { @@ -53,6 +57,7 @@ const struct samsung_ufs_phy_drvdata fsd_ufs_phy = { .mask = FSD_EMBEDDED_COMBO_PHY_CTRL_MASK, .en = FSD_EMBEDDED_COMBO_PHY_CTRL_EN, }, - .has_symbol_clk = 0, + .clk_list = fsd_ufs_phy_clks, + .num_clks = ARRAY_SIZE(fsd_ufs_phy_clks), .cdr_lock_status_offset = FSD_EMBEDDED_COMBO_PHY_CDR_LOCK_STATUS, }; diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c index e4334529ffbc..14cce2f2487e 100644 --- a/drivers/phy/samsung/phy-samsung-ufs.c +++ b/drivers/phy/samsung/phy-samsung-ufs.c @@ -131,73 +131,21 @@ static int samsung_ufs_phy_calibrate(struct phy *phy) return err; } -static int samsung_ufs_phy_symbol_clk_init(struct samsung_ufs_phy *phy) -{ - int ret; - - phy->tx0_symbol_clk = devm_clk_get(phy->dev, "tx0_symbol_clk"); - if (IS_ERR(phy->tx0_symbol_clk)) { - dev_err(phy->dev, "failed to get tx0_symbol_clk clock\n"); - return PTR_ERR(phy->tx0_symbol_clk); - } - - phy->rx0_symbol_clk = devm_clk_get(phy->dev, "rx0_symbol_clk"); - if (IS_ERR(phy->rx0_symbol_clk)) { - dev_err(phy->dev, "failed to get rx0_symbol_clk clock\n"); - return PTR_ERR(phy->rx0_symbol_clk); - } - - phy->rx1_symbol_clk = devm_clk_get(phy->dev, "rx1_symbol_clk"); - if (IS_ERR(phy->rx1_symbol_clk)) { - dev_err(phy->dev, "failed to get rx1_symbol_clk clock\n"); - return PTR_ERR(phy->rx1_symbol_clk); - } - - ret = clk_prepare_enable(phy->tx0_symbol_clk); - if (ret) { - dev_err(phy->dev, "%s: tx0_symbol_clk enable failed %d\n", __func__, ret); - goto out; - } - - ret = clk_prepare_enable(phy->rx0_symbol_clk); - if (ret) { - dev_err(phy->dev, "%s: rx0_symbol_clk enable failed %d\n", __func__, ret); - goto out_disable_tx0_clk; - } - - ret = clk_prepare_enable(phy->rx1_symbol_clk); - if (ret) { - dev_err(phy->dev, "%s: rx1_symbol_clk enable failed %d\n", __func__, ret); - goto out_disable_rx0_clk; - } - - return 0; - -out_disable_rx0_clk: - clk_disable_unprepare(phy->rx0_symbol_clk); -out_disable_tx0_clk: - clk_disable_unprepare(phy->tx0_symbol_clk); -out: - return ret; -} - static int samsung_ufs_phy_clks_init(struct samsung_ufs_phy *phy) { - int ret; - - phy->ref_clk = devm_clk_get(phy->dev, "ref_clk"); - if (IS_ERR(phy->ref_clk)) - dev_err(phy->dev, "failed to get ref_clk clock\n"); + int i; + const struct samsung_ufs_phy_drvdata *drvdata = phy->drvdata; + int num_clks = drvdata->num_clks; - ret = clk_prepare_enable(phy->ref_clk); - if (ret) { - dev_err(phy->dev, "%s: ref_clk enable failed %d\n", __func__, ret); - return ret; - } + phy->clks = devm_kcalloc(phy->dev, num_clks, sizeof(*phy->clks), + GFP_KERNEL); + if (!phy->clks) + return -ENOMEM; - dev_dbg(phy->dev, "UFS MPHY ref_clk_rate = %ld\n", clk_get_rate(phy->ref_clk)); + for (i = 0; i < num_clks; i++) + phy->clks[i].id = drvdata->clk_list[i]; - return 0; + return devm_clk_bulk_get(phy->dev, num_clks, phy->clks); } static int samsung_ufs_phy_init(struct phy *phy) @@ -208,16 +156,12 @@ static int samsung_ufs_phy_init(struct phy *phy) ss_phy->lane_cnt = phy->attrs.bus_width; ss_phy->ufs_phy_state = CFG_PRE_INIT; - if (ss_phy->has_symbol_clk) { - ret = samsung_ufs_phy_symbol_clk_init(ss_phy); - if (ret) - dev_err(ss_phy->dev, "failed to set ufs phy symbol clocks\n"); + ret = clk_bulk_prepare_enable(ss_phy->drvdata->num_clks, ss_phy->clks); + if (ret) { + dev_err(ss_phy->dev, "failed to enable ufs phy clocks\n"); + return ret; } - ret = samsung_ufs_phy_clks_init(ss_phy); - if (ret) - dev_err(ss_phy->dev, "failed to set ufs phy clocks\n"); - ret = samsung_ufs_phy_calibrate(phy); if (ret) dev_err(ss_phy->dev, "ufs phy calibration failed\n"); @@ -258,13 +202,7 @@ static int samsung_ufs_phy_exit(struct phy *phy) { struct samsung_ufs_phy *ss_phy = get_samsung_ufs_phy(phy); - clk_disable_unprepare(ss_phy->ref_clk); - - if (ss_phy->has_symbol_clk) { - clk_disable_unprepare(ss_phy->tx0_symbol_clk); - clk_disable_unprepare(ss_phy->rx0_symbol_clk); - clk_disable_unprepare(ss_phy->rx1_symbol_clk); - } + clk_bulk_disable_unprepare(ss_phy->drvdata->num_clks, ss_phy->clks); return 0; } @@ -330,7 +268,6 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev) phy->dev = dev; phy->drvdata = drvdata; phy->cfgs = drvdata->cfgs; - phy->has_symbol_clk = drvdata->has_symbol_clk; memcpy(&phy->isol, &drvdata->isol, sizeof(phy->isol)); if (!of_property_read_u32_index(dev->of_node, "samsung,pmu-syscon", 1, @@ -339,6 +276,12 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev) phy->lane_cnt = PHY_DEF_LANE_CNT; + err = samsung_ufs_phy_clks_init(phy); + if (err) { + dev_err(dev, "failed to get phy clocks\n"); + goto out; + } + phy_set_drvdata(gen_phy, phy); phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h index 6320ac852f29..e122960cfee8 100644 --- a/drivers/phy/samsung/phy-samsung-ufs.h +++ b/drivers/phy/samsung/phy-samsung-ufs.h @@ -109,7 +109,8 @@ struct samsung_ufs_phy_pmu_isol { struct samsung_ufs_phy_drvdata { const struct samsung_ufs_phy_cfg **cfgs; struct samsung_ufs_phy_pmu_isol isol; - bool has_symbol_clk; + const char * const *clk_list; + int num_clks; u32 cdr_lock_status_offset; }; @@ -117,15 +118,10 @@ struct samsung_ufs_phy { struct device *dev; void __iomem *reg_pma; struct regmap *reg_pmu; - struct clk *ref_clk; - struct clk *ref_clk_parent; - struct clk *tx0_symbol_clk; - struct clk *rx0_symbol_clk; - struct clk *rx1_symbol_clk; + struct clk_bulk_data *clks; const struct samsung_ufs_phy_drvdata *drvdata; const struct samsung_ufs_phy_cfg * const *cfgs; struct samsung_ufs_phy_pmu_isol isol; - bool has_symbol_clk; u8 lane_cnt; int ufs_phy_state; enum phy_mode mode; -- 2.37.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] phy: samsung-ufs: convert phy clk usage to clk_bulk API 2022-07-05 6:54 ` [PATCH 1/3] phy: samsung-ufs: convert phy clk usage to clk_bulk API Chanho Park @ 2022-07-05 9:30 ` Krzysztof Kozlowski 0 siblings, 0 replies; 8+ messages in thread From: Krzysztof Kozlowski @ 2022-07-05 9:30 UTC (permalink / raw) To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, James E . J . Bottomley, Martin K . Petersen, Alim Akhtar, Bart Van Assche Cc: linux-phy, linux-scsi, linux-arm-kernel, linux-samsung-soc On 05/07/2022 08:54, Chanho Park wrote: > Instead of using separated clock manipulation, this converts the phy > clock usage to be clk_bulk APIs. By using this, we can completely > remove has_symbol_clk check and symbol clk variables. > Furthermore, clk_get should be moved to probe because there is no need > to get them in the phy_init callback. > > Signed-off-by: Chanho Park <chanho61.park@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <CGME20220705065722epcas2p1e93a8511b906d5e111bff48a312d0603@epcas2p1.samsung.com>]
* [PATCH 2/3] phy: samsung-ufs: ufs: change phy on/off control [not found] ` <CGME20220705065722epcas2p1e93a8511b906d5e111bff48a312d0603@epcas2p1.samsung.com> @ 2022-07-05 6:54 ` Chanho Park 2022-07-05 9:33 ` Krzysztof Kozlowski 0 siblings, 1 reply; 8+ messages in thread From: Chanho Park @ 2022-07-05 6:54 UTC (permalink / raw) To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski, James E . J . Bottomley, Martin K . Petersen, Alim Akhtar, Bart Van Assche Cc: linux-phy, linux-scsi, linux-arm-kernel, linux-samsung-soc, Chanho Park The sequence of controlling ufs phy block should be below: 1) Power On - Turn off pmu isolation - Clock enable 2) Power Off - Clock disable - Turn on pmu isolation Signed-off-by: Chanho Park <chanho61.park@samsung.com> --- drivers/phy/samsung/phy-samsung-ufs.c | 32 ++++++++++++++++----------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c index 14cce2f2487e..183c88e3d1ec 100644 --- a/drivers/phy/samsung/phy-samsung-ufs.c +++ b/drivers/phy/samsung/phy-samsung-ufs.c @@ -151,37 +151,43 @@ static int samsung_ufs_phy_clks_init(struct samsung_ufs_phy *phy) static int samsung_ufs_phy_init(struct phy *phy) { struct samsung_ufs_phy *ss_phy = get_samsung_ufs_phy(phy); - int ret; ss_phy->lane_cnt = phy->attrs.bus_width; ss_phy->ufs_phy_state = CFG_PRE_INIT; + return 0; +} + +static int samsung_ufs_phy_power_on(struct phy *phy) +{ + struct samsung_ufs_phy *ss_phy = get_samsung_ufs_phy(phy); + int ret; + + samsung_ufs_phy_ctrl_isol(ss_phy, false); + ret = clk_bulk_prepare_enable(ss_phy->drvdata->num_clks, ss_phy->clks); if (ret) { dev_err(ss_phy->dev, "failed to enable ufs phy clocks\n"); return ret; } - ret = samsung_ufs_phy_calibrate(phy); - if (ret) - dev_err(ss_phy->dev, "ufs phy calibration failed\n"); + if (ss_phy->ufs_phy_state == CFG_PRE_INIT) { + ret = samsung_ufs_phy_calibrate(phy); + if (ret) + dev_err(ss_phy->dev, "ufs phy calibration failed\n"); + } return ret; } -static int samsung_ufs_phy_power_on(struct phy *phy) -{ - struct samsung_ufs_phy *ss_phy = get_samsung_ufs_phy(phy); - - samsung_ufs_phy_ctrl_isol(ss_phy, false); - return 0; -} - static int samsung_ufs_phy_power_off(struct phy *phy) { struct samsung_ufs_phy *ss_phy = get_samsung_ufs_phy(phy); + clk_bulk_disable_unprepare(ss_phy->drvdata->num_clks, ss_phy->clks); + samsung_ufs_phy_ctrl_isol(ss_phy, true); + return 0; } @@ -202,7 +208,7 @@ static int samsung_ufs_phy_exit(struct phy *phy) { struct samsung_ufs_phy *ss_phy = get_samsung_ufs_phy(phy); - clk_bulk_disable_unprepare(ss_phy->drvdata->num_clks, ss_phy->clks); + ss_phy->ufs_phy_state = CFG_TAG_MAX; return 0; } -- 2.37.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] phy: samsung-ufs: ufs: change phy on/off control 2022-07-05 6:54 ` [PATCH 2/3] phy: samsung-ufs: ufs: change phy on/off control Chanho Park @ 2022-07-05 9:33 ` Krzysztof Kozlowski 0 siblings, 0 replies; 8+ messages in thread From: Krzysztof Kozlowski @ 2022-07-05 9:33 UTC (permalink / raw) To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, James E . J . Bottomley, Martin K . Petersen, Alim Akhtar, Bart Van Assche Cc: linux-phy, linux-scsi, linux-arm-kernel, linux-samsung-soc On 05/07/2022 08:54, Chanho Park wrote: > The sequence of controlling ufs phy block should be below: > > 1) Power On > - Turn off pmu isolation > - Clock enable > 2) Power Off > - Clock disable > - Turn on pmu isolation > Makes sense. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <CGME20220705065722epcas2p3f9970697f6d1f1fed43e10fe17019619@epcas2p3.samsung.com>]
* [PATCH 3/3] ufs: ufs-exynos: change ufs phy control sequence [not found] ` <CGME20220705065722epcas2p3f9970697f6d1f1fed43e10fe17019619@epcas2p3.samsung.com> @ 2022-07-05 6:54 ` Chanho Park 2022-07-05 9:36 ` Krzysztof Kozlowski 0 siblings, 1 reply; 8+ messages in thread From: Chanho Park @ 2022-07-05 6:54 UTC (permalink / raw) To: Kishon Vijay Abraham I, Vinod Koul, Krzysztof Kozlowski, James E . J . Bottomley, Martin K . Petersen, Alim Akhtar, Bart Van Assche Cc: linux-phy, linux-scsi, linux-arm-kernel, linux-samsung-soc, Chanho Park Since commit 1599069a62c6 ("phy: core: Warn when phy_power_on is called before phy_init"), below warning has been reported. phy_power_on was called before phy_init To address this, we need to remove phy_power_on from exynos_ufs_phy_init and move it after phy_init. phy_power_off and phy_exit are also necessary in exynos_ufs_remove. Signed-off-by: Chanho Park <chanho61.park@samsung.com> --- drivers/ufs/host/ufs-exynos.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index f971569bafc7..5718296e2521 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -908,6 +908,8 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs) goto out_exit_phy; } + phy_power_on(generic_phy); + return 0; out_exit_phy: @@ -1169,10 +1171,6 @@ static int exynos_ufs_init(struct ufs_hba *hba) goto out; } - ret = phy_power_on(ufs->phy); - if (ret) - goto phy_off; - exynos_ufs_priv_init(hba, ufs); if (ufs->drv_data->drv_init) { @@ -1190,8 +1188,6 @@ static int exynos_ufs_init(struct ufs_hba *hba) exynos_ufs_config_smu(ufs); return 0; -phy_off: - phy_power_off(ufs->phy); out: hba->priv = NULL; return ret; @@ -1602,9 +1598,14 @@ static int exynos_ufs_probe(struct platform_device *pdev) static int exynos_ufs_remove(struct platform_device *pdev) { struct ufs_hba *hba = platform_get_drvdata(pdev); + struct exynos_ufs *ufs = ufshcd_get_variant(hba); pm_runtime_get_sync(&(pdev)->dev); ufshcd_remove(hba); + + phy_power_off(ufs->phy); + phy_exit(ufs->phy); + return 0; } -- 2.37.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] ufs: ufs-exynos: change ufs phy control sequence 2022-07-05 6:54 ` [PATCH 3/3] ufs: ufs-exynos: change ufs phy control sequence Chanho Park @ 2022-07-05 9:36 ` Krzysztof Kozlowski 2022-07-06 1:51 ` Chanho Park 0 siblings, 1 reply; 8+ messages in thread From: Krzysztof Kozlowski @ 2022-07-05 9:36 UTC (permalink / raw) To: Chanho Park, Kishon Vijay Abraham I, Vinod Koul, James E . J . Bottomley, Martin K . Petersen, Alim Akhtar, Bart Van Assche Cc: linux-phy, linux-scsi, linux-arm-kernel, linux-samsung-soc On 05/07/2022 08:54, Chanho Park wrote: > Since commit 1599069a62c6 ("phy: core: Warn when phy_power_on is called > before phy_init"), below warning has been reported. > > phy_power_on was called before phy_init > > To address this, we need to remove phy_power_on from > exynos_ufs_phy_init and move it after phy_init. phy_power_off and > phy_exit are also necessary in exynos_ufs_remove. > > Signed-off-by: Chanho Park <chanho61.park@samsung.com> > --- > drivers/ufs/host/ufs-exynos.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c > index f971569bafc7..5718296e2521 100644 > --- a/drivers/ufs/host/ufs-exynos.c > +++ b/drivers/ufs/host/ufs-exynos.c > @@ -908,6 +908,8 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs) > goto out_exit_phy; > } > > + phy_power_on(generic_phy); What about phy_power_on() return code? > + > return 0; > > out_exit_phy: > @@ -1169,10 +1171,6 @@ static int exynos_ufs_init(struct ufs_hba *hba) > goto out; > } > > - ret = phy_power_on(ufs->phy); > - if (ret) > - goto phy_off; > - Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH 3/3] ufs: ufs-exynos: change ufs phy control sequence 2022-07-05 9:36 ` Krzysztof Kozlowski @ 2022-07-06 1:51 ` Chanho Park 0 siblings, 0 replies; 8+ messages in thread From: Chanho Park @ 2022-07-06 1:51 UTC (permalink / raw) To: 'Krzysztof Kozlowski', 'Kishon Vijay Abraham I', 'Vinod Koul', 'James E . J . Bottomley', 'Martin K . Petersen', 'Alim Akhtar', 'Bart Van Assche' Cc: linux-phy, linux-scsi, linux-arm-kernel, linux-samsung-soc > > Since commit 1599069a62c6 ("phy: core: Warn when phy_power_on is > > called before phy_init"), below warning has been reported. > > > > phy_power_on was called before phy_init > > > > To address this, we need to remove phy_power_on from > > exynos_ufs_phy_init and move it after phy_init. phy_power_off and > > phy_exit are also necessary in exynos_ufs_remove. > > > > Signed-off-by: Chanho Park <chanho61.park@samsung.com> > > --- > > drivers/ufs/host/ufs-exynos.c | 13 +++++++------ > > 1 file changed, 7 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/ufs/host/ufs-exynos.c > > b/drivers/ufs/host/ufs-exynos.c index f971569bafc7..5718296e2521 > > 100644 > > --- a/drivers/ufs/host/ufs-exynos.c > > +++ b/drivers/ufs/host/ufs-exynos.c > > @@ -908,6 +908,8 @@ static int exynos_ufs_phy_init(struct exynos_ufs > *ufs) > > goto out_exit_phy; > > } > > > > + phy_power_on(generic_phy); > > > What about phy_power_on() return code? I'll back the check next patch. Best Regards, Chanho Park _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-07-06 1:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20220705065722epcas2p3fad39b3edf1a0fd1789de77997bf5728@epcas2p3.samsung.com>
2022-07-05 6:54 ` [PATCH 0/3] change exynos ufs phy control Chanho Park
[not found] ` <CGME20220705065722epcas2p2973795cc88ee436480abcb48435059a8@epcas2p2.samsung.com>
2022-07-05 6:54 ` [PATCH 1/3] phy: samsung-ufs: convert phy clk usage to clk_bulk API Chanho Park
2022-07-05 9:30 ` Krzysztof Kozlowski
[not found] ` <CGME20220705065722epcas2p1e93a8511b906d5e111bff48a312d0603@epcas2p1.samsung.com>
2022-07-05 6:54 ` [PATCH 2/3] phy: samsung-ufs: ufs: change phy on/off control Chanho Park
2022-07-05 9:33 ` Krzysztof Kozlowski
[not found] ` <CGME20220705065722epcas2p3f9970697f6d1f1fed43e10fe17019619@epcas2p3.samsung.com>
2022-07-05 6:54 ` [PATCH 3/3] ufs: ufs-exynos: change ufs phy control sequence Chanho Park
2022-07-05 9:36 ` Krzysztof Kozlowski
2022-07-06 1:51 ` Chanho Park
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).