lkml.org 
[lkml]   [2010]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] [PATCH V2 1/2] input: CMA3000 Accelerometer driver
    On Fri, Aug 13, 2010 at 08:34:07AM -0500, Murphy, Dan wrote:
    > Hemanth
    > I have a few comments on this patch.
    >
    > +static ssize_t cma3000_store_attr_mdfftmr(struct device *dev,
    > + struct device_attribute *attr,
    > + const char *buf, size_t count)
    > +{
    > + struct platform_device *pdev = to_platform_device(dev);
    > + struct cma3000_accl_data *data = platform_get_drvdata(pdev);
    > + unsigned long val;
    > + int error;
    > +
    > + error = strict_strtoul(buf, 0, &val);
    > + if (error)
    > + return error;
    > +
    > + mutex_lock(&data->mutex);
    > + data->pdata.mdfftmr = val;
    > +
    > + disable_irq(data->client->irq);
    > You should use disable_irq_nosync here. This may not work properly on SMP.

    This is an incorrect statement. disable_irq() is not safe to use on SMP when
    caller may not sleep (since it will wait for the running handler to
    complete), but in this context it is perfectly safe,

    --
    Dmitry


    \
     
     \ /
      Last update: 2010-08-29 20:27    [W:0.036 / U:62.384 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site