lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 11 May 2010 12:06:09 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
cc:	gregkh@...e.de, <konrad.wilk@...cle.com>, <tiwai@...e.de>,
	USB list <linux-usb@...r.kernel.org>, <clemens@...isch.de>,
	Kernel development list <linux-kernel@...r.kernel.org>,
	<chrisw@...s-sol.org>, <iommu@...ts.linux-foundation.org>,
	<andi@...stfloor.org>, <daniel@...aq.de>, <pedrib@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	<dwmw2@...radead.org>
Subject: Re: [alsa-devel] USB transfer_buffer allocations on 64bit systems

On Wed, 12 May 2010, FUJITA Tomonori wrote:

> > > Can you tell me all the exact process of DMA that the usb core and the
> > > driver do?
> > 
> > 1. The audio driver stores data in urb->transfer_buffer.
> 
> How urb->transfer_buffer is allocated?

By kmalloc().  Right, Daniel?

> > 2. The audio driver calls usb_submit_urb(urb).
> > 
> > 3. The USB core does
> > 		urb->transfer_dma = dma_map_single(controller, 
> > 			urb->transfer_buffer,
> > 			urb->transfer_buffer_length,
> > 			DMA_TO_DEVICE);
> 
> The mapping error is checked via dma_mapping_error? Even if an mapping
> error happens, no data corruption happens due to that (needs
> something like retrying the request)?

Yes, we check dma_mapping_error().  If there's an error then the
submission fails, and presumably this failure would be logged by the
audio driver.

> > 4. The host controller driver tells the hardware to carry out the data 
> >    transfer.
> > 
> > 5. When the hardware says the transfer is finished, the USB core does
> > 		dma_unmap_single(controller,
> > 			urb->transfer_dma,
> > 			urb->transfer_buffer_length,
> > 			DMA_TO_DEVICE);
> > 
> > 6. The audio driver's completion handler is called:
> > 		(urb->complete)(urb);
> 
> The driver does only DMA_TO_DEVICE? Or you see DMA problems only with
> DMA_TO_DEVICE?

The particular test that Pedro is running uses audio output only -- 
he's sending sound data to a speaker and it comes out noisy.

But the audio data has to come from somewhere, and I don't remember 
where.  Pedro, does the noise occur only when you're playing sound that 
comes from a different USB device?  What happens if you play sounds 
that are stored on your hard disk, like an MP3 file?

Or what happens if you take the incoming sound data and store it in a 
disk file, and then later play that file out through the speaker?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ