From: Henrik Rydberg <rydberg@euromail.se>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
dmitry.torokhov@gmail.com, robfitz@273k.net, jikos@jikos.cz,
vojtech@suse.cz, dmonakhov@openvz.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH 001/002] linux-input: bcm5974-0.31: fixed resource leak, removed work struct, device data struct introduced
Date: Thu, 03 Jul 2008 18:33:40 +0200 [thread overview]
Message-ID: <1215102820.4138.17.camel@alnilam> (raw)
In-Reply-To: <20080701155925.a4c00a8e.akpm@linux-foundation.org>
On Tue, 2008-07-01 at 15:59 -0700, Andrew Morton wrote:
> > + }
> > +
> > + button = data[1];
> > +
> > + /* only report button state changes */
> > + if (button != dev->bt_state) {
> > + input_report_key(dev->input, BTN_LEFT, button);
> > + input_sync(dev->input);
> > + }
> > +
> > + dev->bt_state = button;
> > +
> > + exit:
> > + retval = usb_submit_urb(dev->bt_urb, GFP_ATOMIC);
>
> GFP_ATOMIC is a red flag. Is this quite unrelaible allocation mode
> really needed here?
Being new to kernel work, I rely a lot on how other drivers work.
However, doing some reading, these are my observations:
* The URB works in interrupt mode.
* The call to usb_submit_urb above is within a completion handler.
* From what I read on kerneltrap (2.6.22), such URBs should be
resubmitted using the ATOMIC method. Maybe this changed, I could not
tell.
* Personally, I am starting to worry about concurrency races, with the
two URBs writing to the same input device. I suppose it depends on
whether they are issued on the same interrupt or not? Spin locks?
Best regards,
Henrik Rydberg
prev parent reply other threads:[~2008-07-03 16:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-28 11:47 [PATCH 001/002] linux-input: bcm5974-0.31: fixed resource leak, removed work struct, device data struct introduced Henrik Rydberg
2008-07-01 22:59 ` Andrew Morton
[not found] ` <20080701155925.a4c00a8e.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-07-02 3:04 ` David Brownell
2008-07-02 3:38 ` Andrew Morton
[not found] ` <20080701203847.2dae15ba.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-07-02 3:53 ` David Brownell
2008-07-02 7:46 ` Henrik Rydberg
2008-07-02 7:53 ` Andrew Morton
[not found] ` <20080702005355.8da89ef7.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-07-03 15:09 ` Randy Dunlap
2008-07-03 16:33 ` Henrik Rydberg [this message]
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=1215102820.4138.17.camel@alnilam \
--to=rydberg@euromail.se \
--cc=akpm@linux-foundation.org \
--cc=dmitry.torokhov@gmail.com \
--cc=dmonakhov@openvz.org \
--cc=jikos@jikos.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robfitz@273k.net \
--cc=vojtech@suse.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).