NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/49424: DRMKMS failure on Lenovo T410s with amd64/7.0_BETA



The following reply was made to PR kern/49424; it has been noted by GNATS.

From: Havard Eidnes <he%NetBSD.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/49424: DRMKMS failure on Lenovo T410s with amd64/7.0_BETA
Date: Wed, 03 Dec 2014 12:27:32 +0100 (CET)

 > Index: i915_dma.c
 > ===================================================================
 > RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c,v
 > retrieving revision 1.12
 > diff -u -r1.12 i915_dma.c
 > --- i915_dma.c  5 Nov 2014 23:46:09 -0000       1.12
 > +++ i915_dma.c  3 Dec 2014 08:05:21 -0000
 > @@ -1645,9 +1645,11 @@ int i915_driver_load(struct drm_device *
 >  #ifdef __NetBSD__
 >         linux_mutex_init(&dev_priv->dpio_lock);
 >         linux_mutex_init(&dev_priv->modeset_restore_lock);
 > +       linux_mutex_init(&dev_priv->rps.hw_lock);
 >  #else
 >         mutex_init(&dev_priv->dpio_lock);
 >         mutex_init(&dev_priv->modeset_restore_lock);
 > +       mutex_init(&dev_priv->rps.hw_lock);
 >  #endif
 >  
 >         intel_pm_setup(dev);
 
 This is wrong, it turns out.
 
 This is a so-called "Ironlake" variant, so it uses another path
 through intel_disable_gt_powersave(), instead hitting the
 uninitialized mchdev_lock in ironlake_disable_drps().  This
 spinlock is being initialized by intel_gpu_ips_init(), but it is
 called much, much later in i915_driver_load(), i.e. too late for
 the indirect use of the lock via intel_uncore_init().
 
 So this is my new suggestion, which seems to provide a working
 DRMKMS kernel and working X11 on this machine:
 
 Index: i915_dma.c
 ===================================================================
 RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c,v
 retrieving revision 1.12
 diff -u -p -r1.12 i915_dma.c
 --- i915_dma.c  5 Nov 2014 23:46:09 -0000       1.12
 +++ i915_dma.c  3 Dec 2014 11:05:28 -0000
 @@ -1697,6 +1697,10 @@ int i915_driver_load(struct drm_device *
         /* This must be called before any calls to HAS_PCH_* */
         intel_detect_pch(dev);
  
 +       /* Needed here to initialize mchdev_lock, before any PM calls */
 +       if (IS_GEN5(dev))
 +               intel_gpu_ips_init(dev_priv);
 +
         intel_uncore_init(dev);
  
         ret = i915_gem_gtt_init(dev);
 @@ -1819,9 +1823,6 @@ int i915_driver_load(struct drm_device *
                 acpi_video_register();
         }
  
 -       if (IS_GEN5(dev))
 -               intel_gpu_ips_init(dev_priv);
 -
         intel_init_runtime_pm(dev_priv);
  
         return 0;
 
 Regards,
 
 - Havard
 


Home | Main Index | Thread Index | Old Index