]> Pileus Git - ~andy/linux/log
~andy/linux
11 years agoMerge tag 'md-3.8-fixes' of git://neil.brown.name/md
Linus Torvalds [Mon, 28 Jan 2013 23:15:34 +0000 (15:15 -0800)]
Merge tag 'md-3.8-fixes' of git://neil.brown.name/md

Pull dmraid fix from NeilBrown:
 "Just one fix for md in 3.8

  dmraid assess redundancy and replacements slightly inaccurately which
  could lead to some degraded arrays failing to assemble."

* tag 'md-3.8-fixes' of git://neil.brown.name/md:
  DM-RAID: Fix RAID10's check for sufficient redundancy

11 years agopowerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning for ppc32
Li Zhong [Sun, 2 Dec 2012 20:19:22 +0000 (20:19 +0000)]
powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning for ppc32

This patch fixes MAX_STACK_TRACE_ENTRIES too low warning for ppc32,
which is similar to commit 12660b17.

Reported-by: Christian Kujau <lists@nerdbynature.de>
Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Tested-by: Christian Kujau <lists@nerdbynature.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agoxfs: Fix xfs_swap_extents() after removal of xfs_flushinval_pages()
Torsten Kaiser [Sun, 20 Jan 2013 09:24:49 +0000 (10:24 +0100)]
xfs: Fix xfs_swap_extents() after removal of xfs_flushinval_pages()

Commit fb59581404ab7ec5075299065c22cb211a9262a9 removed
xfs_flushinval_pages() and changed its callers to use
filemap_write_and_wait() and  truncate_pagecache_range() directly.

But in xfs_swap_extents() this change accidental switched the argument
for 'tip' to 'ip'. This patch switches it back to 'tip'

Signed-off-by: Torsten Kaiser <just.for.lkml@googlemail.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes
Linus Torvalds [Mon, 28 Jan 2013 19:53:49 +0000 (11:53 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes

Pull GFS2 fix from Steven Whitehouse.

* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes:
  GFS2: fix skip unlock condition

11 years agoMerge tag 'iommu-fixes-v3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 28 Jan 2013 19:52:56 +0000 (11:52 -0800)]
Merge tag 'iommu-fixes-v3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fix from Joerg Roedel:
 "One fix for the AMD IOMMU driver to work around broken BIOSes found in
  the field.  Some BIOSes forget to enable a workaround for a hardware
  problem which might cause the IOMMU to stop working under high load
  conditions.  The fix makes sure this workaround is enabled."

* tag 'iommu-fixes-v3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround

11 years agoMerge tag 'mfd-for-linus-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 28 Jan 2013 19:51:57 +0000 (11:51 -0800)]
Merge tag 'mfd-for-linus-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

Pull MFD fixes from Samuel Ortiz:
 "This is the first pull request for MFD fixes for 3.8

  We have some build failure fixes (twl4030, vexpress, abx500 and
  tps65910), some actual runtime oops and lockup fixes (rtsx, da9052),
  and some more hypothetical NULL pointers dereferences fixes for
  pcf50633 and max776xx.

  Then we also have additional rtsx fixes for a correct switch output
  voltage and clock divider correctness for rtl8411 (rtsx driver), and
  irqdomain fix for db8550-prcmu, and some more cosmetic fixes for
  arizona and wm5102."

* tag 'mfd-for-linus-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
  mfd: rtsx: Fix oops when rtsx_pci_sdmmc is not probed
  mfd: wm5102: Fix definition of WM5102_MAX_REGISTER
  mfd: twl4030: Don't warn about uninitialized return code
  mfd: da9052/53 lockup fix
  mfd: rtsx: Add clock divider hook
  mmc: rtsx: Call MFD hook to switch output voltage
  mfd: rtsx: Add output voltage switch hook
  mfd: Fix compile errors and warnings when !CONFIG_AB8500_BM
  mfd: vexpress: Export global functions to fix build error
  mfd: arizona: Check errors from regcache_sync()
  mfd: tc3589x: Use simple irqdomain
  mfd: pcf50633: Init pcf->dev before using it
  mfd: max77693: Init max77693->dev before using it
  mfd: max77686: Init max77686->dev before using it
  mfd: db8500-prcmu: Fix irqdomain usage
  mfd: tps65910: Select REGMAP_IRQ in Kconfig to fix build error
  mfd: arizona: Disable control interface reporting for WM5102 and WM5110

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Mon, 28 Jan 2013 19:41:37 +0000 (11:41 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking updates from David Miller:
 "Much more accumulated than I would have liked due to an unexpected
  bout with a nasty flu:

   1) AH and ESP input don't set ECN field correctly because the
      transport head of the SKB isn't set correctly, fix from Li
      RongQing.

   2) If netfilter conntrack zones are disabled, we can return an
      uninitialized variable instead of the proper error code.  Fix from
      Borislav Petkov.

   3) Fix double SKB free in ath9k driver beacon handling, from Felix
      Feitkau.

   4) Remove bogus assumption about netns cleanup ordering in
      nf_conntrack, from Pablo Neira Ayuso.

   5) Remove a bogus BUG_ON in the new TCP fastopen code, from Eric
      Dumazet.  It uses spin_is_locked() in it's test and is therefore
      unsuitable for UP.

   6) Fix SELINUX labelling regressions added by the tuntap multiqueue
      changes, from Paul Moore.

   7) Fix CRC errors with jumbo frame receive in tg3 driver, from Nithin
      Nayak Sujir.

   8) CXGB4 driver sets interrupt coalescing parameters only on first
      queue, rather than all of them.  Fix from Thadeu Lima de Souza
      Cascardo.

   9) Fix regression in the dispatch of read/write registers in dm9601
      driver, from Tushar Behera.

  10) ipv6_append_data miscalculates header length, from Romain KUNTZ.

  11) Fix PMTU handling regressions on ipv4 routes, from Steffen
      Klassert, Timo Teräs, and Julian Anastasov.

  12) In 3c574_cs driver, add necessary parenthesis to "x << y & z"
      expression.  From Nickolai Zeldovich.

  13) macvlan_get_size() causes underallocation netlink message space,
      fix from Eric Dumazet.

  14) Avoid division by zero in xfrm_replay_advance_bmp(), from Nickolai
      Zeldovich.  Amusingly the zero check was already there, we were
      just performing it after the modulus :-)

  15) Some more splice bug fixes from Eric Dumazet, which fix things
      mostly eminating from how we now more aggressively use high-order
      pages in SKBs.

  16) Fix size calculation bug when freeing hash tables in the IPSEC
      xfrm code, from Michal Kubecek.

  17) Fix PMTU event propagation into socket cached routes, from Steffen
      Klassert.

  18) Fix off by one in TX buffer release in netxen driver, from Eric
      Dumazet.

  19) Fix rediculous memory allocation requirements introduced by the
      tuntap multiqueue changes, from Jason Wang.

  20) Remove bogus AMD platform workaround in r8169 driver that causes
      major problems in normal operation, from Timo Teräs.

  21) virtio-net set affinity and select queue don't handle
      discontiguous cpu numbers properly, fix from Wanlong Gao.

  22) Fix a route refcounting issue in loopback driver, from Eric
      Dumazet.  There's a similar fix coming that we might add to the
      macvlan driver as well.

  23) Fix SKB leaks in batman-adv's distributed arp table code, from
      Matthias Schiffer.

  24) r8169 driver gives descriptor ownership back the hardware before
      we're done reading the VLAN tag out of it, fix from Francois
      Romieu.

  25) Checksums not calculated properly in GRE tunnel driver fix from
      Pravin B Shelar.

26) Fix SCTP memory leak on namespace exit."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (101 commits)
  dm9601: support dm9620 variant
  SCTP: Free the per-net sysctl table on net exit. v2
  net: phy: icplus: fix broken INTR pin settings
  net: phy: icplus: Use the RGMII interface mode to configure clock delays
  IP_GRE: Fix kernel panic in IP_GRE with GRE csum.
  sctp: set association state to established in dupcook_a handler
  ip6mr: limit IPv6 MRT_TABLE identifiers
  r8169: fix vlan tag read ordering.
  net: cdc_ncm: use IAD provided by the USB core
  batman-adv: filter ARP packets with invalid MAC addresses in DAT
  batman-adv: check for more types of invalid IP addresses in DAT
  batman-adv: fix skb leak in batadv_dat_snoop_incoming_arp_reply()
  net: loopback: fix a dst refcounting issue
  virtio-net: reset virtqueue affinity when doing cpu hotplug
  virtio-net: split out clean affinity function
  virtio-net: fix the set affinity bug when CPU IDs are not consecutive
  can: pch_can: fix invalid error codes
  can: ti_hecc: fix invalid error codes
  can: c_can: fix invalid error codes
  r8169: remove the obsolete and incorrect AMD workaround
  ...

11 years agoARM: tegra: add AHB entry to Tegra114 DT
Hiroshi Doyu [Tue, 15 Jan 2013 08:17:27 +0000 (10:17 +0200)]
ARM: tegra: add AHB entry to Tegra114 DT

Add AHB entry.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoxfs: Fix possible use-after-free with AIO
Jan Kara [Wed, 23 Jan 2013 12:56:18 +0000 (13:56 +0100)]
xfs: Fix possible use-after-free with AIO

Running AIO is pinning inode in memory using file reference. Once AIO
is completed using aio_complete(), file reference is put and inode can
be freed from memory. So we have to be sure that calling aio_complete()
is the last thing we do with the inode.

CC: xfs@oss.sgi.com
CC: Ben Myers <bpm@sgi.com>
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: fix shutdown hang on invalid inode during create
Dave Chinner [Mon, 21 Jan 2013 12:53:55 +0000 (23:53 +1100)]
xfs: fix shutdown hang on invalid inode during create

When the new inode verify in xfs_iread() fails, the create
transaction is aborted and a shutdown occurs. The subsequent unmount
then hangs in xfs_wait_buftarg() on a buffer that has an elevated
hold count. Debug showed that it was an AGI buffer getting stuck:

[   22.576147] XFS (vdb): buffer 0x2/0x1, hold 0x2 stuck
[   22.976213] XFS (vdb): buffer 0x2/0x1, hold 0x2 stuck
[   23.376206] XFS (vdb): buffer 0x2/0x1, hold 0x2 stuck
[   23.776325] XFS (vdb): buffer 0x2/0x1, hold 0x2 stuck

The trace of this buffer leading up to the shutdown (trimmed for
brevity) looks like:

xfs_buf_init:        bno 0x2 nblks 0x1 hold 1 caller xfs_buf_get_map
xfs_buf_get:         bno 0x2 len 0x200 hold 1 caller xfs_buf_read_map
xfs_buf_read:        bno 0x2 len 0x200 hold 1 caller xfs_trans_read_buf_map
xfs_buf_iorequest:   bno 0x2 nblks 0x1 hold 1 caller _xfs_buf_read
xfs_buf_hold:        bno 0x2 nblks 0x1 hold 1 caller xfs_buf_iorequest
xfs_buf_rele:        bno 0x2 nblks 0x1 hold 2 caller xfs_buf_iorequest
xfs_buf_iowait:      bno 0x2 nblks 0x1 hold 1 caller _xfs_buf_read
xfs_buf_ioerror:     bno 0x2 len 0x200 hold 1 caller xfs_buf_bio_end_io
xfs_buf_iodone:      bno 0x2 nblks 0x1 hold 1 caller _xfs_buf_ioend
xfs_buf_iowait_done: bno 0x2 nblks 0x1 hold 1 caller _xfs_buf_read
xfs_buf_hold:        bno 0x2 nblks 0x1 hold 1 caller xfs_buf_item_init
xfs_trans_read_buf:  bno 0x2 len 0x200 hold 2 recur 0 refcount 1
xfs_trans_brelse:    bno 0x2 len 0x200 hold 2 recur 0 refcount 1
xfs_buf_item_relse:  bno 0x2 nblks 0x1 hold 2 caller xfs_trans_brelse
xfs_buf_rele:        bno 0x2 nblks 0x1 hold 2 caller xfs_buf_item_relse
xfs_buf_unlock:      bno 0x2 nblks 0x1 hold 1 caller xfs_trans_brelse
xfs_buf_rele:        bno 0x2 nblks 0x1 hold 1 caller xfs_trans_brelse
xfs_buf_trylock:     bno 0x2 nblks 0x1 hold 2 caller _xfs_buf_find
xfs_buf_find:        bno 0x2 len 0x200 hold 2 caller xfs_buf_get_map
xfs_buf_get:         bno 0x2 len 0x200 hold 2 caller xfs_buf_read_map
xfs_buf_read:        bno 0x2 len 0x200 hold 2 caller xfs_trans_read_buf_map
xfs_buf_hold:        bno 0x2 nblks 0x1 hold 2 caller xfs_buf_item_init
xfs_trans_read_buf:  bno 0x2 len 0x200 hold 3 recur 0 refcount 1
xfs_trans_log_buf:   bno 0x2 len 0x200 hold 3 recur 0 refcount 1
xfs_buf_item_unlock: bno 0x2 len 0x200 hold 3 flags DIRTY liflags ABORTED
xfs_buf_unlock:      bno 0x2 nblks 0x1 hold 3 caller xfs_buf_item_unlock
xfs_buf_rele:        bno 0x2 nblks 0x1 hold 3 caller xfs_buf_item_unlock

And that is the AGI buffer from cold cache read into memory to
transaction abort. You can see at transaction abort the bli is dirty
and only has a single reference. The item is not pinned, and it's
not in the AIL. Hence the only reference to it is this transaction.

The problem is that the xfs_buf_item_unlock() call is dropping the
last reference to the xfs_buf_log_item attached to the buffer (which
holds a reference to the buffer), but it is not freeing the
xfs_buf_log_item. Hence nothing will ever release the buffer, and
the unmount hangs waiting for this reference to go away.

The fix is simple - xfs_buf_item_unlock needs to detect the last
reference going away in this case and free the xfs_buf_log_item to
release the reference it holds on the buffer.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: limit speculative prealloc near ENOSPC thresholds
Dave Chinner [Mon, 21 Jan 2013 12:53:54 +0000 (23:53 +1100)]
xfs: limit speculative prealloc near ENOSPC thresholds

There is a window on small filesytsems where specualtive
preallocation can be larger than that ENOSPC throttling thresholds,
resulting in specualtive preallocation trying to reserve more space
than there is space available. This causes immediate ENOSPC to be
triggered, prealloc to be turned off and flushing to occur. One the
next write (i.e. next 4k page), we do exactly the same thing, and so
effective drive into synchronous 4k writes by triggering ENOSPC
flushing on every page while in the window between the prealloc size
and the ENOSPC prealloc throttle threshold.

Fix this by checking to see if the prealloc size would consume all
free space, and throttle it appropriately to avoid premature
ENOSPC...

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: fix _xfs_buf_find oops on blocks beyond the filesystem end
Dave Chinner [Mon, 21 Jan 2013 12:53:52 +0000 (23:53 +1100)]
xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end

When _xfs_buf_find is passed an out of range address, it will fail
to find a relevant struct xfs_perag and oops with a null
dereference. This can happen when trying to walk a filesystem with a
metadata inode that has a partially corrupted extent map (i.e. the
block number returned is corrupt, but is otherwise intact) and we
try to read from the corrupted block address.

In this case, just fail the lookup. If it is readahead being issued,
it will simply not be done, but if it is real read that fails we
will get an error being reported.  Ideally this case should result
in an EFSCORRUPTED error being reported, but we cannot return an
error through xfs_buf_read() or xfs_buf_get() so this lookup failure
may result in ENOMEM or EIO errors being reported instead.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: pull up stack_switch check into xfs_bmapi_write
Brian Foster [Thu, 17 Jan 2013 18:11:29 +0000 (13:11 -0500)]
xfs: pull up stack_switch check into xfs_bmapi_write

The stack_switch check currently occurs in __xfs_bmapi_allocate,
which means the stack switch only occurs when xfs_bmapi_allocate()
is called in a loop. Pull the check up before the loop in
xfs_bmapi_write() such that the first iteration of the loop has
consistent behavior.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agoxfs: Do not return EFSCORRUPTED when filesystem probe finds no XFS magic
Eric Sandeen [Wed, 16 Jan 2013 23:33:53 +0000 (17:33 -0600)]
xfs: Do not return EFSCORRUPTED when filesystem probe finds no XFS magic

9802182 changed the return value from EWRONGFS (aka EINVAL)
to EFSCORRUPTED which doesn't seem to be handled properly by
the root filesystem probe.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Tested-by: Sergei Trofimovich <slyfox@gentoo.org>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
11 years agousb: host: tegra: make use of PHY pointer of HCD
Venu Byravarasu [Thu, 24 Jan 2013 10:27:03 +0000 (15:57 +0530)]
usb: host: tegra: make use of PHY pointer of HCD

As pointer to PHY structure can be stored in struct usb_hcd
making use of it, to call Tegra PHY APIs.

Call to usb_phy_shutdown() is moved up in tegra_ehci_remove(),
so that to avoid dereferencing of hcd after its freed up.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: Add reset GPIO information to PHY DT node
Venu Byravarasu [Thu, 24 Jan 2013 10:16:46 +0000 (15:46 +0530)]
ARM: tegra: Add reset GPIO information to PHY DT node

As reset GPIO information is PHY specific detail, adding
it to PHY DT node.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: Add initial support for Tegra114 SoC.
Hiroshi Doyu [Thu, 24 Jan 2013 01:10:26 +0000 (01:10 +0000)]
ARM: tegra: Add initial support for Tegra114 SoC.

Add new Tegra 114 SoC support.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: dt: tegra114: Add new board, Pluto
Hiroshi Doyu [Thu, 24 Jan 2013 01:10:25 +0000 (01:10 +0000)]
ARM: dt: tegra114: Add new board, Pluto

Add a new evaluation board, Pluto for Tegra 114 family.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: dt: tegra114: Add new board, Dalmore
Hiroshi Doyu [Thu, 24 Jan 2013 01:10:24 +0000 (01:10 +0000)]
ARM: dt: tegra114: Add new board, Dalmore

Add a new evaluation board, Dalmore for Tegra 114 family.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: dt: tegra114: Add new SoC base, Tegra114 SoC
Hiroshi Doyu [Thu, 24 Jan 2013 01:10:23 +0000 (01:10 +0000)]
ARM: dt: tegra114: Add new SoC base, Tegra114 SoC

Initial support for Tegra 114 SoC. This is expected to be included in
the board DTS files, Tegra 114 SoC based evaluation board family.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: fuse: Add chip ID Tegra114 0x35
Hiroshi Doyu [Thu, 24 Jan 2013 01:10:22 +0000 (01:10 +0000)]
ARM: tegra: fuse: Add chip ID Tegra114 0x35

Add tegra_chip_id TEGRA114 0x35

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoMerge branch 'for-3.9/scu-base-rework' into for-3.9/soc-t114
Stephen Warren [Mon, 28 Jan 2013 18:22:46 +0000 (11:22 -0700)]
Merge branch 'for-3.9/scu-base-rework' into for-3.9/soc-t114

Conflicts:
arch/arm/mach-tegra/platsmp.c

11 years agoARM: tegra20: cpuidle: apply coupled cpuidle for powered-down mode
Joseph Lo [Wed, 16 Jan 2013 17:33:55 +0000 (17:33 +0000)]
ARM: tegra20: cpuidle: apply coupled cpuidle for powered-down mode

The "powered-down" cpuidle mode of Tegra20 needs the CPU0 be the last one
core to go into this mode before other core. The coupled cpuidle framework
can help to sync the MPCore to coupled state then go into "powered-down"
idle mode together. The driver can just assume the MPCore come into
"powered-down" mode at the same time. No need to take care if the CPU_0
goes into this mode along and only can put it into safe idle mode (WFI).

The powered-down state of Tegra20 requires power gating both CPU cores.
When the secondary CPU requests to enter powered-down state, it saves
its own contexts and then enters WFI for waiting CPU0 in the same state.
When the CPU0 requests powered-down state, it attempts to put the secondary
CPU into reset to prevent it from waking up. Then power down both CPUs
together and power off the cpu rail.

Be aware of that, you may see the legacy power state "LP2" in the code
which is exactly the same meaning of "CPU power down".

Based on the work by:
Colin Cross <ccross@android.com>
Gary King <gking@nvidia.com>

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra20: flowctrl: add support for cpu_suspend_enter/exit
Joseph Lo [Tue, 15 Jan 2013 22:11:01 +0000 (22:11 +0000)]
ARM: tegra20: flowctrl: add support for cpu_suspend_enter/exit

The flow controller can help CPU to go into suspend mode (powered-down
state). When CPU go into powered-down state, it needs some careful
settings before getting into and after leaving. The enter and exit
functions do that by configuring appropriate mode for flow controller.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoclk: tegra20: Implementing CPU low-power function for tegra_cpu_car_ops
Joseph Lo [Tue, 15 Jan 2013 22:10:48 +0000 (22:10 +0000)]
clk: tegra20: Implementing CPU low-power function for tegra_cpu_car_ops

Implementing suspend, resume and rail_off_ready API for tegra_cpu_car_ops. These
functions were used for CPU powered-down state maintenance.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra20: cpuidle: add powered-down state for secondary CPU
Joseph Lo [Tue, 15 Jan 2013 22:10:38 +0000 (22:10 +0000)]
ARM: tegra20: cpuidle: add powered-down state for secondary CPU

The powered-down state of Tegra20 requires power gating both CPU cores.
When the secondary CPU requests to enter powered-down state, it saves
its own contexts and then enters WFI. The Tegra20 had a limition to
power down both CPU cores. The secondary CPU must waits for CPU0 in
powered-down state too. If the secondary CPU be woken up before CPU0
entering powered-down state, then it needs to restore its CPU states
and waits for next chance.

Be aware of that, you may see the legacy power state "LP2" in the code
which is exactly the same meaning of "CPU power down".

Based on the work by:
Colin Cross <ccross@android.com>
Gary King <gking@nvidia.com>

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: add pending SGI checking API
Joseph Lo [Tue, 15 Jan 2013 22:10:26 +0000 (22:10 +0000)]
ARM: tegra: add pending SGI checking API

The "powered-down" CPU idle mode of Tegra cut off the vdd_cpu rail, it
include the power of GIC. That caused the SGI (Software Generated
Interrupt) been lost. Because the SGI can't wake up the CPU that in
the "powered-down" CPU idle mode. We need to check if there is any
pending SGI when go into "powered-down" CPU idle mode. This is important
especially when applying the coupled cpuidle framework into "power-down"
cpuidle dirver. Because the coupled cpuidle framework may have the
chance that misses IPI_SINGLE_FUNC handling sometimes.

For the PPI or SPI, something like the legacy peripheral interrupt. It
still can be maintained by Tegra legacy interrupt controller. If there
is any pending PPI or SPI when CPU in "powered-down" CPU idle mode. The
CPU can be woken up immediately. So we don't need to take care the same
situation for PPI or SPI.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agousb: host: tegra: don't touch EMC clock
Stephen Warren [Wed, 23 Jan 2013 00:06:32 +0000 (17:06 -0700)]
usb: host: tegra: don't touch EMC clock

Clock "emc" is for the External Memory Controller. The USB driver has no
business touching this clock directly. Remove the code that does so.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agousb: add APIs to access host registers from Tegra PHY
Venu Byravarasu [Thu, 17 Jan 2013 20:15:37 +0000 (20:15 +0000)]
usb: add APIs to access host registers from Tegra PHY

As Tegra PHY driver needs to access one of the host registers,
added few APIs.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
[swarren: moved assignment of phy->is_ulpi_phy to previous patch.]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoUSB: PHY: tegra: Get rid of instance number to differentiate PHY type
Venu Byravarasu [Wed, 16 Jan 2013 03:30:21 +0000 (03:30 +0000)]
USB: PHY: tegra: Get rid of instance number to differentiate PHY type

Tegra20 USB has 3 PHY instances:
Instance 1 and 3 are UTMI. Instance 2 is ULPI.

As instance number was used to differentiate ULPI from UTMI,
used DT param to get this info and processed accordingly.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Acked-by: Felipe Balbi <balbi@ti.com>
[swarren: moved assignment of phy->is_ulpi_phy into this patch out
of next patch.]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoUSB: PHY: tegra: get rid of instance number to differentiate legacy controller
Venu Byravarasu [Wed, 16 Jan 2013 03:30:20 +0000 (03:30 +0000)]
USB: PHY: tegra: get rid of instance number to differentiate legacy controller

Tegra20 USB has 3 PHY instances. Instance 0 is based on
legacy PHY interface and other two are standard interfaces.

As instance number was used to differentiate legacy from
standard interfaces, used DT param to get this info and
processed accordingly.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: add clocks properties to USB PHY nodes
Stephen Warren [Wed, 23 Jan 2013 00:12:25 +0000 (17:12 -0700)]
ARM: tegra: add clocks properties to USB PHY nodes

The patch to add USB PHY nodes to device tree was written before Tegra
supported the clocks property in device tree. Now that it does, add the
required clocks properties to these nodes.

This will allow all clk_get_sys() calls in tegra_usb_phy.c to be replaced
by clk_get(phy->dev, clock_name), as part of converting the PHY driver to
a platform driver.

Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: add DT nodes for Tegra USB PHY
Venu Byravarasu [Wed, 16 Jan 2013 03:30:19 +0000 (03:30 +0000)]
ARM: tegra: add DT nodes for Tegra USB PHY

Add DT nodes for Tegra USB PHY along with related documentation.
Also added a phandle property to controller DT node, for referring
to connected PHY instance.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agousb: phy: remove unused APIs from Tegra PHY.
Venu Byravarasu [Tue, 15 Jan 2013 10:19:30 +0000 (15:49 +0530)]
usb: phy: remove unused APIs from Tegra PHY.

As tegra_usb_phy_clk_disable/enable() are not being
used, removing them.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agousb: host: tegra: Resetting PORT0 based on information received via DT.
Venu Byravarasu [Thu, 13 Dec 2012 20:59:08 +0000 (20:59 +0000)]
usb: host: tegra: Resetting PORT0 based on information received via DT.

Tegra USB host driver is using port instance number,
to handle some of the hardware issues on SOC e.g. reset PORT0
twice etc. As instance number based handling looks ugly,
making use of information passed through DT for achieving this.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: Add new DT property to USB node.
Venu Byravarasu [Thu, 13 Dec 2012 20:59:07 +0000 (20:59 +0000)]
ARM: tegra: Add new DT property to USB node.

As Tegra USB host driver is using instance number for resetting
PORT0 twice, adding a new DT property for handling this.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agousb: phy: use kzalloc to allocate struct tegra_usb_phy
Venu Byravarasu [Sat, 12 Jan 2013 00:31:29 +0000 (17:31 -0700)]
usb: phy: use kzalloc to allocate struct tegra_usb_phy

Use kzalloc instead of kmalloc to allocate struct tegra_usb_phy.
This ensures that all function pointers in member u_phy are
initialized to NULL.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: remove USB address related macros from iomap.h
Venu Byravarasu [Mon, 17 Dec 2012 18:31:01 +0000 (18:31 +0000)]
ARM: tegra: remove USB address related macros from iomap.h

USB register base address and sizes defined in iomap.h
are not used in any files other than board-dt-tegra20.c.
Hence removed those defines from header file and using
the absolute values in board files.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoclk: tegra30: remove unused TEGRA_CLK_DUPLICATE()s
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:29 +0000 (13:31 +0530)]
clk: tegra30: remove unused TEGRA_CLK_DUPLICATE()s

With device tree support added for Tegra clocks look up is done from
device tree, remove unused TEGRA_CLK_DUPLICATE()s.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoclk: tegra20: remove unused TEGRA_CLK_DUPLICATE()s
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:28 +0000 (13:31 +0530)]
clk: tegra20: remove unused TEGRA_CLK_DUPLICATE()s

With device tree support added for Tegra clocks look up is done from
device tree, remove unused TEGRA_CLK_DUPLICATE()s.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra30: remove auxdata
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:27 +0000 (13:31 +0530)]
ARM: tegra30: remove auxdata

Remove AUXDATA as clocks are initialized from device node.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra20: remove auxdata
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:26 +0000 (13:31 +0530)]
ARM: tegra20: remove auxdata

Remove AUXDATA as clock are initialized from device node.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoASoC: tegra: remove auxdata
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:25 +0000 (13:31 +0530)]
ASoC: tegra: remove auxdata

Configlink clock information is added to device tree. Get the clocks
using device node. Remove AUXDATA.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agostaging: nvec: remove use of clk_get_sys
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:24 +0000 (13:31 +0530)]
staging: nvec: remove use of clk_get_sys

As clock information is added to device tree clock can be looked up
using clk_get. Remove use of clk_get_sys.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Acked-by: Julian Andres Klode <jak@jak-linux.org>
[swarren: updated TODO file to remove entry that requested this change]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: paz00: add clock information to DT
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:23 +0000 (13:31 +0530)]
ARM: tegra: paz00: add clock information to DT

Add clock i2c clock information to device node.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: add clock properties to Tegra30 DT
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:22 +0000 (13:31 +0530)]
ARM: tegra: add clock properties to Tegra30 DT

Add clock information to device nodes.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
[swarren: added second clock to 3d node]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: add clock properties to Tegra20 DT
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:21 +0000 (13:31 +0530)]
ARM: tegra: add clock properties to Tegra20 DT

Add clock information to device nodes.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agospi: tegra: do not use clock name to get clock
Prashant Gaikwad [Fri, 11 Jan 2013 08:01:20 +0000 (13:31 +0530)]
spi: tegra: do not use clock name to get clock

Since Tegra spi devices do not have multiple clocks, no need to use
clock name to get the clock.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: remove legacy clock code
Prashant Gaikwad [Fri, 11 Jan 2013 07:46:27 +0000 (13:16 +0530)]
ARM: tegra: remove legacy clock code

Remove all legacy clock code from mach-tegra.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: migrate to new clock code
Prashant Gaikwad [Fri, 11 Jan 2013 07:46:26 +0000 (13:16 +0530)]
ARM: tegra: migrate to new clock code

Migrate Tegra clock support to drivers/clk/tegra, this involves
moving:
1. definition of tegra_cpu_car_ops to clk.c
2. definition of reset functions to clk-peripheral.c
3. change parent of cpu clock.
4. Remove legacy clock initialization.
5. Initialize clocks using DT.
6. Remove all instance of mach/clk.h

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
[swarren: use to_clk_periph_gate().]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoclk: tegra: add clock support for Tegra30
Prashant Gaikwad [Fri, 11 Jan 2013 07:46:25 +0000 (13:16 +0530)]
clk: tegra: add clock support for Tegra30

Add Tegra30 clock support based on common clock framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
[swarren: ensure all OF lookups return valid cookies i.e. an explicit
error pointer or valid pointer not NULL, adapt to renames in earlier
patches, fixed some checkpatch issues.]
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoclk: tegra: add clock support for Tegra20
Prashant Gaikwad [Fri, 11 Jan 2013 07:46:24 +0000 (13:16 +0530)]
clk: tegra: add clock support for Tegra20

Add Tegra20 clock support based on common clock framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
[swarren: s/1GHz/100MHz/ in call to tegra_clk_plle() to fix PCIe,
implemented KBC clock, ensure all OF lookups return valid cookies i.e.
an explicit error pointer or valid pointer not NULL, adapt to renames
in earlier patches, fixed some checkpatch issues.]
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoclk: tegra: add Tegra specific clocks
Prashant Gaikwad [Fri, 11 Jan 2013 07:46:20 +0000 (13:16 +0530)]
clk: tegra: add Tegra specific clocks

Add Tegra specific clocks, pll, pll_out, peripheral, frac_divider, super.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
[swarren: alloc sizeof(*foo) not sizeof(struct foo), add comments re:
storing pointers to stack variables, make a timeout loop more idiomatic,
use _clk_pll_disable() not clk_disable_pll() from _program_pll() to
avoid redundant lock operations, unified tegra_clk_periph() and
tegra_clk_periph_nodiv(), unified tegra_clk_pll{,e}, rename all clock
registration functions so they don't have the same name as the clock
structs, return -EINVAL from clk_plle_enable when matching table rate
not found, pass ops to _tegra_clk_register_pll rather than a bool.]
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: define Tegra30 CAR binding
Prashant Gaikwad [Fri, 11 Jan 2013 07:46:23 +0000 (13:16 +0530)]
ARM: tegra: define Tegra30 CAR binding

The device tree binding models Tegra30 CAR (Clock And Reset)
as a single monolithic clock provider.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
[swarren: fixed typo in binding doc]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: define Tegra20 CAR binding
Stephen Warren [Fri, 11 Jan 2013 07:46:22 +0000 (13:16 +0530)]
ARM: tegra: define Tegra20 CAR binding

The Tegra20 CAR (Clock And Reset) Controller controls most aspects of
most clocks within Tegra20. The device tree binding models this as a
single monolithic clock provider, which exports many clocks. This reduces
the number of nodes needed in device tree to represent these clocks.

This binding is only useful for Tegra20; the set of clocks that exists on
Tegra30 is sufficiently different to merit its own binding.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
[pgaikwad: Added mux clk ids and sorted CAR node]
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: move tegra_cpu_car.h to linux/clk/tegra.h
Prashant Gaikwad [Fri, 11 Jan 2013 07:46:21 +0000 (13:16 +0530)]
ARM: tegra: move tegra_cpu_car.h to linux/clk/tegra.h

tegra_cpu_car_ops struct is going to be accessed from drivers/clk/tegra.
Move the tegra_cpu_car_ops to include/linux/clk/tegra.h.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: add function to read chipid
Prashant Gaikwad [Fri, 11 Jan 2013 07:46:19 +0000 (13:16 +0530)]
ARM: tegra: add function to read chipid

Add function to read chip id from APB MISC registers. This function
will also get called from clock driver to flush write operations on
apb bus.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: fix compile error when disable CPU_IDLE
Joseph Lo [Fri, 25 Jan 2013 06:38:32 +0000 (14:38 +0800)]
ARM: tegra: fix compile error when disable CPU_IDLE

The "sleep.S" file has many functions that be shared by different module
currently. Not just for CPU idle driver. Make it build as default now.

Reported-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Joseph Lo <josephl@nvidia.com>
[swarren: add sleep.o to separate line so each line only contains 1 file]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra30: make the wait time of CPU power up to proportional to HZ
Joseph Lo [Mon, 7 Jan 2013 02:56:14 +0000 (10:56 +0800)]
ARM: tegra30: make the wait time of CPU power up to proportional to HZ

It would rather to use the API of time_to_jiffies than a constant number
of jiffies for the wait time of CPU power up.

Based on the work by:
Sang-Hun Lee <sanlee@nvidia.com>

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: make device can run on UP
Joseph Lo [Fri, 4 Jan 2013 09:32:22 +0000 (17:32 +0800)]
ARM: tegra: make device can run on UP

The reset handler code is used for either UP or SMP. To make Tegra device
can compile for UP. It needs to be moved to another file that is not SMP
only. This is because the reset handler also be needed by CPU idle
"powered-down" mode. So we also need to put the reset handler init function
in non-SMP only and init them always.

And currently the implementation of the reset handler to know which CPU is
OK to bring up was identital with "cpu_present_mask". But the
"cpu_present_mask" did not initialize yet when the reset handler init
function was moved to init early function. We use the "cpu_possible_mask"
to replace "cpu_present_mask". Then it can work on both UP and SMP case.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
[swarren: dropped the move of v7_invalidate_l1() from one file to another,
to avoid conflicts with Pavel's cleanup of this function, adjust Makefile
so each line only contains 1 file.]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: OMAP: Make use of available scu_a9_get_base() interface
Santosh Shilimkar [Wed, 23 Jan 2013 08:26:19 +0000 (13:56 +0530)]
ARM: OMAP: Make use of available scu_a9_get_base() interface

Drop the define and make use of scu_a9_get_base() which reads
the physical address of SCU from CP15 register.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: Skip scu_enable(scu_base) if not Cortex A9
Hiroshi Doyu [Tue, 22 Jan 2013 05:52:02 +0000 (07:52 +0200)]
ARM: tegra: Skip scu_enable(scu_base) if not Cortex A9

Skip scu_enable(scu_base) if CPU is not Cortex A9 with SCU.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: Add API to detect SCU base address from CP15
Hiroshi Doyu [Tue, 22 Jan 2013 05:52:01 +0000 (07:52 +0200)]
ARM: Add API to detect SCU base address from CP15

Add API to detect SCU base address from CP15.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: Use DT /cpu node to detect number of CPU core
Hiroshi Doyu [Tue, 15 Jan 2013 08:13:12 +0000 (10:13 +0200)]
ARM: tegra: Use DT /cpu node to detect number of CPU core

SCU based detection only works with Cortex-A9 MP and it doesn't
support ones with multiple clusters. The only way to detect number of
CPU core correctly is with DT /cpu node.

Tegra SoCs decided to use DT detection as the only way and to not use
SCU based detection at all. Even if DT /cpu node based detection
fails, it continues with a single core

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: Add CPU nodes to Tegra30 device tree
Hiroshi Doyu [Fri, 11 Jan 2013 13:11:54 +0000 (15:11 +0200)]
ARM: tegra: Add CPU nodes to Tegra30 device tree

Add CPU node for Tegra30.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: Add CPU nodes to Tegra20 device tree
Hiroshi Doyu [Fri, 11 Jan 2013 13:26:55 +0000 (15:26 +0200)]
ARM: tegra: Add CPU nodes to Tegra20 device tree

Add CPU node for Tegra20.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoMerge remote-tracking branch 'korg_arm-soc/depends/rmk-perf' into for-3.9/scu-base...
Stephen Warren [Mon, 28 Jan 2013 17:37:20 +0000 (10:37 -0700)]
Merge remote-tracking branch 'korg_arm-soc/depends/rmk-perf' into for-3.9/scu-base-rework

11 years agoARM: tegra: clean up the CPUINIT section
Joseph Lo [Fri, 4 Jan 2013 09:32:21 +0000 (17:32 +0800)]
ARM: tegra: clean up the CPUINIT section

There are some redundant codes in the CPUINIT section that was caused by
some codes not be organized well in "headsmp.S". Currently all the codes
in "headsmp.S" were put into CPUINIT section. But actually it doesn't
need to be loacted in CPUINIT section. There is no fuction access them
in CPUINIT section and we will relocate them to IRAM.

These codes also caused some unnecessary functions that access these
codes been put into CPUINIT section too. This patch clean it up and put
them into normal text section.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: moving the clock gating procedure to tegra_cpu_kill
Joseph Lo [Thu, 3 Jan 2013 06:43:00 +0000 (14:43 +0800)]
ARM: tegra: moving the clock gating procedure to tegra_cpu_kill

The tegra_cpu_die was be executed by the CPU itslf. So the clock gating
procedure won't be executed after the CPU hardware shutdown code. Moving
the clock gating procedure to tegra_cpu_kill that will be run by another
CPU after the CPU died.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: update the cache maintenance order for CPU shutdown
Joseph Lo [Thu, 3 Jan 2013 06:42:59 +0000 (14:42 +0800)]
ARM: tegra: update the cache maintenance order for CPU shutdown

Updating the cache maintenance order before CPU shutdown when doing CPU
hotplug.
The old order:
* clean L1 by flush_cache_all
* exit SMP
* CPU shutdown
Adapt to:
* disable L1 data cache by clear C bit
* clean L1 by v7_flush_dcache_louis
* exit SMP
* CPU shutdown

For CPU hotplug case, it's no need to do "flush_cache_all". And we should
disable L1 data cache before clean L1 data cache. Then leaving the SMP
coherency.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra30: fix power up sequence for boot_secondary
Joseph Lo [Thu, 3 Jan 2013 07:31:31 +0000 (15:31 +0800)]
ARM: tegra30: fix power up sequence for boot_secondary

The power up sequence is different on the cold boot CPU and the CPU
that resumed from the hotplug. For the cold boot CPU, it was been power
gated as default. To power up the cold boot CPU, the power should be
un-gated by un toggling the power gate register manually.

For the CPU that resumed from the hotplug, after un-halted the CPU. The
flow controller will un-gate the power of the CPU. No need to manually
control, just wait the power be resumed and continue the power up
sequence after the CPU power is ready.

Based on the work by:
Varun Wadekar <vwadekar@nvidia.com>

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: cpufreq: move clk_get/put out of function tegra_cpu_init/exit
Richard Zhao [Fri, 21 Dec 2012 00:09:55 +0000 (00:09 +0000)]
ARM: tegra: cpufreq: move clk_get/put out of function tegra_cpu_init/exit

tegra_cpu_init/exit will be called every time one cpu core is online or
offline. And all cpu cores share same clocks, redundant clk_get/put
wast time,  so I move them out.

Signed-off-by: Richard Zhao <linuxzsc@gmail.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: fix Kconfig warnings when !SMP
Stephen Warren [Wed, 2 Jan 2013 21:34:15 +0000 (14:34 -0700)]
ARM: tegra: fix Kconfig warnings when !SMP

Fix:

warning: (ARCH_TEGRA_2x_SOC) selects ARM_ERRATA_754327 which has unmet direct dependencies (CPU_V7 && SMP)
warning: (ARCH_TEGRA_2x_SOC) selects ARM_ERRATA_742230 which has unmet direct dependencies (CPU_V7 && SMP)

by selecting options only if SMP.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: Make variables static
Hiroshi Doyu [Thu, 3 Jan 2013 06:27:05 +0000 (08:27 +0200)]
ARM: tegra: Make variables static

No need to be public. Checked with:
  $ touch arch/arm/mach-tegra/*[ch] && make C=1

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoclocksource: tegra: cosmetic: Fix error message
Hiroshi Doyu [Mon, 17 Dec 2012 11:35:23 +0000 (13:35 +0200)]
clocksource: tegra: cosmetic: Fix error message

Add missing \n.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoARM: tegra: move timer.c to drivers/clocksource/
Stephen Warren [Tue, 23 Oct 2012 17:52:53 +0000 (11:52 -0600)]
ARM: tegra: move timer.c to drivers/clocksource/

Move arch/arm/mach-tegra/timer.c to drivers/clocksource/tegra20_timer.c
so that the code is co-located with other clocksource drivers, and to
reduce the size of the mach-tegra directory.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
11 years agoMerge remote-tracking branch 'korg_arm-soc/timer/cleanup' into for-3.9/cleanup
Stephen Warren [Mon, 28 Jan 2013 17:20:34 +0000 (10:20 -0700)]
Merge remote-tracking branch 'korg_arm-soc/timer/cleanup' into for-3.9/cleanup

11 years agoIOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround
Suravee Suthikulpanit [Thu, 24 Jan 2013 19:17:53 +0000 (13:17 -0600)]
IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround

The IOMMU may stop processing page translations due to a perceived lack
of credits for writing upstream peripheral page service request (PPR)
or event logs. If the L2B miscellaneous clock gating feature is enabled
the IOMMU does not properly register credits after the log request has
completed, leading to a potential system hang.

BIOSes are supposed to disable L2B micellaneous clock gating by setting
L2_L2B_CK_GATE_CONTROL[CKGateL2BMiscDisable](D0F2xF4_x90[2]) = 1b. This
patch corrects that for those which do not enable this workaround.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Joerg Roedel <joro@8bytes.org>
11 years agosmp: Fix SMP function call empty cpu mask race
Wang YanQing [Sat, 26 Jan 2013 07:53:57 +0000 (15:53 +0800)]
smp: Fix SMP function call empty cpu mask race

I get the following warning every day with v3.7, once or
twice a day:

  [ 2235.186027] WARNING: at /mnt/sda7/kernel/linux/arch/x86/kernel/apic/ipi.c:109 default_send_IPI_mask_logical+0x2f/0xb8()

As explained by Linus as well:

 |
 | Once we've done the "list_add_rcu()" to add it to the
 | queue, we can have (another) IPI to the target CPU that can
 | now see it and clear the mask.
 |
 | So by the time we get to actually send the IPI, the mask might
 | have been cleared by another IPI.
 |

This patch also fixes a system hang problem, if the data->cpumask
gets cleared after passing this point:

        if (WARN_ONCE(!mask, "empty IPI mask"))
                return;

then the problem in commit 83d349f35e1a ("x86: don't send an IPI to
the empty set of CPU's") will happen again.

Signed-off-by: Wang YanQing <udknight@gmail.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: peterz@infradead.org
Cc: mina86@mina86.org
Cc: srivatsa.bhat@linux.vnet.ibm.com
Cc: <stable@kernel.org>
Link: http://lkml.kernel.org/r/20130126075357.GA3205@udknight
[ Tidied up the changelog and the comment in the code. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
11 years agoGFS2: fix skip unlock condition
David Teigland [Thu, 3 Jan 2013 22:52:07 +0000 (17:52 -0500)]
GFS2: fix skip unlock condition

The recent commit fb6791d100d1bba20b5cdbc4912e1f7086ec60f8
included the wrong logic.  The lvbptr check was incorrectly
added after the patch was tested.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
11 years agoALSA: hda - fix inverted internal mic on Acer AOA150/ZG5
David Henningsson [Mon, 28 Jan 2013 04:45:47 +0000 (05:45 +0100)]
ALSA: hda - fix inverted internal mic on Acer AOA150/ZG5

This patch enables internal mic input on the machine.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1107477
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoMerge tag 'imx-soc' of git://git.pengutronix.de/git/imx/linux-2.6 into next/soc
Olof Johansson [Mon, 28 Jan 2013 07:42:02 +0000 (23:42 -0800)]
Merge tag 'imx-soc' of git://git.pengutronix.de/git/imx/linux-2.6 into next/soc

From Sascha Hauer:
ARM i.MX SoC updates for next

Mostly clock related updates, most notably the conversion of
i.MX31 to a DT based lookup.

* tag 'imx-soc' of git://git.pengutronix.de/git/imx/linux-2.6:
  ARM: clk-imx35: Fix build warnings with W=1
  ARM: imx27: add a clock gate to activate SPLL clock
  ARM: mx31: Replace clk_register_clkdev with clock DT lookup
  ARM: clk-imx31: Add dummy clock
  ARM: Let CONFIG_MACH_IMX31_DT be built by default

Signed-off-by: Olof Johansson <olof@lixom.net>
11 years agoMerge branch 'marco-timer-cleanup-rebase' of git://gitorious.org/sirfprima2-kernel...
Olof Johansson [Mon, 28 Jan 2013 07:03:42 +0000 (23:03 -0800)]
Merge branch 'marco-timer-cleanup-rebase' of git://gitorious.org/sirfprima2-kernel/sirfprima2-kernel into next/soc

From Barry Song, this adds support for a new SoC from CSR; marco. It's
SMP, uses GIC instead of VIC and in general needs a bit of rework of
the platform code for setup, which this branch contains.

* 'marco-timer-cleanup-rebase' of git://gitorious.org/sirfprima2-kernel/sirfprima2-kernel:
  ARM: PRIMA2: provide two DEBUG_LL ports for prima2 and marco
  ARM: PRIMA2: add new SiRFmarco SMP SoC infrastructures
  ARM: PRIMA2: irq: make prima2 irq can work even we enable GIC for Marco
  ARM: PRIMA2: rtciobg: it is also compatible with marco
  ARM: PRIMA2: rstc: enable the support for Marco
  ARM: PRIMA2: mv timer to timer-prima2 as we will add timer-marco
  ARM: PRIMA2: initialize l2x0 according to mach from DT
  ARM: PRIMA2: enable AUTO_ZRELADDR for SIRF in Kconfig
  ARM: PRIMA2: add CSR SiRFmarco device tree .dts

Signed-off-by: Olof Johansson <olof@lixom.net>
11 years agoMerge branch 'depends/cleanup' into next/soc
Olof Johansson [Mon, 28 Jan 2013 07:03:23 +0000 (23:03 -0800)]
Merge branch 'depends/cleanup' into next/soc

Signed-off-by: Olof Johansson <olof@lixom.net>
11 years agodm9601: support dm9620 variant
Peter Korsgaard [Sun, 27 Jan 2013 12:34:22 +0000 (12:34 +0000)]
dm9601: support dm9620 variant

dm9620 is a newer variant of dm9601 with more features (usb 2.0, checksum
offload, ..), but it can also be put in a dm9601 compatible mode, allowing
us to reuse the existing driver.

This does mean that the extended features like checksum offload cannot be
used, but that's hardly critical on a 100mbps interface.

Thanks to Sławek Wernikowski <slawek@wernikowski.net> for providing me
with a dm9620 based device to test.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoSCTP: Free the per-net sysctl table on net exit. v2
Vlad Yasevich [Thu, 24 Jan 2013 16:02:47 +0000 (11:02 -0500)]
SCTP: Free the per-net sysctl table on net exit. v2

Per-net sysctl table needs to be explicitly freed at
net exit.  Otherwise we see the following with kmemleak:

unreferenced object 0xffff880402d08000 (size 2048):
  comm "chrome_sandbox", pid 18437, jiffies 4310887172 (age 9097.630s)
  hex dump (first 32 bytes):
    b2 68 89 81 ff ff ff ff 20 04 04 f8 01 88 ff ff  .h...... .......
    04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff815b4aad>] kmemleak_alloc+0x21/0x3e
    [<ffffffff81110352>] slab_post_alloc_hook+0x28/0x2a
    [<ffffffff81113fad>] __kmalloc_track_caller+0xf1/0x104
    [<ffffffff810f10c2>] kmemdup+0x1b/0x30
    [<ffffffff81571e9f>] sctp_sysctl_net_register+0x1f/0x72
    [<ffffffff8155d305>] sctp_net_init+0x100/0x39f
    [<ffffffff814ad53c>] ops_init+0xc6/0xf5
    [<ffffffff814ad5b7>] setup_net+0x4c/0xd0
    [<ffffffff814ada5e>] copy_net_ns+0x6d/0xd6
    [<ffffffff810938b1>] create_new_namespaces+0xd7/0x147
    [<ffffffff810939f4>] copy_namespaces+0x63/0x99
    [<ffffffff81076733>] copy_process+0xa65/0x1233
    [<ffffffff81077030>] do_fork+0x10b/0x271
    [<ffffffff8100a0e9>] sys_clone+0x23/0x25
    [<ffffffff815dda73>] stub_clone+0x13/0x20
    [<ffffffffffffffff>] 0xffffffffffffffff

I fixed the spelling of sysctl_header so the code actually
compiles. -- EWB.

Reported-by: Martin Mokrejs <mmokrejs@fold.natur.cuni.cz>
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: phy: icplus: fix broken INTR pin settings
Giuseppe CAVALLARO [Wed, 23 Jan 2013 00:22:37 +0000 (00:22 +0000)]
net: phy: icplus: fix broken INTR pin settings

This patch fixes the setting of the INTR pin that is
valid for IP101 A/G device and not for the IP1001.

Reported-by: Anunay Saxena <anunay.saxena@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: phy: icplus: Use the RGMII interface mode to configure clock delays
Stuart Menefy [Wed, 23 Jan 2013 00:22:36 +0000 (00:22 +0000)]
net: phy: icplus: Use the RGMII interface mode to configure clock delays

Like several other PHY devices which support RGMII, the IC+1001 allows
additional delays to by added to the RX_CLK and TX_CLK signals to
compensate for skew between the clock and data signals. Previously this
was always enabled, but this change makes use of the different RGMII
interface modes to allow the user to specify whether this should be
enabled.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoIP_GRE: Fix kernel panic in IP_GRE with GRE csum.
Pravin B Shelar [Wed, 23 Jan 2013 11:45:42 +0000 (11:45 +0000)]
IP_GRE: Fix kernel panic in IP_GRE with GRE csum.

Due to IP_GRE GSO support, GRE can recieve non linear skb which
results in panic in case of GRE_CSUM.  Following patch fixes it by
using correct csum API.

Bug introduced in commit 6b78f16e4bdde3936b (gre: add GSO support)

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agox86, build: Dynamically find entry points in compressed startup code
David Woodhouse [Thu, 10 Jan 2013 14:31:59 +0000 (14:31 +0000)]
x86, build: Dynamically find entry points in compressed startup code

We have historically hard-coded entry points in head.S just so it's easy
to build the executable/bzImage headers with references to them.

Unfortunately, this leads to boot loaders abusing these "known" addresses
even when they are *explicitly* told that they "should look at the ELF
header to find this address, as it may change in the future". And even
when the address in question *has* actually been changed in the past,
without fanfare or thought to compatibility.

Thus we have bootloaders doing stunningly broken things like jumping
to offset 0x200 in the kernel startup code in 64-bit mode, *hoping*
that startup_64 is still there (it has moved at least once
before). And hoping that it's actually a 64-bit kernel despite the
fact that we don't give them any indication of that fact.

This patch should hopefully remove the temptation to abuse internal
addresses in future, where sternly worded comments have not sufficed.
Instead of having hard-coded addresses and saying "please don't abuse
these", we actually pull the addresses out of the ELF payload into
zoffset.h, and make build.c shove them back into the right places in
the bzImage header.

Rather than including zoffset.h into build.c and thus having to rebuild
the tool for every kernel build, we parse it instead. The parsing code
is small and simple.

This patch doesn't actually move any of the interesting entry points, so
any offending bootloader will still continue to "work" after this patch
is applied. For some version of "work" which includes jumping into the
compressed payload and crashing, if the bzImage it's given is a 32-bit
kernel. No change there then.

[ hpa: some of the issues in the description are addressed or
  retconned by the 2.12 boot protocol.  This patch has been edited to
  only remove fixed addresses that were *not* thus retconned. ]

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Link: http://lkml.kernel.org/r/1358513837.2397.247.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Matt Fleming <matt.fleming@intel.com>
11 years agox86, efi: Fix PCI ROM handing in EFI boot stub, in 32-bit mode
David Woodhouse [Mon, 7 Jan 2013 22:09:49 +0000 (22:09 +0000)]
x86, efi: Fix PCI ROM handing in EFI boot stub, in 32-bit mode

The 'Attributes' argument to pci->Attributes() function is 64-bit. So
when invoking in 32-bit mode it takes two registers, not just one.

This fixes memory corruption when booting via the 32-bit EFI boot stub.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: <stable@kernel.org>
Link: http://lkml.kernel.org/r/1358513837.2397.247.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Matt Fleming <matt.fleming@intel.com>
11 years agox86, efi: Fix 32-bit EFI handover protocol entry point
David Woodhouse [Mon, 7 Jan 2013 22:01:50 +0000 (22:01 +0000)]
x86, efi: Fix 32-bit EFI handover protocol entry point

If the bootloader calls the EFI handover entry point as a standard function
call, then it'll have a return address on the stack. We need to pop that
before calling efi_main(), or the arguments will all be out of position on
the stack.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: <stable@kernel.org>
Link: http://lkml.kernel.org/r/1358513837.2397.247.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Matt Fleming <matt.fleming@intel.com>
11 years agox86, efi: Fix display detection in EFI boot stub
David Woodhouse [Mon, 7 Jan 2013 21:52:16 +0000 (21:52 +0000)]
x86, efi: Fix display detection in EFI boot stub

When booting under OVMF we have precisely one GOP device, and it
implements the ConOut protocol.

We break out of the loop when we look at it... and then promptly abort
because 'first_gop' never gets set. We should set first_gop *before*
breaking out of the loop. Yes, it doesn't really mean "first" any more,
but that doesn't matter. It's only a flag to indicate that a suitable
GOP was found.

In fact, we'd do just as well to initialise 'width' to zero in this
function, then just check *that* instead of first_gop. But I'll do the
minimal fix for now (and for stable@).

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: <stable@kernel.org>
Link: http://lkml.kernel.org/r/1358513837.2397.247.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Matt Fleming <matt.fleming@intel.com>
11 years agosctp: set association state to established in dupcook_a handler
Xufeng Zhang [Wed, 23 Jan 2013 16:44:34 +0000 (16:44 +0000)]
sctp: set association state to established in dupcook_a handler

While sctp handling a duplicate COOKIE-ECHO and the action is
'Association restart', sctp_sf_do_dupcook_a() will processing
the unexpected COOKIE-ECHO for peer restart, but it does not set
the association state to SCTP_STATE_ESTABLISHED, so the association
could stuck in SCTP_STATE_SHUTDOWN_PENDING state forever.
This violates the sctp specification:
  RFC 4960 5.2.4. Handle a COOKIE ECHO when a TCB Exists
  Action
  A) In this case, the peer may have restarted. .....
     After this, the endpoint shall enter the ESTABLISHED state.

To resolve this problem, adding a SCTP_CMD_NEW_STATE cmd to the
command list before SCTP_CMD_REPLY cmd, this will set the restart
association to SCTP_STATE_ESTABLISHED state properly and also avoid
I-bit being set in the DATA chunk header when COOKIE_ACK is bundled
with DATA chunks.

Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoip6mr: limit IPv6 MRT_TABLE identifiers
Dan Carpenter [Wed, 23 Jan 2013 20:38:34 +0000 (20:38 +0000)]
ip6mr: limit IPv6 MRT_TABLE identifiers

We did this for IPv4 in b49d3c1e1c "net: ipmr: limit MRT_TABLE
identifiers" but we need to do it for IPv6 as well.  On IPv6 the name
is "pim6reg" instead of "pimreg" so there is one less digit allowed.

The strcpy() is in ip6mr_reg_vif().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agor8169: fix vlan tag read ordering.
françois romieu [Thu, 24 Jan 2013 13:30:06 +0000 (13:30 +0000)]
r8169: fix vlan tag read ordering.

Control of receive descriptor must not be returned to ethernet chipset
before vlan tag processing is done.

VLAN tag receive word is now reset both in normal and error path.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Spotted-by: Timo Teras <timo.teras@iki.fi>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: cdc_ncm: use IAD provided by the USB core
Bjørn Mork [Fri, 25 Jan 2013 23:36:59 +0000 (23:36 +0000)]
net: cdc_ncm: use IAD provided by the USB core

commit 9992c2e (net: cdc_ncm: workaround for missing CDC Union)
added code to lookup an IAD for the interface we are probing.
This is redundant.  The USB core has already done the lookup
and saved the result in the USB interface struct.  Use that
instead.

Cc: Greg Suarez <gsuarez@smithmicro.com>
Cc: Alexey Orishko <alexey.orishko@stericsson.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
David S. Miller [Mon, 28 Jan 2013 00:10:36 +0000 (19:10 -0500)]
Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge

Included changes ares:
- fix an skb memleak in DAT
- fix the ARP filtering routine in DAT by preventing bogus entries to overwrite
  already existing ones in the local cache.
- fix the ARP filtering routine in DAT by preventing it to parse and add to the
  cache bogus entries

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agox86, boot: Define the 2.12 bzImage boot protocol
H. Peter Anvin [Sun, 27 Jan 2013 18:43:28 +0000 (10:43 -0800)]
x86, boot: Define the 2.12 bzImage boot protocol

Define the 2.12 bzImage boot protocol: add xloadflags and additional
fields to allow the command line, initramfs and struct boot_params to
live above the 4 GiB mark.

The xloadflags now communicates if this is a 64-bit kernel with the
legacy 64-bit entry point and which of the EFI handover entry points
are supported.

Avoid adding new read flags to loadflags because of claimed
bootloaders testing the whole byte for == 1 to determine bzImageness
at least until the issue can be researched further.

This is based on patches by Yinghai Lu and David Woodhouse.

Originally-by: Yinghai Lu <yinghai@kernel.org>
Originally-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/r/1359058816-7615-26-git-send-email-yinghai@kernel.org
Cc: Rob Landley <rob@landley.net>
Cc: Gokul Caushik <caushik1@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Joe Millenbach <jmillenbach@gmail.com>
11 years agoNFSv4.1: Ensure that nfs41_walk_client_list() does start lease recovery
Trond Myklebust [Sat, 19 Jan 2013 04:01:43 +0000 (23:01 -0500)]
NFSv4.1: Ensure that nfs41_walk_client_list() does start lease recovery

We do need to start the lease recovery thread prior to waiting for the
client initialisation to complete in NFSv4.1.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Ben Greear <greearb@candelatech.com>
Cc: stable@vger.kernel.org [>=3.7]