Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-28 Thread Jussi Kivilinna
On 16.06.2013 13:35, Jussi Kivilinna wrote: On 16.06.2013 11:21, Oliver Neukum wrote: On Saturday 15 June 2013 16:22:30 Jussi Kivilinna wrote: Hm.. rethink this a bit. Transfer buffer might be dma aligned but shorter than cacheline and end of cacheline used as something else. Manual

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-28 Thread Oliver Neukum
On Friday 28 June 2013 15:39:27 Jussi Kivilinna wrote: On 16.06.2013 13:35, Jussi Kivilinna wrote: On 16.06.2013 11:21, Oliver Neukum wrote: On Saturday 15 June 2013 16:22:30 Jussi Kivilinna wrote: Hm.. rethink this a bit. Transfer buffer might be dma aligned but shorter than

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-16 Thread Oliver Neukum
On Saturday 15 June 2013 16:22:30 Jussi Kivilinna wrote: Hm.. rethink this a bit. Transfer buffer might be dma aligned but shorter than cacheline and end of cacheline used as something else. Manual alignment by host driver does not catch that or fix that. So, yes.. dma mapping should

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-16 Thread Jussi Kivilinna
On 15.06.2013 16:47, Ming Lei wrote: On Sat, Jun 15, 2013 at 9:10 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: On 15.06.2013 15:07, Ming Lei wrote: On Sat, Jun 15, 2013 at 6:19 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: On 15.06.2013 10:41, Ming Lei wrote: Cc: netdev On Fri,

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-15 Thread Ming Lei
Cc: netdev On Fri, Jun 14, 2013 at 9:38 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: Appearently some out-of-tree USB host drivers do not handle DMA alignment for Looks these host drivers have to face the fact that the transfer buffer is often DMA non-aligned from network device drivers(in

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-15 Thread Jussi Kivilinna
On 14.06.2013 23:20, Alan Stern wrote: On Fri, 14 Jun 2013, Jussi Kivilinna wrote: Appearently some out-of-tree USB host drivers do not handle DMA alignment for URB buffers and let core/hcd.c to do the mapping on architectures that have minimum DMA alignment requirements. This leads to

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-15 Thread Jussi Kivilinna
On 15.06.2013 10:41, Ming Lei wrote: Cc: netdev On Fri, Jun 14, 2013 at 9:38 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: Appearently some out-of-tree USB host drivers do not handle DMA alignment for Looks these host drivers have to face the fact that the transfer buffer is often

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-15 Thread Ming Lei
On Sat, Jun 15, 2013 at 6:19 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: On 15.06.2013 10:41, Ming Lei wrote: Cc: netdev On Fri, Jun 14, 2013 at 9:38 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: Appearently some out-of-tree USB host drivers do not handle DMA alignment for

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-15 Thread Jussi Kivilinna
On 15.06.2013 15:07, Ming Lei wrote: On Sat, Jun 15, 2013 at 6:19 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: On 15.06.2013 10:41, Ming Lei wrote: Cc: netdev On Fri, Jun 14, 2013 at 9:38 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: Appearently some out-of-tree USB host drivers

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-15 Thread Jussi Kivilinna
On 15.06.2013 16:10, Jussi Kivilinna wrote: [...] Instead of fixing host drivers, users end up posting bug reports against those USB device drivers that use unaligned buffers for URB; such as with rtl8192cu (http://thread.gmane.org/gmane.linux.kernel.wireless.general/105631). Not only

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-15 Thread Ming Lei
On Sat, Jun 15, 2013 at 9:10 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: On 15.06.2013 15:07, Ming Lei wrote: On Sat, Jun 15, 2013 at 6:19 PM, Jussi Kivilinna jussi.kivili...@iki.fi wrote: On 15.06.2013 10:41, Ming Lei wrote: Cc: netdev On Fri, Jun 14, 2013 at 9:38 PM, Jussi

[RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-14 Thread Jussi Kivilinna
Appearently some out-of-tree USB host drivers do not handle DMA alignment for URB buffers and let core/hcd.c to do the mapping on architectures that have minimum DMA alignment requirements. This leads to random memory corruptions and crashes when using USB device drivers that use unaligned URB

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-14 Thread Greg Kroah-Hartman
On Fri, Jun 14, 2013 at 04:38:03PM +0300, Jussi Kivilinna wrote: Appearently some out-of-tree USB host drivers do not handle DMA alignment for URB buffers and let core/hcd.c to do the mapping on architectures that have minimum DMA alignment requirements. This leads to random memory corruptions

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-14 Thread Greg Kroah-Hartman
On Fri, Jun 14, 2013 at 08:24:24PM +0300, Jussi Kivilinna wrote: On 14.06.2013 19:05, Greg Kroah-Hartman wrote: On Fri, Jun 14, 2013 at 04:38:03PM +0300, Jussi Kivilinna wrote: Appearently some out-of-tree USB host drivers do not handle DMA alignment for URB buffers and let core/hcd.c to

Re: [RFC PATCH] usb: hcd: warn about URB buffers that are not DMA aligned and are about to be DMA mapped

2013-06-14 Thread Alan Stern
On Fri, 14 Jun 2013, Jussi Kivilinna wrote: Appearently some out-of-tree USB host drivers do not handle DMA alignment for URB buffers and let core/hcd.c to do the mapping on architectures that have minimum DMA alignment requirements. This leads to random memory corruptions and crashes when