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:41:48 +0000 (06:41 +0100)
commitc259832acf57c51971582c84c89b2941a8a9e1ef
tree095a5e58219cddc11a1e75838774659bf6279d20
parent1de86951101be4a3bcee9355a10f327bba491ec5
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