[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-09-01 Thread Dave Airlie
>ssert_spin_locked() is a better option. >> > > >> > >> > Unless there's a bug, assert_spin_locked() is just going to incur an >> > unnecessary cost every time it is called at runtime. My suggestion was >> > to >> > limit that check only to debugging kernels that include enabling lockdep >> > when

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-12 Thread sanjeev sharma
yes you are absolutely correct and the change I have done in other area i.e drivers/usb/storage/uas.c.In gpu drivers assert_spin_locked() make more sense. Regards Sanjeev Sharma On Tue, Aug 12, 2014 at 12:25 PM, Daniel Vetter wrote: > On Mon, Aug 11, 2014 at 04:38:50PM -0700, David Rientjes wr

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-12 Thread sanjeev sharma
Thanks all and I replaced with lockdep_assert_held() which seems less overhead. Regards Sanjeev Sharma On Tue, Aug 12, 2014 at 5:08 AM, David Rientjes wrote: > On Mon, 11 Aug 2014, Rob Clark wrote: > > > > I'm suggesting that if you don't want to incur the cost of the > conditional > > > every

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-12 Thread Daniel Vetter
On Mon, Aug 11, 2014 at 04:38:50PM -0700, David Rientjes wrote: > On Mon, 11 Aug 2014, Rob Clark wrote: > > > > I'm suggesting that if you don't want to incur the cost of the conditional > > > everytime you call a certain function with assert_spin_locked() that you > > > could covert these to lock

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-11 Thread Rob Clark
On Mon, Aug 11, 2014 at 4:53 PM, David Rientjes wrote: > On Mon, 11 Aug 2014, sanjeev sharma wrote: > >> Hello David, >> >> Here is the old discussion carried out on this. >> >> http://linux-kernel.2935.n7.nabble.com/Is-spin-is-locked-safe-to-use-with-BUG-ON-WARN-ON-td654800.html#a921802 >> > > I'

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-11 Thread sanjeev sharma
Hello David, Here is the old discussion carried out on this. http://linux-kernel.2935.n7.nabble.com/Is-spin-is-locked-safe-to-use-with-BUG-ON-WARN-ON-td654800.html#a921802 Regards Sanjeev Sharma On Mon, Aug 11, 2014 at 5:31 PM, sanjeev sharma wrote: > Hello David, > > Do you see any problem

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-11 Thread sanjeev sharma
Hello David, Do you see any problem in replacing with assert_spin_locked() and here is old discusion around the On Mon, Aug 11, 2014 at 5:15 PM, David Rientjes wrote: > On Sun, 10 Aug 2014, Guenter Roeck wrote: > > > spin_is_locked() always returns false in uniprocessor configurations > > an

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-11 Thread David Rientjes
On Mon, 11 Aug 2014, Rob Clark wrote: > > I'm suggesting that if you don't want to incur the cost of the conditional > > everytime you call a certain function with assert_spin_locked() that you > > could covert these to lockdep_assert_held() so the check is only done when > > lockdep is enabled fo

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-11 Thread David Rientjes
On Mon, 11 Aug 2014, sanjeev sharma wrote: > Hello David, > > Here is the old discussion carried out on this. > > http://linux-kernel.2935.n7.nabble.com/Is-spin-is-locked-safe-to-use-with-BUG-ON-WARN-ON-td654800.html#a921802 > I'm suggesting that if you don't want to incur the cost of the cond

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-11 Thread sanjeev sharma
Hello Roeck, This should be replaced everywhere in driver.what do you say ? Regards Sanjeev Sharma On Mon, Aug 11, 2014 at 10:01 AM, Guenter Roeck wrote: > spin_is_locked() always returns false in uniprocessor configurations > and can therefore not be used with BUG_ON. Replace it with > asser

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-11 Thread Guenter Roeck
On 08/11/2014 04:45 AM, David Rientjes wrote: > On Sun, 10 Aug 2014, Guenter Roeck wrote: > >> spin_is_locked() always returns false in uniprocessor configurations >> and can therefore not be used with BUG_ON. Replace it with >> assert_spin_locked(), which exists for that very purpose. >> > > It ma

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-11 Thread David Rientjes
On Sun, 10 Aug 2014, Guenter Roeck wrote: > spin_is_locked() always returns false in uniprocessor configurations > and can therefore not be used with BUG_ON. Replace it with > assert_spin_locked(), which exists for that very purpose. > It may be helpful to assess whether any of these sites shoul

[PATCH] drm: Do not use BUG_ON(!spin_is_locked())

2014-08-10 Thread Guenter Roeck
spin_is_locked() always returns false in uniprocessor configurations and can therefore not be used with BUG_ON. Replace it with assert_spin_locked(), which exists for that very purpose. Signed-off-by: Guenter Roeck --- drivers/gpu/drm/msm/mdp/mdp_kms.c | 2 +- drivers/gpu/drm/nouveau/co