All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Christopher Hudson <chris.hudson.comp.eng@gmail.com>
Cc: linux-input@vger.kernel.org, jic23@cam.ac.uk,
	Chris Hudson <chudson@kionix.com>
Subject: Re: [PATCH v5] input: Initial support for Kionix KXTJ9 accelerometer
Date: Tue, 5 Jul 2011 11:39:17 -0700	[thread overview]
Message-ID: <20110705183917.GA15876@core.coreip.homeip.net> (raw)
In-Reply-To: <CAB7Re7X=N8yCCOXvxMAgf8k0y+Mz_+YbJw58tjj69CP24YDhyw@mail.gmail.com>

On Tue, Jul 05, 2011 at 02:08:01PM -0400, Christopher Hudson wrote:
> On Mon, Jul 4, 2011 at 12:26 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > Hi Chris,
> >
> > On Tue, Jun 28, 2011 at 03:12:28PM -0400, chris.hudson.comp.eng@gmail.com wrote:
> >> From: Chris Hudson <chudson@kionix.com>
> >>
> >> - Added Dmitry's changes
> >> - Now using input_polled_dev interface when in polling mode
> >> - IRQ mode provides a separate sysfs node to change the hardware data rate
> >>
> >
> > I am not happy with the fact that this implementation forces users to
> > select polled or interrupt-driven mode at compile time. The patch I
> > proposed had polled mode support optional and would automatically select
> > IRQ mode for clients that have interrupt assigned and try to activate
> > polled mode if interrupt is not available.
> >
> >> +
> >> +/* kxtj9_set_poll: allows the user to select a new poll interval (in ms) */
> >> +static ssize_t kxtj9_set_poll(struct device *dev, struct device_attribute *attr,
> >> +                                             const char *buf, size_t count)
> >> +{
> >> +     struct kxtj9_data *tj9 = i2c_get_clientdata(to_i2c_client(dev));
> >> +
> >> +     unsigned long interval;
> >> +     int ret = kstrtoul(buf, 10, &interval);
> >> +     if (ret < 0)
> >> +             return ret;
> >> +
> >> +     mutex_lock(&tj9->lock);
> >> +     /* set current interval to the greater of the minimum interval or
> >> +     the requested interval */
> >> +     tj9->last_poll_interval = max((int)interval, tj9->pdata.min_interval);
> >> +     mutex_unlock(&tj9->lock);
> >
> > This lock does not make sense. You are protecting update of last_poll_interval
> > field and this update can not be partial (i.e. only LSB or MSB is
> > written) on all our arches, but you do not protect kxtj9_update_odr()
> > which alters chip state and does need protection.
> >
> > I tried bringing forward my changes from the older patch into yours,
> > please let me know if the patch below works on top of yours.
> 
> Hi Dmitry,
> Thanks for all your hard work, and yes it works fine.  There were a
> couple of changes proposed by Jonathan that I had already merged into
> my version though; should I submit these in a separate patch or resend
> the merged version?

Cris,

Could you please send the changes proposed by Jonathan as a separate
patch relative to the v5 you posted earlier? Then I can fold v5, mine
and your new patch together and queue the driver for 3.1.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-07-05 18:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 19:12 [PATCH v5] input: Initial support for Kionix KXTJ9 accelerometer chris.hudson.comp.eng
2011-06-29 12:39 ` Jonathan Cameron
2011-07-04 14:25   ` Dmitry Torokhov
2011-07-04 16:26 ` Dmitry Torokhov
2011-07-05 18:08   ` Christopher Hudson
2011-07-05 18:39     ` Dmitry Torokhov [this message]
2011-07-12 21:52       ` Christopher Hudson
2011-07-12 22:08         ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110705183917.GA15876@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=chris.hudson.comp.eng@gmail.com \
    --cc=chudson@kionix.com \
    --cc=jic23@cam.ac.uk \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.