OSDN Git Service

w1: ds2490: USB transfer buffers need to be DMAable
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Wed, 18 Jan 2017 20:31:11 +0000 (21:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 05:37:29 +0000 (06:37 +0100)
commit89eb5ed1536ed8c8cb02cf9eb6e34ba3b744cd46
tree4f6b0f5cf5b4a72013325bedc79d9ccd7ac9eb7c
parent1df66c45247185f9fb006166e5933539c2121814
w1: ds2490: USB transfer buffers need to be DMAable

commit 61cd1b4cd1e8f7f7642ab64529d9bd52e8374641 upstream.

ds2490 driver was doing USB transfers from / to buffers on a stack.
This is not permitted and made the driver non-working with vmapped stacks.

Since all these transfers are done under the same bus_mutex lock we can
simply use shared buffers in a device private structure for two most common
of them.

While we are at it, let's also fix a comparison between int and size_t in
ds9490r_search() which made the driver spin in this function if state
register get requests were failing.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/masters/ds2490.c