Re: [RFC PATCH 1/4] i2c: allow drivers to announce that they are IRQ safe

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

 



Hi Andy,

On Tue, Aug 14, 2018 at 02:20:26PM +0300, Andy Shevchenko wrote:
> On Tue, Aug 14, 2018 at 12:16 AM, Stefan Lengfeld
> <contact@xxxxxxxxxxxxxxx> wrote:
> > Like the PM subsystem routine pm_runtime_irq_safe() and flag 'irq_safe'
> 
> No, it seems unlike as in PM. PM has one crucial detail which is done
> together with enabling IRQ safety.
> 
> > add a similar function i2c_adapter_irq_safe() to the I2C core. A driver
> > should be able to announce whether his transfer implementations are safe
> > to be called in IRQ disabled or atomic contexts, also called polling
> > mode or sleep free operation.

Ah, ok. `i2c_adapter_irq_safe()` is a bad idea. Thanks for the feedback.

Then I vote for extending the 'struct i2c_algorithm' with an extra
callback 'master_xfer_irqless'. The idea was already proposed here.

This approach has the same information value than a flag 'irq_safe' and
is even a bit cleaner, since it's more a compile time thing than a
runtime setting.

Kind regards,
Stefan



[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