Commit graph

287115 commits

Author SHA1 Message Date
Stephen Warren 2123552d12 ARM: tegra: Remove use of TEGRA_GPIO_TO_IRQ
Replace compile-time usage of TEGRA_GPIO_TO_IRQ with run-time calls to
gpio_to_irq(). This will allow the base IRQ number for the Tegra GPIO
driver to be dynamically allocated in a later patch.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:25:00 -08:00
Stephen Warren 6d7d7b3ecd ARM: tegra: Pass uncompress.h UART selection to DEBUG_LL
uncompress.h now saves the selected UART's physical address in Tegra's
IRAM, along with a cookie to indicate validity.

The first time it's run, macro addruart in debug-macro.S looks for this
cookie, and if it's present, uses the UART address stored there. If not,
the static value TEGRA_DEBUG_UART_BASE is used, as was previous behaviour.
The static behaviour will thus be used when not booting using a zImage.

This work was inspired by work by Doug Anderson <dianders@chromium.org>;
see http://lkml.org/lkml/2011/9/26/284. However, this patch relies on
the data passing describe above, rather than duplicating the UART
selection logic in debug-macro.S; the latest selection logic is more
complex due to the need to check reset/clock bits too.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Doug Anderson <dianders@chromium.org>
Acked-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:25:00 -08:00
Stephen Warren fe2639892c ARM: tegra: uncompress.h: Choose a UART at runtime
With this change we automatically detect which UART to use for
for printing during decompression. The detection involves coordination
with the bootloader: it's expected that the bootloader will leave a
'D' (for [D]ebug) in the UART scratchpad register for whichever UART we
should use for debugging.

If we don't find any such UART, we fall back to the UART that was
specified during config time: CONFIG_TEGRA_DEBUG_UART_XXX.

As a side effect of this change, uncompress debug messages will work
if you've specified CONFIG_TEGRA_DEBUG_UART_NONE, provided the
bootloader obeys the protocol.

This change is in line with what is documented in
Documentation/arm/Booting.

Other approaches considered:
* Hardcode based on machine ID (as many other ARM boards do).
  OK, but nice to not have yet another place to add per-board
  code. Better to have bootloader parse device tree and pass us
  this info.
* Check for TXE bit (like SA1110). Nice (and doesn't require
  a bootloader change), but a little less explicit. Also: if
  bootloader (for some reason) uses another UART, it needs to
  remember to turn it off before jumping to the kernel or we may
  print to it. NOTE: adapting this patch to check TXE too would
  be easy if desired.

Signed-off-by: Doug Anderson <dianders@chromium.org>
[swarren: Added clock/reset condition checks]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Doug Anderson <dianders@chromium.org>
Acked-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:25:00 -08:00
Doug Anderson 31bac1375b ARM: tegra: uncompress.h: Store UART address in a variable
This will allow a future change to auto-detect which UART to use.

Signed-off-by: Doug Anderson <dianders@chromium.org>
[swarren: Extracted from a larger patch by Doug]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Doug Anderson <dianders@chromium.org>
Acked-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:25:00 -08:00
Doug Anderson 229c7b22a2 ARM: tegra: Introduce define DEBUG_UART_SHIFT
This removes the need for the variable "shift" in all functions in
uncompress.h.

Signed-off-by: Doug Anderson <dianders@chromium.org>
[swarren: Extracted from a larger patch by Doug]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Doug Anderson <dianders@chromium.org>
Acked-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:24:59 -08:00
Stephen Warren e53b7d87cc ARM: tegra: Support Tegra30 in decompressor UART setup
On Tegra20, the UART clock runs at 216MHz, whereas on Tegra30 it runs at
408MHz. Modify arch_decomp_setup() to detect Tegra20-vs-Tegra30 at run-
time, and program the correct divisor.

This makes uncompressor messages work correctly on Tegra30. This also
fixes early printk, assuming zImage is used and this setup code runs.

v2: Use CHIPID register to differentiate between chips, rather than a
GIC register. This should be more future-proof. Volatile is required
to prevent the compiler transforming the 32-bit apb_misc register read
into an 8-bit read of address 1 higher, since the HW only supports 32-
bit accesses, and will hang on an 8-bit access.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:24:59 -08:00
Laxman Dewangan cb3732d0dc ARM: tegra: Pause DMA when reading transfer count
In order to read an accurate channel transfer count
from the APB DMA engine, the DMA controller must be
paused first.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:24:59 -08:00
Olof Johansson 941b8db1df ARM: tegra: emc: device tree support
Add device tree support to the emc driver, filling in the platform data
based on the DT bindings.

Changes since v1:

* Unmangled some messed up patch squashes, moving changes to earlier patches
* Flipped an of_property_read_u32 return value test
* Clarified clock settings message on case where no table is provided

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Stephen Warren <swarren@nvidia.com>
2012-02-06 18:24:59 -08:00
Olof Johansson 17711dbf47 ARM: tegra: emc: convert tegra2_emc to a platform driver
This is the first step in making it device-tree aware and get rid of the
in-kernel EMC tables (of which there are none in mainline, thankfully).

Changes since v3:

* moved to devm_request_and_ioremap() in probe()

Changes since v2:

* D'oh -- missed a couple of variables that were added, never used and then
  later removed in a later patch.

Changes since v1:

* Fixed messed up indentation
* Removed code that should be gone (was added here and removed later in series)

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Stephen Warren <swarren@nvidia.com>
2012-02-06 18:24:59 -08:00
Olof Johansson dee4718330 ARM: tegra: fuse: add bct strapping reading
This is used by the memory setup code to pick the right memory
timing table, if needed.

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:24:59 -08:00
Olof Johansson 9a1086da34 ARM: tegra: fuse: add functions to access chip revision
Add function to get chip revision, and print it out at boot time.

Restructure the fuse access to just use cached variables instead
of always reading the fuses, and export those variables directly
instead of using accessor functions.

Add a SKU ID table of currently known values.

Based on code originally by Colin Cross <ccross@android.com>.

Changes since v1:

* Add A01 minor rev support
* Don't decode for A03p on anything but T2x

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Stephen Warren <swarren@nvidia.com>
2012-02-06 18:24:59 -08:00
Olof Johansson d262f49d10 ARM: tegra: fuse: use apbio dma for register access
Use the apbio dma functions for accessing the fuse registers.

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:24:58 -08:00
Olof Johansson e2f91578b3 ARM: tegra: use APB DMA for accessing APB devices
Tegra2 hangs if APB registers are accessed from the cpu during an
apb dma operation. The workaround is to use apb dma to read/write the
registers instead.

There is a dependency loop between fuses, clocks, and APBDMA.  If dma
is enabled, fuse reads must go through APBDMA to avoid corruption due
to a hw bug.  APBDMA requires a clock to be enabled.  Clocks must read
a fuse to determine allowable cpu frequencies.

Separate out the fuse DMA initialization, and allow the fuse read
and write functions to be called without using DMA before the DMA
initialization has been completed.  Access to the fuses before APBDMA
is initialized won't hit the hardware bug because nothing else can be
using DMA.

Original fuse registar access code from Varun Wadekar
<vwadekar@nvidia.com>, improved by Colin Cross <ccross@android.com>
and later moved to separate driver by Jon Mayo <jmayo@nvidia.com>.

Major refactoring/cleanup by Olof Johansson <olof@lixom.net>.

Changes since v1:

* fix 'return false' on error condition
* dequeue dma ops in case of timeout

From: Jon Mayo <jmayo@nvidia.com>.
Signed-off-by: Jon Mayo <jmayo@nvidia.com>.
Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Stephen Warren <swarren@nvidia.com>
2012-02-06 18:24:58 -08:00
Olof Johansson 13ae3d5bdf ARM: tegra: Don't WARN_ON() for too early dma channel allocations
Since we'll do opportunistic allocations before the dma subsystem is
enabled we want just silent failures and retries instead.

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:24:58 -08:00
Leon Romanovsky 07d4563e58 ARM: dt: tegra: Enable headset autodetection on PAZ00 board.
This patch is adding device tree support of headset autodetection on PAZ00 board.

Signed-off-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:51 -08:00
Leon Romanovsky 613e9657df ARM: dt: tegra: Enable device tree audio codec on PAZ00 board.
This patch adds initial device tree support of ALC5632 sound codec and
machine driver for PAZ00 board. The implementation is based on the WM8903 codec.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:42 -08:00
Stephen Warren d17adfdb17 ARM: dt: Add binding for Tegra PMC
The Tegra PMC (Power Management Controller) interfaces with an external
PMU (Power Management Unit), and controls wake-up from sleep modes.

This initial binding is the bare minimum required to control the PMC's
inversion of the PMU's interrupt signal.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:21 -08:00
Stephen Warren 797acf705b ARM: dt: tegra: Enable audio on WM8903 boards, disable others
Add complete bindings to instantiate and configure the codec and
top-level audio complex on all currently supported boards using the
Tegra+WM8903 audio driver.

On those boards, disable the I2S2 controller since it isn't used.

On boards not using the WM8903 codec, disable all the audio devices;
they can be re-enabled once the relevant codec and ASoC machine drivers
have been ported to device-tree.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:21 -08:00
Stephen Warren c404af0a16 ARM: dt: tegra: Add labels for I2S controllers
This will allow the sound node to refer to the I2S controllers by name
when creating phandles.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:21 -08:00
Stephen Warren 5c8ee3120e ARM: dt: tegra: Modify I2S nodes to match binding
Adjust the dma-channel property name to match the binding implemented by
the driver. The binding was implemented and documented in a
separate change to the ASoC tree.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:20 -08:00
Stephen Warren 8051b75ab3 ARM: dt: tegra: Add Tegra APB DMA device tree binding
Document binding, and add the node to tegra*.dtsi.

The driver isn't actually instantiated from this node yet, but the I2S
binding will rely on being able to refer to the APB DMA node using a
phandle.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:20 -08:00
Stephen Warren f8196b01b9 ARM: dt: tegra30.dtsi: Add extra GPIO interrupt
The Tegra30 GPIO controller has one more bank than Tegra20, and hence
has one more interrupt.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:19 -08:00
Stephen Warren 636e50a0e0 ARM: dt: tegra30.dtsi: Reformat gpio's interrupts property
The new content matches tegra20.dtsi, and is < 80 columns.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:19 -08:00
Stephen Warren a38b84fce9 dt: tegra gpio: Flesh out binding documentation
Document the required reg and interrupts properties.
Add a complete example.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:19 -08:00
Olof Johansson d8017a975c ARM: tegra: seaboard: add EMC table to device tree
Timings for the T25 version of seaboard, only one memory manufacturer
and timing table (two speeds).

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-02-06 18:21:18 -08:00
Olof Johansson 0c6700abfa ARM: tegra: emc: device tree bindings
Device tree bindings for the EMC tables on tegra.

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
2012-02-06 18:21:18 -08:00
Linus Torvalds 62aa2b537c Linux 3.3-rc2 2012-01-31 13:31:54 -08:00
Linus Torvalds d3712b9dfc Pull request from git://github.com/prasad-joshi/logfs_upstream.git
There are few important bug fixes for LogFS
 
 Shortlog:
 Joern Engel (5):
      logfs: Prevent memory corruption
      logfs: remove useless BUG_ON
      logfs: Free areas before calling generic_shutdown_super()
      logfs: Grow inode in delete path
      Logfs: Allow NULL block_isbad() methods
 
 Prasad Joshi (5):
      logfs: update page reference count for pined pages
      logfs: take write mutex lock during fsync and sync
      logfs: set superblock shutdown flag after generic sb shutdown
      logfs: Propagate page parameter to __logfs_write_inode
      MAINTAINERS: Add Prasad Joshi in LogFS maintiners
 
 Diffstat:
  MAINTAINERS          |    1 +
  fs/logfs/dev_mtd.c   |   26 +++++++++++-------------
  fs/logfs/dir.c       |    2 +-
  fs/logfs/file.c      |    2 +
  fs/logfs/gc.c        |    2 +-
  fs/logfs/inode.c     |    4 ++-
  fs/logfs/journal.c   |    1 -
  fs/logfs/logfs.h     |    5 +++-
  fs/logfs/readwrite.c |   51 +++++++++++++++++++++++++++++++++----------------
  fs/logfs/segment.c   |   51 ++++++++++++++++++++++++++++++++++++++-----------
  fs/logfs/super.c     |    3 +-
  11 files changed, 99 insertions(+), 49 deletions(-)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPKByhAAoJEDFA/f+3K+ZNQSUP/3gACcIwcsl+FnXPWBtz9XIG
 g0DjXoRDd/sR0u25nLgjCVdBJgx5FVEyA+PvLgvvUU2KCAsqI5F/EQ+fLJs21YEN
 TzepBO5aHtFZbNEjo6WiXOlDbBePTtk44WrN6jqoCHM/aDeT4Wof3NZBmHWNN1PX
 B2RtEZ0ypJ7/b1OY2LUNcQfTaJXNgVoP8Hkx4KGY5LUVxVrBXxvDTU7YbkS8a+ys
 1Yje/EQ4XD4RyZB42TmFEuTenvGPRgMGVFdnkJKuON8EmJQ8Hc61jEf5d7Q8sWef
 dH5F/ptoAaR9a9LbbO8LoYuBZ8MR8848NPsrNPpr/gWntj46Z79yII8Jr7YoSDyw
 zq5G2dZbwlbVrtVWKGae47THkNB8bljR/g4cijvPAkvuIAku6mg+dgjVHAhZ/t+J
 xu8+Gy2sWHUH2gmoSXuoNyppOvYpPIRd5RB16PizMH3bw+sMad2K8/rfOKnmF1/r
 HTM2jZ5bDcHVDjSuVI6u2m/mQX+PmPXUTffreaFXuSI75YpT0dqN3nponTX4EgFI
 Ad9ZBQvdg8w1LGDsNxIAaqrGx4Q87RxqfUV4W/wo6N8gKsp+I2y4GtYMeD/CEKyi
 wncKg10YwoMXZj7cBAkWgPlgrOBYCPwYZc/1DVRHvqrHo/m13SJrWDKkNKVvoXzH
 2y4Tfi5w1WDRUT7yeoyK
 =TA1A
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream

There are few important bug fixes for LogFS

* tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream:
  Logfs: Allow NULL block_isbad() methods
  logfs: Grow inode in delete path
  logfs: Free areas before calling generic_shutdown_super()
  logfs: remove useless BUG_ON
  MAINTAINERS: Add Prasad Joshi in LogFS maintiners
  logfs: Propagate page parameter to __logfs_write_inode
  logfs: set superblock shutdown flag after generic sb shutdown
  logfs: take write mutex lock during fsync and sync
  logfs: Prevent memory corruption
  logfs: update page reference count for pined pages

Fix up conflict in fs/logfs/dev_mtd.c due to semantic change in what
"mtd->block_isbad" means in commit f2933e86ad: "Logfs: Allow NULL
block_isbad() methods" clashing with the abstraction changes in the
commits 7086c19d07: "mtd: introduce mtd_block_isbad interface" and
d58b27ed58: "logfs: do not use 'mtd->block_isbad' directly".

This resolution takes the semantics from commit f2933e86ad, and just
makes mtd_block_isbad() return zero (false) if the 'block_isbad'
function is NULL.  But that also means that now "mtd_can_have_bb()"
always returns 0.

Now, "mtd_block_markbad()" will obviously return an error if the
low-level driver doesn't support bad blocks, so this is somewhat
non-symmetric, but it actually makes sense if a NULL "block_isbad"
function is considered to mean "I assume that all my blocks are always
good".
2012-01-31 09:23:59 -08:00
Linus Torvalds c5d2bc1103 Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (w83627ehf) Disable setting DC mode for pwm2, pwm3 on NCT6776F
  hwmon: (sht15) fix bad error code
  MAINTAINERS: Drop maintainer for MAX1668 hwmon driver
  MAINTAINERS: Add hwmon entries for Wolfson
  hwmon: (f71805f) Fix clamping of temperature limits
2012-01-30 17:08:40 -08:00
Linus Torvalds 8e2a2880a5 Merge branch 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Here are some fixes to the pin control system that has accumulated since
-rc1.  Mainly Tony Lindgren fixed the module load/unload logic and the
rest are minor fixes and documentation.

* 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: add checks for empty function names
  pinctrl: fix pinmux_hog_maps when ctrl_dev_name is not set
  pinctrl: fix some pinmux typos
  pinctrl: free debugfs entries when unloading a pinmux driver
  pinctrl: unbreak error messages
  Documentation/pinctrl: fix a few syntax errors in code examples
  pinctrl: fix pinconf_pins_show iteration
2012-01-30 17:06:26 -08:00
Linus Torvalds 27ba234c8d Here are some tty/serial patches for 3.3-rc1
Big thing here is the movement of the 8250 serial drivers to their own
 directory, now that the patch churn has calmed down.
 
 Other than that, only minor stuff (omap patches were reverted as they
 were found to be wrong), and another broken driver removed from the
 system.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iEYEABECAAYFAk8nB3wACgkQMUfUDdst+ykJAgCeKirJzWs6KrXMX6TWSabSvvsX
 xbUAn2mnT+UooWSDawrACknkDsQ7y41n
 =9tuj
 -----END PGP SIGNATURE-----

Merge tag 'tty-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Here are some tty/serial patches for 3.3-rc1

Big thing here is the movement of the 8250 serial drivers to their own
directory, now that the patch churn has calmed down.

Other than that, only minor stuff (omap patches were reverted as they
were found to be wrong), and another broken driver removed from the
system.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

* tag 'tty-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: Kill off Moorestown code
  Revert "tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode"
  Revert "tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip"
  serial: Fix wakeup init logic to speed up startup
  docbook: don't use serial_core.h in device-drivers book
  serial: amba-pl011: lock console writes against interrupts
  amba-pl011: do not disable RTS during shutdown
  tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip
  tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode
  omap-serial: make serial_omap_restore_context depend on CONFIG_PM_RUNTIME
  omap-serial :Make the suspend/resume functions depend on CONFIG_PM_SLEEP.
  TTY: fix UV serial console regression
  jsm: Fixed EEH recovery error
  Updated TTY MAINTAINERS info
  serial: group all the 8250 related code together
2012-01-30 15:17:21 -08:00
Linus Torvalds 6bc2b95ee6 Here are a bunch of USB patches for 3.3-rc1.
Nothing major, largest thing here is the removal of some drivers that
 did not work at all.  Other than that, the normal collection of bugfixes
 and new device ids.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iEYEABECAAYFAk8m8JEACgkQMUfUDdst+ymCFQCeNhTHopHy1PQbuCDwk8bSH4DW
 1/YAn2k0YaaCrOo0HCzOslAVX18vGnWl
 =TNNB
 -----END PGP SIGNATURE-----

Merge tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Here are a bunch of USB patches for 3.3-rc1.

Nothing major, largest thing here is the removal of some drivers that
did not work at all.  Other than that, the normal collection of bugfixes
and new device ids.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

* tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (52 commits)
  uwb & wusb: fix kconfig error
  USB: Realtek cr: fix autopm scheduling while atomic
  USB: ftdi_sio: Add more identifiers
  xHCI: Cleanup isoc transfer ring when TD length mismatch found
  usb: musb: omap2430: minor cleanups.
  qcaux: add more Pantech UML190 and UML290 ports
  Revert "drivers: usb: Fix dependency for USB_HWA_HCD"
  usb: mv-otg - Fix build if CONFIG_USB is not set
  USB: cdc-wdm: Avoid hanging on interface with no USB_CDC_DMM_TYPE
  usb: add support for STA2X11 host driver
  drivers: usb: Fix dependency for USB_HWA_HCD
  kernel-doc: fix new warning in usb.h
  USB: OHCI: fix new compiler warnings
  usb: serial: kobil_sct: fix compile warning:
  drivers/usb/host/ehci-fsl.c: add missing iounmap
  USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB core
  USB: cdc-wdm: call wake_up_all to allow driver to shutdown on device removal
  USB: cdc-wdm: use two mutexes to allow simultaneous read and write
  USB: cdc-wdm: updating desc->length must be protected by spin_lock
  USB: usbsevseg: fix max length
  ...
2012-01-30 11:38:28 -08:00
Linus Torvalds a14a8d9316 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
1) Setting link attributes can modify the size of the attributes that
   would be reported on a subsequent getlink netlink operation,
   therefore min_ifinfo_dump_size needs to be adjusted.  From Stefan
   Gula.

2) Resegmentation of TSO frames while trimming can violate invariants
   expected by callers, namely that the number of segments can only stay
   the same or decrease, never increase.  If MSS changes, however, we
   can trim data but then end up with more segments.  Fix this by only
   segmenting to the MSS already recorded in the SKB.  That's the
   simplest fix for now and if we want to get more fancy in the future
   that's a more involved change.

   This probably explains some retransmit counter inaccuracies.

   From Neal Cardwell.

3) Fix too-many-wakeups in POLL with AF_UNIX sockets, from Eric Dumazet.

4) Fix CAIF crashes wrt.  namespace handling.  From Eric Dumazet and
   Eric W. Biederman.

5) TCP port selection fixes from Flavio Leitner.

6) More socket memory cgroup build fixes in certain randonfig
   situations.  From Glauber Costa.

7) Fix TCP memory sysctl regression reported by Ingo Molnar, also from
   Glauber Costa.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  af_unix: fix EPOLLET regression for stream sockets
  tcp: fix tcp_trim_head() to adjust segment count with skb MSS
  net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL
  net caif: Register properly as a pernet subsystem.
  netns: Fail conspicously if someone uses net_generic at an inappropriate time.
  net: explicitly add jump_label.h header to sock.h
  net: RTNETLINK adjusting values of min_ifinfo_dump_size
  ipv6: Fix ip_gre lockless xmits.
  xen-netfront: correct MAX_TX_TARGET calculation.
  netns: fix net_alloc_generic()
  tcp: bind() optimize port allocation
  tcp: bind() fix autoselection to share ports
  l2tp: l2tp_ip - fix possible oops on packet receive
  iwlwifi: fix PCI-E transport "inta" race
  mac80211: set bss_conf.idle when vif is connected
  mac80211: update oper_channel on ibss join
2012-01-30 10:53:20 -08:00
Linus Torvalds b527a2331b This fixes an integration issue with the regulator device tree bindings
which shook out in -rc.  The bindings were overly enthusiatic when
 deciding to set a voltage on a regulator and would try to set zero volts
 on an unconfigured regulator which isn't supported.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPITNlAAoJEBus8iNuMP3d9nUP/1DSmprBh0TwOdqSGfeQKU+A
 TECIi+SsWgYwJoiDXdkrfdauQTzHTFnf2ddGdEhaaSpgwsQSMsjqOTcjpfcIC94Y
 Qqiv4avPIb8FsH7vSn69XX9JWy3Q4yQqoWWwZ1/fwWVrm5dGoyb+fif+yM3Pn7hJ
 jvorCldMFkLEvjhkMJ0MUTtZZplv1jcM3Ffy2dSPGIl/SoXCitmuVy3ygy6B0ICa
 JXLNO5yUQSoGDMSYiEOKQUePLKEQKeluMUG+yC8REXaqki9qnoGHeUu8Uje2+teE
 Ik5YUVWFCl2EjPotvUgJSJZMIr5Z2JyAhTxOtXLAk6ke1jEoNVO02wtoUI+22C1T
 kZjqvFbBpyuJWbYHHR3a5rbTa5eRjdud923F7Xy8+mCoS5f+kuPltZUWgaJOxsL3
 5rAZcW88gWc6XOSZLto2rAeUs9rUHal78sjBPWvTp1wjixGTqJU1RQpi8VYn0dAB
 YAlbeIS3wo3wQfN/A3ZPIGM7pAdlgAxT6l3G8xWSybmZazwQm+eFPtNNe5nzEfrl
 TX6paC0bLR6azKG1p4qVHxaCgwvJsZcBEiz1zM8JPWAkiUn2PzznlFTyBqXKmGr8
 Eqisiy7WLPiysdYuRWg+GJW/4M17sdCaoGKAsVNv2KSy2C/b9z3yRxRYSr9eE8TI
 xAbEh0jYDnopI/jYL89X
 =nREk
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

This fixes an integration issue with the regulator device tree bindings
which shook out in -rc.  The bindings were overly enthusiatic when
deciding to set a voltage on a regulator and would try to set zero volts
on an unconfigured regulator which isn't supported.

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: Set apply_uV only when min and max voltages are defined
2012-01-30 10:16:25 -08:00
Eric Dumazet 6f01fd6e6f af_unix: fix EPOLLET regression for stream sockets
Commit 0884d7aa24 (AF_UNIX: Fix poll blocking problem when reading from
a stream socket) added a regression for epoll() in Edge Triggered mode
(EPOLLET)

Appropriate fix is to use skb_peek()/skb_unlink() instead of
skb_dequeue(), and only call skb_unlink() when skb is fully consumed.

This remove the need to requeue a partial skb into sk_receive_queue head
and the extra sk->sk_data_ready() calls that added the regression.

This is safe because once skb is given to sk_receive_queue, it is not
modified by a writer, and readers are serialized by u->readlock mutex.

This also reduce number of spinlock acquisition for small reads or
MSG_PEEK users so should improve overall performance.

Reported-by: Nick Mathewson <nickm@freehaven.net>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Alexey Moiseytsev <himeraster@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-30 12:45:07 -05:00
Neal Cardwell 5b35e1e6e9 tcp: fix tcp_trim_head() to adjust segment count with skb MSS
This commit fixes tcp_trim_head() to recalculate the number of
segments in the skb with the skb's existing MSS, so trimming the head
causes the skb segment count to be monotonically non-increasing - it
should stay the same or go down, but not increase.

Previously tcp_trim_head() used the current MSS of the connection. But
if there was a decrease in MSS between original transmission and ACK
(e.g. due to PMTUD), this could cause tcp_trim_head() to
counter-intuitively increase the segment count when trimming bytes off
the head of an skb. This violated assumptions in tcp_tso_acked() that
tcp_trim_head() only decreases the packet count, so that packets_acked
in tcp_tso_acked() could underflow, leading tcp_clean_rtx_queue() to
pass u32 pkts_acked values as large as 0xffffffff to
ca_ops->pkts_acked().

As an aside, if tcp_trim_head() had really wanted the skb to reflect
the current MSS, it should have called tcp_set_skb_tso_segs()
unconditionally, since a decrease in MSS would mean that a
single-packet skb should now be sliced into multiple segments.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Nandita Dukkipati <nanditad@google.com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-30 12:42:58 -05:00
Glauber Costa 4acb41903b net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL
sysctl_tcp_mem() initialization was moved to sysctl_tcp_ipv4.c
in commit 3dc43e3e4d, since it
became a per-ns value.

That code, however, will never run when CONFIG_SYSCTL is
disabled, leading to bogus values on those fields - causing hung
TCP sockets.

This patch fixes it by keeping an initialization code in
tcp_init(). It will be overwritten by the first net namespace
init if CONFIG_SYSCTL is compiled in, and do the right thing if
it is compiled out.

It is also named properly as tcp_init_mem(), to properly signal
its non-sysctl side effect on TCP limits.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Glauber Costa <glommer@parallels.com>
Cc: David S. Miller <davem@davemloft.net>
Link: http://lkml.kernel.org/r/4F22D05A.8030604@parallels.com
[ renamed the function, tidied up the changelog a bit ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-30 12:41:06 -05:00
Linus Torvalds 883120eb32 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  [S390] dasd: revalidate server for new pathgroup
  [S390] dasd: revert LCU optimization
  [S390] cleanup entry point definition
2012-01-30 09:02:10 -08:00
Linus Torvalds f07d4a7647 Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: generic atomic64 support
2012-01-30 08:59:46 -08:00
Linus Torvalds dfd07ec3fa Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  vmwgfx: Fix assignment in vmw_framebuffer_create_handle
  drm/radeon/kms: Fix device tree linkage of i2c buses
  drm: Pass the real error code back during GEM bo initialisation
  Revert "drm/i810: cleanup reclaim_buffers"
2012-01-30 08:56:41 -08:00
Linus Torvalds f94f72ee67 NFS client bugfixes for Linux 3.3 (pull 3)
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPJcPiAAoJEGcL54qWCgDyLegQAITxsoM1yYiXUQ70dksWIn8q
 y/ieLyrrTa0X3k3pHjSi305ar5d41ebEdq3aPk7tnXkpVEAPBKu4gmgx2ZQmb/G4
 uS0jiPQMjakORpBQ3RPviPDy+Yb/xWZa8iZFSq8F1pjWggPYVaNaDQmZXY+h1luN
 JSgaLSwefw3eTBuY9sqN1+qr0/F1Cbri5fYDMeA6GlJfdDkt4qO7Rep6VRc8xghk
 Pb5CnyiIziGB8qZnWI2dxQVUZRUYMGA+E6cAZzBxBAyLVxWmZGHJWB6VceNIilaT
 3CWXgQ8XRbOeYWx1q/Lnbf2s1ebRGWj5JxLoMSDYo4U6q5BEjngG0vzf5wHpMToR
 8JZB6PXmD9riCsm6xHIdu5Q+5Ku4cttGDT0PeCci/lwhgf9/u7YxwpTF8zdec0e5
 IWYIA9n+i8pot6XDOrlfmXARIGmtz7CDnPlmXCg0hKujfEj5Tmx7v4DKtGZSxQay
 e83/uuMfSWoaM3/RKG5Y0DhcbweuMMdybno4jgiYilKMCSiP4A+6YOaBSP0Y60DO
 PJmaK5E5BAhGfljCjQkvNZjpIMLUfFKKTjpB1e09ZmNs3q0lSnglX2MEOizaoHLI
 qZ7ZtFY4GVoZDV9d0zqWjUqZK0+L7YWo9M5el2ApBYt/K9gc8bpK9NLB4wrF6aPV
 DSe4flw4d8uTxkFvES3s
 =Fin9
 -----END PGP SIGNATURE-----

Merge tag 'nfs-for-3.3-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

NFS client bugfixes for Linux 3.3 (pull 3)

* tag 'nfs-for-3.3-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  SUNRPC: Fix machine creds in generic_create_cred and generic_match
2012-01-30 08:47:49 -08:00
Linus Torvalds a51f67a4b4 Power management fix for 3.3-rc2
Fix for a hibernate (s2disk) regression introduced during the 3.2
 merge window that causes s2disk to trigger BUG_ON() in
 freeze_workqueues_begin() if there is not enough swap space to save
 the image.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJPJak+AAoJEKhOf7ml8uNsS1oP/3z1em/LJvuwhXAf/cg11kAW
 LxNXK8FKKI55fE/T556oNyWHL6Bew5YtrGuLQdNQLMlWS//lVTBayUVbp9z1z+5Q
 VHPWoZfwbkT7kf0Wvuf/b4NGXRLg3gHcq+xoXJCu9zr7JV4lrHmZnm/f2N1usoAW
 kTb+w078fKT702tvBYkLJDYXkPW+cd+yqTu6H2aPO6vk3m0kq/XSeLtSs1S8ExBo
 Z0koDNJbi2S5S7RYooGwIrC0jgdl60pUcM9pI1x79uDLIz8rSHFX/VdrlVK6M70l
 +3PdccnUmKo92qaSnv1DSYVpGaWSI6KQjy1I12mpbzAgJagZNxc7NtzguhUWzhLe
 W7/rJaTupg8UozDfq0wFpekIjO8v+E8ZbtUzE/EISZ/+espZIUAQpuPCq6Suf7W1
 lraYhHvReXUX/BPKkRTf+9WTMvZbLElfF6DTSOZZ4+fztP+BD1M+1a0uy4BIQ8n7
 Gwz5FDvlyFR+YTEewmWSVhdZlBY8hiJw4fgMwimca8m9DCrFeT+uiXjL0BQsrdYB
 aN1PWiAZQNrPbW6LAoUu9rLzebyuXCd2/RAuR+nIDvxIdBMqV6yz9hkEUMGwftTP
 PvQIBSRxS6t8bLXrVTToGE90sTx1dBs+EorPMq4dPoXGG2VEEbLo+xGgM1lfKFU2
 eIbgOdJxarAph9zI4X30
 =m9yn
 -----END PGP SIGNATURE-----

Merge tag 'pm-fix-for-3.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Power management fix for 3.3-rc2

Fix for a hibernate (s2disk) regression introduced during the 3.2
merge window that causes s2disk to trigger BUG_ON() in
freeze_workqueues_begin() if there is not enough swap space to save
the image.

* tag 'pm-fix-for-3.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  PM / Hibernate: Fix s2disk regression related to freezing workqueues
2012-01-30 08:33:40 -08:00
Ryan Mallon bf9c05d5b6 vmwgfx: Fix assignment in vmw_framebuffer_create_handle
The assignment of handle in vmw_framebuffer_create_handle doesn't actually do anything useful and is incorrectly assigning an integer value to a pointer argument. It appears that this is a typo and should be dereferencing handle rather than assigning to it directly. This fixes a bug where an undefined handle value is potentially returned to user-space.

Signed-off-by: Ryan Mallon <rmallon@gmail.com>
Reviewed-by: Jakob Bornecrantz<jakob@vmware.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 09:32:39 +00:00
Jean Delvare 1ffd57c1da drm/radeon/kms: Fix device tree linkage of i2c buses
Properly set the parent device of i2c buses before registering them so
that they will show at the right place in the device tree (rather than
in /sys/devices directly.)

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Dave Airlie <airlied@gmail.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 09:32:11 +00:00
Chris Wilson dd8bc93d45 drm: Pass the real error code back during GEM bo initialisation
In particular, I found I was hitting the max-file limit in the VFS,
and the EFILE was being magically transformed into ENOMEM. Confusion
reigns.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 09:31:42 +00:00
Daniel Vetter 6e877b576d Revert "drm/i810: cleanup reclaim_buffers"
This reverts commit 87499ffdcb.

Where is that paper bag ... ah here.

I've failed to take an odd interaction between my other cleanups and
this reclaim_buffers patch into account and also failed to properly
test it. Looks like there are more dragons and hidden trapdoors in the
drm release path than actual lines of code.

Until I get a clue, let's just revert this.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 09:31:25 +00:00
Guenter Roeck ad77c3e180 hwmon: (w83627ehf) Disable setting DC mode for pwm2, pwm3 on NCT6776F
NCT6776F only supports pwm mode for pwm2 and pwm3. Return error if an attempt
is made to set those pwm channels to DC mode.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-29 13:06:07 -08:00
Rafael J. Wysocki 181e9bdef3 PM / Hibernate: Fix s2disk regression related to freezing workqueues
Commit 2aede851dd

  PM / Hibernate: Freeze kernel threads after preallocating memory

introduced a mechanism by which kernel threads were frozen after
the preallocation of hibernate image memory to avoid problems with
frozen kernel threads not responding to memory freeing requests.
However, it overlooked the s2disk code path in which the
SNAPSHOT_CREATE_IMAGE ioctl was run directly after SNAPSHOT_FREE,
which caused freeze_workqueues_begin() to BUG(), because it saw
that worqueues had been already frozen.

Although in principle this issue might be addressed by removing
the relevant BUG_ON() from freeze_workqueues_begin(), that would
reintroduce the very problem that commit 2aede851dd
attempted to avoid into that particular code path.  For this reason,
to fix the issue at hand, introduce thaw_kernel_threads() and make
the SNAPSHOT_FREE ioctl execute it.

Special thanks to Srivatsa S. Bhat for detailed analysis of the
problem.

Reported-and-tested-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: stable@kernel.org
2012-01-29 20:35:52 +01:00
Vivien Didelot 6edf3c30af hwmon: (sht15) fix bad error code
When no platform data was supplied, returned error code was 0.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: stable@vger.kernel.org # 2.6.32+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-29 10:35:21 -08:00
Linus Torvalds 0a96265754 Here are some patches for the 3.3-rc1 tree.
It contains the removal of the sysdev code, now that all users of it are
 gone, as well as some sysfs bugfixes that have been reported by users.
 There are also some documentation updates here as well.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iEYEABECAAYFAk8jKW4ACgkQMUfUDdst+ynAUwCfVWwHJxpb4DSSMVZhGOnHMQrL
 ZjIAn00gPeSs5u8y1nPvFrFikbon4FDs
 =bzVy
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.3-rc1-bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Here are some patches for the 3.3-rc1 tree.

It contains the removal of the sysdev code, now that all users of it are
gone, as well as some sysfs bugfixes that have been reported by users.
There are also some documentation updates here as well.

* tag 'driver-core-3.3-rc1-bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  sysfs: Complain bitterly about attempts to remove files from nonexistent directories.
  stable: update documentation to ask for kernel version
  base/core.c:fix typo in comment in function device_add
  Documentation: devres: add allocation functions to list of supported calls
  Documentation update for the driver model core
  kernel-doc: fix new warnings in driver-core
  kernel-doc: fix new warnings in debugfs
  kernel-doc: fix new warnings in device.h
  driver core: remove drivers/base/sys.c and include/linux/sysdev.h
2012-01-28 18:20:48 -08:00