Re: [PATCH v6 3/3] i2c: zx2967: add i2c controller driver for ZTE's zx2967 family

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

 




On Tue, Feb 14, 2017 at 6:05 AM, Jun Nie <jun.nie@xxxxxxxxxx> wrote:
> On 2017年02月09日 17:32, Baoyou Xie wrote:
>>

First of all, please, Jun, remove tons of lines of over quoting when
answering to emails with one line question. Respect others time.

See below.

>> +static irqreturn_t zx2967_i2c_isr(int irq, void *dev_id)
>> +{
>> +       u32 status;
>> +       struct zx2967_i2c_info *zx_i2c = (struct zx2967_i2c_info *)dev_id;
>> +       unsigned long flags;
>> +
>> +       spin_lock_irqsave(&zx_i2c->lock, flags);
>
>
> Is this spin lock really necessary?

If you protect IO and one CPU is in interrupt while another in some
other function you need to have a spin lock.

>> +
>> +       status = zx2967_i2c_readl(zx_i2c, REG_STAT) & I2C_INT_MASK;
>> +       zx2967_i2c_isr_clr(zx_i2c);
>> +
>> +       if (status & I2C_ERROR_MASK) {
>> +               spin_unlock_irqrestore(&zx_i2c->lock, flags);
>> +               return IRQ_HANDLED;
>> +       }
>> +
>> +       if (status & I2C_TRANS_DONE)
>> +               complete(&zx_i2c->complete);
>> +
>> +       spin_unlock_irqrestore(&zx_i2c->lock, flags);
>> +
>> +       return IRQ_HANDLED;
>> +}

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux