]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoMerge remote-tracking branch 'ext3/for_next'
Stephen Rothwell [Thu, 9 Apr 2015 01:37:46 +0000 (11:37 +1000)]
Merge remote-tracking branch 'ext3/for_next'

9 years agoMerge remote-tracking branch 'cifs/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 01:36:38 +0000 (11:36 +1000)]
Merge remote-tracking branch 'cifs/for-next'

9 years agoMerge remote-tracking branch 'ceph/master'
Stephen Rothwell [Thu, 9 Apr 2015 01:36:36 +0000 (11:36 +1000)]
Merge remote-tracking branch 'ceph/master'

Conflicts:
fs/ceph/inode.c
fs/ceph/snap.c
fs/ceph/super.c
fs/ceph/super.h
include/linux/ceph/libceph.h
net/ceph/auth_x.c
net/ceph/ceph_common.c

9 years agoMerge remote-tracking branch 'btrfs/next'
Stephen Rothwell [Thu, 9 Apr 2015 01:35:24 +0000 (11:35 +1000)]
Merge remote-tracking branch 'btrfs/next'

9 years agoMerge remote-tracking branch 'xtensa/for_next'
Stephen Rothwell [Thu, 9 Apr 2015 01:34:22 +0000 (11:34 +1000)]
Merge remote-tracking branch 'xtensa/for_next'

9 years agoMerge remote-tracking branch 'uml/linux-next'
Stephen Rothwell [Thu, 9 Apr 2015 01:33:15 +0000 (11:33 +1000)]
Merge remote-tracking branch 'uml/linux-next'

9 years agoMerge remote-tracking branch 'tile/master'
Stephen Rothwell [Thu, 9 Apr 2015 01:31:39 +0000 (11:31 +1000)]
Merge remote-tracking branch 'tile/master'

9 years agoMerge remote-tracking branch 's390/features'
Stephen Rothwell [Thu, 9 Apr 2015 01:30:36 +0000 (11:30 +1000)]
Merge remote-tracking branch 's390/features'

9 years agoMerge remote-tracking branch 'fsl/next'
Stephen Rothwell [Thu, 9 Apr 2015 01:27:54 +0000 (11:27 +1000)]
Merge remote-tracking branch 'fsl/next'

9 years agoMerge remote-tracking branch 'powerpc-mpe/next'
Stephen Rothwell [Thu, 9 Apr 2015 01:24:36 +0000 (11:24 +1000)]
Merge remote-tracking branch 'powerpc-mpe/next'

9 years agoMerge remote-tracking branch 'powerpc/next'
Stephen Rothwell [Thu, 9 Apr 2015 01:18:51 +0000 (11:18 +1000)]
Merge remote-tracking branch 'powerpc/next'

9 years agoMerge remote-tracking branch 'parisc-hd/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 01:17:50 +0000 (11:17 +1000)]
Merge remote-tracking branch 'parisc-hd/for-next'

9 years agoMerge remote-tracking branch 'mips/mips-for-linux-next'
Stephen Rothwell [Thu, 9 Apr 2015 01:08:28 +0000 (11:08 +1000)]
Merge remote-tracking branch 'mips/mips-for-linux-next'

Conflicts:
drivers/bus/Makefile
drivers/irqchip/Makefile

9 years agoMerge remote-tracking branch 'metag/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 01:07:25 +0000 (11:07 +1000)]
Merge remote-tracking branch 'metag/for-next'

9 years agoMerge remote-tracking branch 'm68knommu/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 01:06:24 +0000 (11:06 +1000)]
Merge remote-tracking branch 'm68knommu/for-next'

9 years agoMerge remote-tracking branch 'm68k/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 01:05:18 +0000 (11:05 +1000)]
Merge remote-tracking branch 'm68k/for-next'

9 years agoMerge remote-tracking branch 'ia64/next'
Stephen Rothwell [Thu, 9 Apr 2015 01:04:15 +0000 (11:04 +1000)]
Merge remote-tracking branch 'ia64/next'

9 years agoMerge remote-tracking branch 'cris/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 01:03:10 +0000 (11:03 +1000)]
Merge remote-tracking branch 'cris/for-next'

9 years agoMerge remote-tracking branch 'c6x/for-linux-next'
Stephen Rothwell [Thu, 9 Apr 2015 01:02:07 +0000 (11:02 +1000)]
Merge remote-tracking branch 'c6x/for-linux-next'

9 years agoMerge remote-tracking branch 'blackfin/for-linus'
Stephen Rothwell [Thu, 9 Apr 2015 01:00:51 +0000 (11:00 +1000)]
Merge remote-tracking branch 'blackfin/for-linus'

9 years agoMerge remote-tracking branch 'arm64-acpi/for-next/acpi'
Stephen Rothwell [Thu, 9 Apr 2015 00:49:43 +0000 (10:49 +1000)]
Merge remote-tracking branch 'arm64-acpi/for-next/acpi'

9 years agoMerge remote-tracking branch 'arm64/for-next/core'
Stephen Rothwell [Thu, 9 Apr 2015 00:48:37 +0000 (10:48 +1000)]
Merge remote-tracking branch 'arm64/for-next/core'

Conflicts:
arch/arm64/configs/defconfig

9 years agoMerge remote-tracking branch 'tegra/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:47:01 +0000 (10:47 +1000)]
Merge remote-tracking branch 'tegra/for-next'

9 years agoMerge remote-tracking branch 'sunxi/sunxi/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:45:54 +0000 (10:45 +1000)]
Merge remote-tracking branch 'sunxi/sunxi/for-next'

9 years agoMerge remote-tracking branch 'samsung/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:44:52 +0000 (10:44 +1000)]
Merge remote-tracking branch 'samsung/for-next'

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

9 years agoMerge remote-tracking branch 'renesas/next'
Stephen Rothwell [Thu, 9 Apr 2015 00:44:30 +0000 (10:44 +1000)]
Merge remote-tracking branch 'renesas/next'

9 years agoMerge remote-tracking branch 'omap-pending/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:44:29 +0000 (10:44 +1000)]
Merge remote-tracking branch 'omap-pending/for-next'

Conflicts:
arch/arm/mach-omap2/omap_hwmod_43xx_data.c

9 years agoMerge remote-tracking branch 'omap/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:43:09 +0000 (10:43 +1000)]
Merge remote-tracking branch 'omap/for-next'

9 years agoMerge remote-tracking branch 'mvebu/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:41:52 +0000 (10:41 +1000)]
Merge remote-tracking branch 'mvebu/for-next'

9 years agoMerge remote-tracking branch 'keystone/next'
Stephen Rothwell [Thu, 9 Apr 2015 00:41:46 +0000 (10:41 +1000)]
Merge remote-tracking branch 'keystone/next'

9 years agoMerge remote-tracking branch 'imx-mxs/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:40:30 +0000 (10:40 +1000)]
Merge remote-tracking branch 'imx-mxs/for-next'

9 years agoMerge remote-tracking branch 'cortex-m/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:40:28 +0000 (10:40 +1000)]
Merge remote-tracking branch 'cortex-m/for-next'

9 years agoMerge remote-tracking branch 'rpi/for-rpi-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:39:27 +0000 (10:39 +1000)]
Merge remote-tracking branch 'rpi/for-rpi-next'

9 years agoMerge remote-tracking branch 'at91/at91-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:38:17 +0000 (10:38 +1000)]
Merge remote-tracking branch 'at91/at91-next'

9 years agoMerge remote-tracking branch 'arm-soc/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:36:44 +0000 (10:36 +1000)]
Merge remote-tracking branch 'arm-soc/for-next'

9 years agoMerge remote-tracking branch 'arm-perf/for-next/perf'
Stephen Rothwell [Thu, 9 Apr 2015 00:35:38 +0000 (10:35 +1000)]
Merge remote-tracking branch 'arm-perf/for-next/perf'

9 years agoMerge remote-tracking branch 'arm/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:33:02 +0000 (10:33 +1000)]
Merge remote-tracking branch 'arm/for-next'

9 years agoMerge remote-tracking branch 'arc/for-next'
Stephen Rothwell [Thu, 9 Apr 2015 00:32:01 +0000 (10:32 +1000)]
Merge remote-tracking branch 'arc/for-next'

9 years agoMerge remote-tracking branch 'input-current/for-linus'
Stephen Rothwell [Thu, 9 Apr 2015 00:29:40 +0000 (10:29 +1000)]
Merge remote-tracking branch 'input-current/for-linus'

9 years agoMerge remote-tracking branch 'pci-current/for-linus'
Stephen Rothwell [Thu, 9 Apr 2015 00:29:38 +0000 (10:29 +1000)]
Merge remote-tracking branch 'pci-current/for-linus'

9 years agoMerge remote-tracking branch 'sound-current/for-linus'
Stephen Rothwell [Thu, 9 Apr 2015 00:29:37 +0000 (10:29 +1000)]
Merge remote-tracking branch 'sound-current/for-linus'

9 years agoMerge remote-tracking branch 'ipsec/master'
Stephen Rothwell [Thu, 9 Apr 2015 00:29:36 +0000 (10:29 +1000)]
Merge remote-tracking branch 'ipsec/master'

9 years agoMerge remote-tracking branch 'net/master'
Stephen Rothwell [Thu, 9 Apr 2015 00:29:35 +0000 (10:29 +1000)]
Merge remote-tracking branch 'net/master'

9 years agoMerge remote-tracking branch 'arm-current/fixes'
Stephen Rothwell [Thu, 9 Apr 2015 00:29:32 +0000 (10:29 +1000)]
Merge remote-tracking branch 'arm-current/fixes'

9 years agoMerge branch 'next-sriov' into next
Benjamin Herrenschmidt [Wed, 8 Apr 2015 23:14:38 +0000 (09:14 +1000)]
Merge branch 'next-sriov' into next

Merge Richard's work to support SR-IOV on PowerNV. All generic PCI
patches acked by Bjorn.

9 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Wed, 8 Apr 2015 22:12:25 +0000 (15:12 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Final drm fixes: one core locking imbalance regression, and a bunch of
  i915 baytrail s/r fixes"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm: fix drm_mode_getconnector() locking imbalance regression
  drm/i915/vlv: remove wait for previous GFX clk disable request
  drm/i915/chv: Remove Wait for a previous gfx force-off
  drm/i915/vlv: save/restore the power context base reg

9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Wed, 8 Apr 2015 21:51:56 +0000 (14:51 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client

Pull ceph revert from Sage Weil:
 "This corrects a recent misadventure with __GFP_MEMALLOC and
  PF_MEMALLOC; it turns out it's not a good fit for RBD and we're better
  off relying on dirty page throttling"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  Revert "libceph: use memalloc flags for net IO"

9 years agoMerge branch 'akpm' (patches from Andrew)
Linus Torvalds [Wed, 8 Apr 2015 21:42:49 +0000 (14:42 -0700)]
Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
 "Three fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm: numa: disable change protection for vma(VM_HUGETLB)
  include/linux/dmapool.h: declare struct device
  mm: move zone lock to a different cache line than order-0 free page lists

9 years agoCopy the kernel module data from user space in chunks
Linus Torvalds [Tue, 7 Apr 2015 17:33:49 +0000 (10:33 -0700)]
Copy the kernel module data from user space in chunks

Unlike most (all?) other copies from user space, kernel module loading
is almost unlimited in size.  So we do a potentially huge
"copy_from_user()" when we copy the module data from user space to the
kernel buffer, which can be a latency concern when preemption is
disabled (or voluntary).

Also, because 'copy_from_user()' clears the tail of the kernel buffer on
failures, even a *failed* copy can end up wasting a lot of time.

Normally neither of these are concerns in real life, but they do trigger
when doing stress-testing with trinity.  Running in a VM seems to add
its own overheadm causing trinity module load testing to even trigger
the watchdog.

The simple fix is to just chunk up the module loading, so that it never
tries to copy insanely big areas in one go.  That bounds the latency,
and also the amount of (unnecessarily, in this case) cleared memory for
the failure case.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agox86: clean up/fix 'copy_in_user()' tail zeroing
Linus Torvalds [Mon, 6 Apr 2015 17:26:17 +0000 (10:26 -0700)]
x86: clean up/fix 'copy_in_user()' tail zeroing

The rule for 'copy_from_user()' is that it zeroes the remaining kernel
buffer even when the copy fails halfway, just to make sure that we don't
leave uninitialized kernel memory around.  Because even if we check for
errors, some kernel buffers stay around after thge copy (think page
cache).

However, the x86-64 logic for user copies uses a copy_user_generic()
function for all the cases, that set the "zerorest" flag for any fault
on the source buffer.  Which meant that it didn't just try to clear the
kernel buffer after a failure in copy_from_user(), it also tried to
clear the destination user buffer for the "copy_in_user()" case.

Not only is that pointless, it also means that the clearing code has to
worry about the tail clearing taking page faults for the user buffer
case.  Which is just stupid, since that case shouldn't happen in the
first place.

Get rid of the whole "zerorest" thing entirely, and instead just check
if the destination is in kernel space or not.  And then just use
memset() to clear the tail of the kernel buffer if necessary.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge tag 'drm-intel-fixes-2015-04-08' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Wed, 8 Apr 2015 20:59:50 +0000 (06:59 +1000)]
Merge tag 'drm-intel-fixes-2015-04-08' of git://anongit.freedesktop.org/drm-intel into drm-fixes

three commits, all cc: stable, to address Baytrail
suspend/resume issues.

* tag 'drm-intel-fixes-2015-04-08' of git://anongit.freedesktop.org/drm-intel:
  drm/i915/vlv: remove wait for previous GFX clk disable request
  drm/i915/chv: Remove Wait for a previous gfx force-off
  drm/i915/vlv: save/restore the power context base reg

9 years agofou: Don't use const __read_mostly
Andi Kleen [Wed, 8 Apr 2015 13:04:31 +0000 (06:04 -0700)]
fou: Don't use const __read_mostly

const __read_mostly is a senseless combination. If something
is already const it cannot be __read_mostly. Remove the bogus
__read_mostly in the fou driver.

This fixes section conflicts with LTO.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: phy: broadcom: Add BCM54616S phy entry
Alessio Igor Bogani [Wed, 8 Apr 2015 10:15:18 +0000 (12:15 +0200)]
net: phy: broadcom: Add BCM54616S phy entry

Signed-off-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'rds'
David S. Miller [Wed, 8 Apr 2015 19:17:38 +0000 (15:17 -0400)]
Merge branch 'rds'

Sowmini Varadhan says:

====================
RDS: RDS-core fixes

This patch-series updates the RDS core and rds-tcp modules with
some bug fixes that were originally authored by  Andy Grover,
Zach Brown, and Chris Mason.

v2: Code review comment by Sergei Shtylov
V3: DaveM comments:
- dropped patches 3, 5 for "heuristic" changes in rds_send_xmit().
  Investigation into the root-cause of these IB-triggered changes
  produced the feedback: "I don't remember seeing "RDS: Stuck RM"
  message in last 1-1.5 years and checking with other folks. It may very
  well be some old workaround for stale connection for which long term
  fix is already made and this part of code not exercised anymore."

  Any such fixes, *if* they are needed, can/should be done in the
  IB specific RDS transport modules.

- similarly dropped the LL_SEND_FULL patch (patch 6 in v2 set)

v4: Documentation/networking/rds.txt contains incorrect references
    to "missing sysctl values for pf_rds and sol_rds in mainline".
    The sysctl values were never needed in mainline, thus fix the
    documentation.

v5: Clarify comment per http://www.spinics.net/lists/netdev/msg324220.html

v6: Re-added entire version history to cover letter.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoRDS: make sure not to loop forever inside rds_send_xmit
Sowmini Varadhan [Wed, 8 Apr 2015 16:33:47 +0000 (12:33 -0400)]
RDS: make sure not to loop forever inside rds_send_xmit

If a determined set of concurrent senders keep the send queue full,
we can loop forever inside rds_send_xmit.  This fix has two parts.

First we are dropping out of the while(1) loop after we've processed a
large batch of messages.

Second we add a generation number that gets bumped each time the
xmit bit lock is acquired.  If someone else has jumped in and
made progress in the queue, we skip our goto restart.

Original patch by Chris Mason.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoRDS: only use passive connections when addresses match
Sowmini Varadhan [Wed, 8 Apr 2015 16:33:46 +0000 (12:33 -0400)]
RDS: only use passive connections when addresses match

Passive connections were added for the case where one loopback IB
connection between identical addresses needs another connection to store
the second QP.  Unfortunately, they were also created in the case where
the addesses differ and we already have both QPs.

This lead to a message reordering bug.

- two different IB interfaces and addresses on a machine: A B
- traffic is sent from A to B
- connection from A-B is created, connect request sent
- listening accepts connect request, B-A is created
- traffic flows, next_rx is incremented
- unacked messages exist on the retrans list
- connection A-B is shut down, new connect request sent
- listen sees existing loopback B-A, creates new passive B-A
- retrans messages are sent and delivered because of 0 next_rx

The problem is that the second connection request saw the previously
existing parent connection.  Instead of using it, and using the existing
next_rx_seq state for the traffic between those IPs, it mistakenly
thought that it had to create a passive connection.

We fix this by only using passive connections in the special case where
laddr and faddr match.  In this case we'll only ever have one parent
sending connection requests and one passive connection created as the
listening path sees the existing parent connection which initiated the
request.

Original patch by Zach Brown

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoRDS: Documentation: Document AF_RDS, PF_RDS and SOL_RDS correctly.
Sowmini Varadhan [Wed, 8 Apr 2015 16:33:45 +0000 (12:33 -0400)]
RDS: Documentation: Document AF_RDS, PF_RDS and SOL_RDS correctly.

AF_RDS, PF_RDS and SOL_RDS are available in header files,
and there is no need to get their values from /proc. Document
this correctly.

Fixes: 0c5f9b8830aa ("RDS: Documentation")
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoALSA: hda - Fix headphone pin config for Lifebook T731
Takashi Iwai [Wed, 8 Apr 2015 18:47:55 +0000 (20:47 +0200)]
ALSA: hda - Fix headphone pin config for Lifebook T731

Some BIOS version of Fujitsu Lifebook T731 seems to set up the
headphone pin (0x21) without the assoc number 0x0f while it's set only
to the output on the docking port (0x1a).  With the recent commit
[03ad6a8c93b6: ALSA: hda - Fix "PCM" name being used on one DAC when
 there are two DACs], this resulted in the weird mixer element
mapping where the headphone on the laptop is assigned as a shared
volume with the speaker and the docking port is assigned as an
individual headphone.

This patch improves the situation by correcting the headphone pin
config to the more appropriate value.

Reported-and-tested-by: Taylor Smock <smocktaylor@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: bebob: fix to processing in big-endian machine for sending cue
Takashi Sakamoto [Wed, 8 Apr 2015 16:15:03 +0000 (01:15 +0900)]
ALSA: bebob: fix to processing in big-endian machine for sending cue

Some M-Audio devices require to receive bootup command just after
powering on, while codes in BeBoB driver doesn't work properly in
big-endian machine because the command should be aligned by
little-endian.

This commit fixes this bug. This fix should go to stable kernel.

Cc: Takayuki Shiroma <t.shiroma.oki@gmail.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoRevert "sparc/PCI: Clip bridge windows to fit in upstream windows"
Bjorn Helgaas [Wed, 8 Apr 2015 15:04:55 +0000 (10:04 -0500)]
Revert "sparc/PCI: Clip bridge windows to fit in upstream windows"

This reverts commit d63e2e1f3df904bf6bd150bdafb42ddbb3257ea8.

David Ahern reported that d63e2e1f3df9 breaks booting on an 8-socket T5
sparc system.  He also verified that the system boots with d63e2e1f3df9
reverted.  Yinghai has some fixes, but they need a little more polishing
than we can do before v4.0.

Link: http://lkml.kernel.org/r/5514391F.2030300@oracle.com
Link: http://lkml.kernel.org/r/1427857069-6789-1-git-send-email-yinghai@kernel.org
9 years agoPCI: Don't look for ACPI hotplug parameters if ACPI is disabled
Bjorn Helgaas [Tue, 24 Mar 2015 16:12:45 +0000 (11:12 -0500)]
PCI: Don't look for ACPI hotplug parameters if ACPI is disabled

Booting a v3.18 or newer Xen domU kernel with PCI devices passed through
results in an oops (this is a 32-bit 3.13.11 dom0 with a 64-bit 4.4.0
hypervisor and 32-bit domU):

  BUG: unable to handle kernel paging request at 0030303e
  IP: [<c06ed0e6>] acpi_ns_validate_handle+0x12/0x1a
  Call Trace:
   [<c06eda4d>] ? acpi_evaluate_object+0x31/0x1fc
   [<c06b78e1>] ? pci_get_hp_params+0x111/0x4e0
   [<c0407bc7>] ? xen_force_evtchn_callback+0x17/0x30
   [<c04085fb>] ? xen_restore_fl_direct_reloc+0x4/0x4
   [<c0699d34>] ? pci_device_add+0x24/0x450

Don't look for ACPI configuration information if ACPI has been disabled.

I don't think this is the best fix, because we can boot plain Linux (no
Xen) with "acpi=off", and we don't need this check in pci_get_hp_params().
There should be a better fix that would make Xen domU work the same way.
The domU kernel has ACPI support but it has no AML.  There should be a way
to initialize the ACPI data structures so things fail gracefully rather
than oopsing.  This is an interim fix to address the regression.

Fixes: 6cd33649fa83 ("PCI: Add pci_configure_device() during enumeration")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=96301
Reported-by: Michael D Labriola <mlabriol@gdeb.com>
Tested-by: Michael D Labriola <mlabriol@gdeb.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: stable@vger.kernel.org # v3.18+
9 years agoMerge branch 'mvebu/fixes' into mvebu/for-next
Gregory CLEMENT [Wed, 8 Apr 2015 14:41:07 +0000 (16:41 +0200)]
Merge branch 'mvebu/fixes' into mvebu/for-next

9 years agoARM: mvebu: use 0xf1000000 as internal registers on Armada 370 DB
Thomas Petazzoni [Tue, 7 Apr 2015 12:23:03 +0000 (14:23 +0200)]
ARM: mvebu: use 0xf1000000 as internal registers on Armada 370 DB

All Marvell EBU SoCs (Kirkwood, Dove, Orion, Armada) have the
capability of changing the location of their internal registers (i.e
the registers for most hardware blocks inside the SoC). When coming
out of reset, the internal registers are mapped at 0xd0000000, but
since years and years, the tradition has been to have the internal
registers remapped at 0xf1000000 by the bootloader, and Linux has
since then assumed that the internal registers for the SoC were
located at 0xf1000000 on Kirkwood, Dove, Orion, etc. Linux has never
been aware that those registers are remappable (and there is no way to
know where they are mapped at runtime, since the register to configure
the address of the registers is itself within the internal registers).

Then came the Armada 370 and Armada XP, in which some of the very
early silicon steppings had an issue, which forced to use 0xd0000000:
the SoC was no longer working properly when the internal registers
were remapped at 0xf1000000. This issue is only affecting very early
silicon steppings and production steppings are not affected: the issue
has been fixed in between.

Since what we (Free Electrons) used to do the initial submission of
the Armada 370 and Armada XP platforms was evaluation boards with
those very early steppings, we submitted Device Tree that assumed the
internal registers were mapped at 0xd0000000. This is the case for
Armada 370 DB, Armada XP DB and Armada XP GP.

However, in practice, since Marvell has been shipping the evaluation
boards with production steppings of the SoC, they are shipping those
boards with bootloaders that remap the registers to 0xf1000000. We
have already changed this internal register address to 0xf1000000 for
the Armada XP DB in commit 82066bdb5a75 and for the Armada XP GP in
commit 91ed32200e6e (both merged in v3.15).

We only recently got our hand on an Armada 370 DB with a production
stepping of the SoC, which uses a bootloader that remaps internal
registers at 0xf1000000. Therefore, this commit aligns the Armada 370
DB to be like the Armada XP DB and Armada XP GP: assume that the
internal registers are mapped at 0xf1000000.

We would like to stress out the fact that the usage of 0xd0000000 as
the internal register base address was a temporary workaround for
early steppings deficiencies, and that the real long-term solution is
the usage of 0xf1000000. Having 0xd0000000 is an *accident* in the
life of the Marvell platform support in the kernel, as is confirmed by
the usage of 0xf1000000 in all previous Marvell platforms (Dove,
Kirkwood, Orion).

There are unfortunately a number of commercial devices that continue
to use 0xd0000000 even though they use production steppings of the
SoC, simply because the vendors of such devices have never bothered
using a more recent bootloader version from Marvell. There is not much
we can do about it, and we plan on keeping 0xd0000000 in the Device
Tree of such devices.

The main reason for remapping the internal registers at 0xf1000000
instead of 0xd0000000 is that it leaves more space in the 0 -> 4 GB
part of the physical address space for RAM. With registers at
0xd0000000, all RAM between 0xd0000000 to 0xffffffff is lost because
it's covered by the I/O registers.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Jason Cooper <jason@lakedameon.net>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
9 years agoALSA: hda/realtek - Make more stable to get pin sense for ALC283
Kailang Yang [Wed, 8 Apr 2015 08:34:00 +0000 (16:34 +0800)]
ALSA: hda/realtek - Make more stable to get pin sense for ALC283

Pin sense will active when power pin is wake up.
Power pin will not wake up immediately during resume state.
Add some delay to wait for power pin activated.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agodrm: fix drm_mode_getconnector() locking imbalance regression
Tommi Rantala [Fri, 3 Apr 2015 07:45:29 +0000 (10:45 +0300)]
drm: fix drm_mode_getconnector() locking imbalance regression

Regression in commit 2caa80e72b57c6216aec6f6a11fcfb4fec46daa0
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sun Feb 22 11:38:36 2015 +0100

    drm: Fix deadlock due to getconnector locking changes

If the drm_connector_find() call returns NULL, we should no longer
call drm_modeset_unlock() to avoid locking imbalance.

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoMerge tag 'media/v3.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Wed, 8 Apr 2015 00:38:31 +0000 (17:38 -0700)]
Merge tag 'media/v3.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:
 "A series of fixup patches for version 4.0:

   - one VB2 core fixup, when stopping the stream;
   - one VB2 core fixup for dma-contig memory type;
   - driver fixes at rtl28xx, s5p (tv, jpeg, mfc, soc-camera, sh_veu,
     cx23885, gspca"

* tag 'media/v3.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] rtl28xxu: return success for unimplemented FE callback
  [media] rtl2832: disable regmap register cache
  [media] vb2: Fix dma_dir setting for dma-contig mem type
  [media] media: s5p-mfc: fix broken pointer cast on 64bit arch
  [media] media: s5p-mfc: fix mmap support for 64bit arch
  [media] cx23885: fix querycap
  [media] sh_veu: v4l2_dev wasn't set
  [media] s5p-mfc: Fix NULL pointer dereference caused by not set q->lock
  [media] s5p-jpeg: exynos3250: fix erroneous reset procedure
  [media] s5p-tv: hdmi needs I2C support
  [media] s5p-jpeg: Initialize cb and cr to zero
  [media] media: fix gspca drivers build dependencies
  [media] soc-camera: Fix devm_kfree() in soc_of_bind()
  [media] media: atmel-isi: increase the burst length to improve the performance
  [media] vb2: fix 'UNBALANCED' warnings when calling vb2_thread_stop()

9 years agomm: numa: disable change protection for vma(VM_HUGETLB)
Naoya Horiguchi [Tue, 7 Apr 2015 21:26:47 +0000 (14:26 -0700)]
mm: numa: disable change protection for vma(VM_HUGETLB)

Currently when a process accesses a hugetlb range protected with
PROTNONE, unexpected COWs are triggered, which finally puts the hugetlb
subsystem into a broken/uncontrollable state, where for example
h->resv_huge_pages is subtracted too much and wraps around to a very
large number, and the free hugepage pool is no longer maintainable.

This patch simply stops changing protection for vma(VM_HUGETLB) to fix
the problem.  And this also allows us to avoid useless overhead of minor
faults.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Suggested-by: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: David Rientjes <rientjes@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoinclude/linux/dmapool.h: declare struct device
Mark Brown [Tue, 7 Apr 2015 21:26:44 +0000 (14:26 -0700)]
include/linux/dmapool.h: declare struct device

dmapool uses struct device in function arguments but relies on an
implicit inclusion to declare struct device causing warnings in some
configurations:

  include/linux/dmapool.h:31:7: warning: 'struct device' declared inside parameter list

Fix this by adding a struct device declaration to the file.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agomm: move zone lock to a different cache line than order-0 free page lists
Mel Gorman [Tue, 7 Apr 2015 21:26:41 +0000 (14:26 -0700)]
mm: move zone lock to a different cache line than order-0 free page lists

Huang Ying reported the following problem due to commit 3484b2de9499 ("mm:
rearrange zone fields into read-only, page alloc, statistics and page
reclaim lines") from the Intel performance tests

    24b7e5819ad5cbef  3484b2de9499df23c4604a513b
    ----------------  --------------------------
             %stddev     %change         %stddev
                 \          |                \
        152288 \261  0%     -46.2%      81911 \261  0%  aim7.jobs-per-min
           237 \261  0%     +85.6%        440 \261  0%  aim7.time.elapsed_time
           237 \261  0%     +85.6%        440 \261  0%  aim7.time.elapsed_time.max
         25026 \261  0%     +70.7%      42712 \261  0%  aim7.time.system_time
       2186645 \261  5%     +32.0%    2885949 \261  4%  aim7.time.voluntary_context_switches
       4576561 \261  1%     +24.9%    5715773 \261  0%  aim7.time.involuntary_context_switches

The problem is specific to very large machines under stress.  It was not
reproducible with the machines I had used to justify the original patch
because large numbers of CPUs are required.  When pressure is high enough,
the cache line is bouncing between CPUs trying to acquire the lock and the
holder of the lock adjusting free lists.  The intention was that the
acquirer of the lock would automatically have the cache line holding the
free lists but according to Huang, this is not a universal win.

One possibility is to move the zone lock to its own cache line but it
increases the size of the zone.  This patch moves the lock to the other
end of the free lists where they do not contend under high pressure.  It
does mean the page allocator paths now require more cache lines but Huang
reports that it restores performance to previous levels on large machines

             %stddev     %change         %stddev
                 \          |                \
         84568 \261  1%     +94.3%     164280 \261  1%  aim7.jobs-per-min
       2881944 \261  2%     -35.1%    1870386 \261  8%  aim7.time.voluntary_context_switches
           681 \261  1%      -3.4%        658 \261  0%  aim7.time.user_time
       5538139 \261  0%     -12.1%    4867884 \261  0%  aim7.time.involuntary_context_switches
         44174 \261  1%     -46.0%      23848 \261  1%  aim7.time.system_time
           426 \261  1%     -48.4%        219 \261  1%  aim7.time.elapsed_time
           426 \261  1%     -48.4%        219 \261  1%  aim7.time.elapsed_time.max
           468 \261  1%     -43.1%        266 \261  2%  uptime.boot

Signed-off-by: Mel Gorman <mgorman@suse.de>
Reported-by: Huang Ying <ying.huang@intel.com>
Tested-by: Huang Ying <ying.huang@intel.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge branch '4.0-fixes' into mips-for-linux-next
Ralf Baechle [Tue, 7 Apr 2015 23:17:03 +0000 (01:17 +0200)]
Merge branch '4.0-fixes' into mips-for-linux-next

9 years agoMerge branch '4.1-fp' into mips-for-linux-next
Ralf Baechle [Tue, 7 Apr 2015 23:15:52 +0000 (01:15 +0200)]
Merge branch '4.1-fp' into mips-for-linux-next

9 years agoMIPS: BCM63xx: Provide a plat_post_dma_flush hook
Florian Fainelli [Tue, 7 Apr 2015 20:34:02 +0000 (13:34 -0700)]
MIPS: BCM63xx: Provide a plat_post_dma_flush hook

Broadcom BCM63xx DSL SoCs utilize BMIPS CPUs, and as such are required
to perform a read-ahead cache flush after a DMA transfer. Utilize
asm/bmips.h to provide a plat_post_dma_flush_hook, and
mach-generic/dma-coherence.h for everything else.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: cernekee@gmail.com
Cc: jogo@openwrt.org
Patchwork: https://patchwork.linux-mips.org/patch/9726/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: DMA: Allow platforms to override only the post DMA hook
Florian Fainelli [Tue, 7 Apr 2015 20:34:01 +0000 (13:34 -0700)]
MIPS: DMA: Allow platforms to override only the post DMA hook

Instead of having platforms to copy the entirety of
mach-generic/dma-coherence.h, check whether these platforms have already
defined a plat_post_dma_flush hook, and if not, provide an inline stub.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: cernekee@gmail.com
Cc: jogo@openwrt.org
Patchwork: https://patchwork.linux-mips.org/patch/9725/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: BMIPS: Move post DMA flush implementation to common header
Florian Fainelli [Tue, 7 Apr 2015 20:34:00 +0000 (13:34 -0700)]
MIPS: BMIPS: Move post DMA flush implementation to common header

arch/mips/include/asm/mach-bmips/dma-coherence.h contains the
plat_post_dma_flush implementation which is not specific to mach-bmips,
but required for all BMIPS-based systems.

Move plat_post_dma_flush to arch/mips/include/asm/bmips.h, rename it to
bmips_post_dma_flush such that other platforms like bcm63xx can utilize
it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: cernekee@gmail.com
Cc: jogo@openwrt.org
Patchwork: https://patchwork.linux-mips.org/patch/9724/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Add user stack and registers to perf.
David Daney [Thu, 16 May 2013 19:07:33 +0000 (12:07 -0700)]
MIPS: Add user stack and registers to perf.

This allows for extracting off-line stack traces from user-space code
in the perf tool.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Patchwork: https://patchwork.linux-mips.org/patch/5246/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Octeon: Don't set .owner.
Ralf Baechle [Tue, 7 Apr 2015 18:29:08 +0000 (20:29 +0200)]
MIPS: Octeon: Don't set .owner.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Netlogic: Fix double inclusion of <asm/netlogic/common.h>.
Ralf Baechle [Tue, 7 Apr 2015 13:01:48 +0000 (15:01 +0200)]
MIPS: Netlogic: Fix double inclusion of <asm/netlogic/common.h>.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Fix double inclusion of headers in misalignment emulator.
Ralf Baechle [Tue, 7 Apr 2015 12:59:18 +0000 (14:59 +0200)]
MIPS: Fix double inclusion of headers in misalignment emulator.

Introduced in 34c2f668d0f6b2ca1c076d8170d6cd4f2235a9d4 (MIPS: microMIPS:
Add unaligned access support.)

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: DEC: Do not set up the FPU interrupt if no FPU
Maciej W. Rozycki [Fri, 3 Apr 2015 22:32:22 +0000 (23:32 +0100)]
MIPS: DEC: Do not set up the FPU interrupt if no FPU

Following the arrangement for processors that wire FPU exceptions to the
FPE CPU exception handle the case where no FPU is in use -- which for
DECstation systems will only ever happen when the "nofpu" kernel option
has been used -- do not register the FPU interrupt in such a case
either.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9714/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: DEC: Implement FPU interrupt counter
Maciej W. Rozycki [Fri, 3 Apr 2015 22:32:08 +0000 (23:32 +0100)]
MIPS: DEC: Implement FPU interrupt counter

Implement a cheap way to count FPU interrupts for R2k/R3k DECstation
systems.  Do this manually in handcoded assembly, rather than calling
`kstat_incr_irq_this_cpu' that would require setting up a stack frame
and a lot of redirection.  This is not going to be a problem because the
FPU interrupt is local to the CPU and also there is one CPU only anyway.

So at bootstrap determine the address of the correct location within
`struct irq_desc', and then only refer to it directly in the interrupt
handler.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9713/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Factor out FPU feature probing
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:54 +0000 (23:27 +0100)]
MIPS: Factor out FPU feature probing

Factor out FPU feature probing, mainly to remove code duplication from
`fpu_disable'.  No functional change although shuffle some code to avoid
forward references.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9712/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Respect the ISA level in FCSR handling
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:48 +0000 (23:27 +0100)]
MIPS: Respect the ISA level in FCSR handling

Define the central place the default FCSR value is set from, initialised
in `cpu_probe'.  Determine the FCSR mask applied to values written to
the register with CTC1 in the full emulation mode and via ptrace(2),
according to the ISA level of processor hardware or the writability of
bits 31:18 if actual FPU hardware is used.

Software may rely on FCSR bits whose functions our emulator does not
implement, so it should not allow them to be set or software may get
confused.  For ptrace(2) it's just sanity.

[ralf@linux-mips.org: Fixed double inclusion of <asm/current.h>.]

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9711/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: math-emu: Make ABS.fmt and NEG.fmt arithmetic again
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:43 +0000 (23:27 +0100)]
MIPS: math-emu: Make ABS.fmt and NEG.fmt arithmetic again

The ABS.fmt and NEG.fmt instructions have been specified as arithmetic
in the MIPS architecture, which in particular implies handling NaN data
in the usual way with qNaN bit patterns propagated unchanged and sNaN
bit patterns signalling the usual IEEE 754 Invalid Operation exception
and quieted by default.

A series of changes applied over time to our implementation:

c5033d78 [MIPS] ieee754[sd]p_neg workaround
cea2be44 MIPS: Fix abs.[sd] and neg.[sd] emulation for NaN operands

has led to the current situation where the sign bit is updated according
to the operation requested even for NaN inputs.  This is according to
these commits a workaround so that broken binaries produced by GCC
disregarding the properties of these instructions have a chance to work.

For sNaN inputs this remains within IEEE Std 754 as the standard leaves
the choice of output qNaN bit patterns produced under the default
Invalid Operation exception handling for individual sNaN input bit
patterns to implementer's discretion, even though it still recommends as
much NaN input information to be preserved in NaN outputs.

For qNaN inputs however it violates the standard as it requires a qNaN
input bit patterns to propagate unchanged to output.

This is also unlike real MIPS FPU hardware behaves where sNaN and/or
qNaN processing has been fully implemented with no Unimplemented
Operation exception signalled.  Such hardware propagates any input qNaN
bit pattern unchanged.  It also quiets any input sNaN bit pattern in an
implementer-specific manner, for example the MIPS 74Kf processor returns
the default qNaN pattern with the sign bit always clear and the Broadcom
SB-1 and BMIPS5000 processors propagate the input sNaN bit pattern with
the sign bit unchanged and the quiet bit first cleared in the trailing
significand field and then the next lower bit set if clearing the quiet
bit left the field with no other bit set.

Especially the latter observation indicates the limited usefulness of
the workaround as it will cover many hardware configurations, but not
all of them, only making it harder to discover such broken binaries that
need to be recompiled with GCC told to avoid the use of ABS.fmt and
NEG.fmt instructions where non-arithmetic semantics is required by the
algorithm used.

Revert the damage done by the series of changes then, and take the
opportunity to simplify implementation by calling `ieee754dp_sub' and
`ieee754dp_add' as required and also the rounding mode set towards -Inf
temporarily so that the sign of 0 is correctly handled.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9710/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: math-emu: Define IEEE 754-2008 feature control bits
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:38 +0000 (23:27 +0100)]
MIPS: math-emu: Define IEEE 754-2008 feature control bits

Define IEEE 754-2008 feature control bits: FIR.HAS2008, FCSR.ABS2008 and
FCSR.NAN2008, and update the `_ieee754_csr' structure accordingly.

For completeness define FIR.UFRP too.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9709/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: math-emu: Implement the FCCR, FEXR and FENR registers
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:33 +0000 (23:27 +0100)]
MIPS: math-emu: Implement the FCCR, FEXR and FENR registers

Implement the FCCR, FEXR and FENR "shadow" FPU registers for the
architecture levels that include them, for the CFC1 and CTC1
instructions in the full emulation mode.

For completeness add macros for the CP1 UFR and UNFR registers too, no
actual implementation though.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9708/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: math-emu: Set FIR feature flags for full emulation
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:26 +0000 (23:27 +0100)]
MIPS: math-emu: Set FIR feature flags for full emulation

Implement FIR feature flags in the FPU emulator according to features
supported and architecture level requirements.  The W, L and F64 bits
have only been added at level #2 even though the features they refer to
were also included with the MIPS64r1 ISA and the W fixed-point format
also with the MIPS32r1 ISA.

This is only relevant for the full emulation mode and the emulated CFC1
instruction as well as ptrace(2) accesses.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9707/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Correct ISA masking in FPU feature determination
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:21 +0000 (23:27 +0100)]
MIPS: Correct ISA masking in FPU feature determination

Correct an ISA level determination problem introduced with 8b8aa636
[MIPS: kernel: cpu-probe.c: Add support for MIPS R6], reverting explicit
masking against individual `MIPS_CPU_ISA_*' macros in FPU feature
determination.

Feature macros such as `cpu_has_mips_r' cannot be used here, because
they operate on CPU #0 and we want to refer to the current CPU instead.
They cannot be used for masking against the current CPU either because
they mask against CPU #0 too, e.g.:

# define cpu_has_mips32r1 (cpu_data[0].isa_level & MIPS_CPU_ISA_M32R1)

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9706/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Set `si_code' for SIGFPE signals sent from emulation too
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:15 +0000 (23:27 +0100)]
MIPS: Set `si_code' for SIGFPE signals sent from emulation too

Rework `process_fpemu_return' and move IEEE 754 exception interpretation
there, from `do_fpe'.  Record the cause bits set in FCSR before they are
cleared and pass them through to `process_fpemu_return' so as to set
`si_code' correctly too for SIGFPE signals sent from emulation rather
than those issued by hardware with the FPE processor exception only.

For simplicity `mipsr2_decoder' assumes `*fcr31' has been preinitialised
and only sets it to anything if an FPU instruction has been emulated,
which in turn is the only case SIGFPE can be issued for here.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9705/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Always clear FCSR cause bits after emulation
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:10 +0000 (23:27 +0100)]
MIPS: Always clear FCSR cause bits after emulation

Clear any FCSR cause bits recorded in the saved FPU context after
emulation in all cases rather than in `do_fpe' only, so that any
unmasked IEEE 754 exception left from emulation does not cause a fatal
kernel-mode FPE hardware exception with the CTC1 instruction used by the
kernel to subsequently restore FCSR hardware from the saved FPU context.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9704/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Respect the FCSR exception mask for `si_code'
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:06 +0000 (23:27 +0100)]
MIPS: Respect the FCSR exception mask for `si_code'

Respect the FCSR exception mask when interpreting the IEEE 754 exception
condition to report with SIGFPE in `si_code', so as not to use one that
has been masked where a different one set in parallel caused the FPE
hardware exception to trigger.  As per the IEEE Std 754 the Inexact
exception can happen together with Overflow or Underflow.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9703/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: math-emu: Move long fixed-point support into an `ar' library
Maciej W. Rozycki [Fri, 3 Apr 2015 22:27:01 +0000 (23:27 +0100)]
MIPS: math-emu: Move long fixed-point support into an `ar' library

Complement 593d33fe [MIPS: math-emu: Move various objects into an ar
library.] and also move sp_tlong.o, sp_flong.o, dp_tlong.o, and
dp_flong.o into an `ar' library.  These objects implement long
fixed-point format support that can be omitted from MIPS I, MIPS II and
MIPS32r1 configurations.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9702/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: math-emu: Correct delay-slot exception propagation
Maciej W. Rozycki [Fri, 3 Apr 2015 22:26:56 +0000 (23:26 +0100)]
MIPS: math-emu: Correct delay-slot exception propagation

Restore EPC at the branch whose delay slot is emulated if the delay-slot
instruction signals.  This is so that code in `fpu_emulator_cop1Handler'
does not see EPC having advanced and mistakenly successfully resume
userland execution from the location at the branch target in that case.
Restoring EPC guarantees an immediate exit from the emulation loop and
if EPC hasn't advanced at all since entering the loop, also issuing the
signal reported by the delay-slot instruction.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9701/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Correct FP ISA requirements
Maciej W. Rozycki [Fri, 3 Apr 2015 22:26:49 +0000 (23:26 +0100)]
MIPS: Correct FP ISA requirements

Correct ISA requirements for floating-point instructions:

* the CU3 exception signifies a real COP3 instruction in MIPS I & II,

* the BC1FL and BC1TL instructions are not supported in MIPS I,

* the SQRT.fmt instructions are indeed supported in MIPS II,

* the LDC1 and SDC1 instructions are indeed supported in MIPS32r1,

* the CEIL.W.fmt, FLOOR.W.fmt, ROUND.W.fmt and TRUNC.W.fmt instructions
  are indeed supported in MIPS32,

* the CVT.L.fmt and CVT.fmt.L instructions are indeed supported in
  MIPS32r2 and MIPS32r6,

* the CEIL.L.fmt, FLOOR.L.fmt, ROUND.L.fmt and TRUNC.L.fmt instructions
  are indeed supported in MIPS32r2 and MIPS32r6,

* the RSQRT.fmt and RECIP.fmt instructions are indeed supported in
  MIPS64r1,

Also simplify conditionals for MIPS III and MIPS IV FPU instructions and
the handling of the MOVCI minor opcode.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9700/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Correct MIPS I FP context layout
Maciej W. Rozycki [Fri, 3 Apr 2015 22:26:44 +0000 (23:26 +0100)]
MIPS: Correct MIPS I FP context layout

Implement the correct ordering of individual floating-point registers
within double-precision register pairs for the MIPS I FP context, as
required by our FP emulation code and expected by userland talking via
ptrace(2).  Use L.D and S.D assembly macros that do the right thing like
LDC1 and SDC1 from MIPS II up, avoiding the need to mess up with
endianness conditionals.

This in particular fixes the handling of denormals and NaN generation in
Unimplemented Operation emulation traps.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9699/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: math-emu: Fix delay-slot emulation cache incoherency
Maciej W. Rozycki [Fri, 3 Apr 2015 22:26:37 +0000 (23:26 +0100)]
MIPS: math-emu: Fix delay-slot emulation cache incoherency

Correct a cache coherency regression introduced with be1664c4 [Another
round of fixes for the fp emulator.] for the emulation frame used in
delay-slot emulation.

Two instructions are copied into the frame and as from the commit
referred a cache synchronisation call is made for the second instruction
aka `badinst' of the two only.  The `flush_cache_sigtramp' interface is
reused that guarantees that synchronisation will be made for 8 bytes or
2 instructions starting from the address requested, although if cache
lines are wider then a larger area may be synchronised.

Change the call to point to the first of the two instructions aka `emul'
instead, removing unpredictable behaviour resulting from cache
incoherency.

This bug only ever manifested itself on systems implementing 4-byte
cache lines, typically MIPS I systems, causing all kinds of weirdness.
This is because the sequence of two instructions starting from `emul' is
8-byte aligned and for 8-byte or wider cache lines the line synchronised
will span both, so the vast majority of systems have escaped unharmed.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9698/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Fix BREAK code interpretation heuristics
Maciej W. Rozycki [Fri, 3 Apr 2015 22:26:32 +0000 (23:26 +0100)]
MIPS: Fix BREAK code interpretation heuristics

Do not lose the other half of the BREAK code where there is an upper
half.  This is so that e.g. `BREAK 7, 7' is not interpreted as a divide
by zero trap, while `BREAK 0, 7' or `BREAK 7, 0' still are.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9697/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: BREAK instruction interpretation corrections
Maciej W. Rozycki [Fri, 3 Apr 2015 22:26:27 +0000 (23:26 +0100)]
MIPS: BREAK instruction interpretation corrections

Add the missing microMIPS BREAK16 instruction code interpretation and
reshape code removing instruction fetching duplication and the separate
call to `do_trap_or_bp' in the MIPS16 path.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9696/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Correct MIPS16 BREAK code interpretation
Maciej W. Rozycki [Fri, 3 Apr 2015 22:26:21 +0000 (23:26 +0100)]
MIPS: Correct MIPS16 BREAK code interpretation

Correct the interpretation of the immediate MIPS16 BREAK instruction
code embedded in the instruction word across bits 10:5 rather than 11:6
as current code implies, fixing the interpretation of integer overflow
and divide by zero traps.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9695/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: Correct `nofpu' non-functionality
Maciej W. Rozycki [Fri, 3 Apr 2015 22:26:04 +0000 (23:26 +0100)]
MIPS: Correct `nofpu' non-functionality

The `cpu_has_fpu' feature flag must not be hardcoded to 1 or the `nofpu'
kernel option will be ignored.  Remove any such overrides and add a
cautionary note.  Hardcoding to 0 is fine for FPU-less platforms.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9694/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoMIPS: math-emu: Make NaN classifiers static
Maciej W. Rozycki [Fri, 3 Apr 2015 22:25:57 +0000 (23:25 +0100)]
MIPS: math-emu: Make NaN classifiers static

The `ieee754sp_isnan' and `ieee754dp_isnan' NaN classifiers are now no
longer externally referred, remove their header prototypes and make them
local to the two only respective places still making use of them.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9693/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>