Re: [PATCH 1/1] i2c: Prevent priority inversion on top of bus lock

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

 



Hi,

On Wed, 2009-09-16 at 13:51 +0200, ext Jean Delvare wrote:

> >  		if (in_atomic() || irqs_disabled()) {
> > -			ret = mutex_trylock(&adap->bus_lock);
> > +			ret = rt_mutex_trylock(&adap->bus_lock);
> >  			if (!ret)
> >  				/* I2C activity is ongoing. */
> >  				return -EAGAIN;
> >  		} else {
> > -			mutex_lock_nested(&adap->bus_lock, adap->level);
> > +			rt_mutex_lock(&adap->bus_lock);
> 
> Hmm, rt_mutex doesn't handle locking model validation as regular
> mutexes have? Looks like a regression to me.
> 

There seems to be no rtmutex_lock_nested in include/linux/rtmutex.h.

CONFIG_DEBUG_RT_MUTEXES help says this:
  This allows rt mutex semantics violations and rt mutex related
  deadlocks (lockups) to be detected and reported automatically.

I don't know if this includes the same stuff as lockdep does.

But as the context is stripped away (adap-level) it's safe to assume
that atleast some functionality is also stripped. Thus it is a
regression.

-- Mika



--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux