lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <153735739367.31835.11641995651905357659@skylake-alporthouse-com>
Date:   Wed, 19 Sep 2018 12:43:13 +0100
From:   Chris Wilson <chris@...is-wilson.co.uk>
To:     Chris Chiu <chiu@...lessm.com>, airlied@...ux.ie,
        jani.nikula@...el.com, joonas.lahtinen@...ux.intel.com,
        rodrigo.vivi@...el.com
Cc:     Chris Chiu <chiu@...lessm.com>, intel-gfx@...ts.freedesktop.org,
        linux@...lessm.com, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: re-check the hotplug with a delayed work

Quoting Chris Chiu (2018-09-19 12:29:33)
> I have few ASUS laptops, X705FD(Intel i7-8565), X560UD(Intel i5-8250U)
> and X530UN(Intel i7-8550U) share the same problem. The HDMI connector
> status stays 'connected' even the HDMI cable has been unplugged.
> Then the status in sysfs would never change since then until we
> do 'xrandr' to reprobe the devices. It would also cause the audio
> output path cannot correctly swicth based on the connector status.
> 
> This commit kicks off a delayed work when the status remains unchanged
> in the first hotplug event handling, which may not be the perfect
> timing in some special cases.
> 
> Signed-off-by: Chris Chiu <chiu@...lessm.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      |  1 +
>  drivers/gpu/drm/i915/intel_hotplug.c | 35 +++++++++++++++++++++++++++++++----
>  2 files changed, 32 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index d51d8574a679..78e2cf09cc10 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -286,6 +286,7 @@ struct i915_hotplug {
>         } stats[HPD_NUM_PINS];
>         u32 event_bits;
>         struct delayed_work reenable_work;
> +       struct delayed_work recheck_work;
>  
>         struct intel_digital_port *irq_port[I915_MAX_PORTS];
>         u32 long_port_mask;
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
> index 43aa92beff2a..089a24588ec8 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -349,14 +349,15 @@ static void i915_digport_work_func(struct work_struct *work)
>         }
>  }
>  
> +#define HPD_RECHECK_DELAY        (2 * 1000)

Or just (2 * HZ)

>  /*
>   * Handle hotplug events outside the interrupt handler proper.
>   */
> -static void i915_hotplug_work_func(struct work_struct *work)
> +static void do_i915_hotplug_check(struct work_struct *work,
> +                                  struct drm_i915_private *dev_priv,
> +                                  struct drm_device *dev, bool do_recheck)

struct drm_i915_private == struct drm_device, no need for tautology

Local struct drm_device *dev = &i915->drm; are eliminated by the
compiler.
-Chris

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ