lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 14 Feb 2017 11:29:39 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Jun Nie <jun.nie@...aro.org>
Cc:     Baoyou Xie <baoyou.xie@...aro.org>, shawnguo@...nel.org,
        Wolfram Sang <wsa@...-dreams.de>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        linux-i2c@...r.kernel.org, devicetree <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        xie.baoyou@....com.cn, chen.chaokai@....com.cn,
        wang.qiang01@....com.cn
Subject: Re: [PATCH v6 3/3] i2c: zx2967: add i2c controller driver for ZTE's
 zx2967 family

On Tue, Feb 14, 2017 at 6:05 AM, Jun Nie <jun.nie@...aro.org> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ