]> Pileus Git - ~andy/linux/log
~andy/linux
11 years agousb: gadget: remove usb_gadget_controller_number()
Sebastian Andrzej Siewior [Mon, 10 Sep 2012 07:16:07 +0000 (09:16 +0200)]
usb: gadget: remove usb_gadget_controller_number()

The bcdDevice field is defined as
|Device release number in binary-coded decimal
in the USB 2.0 specification. We use this field to distinguish the UDCs
from each other. In theory this could be used on the host side to apply
certain quirks if the "special" UDC in combination with this gadget is
used. This hasn't been done as far as I am aware. In practice it would
be better to fix the UDC driver before shipping since a later release
might not need this quirk anymore.

There are some driver in tree (on the host side) which use the bcdDevice
field to figure out special workarounds for a given firmware revision.
This seems to make sense. Therefore this patch converts all gadgets
(except a few) to use the kernel version instead a random 2 or 3 plus
the UDC number. The few that don't report kernel's version are:
- webcam
  This one reports always a version 0x10 so allow it to do so in future.
- nokia
  This one reports always 0x211. The comment says that this gadget works
  only if the UDC supports altsettings so I added a check for this.
- serial
  This one reports 0x2400 + UDC number. Since the gadget version is 2.4
  this could make sense. Therefore bcdDevice is 0x2400 here.

I also remove various gadget_is_<name> macros which are unused. The
remaining few macros should be moved to feature / bug bitfield.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: at91_udc: fix dt support
Fabio Porcedda [Fri, 7 Sep 2012 13:27:42 +0000 (15:27 +0200)]
usb: gadget: at91_udc: fix dt support

Don't fail the initialization check for the platform_data
if there is avaiable an associated device tree node.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: at91_udc: move the dereference below the NULL test
Wei Yongjun [Fri, 7 Sep 2012 06:54:25 +0000 (14:54 +0800)]
usb: gadget: at91_udc: move the dereference below the NULL test

The dereference should be moved below the NULL test.

spatch with a semantic match is used to found this.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: libcomposite: move MODULE_VERSION to composite.c
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:28 +0000 (20:11 +0200)]
usb: gadget: libcomposite: move MODULE_VERSION to composite.c

MODULE_VERSION and AUTHOR looks better in composite.c than in
usbstrings.c so I move it there.
I put David Brownell as the module Author as I belive he wrote most of
it.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: libcomposite: move composite.c into libcomposite
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:27 +0000 (20:11 +0200)]
usb: gadget: libcomposite: move composite.c into libcomposite

This moves composite.c into libcomposite and updates all gadgets.
Finally!

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: Provide a default implementation of default manufacturer string
Sebastian Andrzej Siewior [Mon, 10 Sep 2012 13:01:58 +0000 (15:01 +0200)]
usb: gadget: Provide a default implementation of default manufacturer string

Some gadgets provide custom entry here. Some may override it with an
etntry that is also created by composite if there was no value sumbitted
at all.
This patch removes all "custom manufacturer" strings which are the same
as these which are created by composite. Then it moves the creation of
the default manufacturer string to usb_composite_overwrite_options() in
case no command line argument has been used and the entry is still an
empty string.
By doing this we get rid of the global variable "composite_manufacturer"
in composite.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: remove string override from struct usb_composite_driver
Sebastian Andrzej Siewior [Mon, 10 Sep 2012 13:01:57 +0000 (15:01 +0200)]
usb: gadget: remove string override from struct usb_composite_driver

The struct usb_composite_driver members iProduct, iSerial and
iManufacturer can be entered directly via the string array. There is no
need for them to appear here.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: push iProduct into gadgets
Sebastian Andrzej Siewior [Mon, 10 Sep 2012 13:01:56 +0000 (15:01 +0200)]
usb: gadget: push iProduct into gadgets

This patch pushes the iProduct module argument from composite
into each gadget.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: push iManufacturer into gadgets
Sebastian Andrzej Siewior [Mon, 10 Sep 2012 13:01:55 +0000 (15:01 +0200)]
usb: gadget: push iManufacturer into gadgets

This patch pushes the iManufacturer module argument from composite into
each gadget. Once the user uses the module paramter, the string is
overwritten with the final value.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: push iSerialNumber into gadgets
Sebastian Andrzej Siewior [Mon, 10 Sep 2012 13:01:54 +0000 (15:01 +0200)]
usb: gadget: push iSerialNumber into gadgets

This patch pushes the iSerialNumber module argument from composite into
each gadget. Once the user uses the module paramter, the string is
overwritten with the final value.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: make sure each gadget is using same index for Product, Serial,…
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:21 +0000 (20:11 +0200)]
usb: gadget: make sure each gadget is using same index for Product, Serial,…

The index in usb_string array is defined by the gadget. The gadget can
choose which index entry it assigns for the serial number and which the
product name. The gadget has just to ensure that the descriptor contains
the proper string id which is assigned by composite.
If the composite layer knows the index of the "default" information
which will be overwritten by module parameters, it can be used later to
overwrite it.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: push VID/PID/USB BCD module option into gadgets
Sebastian Andrzej Siewior [Mon, 10 Sep 2012 13:01:53 +0000 (15:01 +0200)]
usb: gadget: push VID/PID/USB BCD module option into gadgets

This patch moves the module options idVendor, idProduct and bcdDevice
from composite.c into each gadgets. This ensures compatibility with
current gadgets and removes the global variable which brings me step
closer towards composite.c in libcomposite

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: move usb_gadget_controller_number() into a .c file and libcomposite
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:19 +0000 (20:11 +0200)]
usb: gadget: move usb_gadget_controller_number() into a .c file and libcomposite

After I moved the function from the header file to the c file I see:

| $ size drivers/usb/gadget/gadget_chips.o
| text    data     bss     dec     hex filename
| 1048       0       0    1048     418 drivers/usb/gadget/gadget_chips.o

That is almost a KiB which is removed from each user.
As Felipe pointed out, the function / usage is very dumb actually. This is
used for the following reasons:
- epautoconf ep hint (could provide a per-gadget callback)
- miss-features. currently the missing altsetting on pxa's and something
  ZLP related on musbhdrc (looks like an optimisation which could be
  implemented in musb itself if it is correct)
- unique BCD accross all UDCs. Not sure how important this is.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: initialize the strings in tcm_usb_gadget properly
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:18 +0000 (20:11 +0200)]
usb: gadget: initialize the strings in tcm_usb_gadget properly

I have no idea what I've been thinking while I was doing this in the first
place. Now the strings are initialized properly and reported by lsusb.

Cc: stable@vger.kernel.org # v3.5
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: make g_printer enumerate again
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:17 +0000 (20:11 +0200)]
usb: gadget: make g_printer enumerate again

This was broken in 2e87edf49 ("usb: gadget: make g_printer use
composite").
The USB-strings were not setup properly and were not used. No function
was added which results in an empty USB config.
While fixing this, the interface number is now auto generated and not
hard coded to 0.

Cc: stable@vger.kernel.org # v3.5
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: use usb_string_ids_tab instead multiple usb_string_id()
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:16 +0000 (20:11 +0200)]
usb: gadget: use usb_string_ids_tab instead multiple usb_string_id()

Using usb_string_ids_tab() instead multiple calls of usb_string_id()
seems to be handy. It also allows to add string without many checks.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: make composite module options readonly only
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:15 +0000 (20:11 +0200)]
usb: gadget: make composite module options readonly only

This is a partly revert of 4fffd6e5 ("usb: gadget: composite: make
module parameters accessible at runtime").
It is not possible to change the VID or other property for a gadget
right now. This change has been made for Anrdoid gadget which has this
functionality in its copy of the file. This function is executed currently
only once and most caller in tree are __init.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: remove bufsiz from struct usb_composite_dev
Sebastian Andrzej Siewior [Mon, 10 Sep 2012 13:01:52 +0000 (15:01 +0200)]
usb: gadget: remove bufsiz from struct usb_composite_dev

there is no read user of bufsiz, its content is available via
USB_COMP_EP0_BUFSIZ. Remove it.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: move USB_BUFSIZ into global composite.h
Sebastian Andrzej Siewior [Mon, 10 Sep 2012 13:01:51 +0000 (15:01 +0200)]
usb: gadget: move USB_BUFSIZ into global composite.h

This patch moves USB_BUFSIZ into global header file as
USB_COMP_EP0_BUFSIZ. There is currently only one user (f_sourcesink)
besides composite which need it. Ideally f_sourcesink would have its
own ep0 buffer. Lets keep it that way it was for now.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: libcomposite: add epautoconf.c to libcomposite
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:12 +0000 (20:11 +0200)]
usb: gadget: libcomposite: add epautoconf.c to libcomposite

This patch adds epautoconf.c into libcomposite and updates all gadgets.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: move global vars from epautoconf into struct usb_gadget
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:11 +0000 (20:11 +0200)]
usb: gadget: move global vars from epautoconf into struct usb_gadget

epautoconf has two global variables which count the endpoint number of
last assigned endpoint.
This patch removes the global variable and keeps it as per (UDC) gadget.
While here, the ifdef is removed and now the in and outpoint are
enumerated unconditionally. The dwc3 for instance supports 32 endpoints
in total.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: libcomposite: move config.c into libcomposite
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:10 +0000 (20:11 +0200)]
usb: gadget: libcomposite: move config.c into libcomposite

This patch moves config.c into libcomposite and updates all gadgets.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: start with libcomposite
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:09 +0000 (20:11 +0200)]
usb: gadget: start with libcomposite

This patch aims to be simple. It removes #include usbstribgs.c line from each
gadget and creates libcomposite.ko which has only one member, that is
usbstribgs.c.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: pxa25x: make it compile with debug again
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:08 +0000 (20:11 +0200)]
usb: gadget: pxa25x: make it compile with debug again

|drivers/usb/gadget/pxa25x_udc.h: In function 'dump_state':
|drivers/usb/gadget/pxa25x_udc.h:228:20: error: invalid type argument of '->' (have 'struct usb_ep')

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: remove global variable composite in composite.c
Sebastian Andrzej Siewior [Fri, 7 Sep 2012 07:53:17 +0000 (09:53 +0200)]
usb: gadget: remove global variable composite in composite.c

This patch removes the global variable composite in composite.c.
The private data which was saved there is now passed via an additional
argument to the bind() function in struct usb_gadget_driver.

Only the "old-style" UDC drivers have to be touched here, new style are
doing it right because this change is made in udc-core.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agostaging: ccg: include all sourced files
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:06 +0000 (20:11 +0200)]
staging: ccg: include all sourced files

This Android gadget includes a bunch of .c files. Fixing normal gadgets
is not the real problem but this gadget is not always fixable since the
problem here are fundumential / design.

*I* wanted to get this removed but other people want to keep it even
though there were reports that Android itself is not using it. Some
poeple think that it is better to have this instead of nothing and other
argue that they need sdb and mass storage gadget. The sdb function is
not provided by ccg so I don't see the point of this. I don't see any
logical reasoning behind it and I decided that it is time for retreat.

This patch brings all dependencies of ccg into staging so I can do
whatever I want in drivers/usb/gadget without breaking ccg.

Cc: devel@driverdev.osuosl.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: move bind() callback back to struct usb_gadget_driver
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:05 +0000 (20:11 +0200)]
usb: gadget: move bind() callback back to struct usb_gadget_driver

This partly reverts 07a18bd7 ("usb gadget: don't save bind callback in
struct usb_composite_driver") and fixes new drivers. The section missmatch
problems was solved by whitelisting bind callback in modpost.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: move bind() callback back to struct usb_composite_driver
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:04 +0000 (20:11 +0200)]
usb: gadget: move bind() callback back to struct usb_composite_driver

This partly reverts 07a18bd7 ("usb gadget: don't save bind callback in
struct usb_composite_driver") and fixes new drivers. The section missmatch
problems was solved by whitelisting structs in question via __ref.

Cc: devel@driverdev.osuosl.org
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: push all usb_composite_driver structs into __refdata
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:03 +0000 (20:11 +0200)]
usb: gadget: push all usb_composite_driver structs into __refdata

As it turns out, Sam's comment was better than I initially assumed. This
patch pushes as struct usb_composite_driver data structures into
__refdata section to avoid a section missmatch report from modpost
because the ->bind() can be marked __init. The only downside is that
modpost does not check between ->bind() and other member. However, it is
temporary.

Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: remove __devexit in f_uac2
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:02 +0000 (20:11 +0200)]
usb: gadget: remove __devexit in f_uac2

avoids the following section missmatch
|WARNING: drivers/usb/gadget/g_audio.o(.init.text+0x2e7): Section
|mismatch in reference from the function afunc_bind() to the function
|.devexit.text:snd_uac2_remove()
|The function __init afunc_bind() references
|a function __devexit snd_uac2_remove().
|This is often seen when error handling in the init function
|uses functionality in the exit path.
|The fix is often to remove the __devexit annotation of
|snd_uac2_remove() so it may be used outside an exit section.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: move bind callback into driver struct usb_composite_driver
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:01 +0000 (20:11 +0200)]
usb: gadget: move bind callback into driver struct usb_composite_driver

It was moved to be an argument in 07a18bd716ed5 ("usb gadget: don't
save bind callback in struct usb_composite_driver"). The reason was to
avoid the section missmatch. The warning was shown because ->bind is
marked as __init becuase it is a one time init. The warning can be also
suppresed by whitelisting the variable i.e. rename it to lets say _probe.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agostaging: ccg: Add a note about compatibility issues.
Sebastian Andrzej Siewior [Thu, 6 Sep 2012 18:11:00 +0000 (20:11 +0200)]
staging: ccg: Add a note about compatibility issues.

The first item on the todo list is a new user interface. Put this
information into Kconfig's help entry to people are not too confusing
once an user API changes which does not happen in kernel otherwise.

Cc: devel@driverdev.osuosl.org
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: bcm63xx UDC driver
Kevin Cernekee [Sat, 25 Aug 2012 19:38:52 +0000 (12:38 -0700)]
usb: gadget: bcm63xx UDC driver

Driver for the "USB20D" / "USBD" block on BCM6328, BCM6368, BCM6816,
BCM6362, BCM3383, and others.

The hardware block was designed to support networking applications
(direct connection of a home router to a PC), and the endpoint
configuration is fixed.

[ balbi@ti.com : dropped USB_GADGET_DUALSPEED from Kconfig ]

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Acked-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c-hsotg: Use devm_clk_get function
Sachin Kamat [Mon, 3 Sep 2012 10:45:18 +0000 (16:15 +0530)]
usb: gadget: s3c-hsotg: Use devm_clk_get function

devm_* functions are already used in this file. Hence
convert clk_get to devm_clk_get for completeness.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c-hsudc: Replace 0 with NULL for pointers
Sachin Kamat [Mon, 3 Sep 2012 10:18:20 +0000 (15:48 +0530)]
usb: gadget: s3c-hsudc: Replace 0 with NULL for pointers

Silences the following type of sparse warnings:
warning: Using plain integer as NULL pointer

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c-hsudc: Add missing braces around sizeof
Sachin Kamat [Mon, 3 Sep 2012 10:18:19 +0000 (15:48 +0530)]
usb: gadget: s3c-hsudc: Add missing braces around sizeof

Silences the following checkpatch warning:
WARNING: sizeof *hsreq should be sizeof(*hsreq)

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c-hsudc: Use devm_* functions
Sachin Kamat [Mon, 3 Sep 2012 10:18:18 +0000 (15:48 +0530)]
usb: gadget: s3c-hsudc: Use devm_* functions

devm_* functions are used to replace kzalloc, request_mem_region, ioremap
clk_get and request_irq functions in probe call. With the usage of devm_*
functions explicit freeing and unmapping is not required.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: remove duplicated include from pxa25x_udc.c
Wei Yongjun [Sun, 26 Aug 2012 01:43:00 +0000 (09:43 +0800)]
usb: gadget: remove duplicated include from pxa25x_udc.c

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: lpc32xx_udc.c: adjust inconsistent IS_ERR and PTR_ERR
Julia Lawall [Sat, 25 Aug 2012 19:57:06 +0000 (21:57 +0200)]
usb: gadget: lpc32xx_udc.c: adjust inconsistent IS_ERR and PTR_ERR

Change the call to PTR_ERR to access the value just tested by IS_ERR.

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

// <smpl>
@@
expression e,e1;
@@

(
if (IS_ERR(e)) { ... PTR_ERR(e) ... }
|
if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... }
|
*if (IS_ERR(e))
 { ...
*  PTR_ERR(e1)
   ... }
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: get rid of USB_GADGET_{DUAL,SUPER}SPEED
Michal Nazarewicz [Fri, 24 Aug 2012 18:46:18 +0000 (20:46 +0200)]
usb: gadget: get rid of USB_GADGET_{DUAL,SUPER}SPEED

This commit removes USB_GADGET_DUALSPEED and USB_GADGET_SUPERSPEED
Kconfig options.  Since now kernel allows many UDC drivers to be
compiled, those options may turn to no longer be valid.  For
instance, if someone decides to build UDC that supports super
speed and UDC that supports high speed only, the latter will be
"assumed" to support super speed since USB_GADGET_SUPERSPEED will
be selected by the former.

The test of whether CONFIG_USB_GADGET_*SPEED was defined was just
an optimisation which removed otherwise dead code (ie. if UDC is
not dual speed, there is no need to handle cases that can happen
if speed is high).  This commit removes those checks.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c2410_udc: Do not use integer for NULL
Sachin Kamat [Wed, 22 Aug 2012 10:19:02 +0000 (15:49 +0530)]
usb: gadget: s3c2410_udc: Do not use integer for NULL

'req' being a pointer shouldn't be equated with 0.

Fixes the following compilation warning:
drivers/usb/gadget/s3c2410_udc.c:1299:13: warning:
Using plain integer as NULL pointer

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c2410_udc: Move assignment outside if condition
Sachin Kamat [Wed, 22 Aug 2012 10:19:01 +0000 (15:49 +0530)]
usb: gadget: s3c2410_udc: Move assignment outside if condition

Fixes the following checkpatch errors:
ERROR: do not use assignment in if condition

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c2410_udc: Silence checkpatch errors and warnings
Sachin Kamat [Wed, 22 Aug 2012 10:19:00 +0000 (15:49 +0530)]
usb: gadget: s3c2410_udc: Silence checkpatch errors and warnings

Silences about 75 errors and warnings related to
- Spacing
- Alignment of braces
- Line over 80 characters

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c2410_udc: Use pr_* and dev_err functions
Sachin Kamat [Wed, 22 Aug 2012 10:18:59 +0000 (15:48 +0530)]
usb: gadget: s3c2410_udc: Use pr_* and dev_err functions

Replace printk with corresponding pr_* and dev_err functions.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c2410_udc: Replace <asm/io.h> with <linux/io.h>
Sachin Kamat [Wed, 22 Aug 2012 10:18:58 +0000 (15:48 +0530)]
usb: gadget: s3c2410_udc: Replace <asm/io.h> with <linux/io.h>

Fixes the following warning:
WARNING: Use #include <linux/io.h> instead of <asm/io.h>

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: dummy-hcd: remember to update driver pointer
Alan Stern [Mon, 20 Aug 2012 20:12:47 +0000 (16:12 -0400)]
usb: gadget: dummy-hcd: remember to update driver pointer

This patch (as1599) fixes dummy-hcd to make it update the appropriate
driver pointer when a new gadget driver is bound or unbound.  Without
this change, the gadget driver's name doesn't appear in dev_printk
output.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: lpc32xx_udc: Support multiple controllers
Roland Stigge [Mon, 20 Aug 2012 08:30:14 +0000 (10:30 +0200)]
usb: gadget: lpc32xx_udc: Support multiple controllers

The lpc32xx_udc driver supported only one controller by defining a global
static struct for it. This patch enables multiple instances of the controller
by dynamic allocation of the struct at probe(). A static struct is kept as a
template on initialization since it does some complex preset, reflecting fixed
hardware endpoint structure.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: lpc32xx_udc: Remove usb_endpoint_descriptor
Roland Stigge [Mon, 20 Aug 2012 08:30:13 +0000 (10:30 +0200)]
usb: gadget: lpc32xx_udc: Remove usb_endpoint_descriptor

This patch removes the utilization of struct usb_endpoint_descriptor, as done
by other drivers also. This was done on request by the USB gadget maintainers,
since this API is obsoleted.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: lpc32xx_udc: Port to new start/stop interface
Roland Stigge [Mon, 20 Aug 2012 08:30:12 +0000 (10:30 +0200)]
usb: gadget: lpc32xx_udc: Port to new start/stop interface

This patch adjusts the LPC32xx USB gadget driver to the new udc_start /
udc_stop interface.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: renesas_usbhs: modify the irq handler for sharing irq
Shimoda, Yoshihiro [Mon, 20 Aug 2012 09:39:23 +0000 (18:39 +0900)]
usb: renesas_usbhs: modify the irq handler for sharing irq

When IORESOURCE_IRQ_SHAREABLE is set, the irq handler may be called
even if the interupt of the USB module doesn't happen. So, it may
clear the interrupt flags by mistake. This patch fixes it.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: use %pm to print mac addresses
Andy Shevchenko [Fri, 6 Jul 2012 15:30:21 +0000 (18:30 +0300)]
usb: gadget: use %pm to print mac addresses

%pm already provides pretty print for mac addresses, let's
use that and drop homebrew mac address printing.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: udc-core: Race between disconnect/unbind and setup
Kevin Cernekee [Thu, 9 Aug 2012 08:23:52 +0000 (11:23 +0300)]
usb: gadget: udc-core: Race between disconnect/unbind and setup

usb_gadget_remove_driver() runs through a four-step sequence to shut down
the gadget driver.  For the case of a composite gadget + at91 UDC, this
would look like:

    udc->driver->disconnect(udc->gadget);          // composite_disconnect()
    usb_gadget_disconnect(udc->gadget);            // at91_pullup(gadget, 0)
    udc->driver->unbind(udc->gadget);              // composite_unbind()
    usb_gadget_udc_stop(udc->gadget, udc->driver); // at91_stop()

The UDC driver can receive SETUP packets from the host up until the
point when usb_gadget_disconnect() returns.  On rare occasions, the
gadget driver may see this sequence:

    udc->driver->disconnect(udc->gadget);          // composite_disconnect()
    udc->driver->setup(udc->gadget, &ctrl);        // composite_setup()
    udc->driver->unbind(udc->gadget);              // composite_unbind()

Some gadget drivers, such as composite, assume this will never happen
and crash as a result.

The fix is to quiesce the UDC hardware (via usb_gadget_disconnect)
before running the gadget driver through the disconnect/unbind sequence.

Reviewed-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: use native print_hex_dump_bytes()
Andy Shevchenko [Tue, 7 Aug 2012 16:07:58 +0000 (19:07 +0300)]
usb: gadget: use native print_hex_dump_bytes()

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: s3c-hsotg: fix core reset timeout failure
Du, Changbin [Tue, 24 Jul 2012 00:19:25 +0000 (08:19 +0800)]
usb: gadget: s3c-hsotg: fix core reset timeout failure

The timeout values were 1000 and timeout issue occured many times on my
s3c6410 Soc based board (mostly when booting whith USB cable not
connected). This patch increase the values to 10000 to guarantee the
success of reset.

Having set timeout to 10000, I printed the remained timeout values
which could cause timeout issue before this change (tested several
times).
the first timeout value remained:
timeout = 8079
timeout = 8079
timeout = 8078
timeout = 8081
the second timeout value remained:
timeout = 7940
timeout = 7945
timeout = 7940
timeout = 7938
Seeing from above values, I think the value 10000 is big enough.

Signed-off-by: Du, Changbin <changbin.du@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb composite: fix locking in usb_function_activate
Michael Grzeschik [Wed, 18 Jul 2012 22:20:11 +0000 (00:20 +0200)]
usb composite: fix locking in usb_function_activate

The lockdep hunter mentions a non consistent usage of spin_lock and
spin_lock_irqsafe in the composite_disconnect and usb_function_activate
function:

[   15.700897] =================================
[   15.705255] [ INFO: inconsistent lock state ]
[   15.709617] 3.5.0-rc5+ #413 Not tainted
[   15.713453] ---------------------------------
[   15.717812] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
[   15.723822] uvc-gadget/116 [HC1[1]:SC0[0]:HE0:SE1] takes:
[   15.729222]  (&(&cdev->lock)->rlock){?.+...}, at: [<7f0049e8>] composite_disconnect+0x2c/0x74 [g_webcam]
[   15.738797] {HARDIRQ-ON-W} state was registered at:
[   15.743677]   [<8006de3c>] mark_lock+0x148/0x688
[   15.748325]   [<8006ecb0>] __lock_acquire+0x934/0x1b74
[   15.753481]   [<8007047c>] lock_acquire+0x98/0x138
[   15.758288]   [<804c776c>] _raw_spin_lock+0x4c/0x84
[   15.763188]   [<7f006ae4>] usb_function_activate+0x28/0x94 [g_webcam]
[   15.769652]   [<7f00820c>] usb_ep_autoconfig_reset+0x78/0x98 [g_webcam]
[   15.776287]   [<7f0082a4>] uvc_v4l2_open+0x78/0x94 [g_webcam]
[   15.782054]   [<80366a38>] v4l2_open+0x104/0x130
[   15.786697]   [<800efd30>] chrdev_open+0xa0/0x170
[   15.791423]   [<800e9718>] do_dentry_open.isra.13+0x1e8/0x264
[   15.797186]   [<800ea5d4>] nameidata_to_filp+0x58/0x94
[   15.802340]   [<800fa29c>] do_last.isra.31+0x2a0/0x808
[   15.807497]   [<800faa40>] path_openat+0xc8/0x3e8
[   15.812216]   [<800fae90>] do_filp_open+0x3c/0x90
[   15.816936]   [<800ea6fc>] do_sys_open+0xec/0x184
[   15.821655]   [<800ea7c4>] sys_open+0x30/0x34
[   15.826027]   [<8000e5c0>] ret_fast_syscall+0x0/0x48
[   15.831015] irq event stamp: 6048
[   15.834330] hardirqs last  enabled at (6047): [<804c81b8>] _raw_spin_unlock_irqrestore+0x40/0x54
[   15.843132] hardirqs last disabled at (6048): [<8000e174>] __irq_svc+0x34/0x60
[   15.850370] softirqs last  enabled at (5940): [<80028380>] __do_softirq+0x188/0x270
[   15.858043] softirqs last disabled at (5935): [<80028944>] irq_exit+0xa0/0xa8
[   15.865195]
[   15.865195] other info that might help us debug this:
[   15.871724]  Possible unsafe locking scenario:
[   15.871724]
[   15.877645]        CPU0
[   15.880091]        ----
[   15.882537]   lock(&(&cdev->lock)->rlock);
[   15.886659]   <Interrupt>
[   15.889278]     lock(&(&cdev->lock)->rlock);
[   15.893573]
[   15.893573]  *** DEADLOCK ***
[   15.893573]
[   15.899496] no locks held by uvc-gadget/116.
[   15.903765]
[   15.903765] stack backtrace:
[   15.908125] Backtrace:
[   15.910604] [<80012038>] (dump_backtrace+0x0/0x114) from [<804bf8a4>] (dump_stack+0x20/0x24)
[   15.919043]  r6:dfb8e6f0 r5:dfb8e400 r4:809717ec r3:60000193
[   15.924766] [<804bf884>] (dump_stack+0x0/0x24) from [<804c0c0c>] (print_usage_bug+0x258/0x2c0)
[   15.933388] [<804c09b4>] (print_usage_bug+0x0/0x2c0) from [<8006e240>] (mark_lock+0x54c/0x688)
[   15.942006] [<8006dcf4>] (mark_lock+0x0/0x688) from [<8006edb8>] (__lock_acquire+0xa3c/0x1b74)
[   15.950625] [<8006e37c>] (__lock_acquire+0x0/0x1b74) from [<8007047c>] (lock_acquire+0x98/0x138)
[   15.959418] [<800703e4>] (lock_acquire+0x0/0x138) from [<804c78fc>] (_raw_spin_lock_irqsave+0x58/0x94)
[   15.968736] [<804c78a4>] (_raw_spin_lock_irqsave+0x0/0x94) from [<7f0049e8>] (composite_disconnect+0x2c/0x74 [g_webcam])
[   15.979605]  r7:00000012 r6:df82b0c4 r5:ded755bc r4:ded75580
[   15.985331] [<7f0049bc>] (composite_disconnect+0x0/0x74 [g_webcam]) from [<8033c170>] (_gadget_stop_activity+0xc4/0x120)
[   15.996200]  r6:df82b0c4 r5:df82b0c8 r4:df82b0d0 r3:7f0049bc
[   16.001919] [<8033c0ac>] (_gadget_stop_activity+0x0/0x120) from [<8033e390>] (udc_irq+0x724/0xcb8)
[   16.010877]  r6:df82b010 r5:00000000 r4:df82b010 r3:00000000
[   16.016595] [<8033dc6c>] (udc_irq+0x0/0xcb8) from [<8033baec>] (ci_irq+0x64/0xdc)
[   16.024086] [<8033ba88>] (ci_irq+0x0/0xdc) from [<80086538>] (handle_irq_event_percpu+0x74/0x298)
[   16.032958]  r5:807fd414 r4:df38fdc0
[   16.036566] [<800864c4>] (handle_irq_event_percpu+0x0/0x298) from [<800867a8>] (handle_irq_event+0x4c/0x6c)
[   16.046315] [<8008675c>] (handle_irq_event+0x0/0x6c) from [<80089318>] (handle_level_irq+0xbc/0x11c)
[   16.055447]  r6:def04000 r5:807fd414 r4:807fd3c0 r3:00020000
[   16.061166] [<8008925c>] (handle_level_irq+0x0/0x11c) from [<80085cc8>] (generic_handle_irq+0x38/0x4c)
[   16.070472]  r5:807f7f64 r4:8081e9f8
[   16.074082] [<80085c90>] (generic_handle_irq+0x0/0x4c) from [<8000ef98>] (handle_IRQ+0x5c/0xbc)
[   16.082788] [<8000ef3c>] (handle_IRQ+0x0/0xbc) from [<800085cc>] (tzic_handle_irq+0x6c/0x9c)
[   16.091225]  r8:00000000 r7:def059b0 r6:00000001 r5:00000000 r4:00000000
r3:00000012
[   16.099141] [<80008560>] (tzic_handle_irq+0x0/0x9c) from [<8000e184>] (__irq_svc+0x44/0x60)
[   16.107494] Exception stack(0xdef059b0 to 0xdef059f8)
[   16.112550] 59a0:                                     00000001 00000001 00000000 dfb8e400
[   16.120732] 59c0: 40000013 81a2e500 00000000 81a2e500 00000000 00000000 80862418 def05a0c
[   16.128912] 59e0: def059c8 def059f8 80070e24 804c81bc 20000013 ffffffff
[   16.135542] [<804c8178>] (_raw_spin_unlock_irqrestore+0x0/0x54) from [<8003d0ec>] (__queue_work+0x108/0x470)
[   16.145369]  r5:dfb1a30c r4:81b93c00
[   16.148978] [<8003cfe4>] (__queue_work+0x0/0x470) from [<8003d4e0>] (queue_work_on+0x4c/0x54)
[   16.157511] [<8003d494>] (queue_work_on+0x0/0x54) from [<8003d544>] (queue_work+0x30/0x34)
[   16.165774]  r6:df2e6900 r5:80e0c2f8 r4:dfb1a2c8 r3:def04000
[   16.171495] [<8003d514>] (queue_work+0x0/0x34) from [<80493284>] (rpc_make_runnable+0x9c/0xac)
[   16.180113] [<804931e8>] (rpc_make_runnable+0x0/0xac) from [<80493c88>] (rpc_execute+0x40/0xa8)
[   16.188811]  r5:def05ad4 r4:dfb1a2c8
[   16.192426] [<80493c48>] (rpc_execute+0x0/0xa8) from [<8048c734>] (rpc_run_task+0xa8/0xb4)
[   16.200690]  r8:00000001 r7:df74f520 r6:ded75700 r5:def05ad4 r4:dfb1a2c8
r3:00000002
[   16.208618] [<8048c68c>] (rpc_run_task+0x0/0xb4) from [<801f1608>] (nfs_initiate_read+0xb4/0xd4)
[   16.217403]  r5:df3e86c0 r4:00000000
[   16.221015] [<801f1554>] (nfs_initiate_read+0x0/0xd4) from [<801f1c64>] (nfs_generic_pg_readpages+0x9c/0x114)
[   16.230937] [<801f1bc8>] (nfs_generic_pg_readpages+0x0/0x114) from [<801f0744>] (__nfs_pageio_add_request+0xe8/0x214)
[   16.241545]  r8:000bf000 r7:00000000 r6:00000000 r5:deef4640 r4:def05c1c
r3:801f1bc8
[   16.249463] [<801f065c>] (__nfs_pageio_add_request+0x0/0x214) from [<801f0e3c>] (nfs_pageio_add_request+0x28/0x54)
[   16.259818] [<801f0e14>] (nfs_pageio_add_request+0x0/0x54) from [<801f1394>] (readpage_async_filler+0x114/0x170)
[   16.269992]  r5:def05c58 r4:80fd7300
[   16.273607] [<801f1280>] (readpage_async_filler+0x0/0x170) from [<800bb418>] (read_cache_pages+0xa0/0x108)
[   16.283259]  r8:00200200 r7:00100100 r6:df74f654 r5:def05cd0 r4:80fd7300
[   16.290034] [<800bb378>] (read_cache_pages+0x0/0x108) from [<801f218c>] (nfs_readpages+0xc4/0x168)
[   16.298999] [<801f20c8>] (nfs_readpages+0x0/0x168) from [<800bb1d0>] (__do_page_cache_readahead+0x254/0x354)
[   16.308833] [<800baf7c>] (__do_page_cache_readahead+0x0/0x354) from [<800bb5d0>] (ra_submit+0x38/0x40)
[   16.318145] [<800bb598>] (ra_submit+0x0/0x40) from [<800bb6b0>] (ondemand_readahead+0xd8/0x3b0)
[   16.326851] [<800bb5d8>] (ondemand_readahead+0x0/0x3b0) from [<800bba20>] (page_cache_async_readahead+0x98/0xa8)
[   16.337043] [<800bb988>] (page_cache_async_readahead+0x0/0xa8) from [<800b2118>] (generic_file_aio_read+0x5b4/0x7c4)
[   16.347565]  r6:00000000 r5:df74f654 r4:80fd70a0
[   16.352231] [<800b1b64>] (generic_file_aio_read+0x0/0x7c4) from [<801e82c0>] (nfs_file_read+0x7c/0xcc)
[   16.361544] [<801e8244>] (nfs_file_read+0x0/0xcc) from [<800eab80>] (do_sync_read+0xb4/0xf4)
[   16.369981]  r9:00000000 r8:def05f70 r7:00000000 r6:00000000 r5:dec34900
r4:fffffdee
[   16.377896] [<800eaacc>] (do_sync_read+0x0/0xf4) from [<800eb548>] (vfs_read+0xb4/0x144)
[   16.385987]  r8:00000000 r7:def05f70 r6:76a95008 r5:003e3dd6 r4:dec34900
[   16.392761] [<800eb494>] (vfs_read+0x0/0x144) from [<800eb624>] (sys_read+0x4c/0x78)
[   16.400504]  r8:00000000 r7:00000003 r6:003e3dd6 r5:76a95008 r4:dec34900
[   16.407279] [<800eb5d8>] (sys_read+0x0/0x78) from [<8000e5c0>] (ret_fast_syscall+0x0/0x48)
[   16.415543]  r9:def04000 r8:8000e864 r6:000086b4 r5:00000000 r4:00000000
[   20.872729]  gadget: high-speed config #1: Video
[   20.877368]  gadget: uvc_function_set_alt(0, 0)
[   20.881908]  gadget: uvc_function_set_alt(1, 0)
[   20.891464]  gadget: uvc_function_set_alt(1, 0)

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: mv_udc: fix boot up hang
Neil Zhang [Tue, 10 Jul 2012 02:07:07 +0000 (10:07 +0800)]
usb: gadget: mv_udc: fix boot up hang

Fix boot up hang when enable udc without otg enabled.
The root cause is that the clock will be shut down when probe routine is
finished because of clock gating. When a gadget driver is registered at
this time, it will call mv_udc_start which in turn will call
mv_udc_vbus_session. If there is no cable attached at the boot up time,
the vbus is low, so it will call stop_activity path without clock
enabled which will cause system hang then.
Actually, we need't go this path when clock is disabled, what we need to
do is just jump out.

Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: mv_udc: fix hang when shutdown
Yunfan Zhang [Tue, 10 Jul 2012 02:07:06 +0000 (10:07 +0800)]
usb: gadget: mv_udc: fix hang when shutdown

Fix system hang in udc shutdown routine which caused by accessing usb
register when clock is disabled. So enable usb clock before access
register.

Signed-off-by: Yunfan Zhang <yfzhang@marvell.com>
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: mv_udc: add iso support
Chao Xie [Tue, 10 Jul 2012 02:07:05 +0000 (10:07 +0800)]
usb: gadget: mv_udc: add iso support

In order to support iso, we need do the following things:
1. fix length for one dtd
2. allow req contains multiple packets for a ISO transfer

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Yu Xu <yuxu@marvell.com>
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: mv_udc: enable stream mode
Neil Zhang [Tue, 10 Jul 2012 02:07:04 +0000 (10:07 +0800)]
usb: gadget: mv_udc: enable stream mode

According to ChipIdea's reference manual in section 8.5.2
"Non-streaming operational mode in device mode", we'd better enable stream
mode, especially that ISO endpoints are not supported when the SDIS bit
is set.

Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: mv_udc: avoid sleeping on spinlock
Neil Zhang [Tue, 10 Jul 2012 02:07:03 +0000 (10:07 +0800)]
usb: gadget: mv_udc: avoid sleeping on spinlock

build_dtd() can be called when hold a spinlock, but GFP_KERNEL may cause
dma_pool_alloc() sleep, So we need use GFP_ATOMIC instead of GFP_KERNEL.
But using GFP_ATOMIC may cause failure when allocating memory, add error
handler to handle it.

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: mv_udc: remove unused code
Neil Zhang [Tue, 10 Jul 2012 02:07:02 +0000 (10:07 +0800)]
usb: gadget: mv_udc: remove unused code

Clean unused code for mv_udc driver.

Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: mv_udc: reduce the delay interval
Neil Zhang [Tue, 10 Jul 2012 02:07:01 +0000 (10:07 +0800)]
usb: gadget: mv_udc: reduce the delay interval

There are several places use udelay(LOOPS_USEC) to wait the status to be
changed, but the delay interval is a bit too long, so reduce it to
enhance the performance.

Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agoLinux 3.6-rc2 v3.6-rc2
Linus Torvalds [Thu, 16 Aug 2012 21:51:24 +0000 (14:51 -0700)]
Linux 3.6-rc2

11 years agoautofs4 - fix get_next_positive_subdir()
Ian Kent [Mon, 6 Aug 2012 01:37:47 +0000 (09:37 +0800)]
autofs4 - fix get_next_positive_subdir()

Following a report of a crash during an automount expire I found that
the locking in fs/autofs4/expire.c:get_next_positive_subdir() was wrong.
Not only is the locking wrong but the function is more complex than it
needs to be.

The function is meant to calculate (and dget) the next entry in the list
of directories contained in the root of an autofs mount point (an autofs
indirect mount to be precise). The main problem was that the d_lock of
the owner of the list was not being taken when walking the list, which
lead to list corruption under load. The only other lock that needs to
be taken is against the next dentry candidate so it can be checked for
usability.

Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge tag 'vfio-for-v3.6-rc1' of git://github.com/awilliam/linux-vfio
Linus Torvalds [Thu, 16 Aug 2012 18:47:42 +0000 (11:47 -0700)]
Merge tag 'vfio-for-v3.6-rc1' of git://github.com/awilliam/linux-vfio

Pull VFIO fix from Alex Williamson:
 "Just a trivial patch to include vfio.h in the installed headers so we
  can complete userspace integration into QEMU."

* tag 'vfio-for-v3.6-rc1' of git://github.com/awilliam/linux-vfio:
  vfio: Include vfio.h in installed headers

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
Linus Torvalds [Thu, 16 Aug 2012 18:46:31 +0000 (11:46 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

Pull fuse updates from Miklos Szeredi.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: verify all ioctl retry iov elements
  fuse: add missing INIT flag descriptions
  fuse: add missing INIT flags
  fuse: update attributes on aio_read
  fuse: invalidate inode mapping if mtime changes
  fuse: add FUSE_AUTO_INVAL_DATA init flag

11 years agoMerge tag 'stable/for-linus-3.6-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 16 Aug 2012 18:31:59 +0000 (11:31 -0700)]
Merge tag 'stable/for-linus-3.6-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

Pull Xen fix from Konrad Rzeszutek Wilk:
 "Way back in v3.5 we added a mechanism to populate back pages that were
  released (they overlapped with MMIO regions), but neglected to reserve
  the proper amount of virtual space for extend_brk to work properly.

  Coincidentally some other commit aligned the _brk space to larger area
  so I didn't trigger this until it was run on a machine with more than
  2GB of MMIO space."

 * On machines with large MMIO/PCI E820 spaces we fail to boot b/c
   we failed to pre-allocate large enough virtual space for extend_brk.

* tag 'stable/for-linus-3.6-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/p2m: Reserve 8MB of _brk space for P2M leafs when populating back.

11 years agoMerge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh
Linus Torvalds [Thu, 16 Aug 2012 18:31:29 +0000 (11:31 -0700)]
Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh

Pull SuperH fixes from Paul Mundt.

* tag 'sh-for-linus' of git://github.com/pmundt/linux-sh:
  sh: intc: Handle domain association for sparseirq pre-allocated vectors.
  sh: sh7269: Fix LCD pinmux
  sh: dma: fix request_irq usage

11 years agoMAINTAINERS: update address for Dan Williams
Dan Williams [Thu, 16 Aug 2012 02:20:02 +0000 (19:20 -0700)]
MAINTAINERS: update address for Dan Williams

Moved to djbw@fb.com

Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Dan Williams <djbw@fb.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoscripts/decodecode: Fixup trapping instruction marker
Borislav Petkov [Wed, 15 Aug 2012 11:00:51 +0000 (13:00 +0200)]
scripts/decodecode: Fixup trapping instruction marker

When dumping "Code: " sections from an oops, the trapping instruction
%rip points to can be a string copy

  2b:*  f3 a5                   rep movsl %ds:(%rsi),%es:(%rdi)

and the line contain a bunch of ":".  Current "cut" selects only the and
the second field output looks funnily overlaid this:

  2b:*  f3 a5                   rep movsl %ds     <-- trapping instruction:(%rsi),%es:(%rdi

Fix this by selecting the remaining fields too.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Thu, 16 Aug 2012 18:13:16 +0000 (11:13 -0700)]
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull two slave-dmaengine fixes from Vinod Koul:
 "One fixes the correct use of clock API in imx driver and the other
  enables clock for tegra driver, which is used for other tegra driver
  conversion to dmanegine in -next."

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dma: tegra: enable/disable dma clock
  dma: imx-dma: Fix kernel crash due to missing clock conversion

11 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Thu, 16 Aug 2012 18:08:32 +0000 (11:08 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull more drm fixes from Dave Airlie:
 "Just some intel and nouveau ones this time, intel has more edp panel
  fixes for macbooks and nouveau has a suspend/resume regression fix in
  there."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/i915: Apply post-sync write for pipe control invalidates
  drm/i915: reorder edp disabling to fix ivb MacBook Air
  drm/nv86/fifo: suspend fix
  drm/nouveau: disable copy engine on NVAF
  nouveau: fixup scanout enable in nvc0_pm
  drm/nouveau/aux: mask off higher bits of auxch index in i2c table entry
  drm/nvd0/disp: mask off high 16 bit of negative cursor x-coordinate
  drm/i915: ensure i2c adapter is all set before adding it
  drm/i915: ignore eDP bpc settings from vbt
  drm/i915: Fix blank panel at reopening lid
  drm/nve0/fifo: add support for the flip completion swmthd

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Linus Torvalds [Thu, 16 Aug 2012 00:07:01 +0000 (17:07 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

Pull two sparc fixes from David S. Miller.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc64: Be less verbose during vmemmap population.
  sparc64: do not clobber personality flags in sys_sparc64_personality()

11 years agoMerge branch 'drm-nouveau-fixes' of git://git.freedesktop.org/git/nouveau/linux-2...
Dave Airlie [Wed, 15 Aug 2012 10:31:22 +0000 (20:31 +1000)]
Merge branch 'drm-nouveau-fixes' of git://git.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

* 'drm-nouveau-fixes' of git://git.freedesktop.org/git/nouveau/linux-2.6:
  drm/nv86/fifo: suspend fix
  drm/nouveau: disable copy engine on NVAF
  nouveau: fixup scanout enable in nvc0_pm
  drm/nouveau/aux: mask off higher bits of auxch index in i2c table entry
  drm/nvd0/disp: mask off high 16 bit of negative cursor x-coordinate
  drm/nve0/fifo: add support for the flip completion swmthd

11 years agoMerge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel...
Dave Airlie [Wed, 15 Aug 2012 10:27:51 +0000 (20:27 +1000)]
Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes

Daniel Vetter writes:

"A few important fixers:
- fix various lvds backlight issues, regressed in 3.6 (Takashi Iwai)
- make the retina mbp work (ignore bogus edp bpc value in vbt)
- fix a gmbus regression introduced in (iirc) 3.4 (Jani Nikula)
- fix an edp panel power sequence regression, fixes the new macbook air
- apply the tlb invalidate w/a

Otherwise we still have another gmbus regression (patches are awaiting
tested-bys) and there's something odd going with some rare systems not
entering rc6 often enough (and hence blowing through too much power).  It
seems to be a timing-related issue and can be mitigated by frobbing the
magic tuning parameters. We're still working on that one. Also, we still
have some fallout from the hw context support, but you can only hit that
with mesa master."

* 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel:
  drm/i915: Apply post-sync write for pipe control invalidates
  drm/i915: reorder edp disabling to fix ivb MacBook Air
  drm/i915: ensure i2c adapter is all set before adding it
  drm/i915: ignore eDP bpc settings from vbt
  drm/i915: Fix blank panel at reopening lid

11 years agosparc64: Be less verbose during vmemmap population.
David S. Miller [Wed, 15 Aug 2012 07:37:29 +0000 (00:37 -0700)]
sparc64: Be less verbose during vmemmap population.

On a 2-node machine with 256GB of ram we get 512 lines of
console output, which is just too much.

This mimicks Yinghai Lu's x86 commit c2b91e2eec9678dbda274e906cc32ea8f711da3b
(x86_64/mm: check and print vmemmap allocation continuous) except that
we aren't ever going to get contiguous block pointers in between calls
so just print when the virtual address or node changes.

This decreases the output by an order of 16.

Also demote this to KERN_DEBUG.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodrm/i915: Apply post-sync write for pipe control invalidates
Chris Wilson [Fri, 10 Aug 2012 09:18:10 +0000 (10:18 +0100)]
drm/i915: Apply post-sync write for pipe control invalidates

When invalidating the TLBs it is documentated as requiring a post-sync
write. Failure to do so seems to result in a GPU hang.

Exposure to this hang on IVB seems to be a result of removing the extra
stalls required for SNB pipecontrol workarounds:

commit 6c6cf5aa9c583478b19e23149feaa92d01fb8c2d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jul 20 18:02:28 2012 +0100

    drm/i915: Only apply the SNB pipe control w/a to gen6

Note: Manually switch the pipe_control cmd to 4 dwords to avoid a
(silent) functional conflict with -next. This way will get a loud (but
conflict with next (since the scratch_addr has been deleted there).

Reported-and-tested-by: yex.tian@intel.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53322
Acked-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: added note about merge conflict with -next.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agodrm/i915: reorder edp disabling to fix ivb MacBook Air
Daniel Vetter [Sun, 12 Aug 2012 20:17:14 +0000 (22:17 +0200)]
drm/i915: reorder edp disabling to fix ivb MacBook Air

eDP is tons of fun. It turns out that at least the new MacBook Air 5,1
model absolutely doesn't like the new force vdd dance we've introduced
in

commit 6cb49835da0426f69a2931bc2a0a8156344b0e41
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sun May 20 17:14:50 2012 +0200

    drm/i915: enable vdd when switching off the eDP panel

But that patch also tried to fix some neat edp sequence issue with the
force_vdd timings. Closer inspection reveals that we've raised
force_vdd only to do the aux channel communication dp_sink_dpms. If we
move the edp_panel_off below that, we don't need any force_vdd for the
disable sequence, which makes the Air happy.

Unfortunately the reporter of the original bug that the above commit
fixed is travelling, so we can't test whether this regresses things.
But my theory is that since we don't check for any power-off ->
force_vdd-on delays in edp_panel_vdd_on, this was the actual
root-cause of this failure. With that force_vdd dance completely
eliminated, I'm hopeful the original bug stays fixed, too.

For reference the old bug, which hopefully doesn't get broken by this:

https://bugzilla.kernel.org/show_bug.cgi?id=43163

In any case, regression fixers win over plain bugfixes, so this needs
to go in asap.

v2: The crucial pieces seems to be to clear the force_vdd flag
uncoditionally, too, in edp_panel_off. Looks like this is left behind
by the firmware somehow.

v3: The Apple firmware seems to switch off the panel on it's own, hence
we still need to keep force_vdd on, but properly clear it when switching
the panel off.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=45671
Tested-by: Roberto Romer <sildurin@gmail.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Tested-by: Keith Packard <keithp@keithp.com>
Cc: stable@vger.kernel.org
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Tue, 14 Aug 2012 04:58:59 +0000 (07:58 +0300)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 patches from Martin Schwidefsky:
 "Included are bug fixes and a patch to enable system call filtering
  with BPF."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/compat: fix mmap compat system calls
  s390/compat: fix compat wrappers for process_vm system calls
  s390: do not clobber personality flags in sys_32_personality()
  s390/seccomp: add support for system call filtering using BPF
  s390/sclp_sdias: Add missing break and "fall through"
  s390/mm: remove MAX_PHYSADDR_BITS define

11 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Tue, 14 Aug 2012 04:52:41 +0000 (07:52 +0300)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Radeon and intel fixes mostly, one fix to the mgag200 driver to not
  hang on certain server variants."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (32 commits)
  drm/radeon: fix typo in function header comment
  drm/radeon/kms: implement timestamp userspace query (v2)
  drm/radeon/kms: add MSAA texture support for r600-evergreen
  drm/radeon/kms: reorder code in r600_check_texture_resource
  drm/radeon: fence virtual address and free it once idle v4
  drm/radeon: fix some missing parens in asic macros
  drm/radeon: add some new SI pci ids
  drm/radeon: fix ordering in pll picking on dce4+
  drm/radeon: do not reenable crtc after moving vram start address
  drm/radeon: fix bank tiling parameters on cayman
  drm/radeon: fix bank tiling parameters on evergreen
  drm/radeon: fix bank tiling parameters on SI
  drm/radeon: properly handle crtc powergating
  drm/radeon: properly handle SS overrides on TN (v2)
  drm/radeon/dce4+: set a more reasonable cursor watermark
  drm/radeon: fix handling for ddc type 5 on combios
  drm/mgag200: fix G200ER pll picking algorithm
  drm/edid: Fix potential memory leak in edid_load()
  drm/udl: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(.. [1]
  drm/radeon/kms: allow "invalid" DB formats as a means to disable DB
  ...

11 years agoGPIO: gpio-pxa: fix building without CONFIG_OF
Arnd Bergmann [Mon, 13 Aug 2012 14:36:10 +0000 (14:36 +0000)]
GPIO: gpio-pxa: fix building without CONFIG_OF

Commit 7212157267 ("GPIO: gpio-pxa: fix devicetree functions") added an
"xlate" function pointer to the irq_domain_ops, but this function is nor
declared or defined anywhere when CONFIG_OF is disabled, causing the
build error:

  drivers/gpio/gpio-pxa.c:532:11: error: 'irq_domain_xlate_twocell' undeclared here (not in a function)

Extending the DT-only code section to cover the irq_domain_ops and the
pxa_gpio_dt_ids solves this problem and makes it clearer which code is
actually used without DT.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agodrm/nv86/fifo: suspend fix
Maxim Levitsky [Mon, 13 Aug 2012 23:22:07 +0000 (02:22 +0300)]
drm/nv86/fifo: suspend fix

This fix is a backport from the reworked nouveau driver.  It masks off the
engines we're not expecting to use before attempting a channel kickoff.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: disable copy engine on NVAF
Henrik Rydberg [Sat, 4 Aug 2012 06:00:45 +0000 (08:00 +0200)]
drm/nouveau: disable copy engine on NVAF

The copy engine exhibits random memory corruption in at least one case, the
GeForce 320M (nv50, 0xaf) in the MacBookAir3,1.

This patch omits creating the engine for the specific chipset, falling back
to M2MF, which kills the symptoms.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agonouveau: fixup scanout enable in nvc0_pm
Maarten Lankhorst [Mon, 30 Jul 2012 10:03:30 +0000 (12:03 +0200)]
nouveau: fixup scanout enable in nvc0_pm

Fixes screen being black after changing performance level.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: stable@vger.kernel.org [3.5+]
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/aux: mask off higher bits of auxch index in i2c table entry
Ben Skeggs [Fri, 27 Jul 2012 04:18:03 +0000 (14:18 +1000)]
drm/nouveau/aux: mask off higher bits of auxch index in i2c table entry

At least partially fixes DP output detection on W530.  Not sure if more
issues remain, or if my adaptor is just behaving weirdly (it does that
sometimes).

In any case, this patch is necessary.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nvd0/disp: mask off high 16 bit of negative cursor x-coordinate
Christoph Bumiller [Thu, 26 Jul 2012 18:53:19 +0000 (20:53 +0200)]
drm/nvd0/disp: mask off high 16 bit of negative cursor x-coordinate

Signed-off-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
11 years agoMerge branch 'drm-fixes-3.6' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Mon, 13 Aug 2012 23:25:01 +0000 (09:25 +1000)]
Merge branch 'drm-fixes-3.6' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

Alex Deucher writes:
This is the current set of radeon fixes for 3.6.  Nothing too major.

Highlights:
- various display fixes
- some SI fixes
- new SI pci ids
- major VM fix
- CS checker support for MSAA

I've tested on a number of cards across generations and noticed no problems.

* 'drm-fixes-3.6' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: fix typo in function header comment
  drm/radeon/kms: implement timestamp userspace query (v2)
  drm/radeon/kms: add MSAA texture support for r600-evergreen
  drm/radeon/kms: reorder code in r600_check_texture_resource
  drm/radeon: fence virtual address and free it once idle v4
  drm/radeon: fix some missing parens in asic macros
  drm/radeon: add some new SI pci ids
  drm/radeon: fix ordering in pll picking on dce4+
  drm/radeon: do not reenable crtc after moving vram start address
  drm/radeon: fix bank tiling parameters on cayman
  drm/radeon: fix bank tiling parameters on evergreen
  drm/radeon: fix bank tiling parameters on SI
  drm/radeon: properly handle crtc powergating
  drm/radeon: properly handle SS overrides on TN (v2)
  drm/radeon/dce4+: set a more reasonable cursor watermark
  drm/radeon: fix handling for ddc type 5 on combios

11 years agodrm/i915: ensure i2c adapter is all set before adding it
Jani Nikula [Mon, 13 Aug 2012 14:33:02 +0000 (17:33 +0300)]
drm/i915: ensure i2c adapter is all set before adding it

i2c_add_adapter() may do i2c transfers on the bus to detect supported
devices. Therefore the adapter needs to be all set before adding it. This
was not the case for the bit-banging fallback, resulting in an oops if the
device detection GMBUS transfers timed out. Fix the issue by calling
i2c_add_adapter() only after intel_gpio_setup().

LKML-Reference: <5021F00B.7000503@ionic.de>
Tested-by: Mihai Moldovan <ionic@ionic.de>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agodrm/radeon: fix typo in function header comment
Dmitrii Cherkasov [Mon, 13 Aug 2012 14:53:29 +0000 (10:53 -0400)]
drm/radeon: fix typo in function header comment

Signed-off-by: Dmitrii Cherkasov <DCherkasov@luxsoft.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/kms: implement timestamp userspace query (v2)
Marek Olšák [Thu, 9 Aug 2012 14:34:17 +0000 (16:34 +0200)]
drm/radeon/kms: implement timestamp userspace query (v2)

Returns a snapshot of the GPU clock counter.  Needed
for certain OpenGL extensions.

v2: agd5f
- address Jerome's comments
- add function documentation

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/kms: add MSAA texture support for r600-evergreen
Marek Olšák [Thu, 9 Aug 2012 14:34:16 +0000 (16:34 +0200)]
drm/radeon/kms: add MSAA texture support for r600-evergreen

Most of the checking seems to be in place already. As you can see,
log2(number of samples) resides in LAST_LEVEL.

This is required for MSAA support (namely for depth-stencil resolve and
blitting between MSAA resources).

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon/kms: reorder code in r600_check_texture_resource
Marek Olšák [Thu, 9 Aug 2012 14:34:15 +0000 (16:34 +0200)]
drm/radeon/kms: reorder code in r600_check_texture_resource

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: fence virtual address and free it once idle v4
Jerome Glisse [Mon, 6 Aug 2012 16:32:21 +0000 (12:32 -0400)]
drm/radeon: fence virtual address and free it once idle v4

Virtual address need to be fenced to know when we can safely remove it.
This patch also properly clear the pagetable. Previously it was
serouisly broken.

Kernel 3.5/3.4 need a similar patch but adapted for difference in mutex locking.

v2: For to update pagetable when unbinding bo (don't bailout if
    bo_va->valid is true).
v3: Add kernel 3.5/3.4 comment.
v4: Fix compilation warnings.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: fix some missing parens in asic macros
Alex Deucher [Fri, 3 Aug 2012 15:50:54 +0000 (11:50 -0400)]
drm/radeon: fix some missing parens in asic macros

Better safe than sorry.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agodrm/radeon: add some new SI pci ids
Alex Deucher [Mon, 6 Aug 2012 14:03:59 +0000 (10:03 -0400)]
drm/radeon: add some new SI pci ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
11 years agodrm/radeon: fix ordering in pll picking on dce4+
Alex Deucher [Mon, 6 Aug 2012 21:06:03 +0000 (17:06 -0400)]
drm/radeon: fix ordering in pll picking on dce4+

No functional change, but re-order the cases so they
evaluate properly due to the way the DCE macros work.

Noticed by kallisti5 on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agodrm/radeon: do not reenable crtc after moving vram start address
Jerome Glisse [Fri, 27 Jul 2012 20:32:24 +0000 (16:32 -0400)]
drm/radeon: do not reenable crtc after moving vram start address

It seems we can not update the crtc scanout address. After disabling
crtc, update to base address do not take effect after crtc being
reenable leading to at least frame being scanout from the old crtc
base address. Disabling crtc display request lead to same behavior.

So after changing the vram address if we don't keep crtc disabled
we will have the GPU trying to read some random system memory address
with some iommu this will broke the crtc engine and will lead to
broken display and iommu error message.

So to avoid this, disable crtc. For flicker less boot we will need
to avoid moving the vram start address.

This patch should also fix :

https://bugs.freedesktop.org/show_bug.cgi?id=42373

Cc: <stable@vger.kernel.org>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
11 years agodrm/radeon: fix bank tiling parameters on cayman
Alex Deucher [Tue, 31 Jul 2012 15:05:11 +0000 (11:05 -0400)]
drm/radeon: fix bank tiling parameters on cayman

Handle the 16 bank case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
11 years agodrm/radeon: fix bank tiling parameters on evergreen
Alex Deucher [Tue, 31 Jul 2012 15:01:10 +0000 (11:01 -0400)]
drm/radeon: fix bank tiling parameters on evergreen

Handle the 16 bank case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
11 years agodrm/radeon: fix bank tiling parameters on SI
Christian König [Tue, 31 Jul 2012 11:48:51 +0000 (13:48 +0200)]
drm/radeon: fix bank tiling parameters on SI

The sixteen bank case wasn't handled here, leading to GPU
crashes because of userspace miscalculation.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>