This v2 collects both single patches from [1] and [2].
Changes in v2: * Added Reviewed-by: Marek Vasut marex@denx.de to patch 1 * Updated commit message of patch 2 as suggested by Marek
[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220121095644.3... [2] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220121131238.5...
Alexander Stein (2): drm: mxsfb: Use dev_err_probe() helper drm: mxsfb: Fix NULL pointer dereference
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +-- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-)
Use the dev_err_probe() helper, instead of open-coding the same operation. This also adds a nice hint in /sys/kernel/debug/devices_deferred.
Reviewed-by: Marek Vasut marex@denx.de Signed-off-by: Alexander Stein alexander.stein@ew.tq-group.com --- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index 375f26d4a417..c4da358f2154 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -258,8 +258,7 @@ static int mxsfb_load(struct drm_device *drm,
ret = mxsfb_attach_bridge(mxsfb); if (ret) { - if (ret != -EPROBE_DEFER) - dev_err(drm->dev, "Cannot connect bridge: %d\n", ret); + dev_err_probe(drm->dev, ret, "Cannot connect bridge\n"); goto err_vblank; }
On 2/2/22 09:17, Alexander Stein wrote:
Use the dev_err_probe() helper, instead of open-coding the same operation. This also adds a nice hint in /sys/kernel/debug/devices_deferred.
Reviewed-by: Marek Vasut marex@denx.de Signed-off-by: Alexander Stein alexander.stein@ew.tq-group.com
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
V2: ... what changed ... ?
(probably nothing, since the patch still looks fine)
Am Mittwoch, 2. Februar 2022, 09:29:20 CET schrieb Marek Vasut:
On 2/2/22 09:17, Alexander Stein wrote:
Use the dev_err_probe() helper, instead of open-coding the same operation. This also adds a nice hint in /sys/kernel/debug/devices_deferred.
Reviewed-by: Marek Vasut marex@denx.de Signed-off-by: Alexander Stein alexander.stein@ew.tq-group.com
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
V2: ... what changed ... ?
(probably nothing, since the patch still looks fine)
I put the changelog into cover letter (0/2). Content hasn't changed, I just added your Reviewed-by.
Regards, Alexander
On 2/2/22 09:58, Alexander Stein wrote:
Am Mittwoch, 2. Februar 2022, 09:29:20 CET schrieb Marek Vasut:
On 2/2/22 09:17, Alexander Stein wrote:
Use the dev_err_probe() helper, instead of open-coding the same operation. This also adds a nice hint in /sys/kernel/debug/devices_deferred.
Reviewed-by: Marek Vasut marex@denx.de Signed-off-by: Alexander Stein alexander.stein@ew.tq-group.com
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
V2: ... what changed ... ?
(probably nothing, since the patch still looks fine)
I put the changelog into cover letter (0/2). Content hasn't changed, I just added your Reviewed-by.
I missed it in the cover letter, got it.
On 2/2/22 10:03, Marek Vasut wrote:
On 2/2/22 09:58, Alexander Stein wrote:
Am Mittwoch, 2. Februar 2022, 09:29:20 CET schrieb Marek Vasut:
On 2/2/22 09:17, Alexander Stein wrote:
Use the dev_err_probe() helper, instead of open-coding the same operation. This also adds a nice hint in /sys/kernel/debug/devices_deferred.
Reviewed-by: Marek Vasut marex@denx.de Signed-off-by: Alexander Stein alexander.stein@ew.tq-group.com
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
V2: ... what changed ... ?
(probably nothing, since the patch still looks fine)
I put the changelog into cover letter (0/2). Content hasn't changed, I just added your Reviewed-by.
I missed it in the cover letter, got it.
Applied to drm-misc/drm-misc-next , thanks.
mxsfb should not never dereference the NULL pointer which drm_atomic_get_new_bridge_state is allowed to return. Assume a fixed format instead.
Fixes: commit b776b0f00f24 ("drm: mxsfb: Use bus_format from the nearest bridge if present") Signed-off-by: Alexander Stein alexander.stein@ew.tq-group.com --- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c index 0655582ae8ed..4cfb6c001679 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c @@ -361,7 +361,11 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, bridge_state = drm_atomic_get_new_bridge_state(state, mxsfb->bridge); - bus_format = bridge_state->input_bus_cfg.format; + if (!bridge_state) + bus_format = MEDIA_BUS_FMT_FIXED; + else + bus_format = bridge_state->input_bus_cfg.format; + if (bus_format == MEDIA_BUS_FMT_FIXED) { dev_warn_once(drm->dev, "Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24.\n"
On 2/2/22 09:17, Alexander Stein wrote:
mxsfb should not never dereference the NULL pointer which
... not ever ... but that's really a nitpick.
drm_atomic_get_new_bridge_state is allowed to return. Assume a fixed format instead.
Fixes: commit b776b0f00f24 ("drm: mxsfb: Use bus_format from the nearest bridge if present") Signed-off-by: Alexander Stein alexander.stein@ew.tq-group.com
It's perfect otherwise, thanks !
Am Mittwoch, 2. Februar 2022, 09:30:38 CET schrieb Marek Vasut:
On 2/2/22 09:17, Alexander Stein wrote:
mxsfb should not never dereference the NULL pointer which
... not ever ... but that's really a nitpick.
Doh, I just copied it from my mail... You want me to send a v2.1? Or will someone fix it when applying?
drm_atomic_get_new_bridge_state is allowed to return. Assume a fixed format instead.
Fixes: commit b776b0f00f24 ("drm: mxsfb: Use bus_format from the nearest bridge if present") Signed-off-by: Alexander Stein alexander.stein@ew.tq-group.com
It's perfect otherwise, thanks !
Thanks, Alexander
On 2/2/22 10:00, Alexander Stein wrote:
Am Mittwoch, 2. Februar 2022, 09:30:38 CET schrieb Marek Vasut:
On 2/2/22 09:17, Alexander Stein wrote:
mxsfb should not never dereference the NULL pointer which
... not ever ... but that's really a nitpick.
Doh, I just copied it from my mail... You want me to send a v2.1? Or will someone fix it when applying?
I think it can be fixed when applying, no worries.
On 2/2/22 10:03, Marek Vasut wrote:
On 2/2/22 10:00, Alexander Stein wrote:
Am Mittwoch, 2. Februar 2022, 09:30:38 CET schrieb Marek Vasut:
On 2/2/22 09:17, Alexander Stein wrote:
mxsfb should not never dereference the NULL pointer which
... not ever ... but that's really a nitpick.
Doh, I just copied it from my mail... You want me to send a v2.1? Or will someone fix it when applying?
I think it can be fixed when applying, no worries.
Applied to drm-misc/drm-misc-fixes , thanks.
dri-devel@lists.freedesktop.org