deliverable/linux.git
9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux...
Linus Torvalds [Fri, 16 Jan 2015 01:29:21 +0000 (14:29 +1300)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/geert/linux-m68k

Pull m68k fixlet from Geert Uytterhoeven.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  m68k: Wire up execveat

9 years agoMerge tag 'powerpc-3.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux
Linus Torvalds [Fri, 16 Jan 2015 01:28:01 +0000 (14:28 +1300)] 
Merge tag 'powerpc-3.19-4' of git://git./linux/kernel/git/mpe/linux

Pull powerpc fixes from Michael Ellerman:
 "A few powerpc fixes"

* tag 'powerpc-3.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
  powerpc: Work around gcc bug in current_thread_info()
  cxl: Fix issues when unmapping contexts
  powernv: Fix OPAL tracepoint code

9 years agousb: musb: debugfs: improve copy_from_user() argument
Markus Pargmann [Wed, 14 Jan 2015 15:08:38 +0000 (16:08 +0100)] 
usb: musb: debugfs: improve copy_from_user() argument

While the code is correct and functions well, it's still
a bit misleading to add the reference operator in from of
the buf argument.

This patch simply removes that operator in order to make
use of buf slightly better to the eyes.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: f_fs: add "no_disconnect" mode
Robert Baldyga [Thu, 18 Dec 2014 08:55:10 +0000 (09:55 +0100)] 
usb: gadget: f_fs: add "no_disconnect" mode

Since we can compose gadgets from many functions, there is the problem
related to gadget breakage while FunctionFS daemon being closed. FFS
function is userspace code so there is no way to know when it will close
files (it doesn't matter what is the reason of this situation, it can
be daemon logic, program breakage, process kill or any other). So when
we have another function in gadget which, for example, sends some amount
of data, does some software update or implements some real-time functionality,
we may want to keep the gadget connected despite FFS function is no longer
functional.

We can't just remove one of functions from gadget since it has been
enumerated, so the only way to keep entire gadget working is to make
broken FFS function deactivated but still visible to host. For this
purpose this patch introduces "no_disconnect" mode. It can be enabled
by setting mount option "no_disconnect=1", and results with defering
function disconnect to the moment of reopen ep0 file or filesystem
unmount. After closing all endpoint files, FunctionFS is set to state
FFS_DEACTIVATED.

When ffs->state == FFS_DEACTIVATED:
- function is still bound and visible to host,
- setup requests are automatically stalled,
- transfers on other endpoints are refused,
- epfiles, except ep0, are deleted from the filesystem,
- opening ep0 causes the function to be closed, and then FunctionFS
  is ready for descriptors and string write,
- altsetting change causes the function to be closed - we want to keep
  function alive until another functions are potentialy used, altsetting
  change means that another configuration is being selected or USB cable
  was unplugged, which indicates that we don't need to stay longer in
  FFS_DEACTIVATED state
- unmounting of the FunctionFS instance causes the function to be closed.

Tested-by: David Cohen <david.a.cohen@linux.intel.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc3: pci: code cleanup
Heikki Krogerus [Mon, 12 Jan 2015 12:20:14 +0000 (14:20 +0200)] 
usb: dwc3: pci: code cleanup

Removing a few items that are not needed anymore and
adding separate function for quirks.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc3: pci: rely on default PM callbacks from PCI driver utility
Heikki Krogerus [Mon, 12 Jan 2015 12:20:13 +0000 (14:20 +0200)] 
usb: dwc3: pci: rely on default PM callbacks from PCI driver utility

There is nothing specific being done in the suspend and
resume callbacks that is not already taken care of in PCI
driver core, so dropping the functions.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc3: pci: remove registration of NOP PHYs
Heikki Krogerus [Mon, 12 Jan 2015 12:20:12 +0000 (14:20 +0200)] 
usb: dwc3: pci: remove registration of NOP PHYs

None of the PCI platforms need the NOP transceivers, and
since we can now live without the PHYs, removing
registration of the platform devices for them.

Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: uvc: to_uvcg_control_header() can be static
kbuild test robot [Tue, 13 Jan 2015 08:55:38 +0000 (16:55 +0800)] 
usb: gadget: uvc: to_uvcg_control_header() can be static

drivers/usb/gadget/function/uvc_configfs.c:46:28: sparse: symbol 'to_uvcg_control_header' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:138:25: sparse: symbol 'uvcg_control_header_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:164:6: sparse: symbol 'uvcg_control_header_drop' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:721:20: sparse: symbol 'to_uvcg_format' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:798:30: sparse: symbol 'to_uvcg_streaming_header' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:950:25: sparse: symbol 'uvcg_streaming_header_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:976:6: sparse: symbol 'uvcg_streaming_header_drop' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1020:19: sparse: symbol 'to_uvcg_frame' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1265:25: sparse: symbol 'uvcg_frame_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1315:6: sparse: symbol 'uvcg_frame_drop' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1338:26: sparse: symbol 'to_uvcg_uncompressed' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1548:25: sparse: symbol 'uvcg_uncompressed_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1586:6: sparse: symbol 'uvcg_uncompressed_drop' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1610:19: sparse: symbol 'to_uvcg_mjpeg' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1761:25: sparse: symbol 'uvcg_mjpeg_type' was not declared. Should it be static?
drivers/usb/gadget/function/uvc_configfs.c:1793:6: sparse: symbol 'uvcg_mjpeg_drop' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agotools: ffs-aio-example: use endpoint addresses from descriptors
Robert Baldyga [Tue, 13 Jan 2015 13:56:28 +0000 (14:56 +0100)] 
tools: ffs-aio-example: use endpoint addresses from descriptors

This makes examples more platform independent and more compatible with
USB standard, as endpoint addresses in given interface may differ
between hardware platforms or even between configurations in single
USB device.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: net2280: Dont use 0 as NULL pointer
Ricardo Ribalda Delgado [Tue, 13 Jan 2015 09:54:58 +0000 (10:54 +0100)] 
usb: gadget: net2280: Dont use 0 as NULL pointer

Fix sparse warning

Fixes: cb442ee1592d2681 (usb: gadget: udc: net2280: Re-enable dynamic debug messages)
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: u_uac1: fix one code style problem
Peter Chen [Mon, 1 Dec 2014 08:09:29 +0000 (16:09 +0800)] 
usb: gadget: u_uac1: fix one code style problem

Fix one code style problem.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: gadget: uac1: struct gaudio is useless for struct f_uac1_opts
Peter Chen [Mon, 1 Dec 2014 08:09:28 +0000 (16:09 +0800)] 
usb: gadget: uac1: struct gaudio is useless for struct f_uac1_opts

Since we call gaudio_cleanup at f_audio_free, the f_uac1_opts
doesn't need to use gaudio any more.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agotracing: Fix enabling of syscall events on the command line
Steven Rostedt (Red Hat) [Wed, 14 Jan 2015 17:53:45 +0000 (12:53 -0500)] 
tracing: Fix enabling of syscall events on the command line

Commit 5f893b2639b2 "tracing: Move enabling tracepoints to just after
rcu_init()" broke the enabling of system call events from the command
line. The reason was that the enabling of command line trace events
was moved before PID 1 started, and the syscall tracepoints require
that all tasks have the TIF_SYSCALL_TRACEPOINT flag set. But the
swapper task (pid 0) is not part of that. Since the swapper task is the
only task that is running at this early in boot, no task gets the
flag set, and the tracepoint never gets reached.

Instead of setting the swapper task flag (there should be no reason to
do that), re-enabled trace events again after the init thread (PID 1)
has been started. It requires disabling all command line events and
re-enabling them, as just enabling them again will not reset the logic
to set the TIF_SYSCALL_TRACEPOINT flag, as the syscall tracepoint will
be fooled into thinking that it was already set, and wont try setting
it again. For this reason, we must first disable it and re-enable it.

Link: http://lkml.kernel.org/r/1421188517-18312-1-git-send-email-mpe@ellerman.id.au
Link: http://lkml.kernel.org/r/20150115040506.216066449@goodmis.org
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
9 years agotracing: Remove extra call to init_ftrace_syscalls()
Steven Rostedt (Red Hat) [Wed, 14 Jan 2015 17:24:37 +0000 (12:24 -0500)] 
tracing: Remove extra call to init_ftrace_syscalls()

trace_init() calls init_ftrace_syscalls() and then calls trace_event_init()
which also calls init_ftrace_syscalls(). It makes more sense to only
call it from trace_event_init().

Calling it twice wastes memory, as it allocates the syscall events twice,
and loses the first copy of it.

Link: http://lkml.kernel.org/r/54AF53BD.5070303@huawei.com
Link: http://lkml.kernel.org/r/20150115040505.930398632@goodmis.org
Reported-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
9 years agoftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing
Steven Rostedt (Red Hat) [Mon, 12 Jan 2015 17:12:03 +0000 (12:12 -0500)] 
ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing

If the function graph tracer traces a jprobe callback, the system will
crash. This can easily be demonstrated by compiling the jprobe
sample module that is in the kernel tree, loading it and running the
function graph tracer.

 # modprobe jprobe_example.ko
 # echo function_graph > /sys/kernel/debug/tracing/current_tracer
 # ls

The first two commands end up in a nice crash after the first fork.
(do_fork has a jprobe attached to it, so "ls" just triggers that fork)

The problem is caused by the jprobe_return() that all jprobe callbacks
must end with. The way jprobes works is that the function a jprobe
is attached to has a breakpoint placed at the start of it (or it uses
ftrace if fentry is supported). The breakpoint handler (or ftrace callback)
will copy the stack frame and change the ip address to return to the
jprobe handler instead of the function. The jprobe handler must end
with jprobe_return() which swaps the stack and does an int3 (breakpoint).
This breakpoint handler will then put back the saved stack frame,
simulate the instruction at the beginning of the function it added
a breakpoint to, and then continue on.

For function tracing to work, it hijakes the return address from the
stack frame, and replaces it with a hook function that will trace
the end of the call. This hook function will restore the return
address of the function call.

If the function tracer traces the jprobe handler, the hook function
for that handler will not be called, and its saved return address
will be used for the next function. This will result in a kernel crash.

To solve this, pause function tracing before the jprobe handler is called
and unpause it before it returns back to the function it probed.

Some other updates:

Used a variable "saved_sp" to hold kcb->jprobe_saved_sp. This makes the
code look a bit cleaner and easier to understand (various tries to fix
this bug required this change).

Note, if fentry is being used, jprobes will change the ip address before
the function graph tracer runs and it will not be able to trace the
function that the jprobe is probing.

Link: http://lkml.kernel.org/r/20150114154329.552437962@goodmis.org
Cc: stable@vger.kernel.org # 2.6.30+
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
9 years agoftrace: Check both notrace and filter for old hash
Steven Rostedt (Red Hat) [Tue, 13 Jan 2015 19:03:38 +0000 (14:03 -0500)] 
ftrace: Check both notrace and filter for old hash

Using just the filter for checking for trampolines or regs is not enough
when updating the code against the records that represent all functions.
Both the filter hash and the notrace hash need to be checked.

To trigger this bug (using trace-cmd and perf):

 # perf probe -a do_fork
 # trace-cmd start -B foo -e probe
 # trace-cmd record -p function_graph -n do_fork sleep 1

The trace-cmd record at the end clears the filter before it disables
function_graph tracing and then that causes the accounting of the
ftrace function records to become incorrect and causes ftrace to bug.

Link: http://lkml.kernel.org/r/20150114154329.358378039@goodmis.org
Cc: stable@vger.kernel.org
[ still need to switch old_hash_ops to old_ops_hash ]
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
9 years agoftrace: Fix updating of filters for shared global_ops filters
Steven Rostedt (Red Hat) [Tue, 13 Jan 2015 16:20:43 +0000 (11:20 -0500)] 
ftrace: Fix updating of filters for shared global_ops filters

As the set_ftrace_filter affects both the function tracer as well as the
function graph tracer, the ops that represent each have a shared
ftrace_ops_hash structure. This allows both to be updated when the filter
files are updated.

But if function graph is enabled and the global_ops (function tracing) ops
is not, then it is possible that the filter could be changed without the
update happening for the function graph ops. This will cause the changes
to not take place and may even cause a ftrace_bug to occur as it could mess
with the trampoline accounting.

The solution is to check if the ops uses the shared global_ops filter and
if the ops itself is not enabled, to check if there's another ops that is
enabled and also shares the global_ops filter. In that case, the
modification still needs to be executed.

Link: http://lkml.kernel.org/r/20150114154329.055980438@goodmis.org
Cc: stable@vger.kernel.org # 3.17+
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
9 years agoMerge branch 'thermal-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang...
Linus Torvalds [Thu, 15 Jan 2015 06:20:26 +0000 (19:20 +1300)] 
Merge branch 'thermal-soc' of git://git./linux/kernel/git/rzhang/linux

Pull thermal fixes from Zhang Rui:
 "Specifics:

   - bogus type qualifier fix in OF thermal code.
   - Minor fixes on imx and rcar thermal drivers.
   - Update TI SoC thermal maintainer entry.
   - Updated documentation of OF cpufreq cooling register"

* 'thermal-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  thermal: rcar: Spelling/grammar: s/drier use .../driver uses ...s/
  thermal: rcar: change type of ctemp in rcar_thermal_update_temp()
  thermal: rcar: fix ENR register value
  Documentation: thermal: document of_cpufreq_cooling_register()
  Thermal: imx: add clk disable/enable for suspend/resume
  MAINTAINERS: update ti-soc-thermal status
  MAINTAINERS: Add linux-omap to list of reviewers for TI Thermal
  thermal: of: Remove bogus type qualifier for of_thermal_get_trip_points()

9 years agoMerge tag 'fixes-for-v3.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Thu, 15 Jan 2015 00:27:23 +0000 (16:27 -0800)] 
Merge tag 'fixes-for-v3.19-rc6' of git://git./linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v3.19-rc6

The final set of fixes for v3.19. Two of the fixes are
related to dwc3 scatter/gather implementation when we have
more requests queued than available TRBs, while the other
is a build fix for mv-usb PHY.

Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoMerge tag 'usb-serial-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Wed, 14 Jan 2015 23:39:23 +0000 (15:39 -0800)] 
Merge tag 'usb-serial-3.19-rc5' of git://git./linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for v3.18-rc5

Here are a few fixes for reported problems including a possible
null-deref on probe with keyspan, a misbehaving modem, and a couple of
issues with the USB console.

Some new device IDs are also added.

Signed-off-by: Johan Hovold <johan@kernel.org>
9 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Wed, 14 Jan 2015 22:17:37 +0000 (11:17 +1300)] 
Merge git://git./linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) Don't use uninitialized data in IPVS, from Dan Carpenter.

 2) conntrack race fixes from Pablo Neira Ayuso.

 3) Fix TX hangs with i40e, from Jesse Brandeburg.

 4) Fix budget return from poll calls in dnet and alx, from Eric
    Dumazet.

 5) Fix bugus "if (unlikely(x) < 0)" test in AF_PACKET, from Christoph
    Jaeger.

 6) Fix bug introduced by conversion to list_head in TIPC retransmit
    code, from Jon Paul Maloy.

 7) Don't use GFP_NOIO under spinlock in USB kaweth driver, from Alexey
    Khoroshilov.

 8) Fix bridge build with INET disabled, from Arnd Bergmann.

 9) Fix netlink array overrun for PROBE attributes in openvswitch, from
    Thomas Graf.

10) Don't hold spinlock across synchronize_irq() in tg3 driver, from
    Prashant Sreedharan.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (44 commits)
  tg3: Release tp->lock before invoking synchronize_irq()
  tg3: tg3_reset_task() needs to use rtnl_lock to synchronize
  tg3: tg3_timer() should grab tp->lock before checking for tp->irq_sync
  team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin
  openvswitch: packet messages need their own probe attribtue
  i40e: adds FCoE configure option
  cxgb4vf: Fix queue allocation for 40G adapter
  netdevice: Add missing parentheses in macro
  bridge: only provide proxy ARP when CONFIG_INET is enabled
  neighbour: fix base_reachable_time(_ms) not effective immediatly when changed
  net: fec: fix MDIO bus assignement for dual fec SoC's
  xen-netfront: use different locks for Rx and Tx stats
  drivers: net: cpsw: fix multicast flush in dual emac mode
  cxgb4vf: Initialize mdio_addr before using it
  net: Corrected the comment describing the ndo operations to reflect the actual prototype for couple of operations
  usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()
  MAINTAINERS: add me as ibmveth maintainer
  tipc: fix bug in broadcast retransmit code
  update ip-sysctl.txt documentation (v2)
  net/at91_ether: prepare and unprepare clock
  ...

9 years agoMerge branch 'tg3-net'
David S. Miller [Wed, 14 Jan 2015 22:05:55 +0000 (17:05 -0500)] 
Merge branch 'tg3-net'

Prashant Sreedharan says:

====================
tg3: synchronize_irq() should be called without taking locks

v2: Added Reported-by, Tested-by fields and reference to the thread that
    reported the problem

This series addresses the problem reported by Peter Hurley in mail thread
https://lkml.org/lkml/2015/1/12/1082
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotg3: Release tp->lock before invoking synchronize_irq()
Prashant Sreedharan [Wed, 14 Jan 2015 19:34:44 +0000 (11:34 -0800)] 
tg3: Release tp->lock before invoking synchronize_irq()

synchronize_irq() can sleep waiting, for pending IRQ handlers so driver
should release the tp->lock spin lock before invoking synchronize_irq()

Reported-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotg3: tg3_reset_task() needs to use rtnl_lock to synchronize
Prashant Sreedharan [Wed, 14 Jan 2015 19:34:17 +0000 (11:34 -0800)] 
tg3: tg3_reset_task() needs to use rtnl_lock to synchronize

Currently tg3_reset_task() uses only tp->lock for synchronizing with code
paths like tg3_open() etc. But since tp->lock is released before doing
synchronize_irq(), rtnl_lock should be taken in tg3_reset_task() to
synchronize it with other code paths.

Reported-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotg3: tg3_timer() should grab tp->lock before checking for tp->irq_sync
Prashant Sreedharan [Wed, 14 Jan 2015 19:33:49 +0000 (11:33 -0800)] 
tg3: tg3_timer() should grab tp->lock before checking for tp->irq_sync

This is to avoid the race between tg3_timer() and the execution paths
which does not invoke tg3_timer_stop() and releases tp->lock before
calling synchronize_irq()

Reported-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Wed, 14 Jan 2015 21:54:30 +0000 (10:54 +1300)] 
Merge tag 'for-linus' of git://git./virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "Two bugfixes for arm64.  I will have another pull request next week,
  but otherwise things are calm"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  arm64: KVM: Fix HCR setting for 32bit guests
  arm64: KVM: Fix TLB invalidation by IPA/VMID

9 years agoteam: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin
Jiri Pirko [Wed, 14 Jan 2015 17:15:30 +0000 (18:15 +0100)] 
team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin

This patch is fixing a race condition that may cause setting
count_pending to -1, which results in unwanted big bulk of arp messages
(in case of "notify peers").

Consider following scenario:

count_pending == 2
   CPU0                                           CPU1
team_notify_peers_work
  atomic_dec_and_test (dec count_pending to 1)
  schedule_delayed_work
 team_notify_peers
   atomic_add (adding 1 to count_pending)
team_notify_peers_work
  atomic_dec_and_test (dec count_pending to 1)
  schedule_delayed_work
team_notify_peers_work
  atomic_dec_and_test (dec count_pending to 0)
   schedule_delayed_work
team_notify_peers_work
  atomic_dec_and_test (dec count_pending to -1)

Fix this race by using atomic_dec_if_positive - that will prevent
count_pending running under 0.

Fixes: fc423ff00df3a1955441 ("team: add peer notification")
Fixes: 492b200efdd20b8fcfd ("team: add support for sending multicast rejoins")
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Wed, 14 Jan 2015 21:50:29 +0000 (10:50 +1300)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
 "Two small performance tweaks, the plumbing for the execveat system
  call and a couple of bug fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/uprobes: fix user space PER events
  s390/bpf: Fix JMP_JGE_X (A > X) and JMP_JGT_X (A >= X)
  s390/bpf: Fix ALU_NEG (A = -A)
  s390/mm: avoid using pmd_to_page for !USE_SPLIT_PMD_PTLOCKS
  s390/timex: fix get_tod_clock_ext() inline assembly
  s390: wire up execveat syscall
  s390/kernel: use stnsm 255 instead of stosm 0
  s390/vtime: Get rid of redundant WARN_ON
  s390/zcrypt: kernel oops at insmod of the z90crypt device driver

9 years agoopenvswitch: packet messages need their own probe attribtue
Thomas Graf [Wed, 14 Jan 2015 13:56:19 +0000 (13:56 +0000)] 
openvswitch: packet messages need their own probe attribtue

User space is currently sending a OVS_FLOW_ATTR_PROBE for both flow
and packet messages. This leads to an out-of-bounds access in
ovs_packet_cmd_execute() because OVS_FLOW_ATTR_PROBE >
OVS_PACKET_ATTR_MAX.

Introduce a new OVS_PACKET_ATTR_PROBE with the same numeric value
as OVS_FLOW_ATTR_PROBE to grow the range of accepted packet attributes
while maintaining to be binary compatible with existing OVS binaries.

Fixes: 05da589 ("openvswitch: Add support for OVS_FLOW_ATTR_PROBE.")
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Tracked-down-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Reviewed-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoi40e: adds FCoE configure option
Vasu Dev [Wed, 14 Jan 2015 13:14:07 +0000 (05:14 -0800)] 
i40e: adds FCoE configure option

Adds FCoE config option I40E_FCOE, so that FCoE can be enabled
as needed but otherwise have it disabled by default.

This also eliminate multiple FCoE config checks, instead now just
one config check for CONFIG_I40E_FCOE.

The I40E FCoE was added with 3.17 kernel and therefore this patch
shall be applied to stable 3.17 kernel also.

CC: <stable@vger.kernel.org>
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4vf: Fix queue allocation for 40G adapter
Hariprasad Shenai [Wed, 14 Jan 2015 12:28:10 +0000 (17:58 +0530)] 
cxgb4vf: Fix queue allocation for 40G adapter

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge tag 'locks-v3.19-1' of git://git.samba.org/jlayton/linux
Linus Torvalds [Wed, 14 Jan 2015 21:38:07 +0000 (10:38 +1300)] 
Merge tag 'locks-v3.19-1' of git://git.samba.org/jlayton/linux

Pull file locking fix from Jeff Layton:
 "Just a simple bugfix for a regression that I introduced into v3.18
  with the internal lease API overhaul -- mea culpa.  Kudos to Linda and
  Neil for tracking this down and fixing it"

* tag 'locks-v3.19-1' of git://git.samba.org/jlayton/linux:
  locks: fix NULL-deref in generic_delete_lease

9 years agonetdevice: Add missing parentheses in macro
Benjamin Poirier [Wed, 14 Jan 2015 07:52:35 +0000 (16:52 +0900)] 
netdevice: Add missing parentheses in macro

For example, one could conceivably call
for_each_netdev_in_bond_rcu(condition ? bond1 : bond2, slave)
and get an unexpected result.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Wed, 14 Jan 2015 21:27:56 +0000 (10:27 +1300)] 
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block layer fixes from Jens Axboe:
 "The major part is an update to the NVMe driver, fixing various issues
  around surprise removal and hung controllers.  Most of that is from
  Keith, and parts are simple blk-mq fixes or exports/additions of minor
  functions to aid this effort, and parts are changes directly to the
  NVMe driver.

  Apart from the above, this contains:

   - Small blk-mq change from me, killing an unused member of the
     hardware queue structure.

   - Small fix from Ming Lei, fixing up a few drivers that didn't
     properly check for ERR_PTR() returns from blk_mq_init_queue()"

* 'for-linus' of git://git.kernel.dk/linux-block:
  NVMe: Fix locking on abort handling
  NVMe: Start and stop h/w queues on reset
  NVMe: Command abort handling fixes
  NVMe: Admin queue removal handling
  NVMe: Reference count admin queue usage
  NVMe: Start all requests
  blk-mq: End unstarted requests on a dying queue
  blk-mq: Allow requests to never expire
  blk-mq: Add helper to abort requeued requests
  blk-mq: Let drivers cancel requeue_work
  blk-mq: Export if requests were started
  blk-mq: Wake tasks entering queue on dying
  blk-mq: get rid of ->cmd_size in the hardware queue
  block: fix checking return value of blk_mq_init_queue
  block: wake up waiters when a queue is marked dying
  NVMe: Fix double free irq
  blk-mq: Export freeze/unfreeze functions
  blk-mq: Exit queue on alloc failure

9 years agobridge: only provide proxy ARP when CONFIG_INET is enabled
Arnd Bergmann [Tue, 13 Jan 2015 14:10:27 +0000 (15:10 +0100)] 
bridge: only provide proxy ARP when CONFIG_INET is enabled

When IPV4 support is disabled, we cannot call arp_send from
the bridge code, which would result in a kernel link error:

net/built-in.o: In function `br_handle_frame_finish':
:(.text+0x59914): undefined reference to `arp_send'
:(.text+0x59a50): undefined reference to `arp_tbl'

This makes the newly added proxy ARP support in the bridge
code depend on the CONFIG_INET symbol and lets the compiler
optimize the code out to avoid the link error.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 958501163ddd ("bridge: Add support for IEEE 802.11 Proxy ARP")
Cc: Kyeyoon Park <kyeyoonp@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agousb: dwc3: gadget: Stop TRB preparation after limit is reached
Amit Virdi [Tue, 13 Jan 2015 08:57:21 +0000 (14:27 +0530)] 
usb: dwc3: gadget: Stop TRB preparation after limit is reached

DWC3 gadget sets up a pool of 32 TRBs for each EP during initialization. This
means, the max TRBs that can be submitted for an EP is fixed to 32. Since the
request queue for an EP is a linked list, any number of requests can be queued
to it by the gadget layer.  However, the dwc3 driver must not submit TRBs more
than the pool it has created for. This limit wasn't respected when SG was used
resulting in submitting more than the max TRBs, eventually leading to
non-transfer of the TRBs submitted over the max limit.

Root cause:
When SG is used, there are two loops iterating to prepare TRBs:
 - Outer loop over the request_list
 - Inner loop over the SG list
The code was missing break to get out of the outer loop.

Fixes: eeb720fb21d6 (usb: dwc3: gadget: add support for SG lists)
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc3: gadget: Fix TRB preparation during SG
Amit Virdi [Tue, 13 Jan 2015 08:57:20 +0000 (14:27 +0530)] 
usb: dwc3: gadget: Fix TRB preparation during SG

When scatter gather (SG) is used, multiple TRBs are prepared from one DWC3
request (dwc3_request). So while preparing TRBs, the 'last' flag should be set
only when it is the last TRB being prepared from the last dwc3_request entry.

The current implementation uses list_is_last to check if the dwc3_request is the
last entry from the request_list. However, list_is_last returns false for the
last entry too. This is because, while preparing the first TRB from a request,
the function dwc3_prepare_one_trb modifies the request's next and prev pointers
while moving the URB to req_queued. Hence, list_is_last always returns false no
matter what.

The correct way is not to access the modified pointers of dwc3_request but to
use list_empty macro instead.

Fixes: e5ba5ec833aa (usb: dwc3: gadget: fix scatter gather implementation)
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agommc: sdhci: Set SDHCI_POWER_ON with external vmmc
Tim Kryger [Wed, 14 Jan 2015 06:24:12 +0000 (07:24 +0100)] 
mmc: sdhci: Set SDHCI_POWER_ON with external vmmc

Host controllers lacking the required internal vmmc regulator may still
follow the spec with regard to the LSB of SDHCI_POWER_CONTROL.  Set the
SDHCI_POWER_ON bit when vmmc is enabled to encourage the controller to
to drive CMD, DAT, SDCLK.

This fixes a regression observed on some Qualcomm and Nvidia boards
caused by 5222161 mmc: sdhci: Improve external VDD regulator support.

Fixes: 52221610dd84 (mmc: sdhci: Improve external VDD regulator support)
Signed-off-by: Tim Kryger <tim.kryger@gmail.com>
Tested-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
9 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
Zhang Rui [Wed, 14 Jan 2015 07:49:19 +0000 (15:49 +0800)] 
Merge branch 'fixes' of git://git./linux/kernel/git/evalenti/linux-soc-thermal into thermal-soc

9 years agoneighbour: fix base_reachable_time(_ms) not effective immediatly when changed
Jean-Francois Remy [Wed, 14 Jan 2015 03:22:39 +0000 (04:22 +0100)] 
neighbour: fix base_reachable_time(_ms) not effective immediatly when changed

When setting base_reachable_time or base_reachable_time_ms on a
specific interface through sysctl or netlink, the reachable_time
value is not updated.

This means that neighbour entries will continue to be updated using the
old value until it is recomputed in neigh_period_work (which
    recomputes the value every 300*HZ).
On systems with HZ equal to 1000 for instance, it means 5mins before
the change is effective.

This patch changes this behavior by recomputing reachable_time after
each set on base_reachable_time or base_reachable_time_ms.
The new value will become effective the next time the neighbour's timer
is triggered.

Changes are made in two places: the netlink code for set and the sysctl
handling code. For sysctl, I use a proc_handler. The ipv6 network
code does provide its own handler but it already refreshes
reachable_time correctly so it's not an issue.
Any other user of neighbour which provide its own handlers must
refresh reachable_time.

Signed-off-by: Jean-Francois Remy <jeff@melix.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: fix MDIO bus assignement for dual fec SoC's
Stefan Agner [Tue, 13 Jan 2015 23:20:21 +0000 (00:20 +0100)] 
net: fec: fix MDIO bus assignement for dual fec SoC's

On i.MX28, the MDIO bus is shared between the two FEC instances.
The driver makes sure that the second FEC uses the MDIO bus of the
first FEC. This is done conditionally if FEC_QUIRK_ENET_MAC is set.
However, in newer designs, such as Vybrid or i.MX6SX, each FEC MAC
has its own MDIO bus. Simply removing the quirk FEC_QUIRK_ENET_MAC
is not an option since other logic, triggered by this quirk, is
still needed.

Furthermore, there are board designs which use the same MDIO bus
for both PHY's even though the second bus would be available on the
SoC side. Such layout are popular since it saves pins on SoC side.
Due to the above quirk, those boards currently do work fine. The
boards in the mainline tree with such a layout are:
- Freescale Vybrid Tower with TWR-SER2 (vf610-twr.dts)
- Freescale i.MX6 SoloX SDB Board (imx6sx-sdb.dts)

This patch adds a new quirk FEC_QUIRK_SINGLE_MDIO for i.MX28, which
makes sure that the MDIO bus of the first FEC is used in any case.

However, the boards above do have a SoC with a MDIO bus for each FEC
instance. But the PHY's are not connected in a 1:1 configuration. A
proper device tree description is needed to allow the driver to
figure out where to find its PHY. This patch fixes that shortcoming
by adding a MDIO bus child node to the first FEC instance, along
with the two PHY's on that bus, and making use of the phy-handle
property to add a reference to the PHY's.

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'leds-fixes-for-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 13 Jan 2015 23:22:56 +0000 (12:22 +1300)] 
Merge branch 'leds-fixes-for-3.19' of git://git./linux/kernel/git/cooloney/linux-leds

Pull LED fix from Bryan Wu.

* 'leds-fixes-for-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
  leds: netxbig: fix oops at probe time

9 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/borntraeger...
Linus Torvalds [Tue, 13 Jan 2015 22:54:12 +0000 (11:54 +1300)] 
Merge tag 'for-linus' of git://git./linux/kernel/git/borntraeger/linux

Pull WRITE_ONCE argument order change from Christian Borntraeger:
 "As discussed on LKML[1] it was agreed that WRITE_ONCE(x, val) is
  better than ASSIGN_ONCE(val, x)

  Lets change that for 3.19 as 3.19 has no user yet, but the first users
  will hit linux-next soon"

[1] http://marc.info/?l=linux-kernel&m=142081181707596

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/borntraeger/linux:
  kernel: Change ASSIGN_ONCE(val, x) to WRITE_ONCE(x, val)

9 years agoxen-netfront: use different locks for Rx and Tx stats
David Vrabel [Tue, 13 Jan 2015 16:42:42 +0000 (16:42 +0000)] 
xen-netfront: use different locks for Rx and Tx stats

In netfront the Rx and Tx path are independent and use different
locks.  The Tx lock is held with hard irqs disabled, but Rx lock is
held with only BH disabled.  Since both sides use the same stats lock,
a deadlock may occur.

  [ INFO: possible irq lock inversion dependency detected ]
  3.16.2 #16 Not tainted
  ---------------------------------------------------------
  swapper/0/0 just changed the state of lock:
   (&(&queue->tx_lock)->rlock){-.....}, at: [<c03adec8>]
  xennet_tx_interrupt+0x14/0x34
  but this lock took another, HARDIRQ-unsafe lock in the past:
   (&stat->syncp.seq#2){+.-...}
  and interrupts could create inverse lock ordering between them.
  other info that might help us debug this:
   Possible interrupt unsafe locking scenario:

         CPU0                    CPU1
         ----                    ----
    lock(&stat->syncp.seq#2);
                                 local_irq_disable();
                                 lock(&(&queue->tx_lock)->rlock);
                                 lock(&stat->syncp.seq#2);
    <Interrupt>
      lock(&(&queue->tx_lock)->rlock);

Using separate locks for the Rx and Tx stats fixes this deadlock.

Reported-by: Dmitry Piotrovsky <piotrovskydmitry@gmail.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodrivers: net: cpsw: fix multicast flush in dual emac mode
Mugunthan V N [Tue, 13 Jan 2015 12:05:49 +0000 (17:35 +0530)] 
drivers: net: cpsw: fix multicast flush in dual emac mode

Since ALE table is a common resource for both the interfaces in Dual EMAC
mode and while bringing up the second interface in cpsw_ndo_set_rx_mode()
all the multicast entries added by the first interface is flushed out and
only second interface multicast addresses are added. Fixing this by
flushing multicast addresses based on dual EMAC port vlans which will not
affect the other emac port multicast addresses.

Fixes: d9ba8f9 (driver: net: ethernet: cpsw: dual emac interface implementation)
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoleds: netxbig: fix oops at probe time
Simon Guinot [Tue, 2 Dec 2014 15:32:10 +0000 (07:32 -0800)] 
leds: netxbig: fix oops at probe time

This patch fixes a NULL pointer dereference on led_dat->mode_val. Due to
this bug, a kernel oops can be observed at probe time on the LaCie 2Big
and 5Big v2 boards:

Unable to handle kernel NULL pointer dereference at virtual address 00000008
[...]
[<c03f244c>] (netxbig_led_probe) from [<c02c8c6c>] (platform_drv_probe+0x4c/0x9c)
[<c02c8c6c>] (platform_drv_probe) from [<c02c72d0>] (driver_probe_device+0x98/0x25c)
[<c02c72d0>] (driver_probe_device) from [<c02c7520>] (__driver_attach+0x8c/0x90)
[<c02c7520>] (__driver_attach) from [<c02c5c24>] (bus_for_each_dev+0x68/0x94)
[<c02c5c24>] (bus_for_each_dev) from [<c02c6408>] (bus_add_driver+0x124/0x1dc)
[<c02c6408>] (bus_add_driver) from [<c02c7ac0>] (driver_register+0x78/0xf8)
[<c02c7ac0>] (driver_register) from [<c000888c>] (do_one_initcall+0x80/0x1cc)
[<c000888c>] (do_one_initcall) from [<c0733618>] (kernel_init_freeable+0xe4/0x1b4)
[<c0733618>] (kernel_init_freeable) from [<c058db9c>] (kernel_init+0xc/0xec)
[<c058db9c>] (kernel_init) from [<c0009850>] (ret_from_fork+0x14/0x24)
[...]

This bug was introduced by commit 588a6a99286ae30afb1339d8bc2163517b1b7dd1
("leds: netxbig: fix attribute-creation race").

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Cc: <stable@vger.kernel.org> # 3.17+
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
9 years agocxgb4vf: Initialize mdio_addr before using it
Hariprasad Shenai [Mon, 12 Jan 2015 16:36:16 +0000 (22:06 +0530)] 
cxgb4vf: Initialize mdio_addr before using it

In commit 5ad24def21b205a8 ("cxgb4vf: Fix ethtool get_settings for VF driver")
mdio_addr of port_info structure was used unininitialzed. Fixing it.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agokernel: Change ASSIGN_ONCE(val, x) to WRITE_ONCE(x, val)
Christian Borntraeger [Tue, 13 Jan 2015 09:46:42 +0000 (10:46 +0100)] 
kernel: Change ASSIGN_ONCE(val, x) to WRITE_ONCE(x, val)

Feedback has shown that WRITE_ONCE(x, val) is easier to use than
ASSIGN_ONCE(val,x).
There are no in-tree users yet, so lets change it for 3.19.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Davidlohr Bueso <dave@stgolabs.net>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
9 years agoMerge tag 'linux-kselftest-3.19-rc-5' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 13 Jan 2015 19:09:14 +0000 (08:09 +1300)] 
Merge tag 'linux-kselftest-3.19-rc-5' of git://git./linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:
 "This update contains three patches to fix one compile error, and two
  run-time bugs.  One of them fixes infinite loop on ARM"

* tag 'linux-kselftest-3.19-rc-5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/vm: fix link error for transhuge-stress test
  tools: testing: selftests: mq_perf_tests: Fix infinite loop on ARM
  selftests/exec: allow shell return code of 126

9 years agoMerge tag 'stable/for-linus-3.19-rc4-tag' of git://git.kernel.org/pub/scm/linux/kerne...
Linus Torvalds [Tue, 13 Jan 2015 19:07:42 +0000 (08:07 +1300)] 
Merge tag 'stable/for-linus-3.19-rc4-tag' of git://git./linux/kernel/git/xen/tip

Pull xen bug fixes from David Vrabel:
 "Several critical linear p2m fixes that prevented some hosts from
  booting"

* tag 'stable/for-linus-3.19-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  x86/xen: properly retrieve NMI reason
  xen: check for zero sized area when invalidating memory
  xen: use correct type for physical addresses
  xen: correct race in alloc_p2m_pmd()
  xen: correct error for building p2m list on 32 bits
  x86/xen: avoid freeing static 'name' when kasprintf() fails
  x86/xen: add extra memory for remapped frames during setup
  x86/xen: don't count how many PFNs are identity mapped
  x86/xen: Free bootmem in free_p2m_page() during early boot
  x86/xen: Remove unnecessary BUG_ON(preemptible()) in xen_setup_timer()

9 years agonet: Corrected the comment describing the ndo operations to reflect the actual protot...
B Viswanath [Mon, 12 Jan 2015 09:16:25 +0000 (14:46 +0530)] 
net: Corrected the comment describing the ndo operations to reflect the actual prototype for couple of operations

Corrected the comment describing the ndo operations to
reflect the actual prototype for couple of operations

Signed-off-by: B Viswanath <marichika4@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoclk: berlin: bg2q: remove non-exist "smemc" gate clock
Jisheng Zhang [Wed, 31 Dec 2014 08:57:52 +0000 (16:57 +0800)] 
clk: berlin: bg2q: remove non-exist "smemc" gate clock

The "smemc" clock is removed on BG2Q SoCs. In fact, bit19 of clkenable
register is for nfc. Current code use bit19 for non-exist "smemc"
incorrectly, this prevents eMMC from working due to the sdhci's
"core" clk is still gated.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: Michael Turquette <mturquette@linaro.org>
9 years agoclk: at91: keep slow clk enabled to prevent system hang
Boris Brezillon [Tue, 13 Jan 2015 14:44:06 +0000 (15:44 +0100)] 
clk: at91: keep slow clk enabled to prevent system hang

All slow clk users are not properly claiming it (get + prepare + enable)
before using it.
If all users properly claiming this clock release it, the clock is
disabled, but faulty users still depends on it, and the system hangs.

This fix prevents the slow clock from being disabled, and should solve the
hanging issue, but offending drivers should be patched to properly claim
this clock.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reported-by: Bo Shen <voice.shen@atmel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Michael Turquette <mturquette@linaro.org>
9 years agoMerge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Tue, 13 Jan 2015 18:53:51 +0000 (07:53 +1300)] 
Merge branch 'for-rc' of git://git./linux/kernel/git/rzhang/linux

Pull thermal management fixes from Zhang Rui:
 "Specifics:

   - Fix a problem that Intel SoC DTS thermal driver does not work when
     CONFIG_THERMAL_INT340X is not set.

   - Fix a NULL pointer dereference when processor_thermal_device driver
     is loaded on a platform without ACPI support"

* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  int340x_thermal/processor_thermal_device: return failure when
  ACPI/int340x_thermal: enumerate INT3401 for Intel SoC DTS thermal driver
  ACPI/int340x_thermal: enumerate INT340X devices even if they're not in _ART/_TRT

9 years agodmaengine: dw: balance PM runtime calls
Andy Shevchenko [Tue, 13 Jan 2015 16:57:15 +0000 (18:57 +0200)] 
dmaengine: dw: balance PM runtime calls

In case of PCI driver we will get a warning:
dw_dmac_pci 0000:00:18.0: Unbalanced pm_runtime_enable!
dw_dmac_pci 0000:00:18.0: DesignWare DMA Controller, 8 channels

This happens due to pm_runtime_enable() call from the driver when PM runtime is
enabled by core.

This patch moves that call to the platform driver where it might make sense.

Fixes: bb32baf76e56 (dmaengine: dw: enable runtime PM)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
9 years agousb: phy: mv-usb: fix usb_phy build errors
Arnd Bergmann [Tue, 13 Jan 2015 14:25:11 +0000 (15:25 +0100)] 
usb: phy: mv-usb: fix usb_phy build errors

The driver was recently adapted to a core API change, but the
change was incomplete, missing out the suspend helper and
leaving an extraneous local variable around:

usb/phy/phy-mv-usb.c: In function 'mv_otg_update_state':
usb/phy/phy-mv-usb.c:341:18: warning: unused variable 'phy' [-Wunused-variable]

usb/phy/phy-mv-usb.c: In function 'mv_otg_suspend':
usb/phy/phy-mv-usb.c:861:16: error: 'struct usb_phy' has no member named 'state'

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: e47d92545c297 ("usb: move the OTG state from the USB PHY to the OTG structure")
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agofbdev/broadsheetfb: fix memory leak
Colin Ian King [Mon, 12 Jan 2015 15:27:52 +0000 (15:27 +0000)] 
fbdev/broadsheetfb: fix memory leak

static code analysis from cppcheck reports:

[drivers/video/fbdev/broadsheetfb.c:673]:
  (error) Memory leak: sector_buffer

sector_buffer is not being kfree'd on each call to
broadsheet_spiflash_rewrite_sector(), so free it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agolocks: fix NULL-deref in generic_delete_lease
NeilBrown [Tue, 13 Jan 2015 02:17:43 +0000 (15:17 +1300)] 
locks: fix NULL-deref in generic_delete_lease

commit 0efaa7e82f02fe69c05ad28e905f31fc86e6f08e
  locks: generic_delete_lease doesn't need a file_lock at all

moves the call to fl->fl_lmops->lm_change() to a place in the
code where fl might be a non-lease lock.
When that happens, fl_lmops is NULL and an Oops ensures.

So add an extra test to restore correct functioning.

Reported-by: Linda Walsh <suse@tlinx.org>
Link: https://bugzilla.suse.com/show_bug.cgi?id=912569
Cc: stable@vger.kernel.org (v3.18)
Fixes: 0efaa7e82f02fe69c05ad28e905f31fc86e6f08e
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
9 years agosimplefb: Fix build failure on Sparc
Hans de Goede [Mon, 5 Jan 2015 08:15:16 +0000 (09:15 +0100)] 
simplefb: Fix build failure on Sparc

of_platform_device_create is only defined when CONFIG_OF_ADDRESS is set,
which is normally always the case when CONFIG_OF is defined, except on Sparc,
so explicitly check for CONFIG_OF_ADDRESS rather then for CONFIG_OF.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 years agox86/xen: properly retrieve NMI reason
Jan Beulich [Tue, 13 Jan 2015 07:40:05 +0000 (07:40 +0000)] 
x86/xen: properly retrieve NMI reason

Using the native code here can't work properly, as the hypervisor would
normally have cleared the two reason bits by the time Dom0 gets to see
the NMI (if passed to it at all). There's a shared info field for this,
and there's an existing hook to use - just fit the two together. This
is particularly relevant so that NMIs intended to be handled by APEI /
GHES actually make it to the respective handler.

Note that the hook can (and should) be used irrespective of whether
being in Dom0, as accessing port 0x61 in a DomU would be even worse,
while the shared info field would just hold zero all the time. Note
further that hardware NMI handling for PVH doesn't currently work
anyway due to missing code in the hypervisor (but it is expected to
work the native rather than the PV way).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
9 years agostaging: vt6655: fix sparse warning: argument type
Eddie Kovsky [Sun, 21 Dec 2014 05:27:55 +0000 (22:27 -0700)] 
staging: vt6655: fix sparse warning: argument type

Fixes following warning generated by sparse:

drivers/staging/vt6655/baseband.c:2180:45: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/baseband.c:2180:45:    expected struct vnt_private *priv
drivers/staging/vt6655/baseband.c:2180:45:    got void [noderef] <asn:2>*dwIoBase

Compile tested on next-20141219.

Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: Fix loss of distant/weak access points on channel change.
Malcolm Priestley [Sun, 21 Dec 2014 12:56:35 +0000 (12:56 +0000)] 
staging: vt6655: Fix loss of distant/weak access points on channel change.

If the asssocated access point is strong byBBVGACurrent will be adjusted
accordingly.

Users will nolonger see distant access points without taking down interface.

When changing channel reset byBBVGACurrent back to pDevice->abyBBVGA[0] for
max sensitivity.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: vnt_tx_packet Fix corrupted tx packets.
Malcolm Priestley [Sun, 21 Dec 2014 12:56:34 +0000 (12:56 +0000)] 
staging: vt6655: vnt_tx_packet Fix corrupted tx packets.

Move PSTxDesc->m_td1TD1 to inside spin locks.

if m_td1TD1.byTCR has TCR_EDP and TCR_STP are set, the interrupt handler will
try and complete the buffer before it is completed. Usually on the tail
of a burst of tx packets.

This results in a partially completed packet being transmitted or worse
sitll dead lock when skb is freed by the interrupt handler.

Set head_td->m_td1TD1.byTCR to 0 in first lock of vnt_tx_packet to stop
interrupt handler completing the buffer. Move Set TSR1 & ReqCount in
s_cbFillTxBufHead to the second lock.

cbReqCount is carried to the second lock in pTDInfo->dwReqCount without
the padding removed.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: fix sparse warnings: incorrect argument type
Mike Krinkin [Sun, 21 Dec 2014 13:56:47 +0000 (16:56 +0300)] 
staging: vt6655: fix sparse warnings: incorrect argument type

this patch fixes following sparse warnings:

drivers/staging/vt6655/device_main.c:1503:25: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/device_main.c:1503:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1503:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1503:25: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/vt6655/device_main.c:1503:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1503:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1505:25: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/device_main.c:1505:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1505:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1505:25: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/vt6655/device_main.c:1505:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1505:25:    got struct vnt_private *

Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoMerge tag 'gpio-v3.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Tue, 13 Jan 2015 02:29:42 +0000 (15:29 +1300)] 
Merge tag 'gpio-v3.19-3' of git://git./linux/kernel/git/linusw/linux-gpio

Pull gpio fixes from Linus Walleij:
 "Here are some GPIO fixes, mainly affecting the DLN2 IRQ handling.
  Nothing special about them, just fixes:

   - Three patches fixing IRQ handling for the DLN2
   - Null pointer handling for grgpio"

* tag 'gpio-v3.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: dln2: use bus_sync_unlock instead of scheduling work
  gpio: grgpio: Avoid potential NULL pointer dereference
  gpio: dln2: Fix gpio output value in dln2_gpio_direction_output()
  gpio: dln2: fix issue when an IRQ is unmasked then enabled

9 years agoMerge tag 'mmc-v3.19-3' of git://git.linaro.org/people/ulf.hansson/mmc
Linus Torvalds [Tue, 13 Jan 2015 02:25:23 +0000 (15:25 +1300)] 
Merge tag 'mmc-v3.19-3' of git://git.linaro.org/people/ulf.hansson/mmc

Pull MMC fixes from Ulf Hansson:
 "MMC host:
   - sdhci-pci|acpi: Support some new IDs
   - sdhci: Fix sleep from atomic context
   - sdhci-pxav3: Prevent hang during ->probe()
   - sdhci: Disable re-tuning for HS400"

* tag 'mmc-v3.19-3' of git://git.linaro.org/people/ulf.hansson/mmc:
  mmc: sdhci-pci: Add support for Intel SPT
  mmc: sdhci-acpi: Add ACPI HID INT344D
  mmc: sdhci: Fix sleep in atomic after inserting SD card
  mmc: sdhci-pxav3: do the mbus window configuration after enabling clocks
  mmc: sdhci: Disable re-tuning for HS400
  mmc: sdhci: Simplify use of tuning timer
  mmc: sdhci: Add out_unlock to sdhci_execute_tuning
  mmc: sdhci: Tuning should not change max_blk_count

9 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Linus Torvalds [Tue, 13 Jan 2015 02:23:26 +0000 (15:23 +1300)] 
Merge git://git./linux/kernel/git/nab/target-pending

Pull scsi target fixes from Nicholas Bellinger:
 "Mostly minor fixes this time, including:

   - Add missing virtio-scsi -> TCM attribute conversion in vhost-scsi.
   - Fix persistent reservations write exclusive handling to allow
     readers for all registered I_T nexuses.
   - Drop arbitrary maximum I/O size limit in order to process I/Os
     larger than 4 MB, required for initiators that don't honor block
     limits EVPD.
   - Drop the now left-over fabric_max_sectors attribute"

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  iscsi-target: Fix typos in enum cmd_flags_table
  MAINTAINERS: Add entry for iSER target driver
  target: Allow Write Exclusive non-reservation holders to READ
  target: Drop left-over fabric_max_sectors attribute
  target: Drop arbitrary maximum I/O size limit
  Documentation/target: Update fabric_ops to latest code
  vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion

9 years agomm: mmu_gather: use tlb->end != 0 only for TLB invalidation
Will Deacon [Mon, 12 Jan 2015 19:10:55 +0000 (19:10 +0000)] 
mm: mmu_gather: use tlb->end != 0 only for TLB invalidation

When batching up address ranges for TLB invalidation, we check tlb->end
!= 0 to indicate that some pages have actually been unmapped.

As of commit f045bbb9fa1b ("mmu_gather: fix over-eager
tlb_flush_mmu_free() calling"), we use the same check for freeing these
pages in order to avoid a performance regression where we call
free_pages_and_swap_cache even when no pages are actually queued up.

Unfortunately, the range could have been reset (tlb->end = 0) by
tlb_end_vma, which has been shown to cause memory leaks on arm64.
Furthermore, investigation into these leaks revealed that the fullmm
case on task exit no longer invalidates the TLB, by virtue of tlb->end
 == 0 (in 3.18, need_flush would have been set).

This patch resolves the problem by reverting commit f045bbb9fa1b, using
instead tlb->local.nr as the predicate for page freeing in
tlb_flush_mmu_free and ensuring that tlb->end is initialised to a
non-zero value in the fullmm case.

Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Dave Hansen <dave@sr71.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge tag 'v3.19-rockhip-clkfixes1' of git://git.kernel.org/pub/scm/linux/kernel...
Michael Turquette [Mon, 12 Jan 2015 22:52:45 +0000 (14:52 -0800)] 
Merge tag 'v3.19-rockhip-clkfixes1' of git://git./linux/kernel/git/mmind/linux-rockchip into clk-fixes

- two currently unused clocks that need to stay enabled
- fix the lock bit locations of the rk3066 plls
- fix rk3288 core divider values to the ones actually
  specified by the soc vendor

9 years agousb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()
Alexey Khoroshilov [Fri, 9 Jan 2015 23:16:22 +0000 (02:16 +0300)] 
usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()

Commit e4c7f259c5be ("USB: kaweth.c: use GFP_ATOMIC under spin_lock")
makes sure that kaweth_internal_control_msg() allocates memory with GFP_ATOMIC,
but kaweth_internal_control_msg() also calls usb_start_wait_urb()
that still allocates memory with GFP_NOIO.

The patch fixes usb_start_wait_urb() as well.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMAINTAINERS: add me as ibmveth maintainer
Thomas Falcon [Fri, 9 Jan 2015 20:29:40 +0000 (14:29 -0600)] 
MAINTAINERS: add me as ibmveth maintainer

Adding myself as the ibmveth maintainer and replacing
Santiago Leon.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Cc: Santiago Leon <santi_leon@yahoo.com>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agousb: renesas_usbhs: add OTG ID signal sensing
Sergei Shtylyov [Mon, 15 Dec 2014 22:42:13 +0000 (01:42 +0300)] 
usb: renesas_usbhs: add OTG ID signal sensing

On the Renesas R8A7791 SoC based boards there's MAX3355 USB OTG chip and mini-AB
USB connector corresponding to USB port 0 driven either by EHCI/OHCI or  Renesas
USBHS gadget controller. And we'd like the host/gadget  drivers to work based on
the cable type connected. An 'extcon' driver for MAX3355 has been written, so we
only need to bind  to it via device tree which I'm doing in this patch.

(Perhaps, it would also make sense to use OTG HNP when the USBHS host mode is
active and a B-cable is connected but I don't have access to host-capable USBHS,
so  wouldn't be able to test it.)

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: report disconnection after reset
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:10 +0000 (13:39 +0100)] 
usb: dwc2: gadget: report disconnection after reset

If usb bus is reset without a physical disconnection, all endpoints
will remain open. Call s3c_hsotg_disconnect() from reset handler to
report a disconnect to gadget framework. hsotg->connected is checked
in s3c_hsotg_disconnect() before processing disconnect.

In some cases, USBRst is seen before EnumDone and after it as well.
So move setting of hsotg->connected to set-address to avoid reporting
extra disconnection in this case.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: force gadget initialization in dev mode
Gregory Herrero [Fri, 9 Jan 2015 12:39:09 +0000 (13:39 +0100)] 
usb: dwc2: gadget: force gadget initialization in dev mode

When booting with id pin grounded, dwc2 default to host mode.
Thus, force device mode prior initializing gadget part.
Else fifo init will fail since fifo values are not correct
in host mode.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: add vbus_draw support
Gregory Herrero [Fri, 9 Jan 2015 12:39:08 +0000 (13:39 +0100)] 
usb: dwc2: gadget: add vbus_draw support

This callback informs the driver about the total amount of current it
is allowed to draw. Share this information with the phy so that
current limits can be set for charging for example.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix pullup handling
Gregory Herrero [Fri, 9 Jan 2015 12:39:07 +0000 (13:39 +0100)] 
usb: dwc2: gadget: fix pullup handling

Gadget must be informed about disconnection when pullup is
removed.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: reset fifo_map when initializing fifos
Gregory Herrero [Fri, 9 Jan 2015 12:39:06 +0000 (13:39 +0100)] 
usb: dwc2: gadget: reset fifo_map when initializing fifos

After all endpoints are disabled, fifo_map should have reached 0.
Its a bug if if didn't, so warn about it and reset it to 0 so that
driver can continue using all the fifos.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix fifo allocation leak
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:05 +0000 (13:39 +0100)] 
usb: dwc2: gadget: fix fifo allocation leak

When selecting different alt setting, s3c_hsotg_ep_enable can be
called with fifo already allocated. Allocate fifo again only if
required and after deallocating the previous fifo.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: pick smallest acceptable fifo
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:04 +0000 (13:39 +0100)] 
usb: dwc2: gadget: pick smallest acceptable fifo

Current algorithm picks the first fifo which is equal to or greater
than the required size. This can result in bigger fifos assigned to
endpoints with smaller maxps. Change the algorithm to pick the
smallest fifo which is greater than or equal to the required size.

Moreover, only use signed variables when required.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: rename sent_zlp to send_zlp
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:03 +0000 (13:39 +0100)] 
usb: dwc2: gadget: rename sent_zlp to send_zlp

This flag is set before sending the zlp. So use present tense instead
of the past tense.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: add vbus_session support
Gregory Herrero [Fri, 9 Jan 2015 12:39:02 +0000 (13:39 +0100)] 
usb: dwc2: gadget: add vbus_session support

Enable phy driver to report vbus session. This allows us to remove
D+ pullup when vbus is not present.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: don't block after fifo flush timeout
Gregory Herrero [Fri, 9 Jan 2015 12:39:01 +0000 (13:39 +0100)] 
usb: dwc2: gadget: don't block after fifo flush timeout

Can't stay in the loop forever. Break it after timeout.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: dont warn if endpoint is not enabled
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:39:00 +0000 (13:39 +0100)] 
usb: dwc2: gadget: dont warn if endpoint is not enabled

The warning is probably good but it has false positives in both dma and non-dma
cases. So its not very helpful in either.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix zero length packet transfers
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:59 +0000 (13:38 +0100)] 
usb: dwc2: gadget: fix zero length packet transfers

According to programming guide, zero length packet should be
programmed on its own and should not be counted in DIEPTSIZ.PktCnt
with other packets.

For ep0, this is the zlp for DATA IN stage (if required) and not for
the STATUS stage.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: manage ep0 state in software
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:58 +0000 (13:38 +0100)] 
usb: dwc2: gadget: manage ep0 state in software

Manage ep0 state in software to add handling of status OUT stage.
Just toggling hsotg->setup in s3c_hsotg_handle_outdone leaves it in
wrong state in 2-stage control transfers.
Moreover, ensure that for setup-packet s3c_hsotg_handle_outdone is
called either from SetupDone or OutDone but not both. Dwc2 ip v3.00a
generates both SetupDone and OutDone on setup packets.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: kill requests after disabling ep
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:57 +0000 (13:38 +0100)] 
usb: dwc2: gadget: kill requests after disabling ep

kill_all_requests() can flush the fifo. Call it after disabling the
endpoint.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: consider all tx fifos
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:56 +0000 (13:38 +0100)] 
usb: dwc2: gadget: consider all tx fifos

When matching tx fifo to endpoint, consider all fifos instead of
hard limiting to 8
Moreover, print error in case no fifo could be found.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix debug loop limits
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:55 +0000 (13:38 +0100)] 
usb: dwc2: gadget: fix debug loop limits

< 15 check doesn't show debug information for endpoint 15.
It is possible to have less than 15 endpoints so use limit
provided by hardware configuration.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: remove unused members from hsotg_req
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:54 +0000 (13:38 +0100)] 
usb: dwc2: gadget: remove unused members from hsotg_req

These members are only occupying space.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: dt-bindings: add dt binding info for dwc2 fifo resizing
Gregory Herrero [Fri, 9 Jan 2015 12:38:53 +0000 (13:38 +0100)] 
Documentation: dt-bindings: add dt binding info for dwc2 fifo resizing

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: configure fifos from device tree
Gregory Herrero [Fri, 9 Jan 2015 12:38:52 +0000 (13:38 +0100)] 
usb: dwc2: gadget: configure fifos from device tree

As fifo size can vary between SOCs, add possibility to configure
them from device tree. Fifo sizes used by the legacy driver will
be used If they are not provided by the device tree.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Reviewed-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: check interrupts for all endpoints
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:51 +0000 (13:38 +0100)] 
usb: dwc2: gadget: check interrupts for all endpoints

Current code does not check endpoint 15 interrupt. Use number
of endpoint configured in hardware instead of the hardcoded value.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: add bi-directional endpoint support
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:50 +0000 (13:38 +0100)] 
usb: dwc2: gadget: add bi-directional endpoint support

GHWCFG1 provides hardware configuration of each endpoint. Use
it to configure the endpoints instead of assuming all even
endpoint are OUT and all odd endpoints are IN.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agoDocumentation: dt-bindings: add dt binding info for dwc2 g-use-dma
Gregory Herrero [Fri, 9 Jan 2015 12:38:49 +0000 (13:38 +0100)] 
Documentation: dt-bindings: add dt binding info for dwc2 g-use-dma

Indicate if gadget driver must use dma for usb transfers.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: add device tree property to enable dma
Gregory Herrero [Fri, 9 Jan 2015 12:38:48 +0000 (13:38 +0100)] 
usb: dwc2: gadget: add device tree property to enable dma

* Add an of specific function to parse device node properties.
* Enable dma usage only if device tree property 'g_use_dma' is present.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: don't erase gahbcfg register when enabling dma
Gregory Herrero [Fri, 9 Jan 2015 12:38:47 +0000 (13:38 +0100)] 
usb: dwc2: gadget: don't erase gahbcfg register when enabling dma

Do a read-modify-write instead of only setting DMAEn bit.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: write correct value in ahbcfg register
Gregory Herrero [Fri, 9 Jan 2015 12:38:46 +0000 (13:38 +0100)] 
usb: dwc2: gadget: write correct value in ahbcfg register

HBstLen is GAHBCFG[4:1]. Use GAHBCFG_HBSTLEN_SHIFT to write burst-
length at correct position.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: fix error path in dwc2_gadget_init
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:45 +0000 (13:38 +0100)] 
usb: dwc2: gadget: fix error path in dwc2_gadget_init

In the error path, s3c_hsotg_phy_disable should be called after a
call to s3c_hsotg_phy_enable is made.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: don't embed ep0 buffers
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:44 +0000 (13:38 +0100)] 
usb: dwc2: gadget: don't embed ep0 buffers

When using DMA, data of the previous setup packet can be read back
from cache because ep0 and ctrl buffers are embedded in struct s3c_hsotg.
Allocate buffers instead of embedding them.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Reviewed-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
9 years agousb: dwc2: gadget: don't process XferCompl on setup packet
Mian Yousaf Kaukab [Fri, 9 Jan 2015 12:38:43 +0000 (13:38 +0100)] 
usb: dwc2: gadget: don't process XferCompl on setup packet

Only process DOEPINT.XferCompl on data packet as DOEPINTn.SetUp can
occur with or without DOEPINT.XferCompl. When DOEPINT.SetUp occurs
with DOEPINT.XferCompl, only DOEPINT.SetUp needs to be handled.

Moreover, ignore DOEPINT.XferCompl when it occurs with
DOEPINT.StupPktRcvd as driver needs to wait for DOEPINT.SetUp to
continue.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This page took 0.061193 seconds and 5 git commands to generate.