[PATCH linux dev-4.10 v5 31/31] drivers: hwmon: occ: Cancel occ operations in remove()

Joel Stanley joel at jms.id.au
Tue Oct 10 13:57:20 AEDT 2017


2017-10-10 0:03 GMT+09:30 Eddie James <eajames at linux.vnet.ibm.com>:
>
>
> On 10/08/2017 09:00 PM, Joel Stanley wrote:
>>> +static void p9_sbe_occ_close_client(struct p9_sbe_occ *occ)
>>> +{
>>> +       struct occ_client *tmp_client;
>>> +
>>> +       spin_lock_irq(&occ->lock);
>>
>> Why not spin_lock_irqsave/spin_unlock_irqsave? Same throughout this patch.
>
>
> Well spin_lock_irq/spin_unlock_irq is used through the occ and sbefifo
> drivers. Just following suit here. I can switch it if necessary.

If you understand the differences and used the non-save/restore
versions intentionally, then we can keep the driver as it is.

In general, to be safe, more experienced kernel hackers than myself
recommend the irqsave/irqrestore versions of the spin lock functions
as they are safe to call from any context (IRQ or otherwise).

Cheers,

Joel


More information about the openbmc mailing list