GitHub/LineageOS/android_kernel_samsung_universal7580.git
11 years agoMerge tag 'gpio-v3.9-lastminute' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 25 Apr 2013 00:01:58 +0000 (17:01 -0700)]
Merge tag 'gpio-v3.9-lastminute' of git://git./linux/kernel/git/linusw/linux-gpio

Pull gpi fix from Linus Walleij:
 "This is a last minute revert for the GPIO tree, as Mike Dunn noticed
  breakage on some older PXA machines due to moving PXA GPIO initcalls
  to the module_init initlevel"

* tag 'gpio-v3.9-lastminute' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  Revert "gpio: pxa: set initcall level to module init"

11 years agosparc64: Fix missing put_cpu_var() in tlb_batch_add_one() when not batching.
David S. Miller [Wed, 24 Apr 2013 23:52:18 +0000 (16:52 -0700)]
sparc64: Fix missing put_cpu_var() in tlb_batch_add_one() when not batching.

Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoRevert "gpio: pxa: set initcall level to module init"
Linus Walleij [Wed, 24 Apr 2013 19:41:20 +0000 (21:41 +0200)]
Revert "gpio: pxa: set initcall level to module init"

This reverts commit 6c7e660a27da7494c670bfba21cfeba30457656c.

The commit causes breakage on several older PXA machines.

Reported-by: Mike Dunn <mikedunn@newsguy.com>
Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoMerge branch 'pci/gavin-msi-cleanup' into next
Bjorn Helgaas [Wed, 24 Apr 2013 17:37:49 +0000 (11:37 -0600)]
Merge branch 'pci/gavin-msi-cleanup' into next

* pci/gavin-msi-cleanup:
  vfio-pci: Use cached MSI/MSI-X capabilities
  vfio-pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK
  PCI: Remove "extern" from function declarations
  PCI: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK
  PCI: Drop msi_mask_reg() and remove drivers/pci/msi.h
  PCI: Use msix_table_size() directly, drop multi_msix_capable()
  PCI: Drop msix_table_offset_reg() and msix_pba_offset_reg() macros
  PCI: Drop is_64bit_address() and is_mask_bit_support() macros
  PCI: Drop msi_data_reg() macro
  PCI: Drop msi_lower_address_reg() and msi_upper_address_reg() macros
  PCI: Drop msi_control_reg() macro and use PCI_MSI_FLAGS directly
  PCI: Use cached MSI/MSI-X offsets from dev, not from msi_desc
  PCI: Clean up MSI/MSI-X capability #defines
  PCI: Use cached MSI-X cap while enabling MSI-X
  PCI: Use cached MSI cap while enabling MSI interrupts
  PCI: Remove MSI/MSI-X cap check in pci_msi_check_device()
  PCI: Cache MSI/MSI-X capability offsets in struct pci_dev
  PCI: Use u8, not int, for PM capability offset
  [SCSI] megaraid_sas: Use correct #define for MSI-X capability

11 years agovfio-pci: Use cached MSI/MSI-X capabilities
Bjorn Helgaas [Thu, 18 Apr 2013 21:12:58 +0000 (15:12 -0600)]
vfio-pci: Use cached MSI/MSI-X capabilities

We now cache the MSI/MSI-X capability offsets in the struct pci_dev,
so no need to find the capabilities again.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
11 years agovfio-pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK
Bjorn Helgaas [Thu, 18 Apr 2013 18:42:58 +0000 (12:42 -0600)]
vfio-pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK

PCI_MSIX_FLAGS_BIRMASK is mis-named because the BIR mask is in the
Table Offset register, not the flags ("Message Control" per spec)
register.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
11 years agoUSB: ftdi_sio: enable two UART ports on ST Microconnect Lite
Adrian Thomasset [Wed, 24 Apr 2013 10:37:35 +0000 (11:37 +0100)]
USB: ftdi_sio: enable two UART ports on ST Microconnect Lite

The FT4232H used in the ST Micro Connect Lite has four hi-speed UART ports.
The first two ports are reserved for the JTAG interface.

We enable by default ports 2 and 3 as UARTs (where port 2 is a
conventional RS-232 UART)

Signed-off-by: Adrian Thomasset <adrian.thomasset@st.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoTools: hv: Fix a checkpatch warning
K. Y. Srinivasan [Wed, 24 Apr 2013 14:48:54 +0000 (07:48 -0700)]
Tools: hv: Fix a checkpatch warning

Fix a checkpatch warning.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agotools: hv: skip iso9660 mounts in hv_vss_daemon
Olaf Hering [Wed, 24 Apr 2013 14:48:53 +0000 (07:48 -0700)]
tools: hv: skip iso9660 mounts in hv_vss_daemon

fsreeze does not work for iso9660 filesystems. A ENOSUPP may be caught
in the freeze case, but the subsequent thaw call would fail and leads to
a false error.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agotools: hv: use FIFREEZE/FITHAW in hv_vss_daemon
Olaf Hering [Wed, 24 Apr 2013 14:48:52 +0000 (07:48 -0700)]
tools: hv: use FIFREEZE/FITHAW in hv_vss_daemon

As suggested by Paolo Bonzini, use ioctl instead of calling fsfreeze.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agotools: hv: use getmntent in hv_vss_daemon
Olaf Hering [Wed, 24 Apr 2013 14:48:51 +0000 (07:48 -0700)]
tools: hv: use getmntent in hv_vss_daemon

As suggested by Paolo Bonzini, use getmntent instead of parsing output
of mount(1).

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoTools: hv: Fix a checkpatch warning
K. Y. Srinivasan [Wed, 24 Apr 2013 14:48:50 +0000 (07:48 -0700)]
Tools: hv: Fix a checkpatch warning

Fix a checkpatch warning.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agotools: hv: fix checks for origin of netlink message in hv_vss_daemon
Olaf Hering [Wed, 24 Apr 2013 14:48:49 +0000 (07:48 -0700)]
tools: hv: fix checks for origin of netlink message in hv_vss_daemon

Similar to what commit 95a69adab9acfc3981c504737a2b6578e4d846ef ("tools:
hv: Netlink source address validation allows DoS") does in
hv_kvp_daemon, improve checks for origin of netlink connector message.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoTools: hv: fix warnings in hv_vss_daemon
Olaf Hering [Wed, 24 Apr 2013 14:48:48 +0000 (07:48 -0700)]
Tools: hv: fix warnings in hv_vss_daemon

This change fixes a few compile errors:

hv_vss_daemon.c:64:15: warning: unknown escape sequence '\/'
hv_vss_daemon.c:64:15: warning: unknown escape sequence '\/'
hv_vss_daemon.c: In function 'vss_operate':
hv_vss_daemon.c:66: warning: 'return' with no value, in function returning non-void
hv_vss_daemon.c: In function 'main':
hv_vss_daemon.c:130: warning: ignoring return value of 'daemon', declared with attribute warn_unused_result
hv_vss_daemon.c: In function 'vss_operate':
hv_vss_daemon.c:47: warning: 'fs_op' may be used uninitialized in this function

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoefi: Check EFI revision in setup_efi_vars
Josh Boyer [Wed, 24 Apr 2013 15:16:52 +0000 (11:16 -0400)]
efi: Check EFI revision in setup_efi_vars

We need to check the runtime sys_table for the EFI version the firmware
specifies instead of just checking for a NULL QueryVariableInfo.  Older
implementations of EFI don't have QueryVariableInfo but the runtime is
a smaller structure, so the pointer to it may be pointing off into garbage.

This is apparently the case with several Apple firmwares that support EFI
1.10, and the current check causes them to no longer boot.  Fix based on
a suggestion from Matthew Garrett.

Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
11 years agox86, efi: Fix a build warning
Borislav Petkov [Wed, 24 Apr 2013 10:09:14 +0000 (12:09 +0200)]
x86, efi: Fix a build warning

Fix this:

arch/x86/boot/compressed/eboot.c: In function ‘setup_efi_vars’:
arch/x86/boot/compressed/eboot.c:269:2: warning: passing argument 1 of ‘efi_call_phys’ makes pointer from integer without a cast [enabled by default]
In file included from arch/x86/boot/compressed/eboot.c:12:0:
/w/kernel/linux/arch/x86/include/asm/efi.h:8:33: note: expected ‘void *’ but argument is of type ‘long unsigned int’

after cc5a080c5d40 ("efi: Pass boot services variable info to runtime
code").

Reported-by: Paul Bolle <pebolle@tiscali.nl>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
11 years agofbdev/sgivwfb: use vm_iomap_memory()
Tomi Valkeinen [Thu, 18 Apr 2013 04:50:44 +0000 (07:50 +0300)]
fbdev/sgivwfb: use vm_iomap_memory()

Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agofbdev/vermillion: use vm_iomap_memory()
Tomi Valkeinen [Thu, 18 Apr 2013 04:47:47 +0000 (07:47 +0300)]
fbdev/vermillion: use vm_iomap_memory()

Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Alan Hourihane <alanh@fairlite.demon.co.uk>
11 years agofbdev/sa1100fb: use vm_iomap_memory()
Tomi Valkeinen [Wed, 17 Apr 2013 10:55:59 +0000 (13:55 +0300)]
fbdev/sa1100fb: use vm_iomap_memory()

Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
11 years agofbdev/fb-puv3: use vm_iomap_memory()
Tomi Valkeinen [Wed, 17 Apr 2013 10:48:43 +0000 (13:48 +0300)]
fbdev/fb-puv3: use vm_iomap_memory()

Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
11 years agofbdev/controlfb: use vm_iomap_memory()
Tomi Valkeinen [Wed, 17 Apr 2013 10:44:19 +0000 (13:44 +0300)]
fbdev/controlfb: use vm_iomap_memory()

Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agofbdev/omapfb: use vm_iomap_memory()
Tomi Valkeinen [Wed, 17 Apr 2013 10:05:07 +0000 (13:05 +0300)]
fbdev/omapfb: use vm_iomap_memory()

Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agostaging: comedi: ni_labpc: fix legacy driver build
H Hartley Sweeten [Tue, 23 Apr 2013 18:05:06 +0000 (11:05 -0700)]
staging: comedi: ni_labpc: fix legacy driver build

CONFIG_COMEDI_NI_LABPC_ISA is a tristate option. #if IS_ENABLED()
needs to be used instead of #ifdef in order to build the legacy
specific code in this driver.

The local variable 'board' is not used in labpc_attach(). Remove it.

The labpc_detach() function is only referenced in this file. Make
it static.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: phy: tegra: don't call into tegra-ehci directly
Arnd Bergmann [Tue, 23 Apr 2013 19:05:40 +0000 (21:05 +0200)]
usb: phy: tegra: don't call into tegra-ehci directly

Both phy-tegra-usb.c and ehci-tegra.c export symbols used by the other one,
which does not work if one of them or both are loadable modules, resulting
in an error like:

drivers/built-in.o: In function `utmi_phy_clk_disable':
drivers/usb/phy/phy-tegra-usb.c:302: undefined reference to `tegra_ehci_set_phcd'
drivers/built-in.o: In function `utmi_phy_clk_enable':
drivers/usb/phy/phy-tegra-usb.c:324: undefined reference to `tegra_ehci_set_phcd'
drivers/built-in.o: In function `utmi_phy_power_on':
drivers/usb/phy/phy-tegra-usb.c:447: undefined reference to `tegra_ehci_set_pts'

This turns the interface into a one-way dependency by letting the tegra ehci
driver pass two function pointers for callbacks that need to be called by
the phy driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Venu Byravarasu <vbyravarasu@nvidia.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agotty/serial/sirf: fix MODULE_DEVICE_TABLE
Arnd Bergmann [Tue, 23 Apr 2013 16:30:49 +0000 (18:30 +0200)]
tty/serial/sirf: fix MODULE_DEVICE_TABLE

This fixes building the sirfsorc-uart driver as a loadable module,
which uses an incorrect MODULE_DEVICE_TABLE, by changing the reference to the
correct symbol.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: cleanup the cio-das802/16 fifo comments
H Hartley Sweeten [Tue, 23 Apr 2013 01:38:26 +0000 (18:38 -0700)]
staging: comedi: das800: cleanup the cio-das802/16 fifo comments

Cleanup the comments about the cio-das802/16 specific register
defines. This also removes a checkpatch.pl warning about > 80
char lines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: rename CamelCase vars in das800_ai_do_cmd()
H Hartley Sweeten [Tue, 23 Apr 2013 01:38:06 +0000 (18:38 -0700)]
staging: comedi: das800: rename CamelCase vars in das800_ai_do_cmd()

Rename the CamelCase variables in das800_ai_do_cmd().

For aesthetic reasons, initialize the variables when they are
declared.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: tidy up the private data
H Hartley Sweeten [Tue, 23 Apr 2013 01:37:48 +0000 (18:37 -0700)]
staging: comedi: das800: tidy up the private data

For aesthetic reasons, change the 'do_bits' type to unsigned int
to match the subdevice s->state. and change the 'forever' flag
to a bool.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: tidy up das800_interrupt()
H Hartley Sweeten [Tue, 23 Apr 2013 01:37:29 +0000 (18:37 -0700)]
staging: comedi: das800: tidy up das800_interrupt()

Rename the CamelCase variable 'dataPoint'.

Cleanup some of the comments and fix the > 80 char lines.

Use the das800_ai_get_sample() helper to get the analog input data.

Change the fifo flags into bools and make sure to check for the
fifo overflow while reading the samples. This also fixes the overflow
detection for 12-bit resolutions. In the current code the 'dataPoint'
value has been shifted and masked. This could result in fifo_overflow
being invalidly true.

Remove the need for the 'thisboard' pointer by using the subdevice
'maxdata' to determine the sample size.

The devpriv->forever flag is really a bool. Treat it as such.

Remove the comedi_error() messages. The user will get the error
condition back in the async event. The message is just added noise.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: tidy up das800_ai_insn_read()
H Hartley Sweeten [Tue, 23 Apr 2013 01:37:03 +0000 (18:37 -0700)]
staging: comedi: das800: tidy up das800_ai_insn_read()

Introduce a couple helper functions to read the 16-bit analog input
sample and to wait for the analog conversion to complete.

Tidy up the das800_ai_insn_read() function by using the new helpers.
Also, remove the need for 'thisboard' in the function by checking the
subdevice 'maxdata' variable to determine the analog input resolution.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: tidy up das800_di_insn_bits()
H Hartley Sweeten [Tue, 23 Apr 2013 01:36:45 +0000 (18:36 -0700)]
staging: comedi: das800: tidy up das800_di_insn_bits()

For digital input subdevices, the (*insn_bits) function simply needs
to return the status of the input channels in data[1].

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: tidy up das800_do_insn_bits()
H Hartley Sweeten [Tue, 23 Apr 2013 01:36:28 +0000 (18:36 -0700)]
staging: comedi: das800: tidy up das800_do_insn_bits()

Use a couple local variables, mask and bits, to clarify this function.

Its only necessary to update the outputs if the mask indicates that
the bits are changing. Modify this function accordingly. Also, use
the subdevice 'state' variable to hold the actual output channel
state instead of needing to get it from the private data and shift
it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: remove extra divisor calculation call
H Hartley Sweeten [Tue, 23 Apr 2013 01:36:11 +0000 (18:36 -0700)]
staging: comedi: das800: remove extra divisor calculation call

The comedi core always calls the (*do_cmdtest) function before it
calls the (*do_cmd) function. The divisors were already calculated
in das800_ai_do_cmdtest(), it is not necessary to calculate them
again in das800_ai_do_cmd().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: rename {enable,disable}_das800
H Hartley Sweeten [Tue, 23 Apr 2013 01:35:49 +0000 (18:35 -0700)]
staging: comedi: das800: rename {enable,disable}_das800

For aesthetic reasons, rename these functions to match the namespace
of the rest of the driver. Also, remove the unnecessary comments.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: tidy up subdevice init
H Hartley Sweeten [Tue, 23 Apr 2013 01:35:31 +0000 (18:35 -0700)]
staging: comedi: das800: tidy up subdevice init

For aesthetic reasons, rename some of the subdevice functions
to help with greps and add some whitespace to the subdevice init.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: allow attaching without interrupt support
H Hartley Sweeten [Tue, 23 Apr 2013 01:35:12 +0000 (18:35 -0700)]
staging: comedi: das800: allow attaching without interrupt support

Interrupts are only requires for the analog input async command support.

Allow the driver to attach to the board if the request_irq() fails.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: interrupts are required for async command support
H Hartley Sweeten [Tue, 23 Apr 2013 01:34:54 +0000 (18:34 -0700)]
staging: comedi: das800: interrupts are required for async command support

Interrupt support is optional with this driver. Only hook up the async
command support for the analog input subdevice if the user requested an
interrupt when attaching to the board. This also allows removing the
extra test in das800_ai_do_cmd().

For aesthetic reasons, add some whitespace to the subdevice init.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: tidy up das800_ai_do_cmdtest()
H Hartley Sweeten [Tue, 23 Apr 2013 01:34:35 +0000 (18:34 -0700)]
staging: comedi: das800: tidy up das800_ai_do_cmdtest()

For aesthetic reasons, move some of the local variables to the place
they are actually used. Also, rename the CamelCase 'startChan' local
variable.

Remove the unnecessary '()' around the variables passed in the
i8253_cascade_ns_to_timer_2div() call.

Add a local variable, 'next', to hold the cmd->chanlist[i] value
used in the loop that checks the channel/gain list.

Replace the comedi_error() with dev_dbg() and shorten the messages
a bit.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: remove 'volatile' on private data variables
H Hartley Sweeten [Tue, 23 Apr 2013 01:34:19 +0000 (18:34 -0700)]
staging: comedi: das800: remove 'volatile' on private data variables

As indicated by checkpatch.pl, "WARNING: Use of volatile is usually
wrong: ...". The variables in the private data that are marked
volatile don't need to be. Remove the volatile.

Also, cleanup the comments to avoid > 80 char lines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: cleanup the boardinfo
H Hartley Sweeten [Tue, 23 Apr 2013 01:34:00 +0000 (18:34 -0700)]
staging: comedi: das800: cleanup the boardinfo

For aesthetic reasons, name the enum used for the boardinfo indexes
and change them to uppercase with the prefix BOARD_.

Add some whitespace to the boardinfo declaration and use the enum
values to clarify the table.

Tidy up the das800_probe() function and only output a dev_dbg()
message if a board model is actually probed. If the user provided
the correct boardname when attaching to this driver the message
is just added noise.

For the 'default' case when checking the proded id, output the
id_bits and return -EINVAL. It should not be assumed that unknown
boards will work with this driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: cleanup range table declarations
H Hartley Sweeten [Tue, 23 Apr 2013 01:33:41 +0000 (18:33 -0700)]
staging: comedi: das800: cleanup range table declarations

Use the BIP_RANGE and UNI_RANGE macros to define the range
tables instead of the more generic RANGE macro.

Tidy up the whitespace of the tables.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: introduce das800_ind_{write, read}()
H Hartley Sweeten [Tue, 23 Apr 2013 01:33:22 +0000 (18:33 -0700)]
staging: comedi: das800: introduce das800_ind_{write, read}()

The GAS800_GAIN register contains some bits that enable indirect
writing to additional registers on the board through iobase + 2
and indirect reading of addition registers through iobase + 7.

Introduce some helper functions to handle the indirect register
write/read.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: remove forward declarations
H Hartley Sweeten [Tue, 23 Apr 2013 01:33:03 +0000 (18:33 -0700)]
staging: comedi: das800: remove forward declarations

Move the das800_cancel() and das800_interrupt() functions to remove
the need for the remaining forward declarations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: move das800_set_frequency()
H Hartley Sweeten [Tue, 23 Apr 2013 01:32:43 +0000 (18:32 -0700)]
staging: comedi: das800: move das800_set_frequency()

Move das800_set_frequency() to avoid the need for the forward
declaration.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: move das800_probe()
H Hartley Sweeten [Tue, 23 Apr 2013 01:32:25 +0000 (18:32 -0700)]
staging: comedi: das800: move das800_probe()

For aesthetic reasons, move the das800_probe() function near its
only caller, das800_attach().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: move das800_attach()
H Hartley Sweeten [Tue, 23 Apr 2013 01:32:06 +0000 (18:32 -0700)]
staging: comedi: das800: move das800_attach()

The move the das800_attach() function near the comedi_driver
declaration at the end of the file. This also removes the need
for some of the forward declarations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: das800: move module_{init, exit} to end of file
H Hartley Sweeten [Tue, 23 Apr 2013 01:31:47 +0000 (18:31 -0700)]
staging: comedi: das800: move module_{init, exit} to end of file

The module_comedi_driver() macro provides the module_{init.exit}
code for this driver. Move the macro call and the comedi_driver
declaration to the end of the file. This also removes the need
for the das800_attach() forward declaration.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: video: imx: Add BGR666 support for parallel display
Marek Vasut [Mon, 22 Apr 2013 21:19:31 +0000 (23:19 +0200)]
staging: video: imx: Add BGR666 support for parallel display

Support the BGR666 format on the IPUv3 parallel display.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: add platform device bindings
Matthijs Kooijman [Mon, 22 Apr 2013 21:00:19 +0000 (14:00 -0700)]
staging: dwc2: add platform device bindings

This adds a dwc_platform.ko module that can be loaded by using
compatible = "snps,dwc2" in a device tree.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: check for null pointer before dereferencing it
Paul Zimmerman [Mon, 22 Apr 2013 21:00:18 +0000 (14:00 -0700)]
staging: dwc2: check for null pointer before dereferencing it

We were testing qtd->urb pointer for null after we had already
dereferenced it

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: add missing newlines to debug messages
Paul Zimmerman [Mon, 22 Apr 2013 21:00:17 +0000 (14:00 -0700)]
staging: dwc2: add missing newlines to debug messages

A few debug messages were missing newlines, add them

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: fix potential null pointer access
Paul Zimmerman [Mon, 22 Apr 2013 21:00:16 +0000 (14:00 -0700)]
staging: dwc2: fix potential null pointer access

We were testing hsotg pointer for null after we had already
dereferenced it

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: remove 'bustype' from boardinfo
H Hartley Sweeten [Mon, 22 Apr 2013 19:34:34 +0000 (12:34 -0700)]
staging: comedi: ni_labpc: remove 'bustype' from boardinfo

The 'bustype' in the boardinfo is not used. Remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: remove unnecessary 'bustype' check
H Hartley Sweeten [Mon, 22 Apr 2013 19:34:13 +0000 (12:34 -0700)]
staging: comedi: ni_labpc: remove unnecessary 'bustype' check

Only the ISA versions of the LabPC boards support DMA and the
devpriv->dma_chan is only set during the ISA board attach if
DMA is available. The extra check of the board->bustype is not
necessary in labpc_ai_cmd().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: pass the isr_flags to labpc_common_attach()
H Hartley Sweeten [Mon, 22 Apr 2013 19:33:53 +0000 (12:33 -0700)]
staging: comedi: ni_labpc: pass the isr_flags to labpc_common_attach()

The PCI and PCMCIA LabPC boards use shared interrupts and need the
IRQF_SHARED flag set when requesting the irq, the ISA boards do not.

Instead of checking the 'bustype' in labpc_common_attach() in order
to determine the isr_flags, just pass the flags as a parameter to the
function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: move DMA init out of the common attach
H Hartley Sweeten [Mon, 22 Apr 2013 19:33:30 +0000 (12:33 -0700)]
staging: comedi: ni_labpc: move DMA init out of the common attach

Only the ISA versions of the LabPC boards support DMA. Move the DMA
initialization out of the labpc_common_attach() and put it in the
ISA specific labpc_attach() function.

Remove the 'dma_chan' parameter from labpc_common_attach().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: split out PCI support
H Hartley Sweeten [Mon, 22 Apr 2013 19:33:09 +0000 (12:33 -0700)]
staging: comedi: ni_labpc: split out PCI support

Currently the ni_labpc driver is used by the legacy (ISA), PCI, and
PCMCIA versions of the LabPC board. The driver is enabled under the
COMEDI_PCI_DRIVERS section of the Kconfig. This means that PCI support
must be enabled in order to use the ni_labpc driver for the PCI or
PCMCIA drivers.

Split the PCI support code out of the ni_labpc driver into a separate
driver, ni_labpc_pci. The PCMCIA support is already slip out as
ni_labpc_cs.

Modify the Kconfig so that the common code in ni_labpc is enabled by the
Kconfig option COMEDI_NI_LABPC. The ISA support code is currently still
in the ni_labpc driver but is only compiled in if COMEDI_NI_LABPC_ISA is
also enabled.

This allows the PCI and PCMCIA drivers to be enabled without the need
for the ISA stuff.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi/daqboard2000: use mdelay for large delays
Arnd Bergmann [Tue, 23 Apr 2013 16:30:47 +0000 (18:30 +0200)]
staging: comedi/daqboard2000: use mdelay for large delays

On ARM, it is not legal to pass values larger than 2ms into udelay(),
and mdelay() must be used instead, to avoid this build error:

ERROR: "__bad_udelay" [drivers/staging/comedi/drivers/daqboard2000.ko]
undefined!

On a related note, any use of mdelay() or large udelay() numbers should
be carefully reviewed, and replaced with msleep() or a different
implementation that does not rely on delaying the work.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: nvec: allow modular build
Arnd Bergmann [Tue, 23 Apr 2013 16:30:46 +0000 (18:30 +0200)]
staging: nvec: allow modular build

The serio code can be a loadable module, which in turn means that nvec
also has to be a module, so mark it as "tristate" in Kconfig.

drivers/built-in.o: In function `nvec_mouse_remove':
drivers/staging/nvec/nvec_ps2.c:136: undefined reference to `serio_unregister_port'
drivers/built-in.o: In function `nvec_mouse_probe':
drivers/staging/nvec/nvec_ps2.c:126: undefined reference to `__serio_register_port'
drivers/built-in.o: In function `nvec_ps2_notifier':
drivers/staging/nvec/nvec_ps2.c:84: undefined reference to `serio_interrupt'
drivers/staging/nvec/nvec_ps2.c:91: undefined reference to `serio_interrupt'

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/zsmalloc: don't use pgtable-mapping from modules
Arnd Bergmann [Tue, 23 Apr 2013 16:30:48 +0000 (18:30 +0200)]
staging/zsmalloc: don't use pgtable-mapping from modules

Building zsmalloc as a module does not work on ARM because it uses
an interface that is not exported:

ERROR: "flush_tlb_kernel_range" [drivers/staging/zsmalloc/zsmalloc.ko] undefined!

Since this is only used as a performance optimization and only on ARM,
we can avoid the problem simply by not using that optimization when
building zsmalloc it is a loadable module.

flush_tlb_kernel_range is often an inline function, but out of the
architectures that use an extern function, only powerpc exports
it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agomisc: mark spear13xx-pcie-gadget as broken
Arnd Bergmann [Tue, 23 Apr 2013 16:30:45 +0000 (18:30 +0200)]
misc: mark spear13xx-pcie-gadget as broken

This driver was merged in 2.6.38 but never actually compiled because
it depends on the <mach/pcie.h> header that has not made it into the
kernel. Starting with Linux-3.10, this results in "allyesconfig"
build errors, since spear13xx can now be enabled with the default
"multiplatform" platform on ARM. Let's mark it as broken for now.
If it doesn't get fixed, we can drop it completely.

Cc: Pratyush Anand <pratyush.anand@st.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Viresh Kumar <viresh.kumar@st.com>
Cc: Shiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agomei: fix krealloc() misuse in in mei_cl_irq_read_msg()
Wei Yongjun [Tue, 23 Apr 2013 02:44:35 +0000 (10:44 +0800)]
mei: fix krealloc() misuse in in mei_cl_irq_read_msg()

If krealloc() returns NULL, it doesn't free the original. So any code
of the form 'foo = krealloc(foo, ...);' is almost certainly a bug.

Introduced by commit fcb136e1ac5774909e0d85189f721b8dfa800e0f(mei: fix
reading large reposnes)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agomei: reduce flow control only for completed messages
Tomas Winkler [Tue, 23 Apr 2013 04:38:12 +0000 (07:38 +0300)]
mei: reduce flow control only for completed messages

This fixes bug when only first chunk of a large message split
by hbuf_max_len is written to the hardware.
All the consequent chunks will not get a new credit.

A regression introduced by the commit
0ef319c93cebff9f82bdd0cdbb298f2dd00acda8
mei: streamline write complete flow function

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: phy: phy core cannot yet be a module
Arnd Bergmann [Tue, 23 Apr 2013 15:54:32 +0000 (17:54 +0200)]
usb: phy: phy core cannot yet be a module

A lot of platform code calls into the usb phy core at the moment, which
does not work if it is built as a loadable module. This will hopefully
change when those platforms are all converted to DT based probing,
but for now, the easiest solution is to change it from "tristate"
to "bool".

This solves at least these ARM allmodconfig build errors:

arch/arm/mach-imx/built-in.o: In function `imx_otg_ulpi_create':
arch/arm/mach-imx/ulpi.c:117: undefined reference to `otg_ulpi_create'
arch/arm/mach-omap2/built-in.o: In function `usbhs_init_phys':
arch/arm/mach-omap2/usb-host.c:652: undefined reference to `usb_bind_phy'
arch/arm/mach-omap2/built-in.o: In function `omap_2430sdp_init':
arch/arm/mach-omap2/board-2430sdp.c:236: undefined reference to `usb_bind_phy'
arch/arm/mach-omap2/built-in.o: In function `omap3_beagle_init':
arch/arm/mach-omap2/board-omap3beagle.c:554: undefined reference to `usb_bind_phy'
arch/arm/mach-omap2/built-in.o: In function `devkit8000_init':
arch/arm/mach-omap2/board-devkit8000.c:596: undefined reference to `usb_bind_phy'
arch/arm/mach-omap2/built-in.o: In function `omap_ldp_init':
arch/arm/mach-omap2/board-ldp.c:379: undefined reference to `usb_bind_phy'
drivers/built-in.o: In function `ab8500_charger_probe':
drivers/power/ab8500_charger.c:3629: undefined reference to `usb_get_phy'
drivers/power/ab8500_charger.c:3706: undefined reference to `usb_put_phy'
drivers/built-in.o: In function `ab8500_charger_remove':
drivers/power/ab8500_charger.c:3411: undefined reference to `usb_put_phy'

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoUSB: Fix initconst in ehci driver
Andi Kleen [Mon, 22 Apr 2013 16:44:56 +0000 (09:44 -0700)]
USB: Fix initconst in ehci driver

Fix some of the initconst markings in the ehci driver(s).

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb-storage: CY7C68300A chips do not support Cypress ATACB
Tormod Volden [Sat, 20 Apr 2013 12:24:04 +0000 (14:24 +0200)]
usb-storage: CY7C68300A chips do not support Cypress ATACB

Many cards based on CY7C68300A/B/C use the USB ID 04b4:6830 but only the
B and C variants (EZ-USB AT2LP) support the ATA Command Block
functionality, according to the data sheets. The A variant (EZ-USB AT2)
locks up if ATACB is attempted, until a typical 30 seconds timeout runs
out and a USB reset is performed.

https://bugs.launchpad.net/bugs/428469

It seems that one way to spot a CY7C68300A (at least where the card
manufacturer left Cypress' EEPROM default vaules, against Cypress'
recommendations) is to look at the USB string descriptor indices.

A http://media.digikey.com/pdf/Data%20Sheets/Cypress%20PDFs/CY7C68300A.pdf
B http://www.farnell.com/datasheets/43456.pdf
C http://www.cypress.com/?rID=14189

Note that a CY7C68300B/C chip appears as CY7C68300A if it is running
in Backward Compatibility Mode, and if ATACB would be supported in this
case there is anyway no way to tell which chip it really is.

For 5 years my external USB drive has been locking up for half a minute
when plugged in and ata_id is run by udev, or anytime hdparm or similar
is run on it.

Finally looking at the /correct/ datasheet I think I found the reason. I
am aware the quirk in this patch is a bit hacky, but the hardware
manufacturers haven't made it easy for us.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoUSB: serial: option: Added support Olivetti Olicard 145
Filippo Turato [Sat, 20 Apr 2013 13:04:08 +0000 (15:04 +0200)]
USB: serial: option: Added support Olivetti Olicard 145

This adds PID for Olivetti Olicard 145 in option.c

Signed-off-by: Filippo Turato <nnj7585@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoUSB: ftdi_sio: correct ST Micro Connect Lite PIDs
Adrian Thomasset [Tue, 23 Apr 2013 11:46:29 +0000 (12:46 +0100)]
USB: ftdi_sio: correct ST Micro Connect Lite PIDs

The current ST Micro Connect Lite uses the FT4232H hi-speed quad USB
UART FTDI chip. It is also possible to drive STM reference targets
populated with an on-board JTAG debugger based on the FT2232H chip with
the same STMicroelectronics tools.

For this reason, the ST Micro Connect Lite PIDs should be
ST_STMCLT_2232_PID: 0x3746
ST_STMCLT_4232_PID: 0x3747

Signed-off-by: Adrian Thomasset <adrian.thomasset@st.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoMerge tag 'usb-for-v3.10-part2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Tue, 23 Apr 2013 16:14:09 +0000 (09:14 -0700)]
Merge tag 'usb-for-v3.10-part2' of git://git./linux/kernel/git/balbi/usb into usb-next

Felipe writes:

usb: urgent fixes for v3.10 merge window

Here are some late urgent fixes for v3.10 merge window.

All of these errors were introduced by recent commits
which are in linux-next.

f_obex, multi and cdc2 gadget drivers have learned to
return a proper error code when something goes wrong.

usb_bind_phy() was mistakenly placed into .init.text
section which caused Section mismatch warnings and undefined
reference compile errors.

f_source_sink had a copy-paste error which is now corrected.

g_zero got a memory leak plugged.

Two defconfigs got fixed to enable the newly introduced
CONFIG_USB_PHY.

11 years agoPCI: Remove "extern" from function declarations
Bjorn Helgaas [Thu, 18 Apr 2013 16:55:46 +0000 (10:55 -0600)]
PCI: Remove "extern" from function declarations

We had an inconsistent mix of using and omitting the "extern" keyword
on function declarations in header files.  This removes them all.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK
Bjorn Helgaas [Thu, 18 Apr 2013 00:10:07 +0000 (18:10 -0600)]
PCI: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK

PCI_MSIX_FLAGS_BIRMASK is mis-named because the BIR mask is in the
Table Offset register, not the flags ("Message Control" per spec)
register.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Drop msi_mask_reg() and remove drivers/pci/msi.h
Bjorn Helgaas [Wed, 17 Apr 2013 23:58:47 +0000 (17:58 -0600)]
PCI: Drop msi_mask_reg() and remove drivers/pci/msi.h

msi_mask_reg() doesn't provide any useful abstraction, do drop it.

Remove the now-empty drivers/pci/msi.h.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Use msix_table_size() directly, drop multi_msix_capable()
Bjorn Helgaas [Wed, 17 Apr 2013 23:44:48 +0000 (17:44 -0600)]
PCI: Use msix_table_size() directly, drop multi_msix_capable()

The users of multi_msix_capable() are really interested in the table
size, so just say what we mean.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Drop msix_table_offset_reg() and msix_pba_offset_reg() macros
Bjorn Helgaas [Wed, 17 Apr 2013 23:43:40 +0000 (17:43 -0600)]
PCI: Drop msix_table_offset_reg() and msix_pba_offset_reg() macros

msix_table_offset_reg() is used only once and adds a useless indirection,
so just use the table offset directly.

msix_pba_offset_reg() is unused, so just delete it.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Drop is_64bit_address() and is_mask_bit_support() macros
Bjorn Helgaas [Wed, 17 Apr 2013 23:42:30 +0000 (17:42 -0600)]
PCI: Drop is_64bit_address() and is_mask_bit_support() macros

is_64bit_address() and is_mask_bit_support() don't provide any useful
abstraction, so drop them.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Drop msi_data_reg() macro
Bjorn Helgaas [Wed, 17 Apr 2013 23:41:13 +0000 (17:41 -0600)]
PCI: Drop msi_data_reg() macro

msi_data_reg() doesn't provide any useful abstraction, so drop it.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Drop msi_lower_address_reg() and msi_upper_address_reg() macros
Bjorn Helgaas [Wed, 17 Apr 2013 23:39:57 +0000 (17:39 -0600)]
PCI: Drop msi_lower_address_reg() and msi_upper_address_reg() macros

msi_lower_address_reg() and msi_upper_address_reg() don't provide any
useful abstraction, so drop them.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Drop msi_control_reg() macro and use PCI_MSI_FLAGS directly
Bjorn Helgaas [Wed, 17 Apr 2013 23:38:32 +0000 (17:38 -0600)]
PCI: Drop msi_control_reg() macro and use PCI_MSI_FLAGS directly

Note the error in pci_msix_table_size() -- we used PCI_MSI_FLAGS to
locate the PCI_MSIX_FLAGS word.  No actual breakage because PCI_MSI_FLAGS
and PCI_MSIX_FLAGS happen to be the same.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Use cached MSI/MSI-X offsets from dev, not from msi_desc
Bjorn Helgaas [Wed, 17 Apr 2013 23:34:36 +0000 (17:34 -0600)]
PCI: Use cached MSI/MSI-X offsets from dev, not from msi_desc

We always know the type (MSI vs MSI-X), so we can use the correct
cached capability offset rather than relying on the copy in the
msi_attrib.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Clean up MSI/MSI-X capability #defines
Bjorn Helgaas [Wed, 17 Apr 2013 23:26:23 +0000 (17:26 -0600)]
PCI: Clean up MSI/MSI-X capability #defines

This doesn't change any existing symbols, but it puts them in logical
order and uses explicit masks instead of shifts, like the rest of the
file.

It also adds new symbols for PCI_MSIX_TABLE_BIR,
PCI_MSIX_TABLE_OFFSET, PCI_MSIX_PBA_BIR, and PCI_MSIX_PBA_OFFSET to
replace the mis-named PCI_MSIX_FLAGS_BIRMASK (the BAR index fields
are part of the Table and PBA registers, not the flags register).

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Use cached MSI-X cap while enabling MSI-X
Gavin Shan [Thu, 4 Apr 2013 16:54:33 +0000 (16:54 +0000)]
PCI: Use cached MSI-X cap while enabling MSI-X

The patch uses the cached MSI-X capability offset in
pci_dev instead of reading it from config space when enabling
MSI-X interrupts.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Use cached MSI cap while enabling MSI interrupts
Gavin Shan [Thu, 4 Apr 2013 16:54:32 +0000 (16:54 +0000)]
PCI: Use cached MSI cap while enabling MSI interrupts

The patch uses the cached MSI capability offset in pci_dev instead
of reading it from config space when enabling MSI interrupts.

[bhelgaas: removed unrelated msi_control_reg() changes]
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Remove MSI/MSI-X cap check in pci_msi_check_device()
Gavin Shan [Thu, 4 Apr 2013 16:54:31 +0000 (16:54 +0000)]
PCI: Remove MSI/MSI-X cap check in pci_msi_check_device()

The function pci_msi_check_device() is called while enabling MSI
or MSI-X interrupts to make sure the PCI device can support MSI
or MSI-X capability.  This patch removes the check on MSI or MSI-X
capability in the function and lets the caller do the check.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Cache MSI/MSI-X capability offsets in struct pci_dev
Gavin Shan [Thu, 4 Apr 2013 16:54:30 +0000 (16:54 +0000)]
PCI: Cache MSI/MSI-X capability offsets in struct pci_dev

The patch caches the MSI and MSI-X capability offset in PCI device
(struct pci_dev) so that we needn't read it from the config space
upon enabling or disabling MSI or MSI-X interrupts.

[bhelgaas: moved pm_cap size change to separate patch]
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
11 years agoPCI: Use u8, not int, for PM capability offset
Bjorn Helgaas [Wed, 17 Apr 2013 22:57:56 +0000 (16:57 -0600)]
PCI: Use u8, not int, for PM capability offset

The Power Management Capability (PCI_CAP_ID_PM == 0x01) is defined by PCI
and must appear in the 256-byte PCI Configuration Space from 0-0xff.  It
cannot be in the PCIe Extended Configuration space from 0x100-0xfff, so
we only need a u8 to hold its offset.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11 years agopinctrl: s3c64xx: Fix build error caused by undefined chained_irq_enter
Tomasz Figa [Tue, 16 Apr 2013 22:23:59 +0000 (00:23 +0200)]
pinctrl: s3c64xx: Fix build error caused by undefined chained_irq_enter

Commit de88cbb7 moved definitions of chained_irq_enter and
chained_irq_exit to a generic header, which must be now included instead
of the legacy arch-specific one.

This patch fixes build error caused by including the legacy header
leading to undefined chained_irq_enter and chained_irq_exit symbols.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: mxs_defconfig: add CONFIG_USB_PHY
Shawn Guo [Sun, 24 Mar 2013 14:06:05 +0000 (22:06 +0800)]
ARM: mxs_defconfig: add CONFIG_USB_PHY

Commit edc7cb2 (usb: phy: make it a menuconfig) makes USB_MXS_PHY
be a sub-item of menuconfig symbol USB_PHY.  This change gets the
selection of CONFIG_USB_MXS_PHY in mxs_defconfig lost.  Hence the
boot stops at the point below.

  [    1.600867] ci_hdrc ci_hdrc.0: doesn't support gadget
  [    1.606282] ci_hdrc ci_hdrc.0: EHCI Host Controller
  [    1.613522] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1

Add CONFIG_USB_PHY to have the CONFIG_USB_MXS_PHY selection back to
work.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agoARM: imx_v6_v7_defconfig: add CONFIG_USB_PHY
Shawn Guo [Sun, 24 Mar 2013 14:06:04 +0000 (22:06 +0800)]
ARM: imx_v6_v7_defconfig: add CONFIG_USB_PHY

Commit edc7cb2 (usb: phy: make it a menuconfig) makes USB_MXS_PHY
be a sub-item of menuconfig symbol USB_PHY.  This change gets the
selection of CONFIG_USB_MXS_PHY in imx_v6_v7_defconfig lost.  Hence the
boot stops at the point below.

  ci_hdrc ci_hdrc.0: doesn't support gadget
  ci_hdrc ci_hdrc.0: EHCI Host Controller
  ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1

Add CONFIG_USB_PHY to have the CONFIG_USB_MXS_PHY selection back to
work.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: phy: remove exported function from __init section
Denis Efremov [Thu, 18 Apr 2013 13:13:31 +0000 (17:13 +0400)]
usb: phy: remove exported function from __init section

The symbol usb_bind_phy is exported and annotated __init.
It looks like section mismatch. Fix by removing the
__init annotation of usb_bind_phy.

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

Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: zero: put function instances on unbind
Andrzej Pietrasiewicz [Thu, 18 Apr 2013 12:43:26 +0000 (14:43 +0200)]
usb: gadget: zero: put function instances on unbind

If function instances are not put on gadget's unbind, their implementation
module's refcount is nonzero and it is impossible to unload them.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: f_sourcesink.c: correct a copy-paste misnomer
Andrzej Pietrasiewicz [Thu, 18 Apr 2013 12:43:25 +0000 (14:43 +0200)]
usb: gadget: f_sourcesink.c: correct a copy-paste misnomer

acm was the first function to be converted and it seems that its
code served as a base for converting f_sourcesink to the new function
interface. source_sink has nothing to do with acm, though.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: cdc2: fix error return code in cdc_do_config()
Wei Yongjun [Sat, 6 Apr 2013 09:25:21 +0000 (17:25 +0800)]
usb: gadget: cdc2: fix error return code in cdc_do_config()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Introduced by commit 29a664 (usb: gadget: cdc2: use function
framework for ACM)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: multi: fix error return code in rndis_do_config()
Wei Yongjun [Sat, 6 Apr 2013 09:23:22 +0000 (17:23 +0800)]
usb: gadget: multi: fix error return code in rndis_do_config()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Introduced by commit 59835a (usb: gadget: multi: use
function framework for ACM.)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agousb: gadget: f_obex: fix error return code in obex_bind()
Wei Yongjun [Sat, 6 Apr 2013 04:39:49 +0000 (12:39 +0800)]
usb: gadget: f_obex: fix error return code in obex_bind()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
11 years agos390/uapi: change struct statfs[64] member types to unsigned values
Heiko Carstens [Mon, 22 Apr 2013 08:41:27 +0000 (10:41 +0200)]
s390/uapi: change struct statfs[64] member types to unsigned values

Kay Sievers reported that coreutils' stat tool has a problem with
s390's statfs[64] definition:

> The definition of struct statfs::f_type needs a fix. s390 is the only
> architecture in the kernel that uses an int and expects magic
> constants lager than INT_MAX to fit into.
>
> A fix is needed to make Fedora boot on s390, it currently fails to do
> so. Userspace does not want to add code to paper-over this issue.

[...]

> Even coreutils cannot handle it:
>   #define RAMFS_MAGIC  0x858458f6
>   # stat -f -c%t /
>   ffffffff858458f6
>
>   #define BTRFS_SUPER_MAGIC 0x9123683E
>   # stat -f -c%t /mnt
>   ffffffff9123683e

The bug is caused by an implicit sign extension within the stat tool:

out_uint_x (pformat, prefix_len, statfsbuf->f_type);

where the format finally will be "%lx".
A similar problem can be found in the 'tail' tool.
s390 is the only architecture which has an int type f_type member in
struct statfs[64]. Other architectures have either unsigned ints or
long values, so that the problem doesn't occur there.

Therefore change the type of the f_type member to unsigned int, so
that we get zero extension instead of sign extension when assignment to
a long value happens.

This patch changes the s390 uapi struct stafs[64] definition in the kernel
to contain only unsigned values.
This was true for 32 bit builds anyway, since we use the generic uapi
header file in that case. So lets not include conditionally the generic
uapi header file but have the s390 implementation completely independent.

Also fix the types of struct compat_stafs to match reality and move the
definition of struct compat_statfs64 to asm/compat.h since it is not part
of the api.

Reported-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/pci: return correct dma address for offset > PAGE_SIZE
Gerald Schaefer [Mon, 22 Apr 2013 17:27:17 +0000 (19:27 +0200)]
s390/pci: return correct dma address for offset > PAGE_SIZE

For offset > PAGE_SIZE, s390_dma_map_pages() will issue a warning
and return a wrong dma address.

This patch removes the warning and fixes the dma return address
calculation.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/ptrace: remove empty ifdefs
Heiko Carstens [Sat, 20 Apr 2013 12:07:29 +0000 (14:07 +0200)]
s390/ptrace: remove empty ifdefs

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/compat: remove ptrace compat definitions from uapi header file
Heiko Carstens [Sat, 20 Apr 2013 12:05:42 +0000 (14:05 +0200)]
s390/compat: remove ptrace compat definitions from uapi header file

The compat definitions are not part of the uapi. So move them to
s390's private compat header file.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/compat: fix compile error for !COMPAT
Heiko Carstens [Sat, 20 Apr 2013 12:25:42 +0000 (14:25 +0200)]
s390/compat: fix compile error for !COMPAT

Fix this one for !COMPAT:

compat.h: In function ‘arch_compat_alloc_user_space’:
compat.h:292:2: error: implicit declaration of function ‘is_compat_task’

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
11 years agos390/compat: fix compat_sys_statfs() memory corruption
Heiko Carstens [Sat, 20 Apr 2013 11:01:19 +0000 (13:01 +0200)]
s390/compat: fix compat_sys_statfs() memory corruption

The f_spare field within struct compat_statfs is four bytes larger
than within the native 31 bit struct statfs.
compat_sys_statfs() clears the f_spare field in user space which
means that in compat mode four bytes that are behind the user space
supplied struct compat_statfs will be corrupted (zeroed).

According to Thomas Gleixner's Linux 2.6 history tree this bug is
present since v2.5.74 87880da124 "[PATCH] s390: 31 bit compat.".
So it get's fixed shortly before its 10th anniversary. Tough luck.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>