GitHub/exynos8895/android_kernel_samsung_universal8895.git
13 years agoUSB: gadget: storage: remove alignment assumption
Alan Stern [Thu, 18 Aug 2011 18:29:00 +0000 (14:29 -0400)]
USB: gadget: storage: remove alignment assumption

This patch (as1481) fixes a problem affecting g_file_storage and
g_mass_storage when running at SuperSpeed.  The two drivers currently
assume that the bulk-out maxpacket size can evenly divide the SCSI
block size, which is 512 bytes.  But SuperSpeed bulk endpoints have a
maxpacket size of 1024, so the assumption is no longer true.

This patch removes that assumption from the drivers, by getting rid of
a small optimization (they try to align VFS reads and writes on page
cache boundaries).  If a command's starting logical block address is
512 bytes below the end of a page, it's not okay to issue a USB
command for just those 512 bytes when the maxpacket size is 1024 -- it
would result in either babble (for an OUT transfer) or a short packet
(for an IN transfer).

Also, for backward compatibility, the test for writes extending beyond
the end of the backing storage has to be changed.  If the host tries
to do this, we should accept the data that fits in the backing storage
and ignore the rest.  Because the storage's end may not align with a
USB packet boundary, this means we may have to accept a USB OUT
transfer that extends beyond the end of the storage and then write out
only the part of the data that fits.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: gadget: storage: adapt logic block size to bound block devices
Peiyu Li [Thu, 18 Aug 2011 05:52:59 +0000 (22:52 -0700)]
usb: gadget: storage: adapt logic block size to bound block devices

Now the mass storage driver has fixed logic block size of 512 bytes.

The mass storage gadget read/write bound devices only through VFS, so the
bottom level devices actually are just RAW devices to the driver and connected
PC. As a RAW, hosts can always format, read and write it right in 512 bytes
logic block and don't care about the actual logic block size of devices bound
to the gadget.

But if we want to share the bound block device partition between target board
and PC, in case the logic block size of the bound block device is 4KB, we
execute the following steps:

1. connect a board with mass storage gadget to PC(the board has set one
partition of on-board block device as file name of the mass storage)
2. PC format the mass storage to VFAT by default logic block size and
read/write it
3. disconnect boards from PC
4. target board mount the partition as VFAT

Step 4 will fail since kernel on target thinks the logic block size of the
bound partition as 4KB.
A typical error is "FAT: logical sector size too small for device (logical
sector size = 512)"

If we execute opposite steps:
1. format the partition to VFAT on target board and read/write this partition
2. connect the board to Windows PC as usb mass storage gadget, windows will
think the disk is not formatted

So the conclusion is that only as a gadget, the mass storage driver has no any
problem.  But being shared VFAT or other filesystem on PC and target board, it
will fail.

This patch adapts logic block size to bound block devices and fix the issue.

Cc: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Peiyu Li <peiyu.li@csr.com>
Signed-off-by: Xianglong Du <xianglong.du@csr.com>
Signed-off-by: Huayi Li <huayi.li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: improve debug on link state change
Felipe Balbi [Thu, 8 Sep 2011 18:18:47 +0000 (21:18 +0300)]
usb: dwc3: gadget: improve debug on link state change

It's useful to know which states core is going
through, as it might help us figure out misbehavior
on specific link states.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: omap: set idle and standby modes
Felipe Balbi [Tue, 6 Sep 2011 07:56:51 +0000 (10:56 +0300)]
usb: dwc3: omap: set idle and standby modes

For now, let's disable IDLE and STANDBY transitions
until we have a real HW to validate against.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: ep0: introduce ep0_expect_in flag
Felipe Balbi [Thu, 8 Sep 2011 15:27:33 +0000 (18:27 +0300)]
usb: dwc3: ep0: introduce ep0_expect_in flag

This flag will tell us which direction we're
expecting on the next (data or status) phase.

It will help us catching errors of host going
crazy and requesting data of the wrong direction.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: ep0: giveback requests on stall_and_restart
Felipe Balbi [Thu, 8 Sep 2011 15:17:12 +0000 (18:17 +0300)]
usb: dwc3: ep0: giveback requests on stall_and_restart

if we don't, the list will be busy forever.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: drop the useless dma_sync_single* calls
Felipe Balbi [Thu, 8 Sep 2011 15:16:21 +0000 (18:16 +0300)]
usb: dwc3: gadget: drop the useless dma_sync_single* calls

if req->dma isn't DMA_ADDR_INVALID it means gadget driver
mapped the request or allocated from coherent, so it's
unnecessary to do anything.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: fix GCTL programming
Felipe Balbi [Thu, 8 Sep 2011 14:42:11 +0000 (17:42 +0300)]
usb: dwc3: gadget: fix GCTL programming

ensure a few bits are cleared before enabling
what we need.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: define ScaleDown macro helper
Felipe Balbi [Thu, 8 Sep 2011 14:41:00 +0000 (17:41 +0300)]
usb: dwc3: define ScaleDown macro helper

We must ensure that those bits aren't set as
they should only be used in simulation.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: Fix definition of DWC3_GCTL_U2RSTECN
Felipe Balbi [Thu, 8 Sep 2011 14:39:59 +0000 (17:39 +0300)]
usb: dwc3: Fix definition of DWC3_GCTL_U2RSTECN

that should be 1 << 16, not 16. Caused so many
problems and we never caught it before.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: do not map/unmap ZLP transfers
Sebastian Andrzej Siewior [Wed, 31 Aug 2011 15:12:02 +0000 (17:12 +0200)]
usb: dwc3: gadget: do not map/unmap ZLP transfers

If the gadget drivers sends a ZLP we are trying to map this this request
which does not work on all implementations. So we simply skip mapping
it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: omap: fix IRQ handling
Felipe Balbi [Tue, 6 Sep 2011 09:00:39 +0000 (12:00 +0300)]
usb: dwc3: omap: fix IRQ handling

In order to ACK the IRQ we must write back
to the same register the bits we read.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: omap: change IRQ name to dwc3-omap
Felipe Balbi [Tue, 6 Sep 2011 07:57:41 +0000 (10:57 +0300)]
usb: dwc3: omap: change IRQ name to dwc3-omap

dwc3-wrapper can be used by any other wrapper,
using dwc3-omap makes it clear that we're running
on OMAP SoC.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: add module.h to dwc3-omap.c and core.c
Felipe Balbi [Mon, 5 Sep 2011 10:37:28 +0000 (13:37 +0300)]
usb: dwc3: add module.h to dwc3-omap.c and core.c

We need that header because of THIS_MODULE.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: omap: distinguish between SW and HW modes
Felipe Balbi [Thu, 1 Sep 2011 19:26:25 +0000 (22:26 +0300)]
usb: dwc3: omap: distinguish between SW and HW modes

The OMAP wrapper allows us to either control internal
OTG signals via SW or HW. Different boards might wish
to use one or the other mode of operation. Let's have
have that information passed via platform_data for now.

After DT conversion is finished for OMAP, we can easily
convert this to a DT attribute.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: omap: drop DEV_PM_OPS for now
Felipe Balbi [Thu, 1 Sep 2011 15:33:43 +0000 (18:33 +0300)]
usb: dwc3: omap: drop DEV_PM_OPS for now

We need to have actual HW in order to implement
and test that part of the code anyway. Until then
it's best to remove it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: omap: use the macro we already have
Felipe Balbi [Thu, 1 Sep 2011 15:22:01 +0000 (18:22 +0300)]
usb: dwc3: omap: use the macro we already have

trivial patch, no functional changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: omap: do not enable DMA Disable Clear IRQ
Felipe Balbi [Thu, 1 Sep 2011 11:52:52 +0000 (14:52 +0300)]
usb: dwc3: omap: do not enable DMA Disable Clear IRQ

Otherwise that IRQ will trigger forever. It's quite
unnecessary.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: omap: fix dev_dbg() calls
Felipe Balbi [Thu, 1 Sep 2011 11:46:16 +0000 (14:46 +0300)]
usb: dwc3: omap: fix dev_dbg() calls

dev_dbg() macro expects a device pointer as
argument, not a memory base address.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: use ep0_next_event field
Felipe Balbi [Tue, 30 Aug 2011 12:52:17 +0000 (15:52 +0300)]
usb: dwc3: use ep0_next_event field

Start tracking the next expected event and act
on the error conditions as suggested by databook.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: core: add ep0_next_event field
Felipe Balbi [Tue, 30 Aug 2011 12:50:40 +0000 (15:50 +0300)]
usb: dwc3: core: add ep0_next_event field

this field will hold the next expected event.

In certain cases, host might fall into some error
condition and ask from us the wrong Control phase.
On such situations, we should stall and restart.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: drop EP0_STALL state
Felipe Balbi [Tue, 30 Aug 2011 12:48:08 +0000 (15:48 +0300)]
usb: dwc3: drop EP0_STALL state

Whenever we issue a Set Stall command on EP0,
the state machine will be restarted and Stall
is cleared automatically, when core receives
the next SETUP packet.

There's no need to track that EP0_STALL state.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: ep0: clear all EP0 flags
Felipe Balbi [Tue, 30 Aug 2011 12:54:53 +0000 (15:54 +0300)]
usb: dwc3: ep0: clear all EP0 flags

when we're going to issue Set Stall command,
we should clear DWC3_EP_STALL flag, but also
we should clear BUSY, HALTED and all others.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: ep0: fix Get Status handling
Felipe Balbi [Wed, 31 Aug 2011 08:51:43 +0000 (11:51 +0300)]
usb: dwc3: ep0: fix Get Status handling

data was prepared on setup_buf but transfer
was started on ctrl_req, fix it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: replace mdelay with udelay in the busy loop
Sebastian Andrzej Siewior [Mon, 29 Aug 2011 14:46:38 +0000 (16:46 +0200)]
usb: dwc3: gadget: replace mdelay with udelay in the busy loop

There are two spots where we wait until the HW finishes processing a
certain command. Initially we had a few problems and we used 500ms as a
limit to be on a the safe side. Paul Zimmerman mentioned this is little too
much. After a debugging session, we noticed that we hardly ever go over 20us
and didn't pass 30usec so far. Using mdelay() seems way overloaded.

Giving the current numbers 500usec as the upper limit is more than  enough.
Should it ever timeout then something is definitely wrong.

While here, also replace the type with u32 since long does not really
fit here.

Cc: Paul Zimmerman <paul.zimmerman@synopsys.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: rework the dequeue on RESET & DISCONNECT
Sebastian Andrzej Siewior [Mon, 29 Aug 2011 11:56:37 +0000 (13:56 +0200)]
usb: dwc3: gadget: rework the dequeue on RESET & DISCONNECT

- since a while we are disabling an endpoint and purging every requests on
  RESET and DISCONNECT which leads to a warning since the endpoint was
  disabled twice (once by the UDC, and second time by the gadget). I
  think UDC should nuke all requests because all those requests
  become invalid. It's gadget driver's responsability, though, to disable
  its used endpoints. This is done by merging dwc3_stop_active_transfer()
  and dwc3_gadget_nuke_reqs() into dwc3_remove_requests().

- dwc3_stop_active_transfer() is now no longer called unconditionaly.
  This has the advantage that it is always called to disable an active
  transfer which means if res_trans_idx 0 than something went wrong and
  it is an error condition because we can't clean up the requests.

- Remove the DWC3_EP_WILL_SHUTDOWN which was introduced while
  introducing the command complete part for dequeue. All requests on
  req_queued list should be removed during the dwc3_cleanup_done_reqs()
  callback so there is no reason to go through the list again.
  We consider it an error condition if requests are still on this
  list since we never queue TRB without LST=1 (the last requests has
  always LST=1, there are no requests with LST=0 behind it).

[ balbi@ti.com : reworked commit log a bit, made patch apply ]

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: core: move the core check before soft reset
Sebastian Andrzej Siewior [Mon, 29 Aug 2011 11:56:36 +0000 (13:56 +0200)]
usb: dwc3: core: move the core check before soft reset

We read the DWC3_GSNPSID register to make sure we got the correct
register offset passed. One of the recent commits moved the soft reset
before this so in case of the wrong offset we end up with "reset timed
out". This patch moves the "id" check before the reset again.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: debugfs: remove test mode interface
Sebastian Andrzej Siewior [Mon, 29 Aug 2011 11:56:35 +0000 (13:56 +0200)]
usb: dwc3: debugfs: remove test mode interface

There are some issues around for enabling/disabling this mode and
handling it. It does not work perfectly (yet). However we have a few
gadgets tested successfuly so far. That means we are quite confident
that we won't need this in near future.
So I'm for removing it and bringing a working version back once there is
a need for it.

Thanks to Dan Carpenter who spotted the wrong memory handling here.

[ balbi@ti.com : made it actually apply ]

Cc: Dan Carpenter <error27@gmail.com>
Cc: wharms@bfs.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: ep0: simplify EP0 state machine
Felipe Balbi [Sat, 27 Aug 2011 19:28:36 +0000 (22:28 +0300)]
usb: dwc3: ep0: simplify EP0 state machine

The DesignWare USB3 core tells us which phase
of a control transfer should be started, it
also tells us which physical endpoint needs
that transfer.

With these two informations, we have all we
need to simply EP0 handling quite a lot and
get rid rid of the SW state machine tracking
ep0 states.

For achieving this perfectly, we needed to
add support for situations where we get
XferNotReady while endpoint is still busy
and XferNotReady while gadget driver still
hasn't queued a request.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: core: add flag for EP0 direction
Felipe Balbi [Sat, 27 Aug 2011 19:26:00 +0000 (22:26 +0300)]
usb: dwc3: core: add flag for EP0 direction

Add a flag to keep track of ep0 direction.
This flag will be used on a following patch.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: ep0: add handling for unaligned OUT transfers
Felipe Balbi [Sat, 27 Aug 2011 19:18:09 +0000 (22:18 +0300)]
usb: dwc3: ep0: add handling for unaligned OUT transfers

In case we have transfers which aren't aligned
to wMaxPacketSize, we need to be careful with
how we start the transfer with the HW. OUT
transfers _must_ be aligned with wMaxPacketSize
and in order to guarantee that, we use a bounce
buffer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: add a bounce buffer for control endpoints
Felipe Balbi [Sat, 27 Aug 2011 19:07:53 +0000 (22:07 +0300)]
usb: dwc3: add a bounce buffer for control endpoints

This core cannot handle OUT transfers which aren't
aligned to wMaxPacketSize, but that can happen at
least on control endpoint with the USB Audio Class.

This patch adds a bounce buffer to be used on the
case of a non-aligned ep0out request is queued.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: core: add defines for XferNotReady event on Control EPs
Felipe Balbi [Sat, 27 Aug 2011 19:04:32 +0000 (22:04 +0300)]
usb: dwc3: core: add defines for XferNotReady event on Control EPs

The status field of the Transfer Not Read event
is different on Control Endpoints. On this patch
we are just adding the defines to be used on a
later patch which will re-work the control endpoint
handling.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: improve command completion debug message
Felipe Balbi [Sat, 27 Aug 2011 17:29:58 +0000 (20:29 +0300)]
usb: dwc3: gadget: improve command completion debug message

the previous message had too little meaning. Make
it more human readable and use the macro we already
had for extracting the command completion status out
of DEPCMDn register.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: set request dma to invalid when unmapping
Felipe Balbi [Sat, 27 Aug 2011 12:10:09 +0000 (15:10 +0300)]
usb: dwc3: gadget: set request dma to invalid when unmapping

if we don't set DMA address to invalid when unmapping,
we might fall in a situation where request buffer
can't be mapped to DMA again.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: ep0: fix 'transfered' typo
Felipe Balbi [Fri, 26 Aug 2011 23:30:33 +0000 (02:30 +0300)]
usb: dwc3: ep0: fix 'transfered' typo

trivial patch. No functional changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: core: add missing @ for kerneldoc
Felipe Balbi [Fri, 26 Aug 2011 22:40:52 +0000 (01:40 +0300)]
usb: dwc3: core: add missing @ for kerneldoc

trivial patch, no functional changes

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: debugfs: add a kfree() on error to dwc3_testmode_open()
Dan Carpenter [Fri, 26 Aug 2011 09:21:13 +0000 (12:21 +0300)]
usb: dwc3: debugfs: add a kfree() on error to dwc3_testmode_open()

We may as well fix this potential leak so we don't have to listen to
the static checkers complain.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gaget: clear DWC3_EP_WILL_SHUTDOWN bit
Sebastian Andrzej Siewior [Mon, 22 Aug 2011 16:29:13 +0000 (18:29 +0200)]
usb: dwc3: gaget: clear DWC3_EP_WILL_SHUTDOWN bit

Without this patch we won't clear that bit and instead will
clear all other bits on our endpoint flag.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: use TRB type 6 for ISOC transfers
Sebastian Andrzej Siewior [Mon, 22 Aug 2011 15:42:19 +0000 (17:42 +0200)]
usb: dwc3: gadget: use TRB type 6 for ISOC transfers

Type 6 should be used for the first transfer during an interval. This is
also what the reference driver is using. Type 7 seems to be for following
or additional transfers within the same interval.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: reset resource index to zero
Sebastian Andrzej Siewior [Mon, 22 Aug 2011 15:42:18 +0000 (17:42 +0200)]
usb: dwc3: gadget: reset resource index to zero

If we collected two requests together (i.e. only the last of them has
LST=1) then we only have to stop transfer once: The clean-up code will
cleanup everything until first TRB with the LST bit set.
After XferComplete this index should be no longer valid since there is
no transfer pending.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: dwc3: gadget: fixing dequeue of TRBs
Sebastian Andrzej Siewior [Fri, 19 Aug 2011 17:59:12 +0000 (19:59 +0200)]
usb: dwc3: gadget: fixing dequeue of TRBs

A TRB which is dequeued seems to have its HWO bits set to 1. Therefore
we ignore it if we dequeue it after the command is completed.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoUSB: pl2303: remove unreachable code
Michał Sroczyński [Thu, 25 Aug 2011 17:52:27 +0000 (19:52 +0200)]
USB: pl2303: remove unreachable code

Signed-off-by: Michal Sroczynski <msroczyn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoums_realtek: do not use stack memory for DMA
Adam Cozzette [Wed, 24 Aug 2011 18:22:37 +0000 (12:22 -0600)]
ums_realtek: do not use stack memory for DMA

This patch changes rts51x_read_mem, rts51x_write_mem, and rts51x_read_status to
allocate temporary buffers with kmalloc. This way stack addresses are not used
for DMA when these functions call rts51x_bulk_transport.

Signed-off-by: Adam Cozzette <acozzette@cs.hmc.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB host i.MX21: remove dependency on MACH_MX21
Sascha Hauer [Wed, 24 Aug 2011 06:41:10 +0000 (08:41 +0200)]
USB host i.MX21: remove dependency on MACH_MX21

the MACH_MX* macros are scheduled for removal, so just depend
on ARCH_MXC instead. The Kconfig text makes it clear on which
SoC the driver runs on.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB gadget i.MX1: remove dependency on ARCH_MXC
Sascha Hauer [Wed, 24 Aug 2011 06:41:11 +0000 (08:41 +0200)]
USB gadget i.MX1: remove dependency on ARCH_MXC

The ARCH_MX1 scheduled for removal. Instead, depend on ARCH_MXC
and make clear in the Kconfig text that only i.MX1 has this
hardware.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: fix ipw.c build error, select USB_SERIAL_WWAN
Randy Dunlap [Tue, 23 Aug 2011 18:22:37 +0000 (11:22 -0700)]
usb: fix ipw.c build error, select USB_SERIAL_WWAN

USB_SERIAL_IPW needs to select USB_SERIAL_WWAN to fix build errors:

ipw.c:(.text+0x333841): undefined reference to `usb_wwan_close'
ipw.c:(.text+0x3339e6): undefined reference to `usb_wwan_open'
ipw.c:(.text+0x333bb9): undefined reference to `usb_wwan_release'
drivers/built-in.o:(.data+0x29dac): undefined reference to `usb_wwan_startup'
drivers/built-in.o:(.data+0x29db4): undefined reference to `usb_wwan_disconnect'
drivers/built-in.o:(.data+0x29dd4): undefined reference to `usb_wwan_write'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: fix dwc3 build when USB_GADGET_DWC3 is not enabled
Randy Dunlap [Tue, 23 Aug 2011 19:52:47 +0000 (12:52 -0700)]
usb: fix dwc3 build when USB_GADGET_DWC3 is not enabled

Fix build error when CONFIG_USB_GADGET_DWC3 is not enabled:

ERROR: "dwc3_send_gadget_ep_cmd" [drivers/usb/dwc3/dwc3.ko] undefined!

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: use usb_endpoint_maxp() instead of le16_to_cpu()
Kuninori Morimoto [Tue, 23 Aug 2011 10:12:03 +0000 (03:12 -0700)]
USB: use usb_endpoint_maxp() instead of le16_to_cpu()

Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size
instead of le16_to_cpu(desc->wMaxPacketSize).
This patch fix it up

Cc: Armin Fuerst <fuerst@in.tum.de>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Johannes Erdfelt <johannes@erdfelt.com>
Cc: Vojtech Pavlik <vojtech@suse.cz>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: David Kubicek <dave@awk.cz>
Cc: Johan Hovold <jhovold@gmail.com>
Cc: Brad Hards <bhards@bigpond.net.au>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>
Cc: David Brownell <david-b@pacbell.net>
Cc: David Lopo <dlopo@chipidea.mips.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Xie Xiaobo <X.Xie@freescale.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Jiang Bo <tanya.jiang@freescale.com>
Cc: Yuan-hsin Chen <yhchen@faraday-tech.com>
Cc: Darius Augulis <augulis.darius@gmail.com>
Cc: Xiaochen Shen <xiaochen.shen@intel.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Ben Dooks <ben@simtec.co.uk>
Cc: Thomas Abraham <thomas.ab@samsung.com>
Cc: Herbert Pötzl <herbert@13thfloor.at>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Roman Weissgaerber <weissg@vienna.at>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: Florian Floe Echtler <echtler@fs.tum.de>
Cc: Christian Lucht <lucht@codemercs.com>
Cc: Juergen Stuber <starblue@sourceforge.net>
Cc: Georges Toth <g.toth@e-biz.lu>
Cc: Bill Ryder <bryder@sgi.com>
Cc: Kuba Ober <kuba@mareimbrium.org>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: include module.h in the DesignWare USB3 DRD driver
Stephen Rothwell [Tue, 23 Aug 2011 05:08:54 +0000 (15:08 +1000)]
usb: include module.h in the DesignWare USB3 DRD driver

Fixes this build error:

drivers/usb/dwc3/dwc3-pci.c: In function 'dwc3_pci_init':
drivers/usb/dwc3/dwc3-pci.c:211:9: error: 'THIS_MODULE' undeclared (first use in this function)

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: usbtest: use URB_ZERO_PACKET for BULK-OUT transfers
Sebastian Andrzej Siewior [Tue, 23 Aug 2011 08:44:54 +0000 (10:44 +0200)]
USB: usbtest: use URB_ZERO_PACKET for BULK-OUT transfers

Executing
| testusb -a -c 1 -t 3 -v 421 -s 2048

does not complete on the gadget side.
g_zero enqueues a 4096 bytes long buffer. The host sends 2048bytes which
is a multiple of wMaxPacketSize (either 64 or 512 bytes). The host is
done with sending data but the gadget waits for more.
Since the protocol does not include transfer-length-field sending a
terminating zero packet seems the only way out.

Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: fhci-hcd: Allocate pram dynamically.
Joakim Tjernlund [Tue, 23 Aug 2011 13:23:46 +0000 (15:23 +0200)]
usb: fhci-hcd: Allocate pram dynamically.

MPC832x does not have enough MURAM to do fixed MURAM allocation.
Change to dynamic allocation.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Clear TT buffer on interrupted low & full speed transfers
Arvid Brodin [Mon, 22 Aug 2011 23:25:30 +0000 (01:25 +0200)]
usb/isp1760: Clear TT buffer on interrupted low & full speed transfers

When a low or full speed urb in progress is unlinked (or some other error
occurs), the buffer in the transaction translator (part of the hub) might end
up in an inconsistent state. This can make all further low and full speed
transactions fail, unless the buffer is cleared.

The bug can be seen when running the usbtest unlink tests as "set altsetting
to 0 failed, -110", and gets fixed by this patch.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agodrivers/usb/host/ohci-omap3.c: test the just-initialized value
Julia Lawall [Mon, 22 Aug 2011 14:00:35 +0000 (16:00 +0200)]
drivers/usb/host/ohci-omap3.c: test the just-initialized value

Test the just-initialized value rather than some other one.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier x,y,f!={PTR_ERR,ERR_PTR,ERR_CAST};
statement S;
@@

x = f(...);
(
if (\(x == NULL\|IS_ERR(x)\)) S
|
*if (\(y == NULL\|IS_ERR(y)\))
 { ... when != x
   return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: otg: remove unused function twl6030_set_phy_clk
Wanlong Gao [Sun, 21 Aug 2011 13:45:53 +0000 (21:45 +0800)]
USB: otg: remove unused function twl6030_set_phy_clk

Remove the unused function twl6030_set_phy_clk of twl6030-usb.c.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agos3c-hsudc: Add basic otg transceiver handling
Heiko Stübner [Sun, 21 Aug 2011 12:32:14 +0000 (14:32 +0200)]
s3c-hsudc: Add basic otg transceiver handling

Makes it possible to use i.e. gpio-vbus to handle vbus events.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agos3c-hsudc: Fix possible nullpointer dereference during probe
Heiko Stübner [Sun, 21 Aug 2011 12:31:17 +0000 (14:31 +0200)]
s3c-hsudc: Fix possible nullpointer dereference during probe

The usb-interrupt is requested before the endpoints are initalised.
If an interrupt happens in the time between request_irq and the init
of the endpoint-data (as seen on the Qisda ESx00 ebook-platforms),
it is therefore possible for the interrupt handler to access endpoint-
data before its creation resulting in a null-pointer dereference.

This patch simply moves the irq request below the endpoint init.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoMAINTAINERS: add a maintainer for DesignWare USB3 driver
Felipe Balbi [Fri, 19 Aug 2011 15:10:59 +0000 (18:10 +0300)]
MAINTAINERS: add a maintainer for DesignWare USB3 driver

I'll be focussed on this driver and can maintain
it without any problem.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: Introduce DesignWare USB3 DRD Driver
Felipe Balbi [Fri, 19 Aug 2011 15:10:58 +0000 (18:10 +0300)]
usb: Introduce DesignWare USB3 DRD Driver

The DesignWare USB3 is a highly
configurable IP Core which can be
instantiated as Dual-Role Device (DRD),
Peripheral Only and Host Only (XHCI)
configurations.

Several other parameters can be configured
like amount of FIFO space, amount of TX and
RX endpoints, amount of Host Interrupters,
etc.

The current driver has been validated with
a virtual model of version 1.73a of that core
and with an FPGA burned with version 1.83a
of the DRD core. We have support for PCIe
bus, which is used on FPGA prototyping, and
for the OMAP5, more adaptation (or glue)
layers can be easily added and the driver
is half prepared to handle any possible
configuration the HW engineer has chosen
considering we have the information on
one of the GHWPARAMS registers to do
runtime checking of certain features.

More runtime checks can, and should, be added
in order to make this driver even more flexible
with regards to number of endpoints, FIFO sizes,
transfer types, etc.

While this supports only the device side, for
now, we will add support for Host side (xHCI -
see the updated series Sebastian has sent [1])
and OTG after we have it all stabilized.

[1] http://marc.info/?l=linux-usb&m=131341992020339&w=2

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: introduce gadget_is_dwc3()
Felipe Balbi [Fri, 19 Aug 2011 15:10:57 +0000 (18:10 +0300)]
usb: gadget: introduce gadget_is_dwc3()

... to check whether we're running on DesignWare
USB3 DRD Controller.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: ch9: add function defines from ch9, USB 3.0 spec
Sebastian Andrzej Siewior [Fri, 19 Aug 2011 15:10:56 +0000 (18:10 +0300)]
usb: ch9: add function defines from ch9, USB 3.0 spec

not to confuse with Table 9-7 in USB 2.0 spec

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: remove usages of hcd->state
Alan Stern [Thu, 18 Aug 2011 20:31:30 +0000 (16:31 -0400)]
USB: EHCI: remove usages of hcd->state

This patch (as1483) improves the ehci-hcd driver family by getting rid
of the reliance on the hcd->state variable.  It has no clear owner and
it isn't protected by the usual HCD locks.  In its place, the patch
adds a new, private ehci->rh_state field to record the state of the
root hub.

Along the way, the patch removes a couple of lines containing
redundant assignments to the state variable.  Also, the QUIESCING
state simply gets changed to the RUNNING state, because the driver
doesn't make any distinction between them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: renesas_usbhs: use usb_endpoint_maxp()
kuninori.morimoto.gx@renesas.com [Mon, 25 Jul 2011 07:39:51 +0000 (00:39 -0700)]
usb: renesas_usbhs: use usb_endpoint_maxp()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: add usb_endpoint_maxp() macro
kuninori.morimoto.gx@renesas.com [Mon, 25 Jul 2011 07:39:30 +0000 (00:39 -0700)]
usb: add usb_endpoint_maxp() macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: OHCI/EHCI support for Netlogic XLS processor.
Jayachandran C [Thu, 4 Aug 2011 19:58:22 +0000 (01:28 +0530)]
usb: OHCI/EHCI support for Netlogic XLS processor.

Add supprt for on-chip USB controller for Netlogic XLS MIPS64
SoC processor family.
Changes are:
 - update ehci-hcd.c and ohci-hcd.c to add XLS hcds
 - add ehci-xls.c: EHCI support for Netlogic XLS.
 - add ohci-xls.c: OHCI support for Netlogic XLS.

Signed-off-by: Jayachandran C <jayachandranc@netlogicmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: pxa168: Add onchip USB host controller support
Tanmay Upadhyay [Wed, 20 Jul 2011 04:30:58 +0000 (10:00 +0530)]
USB: pxa168: Add onchip USB host controller support

- Add EHCI Host controller driver
- Add wrapper that creates resources for host controller driver

v2 - Call clk_put() after clk_disable() in probe function

Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: isp1362-hcd: Quieten printks
Tobias Klauser [Wed, 27 Jul 2011 06:57:25 +0000 (08:57 +0200)]
usb: isp1362-hcd: Quieten printks

These messages just clutter the log and provide no useful information to
the user, so make them pr_debug().

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Fix problems that trigger WARNING at line 1136.
Arvid Brodin [Sun, 21 Aug 2011 06:29:28 +0000 (08:29 +0200)]
usb/isp1760: Fix problems that trigger WARNING at line 1136.

1) A bug in the usage of time_after() in errata2_function().

2) Clear done_maps just prior to starting a new transfer in
   start_bus_transfer(), instead of just after, when done_map bits might have
   been validly set by the started transfer.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Fix missing endpoint unlink when no mem during enqueue
Arvid Brodin [Sun, 21 Aug 2011 06:29:27 +0000 (08:29 +0200)]
usb/isp1760: Fix missing endpoint unlink when no mem during enqueue

... and some small code style fixes.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Use polling instead of SOF interrupts to fix Errata 2
Arvid Brodin [Sun, 21 Aug 2011 06:29:26 +0000 (08:29 +0200)]
usb/isp1760: Use polling instead of SOF interrupts to fix Errata 2

Errata 2 for the isp1760 explains that the chip sometimes does not issue
interrupts when an ATL (bulk or control) transfer is completed. There are
several issues with the current work-around (SOF interrupts) for this:

1) It seems the chip sometimes does not even set the done bit for a
   completed transfer, in which case SOF interrupts does not solve
   the problem since we still check the done map to find out which
   transfer descriptors to handle.

2) The above point seems to happen only when ATL and SOF interrupts
   are enabled at the same time. However, disabling ATL interrupts
   increases the latency between transfer completion and handling.
   This is very noticeable in the testusb suite, which take several
   minutes more to run with ATL interrupts disabled.

This patch removes the code to switch on SOF interrupts, and instead
use a kernel timer to periodically check for "old" descriptors that
have their VALID and ACTIVE flags unset, indicating completion, thus
avoiding the dependency on the chip's done map (and SOF interrupts)
to find transfers affected by this HW bug.

[bigeasy@linutronix: 80 lines limit]

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Move isp1760_run within file (prepare for next patch)
Arvid Brodin [Sun, 21 Aug 2011 06:29:25 +0000 (08:29 +0200)]
usb/isp1760: Move isp1760_run within file (prepare for next patch)

Like the previous patch, this patch has been split from the next one
for clarity.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb/isp1760: Move some code (prepare for next patch)
Arvid Brodin [Sun, 21 Aug 2011 06:29:24 +0000 (08:29 +0200)]
usb/isp1760: Move some code (prepare for next patch)

Move the few lines of code in isp1760_enable_interrupts() and
isp1760_init_maps() into isp1760_run(). This makes the following patch
easier.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: misc: usblcd: fixed coding style issues
Zack Parsons [Fri, 29 Jul 2011 01:58:30 +0000 (18:58 -0700)]
usb: misc: usblcd: fixed coding style issues

Fixed multiple coding style issues

Signed-off-by: Zack Parsons <k3bacon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: misc: usbled: fixed coding style issues
Zack Parsons [Fri, 29 Jul 2011 07:17:57 +0000 (00:17 -0700)]
usb: misc: usbled: fixed coding style issues

Fixed multiple coding style issues

Signed-off-by: Zack Parsons <k3bacon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: ipw: convert to usb-wwan framework
Oliver Neukum [Wed, 13 Jul 2011 11:54:48 +0000 (13:54 +0200)]
USB: ipw: convert to usb-wwan framework

From 2d487c10136f76cf3705881d34868e8592839cfe Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oliver@neukum.org>
Date: Tue, 12 Jul 2011 15:36:51 +0200
Subject: [PATCH] USB: ipw: convert to usb-wwan framework

This patch allows the ipw driver to use the multibuffer
infrastructure of usb-wwan. This improves speed.

Signed-off-by: Oliver Neukum<oneukum@suse.de>
Tested-by: Michal Hybner <dta081@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb_storage: Don't freeze in usb-stor-scan
Seth Forshee [Tue, 26 Jul 2011 14:56:07 +0000 (09:56 -0500)]
usb_storage: Don't freeze in usb-stor-scan

Scanning cannot be run during suspend or hibernation, but if
usb-stor-scan freezes another thread waiting on scanning to
complete may fail to freeze.

However, if usb-stor-scan is left freezable without ever actually
freezing then the freezer will wait on it to exit, and threads
waiting for scanning to finish will no longer be blocked. One
problem with this approach is that usb-stor-scan has a delay to
wait for devices to settle (which is currently the only point where
it can freeze). To work around this we can request that the freezer
send a fake signal when freezing, then use interruptible sleep to
wake the thread early when freezing happens.

To make this happen, the following changes are made to
usb-stor-scan:

 * Use set_freezable_with_signal() instead of set_freezable() to
   request a fake signal when freezing

 * Use wait_event_interruptible_timeout() instead of
   wait_event_freezable_timeout() to avoid freezing

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Remove test for NULL that'll never happen in usb_disconnect()
Jesper Juhl [Mon, 11 Jul 2011 20:59:36 +0000 (22:59 +0200)]
USB: Remove test for NULL that'll never happen in usb_disconnect()

In drivers/usb/core/hub.c::usb_disconnect(), 'udev' will never be
NULL, so remove the test and printing of debug message.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoLinux 3.1-rc3
Linus Torvalds [Mon, 22 Aug 2011 18:42:53 +0000 (11:42 -0700)]
Linux 3.1-rc3

13 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 22 Aug 2011 18:26:56 +0000 (11:26 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf tools: Add group event scheduling option to perf record/stat
  MAINTAINERS: Fix list of perf events source files
  perf tools: Fix build against newer glibc
  perf tools: Fix error handling of unknown events
  perf evlist: Fix missing event name init for default event
  perf list: Fix exit value

13 years agoMerge branch 'stable/bug.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 22 Aug 2011 18:25:44 +0000 (11:25 -0700)]
Merge branch 'stable/bug.fixes' of git://git./linux/kernel/git/konrad/xen

* 'stable/bug.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/tracing: Fix tracing config option properly
  xen: Do not enable PV IPIs when vector callback not present
  xen/x86: replace order-based range checking of M2P table by linear one
  xen: xen-selfballoon.c needs more header files

13 years agoxen/tracing: Fix tracing config option properly
Jeremy Fitzhardinge [Thu, 11 Aug 2011 20:17:20 +0000 (13:17 -0700)]
xen/tracing: Fix tracing config option properly

Steven Rostedt says we should use CONFIG_EVENT_TRACING.

Cc:Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: Do not enable PV IPIs when vector callback not present
Stefano Stabellini [Wed, 17 Aug 2011 13:15:00 +0000 (15:15 +0200)]
xen: Do not enable PV IPIs when vector callback not present

Fix regression for HVM case on older (<4.1.1) hypervisors caused by

  commit 99bbb3a84a99cd04ab16b998b20f01a72cfa9f4f
  Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
  Date:   Thu Dec 2 17:55:10 2010 +0000

    xen: PV on HVM: support PV spinlocks and IPIs

This change replaced the SMP operations with event based handlers without
taking into account that this only works when the hypervisor supports
callback vectors. This causes unexplainable hangs early on boot for
HVM guests with more than one CPU.

BugLink: http://bugs.launchpad.net/bugs/791850
CC: stable@kernel.org
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-and-Reported-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1...
Linus Torvalds [Mon, 22 Aug 2011 01:13:19 +0000 (18:13 -0700)]
Merge branch 'fixes' of git://git./linux/kernel/git/ieee1394/linux1394-2.6

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: core: handle ack_busy when fetching the Config ROM

13 years agoBtrfs: fix 64 bit divide problem
Josef Bacik [Sat, 20 Aug 2011 12:29:51 +0000 (08:29 -0400)]
Btrfs: fix 64 bit divide problem

This fixes a regression introduced by commit cdcb725c05fe ("Btrfs: check
if there is enough space for balancing smarter").  We can't do 64-bit
divides on 32-bit architectures.

In cases where we need to divide/multiply by 2 we should just left/right
shift respectively, and in cases where theres N number of devices use
do_div.  Also make the counters u64 to match up with rw_devices.
Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Acked-and-tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Linus Torvalds [Sun, 21 Aug 2011 13:59:41 +0000 (06:59 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: flush any pending end_io requests before DIO reads w/dioread_nolock
  ext4: fix nomblk_io_submit option so it correctly converts uninit blocks
  ext4: Resolve the hang of direct i/o read in handling EXT4_IO_END_UNWRITTEN.
  ext4: call ext4_ioend_wait and ext4_flush_completed_IO in ext4_evict_inode
  ext4: Fix ext4_should_writeback_data() for no-journal mode

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Sun, 21 Aug 2011 13:59:02 +0000 (06:59 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: sound/aoa/fabrics/layout.c: remove unneeded kfree
  ALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.c
  ALSA: hda - Don't spew too many ELD errors
  ALSA: usb-audio - Fix missing mixer dB information
  ALSA: hda - Add "PCM" volume to vmaster slave list
  ALSA: hda - Fix duplicated capture-volume creation for ALC268 models
  ALSA: ac97: Add HP Compaq dc5100 SFF(PT003AW) to Headphone Jack Sense whitelist
  ALSA: snd_usb_caiaq: track submitted output urbs

13 years agopci: fix new kernel-doc warning in pci.c
Randy Dunlap [Sat, 20 Aug 2011 18:49:43 +0000 (11:49 -0700)]
pci: fix new kernel-doc warning in pci.c

Fix new kernel-doc warning in pci.c:

  Warning(drivers/pci/pci.c:3259): No description found for parameter 'mps'
  Warning(drivers/pci/pci.c:3259): Excess function parameter 'rq' description in 'pcie_set_mps'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoALSA: sound/aoa/fabrics/layout.c: remove unneeded kfree
Julia Lawall [Sat, 20 Aug 2011 06:12:41 +0000 (08:12 +0200)]
ALSA: sound/aoa/fabrics/layout.c: remove unneeded kfree

The label outnodev is only used when kzalloc has not yet taken place or has
failed, so there is no need for the call for kfree under this label.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier x;
expression E1!=0,E2,E3,E4;
statement S;
iterator I;
@@

(
if (...) { ... when != kfree(x)
               when != x = E3
               when != E3 = x
*  return ...;
 }
... when != x = E2
    when != I(...,x,...) S
if (...) { ... when != x = E4
 kfree(x); ... return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.c
Takashi Iwai [Sat, 20 Aug 2011 07:19:59 +0000 (09:19 +0200)]
ALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.c

snd_hda_get_conn_index() returns a negative value while the current code
stores it in an unsigned int.  It must be stored in a signed integer.

Reported-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda - Don't spew too many ELD errors
Takashi Iwai [Sat, 20 Aug 2011 07:14:45 +0000 (09:14 +0200)]
ALSA: hda - Don't spew too many ELD errors

Currently HD-audio driver shows the all error ELD byte as an error
in the kernel message.  This is annoying when the video driver doesn't
set the correct ELD from the beginning. e.g. radeon sends a zero-byte
data, but we still check ELD with the fixed 128 byte as a workaround
for some broken devices, it spews 128-times errors.

For avoiding this, the driver aborts reading when the first byte is
invalid.  In such a case, the whole data is certainly invalid.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Sat, 20 Aug 2011 06:07:08 +0000 (23:07 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/drm-intel

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/drm-intel:
  drm/i915: set GFX_MODE to pre-Ivybridge default value even on Ivybridge

13 years agoext4: flush any pending end_io requests before DIO reads w/dioread_nolock
Jiaying Zhang [Fri, 19 Aug 2011 23:13:32 +0000 (19:13 -0400)]
ext4: flush any pending end_io requests before DIO reads w/dioread_nolock

There is a race between ext4 buffer write and direct_IO read with
dioread_nolock mount option enabled. The problem is that we clear
PageWriteback flag during end_io time but will do
uninitialized-to-initialized extent conversion later with dioread_nolock.
If an O_direct read request comes in during this period, ext4 will return
zero instead of the recently written data.

This patch checks whether there are any pending uninitialized-to-initialized
extent conversion requests before doing O_direct read to close the race.
Note that this is just a bandaid fix. The fundamental issue is that we
clear PageWriteback flag before we really complete an IO, which is
problem-prone. To fix the fundamental issue, we may need to implement an
extent tree cache that we can use to look up pending to-be-converted extents.

Signed-off-by: Jiaying Zhang <jiayingz@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
13 years agodrm/i915: set GFX_MODE to pre-Ivybridge default value even on Ivybridge
Jesse Barnes [Fri, 12 Aug 2011 22:28:32 +0000 (15:28 -0700)]
drm/i915: set GFX_MODE to pre-Ivybridge default value even on Ivybridge

Prior to Ivybridge, the GFX_MODE would default to 0x800, meaning that
MI_FLUSH would flush the TLBs in addition to the rest of the caches
indicated in the MI_FLUSH command.  However starting with Ivybridge, the
register defaults to 0x2800 out of reset, meaning that to invalidate the
TLB we need to use PIPE_CONTROL.  Since we're not doing that yet, go
back to the old default so things work.

v2: don't forget to actually *clear* the new bit

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
13 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Fri, 19 Aug 2011 17:47:07 +0000 (10:47 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

* 'for-linus' of git://git.kernel.dk/linux-block: (23 commits)
  Revert "cfq: Remove special treatment for metadata rqs."
  block: fix flush machinery for stacking drivers with differring flush flags
  block: improve rq_affinity placement
  blktrace: add FLUSH/FUA support
  Move some REQ flags to the common bio/request area
  allow blk_flush_policy to return REQ_FSEQ_DATA independent of *FLUSH
  xen/blkback: Make description more obvious.
  cfq-iosched: Add documentation about idling
  block: Make rq_affinity = 1 work as expected
  block: swim3: fix unterminated of_device_id table
  block/genhd.c: remove useless cast in diskstats_show()
  drivers/cdrom/cdrom.c: relax check on dvd manufacturer value
  drivers/block/drbd/drbd_nl.c: use bitmap_parse instead of __bitmap_parse
  bsg-lib: add module.h include
  cfq-iosched: Reduce linked group count upon group destruction
  blk-throttle: correctly determine sync bio
  loop: fix deadlock when sysfs and LOOP_CLR_FD race against each other
  loop: add BLK_DEV_LOOP_MIN_COUNT=%i to allow distros 0 pre-allocated loop devices
  loop: add management interface for on-demand device allocation
  loop: replace linked list of allocated devices with an idr index
  ...

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Fri, 19 Aug 2011 17:02:37 +0000 (10:02 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI: OF: Don't crash when bridge parent is NULL.
  PCI: export pcie_bus_configure_settings symbol
  PCI: code and comments cleanup
  PCI: make cardbus-bridge resources optional
  PCI: make SRIOV resources optional
  PCI : ability to relocate assigned pci-resources
  PCI: honor child buses add_size in hot plug configuration
  PCI: Set PCI-E Max Payload Size on fabric

13 years agoPCI: OF: Don't crash when bridge parent is NULL.
David Daney [Tue, 16 Aug 2011 18:24:37 +0000 (11:24 -0700)]
PCI: OF: Don't crash when bridge parent is NULL.

In pcibios_get_phb_of_node(), we will crash while booting if
bus->bridge->parent is NULL.

Check for this case and avoid dereferencing the NULL pointer.

Signed-off-by: David Daney <david.daney@cavium.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
13 years agoRevert "cfq: Remove special treatment for metadata rqs."
Jens Axboe [Fri, 19 Aug 2011 06:34:48 +0000 (08:34 +0200)]
Revert "cfq: Remove special treatment for metadata rqs."

We have a kernel build regression since 3.1-rc1, which is about 10%
regression. The kernel source is in an ext3 filesystem.
Alex Shi bisect it to commit:
commit a07405b7802691d29ab3b23bdc76ee6d006aad0b
Author: Justin TerAvest <teravest@google.com>
Date:   Sun Jul 10 22:09:19 2011 +0200

    cfq: Remove special treatment for metadata rqs.

Apparently this is caused by lack metadata preemption, where ext3/ext4
do use READ_META. I didn't see a way to fix the issue, so suggest
reverting the patch.

This reverts commit a07405b7802691d29ab3b23bdc76ee6d006aad0b.

Reported-by: Alex Shi<alex.shi@intel.com>
Reported-by: Shaohua Li<shaohua.li@intel.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agoALSA: usb-audio - Fix missing mixer dB information
Takashi Iwai [Fri, 19 Aug 2011 05:55:10 +0000 (07:55 +0200)]
ALSA: usb-audio - Fix missing mixer dB information

The recent fix for testing dB range at the mixer creation time seems
to cause regressions in some devices.  In such devices, reading the dB
info at probing time gives an error, thus both dBmin and dBmax are still
zero, and TLV flag isn't set although the later read of dB info succeeds.

This patch adds a workaround for such a case by assuming that the later
read will succeed.  In future, a similar test should be performed in a
case where a wrong dB range is seen even in the later read.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Linus Torvalds [Fri, 19 Aug 2011 05:49:34 +0000 (22:49 -0700)]
Merge git://git./linux/kernel/git/davem/sparc

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc: fix array bounds error setting up PCIC NMI trap

13 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Fri, 19 Aug 2011 05:48:30 +0000 (22:48 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  drivers/ata/sata_dwc_460ex.c: add missing kfree
  ata: Add iMX pata support
  pata_via: disable ATAPI DMA on AVERATEC 3200
  [libata] sata_sil: fix used-uninit warning