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:	Wed, 10 Jul 2013 17:31:58 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
cc:	Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	<linux-input@...r.kernel.org>, <linux-media@...r.kernel.org>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: USB host support should depend on HAS_DMA

On Wed, 10 Jul 2013, Geert Uytterhoeven wrote:

> If NO_DMA=y:
> 
> drivers/built-in.o: In function `usb_hcd_unmap_urb_setup_for_dma':
> drivers/usb/core/hcd.c:1361: undefined reference to `dma_unmap_single'

> ,,,
> 
> Commit d9ea21a779278da06d0cbe989594bf542ed213d7 ("usb: host: make
> USB_ARCH_HAS_?HCI obsolete") allowed to enable USB on platforms with
> NO_DMA=y, and exposed several input and media USB drivers that just select
> USB if USB_ARCH_HAS_HCD, without checking HAS_DMA.
> 
> Fix the former by making USB depend on HAS_DMA.

This isn't right.  There are USB host controllers that use PIO, not
DMA.  The HAS_DMA dependency should go with the controller driver, not 
the USB core.

On the other hand, the USB core does call various routines like 
dma_unmap_single.  It ought to be possible to compile these calls even 
when DMA isn't enabled.  That is, they should be defined as do-nothing 
stubs.

> To fix the latter, instead of adding lots of "depends on HAS_DMA", make
> those drivers depend on USB, instead of depending on USB_ARCH_HAS_HCD and
> selecting USB.  Drivers for other busses (e.g. MOUSE_SYNAPTICS_I2C) already
> handle this in a similar way.

That seems reasonable.

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