aboutsummaryrefslogtreecommitdiffstats
path: root/usb.current
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2009-07-29 07:02:05 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-07-29 07:02:05 -0700
commit82314d1be36ae7984f54dd878074b51c672cfc0f (patch)
tree35943175c9a2ded3d45a9915d6003d757836434c /usb.current
parent3dca4a7e6b695903b870a7185a9ec2b7e71ffa06 (diff)
downloadpatches-82314d1be36ae7984f54dd878074b51c672cfc0f.tar.gz
more patchfun
Diffstat (limited to 'usb.current')
-rw-r--r--usb.current/usb-devio-properly-do-access_ok-checks.patch51
-rw-r--r--usb.current/usb-musb-fix-the-nop-registration-for-omap3evm.patch109
2 files changed, 160 insertions, 0 deletions
diff --git a/usb.current/usb-devio-properly-do-access_ok-checks.patch b/usb.current/usb-devio-properly-do-access_ok-checks.patch
new file mode 100644
index 00000000000000..d6d2c38903041a
--- /dev/null
+++ b/usb.current/usb-devio-properly-do-access_ok-checks.patch
@@ -0,0 +1,51 @@
+From mb@bu3sch.de Wed Jul 29 06:43:33 2009
+From: Michael Buesch <mb@bu3sch.de>
+Date: Wed, 29 Jul 2009 11:39:03 +0200
+Subject: USB: devio: Properly do access_ok() checks
+To: linux-usb@vger.kernel.org
+Cc: gregkh@suse.de, Pete Zaitcev <zaitcev@redhat.com>
+Message-ID: <200907291139.04233.mb@bu3sch.de>
+Content-Disposition: inline
+
+
+access_ok() checks must be done on every part of the userspace structure
+that is accessed. If access_ok() on one part of the struct succeeded, it
+does not imply it will succeed on other parts of the struct. (Does
+depend on the architecture implementation of access_ok()).
+
+This changes the __get_user() users to first check access_ok() on the
+data structure.
+
+Signed-off-by: Michael Buesch <mb@bu3sch.de>
+Cc: stable <stable@kernel.org>
+Cc: Pete Zaitcev <zaitcev@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/devio.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/core/devio.c
++++ b/drivers/usb/core/devio.c
+@@ -1321,7 +1321,8 @@ static int get_urb32(struct usbdevfs_urb
+ struct usbdevfs_urb32 __user *uurb)
+ {
+ __u32 uptr;
+- if (get_user(kurb->type, &uurb->type) ||
++ if (!access_ok(VERIFY_READ, uurb, sizeof(*uurb)) ||
++ __get_user(kurb->type, &uurb->type) ||
+ __get_user(kurb->endpoint, &uurb->endpoint) ||
+ __get_user(kurb->status, &uurb->status) ||
+ __get_user(kurb->flags, &uurb->flags) ||
+@@ -1536,8 +1537,9 @@ static int proc_ioctl_compat(struct dev_
+ u32 udata;
+
+ uioc = compat_ptr((long)arg);
+- if (get_user(ctrl.ifno, &uioc->ifno) ||
+- get_user(ctrl.ioctl_code, &uioc->ioctl_code) ||
++ if (!access_ok(VERIFY_READ, uioc, sizeof(*uioc)) ||
++ __get_user(ctrl.ifno, &uioc->ifno) ||
++ __get_user(ctrl.ioctl_code, &uioc->ioctl_code) ||
+ __get_user(udata, &uioc->data))
+ return -EFAULT;
+ ctrl.data = compat_ptr(udata);
diff --git a/usb.current/usb-musb-fix-the-nop-registration-for-omap3evm.patch b/usb.current/usb-musb-fix-the-nop-registration-for-omap3evm.patch
new file mode 100644
index 00000000000000..c0160398bec771
--- /dev/null
+++ b/usb.current/usb-musb-fix-the-nop-registration-for-omap3evm.patch
@@ -0,0 +1,109 @@
+From ajay.gupta@ti.com Wed Jul 29 06:50:48 2009
+From: "Gupta, Ajay Kumar" <ajay.gupta@ti.com>
+Date: Wed, 29 Jul 2009 11:58:57 +0530
+Subject: USB: musb: fix the nop registration for OMAP3EVM
+To: "gregkh@suse.de" <gregkh@suse.de>, David Brownell <david-b@pacbell.net>
+Cc: <linux-omap@vger.kernel.org>, "felipe.balbi@nokia.com" <felipe.balbi@nokia.com>, "tony@atomide.com" <tony@atomide.com>, "talvala@stanford.edu" <talvala@stanford.edu>
+Message-ID: <19F8576C6E063C45BE387C64729E73940432A6E035@dbde02.ent.ti.com>
+
+OMAP3EVM uses ISP1504 phy which doesn't require any programming and
+thus has to use NOP otg transceiver.
+
+Cleanups being done:
+ - Remove unwanted code in usb-musb.c file
+ - Register NOP in OMAP3EVM board file using
+ usb_nop_xceiv_register().
+ - Select NOP_USB_XCEIV for OMAP3EVM boards.
+ - Don't enable TWL4030_USB in omap3_evm_defconfig
+
+Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
+Signed-off-by: Eino-Ville Talvala <talvala@stanford.edu>
+Acked-by: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/arm/configs/omap3_evm_defconfig | 2 +-
+ arch/arm/mach-omap2/board-omap3evm.c | 5 +++++
+ arch/arm/mach-omap2/usb-musb.c | 21 ---------------------
+ drivers/usb/musb/Kconfig | 1 +
+ 4 files changed, 7 insertions(+), 22 deletions(-)
+
+--- a/arch/arm/configs/omap3_evm_defconfig
++++ b/arch/arm/configs/omap3_evm_defconfig
+@@ -1107,7 +1107,7 @@ CONFIG_USB_ZERO=m
+ CONFIG_USB_OTG_UTILS=y
+ # CONFIG_USB_GPIO_VBUS is not set
+ # CONFIG_ISP1301_OMAP is not set
+-CONFIG_TWL4030_USB=y
++# CONFIG_TWL4030_USB is not set
+ # CONFIG_NOP_USB_XCEIV is not set
+ CONFIG_MMC=y
+ # CONFIG_MMC_DEBUG is not set
+--- a/arch/arm/mach-omap2/board-omap3evm.c
++++ b/arch/arm/mach-omap2/board-omap3evm.c
+@@ -25,6 +25,7 @@
+ #include <linux/spi/spi.h>
+ #include <linux/spi/ads7846.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/usb/otg.h>
+
+ #include <mach/hardware.h>
+ #include <asm/mach-types.h>
+@@ -307,6 +308,10 @@ static void __init omap3_evm_init(void)
+ ARRAY_SIZE(omap3evm_spi_board_info));
+
+ omap_serial_init();
++#ifdef CONFIG_NOP_USB_XCEIV
++ /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
++ usb_nop_xceiv_register();
++#endif
+ usb_musb_init();
+ ads7846_dev_init();
+ }
+--- a/arch/arm/mach-omap2/usb-musb.c
++++ b/arch/arm/mach-omap2/usb-musb.c
+@@ -155,20 +155,6 @@ static struct platform_device musb_devic
+ .resource = musb_resources,
+ };
+
+-#ifdef CONFIG_NOP_USB_XCEIV
+-static u64 nop_xceiv_dmamask = DMA_BIT_MASK(32);
+-
+-static struct platform_device nop_xceiv_device = {
+- .name = "nop_usb_xceiv",
+- .id = -1,
+- .dev = {
+- .dma_mask = &nop_xceiv_dmamask,
+- .coherent_dma_mask = DMA_BIT_MASK(32),
+- .platform_data = NULL,
+- },
+-};
+-#endif
+-
+ void __init usb_musb_init(void)
+ {
+ if (cpu_is_omap243x())
+@@ -183,13 +169,6 @@ void __init usb_musb_init(void)
+ */
+ musb_plat.clock = "ick";
+
+-#ifdef CONFIG_NOP_USB_XCEIV
+- if (platform_device_register(&nop_xceiv_device) < 0) {
+- printk(KERN_ERR "Unable to register NOP-XCEIV device\n");
+- return;
+- }
+-#endif
+-
+ if (platform_device_register(&musb_device) < 0) {
+ printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
+ return;
+--- a/drivers/usb/musb/Kconfig
++++ b/drivers/usb/musb/Kconfig
+@@ -12,6 +12,7 @@ config USB_MUSB_HDRC
+ depends on !SUPERH
+ select NOP_USB_XCEIV if ARCH_DAVINCI
+ select TWL4030_USB if MACH_OMAP_3430SDP
++ select NOP_USB_XCEIV if MACH_OMAP3EVM
+ select USB_OTG_UTILS
+ tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
+ help