Commit graph

389608 commits

Author SHA1 Message Date
Josef Bacik b76bb70136 Btrfs: do not offset physical if we're compressed
xfstest btrfs/276 was freaking out on slower boxes partly because fiemap was
offsetting the physical based on the extent offset.  This is perfectly fine with
uncompressed extents, however the extent offset is into the uncompressed area,
not the compressed.  So we can return a physical value that isn't at all within
the area we have allocated on disk.  Fix this by returning the start of the
extent if it is compressed no matter what the offset.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-08-09 19:29:50 -04:00
Liu Bo b5b9b5b318 Btrfs: fix extent buffer leak after backref walking
commit 47fb091fb787420cd195e66f162737401cce023f(Btrfs: fix unlock after free on rewinded tree blocks)
takes an extra increment on the reference of allocated dummy extent buffer, so now we
cannot free this dummy one, and end up with extent buffer leak.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-08-09 19:29:42 -04:00
Liu Bo e68afa49ae Btrfs: fix a bug of snapshot-aware defrag to make it work on partial extents
For partial extents, snapshot-aware defrag does not work as expected,
since
a) we use the wrong logical offset to search for parents, which should be
   disk_bytenr + extent_offset, not just disk_bytenr,
b) 'offset' returned by the backref walking just refers to key.offset, not
   the 'offset' stored in btrfs_extent_data_ref which is
   (key.offset - extent_offset).

The reproducer:
$ mkfs.btrfs sda
$ mount sda /mnt
$ btrfs sub create /mnt/sub
$ for i in `seq 5 -1 1`; do dd if=/dev/zero of=/mnt/sub/foo bs=5k count=1 seek=$i conv=notrunc oflag=sync; done
$ btrfs sub snap /mnt/sub /mnt/snap1
$ btrfs sub snap /mnt/sub /mnt/snap2
$ sync; btrfs filesystem defrag /mnt/sub/foo;
$ umount /mnt
$ btrfs-debug-tree sda (Here we can check whether the defrag operation is snapshot-awared.

This addresses the above two problems.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-08-09 19:29:17 -04:00
Jie Liu 7cddc19392 btrfs: fix file truncation if FALLOC_FL_KEEP_SIZE is specified
Create a small file and fallocate it to a big size with
FALLOC_FL_KEEP_SIZE option, then truncate it back to the
small size again, the disk free space is not changed back
in this case. i.e,

total 4
-rw-r--r-- 1 root root 512 Jun 28 11:35 test

Filesystem      Size  Used Avail Use% Mounted on
....
/dev/sdb1       8.0G   56K  7.2G   1% /mnt

-rw-r--r-- 1 root root 512 Jun 28 11:35 /mnt/test

Filesystem      Size  Used Avail Use% Mounted on
....
/dev/sdb1       8.0G  5.1G  2.2G  70% /mnt

Filesystem      Size  Used Avail Use% Mounted on
....
/dev/sdb1       8.0G  5.1G  2.2G  70% /mnt

With this fix, the truncated up space is back as:
Filesystem      Size  Used Avail Use% Mounted on
....
/dev/sdb1       8.0G   56K  7.2G   1% /mnt

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
2013-08-09 19:28:56 -04:00
Linus Torvalds 14e94194d1 ACPI and power management fixes for 3.11-rc5
- ACPI-based memory hotplug stopped working after a recent change,
   because it's not possible to associate sufficiently many "physical"
   devices with one ACPI device object due to an artificial limit.
   Fix from Rafael J Wysocki removes that limit and makes memory
   hotplug work again.
 
 - A change made in 3.9 uncovered a bug in the ACPI processor driver
   preventing NUMA nodes from being put offline due to an ordering
   issue.  Fix from Yasuaki Ishimatsu changes the ordering to make
   things work again.
 
 - One of the recent ACPI video commits (that hasn't been reverted
   so far) uncovered a bug in the code handling quirky BIOSes that
   caused some Asus machines to boot with backlight completely off
   which made it quite difficult to use them afterward.  Fix from
   Felipe Contreras improves the quirk to cover this particular
   case correctly.
 
 - A cpufreq user space interface change made in 3.10 inadvertently
   renamed the ignore_nice_load sysfs attribute to ignore_nice which
   resulted in some confusion.  Fix from Viresh Kumar changes the name
   back to ignore_nice_load.
 
 - An initialization ordering change made in 3.9 broke cpufreq on
   loongson2 boards.  Fix from Aaro Koskinen restores the correct
   initialization ordering there.
 
 - Fix breakage resulting from a mistake made in 3.9 and causing the
   detection of some graphics adapters (that were detected correctly
   before) to fail.  There are two objects representing the same PCIe
   port in the affected systems' ACPI tables and both appear as
   "enabled" and we are expected to guess which one to use.  We used
   to choose the right one before by pure luck, but when we tried to
   address another similar corner case, the luck went away.  This time
   we try to make our guessing a bit more educated which is reported
   to work on those systems.
 
 - The /proc/acpi/wakeup interface code is missing some locking
   which may lead to breakage if that file is written or read during
   hotplug of wakeup devices.  That should be rare but still possible,
   so it's better to start using the appropriate locking there.
 
 /
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJSBQJtAAoJEKhOf7ml8uNs9FQP/1dhuih2SxwGG07//58AdQg8
 lIktdutgAxO8NvhYwP8SWH+SasBywkn2I6LSK2Ys8UMfUrfCMI/8jK1JMRmj+IfN
 tcd/13CdxV/sFDnnoQf1N/FCoskn8nNfbSw030lR3vHcBSc6CpqGHnQc8A78FNuC
 HohtV4xhHU3SCHOOiCP0HeVC3F3JMAlfRMbm/du1U9lrRpKXvU65J0JGvVG/9jn/
 HNd3OVvvJ7l7kbNy7D99MO2QbX8O21qgKnd26Rk2gdERygSdrrBG4uCL1TMH1+Kn
 Q4tKvUR6Ja/b7f8lyWjPApjhCsGYmzeYfSJtEFZunZwcHShmgliiofD1E3lLhnY+
 ZhUTgaalIETdcZy2GhzX42hi9YfqGUSeLccvqBEAC2eWCHhvKGw6A7kyBf6F9Sre
 eQpnnmOeKMNFwqEniYEcABWoG+XEtKWzxgIn9sX2aW/qkWLa/8i6PYOWe6Aze1Mr
 8DduFy6HuU9LSALdlPKhl8zlD1y3vY5UDNFN3X2Vpzx33NYv5Ft2aykFSxWpzgb9
 hVzWaYLS25SrxPncTgJZL8eR+/u7eY2B/OMczpfP+PmTztyCSTdPa0t6zn5xr5vq
 vLgfCh9lPXEaMz85Jlw5PZ+ZBAQ5PfjmIVB7ac0yM/G/J9N+h7q/J/BzbQEJDQI0
 qovn9XAIW6wpG9MiMJs3
 =0u8M
 -----END PGP SIGNATURE-----

Merge tag 'pm+acpi-3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki:

 - ACPI-based memory hotplug stopped working after a recent change,
   because it's not possible to associate sufficiently many "physical"
   devices with one ACPI device object due to an artificial limit.  Fix
   from Rafael J Wysocki removes that limit and makes memory hotplug
   work again.

 - A change made in 3.9 uncovered a bug in the ACPI processor driver
   preventing NUMA nodes from being put offline due to an ordering
   issue.  Fix from Yasuaki Ishimatsu changes the ordering to make
   things work again.

 - One of the recent ACPI video commits (that hasn't been reverted so
   far) uncovered a bug in the code handling quirky BIOSes that caused
   some Asus machines to boot with backlight completely off which made
   it quite difficult to use them afterward.  Fix from Felipe Contreras
   improves the quirk to cover this particular case correctly.

 - A cpufreq user space interface change made in 3.10 inadvertently
   renamed the ignore_nice_load sysfs attribute to ignore_nice which
   resulted in some confusion.  Fix from Viresh Kumar changes the name
   back to ignore_nice_load.

 - An initialization ordering change made in 3.9 broke cpufreq on
   loongson2 boards.  Fix from Aaro Koskinen restores the correct
   initialization ordering there.

 - Fix breakage resulting from a mistake made in 3.9 and causing the
   detection of some graphics adapters (that were detected correctly
   before) to fail.  There are two objects representing the same PCIe
   port in the affected systems' ACPI tables and both appear as
   "enabled" and we are expected to guess which one to use.  We used to
   choose the right one before by pure luck, but when we tried to
   address another similar corner case, the luck went away.  This time
   we try to make our guessing a bit more educated which is reported to
   work on those systems.

 - The /proc/acpi/wakeup interface code is missing some locking which
   may lead to breakage if that file is written or read during hotplug
   of wakeup devices.  That should be rare but still possible, so it's
   better to start using the appropriate locking there.

* tag 'pm+acpi-3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: Try harder to resolve _ADR collisions for bridges
  cpufreq: rename ignore_nice as ignore_nice_load
  cpufreq: loongson2: fix regression related to clock management
  ACPI / processor: move try_offline_node() after acpi_unmap_lsapic()
  ACPI: Drop physical_node_id_bitmap from struct acpi_device
  ACPI / PM: Walk physical_node_list under physical_node_lock
  ACPI / video: improve quirk check in acpi_video_bqc_quirk()
2013-08-09 15:07:19 -07:00
Linus Torvalds fdafa7cf97 Fix bug in adt7470 driver which causes it to fail writing fan speed limits.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJSBDHTAAoJEMsfJm/On5mBgT0QAJuym3tQB2wCNFXcB6wzp69z
 4/YuG/GFSizg1K8UgiBiawY/z+jhcXIu7fE3EmP/nizaPYY71ZSj+u4SMlynqEAG
 Y0zsM8ukb3X40TzsMG1GRhuiykNfPIONnJARJykc9QZZnwDrjn2N39T2WmJKokxf
 GnnkMAfHrP8W3ha74yn0ICta5edrWD4AYuYYKWx/LA/CwESAuvFQUGSjoQeuBdoP
 89i7aGlj7AyGHy7dYXgMhW/aMibyI6/k2qEIIsGmO+sHwoYUQ+jUrdH9JncBUWln
 bYaRcoVCs5yXQwHDKGJknAwa3+bFjJxyS7nTWpfM8SfGYVyjgbOQhFl+GlhxqzNO
 rD8aev+xu+SQ1oo2wjcHK/xck5paXpMWJiMgk0JIYyVf7GEmaP1YFrE5KxuBOVjd
 y4kRkr3yCZUfaU+ABBdaxtqBaL/PZcu+5WUCbPC3qcy5VkRxAdiiYpuvxK1ZSyeM
 g4rnsujEH+U2jbOmkGIigu7OFYWvwKLV4vT/7+PpJ/K9kZEw74mQ4WZtE4HSwLTB
 vZ0LqNTTASOwnSBpta+0EoMSk5HcPPYn8OOb7m3bkjw6uPEh/BtX7+Dvhh2qVYac
 9gMHLXNQ8x4sunKPyzIkUpawgfO5L8l/BCfYmkp/qakIjnNsUlI+AJLkjVRAjUu6
 ajzJh67AzXCD+fY/fWmT
 =HBa+
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fix from Guenter Roeck:
 "Fix bug in adt7470 driver which causes it to fail writing fan speed
  limits"

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (adt7470) Fix incorrect return code check
2013-08-09 15:06:17 -07:00
Linus Torvalds 79a6fb1ace Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab:
 "Some driver fixes (em28xx, coda, usbtv, s5p, hdpvr and ml86v7667) and
  a fix for media DocBook"

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] em28xx: fix assignment of the eeprom data
  [media] hdpvr: fix iteration over uninitialized lists in hdpvr_probe()
  [media] usbtv: fix dependency
  [media] usbtv: Throw corrupted frames away
  [media] usbtv: Fix deinterlacing
  [media] v4l2: added missing mutex.h include to v4l2-ctrls.h
  [media] DocBook: upgrade media_api DocBook version to 4.2
  [media] ml86v7667: fix compile warning: 'ret' set but not used
  [media] s5p-g2d: Fix registration failure
  [media] media: coda: Fix DT driver data pointer for i.MX27
  [media] s5p-mfc: Fix input/output format reporting
2013-08-09 15:04:09 -07:00
Linus Torvalds 58c59bc997 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID fix from Jiri Kosina:
 "Revert of a patch which breaks enumeration workaround in
  hid-logitech-dj"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  Revert "HID: hid-logitech-dj: querying_devices was never set"
2013-08-09 11:53:06 -07:00
Linus Torvalds 78ebf0e349 fbdev fixes:
- omapdss: compilation fix and DVI fix for PandaBoard
 - mxsfb: fix colors when using 18bit LCD bus
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJSBMT+AAoJEPo9qoy8lh71q+EP/jALUWxJQUpswFsuhKu6Mubf
 IUg9F06EH5D+P5IIUWTE5rU5rtEQVm6ANg3gfTiKmjepxgF0zb/odpFjNmhKiFXu
 HKqiJWixi07veAxWUidkF2YEPzmoRHQ7rLCVrE4Tg4n0MOzD43sp6HrNWHY3YN4m
 XT+V8ZFN0AyLBQveE70tGjuk8Th+tMb4Xoja6vGhpE4MvQJpdBHu9IencBIVlINW
 IXbVTCbApOVSbkLuZkXIivrhbWZQhmIYqDO5/kwgaTI7xpTcYlSzjHrhnbHZ/Lw9
 ZNCC6DP63v2PsPwakjSbAyQeFIj8k/iqvlpcGK7p7RHq2vIA/UL1Vr3gN/nNGC+k
 /ZeVyGOFfLKWJCvIcVEkQpZcQPg1bJafIEc4DexQc5kKU07GcnLi2bEwY7JezbYm
 skmiMTaDN4M4JFBltVy69bW/92Z1b1O2Ei+zulwP39OcgHLTooNqk8Y780EQROSM
 enuPtgxWiKjJJ1VJy1p4ZWqIn7mtaXuKsFsdMOC9ClQBpBdxrBw9PtV3rjkht7ov
 uU/5YPb/ccuyGW7dRK7zrmMMryaEq/YhJS/XKzT/5Xju2XvZk1XSSTJjvLeFyD3+
 Qwh+lYPCHLQM2ICajiAGSPmpwdvTRY9ViexnWESaZNwe8p1if0PIyE/tHpYsAYCy
 mzzoatK5N96HjIdrXBPK
 =bHE/
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-fixes-3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux

Pull fbdev fixes from Tomi Valkeinen:
 - omapdss: compilation fix and DVI fix for PandaBoard
 - mxsfb: fix colors when using 18bit LCD bus

* tag 'fbdev-fixes-3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
  ARM: OMAP: dss-common: fix Panda's DVI DDC channel
  video: mxsfb: fix color settings for 18bit data bus and 32bpp
  OMAPDSS: analog-tv-connector: compile fix
2013-08-09 11:52:34 -07:00
Linus Torvalds 6a93316661 Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
 "Mostly radeon, more fixes for dynamic power management which is is off
  by default for this release anyways, but there are a large number of
  testers, so I'd like to keep merging the fixes.

  Otherwise, radeon UVD fixes affecting suspend/resume regressions, i915
  regression fixes, one for your mac mini, ast, mgag200, cirrus ttm fix
  and one regression fix in the core"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (25 commits)
  drm: Don't pass negative delta to ktime_sub_ns()
  drm/radeon: make missing smc ucode non-fatal
  drm/radeon/dpm: require rlc for dpm
  drm/radeon/cik: use a mutex to properly lock srbm instanced registers
  drm/radeon: remove unnecessary unpin
  drm/radeon: add more UVD CS checking
  drm/radeon: stop sending invalid UVD destroy msg
  drm/radeon: only save UVD bo when we have open handles
  drm/radeon: always program the MC on startup
  drm/radeon: fix audio dto calculation on DCE3+ (v3)
  drm/radeon/dpm: disable sclk ss on rv6xx
  drm/radeon: fix halting UVD
  drm/radeon/dpm: adjust power state properly for UVD on SI
  drm/radeon/dpm: fix spread spectrum setup (v2)
  drm/radeon/dpm: adjust thermal protection requirements
  drm/radeon: select audio dto based on encoder id for DCE3
  drm/radeon: properly handle pm on gpu reset
  drm/i915: do not disable backlight on vgaswitcheroo switch off
  drm/i915: Don't call encoder's get_config unless encoder is active
  drm/i915: avoid brightness overflow when doing scale
  ...
2013-08-09 11:51:29 -07:00
Oleg Nesterov 201d3dfa4d dlm: kill the unnecessary and wrong device_close()->recalc_sigpending()
device_close()->recalc_sigpending() is not needed, sigprocmask() takes
care of TIF_SIGPENDING correctly.

And without ->siglock it is racy and wrong, it can wrongly clear
TIF_SIGPENDING and miss a signal.

But even with this patch device_close() is still buggy:

  1. sigprocmask() should not be used, we have set_task_blocked(),
     but this is minor.

  2. We should never block SIGKILL or SIGSTOP, and this is what
     the code tries to do.

  3. This can't protect against SIGKILL or SIGSTOP anyway. Another
     thread can do signal_wake_up(), say, do_signal_stop() or
     complete_signal() or debugger.

  4. sigprocmask(SIG_BLOCK, allsigs) doesn't necessarily clears
     TIF_SIGPENDING, say, freezing() or ->jobctl.

  5. device_write() looks equally wrong by the same reason.

Looks like, this tries to protect some wait_event_interruptible() logic
from signals, it should be turned into uninterruptible wait.  Or we need
to implement something like signals_stop/start for such a use-case.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-08-09 10:48:20 -07:00
Jiri Kosina 8e5654ce69 Revert "HID: hid-logitech-dj: querying_devices was never set"
This reverts commit 407a2c2a4d.

Explanation provided by Benjamin Tissoires:

Commit "HID: hid-logitech-dj, querying_devices was never set" activate
a flag which guarantees that we do not ask the receiver for too many
enumeration. When the flag is set, each following enumeration call is
discarded (the usb request is not forwarded to the receiver). The flag
is then released when the driver receive a pairing information event,
which normally follows the enumeration request.
However, the USB3 bug makes the driver think the enumeration request
has been forwarded to the receiver. However, it is actually not the
case because the USB stack returns -EPIPE. So, when a new unknown
device appears, the workaround consisting in asking for a new
enumeration is not working anymore: this new enumeration is discarded
because of the flag, which is never reset.

A solution could be to trigger a timeout before releasing it, but for
now, let's just revert the patch.

Reported-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Tested-by: Sune Mølgaard <sune@molgaard.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-08-09 11:34:19 +02:00
Michael Neuling 28e61cc466 powerpc/tm: Fix context switching TAR, PPR and DSCR SPRs
If a transaction is rolled back, the Target Address Register (TAR), Processor
Priority Register (PPR) and Data Stream Control Register (DSCR) should be
restored to the checkpointed values before the transaction began.  Any changes
to these SPRs inside the transaction should not be visible in the abort
handler.

Currently Linux doesn't save or restore the checkpointed TAR, PPR or DSCR.  If
we preempt a processes inside a transaction which has modified any of these, on
process restore, that same transaction may be aborted we but we won't see the
checkpointed versions of these SPRs.

This adds checkpointed versions of these SPRs to the thread_struct and adds the
save/restore of these three SPRs to the treclaim/trechkpt code.

Without this if any of these SPRs are modified during a transaction, users may
incorrectly see a speculated SPR value even if the transaction is aborted.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Cc: <stable@vger.kernel.org> [v3.10]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:07:12 +10:00
Michael Neuling c2d52644e2 powerpc: Save the TAR register earlier
This moves us to save the Target Address Register (TAR) a earlier in
__switch_to.  It introduces a new function save_tar() to do this.

We need to save the TAR earlier as we will overwrite it in the transactional
memory reclaim/recheckpoint path.  We are going to do this in a subsequent
patch which will fix saving the TAR register when it's modified inside a
transaction.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Cc: <stable@vger.kernel.org> [v3.10]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:07:08 +10:00
Michael Neuling 2517617e0d powerpc: Fix context switch DSCR on POWER8
POWER8 allows the DSCR to be accessed directly from userspace via a new SPR
number 0x3 (Rather than 0x11.  DSCR SPR number 0x11 is still used on POWER8 but
like POWER7, is only accessible in HV and OS modes).  Currently, we allow this
by setting H/FSCR DSCR bit on boot.

Unfortunately this doesn't work, as the kernel needs to see the DSCR change so
that it knows to no longer restore the system wide version of DSCR on context
switch (ie. to set thread.dscr_inherit).

This clears the H/FSCR DSCR bit initially.  If a process then accesses the DSCR
(via SPR 0x3), it'll trap into the kernel where we set thread.dscr_inherit in
facility_unavailable_exception().

We also change _switch() so that we set or clear the H/FSCR DSCR bit based on
the thread.dscr_inherit.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Cc: <stable@vger.kernel.org> [v3.10]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:07:05 +10:00
Michael Neuling 74e400cee6 powerpc: Rework setting up H/FSCR bit definitions
This reworks the Facility Status and Control Regsiter (FSCR) config bit
definitions so that we can access the bit numbers.  This is needed for a
subsequent patch to fix the userspace DSCR handling.

HFSCR and FSCR bit definitions are the same, so reuse them.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Cc: <stable@vger.kernel.org> [v3.10]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:07:01 +10:00
Michael Neuling 88f094120b powerpc: Fix hypervisor facility unavaliable vector number
Currently if we take hypervisor facility unavaliable (from 0xf80/0x4f80) we
mark it as an OS facility unavaliable (0xf60) as the two share the same code
path.

The becomes a problem in facility_unavailable_exception() as we aren't able to
see the hypervisor facility unavailable exceptions.

Below fixes this by duplication the required macros.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Cc: <stable@vger.kernel.org> [v3.10]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:06:58 +10:00
Thadeu Lima de Souza Cascardo e0e1361462 powerpc/kvm/book3s_pr: Return appropriate error when allocation fails
err was overwritten by a previous function call, and checked to be 0. If
the following page allocation fails, 0 is going to be returned instead
of -ENOMEM.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:06:54 +10:00
Chen Gang 2fb10672c8 powerpc/kvm: Add signed type cast for comparation
'rmls' is 'unsigned long', lpcr_rmls() will return negative number when
failure occurs, so it need a type cast for comparing.

'lpid' is 'unsigned long', kvmppc_alloc_lpid() return negative number
when failure occurs, so it need a type cast for comparing.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:06:51 +10:00
Mike Qiu 144136dd7a powerpc/eeh: Add missing procfs entry for PowerNV
The procfs entry for global statistics has been missed on PowerNV
platform and the patch is going to add that.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Acked-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:06:47 +10:00
Aruna Balakrishnaiah 156c9ebdac powerpc/pseries: Add backward compatibilty to read old kernel oops-log
Older kernels has just length information in their header. Handle it
while reading old kernel oops log from pstore.

Applies on top of powerpc/pseries: Fix buffer overflow when reading from pstore

Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:06:44 +10:00
Aruna Balakrishnaiah 7e76f34fa1 powerpc/pseries: Fix buffer overflow when reading from pstore
When reading from pstore there is a buffer overflow during decompression
due to the header added in unzip_oops. Remove unzip_oops and call
pstore_decompress directly in nvram_pstore_read. Allocate buffer of size
report_length of the oops header as header will not be deallocated in pstore.
Since we have 'openssl' command line tool to decompress the compressed data,
dump the compressed data in case decompression fails instead of not dumping
anything.

Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-09 18:06:40 +10:00
Anton Blanchard 4e90a2a737 powerpc: On POWERNV enable PPC_DENORMALISATION by default
We want PPC_DENORMALISATION enabled when POWERNV is enabled,
so update the Kconfig.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: <stable@vger.kernel.org>
2013-08-09 18:05:29 +10:00
Dave Airlie e42f581421 Merge tag 'drm-intel-fixes-2013-08-08' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes
Daniel writes:
A few bugfixes for serious stuff and regressions. Highlight is the
reinstated hack to keep the i915 backlight on when running on an optimus
machine, this prevents black screens especially with some radeon muxed
platforms. And the patch to quiet dmesg on Linus' old mac mini ;-)

* tag 'drm-intel-fixes-2013-08-08' of git://people.freedesktop.org/~danvet/drm-intel:
  drm/i915: do not disable backlight on vgaswitcheroo switch off
  drm/i915: Don't call encoder's get_config unless encoder is active
  drm/i915: avoid brightness overflow when doing scale
  drm/i915: update last_vblank when disabling the power well
  drm/i915: fix gen4 digital port hotplug definitions
2013-08-09 09:09:37 +10:00
Linus Torvalds 6c2580c501 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32
Pull AVR32 build fix from Hans-Christian Egtvedt.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
  avr32: boards/atngw100/mrmt.c: fix building error
2013-08-08 13:11:53 -07:00
Oleg Nesterov 8742f229b6 userns: limit the maximum depth of user_namespace->parent chain
Ensure that user_namespace->parent chain can't grow too much.
Currently we use the hardroded 32 as limit.

Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-08-08 13:11:39 -07:00
Curt Brune 93d783bcca hwmon: (adt7470) Fix incorrect return code check
In adt7470_write_word_data(), which writes two bytes using
i2c_smbus_write_byte_data(), the return codes are incorrectly AND-ed
together when they should be OR-ed together.

The return code of i2c_smbus_write_byte_data() is zero for success.

The upshot is only the first byte was ever written to the hardware.
The 2nd byte was never written out.

I noticed that trying to set the fan speed limits was not working
correctly on my system.  Setting the fan speed limits is the only
code that uses adt7470_write_word_data().  After making the change
the limit settings work and the alarms work also.

Signed-off-by: Curt Brune <curt@cumulusnetworks.com>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-08 12:43:07 -07:00
Linus Torvalds 55f5bfd4c9 ext4 bugfixes for v3.11-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABCAAGBQJR+YUoAAoJENNvdpvBGATwxsgQAJzxe8x1SWW8jrvasMELW3bS
 I7gl3lu789GROmZo5MI6+XI1DSCjHcMTisoPnPGx8q9LNhiYQGjp9Loxgl+L+Cem
 wbDfkSHrhxtDoEw2rdpPb/hFHOpsv8t6TT53GVbdc5l/lxwyvdrblXxhWbLuTRCQ
 G0X2VoxvTph7SyVPpRqoU4U99vW3g6LRI0dsxyU8kLc/kp7/t89gwh6Gj0wlb6tb
 4pswvEuxK4HauMPjajCIaEeGpQoHbvCVpB4P9HvEtL/wklc5hNIAWy5+KYjMFWil
 8Vc6RsJv6DZc66z+X4PT1oYrx6bkhNKNRGBETV2/dzeLU/7o2ttUIQ0vlOlN9gKV
 xSne19OKwqhhRMuWrc3LDzunlFiLex2zHbZJVDOeKNXmEJVpO9ZPVkvpoi/g0vOE
 DPwcc89J+763CVmXu8uyPqgQRfJTp2dXNggP3lINCDi1mFayrBqR0S6rQ1B2m/6R
 8HYDjJ6gBpXBcs0FTGh1cfbpI8GpPx9Xu3Q/FtjvczEXUO3831KCm+k7O3cUjB72
 I7I3wmyYQvUanOc39fg+EZ0cXpiSIZG4Mjv+8vWgADFlCMUKMaC+vp2PuKmBxTuk
 7dAkxKr2kXfMirGWF1R/vo/CaKnCWmJbAJDFJ8Mt/Nk3zn3NOl/kCRtxndlj7k+m
 /s8DHlVLyD8dgvzRO9gp
 =xqB3
 -----END PGP SIGNATURE-----

Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 bugfixes from Ted Ts'o.

Misc ext4 fixes, delayed by Ted moving mail servers and email getting
marked as spam due to bad spf records.

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: add WARN_ON to check the length of allocated blocks
  ext4: fix retry handling in ext4_ext_truncate()
  ext4: destroy ext4_es_cachep on module unload
  ext4: make sure group number is bumped after a inode allocation race
2013-08-08 09:38:19 -07:00
Linus Torvalds 64b4aaf025 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security layer fix from James Morris:
 "Smack casting fix"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  Smack: IPv6 casting error fix for 3.11
2013-08-08 09:36:38 -07:00
Linus Torvalds 84e4526f88 regulator: DT binding fixes for v3.11
A couple of fixes to bring the DT binding documentation for Palmas into
 sync with the code.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSA3XHAAoJELSic+t+oim99V8P/RlIUqTKx17nWChbpbTYgysx
 PNuwXp5TUjkvCmTtCy0OvdxyLoYWGR+LLzNfhYPNItLD9uXMA4Z6I+oNDb0wNxGl
 XbPBN3FfZg2SEfV6gjXonXGOhLM7nT/90xwfKBHj2dmkZTCpu2BRnnm5qwgdyfKv
 QZytKT3YajmcInCmaaanXznRRAqezc61audbGxbd2g0ewmMUs9NEt6UhkswluQsP
 oxYOQ8RnW6jUvZ4451Z2UsYsV/oijZwrqg+gkNz1McEePPS86Yidr4flmv83gB9Y
 tFMt4kzw0onHGpH2tmNsvkPkgk3DULdo1P/wiWi/Ap51/ZuhCkEPHIu1MariwEGf
 thMrlGqN6FYbT4+j+MzHbF2cM/QodQuN6hqRbUSQO2hYVu8/isoh3bySQPyyK6c6
 idbmdEe3oot+OWkBN7wICI0qlNZQBnAq+R/SLzrlOWtW+coGEnOwmMiM18MS9UcV
 1Y/cNxS1zhXoFNoNVXjgUWdrTmxMEbVLI9Hr/5XjfBJIYR+uJOtsIPno3NuFJ7o4
 4C1RSOxtLsdyP6aJ1IsozUGIRARgVsys6oVKAVW6atJDTTzOW/Qm+2uhSjbJuR5c
 W1npzNKvyuFZ+rgiHJPpI+5f5TS30ct56c6UDj0c7fHlYP4PE7u3y3hsTV4DyhIK
 LwUGRM9rjtnLF0jvxdac
 =faDW
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator DT binding fixes from Mark Brown:
 "A couple of fixes to bring the DT binding documentation for Palmas
  into sync with the code"

* tag 'regulator-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: palmas-pmic: doc: remove ti,tstep
  regulator: palmas-pmic: doc: fix typo for sleep-mode
2013-08-08 09:34:40 -07:00
Linus Torvalds d56290bbc1 regmap: Fixes for v3.11
Two things here, one is a fix for a nasty issue where we were failing to
 sync the last register in a block when using raw writes and the other
 fixes a missing header for the !REGMAP stubs so that we don't rely on
 implicit includes in that case.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSA3O4AAoJELSic+t+oim9stQP+QFLjbyTpjBe10scjPnZ94MV
 yfAl31+uBi80YPsNxTQC/JxzNtQCn+X0Y7I2/gdpf5DcUA6Vw+D8l5ABZDAiWWmU
 FtijXn86zEmHtjGD88om4WX7trm9wKnL0YYUdNUXYeXduoLl9uElZGqSZedDziXk
 5W0967WTKu22OeqsRe5PtXmjtFfWuI0TYEHboc7KVNTZRFdDQVzmr5oRynzW3rL2
 vZ3bb9GK0fN2RTwWhjQu5fQJfjV7ZS30JAy6/uHAWaeh1u90yCcMoHgRJ0YfuBMj
 3ggFVvMU2rgg9NOdlv4WuxUWEnElgKi6kWg2Figu8gKFeUPlbxkw6AMwYlg9eyUR
 mSRoBs34iN1kdPqe467pKxjKZLrhyu3ZDK2fnR+wCQ8uWqKrjE/YvTiYCfzuwi6S
 AMV/FiOVSzhTIyQxtvgyhGP5hR401UZtOo4Lom1GcXKeLX3/vPceErqBFYM3m7bB
 pf0BlovDR1BgmN6NB9oIk8Q60NJD7Rjl1dYxXyTAgWVSZLVy3mpYYvqvBsLBtfbA
 L9hhLuQ5dHWg3rNWLNaKX0z5sBNklnCfSHUhfURBO5X8H+5eoVQatqv9ZCleJp8X
 Xyyjjsu4UyoBLfOMmlEEoxsYnhNbTAgvHFZ7YD5DlnZruLPT/hMgvoyf4kWoFFCc
 zU96Lr3d9NIBgVtb+0C/
 =OFAa
 -----END PGP SIGNATURE-----

Merge tag 'regmap-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap fixes from Mark Brown:
 "Two things here, one is a fix for a nasty issue where we were failing
  to sync the last register in a block when using raw writes and the
  other fixes a missing header for the !REGMAP stubs so that we don't
  rely on implicit includes in that case"

* tag 'regmap-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: Add missing header for !CONFIG_REGMAP stubs
  regmap: cache: Make sure to sync the last register in a block
2013-08-08 09:34:04 -07:00
Linus Torvalds 91b831a207 spi: Simple fix for davinci
Just one update for SPI, a simple fix to the davinci driver to correct
 the direction for which DMA is mapped following the dmaengine
 conversion.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSA3JLAAoJELSic+t+oim9V4EP/1y95gtcWpo6NOxvu88+FRar
 QC5FOnuDQRBgZnupurK95C27JZOJfwH0o/6PLiG/c/f+nEYyBhFFnJ+5ZC8O6Rg9
 gzGWymtDAuS6Rlh6MI7f++k3z2DrSj8KF/0v2KW71CgaKmdvpTOoXK8FVBXx6Y5W
 X74vW/+aZVQU483OUygYHl67QHDuOpKLQwkTKMcxVAheWHRCcb3zhUUgVKog8EEi
 Ukl6C2xV67b7/x1TFGhUouq1pS0ShLNQdLYL8NLuc+HdFxg/nob1hGtu9crZ0Asp
 FdqIQ6OBJfxkpklBY5g7GDabKD80Wb16fG9JYp0PpRphvrtKpn9rPejQXDpeIhHY
 kw+5o0rw0YqyCaL2Gs9uvmgKjYXhrs+lLogCHWxRg7JbMF6FfvDkBJd8wG5UiYEY
 /AvHNhsaY1YszdyNqRRc5AOrD8WEmDMS1kWDGk4tOw1lu+3X0gVzxx+7kZa61H9r
 t0nFpcuRnvqyiPiGC7kH8g9/BeLMG/kW9h+1W92kIfwof2A9CufTKSFS78/UEw/C
 CUTds7hFlpDh8fGSUpx5hr3xC4oGZxSF2hJTtFuHNjKnVfrxBeUQcF+y4oR8+kWH
 89Xt1GqO7wKjyVXVlqWL+bCD11s37Ur7PcaFTqIxDKxRA2TY21/THuFJ/JQnEbaa
 KCyCUBODgPFJ42X0jXfY
 =zVk5
 -----END PGP SIGNATURE-----

Merge tag 'spi-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fix from Mark Brown:
 "Just one update for SPI, a simple fix to the davinci driver to correct
  the direction for which DMA is mapped following the dmaengine
  conversion"

* tag 'spi-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: spi-davinci: Fix direction in dma_map_single()
2013-08-08 09:33:27 -07:00
Linus Torvalds bb014db07c More virtio console fixes than I'm happy with, but all real issues,
and all CC:stable..
 
 Thanks,
 Rusty.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJSAtjmAAoJENkgDmzRrbjxV/kP+wQaShGQ6Q8U7yYew7yZvo2H
 CE3VHpSkp3NnJfAqNMz/sCES7pAvYXvUM1hcVQ+GI1ZqVnN5yJViqeygIOU/xQEN
 WjslgtCvpdw0/R3dL4oxhcIMdgBioP9hknB56WPqHFZ9Ytb5GxPVf4wCNpd7FrsC
 iGHklImzN1r4AjxSTdbCCCk8iYKJOJRTAfZrtVtkc9uOU68GGBcAl8ArSPIScwEb
 41JuuB/Qgja0ssCYpD5jrC74QePvU1eTgSQWs8Tgc6v43UNFjZyKWSY8G13MAd+l
 c3SCLCRqzPxpwhIhvAMQFnkmIlIqVpp66nnh6AqJt8Mw2ymSvP3AY5PMegV92Al+
 afBofUz2KRPinGINe7SrrpRt/NU3SM+k1CWHeVu76U7V59f8ohxW9dLqI6otOrq+
 6GZx2Z9vyVkj4TP8vz4rNZINKXjRBaGhTNcQ0rM3obMFM4Dg+4dhF+PpGA8UyFwI
 3Tw2c0zbVIqQ6fEO63ZYGhAdVNdlZoPA2tuA34hfY/D07842tgkPhuAF6yDeb4jg
 JmiERc506JpLws0Tu6E6H+x6LQAGr9cYPgBpvucab/SVa3bcrEJj2oqDt0pZaTiO
 q6HkkDwfoDVdv9TY3sCgOmKSUp/smkrloa3vMHLUZsnjx66iIPdHn+PcN/7Im8ut
 kfnKgLgo/BloWT0XeFv+
 =ZV9B
 -----END PGP SIGNATURE-----

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

Pull virtio fixes from Rusty Russell:
 "More virtio console fixes than I'm happy with, but all real issues,
  and all CC:stable.."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  virtio-scsi: Fix virtqueue affinity setup
  virtio: console: return -ENODEV on all read operations after unplug
  virtio: console: fix raising SIGIO after port unplug
  virtio: console: clean up port data immediately at time of unplug
  virtio: console: fix race in port_fops_open() and port unplug
  virtio: console: fix race with port unplug and open/close
  virtio/console: Add pipe_lock/unlock for splice_write
  virtio/console: Quit from splice_write if pipe->nrbufs is 0
2013-08-08 09:32:20 -07:00
Linus Torvalds 67ef626506 ARM: SoC fixes for v3.11-rc
- MSM: GPIO fixes (includes old code removal)
 - OMAP: earlyprintk regression, AM33xx cpgmac PM regression
 - OMAP5: urgent fix for potentially harmful voltage regulator values
 - Renesas: gpio-keys fix, fix SD card detection, fix shdma calculation error
 - STi: critical SMP boot fix
 - tegra: DTS fix for usb-phy
 - a couple MAINTAINERS updates
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJSAshIAAoJEFk3GJrT+8Zl3i8QAITSHEVGoksh0dgi2djlknMK
 HoZq35kL/tpUCzZZkt3YroQFAgCeNhnfaWoelR2I7Pvaevyu7Z0wpIigfNhnraH2
 cvzlaZPZKJxW32yPWrOOJjaEaxQ8ltBIt6XUfqMusXHKPI99XV3nkj/6vuux3OXI
 9ADE4lHtH2mlMjOgoP4xJb+cID1raRloXjNWz69u816/a+cujT+3ghqE9DDZY1Xo
 7exYSukwaMLVFg2HpG+LbNzpZxHYD1oIR4Mww79XefMq0/7JDlb+e7DuvIhNlPAW
 GPZMfE98h+YPLYTVFW3rKcQCIl081IsaZRIQSupX2J2jGW6Izv16lZad5yBvLYhk
 TX41o4ATfpS/FAW7ahz2olhewsHvLY/5TYDjlr/ULSBWcaE5/v6Zu7H3DaZ4BFho
 T8WMf6pYz8Mu2fSBbkLonbt+mJBdzh1/42M0bCO469VBlls3B79efuEvhU2V+XC4
 APuCd9m/Eo5Uf+1dJP0IcvHwVRPbJGH75dGnWCAVD0gkQ9cAHoinT9jqHW3gIB9o
 FE/yUx0w9Bq0p/7twF2xgKaBqAMzcACDWXozfY8+8gXGfoqh32WY72qUV4lUycYa
 3La2pg6NeD37pVtspG9lGZg8iQJSL+WKzba3NTuZry2st+/mHP5QXQZhgtz8jzkc
 GHwcz+o7yQm31P17N7I+
 =aecr
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Kevin Hilman:
 - MSM: GPIO fixes (includes old code removal)
 - OMAP: earlyprintk regression, AM33xx cpgmac PM regression
 - OMAP5: urgent fix for potentially harmful voltage regulator values
 - Renesas: gpio-keys fix, fix SD card detection, fix shdma calculation
   error
 - STi: critical SMP boot fix
 - tegra: DTS fix for usb-phy
 - a couple MAINTAINERS updates

(Arnd is on paternity leave, Kevin is stepping up to help arm-soc
maintenance)

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  MAINTAINERS: add TI Keystone ARM platform
  MAINTAINERS: delete Srinidhi from ux500
  ARM: tegra: enable ULPI phy on Colibri T20
  ARM: STi: remove sti_secondary_start from INIT section.
  ARM: STi: Fix cpu nodes with correct device_type.
  ARM: shmobile: lager: do not annotate gpio_buttons as __initdata
  ARM: shmobile: BOCK-W: fix SDHI0 PFC settings
  shdma: fixup sh_dmae_get_partial() calculation error
  ARM: OMAP2+: hwmod: AM335x: fix cpgmac address space
  ARM: OMAP2+: hwmod: rt address space index for DT
  ARM: OMAP2+: Sync hwmod state with the pm_runtime and omap_device state
  ARM: OMAP2+: Avoid idling memory controllers with no drivers
  ARM: OMAP2+: hwmod: Fix a crash in _setup_reset() with DEBUG_LL
  ARM: dts: omap5-uevm: update optional/unused regulator configurations
  ARM: dts: omap5-uevm: fix regulator configurations mandatory for SoC
  ARM: dts: omap5-uevm: document regulator signals used on the actual board
  ARM: msm: Consolidate gpiomux for older architectures
  ARM: shmobile: armadillo800eva: Don't request GPIO 166 in board code
  ARM: msm: dts: Fix the gpio register address for msm8960
2013-08-08 09:28:08 -07:00
Linus Torvalds 370905069c Revert "slub: do not put a slab to cpu partial list when cpu_partial is 0"
This reverts commit 318df36e57.

This commit caused Steven Rostedt's hackbench runs to run out of memory
due to a leak.  As noted by Joonsoo Kim, it is buggy in the following
scenario:

 "I guess, you may set 0 to all kmem caches's cpu_partial via sysfs,
  doesn't it?

  In this case, memory leak is possible in following case.  Code flow of
  possible leak is follwing case.

   * in __slab_free()
   1. (!new.inuse || !prior) && !was_frozen
   2. !kmem_cache_debug && !prior
   3. new.frozen = 1
   4. after cmpxchg_double_slab, run the (!n) case with new.frozen=1
   5. with this patch, put_cpu_partial() doesn't do anything,
      because this cache's cpu_partial is 0
   6. return

  In step 5, leak occur"

And Steven does indeed have cpu_partial set to 0 due to RT testing.

Joonsoo is cooking up a patch, but everybody agrees that reverting this
for now is the right thing to do.

Reported-and-bisected-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-08-08 09:06:37 -07:00
Cong Ding c4afd7b95f avr32: boards/atngw100/mrmt.c: fix building error
there is an additional "{", which causes building error.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
2013-08-08 14:16:22 +02:00
Clemens Ladisch 57e6dae108 ALSA: usb-audio: do not trust too-big wMaxPacketSize values
The driver used to assume that the streaming endpoint's wMaxPacketSize
value would be an indication of how much data the endpoint expects or
sends, and compute the number of packets per URB using this value.

However, the Focusrite Scarlett 2i4 declares a value of 1024 bytes,
while only about 88 or 44 bytes are be actually used.  This discrepancy
would result in URBs with far too few packets, which would not work
correctly on the EHCI driver.

To get correct URBs, use wMaxPacketSize only as an upper limit on the
packet size.

Reported-by: James Stone <jamesmstone@gmail.com>
Tested-by: James Stone <jamesmstone@gmail.com>
Cc: <stable@vger.kernel.org> # 2.6.35+
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-08 11:37:34 +02:00
Trond Myklebust b72888cb0b NFSv4: Fix up nfs4_proc_lookup_mountpoint
Currently, we do not check the return value of client = rpc_clone_client(),
nor do we shut down the resulting cloned rpc_clnt in the case where a
NFS4ERR_WRONGSEC has caused nfs4_proc_lookup_common() to replace the
original value of 'client' (causing a memory leak).

Fix both issues and simplify the code by moving the call to
rpc_clone_client() until after nfs4_proc_lookup_common() has
done its business.

Reported-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2013-08-07 20:47:26 -04:00
Michel Dänzer e91abf80a0 drm: Don't pass negative delta to ktime_sub_ns()
It takes an unsigned value. This happens not to blow up on 64-bit
architectures, but it does on 32-bit, causing
drm_calc_vbltimestamp_from_scanoutpos() to calculate totally bogus
timestamps for vblank events. Which in turn causes e.g. gnome-shell to
hang after a DPMS off cycle with current xf86-video-ati Git.

[airlied: regression introduced in drm: use monotonic time in drm_calc_vbltimestamp_from_scanoutpos]

Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59339
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59836
Tested-by: shui yangwei <yangweix.shui@intel.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-08-08 09:50:25 +10:00
Dave Airlie 16d5b27250 Merge branch 'drm-fixes-3.11' of git://people.freedesktop.org/~agd5f/linux
Some more radeon fixes.  Mostly dpm and uvd fixes.  Fixes hangs
with dpm on more rv6xx asics, and fixes suspend and resume with UVD.

* 'drm-fixes-3.11' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: make missing smc ucode non-fatal
  drm/radeon/dpm: require rlc for dpm
  drm/radeon/cik: use a mutex to properly lock srbm instanced registers
  drm/radeon: remove unnecessary unpin
  drm/radeon: add more UVD CS checking
  drm/radeon: stop sending invalid UVD destroy msg
  drm/radeon: only save UVD bo when we have open handles
  drm/radeon: always program the MC on startup
  drm/radeon: fix audio dto calculation on DCE3+ (v3)
  drm/radeon/dpm: disable sclk ss on rv6xx
  drm/radeon: fix halting UVD
  drm/radeon/dpm: adjust power state properly for UVD on SI
  drm/radeon/dpm: fix spread spectrum setup (v2)
  drm/radeon/dpm: adjust thermal protection requirements
  drm/radeon: select audio dto based on encoder id for DCE3
  drm/radeon: properly handle pm on gpu reset
2013-08-08 09:47:02 +10:00
Alex Deucher 8a53fa23fd drm/radeon: make missing smc ucode non-fatal
The smc ucode is required for dpm (dynamic power
management), but if it's missing just skip dpm setup
and don't disable acceleration.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=67876

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:19 -04:00
Alex Deucher 761bfb9998 drm/radeon/dpm: require rlc for dpm
The rlc is required for dpm to work properly, so if
the rlc ucode is missing, don't enable dpm.  Enabling
dpm without the rlc enabled can result in hangs.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:19 -04:00
Alex Deucher f61d5b4677 drm/radeon/cik: use a mutex to properly lock srbm instanced registers
We need proper locking in the driver when accessing instanced
registers on CIK.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:18 -04:00
Christian König 3744b248f9 drm/radeon: remove unnecessary unpin
We don't pin the BO on allocation, so don't unpin it on free.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:17 -04:00
Christian König 56cc2c1538 drm/radeon: add more UVD CS checking
Improve error handling in case userspace sends us
an invalid command buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:16 -04:00
Christian König 641a00593f drm/radeon: stop sending invalid UVD destroy msg
We also need to check the handle.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:15 -04:00
Christian König 4ad9c1c774 drm/radeon: only save UVD bo when we have open handles
Otherwise just reinitialize from scratch on resume,
and so make it more likely to succeed.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:15 -04:00
Alex Deucher 6fab3febf6 drm/radeon: always program the MC on startup
For r6xx+ asics.  This mirrors the behavior of pre-r6xx
asics.  We need to program the MC even if something
else in startup() fails.  Failure to do so results in
an unusable GPU.

Based on a fix from: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2013-08-07 17:37:14 -04:00
Alex Deucher 1518dd8efd drm/radeon: fix audio dto calculation on DCE3+ (v3)
Need to set the wallclock ratio and adjust the phase
and module registers appropriately.  May fix problems
with audio timing at certain display timings.

v2: properly handle clocks below 24mhz
v3: rebase r600 changes

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:13 -04:00
Alex Deucher ce149a9406 drm/radeon/dpm: disable sclk ss on rv6xx
Enabling spread spectrum on the engine clock
leads to hangs on some asics.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=66963

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-08-07 17:37:12 -04:00