Subject: Re: [PATCH RESEND] dm9601: don't do usb transfers of data on stack

From: Peter Korsgaard <jacmet-OfajU3CKLf1/[email-masked]>
Date: Fri, 11 Jul 2008 14:17:58 +0200

>>>>> "Oliver" == Oliver Neukum <[email-masked]> writes:

 >> dm_{read,write}_shared_word() were doing USB transfers of data on stack,
 >> which isn't allowed. Fix it by using the usbnet->data area like in
 >> dm9601_set_multicast().

 Oliver> You cannot do this. You've identified the bug correctly, but
 Oliver> the fix is incorrect. Doing DMA on non coherent architectures
 Oliver> means that any cacheline the buffer shares must not be
 Oliver> touched while DMA may be running. If you embed the buffer
 Oliver> into struct usbnet, how could you meet the guarantee?

Ahh. So kmalloc() / kfree() around the usb_control_msg isn dm_read /
dm_write is the way to go?

-- 
Bye, Peter Korsgaard
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email-masked]
More majordomo info at  http://vger.kernel.org/majordomo-info.html