commit 518cb7057a59b9441336d2e88a396d52b6ab0cce upstream.
I was recently seeing issues with EDID probing, where
the logic to wait for the EDID read bit to be set by the
IRQ wasn't happening and the code would time out and fail.
Digging deeper, I found this was due to the fact that
IRQs were disabled as we were running in IRQ context from
the HPD signal.
Thus this patch changes the logic to handle the HPD signal
via a work_struct so we can be out of irq context.
With this patch, the EDID …
[View More]probing on hotplug does not time
out.
Cc: David Airlie <airlied(a)linux.ie>
Cc: Archit Taneja <architt(a)codeaurora.org>
Cc: Wolfram Sang <wsa+renesas(a)sang-engineering.com>
Cc: Lars-Peter Clausen <lars(a)metafoo.de>
Cc: Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
Cc: dri-devel(a)lists.freedesktop.org
Cc: stable(a)vger.kernel.org
Reviewed-by: Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
Signed-off-by: John Stultz <john.stultz(a)linaro.org>
Signed-off-by: Archit Taneja <architt(a)codeaurora.org>
Signed-off-by: Thong Ho <thong.ho.px(a)rvc.renesas.com>
Signed-off-by: Nhan Nguyen <nhan.nguyen.yb(a)renesas.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-2-git-send-em…
---
drivers/gpu/drm/i2c/adv7511.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i2c/adv7511.c b/drivers/gpu/drm/i2c/adv7511.c
index a79b612..f8a8a0b 100644
--- a/drivers/gpu/drm/i2c/adv7511.c
+++ b/drivers/gpu/drm/i2c/adv7511.c
@@ -36,7 +36,10 @@ struct adv7511 {
bool edid_read;
wait_queue_head_t wq;
+ struct work_struct hpd_work;
+
struct drm_encoder *encoder;
+ struct drm_connector connector;
bool embedded_sync;
enum adv7511_sync_polarity vsync_polarity;
@@ -429,6 +432,13 @@ static bool adv7511_hpd(struct adv7511 *adv7511)
return false;
}
+static void adv7511_hpd_work(struct work_struct *work)
+{
+ struct adv7511 *adv7511 = container_of(work, struct adv7511, hpd_work);
+
+ drm_helper_hpd_irq_event(adv7511->connector.dev);
+}
+
static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd)
{
unsigned int irq0, irq1;
@@ -446,7 +456,7 @@ static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd)
regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1);
if (process_hpd && irq0 & ADV7511_INT0_HDP && adv7511->encoder)
- drm_helper_hpd_irq_event(adv7511->encoder->dev);
+ schedule_work(&adv7511->hpd_work);
if (irq0 & ADV7511_INT0_EDID_READY || irq1 & ADV7511_INT1_DDC_ERROR) {
adv7511->edid_read = true;
@@ -922,6 +932,8 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
if (!adv7511->i2c_edid)
return -ENOMEM;
+ INIT_WORK(&adv7511->hpd_work, adv7511_hpd_work);
+
if (i2c->irq) {
init_waitqueue_head(&adv7511->wq);
--
1.9.1
[View Less]
Hi Linus,
Since Dave is on paternity leave we are sending drm/i915 fixes for
v4.14-rc1 directly to you as he had asked us to do.
The most critical ones are the GPU reset fix for gen2-4 and GVT fix
for a regression that is blocking gvt init to work on your tree.
The rest is general fixes for patches coming from drm-next.
Thanks,
Rodrigo.
The following changes since commit 7846b12fe0b5feab5446d892f41b5140c1419109:
Merge branch 'drm-vmwgfx-next' of git://people.freedesktop.org/~syeh/…
[View More]repos_linux into drm-next (2017-08-29 10:38:14 +1000)
are available in the git repository at:
git://anongit.freedesktop.org/git/drm-intel tags/drm-intel-next-fixes-2017-09-07
for you to fetch changes up to 426ca2cb69cda59f32c251d1f3e111aee8c42814:
Merge tag 'gvt-fixes-2017-09-06' of https://github.com/01org/gvt-linux into drm-intel-next-fixes (2017-09-06 13:34:13 -0700)
----------------------------------------------------------------
drm/i915 fixes for v4.14-rc1
----------------------------------------------------------------
Chris Wilson (6):
drm/i915: Quietly cancel FBC activation if CRTC is turned off before worker
drm/i915: Recreate vmapping even when the object is pinned
drm/i915: Always wake the device to flush the GTT
drm/i915: Ignore duplicate VMA stored within the per-object handle LUT
drm/i915: Silence sparse by using gfp_t
drm/i915: Re-enable GTT following a device reset
Jian Jun Chen (1):
drm/i915/gvt: Remove one duplicated MMIO
Manasi Navare (1):
drm/i915/edp: Increase T12 panel delay to 900 ms to fix DP AUX CH timeouts
Rodrigo Vivi (1):
Merge tag 'gvt-fixes-2017-09-06' of https://github.com/01org/gvt-linux into drm-intel-next-fixes
Ville Syrjälä (7):
drm/i915: Treat fb->offsets[] as a raw byte offset instead of a linear offset
drm/i915: Skip fence alignemnt check for the CCS plane
drm/i915: Make i9xx_load_ycbcr_conversion_matrix() static
drm/i915: Make i2c lock ops static
drm/i915: Fix enum pipe vs. enum transcoder for the PCH transcoder
drm/i915: Add __rcu to radix tree slot pointer
drm/i915: Annotate user relocs with __user
Zhi Wang (1):
drm/i915: Fix the missing PPAT cache attributes on CNL
drivers/gpu/drm/i915/gvt/handlers.c | 1 -
drivers/gpu/drm/i915/i915_cmd_parser.c | 2 +-
drivers/gpu/drm/i915/i915_drv.c | 12 +++-
drivers/gpu/drm/i915/i915_drv.h | 3 +
drivers/gpu/drm/i915/i915_gem.c | 28 +++++---
drivers/gpu/drm/i915/i915_gem_execbuffer.c | 9 ++-
drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +--
drivers/gpu/drm/i915/i915_trace.h | 4 +-
drivers/gpu/drm/i915/i915_vma.h | 6 ++
drivers/gpu/drm/i915/intel_color.c | 2 +-
drivers/gpu/drm/i915/intel_display.c | 110 +++++++++++++++++------------
drivers/gpu/drm/i915/intel_dp.c | 2 +-
drivers/gpu/drm/i915/intel_fbc.c | 4 +-
drivers/gpu/drm/i915/intel_fifo_underrun.c | 20 +++---
drivers/gpu/drm/i915/intel_i2c.c | 2 +-
drivers/gpu/drm/i915/intel_sdvo.c | 2 +-
16 files changed, 130 insertions(+), 85 deletions(-)
[View Less]
From: Eric Biggers <ebiggers(a)google.com>
IDR only supports non-negative IDs. There used to be a
'WARN_ON_ONCE(id < 0)' in idr_replace(), but it was intentionally
removed by commit 2e1c9b286765 ("idr: remove WARN_ON_ONCE() on negative
IDs"). Then it was added back by commit 0a835c4f090a ("Reimplement IDR
and IDA using the radix tree"). However it seems that adding it back
was a mistake, given that some users such as drm_gem_handle_delete()
(DRM_IOCTL_GEM_CLOSE) pass in a value …
[View More]from userspace to idr_replace(),
allowing the WARN_ON_ONCE to be triggered. drm_gem_handle_delete()
actually just wants idr_replace() to return an error code if the ID is
not allocated, including in the case where the ID is invalid (negative).
So once again remove the bogus WARN_ON_ONCE().
This bug was found by syzkaller, which encountered the following
warning:
WARNING: CPU: 3 PID: 3008 at lib/idr.c:157 idr_replace+0x1d8/0x240 lib/idr.c:157
Kernel panic - not syncing: panic_on_warn set ...
CPU: 3 PID: 3008 Comm: syzkaller218828 Not tainted 4.13.0-rc4-next-20170811 #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:16 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:52
panic+0x1e4/0x417 kernel/panic.c:180
__warn+0x1c4/0x1d9 kernel/panic.c:541
report_bug+0x211/0x2d0 lib/bug.c:183
fixup_bug+0x40/0x90 arch/x86/kernel/traps.c:190
do_trap_no_signal arch/x86/kernel/traps.c:224 [inline]
do_trap+0x260/0x390 arch/x86/kernel/traps.c:273
do_error_trap+0x120/0x390 arch/x86/kernel/traps.c:310
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:323
invalid_op+0x1e/0x30 arch/x86/entry/entry_64.S:930
RIP: 0010:idr_replace+0x1d8/0x240 lib/idr.c:157
RSP: 0018:ffff8800394bf9f8 EFLAGS: 00010297
RAX: ffff88003c6c60c0 RBX: 1ffff10007297f43 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8800394bfa78
RBP: ffff8800394bfae0 R08: ffffffff82856487 R09: 0000000000000000
R10: ffff8800394bf9a8 R11: ffff88006c8bae28 R12: ffffffffffffffff
R13: ffff8800394bfab8 R14: dffffc0000000000 R15: ffff8800394bfbc8
drm_gem_handle_delete+0x33/0xa0 drivers/gpu/drm/drm_gem.c:297
drm_gem_close_ioctl+0xa1/0xe0 drivers/gpu/drm/drm_gem.c:671
drm_ioctl_kernel+0x1e7/0x2e0 drivers/gpu/drm/drm_ioctl.c:729
drm_ioctl+0x72e/0xa50 drivers/gpu/drm/drm_ioctl.c:825
vfs_ioctl fs/ioctl.c:45 [inline]
do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:685
SYSC_ioctl fs/ioctl.c:700 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
entry_SYSCALL_64_fastpath+0x1f/0xbe
Here is a C reproducer:
#include <fcntl.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/ioctl.h>
#include <drm/drm.h>
int main(void)
{
int cardfd = open("/dev/dri/card0", O_RDONLY);
ioctl(cardfd, DRM_IOCTL_GEM_CLOSE,
&(struct drm_gem_close) { .handle = -1 } );
}
Fixes: 0a835c4f090a ("Reimplement IDR and IDA using the radix tree")
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Cc: Chris Wilson <chris(a)chris-wilson.co.uk>
Cc: Dmitry Vyukov <dvyukov(a)google.com>
Cc: Matthew Wilcox <mawilcox(a)microsoft.com>
Cc: Tejun Heo <tj(a)kernel.org>
Cc: dri-devel(a)lists.freedesktop.org
Cc: <stable(a)vger.kernel.org> [v4.11+]
Signed-off-by: Eric Biggers <ebiggers(a)google.com>
---
lib/idr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/idr.c b/lib/idr.c
index 082778cf883e..f9adf4805fd7 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -151,7 +151,7 @@ EXPORT_SYMBOL(idr_get_next_ext);
*/
void *idr_replace(struct idr *idr, void *ptr, int id)
{
- if (WARN_ON_ONCE(id < 0))
+ if (id < 0)
return ERR_PTR(-EINVAL);
return idr_replace_ext(idr, ptr, id);
--
2.14.1.581.gf28d330327-goog
[View Less]
If we cannot find a panel, assume that the output from the
PL111 is connected directly to a "dumb" VGA connector,
so look up the connector from that bridge.
Signed-off-by: Linus Walleij <linus.walleij(a)linaro.org>
---
This is how the new API is used in the PL111.
---
drivers/gpu/drm/pl111/Kconfig | 1 +
drivers/gpu/drm/pl111/pl111_drv.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/pl111/Kconfig b/drivers/gpu/drm/pl111/Kconfig
index e5e2abd66491..…
[View More]82cb3e60ddc8 100644
--- a/drivers/gpu/drm/pl111/Kconfig
+++ b/drivers/gpu/drm/pl111/Kconfig
@@ -8,6 +8,7 @@ config DRM_PL111
select DRM_GEM_CMA_HELPER
select DRM_BRIDGE
select DRM_PANEL_BRIDGE
+ select DRM_DUMB_VGA_DAC
select VT_HW_CONSOLE_BINDING if FRAMEBUFFER_CONSOLE
help
Choose this option for DRM support for the PL111 CLCD controller.
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index f5bc6f160e60..6db423bbd84e 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -67,6 +67,7 @@
#include <drm/drm_of.h>
#include <drm/drm_bridge.h>
#include <drm/drm_panel.h>
+#include <drm/dumb_vga_dac.h>
#include "pl111_drm.h"
#include "pl111_versatile.h"
@@ -128,6 +129,8 @@ static int pl111_modeset_init(struct drm_device *dev)
if (panel) {
priv->panel = panel;
priv->connector = panel->connector;
+ } else {
+ priv->connector = drm_dumb_vga_get_connector(bridge);
}
priv->bridge = bridge;
--
2.13.5
[View Less]
https://bugs.freedesktop.org/show_bug.cgi?id=102417
Chris Wilson <chris(a)chris-wilson.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|intel-gfx-bugs(a)lists.freede |dri-devel(a)lists.freedesktop
|sktop.org |.org
QA Contact|intel-gfx-bugs(a)lists.freede |
|sktop.org |
Component|…
[View More]DRM/Intel |IGT
--
You are receiving this mail because:
You are the assignee for the bug.
[View Less]
https://bugs.freedesktop.org/show_bug.cgi?id=102543
--- Comment #5 from Chris Wilson <chris(a)chris-wilson.co.uk> ---
commit d7a133d886b45651e36e7065998b1413d379ac1f
Author: Chris Wilson <chris(a)chris-wilson.co.uk>
Date: Thu Sep 7 14:44:41 2017 +0100
drm/i915: Disable mmio debugging during user access
If the user bypasses i915 and accesses mmio directly, that easily
confuses our automatic mmio debugging (any error we then detect is
likely to be as a result of …
[View More]the user). Since we expect userspace to open
debugfs/i915_forcewake_user if i915.ko is loaded and they want mmio
access, that makes the opportune time to disable our debugging for
duration of the bypass.
v2: Move the fiddling of uncore internals to uncore.c
The issue in intel_reg_dump is still there, just not triggering a kernel
warning.
--
You are receiving this mail because:
You are the assignee for the bug.
[View Less]
https://bugs.freedesktop.org/show_bug.cgi?id=100596
--- Comment #18 from Hector Velazquez <hector.franciscox.velazquez.suriano(a)intel.com> ---
Sorry, this test was not executed and is not part of this bug... :
igt@kms_sysfs_edid_timing
--
You are receiving this mail because:
You are the assignee for the bug.