On Mon, Jul 31, 2023 at 10:04:44PM +0200, Claudio Jeker wrote:
> On Mon, Jul 31, 2023 at 09:49:30PM +0200, Claudio Jeker wrote:
> > On Mon, Jul 31, 2023 at 08:03:41PM +0300, Vitaliy Makkoveev wrote:
> > > This is the culprit:
> > > 
> > > schedule_timeout_uninterruptible(long timeout)
> > > {
> > >         tsleep(curproc, PWAIT, "schtou", timeout);
> > >         return 0;
> > > }
> > > 
> > 
> > Please give this a try. I think on initialization
> > intel_dp_wait_source_oui() is called before intel_dp->last_oui_write is
> > set and this results in a 10min timeout because our jiffies are set to
> > ULONG_MAX - (10 * 60 * HZ);
> 
> After talking with kettenis@ I think the following diff is better.
> Starting with 0 jiffies should fix this issue.
> Unless we want to do the linux madness and set it to
>       ((unsigned long)(unsigned int) (-300*HZ))
> 
> -- 
> :wq Claudio
> 
> Index: kern_clock.c
> ===================================================================
> RCS file: /cvs/src/sys/kern/kern_clock.c,v
> retrieving revision 1.109
> diff -u -p -r1.109 kern_clock.c
> --- kern_clock.c      25 Jul 2023 18:16:19 -0000      1.109
> +++ kern_clock.c      31 Jul 2023 20:01:57 -0000
> @@ -84,7 +84,7 @@ int profhz;
>  int  profprocs;
>  int  ticks = INT_MAX - (15 * 60 * HZ);
>  
> -volatile unsigned long jiffies = ULONG_MAX - (10 * 60 * HZ);
> +volatile unsigned long jiffies;
>  
>  /*
>   * Initialize clock frequencies and start both clocks running.
> 

This diff contains all of diffs you posted to this thread. Works fine
with hunks 1 and 2 together as with any of them separately.

Index: sys/dev/pci/drm/i915/display/intel_dp.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/i915/display/intel_dp.c,v
retrieving revision 1.14
diff -u -p -r1.14 intel_dp.c
--- sys/dev/pci/drm/i915/display/intel_dp.c     28 Jul 2023 06:56:32 -0000      
1.14
+++ sys/dev/pci/drm/i915/display/intel_dp.c     31 Jul 2023 20:38:05 -0000
@@ -2228,6 +2228,8 @@ void intel_dp_wait_source_oui(struct int
        struct drm_i915_private *i915 = dp_to_i915(intel_dp);
 
        drm_dbg_kms(&i915->drm, "Performing OUI wait\n");
+       if (intel_dp->last_oui_write == 0)
+               intel_dp->last_oui_write = jiffies;
        wait_remaining_ms_from_jiffies(intel_dp->last_oui_write, 30);
 }
 
Index: sys/kern/kern_clock.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_clock.c,v
retrieving revision 1.109
diff -u -p -r1.109 kern_clock.c
--- sys/kern/kern_clock.c       25 Jul 2023 18:16:19 -0000      1.109
+++ sys/kern/kern_clock.c       31 Jul 2023 20:38:05 -0000
@@ -84,7 +84,7 @@ int   profhz;
 int    profprocs;
 int    ticks = INT_MAX - (15 * 60 * HZ);
 
-volatile unsigned long jiffies = ULONG_MAX - (10 * 60 * HZ);
+volatile unsigned long jiffies;
 
 /*
  * Initialize clock frequencies and start both clocks running.
Index: sys/uvm/uvm_meter.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_meter.c,v
retrieving revision 1.44
diff -u -p -r1.44 uvm_meter.c
--- sys/uvm/uvm_meter.c 21 Jun 2023 21:16:21 -0000      1.44
+++ sys/uvm/uvm_meter.c 31 Jul 2023 20:38:05 -0000
@@ -89,8 +89,6 @@ uvm_meter(void)
 {
        if ((gettime() % 5) == 0)
                uvm_loadav(&averunnable);
-       if (proc0.p_slptime > (maxslp / 2))
-               wakeup(&proc0);
 }
 
 /*

Reply via email to