Skip to content

Commit 792ca7e

Browse files
committed
Merge tag 'drm-msm-fixes-2021-07-27' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
A few fixes for v5.14, including a fix for a crash if display triggers an iommu fault (which tends to happen at probe time on devices with bootloader fw that leaves display enabled as kernel starts) Signed-off-by: Dave Airlie <[email protected]> From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGubeV_uzWhsqp_+EmQmPcPatnqWOQnARoing2YvQOHbyg@mail.gmail.com
2 parents ff11764 + fc71c9e commit 792ca7e

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static const struct dpu_mdp_cfg sc7180_mdp[] = {
296296
static const struct dpu_mdp_cfg sm8250_mdp[] = {
297297
{
298298
.name = "top_0", .id = MDP_TOP,
299-
.base = 0x0, .len = 0x45C,
299+
.base = 0x0, .len = 0x494,
300300
.features = 0,
301301
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
302302
.clk_ctrls[DPU_CLK_CTRL_VIG0] = {

drivers/gpu/drm/msm/dp/dp_catalog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ int dp_catalog_panel_timing_cfg(struct dp_catalog *dp_catalog)
771771
dp_write_link(catalog, REG_DP_HSYNC_VSYNC_WIDTH_POLARITY,
772772
dp_catalog->width_blanking);
773773
dp_write_link(catalog, REG_DP_ACTIVE_HOR_VER, dp_catalog->dp_active);
774+
dp_write_p0(catalog, MMSS_DP_INTF_CONFIG, 0);
774775
return 0;
775776
}
776777

drivers/gpu/drm/msm/dp/dp_ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ static int dp_ctrl_process_phy_test_request(struct dp_ctrl_private *ctrl)
15261526
* running. Add the global reset just before disabling the
15271527
* link clocks and core clocks.
15281528
*/
1529-
ret = dp_ctrl_off(&ctrl->dp_ctrl);
1529+
ret = dp_ctrl_off_link_stream(&ctrl->dp_ctrl);
15301530
if (ret) {
15311531
DRM_ERROR("failed to disable DP controller\n");
15321532
return ret;

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ static int dp_display_bind(struct device *dev, struct device *master,
219219
goto end;
220220
}
221221

222+
dp->aux->drm_dev = drm;
222223
rc = dp_aux_register(dp->aux);
223224
if (rc) {
224225
DRM_ERROR("DRM DP AUX register failed\n");
@@ -1311,6 +1312,10 @@ static int dp_pm_resume(struct device *dev)
13111312
else
13121313
dp->dp_display.is_connected = false;
13131314

1315+
dp_display_handle_plugged_change(g_dp_display,
1316+
dp->dp_display.is_connected);
1317+
1318+
13141319
mutex_unlock(&dp->event_mutex);
13151320

13161321
return 0;

drivers/gpu/drm/msm/msm_iommu.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ static const struct iommu_flush_ops null_tlb_ops = {
142142
.tlb_add_page = msm_iommu_tlb_add_page,
143143
};
144144

145+
static int msm_fault_handler(struct iommu_domain *domain, struct device *dev,
146+
unsigned long iova, int flags, void *arg);
147+
145148
struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent)
146149
{
147150
struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(parent->dev);
@@ -157,6 +160,13 @@ struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent)
157160
if (!ttbr1_cfg)
158161
return ERR_PTR(-ENODEV);
159162

163+
/*
164+
* Defer setting the fault handler until we have a valid adreno_smmu
165+
* to avoid accidentially installing a GPU specific fault handler for
166+
* the display's iommu
167+
*/
168+
iommu_set_fault_handler(iommu->domain, msm_fault_handler, iommu);
169+
160170
pagetable = kzalloc(sizeof(*pagetable), GFP_KERNEL);
161171
if (!pagetable)
162172
return ERR_PTR(-ENOMEM);
@@ -300,7 +310,6 @@ struct msm_mmu *msm_iommu_new(struct device *dev, struct iommu_domain *domain)
300310

301311
iommu->domain = domain;
302312
msm_mmu_init(&iommu->base, dev, &funcs, MSM_MMU_IOMMU);
303-
iommu_set_fault_handler(domain, msm_fault_handler, iommu);
304313

305314
atomic_set(&iommu->pagetables, 0);
306315

0 commit comments

Comments
 (0)