drm/msm/dsi: fix check-before-set in the 7nm dsi_pll code
PATCH 1/1 drm/msm/dsi: fix check-before-set in the 7nm dsi_pll code
Fix setting min/max DSI PLL rate for the V4.1 7nm DSI PLL (used on sm8250). Current code checks for pll->type before it is set (as it is set in the msm_dsi_pll_init() after calling device-specific functions.
--- drivers/gpu/drm/msm/dsi/pll/dsi_pll.c | 2 +- drivers/gpu/drm/msm/dsi/pll/dsi_pll.h | 6 ++++-- drivers/gpu/drm/msm/dsi/pll/dsi_pll_7nm.c | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/dsi/pll/dsi_pll.c +1 -1
@@ -163,7 +163,7 @@ struct msm_dsi_pll *msm_dsi_pll_init(struct platform_device *pdev,break ;case MSM_DSI_PHY_7NM :case MSM_DSI_PHY_7NM_V4_1 : - pll =msm_dsi_pll_7nm_init (pdev, id); + pll =msm_dsi_pll_7nm_init (pdev, type, id);break ;default : pll =ERR_PTR (-ENXIO );
drivers/gpu/drm/msm/dsi/pll/dsi_pll.h +4 -2
@@ -117,10 +117,12 @@ msm_dsi_pll_10nm_init(struct platform_device *pdev, int id) }#endif #ifdef CONFIG_DRM_MSM_DSI_7NM_PHY -struct msm_dsi_pll *msm_dsi_pll_7nm_init (struct platform_device *pdev,int id); +struct msm_dsi_pll *msm_dsi_pll_7nm_init (struct platform_device *pdev, +enum msm_dsi_phy_type type,int id);#else static inline struct msm_dsi_pll * -msm_dsi_pll_7nm_init (struct platform_device *pdev,int id) +msm_dsi_pll_7nm_init (struct platform_device *pdev, +enum msm_dsi_phy_type type,int id) {return ERR_PTR (-ENODEV ); }
drivers/gpu/drm/msm/dsi/pll/dsi_pll_7nm.c +3 -2
@@ -852,7 +852,8 @@ static int pll_7nm_register(struct dsi_pll_7nm *pll_7nm)return ret; } -struct msm_dsi_pll *msm_dsi_pll_7nm_init (struct platform_device *pdev,int id) +struct msm_dsi_pll *msm_dsi_pll_7nm_init (struct platform_device *pdev, +enum msm_dsi_phy_type type,int id) {struct dsi_pll_7nm *pll_7nm;struct msm_dsi_pll *pll;
@@ -885,7 +886,7 @@ struct msm_dsi_pll *msm_dsi_pll_7nm_init(struct platform_device *pdev, int id) pll = &pll_7nm->base; pll->min_rate =1000000000UL ; pll->max_rate =3500000000UL ; -if (pll->type ==MSM_DSI_PHY_7NM_V4_1 ) { +if (type ==MSM_DSI_PHY_7NM_V4_1 ) { pll->min_rate =600000000UL ; pll->max_rate = (unsigned long )5000000000ULL ;/* workaround for max rate overflowing on 32-bit builds: */
Signature · 6 lines
2.30.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Rob,
Any feedback on this? The patches were sent about two weeks ago.
Quoted 72 lines · Dmitry Baryshkov
Fix setting min/max DSI PLL rate for the V4.1 7nm DSI PLL (used on sm8250). Current code checks for
pll->typebefore it is set (as it is set in themsm_dsi_pll_init()after calling device-specific functions.Cc Jonathan Marek <[email protected]>Fixes 1ef7c99d145c ("drm/msm/dsi: add support for 7nm DSI PHY/PLL")Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/msm/dsi/pll/dsi_pll.c | 2 +- drivers/gpu/drm/msm/dsi/pll/dsi_pll.h | 6 ++++-- drivers/gpu/drm/msm/dsi/pll/dsi_pll_7nm.c | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-)drivers/gpu/drm/msm/dsi/pll/dsi_pll.c +1
-1@@ -163,7 +163,7 @@ struct msm_dsi_pll *msm_dsi_pll_init(struct platform_device *pdev,break ;case MSM_DSI_PHY_7NM :case MSM_DSI_PHY_7NM_V4_1 : - pll =msm_dsi_pll_7nm_init (pdev, id); + pll =msm_dsi_pll_7nm_init (pdev, type, id);break ;default : pll =ERR_PTR (-ENXIO );drivers/gpu/drm/msm/dsi/pll/dsi_pll.h +4
-2@@ -117,10 +117,12 @@ msm_dsi_pll_10nm_init(struct platform_device *pdev, int id) }#endif #ifdef CONFIG_DRM_MSM_DSI_7NM_PHY -struct msm_dsi_pll *msm_dsi_pll_7nm_init (struct platform_device *pdev,int id); +struct msm_dsi_pll *msm_dsi_pll_7nm_init (struct platform_device *pdev, +enum msm_dsi_phy_type type,int id);#else static inline struct msm_dsi_pll * -msm_dsi_pll_7nm_init (struct platform_device *pdev,int id) +msm_dsi_pll_7nm_init (struct platform_device *pdev, +enum msm_dsi_phy_type type,int id) {return ERR_PTR (-ENODEV ); }drivers/gpu/drm/msm/dsi/pll/dsi_pll_7nm.c +3
-3@@ -852,7 +852,8 @@ static int pll_7nm_register(struct dsi_pll_7nm *pll_7nm)return ret; } -struct msm_dsi_pll *msm_dsi_pll_7nm_init (struct platform_device *pdev,int id) +struct msm_dsi_pll *msm_dsi_pll_7nm_init (struct platform_device *pdev, +enum msm_dsi_phy_type type,int id) {struct dsi_pll_7nm *pll_7nm;struct msm_dsi_pll *pll;@@ -885,7 +886,7 @@ struct msm_dsi_pll *msm_dsi_pll_7nm_init(struct platform_device *pdev, int id) pll = &pll_7nm->base; pll->min_rate =1000000000UL ; pll->max_rate =3500000000UL ; -if (pll->type ==MSM_DSI_PHY_7NM_V4_1 ) { +if (type ==MSM_DSI_PHY_7NM_V4_1 ) { pll->min_rate =600000000UL ; pll->max_rate = (unsigned long )5000000000ULL ;/* workaround for max rate overflowing on 32-bit builds: */ --2.30.0
Signature · 6 lines
With best wishes Dmitry _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
This patch was applied to qcom/linux.git (refs/heads/for-next):
Hello:
This patch was applied to qcom/linux.git (refs/heads/for-next):
Quoted 9 lines · On Thu, 25 Feb 2021 01:47:51 +0300 you wrote:
Fix setting min/max DSI PLL rate for the V4.1 7nm DSI PLL (used on sm8250). Current code checks for
pll->typebefore it is set (as it is set in themsm_dsi_pll_init()after calling device-specific functions.Cc Jonathan Marek <[email protected]>Fixes 1ef7c99d145c ("drm/msm/dsi: add support for 7nm DSI PHY/PLL")Signed-off-by Dmitry Baryshkov <[email protected]>[...]
Here is the summary with links:
- drm/msm/dsi: fix check-before-set in the 7nm dsi_pll code
https://git.kernel.org/qcom/c/3b24cdfc721a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html