Re: [Freedreno] [PATCH V2 0/8] opp: Unconditionally call dev_pm_opp_of_remove_table()

2020-09-09 Thread Viresh Kumar
On 31-08-20, 16:39, Viresh Kumar wrote:
> On 28-08-20, 11:37, Viresh Kumar wrote:
> > Hello,
> > 
> > This cleans up some of the user code around calls to
> > dev_pm_opp_of_remove_table().
> > 
> > All the patches can be picked by respective maintainers directly except
> > for the last patch, which needs the previous two to get merged first.
> > 
> > These are based for 5.9-rc1.
>  
> > Viresh Kumar (8):
> >   cpufreq: imx6q: Unconditionally call dev_pm_opp_of_remove_table()
> >   drm/lima: Unconditionally call dev_pm_opp_of_remove_table()
> >   drm/msm: Unconditionally call dev_pm_opp_of_remove_table()
> >   mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table()
> >   spi: spi-geni-qcom: Unconditionally call dev_pm_opp_of_remove_table()
> >   spi: spi-qcom-qspi: Unconditionally call dev_pm_opp_of_remove_table()
> >   tty: serial: qcom_geni_serial: Unconditionally call
> > dev_pm_opp_of_remove_table()
> >   qcom-geni-se: remove has_opp_table
> 
> During testing by some of the Linaro folks on linux-next, we found out
> that there was a bug in the OPP core (which makes the kernel crash in
> some corner cases with these patches) for which I have sent a fix
> today which should be part of 5.9-rc4:
> 
> https://lore.kernel.org/lkml/922ff0759a16299e24cacfc981ac07914d8f1826.1598865786.git.viresh.ku...@linaro.org/
> 
> Please apply the patches over rc4 only once it comes out (I will
> confirm by that time once the patch gets merged). Else you guys can
> provide your Ack and I can take the patches through OPP tree.

The fix got merged in 5.9-rc4, please apply the patches from this
series in your trees and base them on rc4. Thanks.

-- 
viresh
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno


Re: [Freedreno] [PATCH V2 0/8] opp: Unconditionally call dev_pm_opp_of_remove_table()

2020-09-09 Thread Mark Brown
On Fri, 28 Aug 2020 11:37:45 +0530, Viresh Kumar wrote:
> This cleans up some of the user code around calls to
> dev_pm_opp_of_remove_table().
> 
> All the patches can be picked by respective maintainers directly except
> for the last patch, which needs the previous two to get merged first.
> 
> These are based for 5.9-rc1.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/2] spi: spi-geni-qcom: Unconditionally call dev_pm_opp_of_remove_table()
  commit: 7d568edff5cb7968cc5f29e85da15f941b8070b8
[2/2] spi: spi-qcom-qspi: Unconditionally call dev_pm_opp_of_remove_table()
  commit: 062cf7fc927d2546b58ed128383e5c52f26a00a5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno


[Freedreno] [PATCH v5] drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets

2020-09-09 Thread Kuogee Hsieh
add event thread to execute events serially from event queue. Also
timeout mode is supported  which allow an event be deferred to be
executed at later time. Both link and phy compliant tests had been
done successfully.

Changes in v2:
- Fix potential deadlock by removing redundant connect_mutex
- Check and enable link clock during modeset
- Drop unused code and fix function prototypes.
- set sink power to normal operation state (D0) before DPCD read

Changes in v3:
- push idle pattern at main link before timing generator off
- add timeout handles for both connect and disconnect

Changes in v4:
- add ST_SUSPEND_PENDING to handles suspend/modeset test operations
- clear dp phy aux interrupt status when ERR_DPPHY_AUX error
- send segment addr during edid read
- clear bpp depth before MISC register write

Changes in v5:
- add ST_SUSPENDED to fix crash at resume

Signed-off-by: Kuogee Hsieh 

This patch depends-on following series:
https://lore.kernel.org/dri-devel/20200827211658.27479-1-tan...@codeaurora.org/
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c |   6 +
 drivers/gpu/drm/msm/dp/dp_aux.c |   1 +
 drivers/gpu/drm/msm/dp/dp_catalog.c |  77 +-
 drivers/gpu/drm/msm/dp/dp_ctrl.c| 370 ++---
 drivers/gpu/drm/msm/dp/dp_ctrl.h|   3 +-
 drivers/gpu/drm/msm/dp/dp_display.c | 804 +---
 drivers/gpu/drm/msm/dp/dp_display.h |   1 -
 drivers/gpu/drm/msm/dp/dp_drm.c |   4 -
 drivers/gpu/drm/msm/dp/dp_hpd.c |   2 +-
 drivers/gpu/drm/msm/dp/dp_hpd.h |   1 +
 drivers/gpu/drm/msm/dp/dp_link.c|  22 +-
 drivers/gpu/drm/msm/dp/dp_panel.c   |  78 +-
 drivers/gpu/drm/msm/dp/dp_panel.h   |   9 +-
 drivers/gpu/drm/msm/dp/dp_parser.c  |  42 +-
 drivers/gpu/drm/msm/dp/dp_parser.h  |   2 +
 drivers/gpu/drm/msm/dp/dp_power.c   |  46 +-
 drivers/gpu/drm/msm/dp/dp_power.h   |  13 +
 drivers/gpu/drm/msm/dp/dp_reg.h |   1 +
 drivers/gpu/drm/msm/msm_drv.h   |   1 +
 19 files changed, 1025 insertions(+), 458 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 6a9e257d2fe6..81373bd38f0b 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -1221,6 +1221,11 @@ static void dpu_encoder_virt_disable(struct drm_encoder 
*drm_enc)
/* wait for idle */
dpu_encoder_wait_for_event(drm_enc, MSM_ENC_TX_COMPLETE);
 
+   if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) {
+   if (msm_dp_display_pre_disable(priv->dp, drm_enc))
+   DPU_ERROR_ENC(dpu_enc, "dp display push idle failed\n");
+   }
+
dpu_encoder_resource_control(drm_enc, DPU_ENC_RC_EVENT_PRE_STOP);
 
for (i = 0; i < dpu_enc->num_phys_encs; i++) {
@@ -1230,6 +1235,7 @@ static void dpu_encoder_virt_disable(struct drm_encoder 
*drm_enc)
phys->ops.disable(phys);
}
 
+
/* after phys waits for frame-done, should be no more frames pending */
if (atomic_xchg(&dpu_enc->frame_done_timeout_ms, 0)) {
DPU_ERROR("enc%d timeout pending\n", drm_enc->base.id);
diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c
index 6bf3a5712968..d742b4d870b3 100644
--- a/drivers/gpu/drm/msm/dp/dp_aux.c
+++ b/drivers/gpu/drm/msm/dp/dp_aux.c
@@ -384,6 +384,7 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux,
PHY_AUX_CFG1);
dp_catalog_aux_reset(aux->catalog);
}
+   usleep_range(400, 500); /* at least 400us to next try */
goto unlock_exit;
}
 
diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c 
b/drivers/gpu/drm/msm/dp/dp_catalog.c
index c16072630d40..67abb90953e4 100644
--- a/drivers/gpu/drm/msm/dp/dp_catalog.c
+++ b/drivers/gpu/drm/msm/dp/dp_catalog.c
@@ -536,16 +536,21 @@ void dp_catalog_ctrl_mainlink_ctrl(struct dp_catalog 
*dp_catalog,
 * To make sure link reg writes happens before other operation,
 * dp_write_link() function uses writel()
 */
-   dp_write_link(catalog, REG_DP_MAINLINK_CTRL,
-   DP_MAINLINK_FB_BOUNDARY_SEL);
-   dp_write_link(catalog, REG_DP_MAINLINK_CTRL,
-   DP_MAINLINK_FB_BOUNDARY_SEL |
-   DP_MAINLINK_CTRL_RESET);
-   dp_write_link(catalog, REG_DP_MAINLINK_CTRL,
+   mainlink_ctrl = dp_read_link(catalog, REG_DP_MAINLINK_CTRL);
+
+   mainlink_ctrl &= ~(DP_MAINLINK_CTRL_RESET |
+   DP_MAINLINK_CTRL_ENABLE);
+   dp_write_link(catalog, REG_DP_MAINLINK_CTRL, mainlink_ctrl);
+
+   mainlink_ctrl |= DP_MAINLINK_CTRL_RESET;