Re: [PATCH v7 03/10] i2c: i2c-smbus: Use threaded irq for smbalert
From: Phil Reid <hidden>
Date: 2017-06-20 02:30:42
Also in:
linux-i2c, linux-pm
On 19/06/2017 23:27, Wolfram Sang wrote:
On Thu, Jun 15, 2017 at 09:59:31PM +0800, Phil Reid wrote:quoted
Prior to this commit the smbalert_irq was handling in the hard irq context. This change switch to using a thread irq which avoids the need for the work thread. Using threaded irq also removes the need for the edge_triggered flag as the enabling / disabling of the hard irq for level triggered interrupts will be handled by the irq core. Without this change have an irq connected to something like an i2c gpio resulted in a null ptr deferences. Specifically handle_nested_irq calls the threaded irq handler. There are currently 3 in tree drivers affected by this change. i2c-parport driver calls i2c_handle_smbus_alert in a hard irq context. This driver use edge trigger interrupts which skip the enable / disable calls. But it still need to handle the smbus transaction on a thread. So the work thread is kept for this driver. i2c-parport-light & i2c-thunderx-pcidrv provide the irq number in the setup which will result in the thread irq being used. i2c-parport-light is edge trigger so the enable / disable call was skipped as well. i2c-thunderx-pcidrv is getting the edge / level trigger setting from of data and was setting the flag as required. However the irq core should handle this automatically. Signed-off-by: Phil Reid <redacted>CCing Benjamin for smbus changes (like last time). Please CC him in the future in case we need another revision of this series.
Sorry forgot he was added manually. I just used the get maintainers script to get the list. And he wasn't listed against the i2c / smbus paths. -- Regards Phil Reid