deliverable/linux.git
10 years agousbtmc: convert to devm_kzalloc
Andy Shevchenko [Mon, 15 Jul 2013 08:59:41 +0000 (11:59 +0300)] 
usbtmc: convert to devm_kzalloc

kfree(data) will be called implicitly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousbtmc: remove redundant braces
Andy Shevchenko [Mon, 15 Jul 2013 08:59:43 +0000 (11:59 +0300)] 
usbtmc: remove redundant braces

There is a few cases where braces are not needed. This patch removes
unnecessary '& 255' pieces as well when lvalue type is u8.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousbtmc: call pr_err instead of plain printk
Andy Shevchenko [Mon, 15 Jul 2013 08:59:42 +0000 (11:59 +0300)] 
usbtmc: call pr_err instead of plain printk

Additionally remove useless label.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousbtmc: remove trailing spaces
Andy Shevchenko [Mon, 15 Jul 2013 08:59:40 +0000 (11:59 +0300)] 
usbtmc: remove trailing spaces

Recent patch series introduces few trailing spaces. This patch removes them.
No functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousbfs: Allow printer class 'get_device_id' without needing to claim the intf
Hans de Goede [Fri, 12 Jul 2013 08:04:18 +0000 (10:04 +0200)] 
usbfs: Allow printer class 'get_device_id' without needing to claim the intf

For certain (HP) printers the printer device_id does not only contain a
static part identifying the printer, but it also contains a dynamic part
giving printer status, ink level, etc.

To get to this info various userspace utilities need to be able to make a
printer class 'get_device_id' request without first claiming the interface
(as that is in use for the actual printer driver).

Since the printer class 'get_device_id' request does not change interface
settings in anyway, allowing this without claiming the interface should not
cause any issues.

CC: Sanjay Kumar <sanjay.kumar14@hp.com>
CC: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: host: Use usb_hcd_platform_shutdown() wherever possible
Roger Quadros [Mon, 22 Jul 2013 12:04:50 +0000 (15:04 +0300)] 
USB: host: Use usb_hcd_platform_shutdown() wherever possible

Most HCD drivers are doing the same thing in their ".shutdown" callback
so it makes sense to use the generic usb_hcd_platform_shutdown()
handler there.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: remove redundant "#if"
Alan Stern [Thu, 11 Jul 2013 18:58:23 +0000 (14:58 -0400)] 
USB: remove redundant "#if"

This patch removes a redundant nested "#ifdef CONFIG_PM" from the hub
driver.  It also adds a label to the "#endif" line corresponding to
the outer "#ifdef CONFIG_PM".

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousb: misc: EHSET Test Fixture device driver for host compliance
Manu Gautam [Wed, 3 Jul 2013 03:13:51 +0000 (20:13 -0700)] 
usb: misc: EHSET Test Fixture device driver for host compliance

An Embedded Host High-Speed Electrical Test (EHSET) test fixture is
used to initiate test modes on a host controller in order to perform
the high speed electrical testing procedure for USB-IF compliance.
When this test fixture is connected to a host, it can enumerate as
one of several selectable VID/PID pairs, each corresponding to one
of the following test modes:

* TEST_SE0_NAK
* TEST_J
* TEST_K
* TEST_PACKET
* HS_HOST_PORT_SUSPEND_RESUME
* SINGLE_STEP_GET_DEV_DESC
* SINGLE_STEP_SET_FEATURE

The USB EHSET procedure can be found here:
http://www.usb.org/developers/onthego/EHSET_v1.01.pdf

Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
[jackp@codeaurora.org: imported from commit 073c9409 on codeaurora.org;
 minor cleanup and updated author email]
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousb: clamp bInterval to allowed range
Felipe Balbi [Tue, 2 Jul 2013 07:50:15 +0000 (10:50 +0300)] 
usb: clamp bInterval to allowed range

bInterval must be within the range 1 - 16
when running at High/Super speed, and within
the range 1 - 255 when running at Full/Low speed.

In order to catch drivers passing a too
large bInterval on Super/High speed scenarios
(thus overflowing urb->interval), let's clamp()
the argument to the allowed ranges.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousb: atm: speedtch: be careful with bInterval
Felipe Balbi [Mon, 1 Jul 2013 08:23:23 +0000 (11:23 +0300)] 
usb: atm: speedtch: be careful with bInterval

bInterval must be on the range 1 - 16, if we
want to pass the maximum allowed, we should
be passing 16.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousb: class: cdc-acm: be careful with bInterval
Felipe Balbi [Mon, 1 Jul 2013 08:23:24 +0000 (11:23 +0300)] 
usb: class: cdc-acm: be careful with bInterval

bInterval must be on the range 1 - 16, if we
want to pass the maximum allowed, we should
be passing 16

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoRevert "usb: host: Faraday fotg210-hcd driver"
Greg Kroah-Hartman [Wed, 24 Jul 2013 23:10:58 +0000 (16:10 -0700)] 
Revert "usb: host: Faraday fotg210-hcd driver"

This reverts commit 1dd3d123239179fad5de5dc00a6e0014a1918fde.

The email address for the developer now bounces, which means they have
moved on, so remove the driver until someone else from the company steps
up to maintain it.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousb: host: Faraday fotg210-hcd driver
Yuan-Hsin Chen [Wed, 19 Jun 2013 19:53:04 +0000 (19:53 +0000)] 
usb: host: Faraday fotg210-hcd driver

FOTG210 is an OTG controller which can be configured as an
USB2.0 host. FOTG210 host is an ehci-like controller with
some differences. First, register layout of FOTG210 is
incompatible with EHCI. Furthermore, FOTG210 is lack of
siTDs which means iTDs are used for both HS and FS ISO
transfer.

Signed-off-by: Yuan-Hsin Chen <yhchen@faraday-tech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: check sg buffer size in usb_submit_urb
Ming Lei [Fri, 28 Jun 2013 01:38:12 +0000 (09:38 +0800)] 
USB: check sg buffer size in usb_submit_urb

USB spec stats that short packet can only appear at the end
of transfer. Because lost of HC(EHCI/UHCI/OHCI/...) can't
build a full packet from discontinuous buffers, we introduce
the limit in usb_submit_urb() to avoid such kind of bad sg buffers
coming from driver.

The limit might be a bit strict:
- platform has iommu to do sg list mapping
- some host controllers may support to build full packet from
discontinuous buffers.

But considered that most of HCs don't support that, and driver
need work well or keep consistent on different HCs and ARCHs, we
have to introduce the limit.

Currently, only usbtest is reported to pass such sg buffers to HC,
and other users(mass storage, usbfs) don't have the problem.

We don't check it on USB wireless device, because:
- wireless devices can't be attached to common USB
  bus(EHCI/UHCI/OHCI/...)
- the max packet size of endpoint may be odd, and often can't
devide 4KB which is a typical usage in usb mass storage application

Reported-by: Konstantin Filatov <kfilatov@parallels.com>
Reported-by: Denis V. Lunev <den@openvz.org>
Cc: Felipe Balbi <balbi@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: isp1362: move debug files from proc to debugfs
Greg Kroah-Hartman [Tue, 2 Jul 2013 19:22:07 +0000 (12:22 -0700)] 
USB: isp1362: move debug files from proc to debugfs

Drivers should not be putting debug files in /proc/ that is what debugfs
is for, so move the isp1362 driver's debug file to debugfs.

Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: sl811: move debug files from proc to debugfs
Greg Kroah-Hartman [Tue, 2 Jul 2013 19:22:06 +0000 (12:22 -0700)] 
USB: sl811: move debug files from proc to debugfs

Drivers should not be putting debug files in /proc/ that is what debugfs
is for, so move the sl811 driver's debug file to debugfs.

Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: remove unneeded idr.h include
Greg Kroah-Hartman [Tue, 2 Jul 2013 19:22:05 +0000 (12:22 -0700)] 
USB: remove unneeded idr.h include

None of these USB files need idr.h, so don't include it.

Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge tag 'for-usb-next-2013-07-23' of git://git.kernel.org/pub/scm/linux/kernel...
Greg Kroah-Hartman [Wed, 24 Jul 2013 16:07:32 +0000 (09:07 -0700)] 
Merge tag 'for-usb-next-2013-07-23' of git://git./linux/kernel/git/sarah/xhci into usb-next

Sarah writes:

xhci: Features for 3.12

In the spirit of "let's stop gossiping around the water cooler and get to work",
here's some xHCI patches for 3.12.

They include a patch for suspend/resume support for xhci platform hosts, two
patches to support showing USB 2.1 link status, and a patch to future-proof the
Intel EHCI to xHCI port switchover.

Sarah Sharp

10 years agoUSB: sl811: remove CONFIG_USB_DEBUG dependency
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:33:03 +0000 (11:33 -0700)] 
USB: sl811: remove CONFIG_USB_DEBUG dependency

This removes the dependency of the driver on CONFIG_USB_DEBUG and moves
it to us the dynamic debug subsystem instead.  Bonus is the fact that we
can now properly determine the exact hardware that is spitting out the
messages.

This lets debugging be enabled without having to rebuild the driver, an
important thing for users that can not do it.

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: isp116x: remove dependency on CONFIG_USB_DEBUG
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:33:02 +0000 (11:33 -0700)] 
USB: isp116x: remove dependency on CONFIG_USB_DEBUG

Move all debugging messages in the driver to use the dynamic debug
subsystem, and not rely on CONFIG_USB_DEBUG to turn them on or off.

This lets debugging be enabled without having to rebuild the driver, an
important thing for users that can not do it.

It also removes the pointless IRQ_TEST() macro, as that was totally
useless and obviously never used.

Cc: Olav Kongas <ok@artecdesign.ee>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: isp1362: remove CONFIG_USB_DEBUG dependency
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:33:01 +0000 (11:33 -0700)] 
USB: isp1362: remove CONFIG_USB_DEBUG dependency

Now that the debugging macros are cleaned up, just rely on the dynamic
debug code in the kernel to do the debug messages for the driver.

This lets debugging be enabled without having to rebuild the driver, an
important thing for users that can not do it.

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: isp1362: remove _DBG() usage
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:33:00 +0000 (11:33 -0700)] 
USB: isp1362: remove _DBG() usage

If you want a debug call, just make it, so move to using the
already-there DBG() call.  No need to make things more complex than they
really need to be.

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: isp1362: remove unused _WARN_ON() calls
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:59 +0000 (11:32 -0700)] 
USB: isp1362: remove unused _WARN_ON() calls

Like _BUG_ON(), _WARN_ON() wasn't ever being used, so just delete it, as
obviously things are working properly now (if not, we have bigger
problems...)

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: isp1362: remove unused _BUG_ON() calls
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:58 +0000 (11:32 -0700)] 
USB: isp1362: remove unused _BUG_ON() calls

We shouldn't ever panic in a driver, and these calls were never being
used, so just delete them, as obviously the driver is working properly
now (right?)

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: gadget: fix up comment
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:57 +0000 (11:32 -0700)] 
USB: gadget: fix up comment

This endif is for CONFIG_USB_GADGET_DEBUG_FILES, not CONFIG_USB_DEBUG,
so document it properly.

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: phy: remove CONFIG_USB_DEBUG usage
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:56 +0000 (11:32 -0700)] 
USB: phy: remove CONFIG_USB_DEBUG usage

Now that no USB phy driver is using CONFIG_USB_DEBUG, remove it from the
Makefile.

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: phy: remove custom DBG macro
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:55 +0000 (11:32 -0700)] 
USB: phy: remove custom DBG macro

Use the in-kernel pr_debug() calls instead of trying to roll your own
DBG macro.  This means the dynamic debugging calls now work here, and
there is no dependency on CONFIG_USB_DEBUG for the phy code anymore.

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: usbatm: remove CONFIG_USB_DEBUG dependancy
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:54 +0000 (11:32 -0700)] 
USB: usbatm: remove CONFIG_USB_DEBUG dependancy

Now that no USB atm driver is relying on the CONFIG_USB_DEBUG option
(well, really the DEBUG option, thanks to some Makefile fun), remove it
from the Makefile.

Also remove two last vestiges of DEBUG in the usbatm.c driver, moving
one to VERBOSE_DEBUG, which no one ever really cares about, and the
other to use the dynamic debug subsystem.

Cc: Duncan Sands <duncan.sands@free.fr>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: usbatm: move the atm_dbg() call to use dynamic debug
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:53 +0000 (11:32 -0700)] 
USB: usbatm: move the atm_dbg() call to use dynamic debug

Move the atm_dbg() call to use the dynamic debug subsystem, and not rely
on CONFIG_USB_DEBUG for if things should be printed out or not.

This also means the drivers do not have to be rebuilt to get debugging
messages, important for getting information from users who can not
rebuild their kernels.

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: usbatm: don't rely on CONFIG_USB_DEBUG
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:52 +0000 (11:32 -0700)] 
USB: usbatm: don't rely on CONFIG_USB_DEBUG

Enable the USB atm drivers to use the dynamic debugging subsystem, and
not rely on if CONFIG_USB_DEBUG is enabled or not for debugging
messages. This also provides a saner debug message, pointing out the
exact device the message is coming from.

This also means the drivers do not have to be rebuilt to get debugging
messages, important for getting information from users who can not
rebuild their kernels.

Cc: Duncan Sands <duncan.sands@free.fr>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: usbatm: remove unneeded trace printk calls
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:51 +0000 (11:32 -0700)] 
USB: usbatm: remove unneeded trace printk calls

We have an in-kernel trace subsystem, so use that instead of printk for
trying to figure out what functions are being called.

Cc: Duncan Sands <duncan.sands@free.fr>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: usbatm: remove unused UDSL_ASSERT macro
Greg Kroah-Hartman [Fri, 28 Jun 2013 18:32:50 +0000 (11:32 -0700)] 
USB: usbatm: remove unused UDSL_ASSERT macro

If this code isn't triggering this assert by now, it never will, so just
remove it, it's pointless.

Cc: Duncan Sands <duncan.sands@free.fr>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: ti_usb_3410_5052: remove vendor/product module parameters
Johan Hovold [Wed, 26 Jun 2013 14:47:43 +0000 (16:47 +0200)] 
USB: ti_usb_3410_5052: remove vendor/product module parameters

Remove the vendor and product module parameters which were added a long
time ago when we did not have the dynamic sysfs interface to add
new device ids (and which isn't limited to five new vid/pid pair).

A vid/pid pair can be added dynamically using sysfs, for example:

  echo 0451 1234 >/sys/bus/usb-serial/drivers/ti_usb_3410_5052_1/new_id

for 1-port adapters, or

  echo 0451 1234 >/sys/bus/usb-serial/drivers/ti_usb_3410_5052_2/new_id

for 2-port adapters.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: ti_usb_3410_5052: remove unused wait queue
Johan Hovold [Wed, 26 Jun 2013 14:47:42 +0000 (16:47 +0200)] 
USB: ti_usb_3410_5052: remove unused wait queue

The write wait queue is never added to since commit f1175daa5 ("USB:
ti_usb_3410_5052: kill custom closing_wait"). Remove it completely.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: ti_usb_3410_5052: kill private fifo
Johan Hovold [Wed, 26 Jun 2013 14:47:41 +0000 (16:47 +0200)] 
USB: ti_usb_3410_5052: kill private fifo

Kill private write fifo and use the already allocated port write fifo
instead.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: safe_serial: remove vendor/product module parameters
Johan Hovold [Wed, 26 Jun 2013 14:47:40 +0000 (16:47 +0200)] 
USB: safe_serial: remove vendor/product module parameters

Remove the vendor and product module parameters which were added a long
time ago when we did not have the dynamic sysfs interface to add
new device ids (and which isn't limited to a single new vid/pid pair).

A vid/pid pair can be added dynamically using sysfs, for example:

  echo 04dd 1234 >/sys/bus/usb-serial/drivers/safe_serial/new_id

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: mos7840: remove broken chase implementation
Johan Hovold [Wed, 26 Jun 2013 14:47:39 +0000 (16:47 +0200)] 
USB: mos7840: remove broken chase implementation

Remove broken "chase" implementation which was supposed to be used to
drain the write buffers at break.

The chase implementation slept on a wait queue which was never woken up
(i.e. no hardware buffers were queried), and thus amounted to nothing
more than polling chars_in_buffer, something which has already been
taken care of by the tty layer.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: io_ti: move port initialisation to probe
Johan Hovold [Wed, 26 Jun 2013 14:47:38 +0000 (16:47 +0200)] 
USB: io_ti: move port initialisation to probe

Move port initialisation code from open to probe where it belongs.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: io_ti: kill private fifo
Johan Hovold [Wed, 26 Jun 2013 14:47:37 +0000 (16:47 +0200)] 
USB: io_ti: kill private fifo

Kill private write fifo and use the already allocated port write fifo
instead.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: io_edgeport: remove unused defines
Johan Hovold [Wed, 26 Jun 2013 14:47:36 +0000 (16:47 +0200)] 
USB: io_edgeport: remove unused defines

Remove unused timeout defines.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: ftdi_sio: remove unused defines
Johan Hovold [Wed, 26 Jun 2013 14:47:35 +0000 (16:47 +0200)] 
USB: ftdi_sio: remove unused defines

Remove some unused defines.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: ftdi_sio: remove vendor/product module parameters
Johan Hovold [Wed, 26 Jun 2013 14:47:34 +0000 (16:47 +0200)] 
USB: ftdi_sio: remove vendor/product module parameters

Remove the vendor and product module parameters which were added a long
time ago when we did not have the dynamic sysfs interface to add
new device ids (and which isn't limited to a single new vid/pid pair).

A vid/pid pair can be added dynamically using sysfs, for example:

echo 0403 1234 >/sys/bus/usb-serial/drivers/ftdi_sio/new_id

Also fix up the in-code comment that got the sysfs path wrong.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: ftdi_sio: remove redundant raise of DTR/RTS at open
Johan Hovold [Wed, 26 Jun 2013 14:47:33 +0000 (16:47 +0200)] 
USB: ftdi_sio: remove redundant raise of DTR/RTS at open

Do not raise DTR/RTS a second time in set_termios at open -- this has
already been taken care of by the tty layer.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: ftdi_sio: clean up device initialisation
Johan Hovold [Wed, 26 Jun 2013 14:47:32 +0000 (16:47 +0200)] 
USB: ftdi_sio: clean up device initialisation

Do not use zeroed termios data to determine when to unconditionally
configure the device at open.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: oti6858: do not call set_termios with uninitialised data
Johan Hovold [Wed, 26 Jun 2013 14:47:31 +0000 (16:47 +0200)] 
USB: oti6858: do not call set_termios with uninitialised data

Make sure set_termios is not called with uninitialised data at open. The
old termios struct is currently not used, but pass NULL instead to avoid
future problems (e.g. stack data leak).

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: pl2303: remove debugging noise
Johan Hovold [Wed, 26 Jun 2013 14:47:30 +0000 (16:47 +0200)] 
USB: pl2303: remove debugging noise

Only log the tty_flags in process_read_urb on errors.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: pl2303: clean up set_termios
Johan Hovold [Wed, 26 Jun 2013 14:47:29 +0000 (16:47 +0200)] 
USB: pl2303: clean up set_termios

Clean up set_termios somewhat.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: pl2303: clean up baud-rate handling
Johan Hovold [Wed, 26 Jun 2013 14:47:28 +0000 (16:47 +0200)] 
USB: pl2303: clean up baud-rate handling

Clean up baud-rate handling somewhat.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: pl2303: refactor baud-rate handling
Johan Hovold [Wed, 26 Jun 2013 14:47:27 +0000 (16:47 +0200)] 
USB: pl2303: refactor baud-rate handling

Break out baud-rate handling from set_termios.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: console: remove unnecessary operations test
Johan Hovold [Wed, 26 Jun 2013 14:47:26 +0000 (16:47 +0200)] 
USB: console: remove unnecessary operations test

Remove unnecessary tests for open and write operations as these are set
to the generic implementations by usb-serial core if left unset by a
subdriver.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: console: use dev_dbg
Johan Hovold [Wed, 26 Jun 2013 14:47:25 +0000 (16:47 +0200)] 
USB: console: use dev_dbg

Use dev_dbg for debugging.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: serial: set drain delay at port probe
Johan Hovold [Wed, 26 Jun 2013 14:47:23 +0000 (16:47 +0200)] 
USB: serial: set drain delay at port probe

The port drain delay is constant and should be set at port probe rather
than open.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: serial: clean up dtr_rts
Johan Hovold [Wed, 26 Jun 2013 14:47:22 +0000 (16:47 +0200)] 
USB: serial: clean up dtr_rts

Since commit 957dacae ("TTY: fix DTR not being dropped on hang up")
dtr_rts is no longer called for uninitialised ports (e.g. after
a disconnect), which removes the need to grab the disconnect mutex.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: serial: remove hupping check from tiocmiwait
Johan Hovold [Wed, 26 Jun 2013 14:47:21 +0000 (16:47 +0200)] 
USB: serial: remove hupping check from tiocmiwait

Since commit 31ca020b ("TTY: wake up processes last at hangup") there no
longer any need to check the hupping flag in the generic tiocmiwait
implementation, so remove it.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: serial: remove defensive test from set_termios
Johan Hovold [Wed, 26 Jun 2013 14:47:20 +0000 (16:47 +0200)] 
USB: serial: remove defensive test from set_termios

Remove defensive test from set_termios which is never called with a NULL
tty.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: misc: remove CONFIG_USB_DEBUG from Makefile
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:47 +0000 (16:30 -0700)] 
USB: misc: remove CONFIG_USB_DEBUG from Makefile

Now that no usb misc driver is looking for CONFIG_USB_DEBUG, or DEBUG,
don't enable it in the Makefile, as that's pointless.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: adutux: remove direct calls to printk()
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:46 +0000 (16:30 -0700)] 
USB: adutux: remove direct calls to printk()

Use the pr_* calls instead, which are much more descriptive.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: adutux: remove custom debug macro and module parameter
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:45 +0000 (16:30 -0700)] 
USB: adutux: remove custom debug macro and module parameter

Now that we don't use the dbg() macro, remove it, and the module
parameter.  Also fix up the "dump_data" function to properly use the
dynamic debug core and the correct printk options, and don't call it
twice per function, as the data doesn't change from the beginning and
the end of the call.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: adutux: remove custom debug macro
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:44 +0000 (16:30 -0700)] 
USB: adutux: remove custom debug macro

Don't use a custom debug macro for just one driver, instead rely on the
in-kernel dynamic debugging logic, which can handle this much better.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: adutux: remove unneeded tracing macros
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:43 +0000 (16:30 -0700)] 
USB: adutux: remove unneeded tracing macros

Remove the unneeded tracing macros in this driver.  The kernel has a
built-in trace function that can be used if this is really still needed.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: legotower: remove direct calls to printk()
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:42 +0000 (16:30 -0700)] 
USB: legotower: remove direct calls to printk()

Use the pr_* calls instead, which are much more descriptive.

Cc: Juergen Stuber <starblue@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: legotower: remove custom debug macro and module parameter
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:41 +0000 (16:30 -0700)] 
USB: legotower: remove custom debug macro and module parameter

Now that we don't use the dbg() macro, remove it, and the module
parameter.  Also fix up the "dump_data" function to properly use the
dynamic debug core and the correct printk options, and don't call it
twice per function, as the data doesn't change from the beginning and
the end of the call.

Cc: Juergen Stuber <starblue@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: legousbtower: remove custom debug macro
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:40 +0000 (16:30 -0700)] 
USB: legousbtower: remove custom debug macro

Don't use a custom debug macro for just one driver, instead rely on the
in-kernel dynamic debugging logic, which can handle this much better.

Cc: Juergen Stuber <starblue@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: legotower: remove unneeded tracing macros
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:39 +0000 (16:30 -0700)] 
USB: legotower: remove unneeded tracing macros

Remove the unneeded tracing macros in this driver.  The kernel has a
built-in trace function that can be used if this is really still needed.

Cc: Juergen Stuber <starblue@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: ldusb: remove custom dbg_info() macro
Greg Kroah-Hartman [Wed, 26 Jun 2013 23:30:38 +0000 (16:30 -0700)] 
USB: ldusb: remove custom dbg_info() macro

We want to get rid of CONFIG_USB_DEBUG, so remove the reliance of the
ldusb driver on it.  Don't use the custom macro, or a special module
parameter, instead, rely on the in-kernel dynamic debugging
infrastructure, which is much easier to use, and consistant across the
whole kernel.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoxhci: Correct misplaced newlines
Joe Perches [Wed, 17 Jul 2013 02:25:59 +0000 (19:25 -0700)] 
xhci: Correct misplaced newlines

Logging messages end in newlines, not have
them put in the middle of messages.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
10 years agoIntel xhci: refactor EHCI/xHCI port switching
Mathias Nyman [Tue, 23 Jul 2013 08:35:47 +0000 (11:35 +0300)] 
Intel xhci: refactor EHCI/xHCI port switching

Make the Linux xHCI driver automatically try to switchover the EHCI ports to
xHCI when an Intel xHCI host is detected, and it also finds an Intel EHCI host.

This means we will no longer have to add Intel xHCI hosts to a quirks list when
the PCI device IDs change.  Simply continuing to add new Intel xHCI PCI device
IDs to the quirks list is not sustainable.

During suspend ports may be swicthed back to EHCI by BIOS and not properly
restored to xHCI at resume. Previously both EHCI and xHCI resume functions
switched ports back to XHCI, but it's enough to do it in xHCI only
because the hub driver doesn't start running again until after both hosts are resumed.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
10 years agoxhci: Report USB 2.1 link status for L1
Sarah Sharp [Tue, 2 Apr 2013 16:23:42 +0000 (09:23 -0700)] 
xhci: Report USB 2.1 link status for L1

USB 2.1 devices can go into a lower power link state, L1.  When they are
active, they are in the L0 state.  The L1 transition can be purely
driven by software, or some USB host controllers (including some xHCI
1.0 hosts) allow the host hardware to track idleness and automatically
place a port into L1.

The USB 2.1 Link Power Management ECN gives a way for USB 2.1 hubs that
support LPM to report that a port is in L1.  The port status bit 5 will
be set when the port is in L1.  The xHCI host reports the root port as
being in 'U2' when the devices is in L1, and as being in 'U0' when the
port is active (in L0).

Translate the xHCI USB 2.1 link status into the format external hubs
use, and pass the L1 status up to the USB core and tools like lsusb.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
10 years agoxhci: Refactor port status into a new function.
Sarah Sharp [Tue, 2 Apr 2013 15:42:20 +0000 (08:42 -0700)] 
xhci: Refactor port status into a new function.

The hub control function is *way* too long.  Refactor it into a new
function, and document the side effects of calling that function.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
10 years agousb: xhci: add the suspend/resume functionality
Vikas Sajjan [Mon, 11 Feb 2013 10:58:00 +0000 (12:58 +0200)] 
usb: xhci: add the suspend/resume functionality

Adds power management support to xHCI platform driver.

This patch facilitates the transition of xHCI host controller
between S0 and S3/S4 power states, during suspend/resume cycles.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Vikas C Sajjan <vikas.sajjan@linaro.org>
CC: Doug Anderson <dianders@chromium.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
10 years agoLinux 3.11-rc2
Linus Torvalds [Sun, 21 Jul 2013 19:05:29 +0000 (12:05 -0700)] 
Linux 3.11-rc2

10 years agoMerge tag 'acpi-video-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Sun, 21 Jul 2013 17:11:04 +0000 (10:11 -0700)] 
Merge tag 'acpi-video-3.11' of git://git./linux/kernel/git/rafael/linux-pm

Pull ACPI video support fixes from Rafael Wysocki:
 "I'm sending a separate pull request for this as it may be somewhat
  controversial.  The breakage addressed here is not really new and the
  fixes may not satisfy all users of the affected systems, but we've had
  so much back and forth dance in this area over the last several weeks
  that I think it's time to actually make some progress.

  The source of the problem is that about a year ago we started to tell
  BIOSes that we're compatible with Windows 8, which we really need to
  do, because some systems shipping with Windows 8 are tested with it
  and nothing else, so if we tell their BIOSes that we aren't compatible
  with Windows 8, we expose our users to untested BIOS/AML code paths.

  However, as it turns out, some Windows 8-specific AML code paths are
  not tested either, because Windows 8 actually doesn't use the ACPI
  methods containing them, so if we declare Windows 8 compatibility and
  attempt to use those ACPI methods, things break.  That occurs mostly
  in the backlight support area where in particular the _BCM and _BQC
  methods are plain unusable on some systems if the OS declares Windows
  8 compatibility.

  [ The additional twist is that they actually become usable if the OS
    says it is not compatible with Windows 8, but that may cause
    problems to show up elsewhere ]

  Investigation carried out by Matthew Garrett indicates that what
  Windows 8 does about backlight is to leave backlight control up to
  individual graphics drivers.  At least there's evidence that it does
  that if the Intel graphics driver is used, so we've decided to follow
  Windows 8 in that respect and allow i915 to control backlight (Daniel
  likes that part).

  The first commit from Aaron Lu makes ACPICA export the variable from
  which we can infer whether or not the BIOS believes that we are
  compatible with Windows 8.

  The second commit from Matthew Garrett prepares the ACPI video driver
  by making it initialize the ACPI backlight even if it is not going to
  be used afterward (that is needed for backlight control to work on
  Thinkpads).

  The third commit implements the actual workaround making i915 take
  over backlight control if the firmware thinks it's dealing with
  Windows 8 and is based on the work of multiple developers, including
  Matthew Garrett, Chun-Yi Lee, Seth Forshee, and Aaron Lu.

  The final commit from Aaron Lu makes us follow Windows 8 by informing
  the firmware through the _DOS method that it should not carry out
  automatic brightness changes, so that brightness can be controlled by
  GUI.

  Hopefully, this approach will allow us to avoid using blacklists of
  systems that should not declare Windows 8 compatibility just to avoid
  backlight control problems in the future.

   - Change from Aaron Lu makes ACPICA export a variable which can be
     used by driver code to determine whether or not the BIOS believes
     that we are compatible with Windows 8.

   - Change from Matthew Garrett makes the ACPI video driver initialize
     the ACPI backlight even if it is not going to be used afterward
     (that is needed for backlight control to work on Thinkpads).

   - Fix from Rafael J Wysocki implements Windows 8 backlight support
     workaround making i915 take over bakclight control if the firmware
     thinks it's dealing with Windows 8.  Based on the work of multiple
     developers including Matthew Garrett, Chun-Yi Lee, Seth Forshee,
     and Aaron Lu.

   - Fix from Aaron Lu makes the kernel follow Windows 8 by informing
     the firmware through the _DOS method that it should not carry out
     automatic brightness changes, so that brightness can be controlled
     by GUI"

* tag 'acpi-video-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / video: no automatic brightness changes by win8-compatible firmware
  ACPI / video / i915: No ACPI backlight if firmware expects Windows 8
  ACPI / video: Always call acpi_video_init_brightness() on init
  ACPICA: expose OSI version

10 years agoMerge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
Linus Torvalds [Sun, 21 Jul 2013 03:11:42 +0000 (20:11 -0700)] 
Merge tag 'ext4_for_linus' of git://git./linux/kernel/git/tytso/ext4

Pull ext[34] tmpfile bugfix from Ted Ts'o:
 "Fix regression caused by commit af51a2ac36d1f which added ->tmpfile()
  support (along with a similar fix for ext3)"

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext3: fix a BUG when opening a file with O_TMPFILE flag
  ext4: fix a BUG when opening a file with O_TMPFILE flag

10 years agoext3: fix a BUG when opening a file with O_TMPFILE flag
Zheng Liu [Sun, 21 Jul 2013 02:03:20 +0000 (22:03 -0400)] 
ext3: fix a BUG when opening a file with O_TMPFILE flag

When we try to open a file with O_TMPFILE flag, we will trigger a bug.
The root cause is that in ext4_orphan_add() we check ->i_nlink == 0 and
this check always fails because we set ->i_nlink = 1 in
inode_init_always().  We can use the following program to trigger it:

int main(int argc, char *argv[])
{
int fd;

fd = open(argv[1], O_TMPFILE, 0666);
if (fd < 0) {
perror("open ");
return -1;
}
close(fd);
return 0;
}

The oops message looks like this:

kernel: kernel BUG at fs/ext3/namei.c:1992!
kernel: invalid opcode: 0000 [#1] SMP
kernel: Modules linked in: ext4 jbd2 crc16 cpufreq_ondemand ipv6 dm_mirror dm_region_hash dm_log dm_mod parport_pc parport serio_raw sg dcdbas pcspkr i2c_i801 ehci_pci ehci_hcd button acpi_cpufreq mperf e1000e ptp pps_core ttm drm_kms_helper drm hwmon i2c_algo_bit i2c_core ext3 jbd sd_mod ahci libahci libata scsi_mod uhci_hcd
kernel: CPU: 0 PID: 2882 Comm: tst_tmpfile Not tainted 3.11.0-rc1+ #4
kernel: Hardware name: Dell Inc. OptiPlex 780 /0V4W66, BIOS A05 08/11/2010
kernel: task: ffff880112d30050 ti: ffff8801124d4000 task.ti: ffff8801124d4000
kernel: RIP: 0010:[<ffffffffa00db5ae>] [<ffffffffa00db5ae>] ext3_orphan_add+0x6a/0x1eb [ext3]
kernel: RSP: 0018:ffff8801124d5cc8  EFLAGS: 00010202
kernel: RAX: 0000000000000000 RBX: ffff880111510128 RCX: ffff8801114683a0
kernel: RDX: 0000000000000000 RSI: ffff880111510128 RDI: ffff88010fcf65a8
kernel: RBP: ffff8801124d5d18 R08: 0080000000000000 R09: ffffffffa00d3b7f
kernel: R10: ffff8801114683a0 R11: ffff8801032a2558 R12: 0000000000000000
kernel: R13: ffff88010fcf6800 R14: ffff8801032a2558 R15: ffff8801115100d8
kernel: FS:  00007f5d172b5700(0000) GS:ffff880117c00000(0000) knlGS:0000000000000000
kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
kernel: CR2: 00007f5d16df15d0 CR3: 0000000110b1d000 CR4: 00000000000407f0
kernel: Stack:
kernel: 000000000000000c ffff8801048a7dc8 ffff8801114685a8 ffffffffa00b80d7
kernel: ffff8801124d5e38 ffff8801032a2558 ffff88010ce24d68 0000000000000000
kernel: ffff88011146b300 ffff8801124d5d44 ffff8801124d5d78 ffffffffa00db7e1
kernel: Call Trace:
kernel: [<ffffffffa00b80d7>] ? journal_start+0x8c/0xbd [jbd]
kernel: [<ffffffffa00db7e1>] ext3_tmpfile+0xb2/0x13b [ext3]
kernel: [<ffffffff821076f8>] path_openat+0x11f/0x5e7
kernel: [<ffffffff821c86b4>] ? list_del+0x11/0x30
kernel: [<ffffffff82065fa2>] ?  __dequeue_entity+0x33/0x38
kernel: [<ffffffff82107cd5>] do_filp_open+0x3f/0x8d
kernel: [<ffffffff82112532>] ? __alloc_fd+0x50/0x102
kernel: [<ffffffff820f9296>] do_sys_open+0x13b/0x1cd
kernel: [<ffffffff820f935c>] SyS_open+0x1e/0x20
kernel: [<ffffffff82398c02>] system_call_fastpath+0x16/0x1b
kernel: Code: 39 c7 0f 85 67 01 00 00 0f b7 03 25 00 f0 00 00 3d 00 40 00 00 74 18 3d 00 80 00 00 74 11 3d 00 a0 00 00 74 0a 83 7b 48 00 74 04 <0f> 0b eb fe 49 8b 85 50 03 00 00 4c 89 f6 48 c7 c7 c0 99 0e a0
kernel: RIP  [<ffffffffa00db5ae>] ext3_orphan_add+0x6a/0x1eb [ext3]
kernel: RSP <ffff8801124d5cc8>

Here we couldn't call clear_nlink() directly because in d_tmpfile() we
will call inode_dec_link_count() to decrease ->i_nlink.  So this commit
tries to call d_tmpfile() before ext4_orphan_add() to fix this problem.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
10 years agoext4: fix a BUG when opening a file with O_TMPFILE flag
Zheng Liu [Sun, 21 Jul 2013 01:58:38 +0000 (21:58 -0400)] 
ext4: fix a BUG when opening a file with O_TMPFILE flag

When we try to open a file with O_TMPFILE flag, we will trigger a bug.
The root cause is that in ext4_orphan_add() we check ->i_nlink == 0 and
this check always fails because we set ->i_nlink = 1 in
inode_init_always().  We can use the following program to trigger it:

int main(int argc, char *argv[])
{
int fd;

fd = open(argv[1], O_TMPFILE, 0666);
if (fd < 0) {
perror("open ");
return -1;
}
close(fd);
return 0;
}

The oops message looks like this:

kernel BUG at fs/ext4/namei.c:2572!
invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
Modules linked in: dlci bridge stp hidp cmtp kernelcapi l2tp_ppp l2tp_netlink l2tp_core sctp libcrc32c rfcomm tun fuse nfnetli
nk can_raw ipt_ULOG can_bcm x25 scsi_transport_iscsi ipx p8023 p8022 appletalk phonet psnap vmw_vsock_vmci_transport af_key vmw_vmci rose vsock atm can netrom ax25 af_rxrpc ir
da pppoe pppox ppp_generic slhc bluetooth nfc rfkill rds caif_socket caif crc_ccitt af_802154 llc2 llc snd_hda_codec_realtek snd_hda_intel snd_hda_codec serio_raw snd_pcm pcsp
kr edac_core snd_page_alloc snd_timer snd soundcore r8169 mii sr_mod cdrom pata_atiixp radeon backlight drm_kms_helper ttm
CPU: 1 PID: 1812571 Comm: trinity-child2 Not tainted 3.11.0-rc1+ #12
Hardware name: Gigabyte Technology Co., Ltd. GA-MA78GM-S2H/GA-MA78GM-S2H, BIOS F12a 04/23/2010
task: ffff88007dfe69a0 ti: ffff88010f7b6000 task.ti: ffff88010f7b6000
RIP: 0010:[<ffffffff8125ce69>]  [<ffffffff8125ce69>] ext4_orphan_add+0x299/0x2b0
RSP: 0018:ffff88010f7b7cf8  EFLAGS: 00010202
RAX: 0000000000000000 RBX: ffff8800966d3020 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff88007dfe70b8 RDI: 0000000000000001
RBP: ffff88010f7b7d40 R08: ffff880126a3c4e0 R09: ffff88010f7b7ca0
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801271fd668
R13: ffff8800966d2f78 R14: ffff88011d7089f0 R15: ffff88007dfe69a0
FS:  00007f70441a3740(0000) GS:ffff88012a800000(0000) knlGS:00000000f77c96c0
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000002834000 CR3: 0000000107964000 CR4: 00000000000007e0
DR0: 0000000000780000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
Stack:
 0000000000002000 00000020810b6dde 0000000000000000 ffff88011d46db00
 ffff8800966d3020 ffff88011d7089f0 ffff88009c7f4c10 ffff88010f7b7f2c
 ffff88007dfe69a0 ffff88010f7b7da8 ffffffff8125cfac ffff880100000004
Call Trace:
 [<ffffffff8125cfac>] ext4_tmpfile+0x12c/0x180
 [<ffffffff811cba78>] path_openat+0x238/0x700
 [<ffffffff8100afc4>] ? native_sched_clock+0x24/0x80
 [<ffffffff811cc647>] do_filp_open+0x47/0xa0
 [<ffffffff811db73f>] ? __alloc_fd+0xaf/0x200
 [<ffffffff811ba2e4>] do_sys_open+0x124/0x210
 [<ffffffff81010725>] ? syscall_trace_enter+0x25/0x290
 [<ffffffff811ba3ee>] SyS_open+0x1e/0x20
 [<ffffffff816ca8d4>] tracesys+0xdd/0xe2
 [<ffffffff81001001>] ? start_thread_common.constprop.6+0x1/0xa0
Code: 04 00 00 00 89 04 24 31 c0 e8 c4 77 04 00 e9 43 fe ff ff 66 25 00 d0 66 3d 00 80 0f 84 0e fe ff ff 83 7b 48 00 0f 84 04 fe ff ff <0f> 0b 49 8b 8c 24 50 07 00 00 e9 88 fe ff ff 0f 1f 84 00 00 00

Here we couldn't call clear_nlink() directly because in d_tmpfile() we
will call inode_dec_link_count() to decrease ->i_nlink.  So this commit
tries to call d_tmpfile() before ext4_orphan_add() to fix this problem.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Tested-by: Darrick J. Wong <darrick.wong@oracle.com>
Tested-by: Dave Jones <davej@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
10 years agoMerge tag 'staging-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sat, 20 Jul 2013 22:42:38 +0000 (15:42 -0700)] 
Merge tag 'staging-3.11-rc2' of git://git./linux/kernel/git/gregkh/staging

Pull staging tree fixes from Greg KH:
 "Here are a few iio driver fixes for 3.11-rc2.  They are still spread
  across drivers/iio and drivers/staging/iio so they are coming in
  through this tree.

  I've also removed the drivers/staging/csr/ driver as the developers
  who originally sent it to me have moved on to other companies, and CSR
  still will not send us the specs for the device, making the driver
  pretty much obsolete and impossible to fix up.  Deleting it now
  prevents people from sending in lots of tiny codingsyle fixes that
  will never go anywhere.

  It also helps to offset the large lustre filesystem merge that
  happened in 3.11-rc1 in the overall 3.11.0 diffstat.  :)"

* tag 'staging-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: csr: remove driver
  iio: lps331ap: Fix wrong in_pressure_scale output value
  iio staging: fix lis3l02dq, read error handling
  staging:iio:ad7291: add missing .driver_module to struct iio_info
  iio: ti_am335x_adc: add missing .driver_module to struct iio_info
  iio: mxs-lradc: Remove useless check in read_raw
  iio: mxs-lradc: Fix misuse of iio->trig
  iio: inkern: fix iio_convert_raw_to_processed_unlocked
  iio: Fix iio_channel_has_info
  iio:trigger: device_unregister->device_del to avoid double free
  iio: dac: ad7303: fix error return code in ad7303_probe()

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Sat, 20 Jul 2013 17:50:01 +0000 (10:50 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs

Pull vfs fixes from Al Viro:
 "The sget() one is a long-standing bug and will need to go into -stable
  (in fact, it had been originally caught in RHEL6), the other two are
  3.11-only"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  vfs: constify dentry parameter in d_count()
  livelock avoidance in sget()
  allow O_TMPFILE to work with O_WRONLY

10 years agoMerge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
Linus Torvalds [Sat, 20 Jul 2013 17:48:59 +0000 (10:48 -0700)] 
Merge tag 'ext4_for_linus' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 bugfixes from Ted Ts'o:
 "Fixes for 3.11-rc2, sent at 5pm, in the professoinal style.  :-)"

I'm not sure I like this new level of "professionalism".
9-5, people, 9-5.

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: call ext4_es_lru_add() after handling cache miss
  ext4: yield during large unlinks
  ext4: make the extent_status code more robust against ENOMEM failures
  ext4: simplify calculation of blocks to free on error
  ext4: fix error handling in ext4_ext_truncate()

10 years agoMerge tag 'nfs-for-3.11-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Linus Torvalds [Sat, 20 Jul 2013 17:48:24 +0000 (10:48 -0700)] 
Merge tag 'nfs-for-3.11-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfixes from Trond Myklebust:
 - Fix a regression against NFSv4 FreeBSD servers when creating a new
   file
 - Fix another regression in rpc_client_register()

* tag 'nfs-for-3.11-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  NFSv4: Fix a regression against the FreeBSD server
  SUNRPC: Fix another issue with rpc_client_register()

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs...
Linus Torvalds [Sat, 20 Jul 2013 17:47:38 +0000 (10:47 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/josef/btrfs-next

Pull btrfs fixes from Josef Bacik:
 "I'm playing the role of Chris Mason this week while he's on vacation.
  There are a few critical fixes for btrfs here, all regressions and
  have been tested well"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next:
  Btrfs: fix wrong write offset when replacing a device
  Btrfs: re-add root to dead root list if we stop dropping it
  Btrfs: fix lock leak when resuming snapshot deletion
  Btrfs: update drop progress before stopping snapshot dropping

10 years agovfs: constify dentry parameter in d_count()
Peng Tao [Thu, 18 Jul 2013 14:09:08 +0000 (22:09 +0800)] 
vfs: constify dentry parameter in d_count()

so that it can be used in places like d_compare/d_hash
without causing a compiler warning.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
10 years agolivelock avoidance in sget()
Al Viro [Fri, 19 Jul 2013 23:13:55 +0000 (03:13 +0400)] 
livelock avoidance in sget()

Eric Sandeen has found a nasty livelock in sget() - take a mount(2) about
to fail.  The superblock is on ->fs_supers, ->s_umount is held exclusive,
->s_active is 1.  Along comes two more processes, trying to mount the same
thing; sget() in each is picking that superblock, bumping ->s_count and
trying to grab ->s_umount.  ->s_active is 3 now.  Original mount(2)
finally gets to deactivate_locked_super() on failure; ->s_active is 2,
superblock is still ->fs_supers because shutdown will *not* happen until
->s_active hits 0.  ->s_umount is dropped and now we have two processes
chasing each other:
s_active = 2, A acquired ->s_umount, B blocked
A sees that the damn thing is stillborn, does deactivate_locked_super()
s_active = 1, A drops ->s_umount, B gets it
A restarts the search and finds the same superblock.  And bumps it ->s_active.
s_active = 2, B holds ->s_umount, A blocked on trying to get it
... and we are in the earlier situation with A and B switched places.

The root cause, of course, is that ->s_active should not grow until we'd
got MS_BORN.  Then failing ->mount() will have deactivate_locked_super()
shut the damn thing down.  Fortunately, it's easy to do - the key point
is that grab_super() is called only for superblocks currently on ->fs_supers,
so it can bump ->s_count and grab ->s_umount first, then check MS_BORN and
bump ->s_active; we must never increment ->s_count for superblocks past
->kill_sb(), but grab_super() is never called for those.

The bug is pretty old; we would've caught it by now, if not for accidental
exclusion between sget() for block filesystems; the things like cgroup or
e.g. mtd-based filesystems don't have anything of that sort, so they get
bitten.  The right way to deal with that is obviously to fix sget()...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
10 years agoallow O_TMPFILE to work with O_WRONLY
Al Viro [Fri, 19 Jul 2013 23:11:32 +0000 (03:11 +0400)] 
allow O_TMPFILE to work with O_WRONLY

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
Linus Torvalds [Fri, 19 Jul 2013 22:11:09 +0000 (15:11 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/rw/uml

Pull UML fixes from Richard Weinberger:
 "Special thanks goes to Toralf Föster for continuously testing UML and
  reporting issues!"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
  um: remove dead code
  um: siginfo cleanup
  uml: Fix which_tmpdir failure when /dev/shm is a symlink, and in other edge cases
  um: Fix wait_stub_done() error handling
  um: Mark stub pages mapping with VM_PFNMAP
  um: Fix return value of strnlen_user()

10 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Fri, 19 Jul 2013 22:10:01 +0000 (15:10 -0700)] 
Merge branch 'upstream' of git://git.linux-mips.org/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
 "MIPS fixes for 3.11.  Half of then is for Netlogic the remainder
  touches things across arch/mips.

  Nothing really dramatic and by rc1 standards MIPS will be in fairly
  good shape with this applied.  Tested by building all MIPS defconfigs
  of which with this pull request four platforms won't build.  And yes,
  it boots also on my favorite test systems"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: kvm: Kconfig: Drop HAVE_KVM dependency from VIRTUALIZATION
  MIPS: Octeon: Fix DT pruning bug with pip ports
  MIPS: KVM: Mark KVM_GUEST (T&E KVM) as BROKEN_ON_SMP
  MIPS: tlbex: fix broken build in v3.11-rc1
  MIPS: Netlogic: Add XLP PIC irqdomain
  MIPS: Netlogic: Fix USB block's coherent DMA mask
  MIPS: tlbex: Fix typo in r3000 tlb store handler
  MIPS: BMIPS: Fix thinko to release slave TP from reset
  MIPS: Delete dead invocation of exception_exit().

10 years agoMerge tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas...
Linus Torvalds [Fri, 19 Jul 2013 22:08:53 +0000 (15:08 -0700)] 
Merge tag 'arm64-stable' of git://git./linux/kernel/git/cmarinas/linux-aarch64

Pull arm64 fixes from Catalin Marinas:
 - Post -rc1 update to the common reboot infrastructure.
 - Fixes (user cache maintenance fault handling, !COMPAT compilation,
   CPU online and interrupt hanlding).

* tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
  arm64: use common reboot infrastructure
  arm64: mm: don't treat user cache maintenance faults as writes
  arm64: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
  arm64: Only enable local interrupts after the CPU is marked online

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Fri, 19 Jul 2013 22:08:12 +0000 (15:08 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
 "An update for the BFP jit to the latest and greatest, two patches to
  get kdump working again, the random-abort ptrace extention for
  transactional execution, the z90crypt module alias for ap and a tiny
  cleanup"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/zcrypt: Alias for new zcrypt device driver base module
  s390/kdump: Allow copy_oldmem_page() copy to virtual memory
  s390/kdump: Disable mmap for s390
  s390/bpf,jit: add pkt_type support
  s390/bpf,jit: address randomize and write protect jit code
  s390/bpf,jit: use generic jit dumper
  s390/bpf,jit: call module_free() from any context
  s390/qdio: remove unused variable
  s390/ptrace: PTRACE_TE_ABORT_RAND

10 years agoBtrfs: fix wrong write offset when replacing a device
Stefan Behrens [Thu, 4 Jul 2013 14:14:23 +0000 (16:14 +0200)] 
Btrfs: fix wrong write offset when replacing a device

Miao Xie reported the following issue:

The filesystem was corrupted after we did a device replace.

Steps to reproduce:
 # mkfs.btrfs -f -m single -d raid10 <device0>..<device3>
 # mount <device0> <mnt>
 # btrfs replace start -rfB 1 <device4> <mnt>
 # umount <mnt>
 # btrfsck <device4>

The reason for the issue is that we changed the write offset by mistake,
introduced by commit 625f1c8dc.

We read the data from the source device at first, and then write the
data into the corresponding place of the new device. In order to
implement the "-r" option, the source location is remapped using
btrfs_map_block(). The read takes place on the mapped location, and
the write needs to take place on the unmapped location. Currently
the write is using the mapped location, and this commit changes it
back by undoing the change to the write address that the aforementioned
commit added by mistake.

Reported-by: Miao Xie <miaox@cn.fujitsu.com>
Cc: <stable@vger.kernel.org> # 3.10+
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
10 years agoBtrfs: re-add root to dead root list if we stop dropping it
Josef Bacik [Wed, 17 Jul 2013 23:30:20 +0000 (19:30 -0400)] 
Btrfs: re-add root to dead root list if we stop dropping it

If we stop dropping a root for whatever reason we need to add it back to the
dead root list so that we will re-start the dropping next transaction commit.
The other case this happens is if we recover a drop because we will add a root
without adding it to the fs radix tree, so we can leak it's root and commit root
extent buffer, adding this to the dead root list makes this cleanup happen.
Thanks,

Cc: stable@vger.kernel.org
Reported-by: Alex Lyakas <alex.btrfs@zadarastorage.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
10 years agoBtrfs: fix lock leak when resuming snapshot deletion
Josef Bacik [Mon, 15 Jul 2013 16:41:42 +0000 (12:41 -0400)] 
Btrfs: fix lock leak when resuming snapshot deletion

We aren't setting path->locks[level] when we resume a snapshot deletion which
means we won't unlock the buffer when we free the path.  This causes deadlocks
if we happen to re-allocate the block before we've evicted the extent buffer
from cache.  Thanks,

Cc: stable@vger.kernel.org
Reported-by: Alex Lyakas <alex.btrfs@zadarastorage.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
10 years agoBtrfs: update drop progress before stopping snapshot dropping
Josef Bacik [Mon, 15 Jul 2013 15:57:06 +0000 (11:57 -0400)] 
Btrfs: update drop progress before stopping snapshot dropping

Alex pointed out a problem and fix that exists in the drop one snapshot at a
time patch.  If we decide we need to exit for whatever reason (umount for
example) we will just exit the snapshot dropping without updating the drop
progress.  So the next time we go to resume we will BUG_ON() because we can't
find the extent we left off at because we never updated it.  This patch fixes
the problem.

Cc: stable@vger.kernel.org
Reported-by: Alex Lyakas <alex.btrfs@zadarastorage.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
10 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Fri, 19 Jul 2013 17:17:12 +0000 (10:17 -0700)] 
Merge tag 'for-linus' of git://git./virt/kvm/kvm

Pull KVM fix from Paolo Bonzini:
 "This single patch fixes a regression caused by one of the
  optimizations introduced in 3.11, which is generally visible only on
  AMD processors"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: MMU: avoid fast page fault fixing mmio page fault

10 years agoMerge tag 'pm+acpi-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Fri, 19 Jul 2013 16:59:06 +0000 (09:59 -0700)] 
Merge tag 'pm+acpi-3.11-rc2' of git://git./linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael Wysocki:
 "These are fixes collected over the last week, most importnatly two
  cpufreq reverts fixing regressions introduced in 3.10, an autoseelp
  fix preventing systems using it from crashing during shutdown and two
  ACPI scan fixes related to hotplug.

  Specifics:

   - Two cpufreq commits from the 3.10 cycle introduced regressions.
     The first of them was buggy (it did way much more than it needed to
     do) and the second one attempted to fix an issue introduced by the
     first one.  Fixes from Srivatsa S Bhat revert both.

   - If autosleep triggers during system shutdown and the shutdown
     callbacks of some device drivers have been called already, it may
     crash the system.  Fix from Liu Shuo prevents that from happening
     by making try_to_suspend() check system_state.

   - The ACPI memory hotplug driver doesn't clear its driver_data on
     errors which may cause a NULL poiter dereference to happen later.
     Fix from Toshi Kani.

   - The ACPI namespace scanning code should not try to attach scan
     handlers to device objects that have them already, which may
     confuse things quite a bit, and it should rescan the whole
     namespace branch starting at the given node after receiving a bus
     check notify event even if the device at that particular node has
     been discovered already.  Fixes from Rafael J Wysocki.

   - New ACPI video blacklist entry for a system whose initial backlight
     setting from the BIOS doesn't make sense.  From Lan Tianyu.

   - Garbage string output avoindance for ACPI PNP from Liu Shuo.

   - Two Kconfig fixes for issues introduced recently in the s3c24xx
     cpufreq driver (when moving the driver to drivers/cpufreq) from
     Paul Bolle.

   - Trivial comment fix in pm_wakeup.h from Chanwoo Choi"

* tag 'pm+acpi-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / video: ignore BIOS initial backlight value for Fujitsu E753
  PNP / ACPI: avoid garbage in resource name
  cpufreq: Revert commit 2f7021a8 to fix CPU hotplug regression
  cpufreq: s3c24xx: fix "depends on ARM_S3C24XX" in Kconfig
  cpufreq: s3c24xx: rename CONFIG_CPU_FREQ_S3C24XX_DEBUGFS
  PM / Sleep: Fix comment typo in pm_wakeup.h
  PM / Sleep: avoid 'autosleep' in shutdown progress
  cpufreq: Revert commit a66b2e to fix suspend/resume regression
  ACPI / memhotplug: Fix a stale pointer in error path
  ACPI / scan: Always call acpi_bus_scan() for bus check notifications
  ACPI / scan: Do not try to attach scan handlers to devices having them

10 years agoarm64: use common reboot infrastructure
Marc Zyngier [Thu, 11 Jul 2013 11:13:00 +0000 (12:13 +0100)] 
arm64: use common reboot infrastructure

Commit 7b6d864b48d9 (reboot: arm: change reboot_mode to use enum
reboot_mode) changed the way reboot is handled on arm, which has a
direct impact on arm64 as we share the reset driver on the VE platform.

The obvious fix is to move arm64 to use the same infrastructure.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
[catalin.marinas@arm.com: removed reboot_mode = REBOOT_HARD default setting]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
10 years agoarm64: mm: don't treat user cache maintenance faults as writes
Will Deacon [Fri, 19 Jul 2013 14:37:12 +0000 (15:37 +0100)] 
arm64: mm: don't treat user cache maintenance faults as writes

On arm64, cache maintenance faults appear as data aborts with the CM
bit set in the ESR. The WnR bit, usually used to distinguish between
faulting loads and stores, always reads as 1 and (slightly confusingly)
the instructions are treated as reads by the architecture.

This patch fixes our fault handling code to treat cache maintenance
faults in the same way as loads.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
10 years agoarm64: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
Chen Gang [Mon, 24 Jun 2013 09:27:49 +0000 (10:27 +0100)] 
arm64: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()

If 'COMPAT' not defined, aarch32_break_handler() cannot pass compiling,
and it can work independent with 'COMPAT', so remove dummy definition.

The related error:

  arch/arm64/kernel/debug-monitors.c:249:5: error: redefinition of ‘aarch32_break_handler’
  In file included from arch/arm64/kernel/debug-monitors.c:29:0:
  /root/linux-next/arch/arm64/include/asm/debug-monitors.h:89:12: note: previous definition of ‘aarch32_break_handler’ was here

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
10 years agoarm64: Only enable local interrupts after the CPU is marked online
Catalin Marinas [Fri, 19 Jul 2013 14:08:15 +0000 (15:08 +0100)] 
arm64: Only enable local interrupts after the CPU is marked online

There is a slight chance that (timer) interrupts are triggered before a
secondary CPU has been marked online with implications on softirq thread
affinity.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Kirill Tkhai <tkhai@yandex.ru>
10 years agoMIPS: kvm: Kconfig: Drop HAVE_KVM dependency from VIRTUALIZATION
Markos Chandras [Tue, 11 Jun 2013 09:02:33 +0000 (09:02 +0000)] 
MIPS: kvm: Kconfig: Drop HAVE_KVM dependency from VIRTUALIZATION

Virtualization does not always need KVM capabilities so drop the
dependency. The KVM symbol already depends on HAVE_KVM.

Fixes the following problem on a randconfig:
warning: (REMOTEPROC && RPMSG) selects VIRTUALIZATION which has unmet direct
dependencies (HAVE_KVM)
warning: (REMOTEPROC && RPMSG) selects VIRTUALIZATION which has unmet
direct dependencies (HAVE_KVM)

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5443/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
10 years agoum: remove dead code
Richard Weinberger [Fri, 19 Jul 2013 09:35:32 +0000 (11:35 +0200)] 
um: remove dead code

"me" is not used.

Signed-off-by: Richard Weinberger <richard@nod.at>
10 years agoum: siginfo cleanup
Richard Weinberger [Fri, 19 Jul 2013 09:31:36 +0000 (11:31 +0200)] 
um: siginfo cleanup

Currently we use both struct siginfo and siginfo_t.
Let's use struct siginfo internally to avoid ongoing
compiler warning. We are allowed to do so because
struct siginfo and siginfo_t are equivalent.

Signed-off-by: Richard Weinberger <richard@nod.at>
This page took 0.078376 seconds and 5 git commands to generate.