* [PATCH AUTOSEL 4.19 11/32] drm/bridge: lvds-encoder: Fix build error while CONFIG_DRM_KMS_HELPER=m
[not found] <20190806213522.19859-1-sashal@kernel.org>
@ 2019-08-06 21:34 ` Sasha Levin
[not found] ` <20190806213522.19859-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2019-08-06 21:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, Hulk Robot, YueHaibing, dri-devel, Neil Armstrong
From: YueHaibing <yuehaibing@huawei.com>
[ Upstream commit f4cc743a98136df3c3763050a0e8223b52d9a960 ]
If DRM_LVDS_ENCODER=y but CONFIG_DRM_KMS_HELPER=m,
build fails:
drivers/gpu/drm/bridge/lvds-encoder.o: In function `lvds_encoder_probe':
lvds-encoder.c:(.text+0x155): undefined reference to `devm_drm_panel_bridge_add'
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: dbb58bfd9ae6 ("drm/bridge: Fix lvds-encoder since the panel_bridge rework.")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190729071216.27488-1-yuehaibing@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/bridge/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index bf6cad6c9178b..7a3e5a8f6439b 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -46,6 +46,7 @@ config DRM_DUMB_VGA_DAC
config DRM_LVDS_ENCODER
tristate "Transparent parallel to LVDS encoder support"
depends on OF
+ select DRM_KMS_HELPER
select DRM_PANEL_BRIDGE
help
Support for transparent parallel to LVDS encoders that don't require
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 4.19 16/32] drm/amdgpu: fix a potential information leaking bug
[not found] ` <20190806213522.19859-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2019-08-06 21:35 ` Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 27/32] drm: msm: Fix add_gpu_components Sasha Levin
1 sibling, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2019-08-06 21:35 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
stable-u79uwXL29TY76Z2rM5mHXA
Cc: Sasha Levin, Chunming Zhou, Wang Xiayang,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alex Deucher,
Christian König
From: Wang Xiayang <xywang.sjtu@sjtu.edu.cn>
[ Upstream commit 929e571c04c285861e0bb049a396a2bdaea63282 ]
Coccinelle reports a path that the array "data" is never initialized.
The path skips the checks in the conditional branches when either
of callback functions, read_wave_vgprs and read_wave_sgprs, is not
registered. Later, the uninitialized "data" array is read
in the while-loop below and passed to put_user().
Fix the path by allocating the array with kcalloc().
The patch is simplier than adding a fall-back branch that explicitly
calls memset(data, 0, ...). Also it does not need the multiplication
1024*sizeof(*data) as the size parameter for memset() though there is
no risk of integer overflow.
Signed-off-by: Wang Xiayang <xywang.sjtu@sjtu.edu.cn>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index f5fb93795a69a..65cecfdd9b454 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -707,7 +707,7 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf,
thread = (*pos & GENMASK_ULL(59, 52)) >> 52;
bank = (*pos & GENMASK_ULL(61, 60)) >> 60;
- data = kmalloc_array(1024, sizeof(*data), GFP_KERNEL);
+ data = kcalloc(1024, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
--
2.20.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 4.19 21/32] drm/vgem: fix cache synchronization on arm/arm64
[not found] <20190806213522.19859-1-sashal@kernel.org>
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 11/32] drm/bridge: lvds-encoder: Fix build error while CONFIG_DRM_KMS_HELPER=m Sasha Levin
[not found] ` <20190806213522.19859-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2019-08-06 21:35 ` Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 28/32] drm/exynos: fix missing decrement of retry counter Sasha Levin
3 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2019-08-06 21:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Rob Clark, Daniel Vetter, Sean Paul, dri-devel, Sasha Levin
From: Rob Clark <robdclark@chromium.org>
[ Upstream commit 7e9e5ead55beacc11116b3fb90b0de6e7cf55a69 ]
drm_cflush_pages() is no-op on arm/arm64. But instead we can use
dma_sync API.
Fixes failures w/ vgem_test.
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190717211542.30482-1-robdclark@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/vgem/vgem_drv.c | 130 ++++++++++++++++++++------------
1 file changed, 83 insertions(+), 47 deletions(-)
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 4709f08f39e49..78c913f163851 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -47,10 +47,16 @@ static struct vgem_device {
struct platform_device *platform;
} *vgem_device;
+static void sync_and_unpin(struct drm_vgem_gem_object *bo);
+static struct page **pin_and_sync(struct drm_vgem_gem_object *bo);
+
static void vgem_gem_free_object(struct drm_gem_object *obj)
{
struct drm_vgem_gem_object *vgem_obj = to_vgem_bo(obj);
+ if (!obj->import_attach)
+ sync_and_unpin(vgem_obj);
+
kvfree(vgem_obj->pages);
mutex_destroy(&vgem_obj->pages_lock);
@@ -78,40 +84,15 @@ static vm_fault_t vgem_gem_fault(struct vm_fault *vmf)
return VM_FAULT_SIGBUS;
mutex_lock(&obj->pages_lock);
+ if (!obj->pages)
+ pin_and_sync(obj);
if (obj->pages) {
get_page(obj->pages[page_offset]);
vmf->page = obj->pages[page_offset];
ret = 0;
}
mutex_unlock(&obj->pages_lock);
- if (ret) {
- struct page *page;
-
- page = shmem_read_mapping_page(
- file_inode(obj->base.filp)->i_mapping,
- page_offset);
- if (!IS_ERR(page)) {
- vmf->page = page;
- ret = 0;
- } else switch (PTR_ERR(page)) {
- case -ENOSPC:
- case -ENOMEM:
- ret = VM_FAULT_OOM;
- break;
- case -EBUSY:
- ret = VM_FAULT_RETRY;
- break;
- case -EFAULT:
- case -EINVAL:
- ret = VM_FAULT_SIGBUS;
- break;
- default:
- WARN_ON(PTR_ERR(page));
- ret = VM_FAULT_SIGBUS;
- break;
- }
- }
return ret;
}
@@ -277,32 +258,93 @@ static const struct file_operations vgem_driver_fops = {
.release = drm_release,
};
-static struct page **vgem_pin_pages(struct drm_vgem_gem_object *bo)
+/* Called under pages_lock, except in free path (where it can't race): */
+static void sync_and_unpin(struct drm_vgem_gem_object *bo)
{
- mutex_lock(&bo->pages_lock);
- if (bo->pages_pin_count++ == 0) {
- struct page **pages;
+ struct drm_device *dev = bo->base.dev;
+
+ if (bo->table) {
+ dma_sync_sg_for_cpu(dev->dev, bo->table->sgl,
+ bo->table->nents, DMA_BIDIRECTIONAL);
+ sg_free_table(bo->table);
+ kfree(bo->table);
+ bo->table = NULL;
+ }
+
+ if (bo->pages) {
+ drm_gem_put_pages(&bo->base, bo->pages, true, true);
+ bo->pages = NULL;
+ }
+}
+
+static struct page **pin_and_sync(struct drm_vgem_gem_object *bo)
+{
+ struct drm_device *dev = bo->base.dev;
+ int npages = bo->base.size >> PAGE_SHIFT;
+ struct page **pages;
+ struct sg_table *sgt;
+
+ WARN_ON(!mutex_is_locked(&bo->pages_lock));
+
+ pages = drm_gem_get_pages(&bo->base);
+ if (IS_ERR(pages)) {
+ bo->pages_pin_count--;
+ mutex_unlock(&bo->pages_lock);
+ return pages;
+ }
- pages = drm_gem_get_pages(&bo->base);
- if (IS_ERR(pages)) {
- bo->pages_pin_count--;
- mutex_unlock(&bo->pages_lock);
- return pages;
- }
+ sgt = drm_prime_pages_to_sg(pages, npages);
+ if (IS_ERR(sgt)) {
+ dev_err(dev->dev,
+ "failed to allocate sgt: %ld\n",
+ PTR_ERR(bo->table));
+ drm_gem_put_pages(&bo->base, pages, false, false);
+ mutex_unlock(&bo->pages_lock);
+ return ERR_CAST(bo->table);
+ }
+
+ /*
+ * Flush the object from the CPU cache so that importers
+ * can rely on coherent indirect access via the exported
+ * dma-address.
+ */
+ dma_sync_sg_for_device(dev->dev, sgt->sgl,
+ sgt->nents, DMA_BIDIRECTIONAL);
+
+ bo->pages = pages;
+ bo->table = sgt;
+
+ return pages;
+}
+
+static struct page **vgem_pin_pages(struct drm_vgem_gem_object *bo)
+{
+ struct page **pages;
- bo->pages = pages;
+ mutex_lock(&bo->pages_lock);
+ if (bo->pages_pin_count++ == 0 && !bo->pages) {
+ pages = pin_and_sync(bo);
+ } else {
+ WARN_ON(!bo->pages);
+ pages = bo->pages;
}
mutex_unlock(&bo->pages_lock);
- return bo->pages;
+ return pages;
}
static void vgem_unpin_pages(struct drm_vgem_gem_object *bo)
{
+ /*
+ * We shouldn't hit this for imported bo's.. in the import
+ * case we don't own the scatter-table
+ */
+ WARN_ON(bo->base.import_attach);
+
mutex_lock(&bo->pages_lock);
if (--bo->pages_pin_count == 0) {
- drm_gem_put_pages(&bo->base, bo->pages, true, true);
- bo->pages = NULL;
+ WARN_ON(!bo->table);
+ sync_and_unpin(bo);
}
mutex_unlock(&bo->pages_lock);
}
@@ -310,18 +352,12 @@ static void vgem_unpin_pages(struct drm_vgem_gem_object *bo)
static int vgem_prime_pin(struct drm_gem_object *obj)
{
struct drm_vgem_gem_object *bo = to_vgem_bo(obj);
- long n_pages = obj->size >> PAGE_SHIFT;
struct page **pages;
pages = vgem_pin_pages(bo);
if (IS_ERR(pages))
return PTR_ERR(pages);
- /* Flush the object from the CPU cache so that importers can rely
- * on coherent indirect access via the exported dma-address.
- */
- drm_clflush_pages(pages, n_pages);
-
return 0;
}
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 4.19 27/32] drm: msm: Fix add_gpu_components
[not found] ` <20190806213522.19859-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 16/32] drm/amdgpu: fix a potential information leaking bug Sasha Levin
@ 2019-08-06 21:35 ` Sasha Levin
1 sibling, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2019-08-06 21:35 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
stable-u79uwXL29TY76Z2rM5mHXA
Cc: Sasha Levin, Jeffrey Hugo, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Rob Clark, Sean Paul,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
From: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
[ Upstream commit 9ca7ad6c7706edeae331c1632d0c63897418ebad ]
add_gpu_components() adds found GPU nodes from the DT to the match list,
regardless of the status of the nodes. This is a problem, because if the
nodes are disabled, they should not be on the match list because they will
not be matched. This prevents display from initing if a GPU node is
defined, but it's status is disabled.
Fix this by checking the node's status before adding it to the match list.
Fixes: dc3ea265b856 (drm/msm: Drop the gpu binding)
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190626180015.45242-1-jeffrey.l.hugo@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/msm_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index ed9a3a1e50efb..dbfd2c006f740 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -1284,7 +1284,8 @@ static int add_gpu_components(struct device *dev,
if (!np)
return 0;
- drm_of_component_match_add(dev, matchptr, compare_of, np);
+ if (of_device_is_available(np))
+ drm_of_component_match_add(dev, matchptr, compare_of, np);
of_node_put(np);
--
2.20.1
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 4.19 28/32] drm/exynos: fix missing decrement of retry counter
[not found] <20190806213522.19859-1-sashal@kernel.org>
` (2 preceding siblings ...)
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 21/32] drm/vgem: fix cache synchronization on arm/arm64 Sasha Levin
@ 2019-08-06 21:35 ` Sasha Levin
3 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2019-08-06 21:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Colin Ian King, dri-devel, Sasha Levin
From: Colin Ian King <colin.king@canonical.com>
[ Upstream commit 1bbbab097a05276e312dd2462791d32b21ceb1ee ]
Currently the retry counter is not being decremented, leading to a
potential infinite spin if the scalar_reads don't change state.
Addresses-Coverity: ("Infinite loop")
Fixes: 280e54c9f614 ("drm/exynos: scaler: Reset hardware before starting the operation")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/exynos/exynos_drm_scaler.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c
index 0ddb6eec7b113..df228436a03d9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c
@@ -108,12 +108,12 @@ static inline int scaler_reset(struct scaler_context *scaler)
scaler_write(SCALER_CFG_SOFT_RESET, SCALER_CFG);
do {
cpu_relax();
- } while (retry > 1 &&
+ } while (--retry > 1 &&
scaler_read(SCALER_CFG) & SCALER_CFG_SOFT_RESET);
do {
cpu_relax();
scaler_write(1, SCALER_INT_EN);
- } while (retry > 0 && scaler_read(SCALER_INT_EN) != 1);
+ } while (--retry > 0 && scaler_read(SCALER_INT_EN) != 1);
return retry ? 0 : -EIO;
}
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-08-06 21:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20190806213522.19859-1-sashal@kernel.org>
2019-08-06 21:34 ` [PATCH AUTOSEL 4.19 11/32] drm/bridge: lvds-encoder: Fix build error while CONFIG_DRM_KMS_HELPER=m Sasha Levin
[not found] ` <20190806213522.19859-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 16/32] drm/amdgpu: fix a potential information leaking bug Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 27/32] drm: msm: Fix add_gpu_components Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 21/32] drm/vgem: fix cache synchronization on arm/arm64 Sasha Levin
2019-08-06 21:35 ` [PATCH AUTOSEL 4.19 28/32] drm/exynos: fix missing decrement of retry counter Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox