From: Pete Zaitcev <zaitcev@redhat.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Soeren Sonnenburg <kernel@nn7.de>,
linux-input@atrey.karlin.mff.cuni.cz, nicolas@boichat.ch,
linux-usb-devel@lists.sourceforge.net,
Linux Kernel <linux-kernel@vger.kernel.org>,
zaitcev@redhat.com
Subject: Re: [PATCH] Make appletouch shut up when it has nothing to say
Date: Sun, 13 May 2007 11:46:26 -0700 [thread overview]
Message-ID: <20070513114626.d943999a.zaitcev@redhat.com> (raw)
In-Reply-To: <20070513172052.GA26712@srcf.ucam.org>
On Sun, 13 May 2007 18:20:53 +0100, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> +static void atp_reinit(struct work_struct *work)
> +{
> + char data[8];
> + size = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
> + ATP_GEYSER3_MODE_READ_REQUEST_ID,
> + USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
> + ATP_GEYSER3_MODE_REQUEST_VALUE,
> + ATP_GEYSER3_MODE_REQUEST_INDEX, &data, 8, 5000);
Generally speaking, DMA-ing from stack is not allowed. Maybe you want
to add a comment saying "buffer on stack because this is Mac-only driver".
I would not ask for kmalloc here which is entirely pointless.
> +
> + /* Geyser 3 will continue to send packets continually after
> + the first touch unless reinitialised. Do so if it's been
> + idle for a while in order to avoid waking the kernel up
> + several hundred times a second */
> + if (dev->idlecount >= 10)
> + queue_work (appletouch_wq, &dev->work);
So, why don't you check for Geyser 3 or whatnot here instead of doing
it inside the work function? Why poking workqueue on other systems?
> + appletouch_wq = create_singlethread_workqueue("kappletouch");
> + if (!appletouch_wq) {
> + printk(KERN_ERR "appletouch: failed to create workqueue\n");
> + return -ENOMEM;
> + }
> return usb_register(&atp_driver);
I'm wondering about the wisdom of this too. Why won't the stock
workqueue work? We have way too many daemons already. Plus, making
one more unconditionally regardless of hardware present seems like
stepping over the line to me.
Overall this seems like a good patch to me, only needs to be less
intrusive for owners of other hardware.
-- Pete
next prev parent reply other threads:[~2007-05-13 18:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-12 18:51 converting appletouch to usb autosuspend Soeren Sonnenburg
2007-05-12 19:59 ` [linux-usb-devel] " Alan Stern
2007-05-12 21:40 ` Jiri Kosina
2007-05-14 7:39 ` Oliver Neukum
2007-05-12 21:47 ` Alistair John Strachan
2007-05-14 0:46 ` Soeren Sonnenburg
2007-05-14 0:53 ` Alistair John Strachan
2007-05-14 5:50 ` Oliver Neukum
2007-05-14 17:56 ` Alistair John Strachan
2007-05-13 17:20 ` [PATCH] Make appletouch shut up when it has nothing to say Matthew Garrett
2007-05-13 18:46 ` Pete Zaitcev [this message]
2007-05-13 19:57 ` Matthew Garrett
2007-05-14 0:19 ` Soeren Sonnenburg
2007-05-14 1:58 ` Pete Zaitcev
2007-05-15 20:34 ` Soeren Sonnenburg
2007-05-16 2:38 ` Matthew Garrett
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=20070513114626.d943999a.zaitcev@redhat.com \
--to=zaitcev@redhat.com \
--cc=kernel@nn7.de \
--cc=linux-input@atrey.karlin.mff.cuni.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=mjg59@srcf.ucam.org \
--cc=nicolas@boichat.ch \
/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
Powered by JetHome