1. 26 Sep, 2014 40 commits
    • Ilya Dryomov's avatar
      libceph: do not hard code max auth ticket len · 0518223c
      Ilya Dryomov authored
      We hard code cephx auth ticket buffer size to 256 bytes.  This isn't
      enough for any moderate setups and, in case tickets themselves are not
      encrypted, leads to buffer overflows (ceph_x_decrypt() errors out, but
      ceph_decode_copy() doesn't - it's just a memcpy() wrapper).  Since the
      buffer is allocated dynamically anyway, allocated it a bit later, at
      the point where we know how much is going to be needed.
      
      Fixes: http://tracker.ceph.com/issues/8979
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarIlya Dryomov <ilya.dryomov@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@redhat.com>
      
      (cherry picked from commit c27a3e4d)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0518223c
    • Ilya Dryomov's avatar
      libceph: add process_one_ticket() helper · 5c06b980
      Ilya Dryomov authored
      Add a helper for processing individual cephx auth tickets.  Needed for
      the next commit, which deals with allocating ticket buffers.  (Most of
      the diff here is whitespace - view with git diff -b).
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarIlya Dryomov <ilya.dryomov@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@redhat.com>
      
      (cherry picked from commit 597cda35)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5c06b980
    • Sage Weil's avatar
      libceph: gracefully handle large reply messages from the mon · 19efa81f
      Sage Weil authored
      We preallocate a few of the message types we get back from the mon.  If we
      get a larger message than we are expecting, fall back to trying to allocate
      a new one instead of blindly using the one we have.
      
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarSage Weil <sage@redhat.com>
      Reviewed-by: default avatarIlya Dryomov <ilya.dryomov@inktank.com>
      
      (cherry picked from commit 73c3d481)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      19efa81f
    • Chris Mason's avatar
      xfs: don't zero partial page cache pages during O_DIRECT writes · 925f62c7
      Chris Mason authored
      Similar to direct IO reads, direct IO writes are using
      truncate_pagecache_range to invalidate the page cache. This is
      incorrect due to the sub-block zeroing in the page cache that
      truncate_pagecache_range() triggers.
      
      This patch fixes things by using invalidate_inode_pages2_range
      instead.  It preserves the page cache invalidation, but won't zero
      any pages.
      
      cc: stable@vger.kernel.org
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      
      xfs: don't zero partial page cache pages during O_DIRECT writes
      
      xfs is using truncate_pagecache_range to invalidate the page cache
      during DIO reads.  This is different from the other filesystems who
      only invalidate pages during DIO writes.
      
      truncate_pagecache_range is meant to be used when we are freeing the
      underlying data structs from disk, so it will zero any partial
      ranges in the page.  This means a DIO read can zero out part of the
      page cache page, and it is possible the page will stay in cache.
      
      buffered reads will find an up to date page with zeros instead of
      the data actually on disk.
      
      This patch fixes things by using invalidate_inode_pages2_range
      instead.  It preserves the page cache invalidation, but won't zero
      any pages.
      
      [dchinner: catch error and warn if it fails. Comment.]
      
      cc: stable@vger.kernel.org
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      
      (cherry picked from commit 834ffca6
      85e584da)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      925f62c7
    • Dave Chinner's avatar
      xfs: don't zero partial page cache pages during O_DIRECT writes · fef33816
      Dave Chinner authored
      Similar to direct IO reads, direct IO writes are using
      truncate_pagecache_range to invalidate the page cache. This is
      incorrect due to the sub-block zeroing in the page cache that
      truncate_pagecache_range() triggers.
      
      This patch fixes things by using invalidate_inode_pages2_range
      instead.  It preserves the page cache invalidation, but won't zero
      any pages.
      
      cc: stable@vger.kernel.org
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      
      xfs: don't zero partial page cache pages during O_DIRECT writes
      
      xfs is using truncate_pagecache_range to invalidate the page cache
      during DIO reads.  This is different from the other filesystems who
      only invalidate pages during DIO writes.
      
      truncate_pagecache_range is meant to be used when we are freeing the
      underlying data structs from disk, so it will zero any partial
      ranges in the page.  This means a DIO read can zero out part of the
      page cache page, and it is possible the page will stay in cache.
      
      buffered reads will find an up to date page with zeros instead of
      the data actually on disk.
      
      This patch fixes things by using invalidate_inode_pages2_range
      instead.  It preserves the page cache invalidation, but won't zero
      any pages.
      
      [dchinner: catch error and warn if it fails. Comment.]
      
      cc: stable@vger.kernel.org
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      
      (cherry picked from commit 834ffca6
      85e584da)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      fef33816
    • Dave Chinner's avatar
      xfs: don't dirty buffers beyond EOF · e52c37f8
      Dave Chinner authored
      generic/263 is failing fsx at this point with a page spanning
      EOF that cannot be invalidated. The operations are:
      
      1190 mapwrite   0x52c00 thru    0x5e569 (0xb96a bytes)
      1191 mapread    0x5c000 thru    0x5d636 (0x1637 bytes)
      1192 write      0x5b600 thru    0x771ff (0x1bc00 bytes)
      
      where 1190 extents EOF from 0x54000 to 0x5e569. When the direct IO
      write attempts to invalidate the cached page over this range, it
      fails with -EBUSY and so any attempt to do page invalidation fails.
      
      The real question is this: Why can't that page be invalidated after
      it has been written to disk and cleaned?
      
      Well, there's data on the first two buffers in the page (1k block
      size, 4k page), but the third buffer on the page (i.e. beyond EOF)
      is failing drop_buffers because it's bh->b_state == 0x3, which is
      BH_Uptodate | BH_Dirty.  IOWs, there's dirty buffers beyond EOF. Say
      what?
      
      OK, set_buffer_dirty() is called on all buffers from
      __set_page_buffers_dirty(), regardless of whether the buffer is
      beyond EOF or not, which means that when we get to ->writepage,
      we have buffers marked dirty beyond EOF that we need to clean.
      So, we need to implement our own .set_page_dirty method that
      doesn't dirty buffers beyond EOF.
      
      This is messy because the buffer code is not meant to be shared
      and it has interesting locking issues on the buffer dirty bits.
      So just copy and paste it and then modify it to suit what we need.
      
      Note: the solutions the other filesystems and generic block code use
      of marking the buffers clean in ->writepage does not work for XFS.
      It still leaves dirty buffers beyond EOF and invalidations still
      fail. Hence rather than play whack-a-mole, this patch simply
      prevents those buffers from being dirtied in the first place.
      
      cc: <stable@kernel.org>
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      
      (cherry picked from commit 22e757a4)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      e52c37f8
    • Dave Chinner's avatar
      xfs: quotacheck leaves dquot buffers without verifiers · a1d44560
      Dave Chinner authored
      When running xfs/305, I noticed that quotacheck was flushing dquot
      buffers that did not have the xfs_dquot_buf_ops verifiers attached:
      
      XFS (vdb): _xfs_buf_ioapply: no ops on block 0x1dc8/0x1dc8
      ffff880052489000: 44 51 01 04 00 00 65 b8 00 00 00 00 00 00 00 00  DQ....e.........
      ffff880052489010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      ffff880052489020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      ffff880052489030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      CPU: 1 PID: 2376 Comm: mount Not tainted 3.16.0-rc2-dgc+ #306
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
       ffff88006fe38000 ffff88004a0ffae8 ffffffff81cf1cca 0000000000000001
       ffff88004a0ffb88 ffffffff814d50ca 000010004a0ffc70 0000000000000000
       ffff88006be56dc4 0000000000000021 0000000000001dc8 ffff88007c773d80
      Call Trace:
       [<ffffffff81cf1cca>] dump_stack+0x45/0x56
       [<ffffffff814d50ca>] _xfs_buf_ioapply+0x3ca/0x3d0
       [<ffffffff810db520>] ? wake_up_state+0x20/0x20
       [<ffffffff814d51f5>] ? xfs_bdstrat_cb+0x55/0xb0
       [<ffffffff814d513b>] xfs_buf_iorequest+0x6b/0xd0
       [<ffffffff814d51f5>] xfs_bdstrat_cb+0x55/0xb0
       [<ffffffff814d53ab>] __xfs_buf_delwri_submit+0x15b/0x220
       [<ffffffff814d6040>] ? xfs_buf_delwri_submit+0x30/0x90
       [<ffffffff814d6040>] xfs_buf_delwri_submit+0x30/0x90
       [<ffffffff8150f89d>] xfs_qm_quotacheck+0x17d/0x3c0
       [<ffffffff81510591>] xfs_qm_mount_quotas+0x151/0x1e0
       [<ffffffff814ed01c>] xfs_mountfs+0x56c/0x7d0
       [<ffffffff814f0f12>] xfs_fs_fill_super+0x2c2/0x340
       [<ffffffff811c9fe4>] mount_bdev+0x194/0x1d0
       [<ffffffff814f0c50>] ? xfs_finish_flags+0x170/0x170
       [<ffffffff814ef0f5>] xfs_fs_mount+0x15/0x20
       [<ffffffff811ca8c9>] mount_fs+0x39/0x1b0
       [<ffffffff811e4d67>] vfs_kern_mount+0x67/0x120
       [<ffffffff811e757e>] do_mount+0x23e/0xad0
       [<ffffffff8117abde>] ? __get_free_pages+0xe/0x50
       [<ffffffff811e71e6>] ? copy_mount_options+0x36/0x150
       [<ffffffff811e8103>] SyS_mount+0x83/0xc0
       [<ffffffff81cfd40b>] tracesys+0xdd/0xe2
      
      This was caused by dquot buffer readahead not attaching a verifier
      structure to the buffer when readahead was issued, resulting in the
      followup read of the buffer finding a valid buffer and so not
      attaching new verifiers to the buffer as part of the read.
      
      Also, when a verifier failure occurs, we then read the buffer
      without verifiers. Attach the verifiers manually after this read so
      that if the buffer is then written it will be verified that the
      corruption has been repaired.
      
      Further, when flushing a dquot we don't ask for a verifier when
      reading in the dquot buffer the dquot belongs to. Most of the time
      this isn't an issue because the buffer is still cached, but when it
      is not cached it will result in writing the dquot buffer without
      having the verfier attached.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      
      (cherry picked from commit 5fd364fe)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a1d44560
    • Doug Ledford's avatar
      RDMA/uapi: Include socket.h in rdma_user_cm.h · 22393801
      Doug Ledford authored
      added struct sockaddr_storage to rdma_user_cm.h without also adding an
      include for linux/socket.h to make sure it is defined.  Systemtap
      needs the header files to build standalone and cannot rely on other
      files to pre-include other headers, so add linux/socket.h to the list
      of includes in this file.
      
      Fixes: ee7aed45 ("RDMA/ucma: Support querying for AF_IB addresses")
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      
      (cherry picked from commit db1044d4)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      22393801
    • Steve Wise's avatar
      RDMA/iwcm: Use a default listen backlog if needed · 0bdc342c
      Steve Wise authored
      If the user creates a listening cm_id with backlog of 0 the IWCM ends
      up not allowing any connection requests at all.  The correct behavior
      is for the IWCM to pick a default value if the user backlog parameter
      is zero.
      
      Lustre from version 1.8.8 onward uses a backlog of 0, which breaks
      iwarp support without this fix.
      Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      
      (cherry picked from commit 2f0304d2)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0bdc342c
    • NeilBrown's avatar
      md/raid10: Fix memory leak when raid10 reshape completes. · 21b2d992
      NeilBrown authored
      When a raid10 commences a resync/recovery/reshape it allocates
      some buffer space.
      When a resync/recovery completes the buffer space is freed.  But not
      when the reshape completes.
      This can result in a small memory leak.
      
      There is a subtle side-effect of this bug.  When a RAID10 is reshaped
      to a larger array (more devices), the reshape is immediately followed
      by a "resync" of the new space.  This "resync" will use the buffer
      space which was allocated for "reshape".  This can cause problems
      including a "BUG" in the SCSI layer.  So this is suitable for -stable.
      
      Cc: stable@vger.kernel.org (v3.5+)
      Fixes: 3ea7daa5Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      
      (cherry picked from commit b3968552)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      21b2d992
    • NeilBrown's avatar
      md/raid10: fix memory leak when reshaping a RAID10. · 670acfbc
      NeilBrown authored
      raid10 reshape clears unwanted bits from a bio->bi_flags using
      a method which, while clumsy, worked until 3.10 when BIO_OWNS_VEC
      was added.
      Since then it clears that bit but shouldn't.  This results in a
      memory leak.
      
      So change to used the approved method of clearing unwanted bits.
      
      As this causes a memory leak which can consume all of memory
      the fix is suitable for -stable.
      
      Fixes: a38352e0
      Cc: stable@vger.kernel.org (v3.10+)
      Reported-by: mdraid.pkoch@dfgh.net (Peter Koch)
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      
      (cherry picked from commit ce0b0a46)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      670acfbc
    • NeilBrown's avatar
      md/raid6: avoid data corruption during recovery of double-degraded RAID6 · d21eb3fb
      NeilBrown authored
      During recovery of a double-degraded RAID6 it is possible for
      some blocks not to be recovered properly, leading to corruption.
      
      If a write happens to one block in a stripe that would be written to a
      missing device, and at the same time that stripe is recovering data
      to the other missing device, then that recovered data may not be written.
      
      This patch skips, in the double-degraded case, an optimisation that is
      only safe for single-degraded arrays.
      
      Bug was introduced in 2.6.32 and fix is suitable for any kernel since
      then.  In an older kernel with separate handle_stripe5() and
      handle_stripe6() functions the patch must change handle_stripe6().
      
      Cc: stable@vger.kernel.org (2.6.32+)
      Fixes: 6c0069c0
      Cc: Yuri Tikhonov <yur@emcraft.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Reported-by: default avatar"Manibalan P" <pmanibalan@amiindia.co.in>
      Tested-by: default avatar"Manibalan P" <pmanibalan@amiindia.co.in>
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1090423Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Acked-by: default avatarDan Williams <dan.j.williams@intel.com>
      
      (cherry picked from commit 9c4bdf69)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      d21eb3fb
    • Vladimir Davydov's avatar
      Bluetooth: never linger on process exit · a4c06307
      Vladimir Davydov authored
      If the current process is exiting, lingering on socket close will make
      it unkillable, so we should avoid it.
      
      Reproducer:
      
        #include <sys/types.h>
        #include <sys/socket.h>
      
        #define BTPROTO_L2CAP   0
        #define BTPROTO_SCO     2
        #define BTPROTO_RFCOMM  3
      
        int main()
        {
                int fd;
                struct linger ling;
      
                fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
                //or: fd = socket(PF_BLUETOOTH, SOCK_DGRAM, BTPROTO_L2CAP);
                //or: fd = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_SCO);
      
                ling.l_onoff = 1;
                ling.l_linger = 1000000000;
                setsockopt(fd, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling));
      
                return 0;
        }
      Signed-off-by: default avatarVladimir Davydov <vdavydov@parallels.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 093facf3)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a4c06307
    • Eric W. Biederman's avatar
      mnt: Change the default remount atime from relatime to the existing value · 3d55f426
      Eric W. Biederman authored
      Since March 2009 the kernel has treated the state that if no
      MS_..ATIME flags are passed then the kernel defaults to relatime.
      
      Defaulting to relatime instead of the existing atime state during a
      remount is silly, and causes problems in practice for people who don't
      specify any MS_...ATIME flags and to get the default filesystem atime
      setting.  Those users may encounter a permission error because the
      default atime setting does not work.
      
      A default that does not work and causes permission problems is
      ridiculous, so preserve the existing value to have a default
      atime setting that is always guaranteed to work.
      
      Using the default atime setting in this way is particularly
      interesting for applications built to run in restricted userspace
      environments without /proc mounted, as the existing atime mount
      options of a filesystem can not be read from /proc/mounts.
      
      In practice this fixes user space that uses the default atime
      setting on remount that are broken by the permission checks
      keeping less privileged users from changing more privileged users
      atime settings.
      
      Cc: stable@vger.kernel.org
      Acked-by: default avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      
      (cherry picked from commit ffbc6f0e)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3d55f426
    • Eric W. Biederman's avatar
      mnt: Move the test for MNT_LOCK_READONLY from change_mount_flags into do_remount · f6ac37e1
      Eric W. Biederman authored
      There are no races as locked mount flags are guaranteed to never change.
      
      Moving the test into do_remount makes it more visible, and ensures all
      filesystem remounts pass the MNT_LOCK_READONLY permission check.  This
      second case is not an issue today as filesystem remounts are guarded
      by capable(CAP_DAC_ADMIN) and thus will always fail in less privileged
      mount namespaces, but it could become an issue in the future.
      
      Cc: stable@vger.kernel.org
      Acked-by: default avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      
      (cherry picked from commit 07b64558)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f6ac37e1
    • Steven Rostedt (Red Hat)'s avatar
      ring-buffer: Up rb_iter_peek() loop count to 3 · 0c1377c6
      Steven Rostedt (Red Hat) authored
      After writting a test to try to trigger the bug that caused the
      ring buffer iterator to become corrupted, I hit another bug:
      
       WARNING: CPU: 1 PID: 5281 at kernel/trace/ring_buffer.c:3766 rb_iter_peek+0x113/0x238()
       Modules linked in: ipt_MASQUERADE sunrpc [...]
       CPU: 1 PID: 5281 Comm: grep Tainted: G        W     3.16.0-rc3-test+ #143
       Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./To be filled by O.E.M., BIOS SDBLI944.86P 05/08/2007
        0000000000000000 ffffffff81809a80 ffffffff81503fb0 0000000000000000
        ffffffff81040ca1 ffff8800796d6010 ffffffff810c138d ffff8800796d6010
        ffff880077438c80 ffff8800796d6010 ffff88007abbe600 0000000000000003
       Call Trace:
        [<ffffffff81503fb0>] ? dump_stack+0x4a/0x75
        [<ffffffff81040ca1>] ? warn_slowpath_common+0x7e/0x97
        [<ffffffff810c138d>] ? rb_iter_peek+0x113/0x238
        [<ffffffff810c138d>] ? rb_iter_peek+0x113/0x238
        [<ffffffff810c14df>] ? ring_buffer_iter_peek+0x2d/0x5c
        [<ffffffff810c6f73>] ? tracing_iter_reset+0x6e/0x96
        [<ffffffff810c74a3>] ? s_start+0xd7/0x17b
        [<ffffffff8112b13e>] ? kmem_cache_alloc_trace+0xda/0xea
        [<ffffffff8114cf94>] ? seq_read+0x148/0x361
        [<ffffffff81132d98>] ? vfs_read+0x93/0xf1
        [<ffffffff81132f1b>] ? SyS_read+0x60/0x8e
        [<ffffffff8150bf9f>] ? tracesys+0xdd/0xe2
      
      Debugging this bug, which triggers when the rb_iter_peek() loops too
      many times (more than 2 times), I discovered there's a case that can
      cause that function to legitimately loop 3 times!
      
      rb_iter_peek() is different than rb_buffer_peek() as the rb_buffer_peek()
      only deals with the reader page (it's for consuming reads). The
      rb_iter_peek() is for traversing the buffer without consuming it, and as
      such, it can loop for one more reason. That is, if we hit the end of
      the reader page or any page, it will go to the next page and try again.
      
      That is, we have this:
      
       1. iter->head > iter->head_page->page->commit
          (rb_inc_iter() which moves the iter to the next page)
          try again
      
       2. event = rb_iter_head_event()
          event->type_len == RINGBUF_TYPE_TIME_EXTEND
          rb_advance_iter()
          try again
      
       3. read the event.
      
      But we never get to 3, because the count is greater than 2 and we
      cause the WARNING and return NULL.
      
      Up the counter to 3.
      
      Cc: stable@vger.kernel.org # 2.6.37+
      Fixes: 69d1b839 "ring-buffer: Bind time extend and data events together"
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      
      (cherry picked from commit 021de3d9)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0c1377c6
    • Steven Rostedt (Red Hat)'s avatar
      ring-buffer: Always reset iterator to reader page · bc630959
      Steven Rostedt (Red Hat) authored
      When performing a consuming read, the ring buffer swaps out a
      page from the ring buffer with a empty page and this page that
      was swapped out becomes the new reader page. The reader page
      is owned by the reader and since it was swapped out of the ring
      buffer, writers do not have access to it (there's an exception
      to that rule, but it's out of scope for this commit).
      
      When reading the "trace" file, it is a non consuming read, which
      means that the data in the ring buffer will not be modified.
      When the trace file is opened, a ring buffer iterator is allocated
      and writes to the ring buffer are disabled, such that the iterator
      will not have issues iterating over the data.
      
      Although the ring buffer disabled writes, it does not disable other
      reads, or even consuming reads. If a consuming read happens, then
      the iterator is reset and starts reading from the beginning again.
      
      My tests would sometimes trigger this bug on my i386 box:
      
      WARNING: CPU: 0 PID: 5175 at kernel/trace/trace.c:1527 __trace_find_cmdline+0x66/0xaa()
      Modules linked in:
      CPU: 0 PID: 5175 Comm: grep Not tainted 3.16.0-rc3-test+ #8
      Hardware name:                  /DG965MQ, BIOS MQ96510J.86A.0372.2006.0605.1717 06/05/2006
       00000000 00000000 f09c9e1c c18796b3 c1b5d74c f09c9e4c c103a0e3 c1b5154b
       f09c9e78 00001437 c1b5d74c 000005f7 c10bd85a c10bd85a c1cac57c f09c9eb0
       ed0e0000 f09c9e64 c103a185 00000009 f09c9e5c c1b5154b f09c9e78 f09c9e80^M
      Call Trace:
       [<c18796b3>] dump_stack+0x4b/0x75
       [<c103a0e3>] warn_slowpath_common+0x7e/0x95
       [<c10bd85a>] ? __trace_find_cmdline+0x66/0xaa
       [<c10bd85a>] ? __trace_find_cmdline+0x66/0xaa
       [<c103a185>] warn_slowpath_fmt+0x33/0x35
       [<c10bd85a>] __trace_find_cmdline+0x66/0xaa^M
       [<c10bed04>] trace_find_cmdline+0x40/0x64
       [<c10c3c16>] trace_print_context+0x27/0xec
       [<c10c4360>] ? trace_seq_printf+0x37/0x5b
       [<c10c0b15>] print_trace_line+0x319/0x39b
       [<c10ba3fb>] ? ring_buffer_read+0x47/0x50
       [<c10c13b1>] s_show+0x192/0x1ab
       [<c10bfd9a>] ? s_next+0x5a/0x7c
       [<c112e76e>] seq_read+0x267/0x34c
       [<c1115a25>] vfs_read+0x8c/0xef
       [<c112e507>] ? seq_lseek+0x154/0x154
       [<c1115ba2>] SyS_read+0x54/0x7f
       [<c188488e>] syscall_call+0x7/0xb
      ---[ end trace 3f507febd6b4cc83 ]---
      >>>> ##### CPU 1 buffer started ####
      
      Which was the __trace_find_cmdline() function complaining about the pid
      in the event record being negative.
      
      After adding more test cases, this would trigger more often. Strangely
      enough, it would never trigger on a single test, but instead would trigger
      only when running all the tests. I believe that was the case because it
      required one of the tests to be shutting down via delayed instances while
      a new test started up.
      
      After spending several days debugging this, I found that it was caused by
      the iterator becoming corrupted. Debugging further, I found out why
      the iterator became corrupted. It happened with the rb_iter_reset().
      
      As consuming reads may not read the full reader page, and only part
      of it, there's a "read" field to know where the last read took place.
      The iterator, must also start at the read position. In the rb_iter_reset()
      code, if the reader page was disconnected from the ring buffer, the iterator
      would start at the head page within the ring buffer (where writes still
      happen). But the mistake there was that it still used the "read" field
      to start the iterator on the head page, where it should always start
      at zero because readers never read from within the ring buffer where
      writes occur.
      
      I originally wrote a patch to have it set the iter->head to 0 instead
      of iter->head_page->read, but then I questioned why it wasn't always
      setting the iter to point to the reader page, as the reader page is
      still valid.  The list_empty(reader_page->list) just means that it was
      successful in swapping out. But the reader_page may still have data.
      
      There was a bug report a long time ago that was not reproducible that
      had something about trace_pipe (consuming read) not matching trace
      (iterator read). This may explain why that happened.
      
      Anyway, the correct answer to this bug is to always use the reader page
      an not reset the iterator to inside the writable ring buffer.
      
      Cc: stable@vger.kernel.org # 2.6.28+
      Fixes: d769041f "ring_buffer: implement new locking"
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      
      (cherry picked from commit 651e22f2)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      bc630959
    • Hans de Goede's avatar
      ACPI / video: Disable native_backlight on HP ENVY 15 Notebook PC · 646d4ee3
      Hans de Goede authored
      Link: https://bugs.freedesktop.org/show_bug.cgi?id=81515Reported-and-tested-by: default avatarHohahiu <rakothedin@gmail.com>
      Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 84c34858)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      646d4ee3
    • Hans de Goede's avatar
      ACPI / video: Add a disable_native_backlight quirk · 154f1c14
      Hans de Goede authored
      Some laptops have a working acpi_video backlight control, and using native
      backlight on these causes a regression where backlight control does not work
      when userspace is not handling brightness key events. Disable native_backlight
      on these to fix this.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=81691Reported-and-tested-by: default avatarAndre Müller <andre.muller@web.de>
      Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 5f24079b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      154f1c14
    • Jiri Kosina's avatar
      ACPI / cpuidle: fix deadlock between cpuidle_lock and cpu_hotplug.lock · cea42267
      Jiri Kosina authored
      There is a following AB-BA dependency between cpu_hotplug.lock and
      cpuidle_lock:
      
      1) cpu_hotplug.lock -> cpuidle_lock
      enable_nonboot_cpus()
       _cpu_up()
        cpu_hotplug_begin()
         LOCK(cpu_hotplug.lock)
       cpu_notify()
        ...
        acpi_processor_hotplug()
         cpuidle_pause_and_lock()
          LOCK(cpuidle_lock)
      
      2) cpuidle_lock -> cpu_hotplug.lock
      acpi_os_execute_deferred() workqueue
       ...
       acpi_processor_cst_has_changed()
        cpuidle_pause_and_lock()
         LOCK(cpuidle_lock)
        get_online_cpus()
         LOCK(cpu_hotplug.lock)
      
      Fix this by reversing the order acpi_processor_cst_has_changed() does
      thigs -- let it first execute the protection against CPU hotplug by
      calling get_online_cpus() and obtain the cpuidle lock only after that (and
      perform the symmentric change when allowing CPUs hotplug again and
      dropping cpuidle lock).
      
      Spotted by lockdep.
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 6726655d)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      cea42267
    • Lv Zheng's avatar
      ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC · a321cedd
      Lv Zheng authored
      There is platform refusing to respond QR_EC when SCI_EVT isn't set
      which is Acer Aspire V5-573G.
      
      By disallowing QR_EC to be issued before the previous one has been
      completed we are able to reduce the possibilities to trigger issues on
      such platforms.
      
      Note that this fix can only reduce the occurrence rate of this issue, but
      this issue may still occur when such a platform doesn't clear SCI_EVT
      before or immediately after completing the previous QR_EC transaction.
      This patch cannot fix the CLEAR_ON_RESUME quirk which also relies on
      the assumption that the platforms are able to respond even when SCI_EVT
      isn't set.
      
      But this patch is still useful as it can help to reduce the number of
      scheduled QR_EC work items.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=82611Reported-and-tested-by: default avatarAlexander Mezin <mezin.alexander@gmail.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 558e4736)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a321cedd
    • Lan Tianyu's avatar
      ACPI: Run fixed event device notifications in process context · 18fd5e81
      Lan Tianyu authored
      Currently, notify callbacks for fixed button events are run from
      interrupt context.  That is not necessary and after commit 0bf6368e
      (ACPI / button: Add ACPI Button event via netlink routine) it causes
      netlink routines to be called from interrupt context which is not
      correct.
      
      Also, that is different from non-fixed device events (including
      non-fixed button events) whose notify callbacks are all executed from
      process context.
      
      For the above reasons, make fixed button device notify callbacks run
      in process context which will avoid the deadlock when using netlink
      to report button events to user space.
      
      Fixes: 0bf6368e (ACPI / button: Add ACPI Button event via netlink routine)
      Link: https://lkml.org/lkml/2014/8/21/606Reported-by: default avatarBenjamin Block <bebl@mageta.org>
      Reported-by: default avatarKnut Petersen <Knut_Petersen@t-online.de>
      Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
      [rjw: Function names, subject and changelog.]
      Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 236105db)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      18fd5e81
    • David E. Box's avatar
      ACPICA: Fix a regression for deletion of Alias() objects. · 6643b42f
      David E. Box authored
      Fixes a regression introduced by commit e23d9b82 (ACPICA:
      Namespace: Properly null terminate objects detached from a namespace
      node)
      
      In the case of Alias namespace nodes, the node simply points to the aliased
      node via the Object field; thus we cannot assume that the object is an
      operand object.
      
      Fixes: e23d9b82 (ACPICA: Namespace: Properly null terminate objects detached from a namespace node)
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Update version to 20140627
      
      Version 20140627.
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Tables: Merge DMAR table structure updates
      
      This patch is a back port result of the following Linux commit:
        Author: David Woodhouse <David.Woodhouse@intel.com>
        Subject: iommu/vt-d: Add ACPI namespace device reporting structures
      
      ACPICA need to handle old compilers where u8 object_name[] is only allowed
      for an initialized variable. This patch reduces back port source code
      differences between Linux and ACPICA upstream.
      
      Cc: David Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Hardware: back port of a recursive locking fix
      
      This patch is a back port result of the following Linux commit:
       Commit: f7f71cfb
       Author: Rakib Mullick <rakib.mullick@gmail.com>
       Subject: ACPI: Fix possible recursive locking in hwregs.c
      
      As a result of different coding style rules, the back ported code generates
      source code differences between the Linux kernel and the ACPICA upstream.
      This patch reduces such source code differences.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: utprint/oslibcfs: cleanup - no functional change
      
      Some cleanup and comment update.
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Executer: Fix trivial issues in acpi_get_serial_access_bytes()
      
      This patch fixes trivial issues in acpi_get_serial_access_bytes(), no real
      functional bugs. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: OSL: Update acpidump to reduce source code differences
      
      This patch is a result of an ACPICA commit to enables acpidump for EFI. For
      Linux kernel, this patch is a no-op. It is only required by the ACPICA
      release process to reduce the source code differences between the Linux
      kernel and the ACPICA upstream. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: acpidump: Reduce freopen() invocations to improve portability
      
      This patch reduces the requirement of invoking freopen() in acpidump in order
      to reduce the porting effort of acpidump.
      
      This patch achieves this by turning all acpi_os_printf(stdout) into
      acpi_ut_file_printf(gbl_output_file). Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: acpidump: Replace file IOs with new APIs to improve portability
      
      The new APIs are enabled to offer a portable layer to access files:
       1. acpi_os_XXX_file_XXX: Wrapper of fopen/fclose/fread/fwrite
       2. acpi_os_printf: Wrapper of printf
       3. acpi_log_error: Wrapper of fprintf(stderr)
      
      This patch deploys such mechanisms to acpidump to improve the portability
      of this tool. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: acpidump: Remove exit() from generic layer to improve portability
      
      This patch removes exit() from generic acpidump code to improve the
      portability of this tool. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: acpidump: Add memory/string OSL usage to improve portability
      
      This patch adds code to use generic OSL for acpidump to improve the
      portability of this tool. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Common: Enhance acpi_getopt() to improve portability
      
      This patch enhances acpi_getopt() by converting the standard C library
      invocations into portable ACPI string APIs and acpi_log_error() to improve
      portability. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Common: Enhance cm_get_file_size() to improve portability
      
      This patch uses abstract file IO and acpi_log_error() APIs to enhance
      cm_get_file_size() so that applications that invoke this API could have
      portability improved.
      
      With actual references added to abstract file IO and acpi_log_error(), the
      applications need to link oslibcfs.o, utdebug.o, utexcep.o, utmath.o,
      utprint.o and utxferror.o.
      
      It is also required to add acpi_os_initialize() invocations if an
      application starts to use acpi_log_error().
      
      acpidump has already invoked acpi_os_initialize() in this way.  Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Application: Enhance ACPI_USAGE_xxx/ACPI_OPTION with acpi_os_printf() to improve portability
      
      This patch enhances ACPI_USAGE_xxx/ACPI_OPTION macros to use portable
      acpi_os_printf() so that usage functions for applications no longer rely on
      the printf() API.
      
      To use acpi_os_printf() exported by osunixxf.c as a replacement of
      printf(), applications need to initialize acpi_gbl_output_file to stdout
      and initialize acpi_gbl_db_output_flags to ACPI_DB_CONSOLE_OUTPUT. The
      latter is automatically done by ACPI_INIT_GLOBAL(), applications need to
      link utglobal.o to utilize this mechanism. For GCC, assigning stdout to
      acpi_gbl_output_file using ACPI_INIT_GLOBAL() is not possible as stdout is
      not a constant in GCC environment. As an alternative solution, stdout
      assignment has been put into acpi_os_initialize(). Thus
      acpi_os_initialize() need to be invoked very early by the applications to
      initialize the default output of acpi_os_printf() to keep behavior
      consistency.
      
      acpidump has already invoked acpi_os_initialize() in this way. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Utilities: Introduce acpi_log_error() to improve portability
      
      Invocations like fprintf(stderr) and perror() are not portable, this patch
      introduces acpi_log_error() as a replacement, it is implemented using new
      portable API - acpi_ut_file_vprintf().
      
      Note that though acpi_os_initialize() need to be invoked prior than using
      this new API, since no users are introduced in this patch, such invocations
      are not added for applications that link utprint.c in this patch. Futher
      patches that introduce users of acpi_log_error() should take care of this.
      
      This patch is only useful for ACPICA applications, most of which are not
      shipped in the Linux kernel.
      
      Note that follow-up commits will update acpidump to use this new API to
      improve portability. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Namespace: Properly null terminate objects detached from a namespace node
      
      Fixes a bug exposed by an ACPICA unit test around the
      acpi_attach_data()/acpi_detach_data() APIs where the failure to null
      terminate a detached object led to the creation of a circular linked list
      (and infinite looping) when the object is reattached.
      
      Reported in acpica bugzilla #1063
      
      Link: https://bugs.acpica.org/show_bug.cgi?id=1063Signed-off-by: default avatarDavid E. Box <david.e.box@linux.intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Utilities: Add formatted printing APIs
      
      This patch introduces formatted printing APIs to handle ACPICA specific
      formatted print requirements. Currently only specific OSPMs will use this
      customized printing support, Linux kernel doesn't use these APIs at this
      time. It will be enabled for Linux kernel resident ACPICA after being well
      tested. So currently this patch is a no-op.
      
      The specific formatted printing APIs are useful to ACPICA as:
       1. Some portable applications do not link standard C library, so they
          cannot use standard formatted print APIs directly.
       2. Platform specific printing format may differ and thus not portable, for
          example, u64 is %ull for Linux kernel and is %uI64 for some MSVC
          versions.
       3. Platform specific printing format may conflict with ACPICA's usages
          while it is not possible for ACPICA developers to test their code for
          all platforms. For example, developers may generate %pRxxx while Linux
          kernel treats %pR as structured resource printing and decodes variable
          argument as a "struct resource" pointer.
      This patch solves above issues by introducing the new APIs.
      
      Note that users of such APIs are not introduced in this patch. Users of
      acpi_os_file_vprintf()/acpi_ut_file_printf() need to invoke acpi_os_initialize(),
      this should be taken care by the further patches where such users are
      introduced. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: OSL: Add portable file IO to improve portability
      
      This patch adds portable file IO to generic OSL to improve the portability
      of the applications.
      
      A portable application may use different file IO interfaces than the
      standard C library ones. This patch thus introduces an abstract file IO
      layer into the generic OSL.
      
      Note that this patch does not introduce users of such interfaces, further
      patches should introduce users one by one carefully with build tests
      performed. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: OSL: Clean up acpi_os_printf()/acpi_os_vprintf() stubs
      
      This patch is mainly for acpidump where there are redundant
      acpi_os_printf()/acpi_os_vprintf() stubs implemented. This patch cleans up such
      specific implementation by linking acpidump to osunixxf.c/oswinxf.c.
      
      To make acpi_os_printf() exported by osunixxf.c/oswinxf.c to behave as the
      old acpidump specific ones, applications need to:
       1. Initialize acpi_gbl_db_output_flags to ACPI_DB_CONSOLE_OUTPUT.
          This is automatically done by ACPI_INIT_GLOBAL(), applications need to
          link utglobal.o to utilize this mechanism.
       2. Initialize acpi_gbl_output_file to stdout.
          For GCC, assigning stdout to acpi_gbl_output_file using ACPI_INIT_GLOBAL()
          is not possible as stdout is not a constant in GCC environment. As an
          alternative solution, stdout assignment is put into acpi_os_initialize().
          Thus acpi_os_initialize() need to be invoked very early by the
          applications to initialize the default output of acpi_os_printf().
      
      This patch also releases osunixxf.c to the Linux kernel. Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: Utilities: Cleanup DEFINE_ACPI_GLOBALS by moving acpi_ut_init_global() from utglobal.c to utinit.c
      
      The utglobal.c is used to define and initialize global variables.  It makes
      sense if just adding utglobal.o to applications that are using such
      variables. But acpi_ut_init_globals() is preventing us from doing so as
      this initialization function references other components' initializations
      code, which leads to the requirement that many files should also get linked
      if one wants to link utglobal.o.
      
      It is possible to just move acpi_ut_init_global() to utinit.c for
      applications that require this function to link.
      
      By linking utglobal.o, we can stop defining DEFINE_ACPI_GLOBALS for
      applications (currently only acpidump is affected). Lv Zheng.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      ACPICA: OSL: Update environments to improve portability
      
      This patch contains some environment updates that will be used by acpidump
      because:
       1. The follow-up commits will release osunixxf.c to the Linux kernel for
          acpidump to link, and
       2. Such environment settings will be used to avoid linkage issues.
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 7817e265
      e23d9b82)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      6643b42f
    • David E. Box's avatar
      ACPICA: Utilities: Fix memory leak in acpi_ut_copy_iobject_to_iobject · 516743b2
      David E. Box authored
      Adds return status check on copy routines to delete the allocated destination
      object if either copy fails. Reported by Colin Ian King on bugs.acpica.org,
      Bug 1087.
      The last applicable commit:
       Commit: 3371c19c
       Subject: ACPICA: Remove ACPI_GET_OBJECT_TYPE macro
      
      Link: https://bugs.acpica.org/show_bug.cgi?id=1087Reported-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid E. Box <david.e.box@linux.intel.com>
      Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: 3.9+ <stable@vger.kernel.org> # 3.9+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 8aa5e56e)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      516743b2
    • Sebastian Reichel's avatar
      bq2415x_charger: Fix Atomic Sleep Bug · a38279ad
      Sebastian Reichel authored
      Move sysfs_notify and i2c_transfer calls from bq2415x_notifier_call
      to bq2415x_timer_work to avoid sleeping in atomic context.
      
      This fixes the following bug:
      
      [ 7.667449] Workqueue: events power_supply_changed_work
      [ 7.673034] [<c0015c28>] (unwind_backtrace+0x0/0xe0) from [<c0011e1c>] (show_stack+0x10/0x14)
      [ 7.682098] [<c0011e1c>] (show_stack+0x10/0x14) from [<c052cdd0>] (dump_stack+0x78/0xac)
      [ 7.690704] [<c052cdd0>] (dump_stack+0x78/0xac) from [<c052a044>] (__schedule_bug+0x48/0x60)
      [ 7.699645] [<c052a044>] (__schedule_bug+0x48/0x60) from [<c053071c>] (__schedule+0x74/0x638)
      [ 7.708618] [<c053071c>] (__schedule+0x74/0x638) from [<c05301fc>] (schedule_timeout+0x1dc/0x24c)
      [ 7.718017] [<c05301fc>] (schedule_timeout+0x1dc/0x24c) from [<c05316ec>] (wait_for_common+0x138/0x17c)
      [ 7.727966] [<c05316ec>] (wait_for_common+0x138/0x17c) from [<c0362a70>] (omap_i2c_xfer+0x340/0x4a0)
      [ 7.737640] [<c0362a70>] (omap_i2c_xfer+0x340/0x4a0) from [<c035d928>] (__i2c_transfer+0x40/0x74)
      [ 7.747039] [<c035d928>] (__i2c_transfer+0x40/0x74) from [<c035e22c>] (i2c_transfer+0x6c/0x90)
      [ 7.756195] [<c035e22c>] (i2c_transfer+0x6c/0x90) from [<c037ad24>] (bq2415x_i2c_write+0x48/0x78)
      [ 7.765563] [<c037ad24>] (bq2415x_i2c_write+0x48/0x78) from [<c037ae60>] (bq2415x_set_weak_battery_voltage+0x4c/0x50)
      [ 7.776824] [<c037ae60>] (bq2415x_set_weak_battery_voltage+0x4c/0x50) from [<c037bce8>] (bq2415x_set_mode+0xdc/0x14c)
      [ 7.788085] [<c037bce8>] (bq2415x_set_mode+0xdc/0x14c) from [<c037bfb8>] (bq2415x_notifier_call+0xa8/0xb4)
      [ 7.798309] [<c037bfb8>] (bq2415x_notifier_call+0xa8/0xb4) from [<c005f228>] (notifier_call_chain+0x38/0x68)
      [ 7.808715] [<c005f228>] (notifier_call_chain+0x38/0x68) from [<c005f284>] (__atomic_notifier_call_chain+0x2c/0x3c)
      [ 7.819732] [<c005f284>] (__atomic_notifier_call_chain+0x2c/0x3c) from [<c005f2a8>] (atomic_notifier_call_chain+0x14/0x18)
      [ 7.831420] [<c005f2a8>] (atomic_notifier_call_chain+0x14/0x18) from [<c0378078>] (power_supply_changed_work+0x6c/0xb8)
      [ 7.842864] [<c0378078>] (power_supply_changed_work+0x6c/0xb8) from [<c00556c0>] (process_one_work+0x248/0x440)
      [ 7.853546] [<c00556c0>] (process_one_work+0x248/0x440) from [<c0055d6c>] (worker_thread+0x208/0x350)
      [ 7.863372] [<c0055d6c>] (worker_thread+0x208/0x350) from [<c005b0ac>] (kthread+0xc8/0xdc)
      [ 7.872131] [<c005b0ac>] (kthread+0xc8/0xdc) from [<c000e138>] (ret_from_fork+0x14/0x3c)
      
      Fixes: 32260308 ("bq2415x_charger: Use power_supply notifier for automode")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      
      (cherry picked from commit 3c018504)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a38279ad
    • Ben Hutchings's avatar
      bfa: Fix undefined bit shift on big-endian architectures with 32-bit DMA address · 6a6c58f9
      Ben Hutchings authored
      bfa_swap_words() shifts its argument (assumed to be 64-bit) by 32 bits
      each way.  In two places the argument type is dma_addr_t, which may be
      32-bit, in which case the effect of the bit shift is undefined:
      
      drivers/scsi/bfa/bfa_fcpim.c: In function 'bfa_ioim_send_ioreq':
      drivers/scsi/bfa/bfa_fcpim.c:2497:4: warning: left shift count >= width of type [enabled by default]
          addr = bfa_sgaddr_le(sg_dma_address(sg));
          ^
      drivers/scsi/bfa/bfa_fcpim.c:2497:4: warning: right shift count >= width of type [enabled by default]
      drivers/scsi/bfa/bfa_fcpim.c:2509:4: warning: left shift count >= width of type [enabled by default]
          addr = bfa_sgaddr_le(sg_dma_address(sg));
          ^
      drivers/scsi/bfa/bfa_fcpim.c:2509:4: warning: right shift count >= width of type [enabled by default]
      
      Avoid this by adding casts to u64 in bfa_swap_words().
      
      Compile-tested only.
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Acked-by: default avatarAnil Gurumurthy <anil.gurumurthy@qlogic.com>
      Cc: stable@vger.kernel.org
      Fixes: f16a1750 ('[SCSI] bfa: remove all OS wrappers')
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      
      (cherry picked from commit 03a6c3ff)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      6a6c58f9
    • Daniel Mack's avatar
      ASoC: pxa-ssp: drop SNDRV_PCM_FMTBIT_S24_LE · 9cb67c5c
      Daniel Mack authored
      This mode is unsupported, as the DMA controller can't do zero-padding
      of samples.
      Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
      Reported-by: default avatarJohannes Stezenbach <js@sig21.net>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 9301503a)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9cb67c5c
    • Sylwester Nawrocki's avatar
      ASoC: samsung: Correct I2S DAI suspend/resume ops · 16881e70
      Sylwester Nawrocki authored
      We should save/restore relevant I2S registers regardless of
      the dai->active flag, otherwise some settings are being lost
      after system suspend/resume cycle. E.g. I2S slave mode set only
      during dai initialization is not preserved and the device ends
      up in master mode after system resume.
      Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit d3d4e524)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      16881e70
    • Praveen Diwakar's avatar
      ASoC: wm_adsp: Add missing MODULE_LICENSE · a9629b3d
      Praveen Diwakar authored
      Since MODULE_LICENSE is missing the module load fails,
      so add this for module.
      Signed-off-by: default avatarPraveen Diwakar <praveen.diwakar@intel.com>
      Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
      Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 0a37c6ef)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a9629b3d
    • Qiao Zhou's avatar
      ASoC: pcm: fix dpcm_path_put in dpcm runtime update · 258eb0a5
      Qiao Zhou authored
      we need to release dapm widget list after dpcm_path_get in
      soc_dpcm_runtime_update. otherwise, there will be potential memory
      leak. add dpcm_path_put to fix it.
      Signed-off-by: default avatarQiao Zhou <zhouqiao@marvell.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 7ed9de76)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      258eb0a5
    • Markos Chandras's avatar
      MIPS: EVA: Add new EVA header · b8010212
      Markos Chandras authored
      Generic code may need to perform certain operations when EVA is
      enabled, for example, configure the segmentation registers during
      boot. In order to avoid using more CONFIG_EVA ifdefs in the arch code,
      such functions will be added in this header instead.
      Initially this header contains a macro which will be used by generic
      code later on during VPEs configuration on secondary cores.
      All it does is to call the platform specific EVA init code in case
      EVA is enabled.
      Reviewed-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Patchwork: http://patchwork.linux-mips.org/patch/7422/Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      
      MIPS: scall64-o32: Fix indirect syscall detection
      
      Commit 4c21b8fd (MIPS: seccomp: Handle indirect system calls (o32))
      added indirect syscall detection for O32 processes running on MIPS64
      but it did not work as expected. The reason is the the scall64-o32
      implementation differs compared to scall32-o32. In the former, the v0
      (syscall number) register contains the absolute syscall number
      (4000 + X) whereas in the latter it contains the relative syscall
      number (X). Fix the code to avoid doing an extra addition, and load
      the v0 register directly to the first argument for syscall_trace_enter.
      Moreover, set the .reorder assembler option in order to have better
      control on this part of the assembly code.
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Patchwork: http://patchwork.linux-mips.org/patch/7481/
      Cc: <stable@vger.kernel.org> # v3.15+
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      
      MIPS: syscall: Fix AUDIT value for O32 processes on MIPS64
      
      On MIPS64, O32 processes set both TIF_32BIT_ADDR and
      TIF_32BIT_REGS so the previous condition treated O32 applications
      as N32 when evaluating seccomp filters. Fix the condition to check
      both TIF_32BIT_{REGS, ADDR} for the N32 AUDIT flag.
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Patchwork: http://patchwork.linux-mips.org/patch/7480/
      Cc: <stable@vger.kernel.org> # v3.15+
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      
      MIPS: Loongson: Fix COP2 usage for preemptible kernel
      
      In preemptible kernel, only TIF_USEDFPU flag is reliable to distinguish
      whether _init_fpu()/_restore_fp() is needed. Because the value of the
      CP0_Status.CU1 isn't changed during preemption.
      
      V2: Fix coding style.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7515/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: NL: Fix nlm_xlp_defconfig build error
      
      The nlm_xlp_defconfig build fails with
      
      ./arch/mips/include/asm/mach-netlogic/topology.h:15:0:
      			error: "topology_core_id" redefined [-Werror]
      In file included from include/linux/smp.h:59:0,
      	[ ...]
                       from arch/mips/mm/dma-default.c:12:
      ./arch/mips/include/asm/smp.h:41:0:
      			note: this is the location of the previous definition
      
      and similar errors.
      
      This is caused by commit bda4584c ("MIPS: Support CPU topology files
      in sysfs") which adds the defines to arch/mips/include/asm/smp.h.
      
      Remove the defines from arch/mips/include/asm/mach-netlogic/topology.h
      as no longer necessary.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7513/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Remove race window in page fault handling
      
      Multicore MIPSes without I/D hardware coherency suffered from a race
      condition in the page fault handler. The page table entry was
      published before any pending lazy D-cache flush was committed, hence
      it allowed execution of stale page cache data by other VPEs in the
      system.
      
      To make the cache handling safe we need to perform flushing already in
      the set_pte_at function. MIPSes without coherent I-caches can get a
      small increase in flushes due to the unavailability of the execute
      flag in set_pte_at.
      
      [ralf@linux-mips.org: outlining set_pte_at() saves a good k in a test
      build, so I moved its definition from pgtable.h to cache.c.]
      Signed-off-by: default avatarLars Persson <larper@axis.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7511/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Malta: Improve system memory detection for '{e, }memsize' >= 2G
      
      Using kstrtol to parse the "{e,}memsize" variables was wrong because this
      parses signed long numbers. In case of '{e,}memsize' >= 2G, the top bit
      is set, resulting to -ERANGE errors and possibly random system memory
      boundaries. We fix this by replacing "kstrtol" with "kstrtoul".
      We also improve the code to check the kstrtoul return value and
      print a warning if an error was returned.
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: <stable@vger.kernel.org> # v3.15+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7543/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: Fix db1200 PSC clock enablement
      
      Enable PSC0 (I2C/SPI) clock and leave PSC1 (Audio) alone.  This patch
      restores functionality to both Audio and I2C/SPI.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7544/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47XX: Fix reboot problem on BCM4705/BCM4785
      
      This adds some code based on code from the Broadcom GPL tar to fix the
      reboot problems on BCM4705/BCM4785. I tried rebooting my device for ~10
      times and have never seen a problem. This reverts the changes in the
      previous commit and adds the real fix as suggested by Rafał.
      
      Setting bit 22 in Reg 22, sel 4 puts the BIU (Bus Interface Unit) into
      async mode.
      
      The previous commit was 316cad5c [MIPS:
      BCM47XX: make reboot more relaiable]
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Cc: jogo@openwrt.org
      Cc: zajec5@gmail.com
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7545/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Remove duplicated include from numa.c
      Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7537/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Add common plat_irq_dispatch declaration
      
      Add common declaration to get rid of following sparse warning: "symbol
      'plat_irq_dispatch' was not declared. Should it be static?"
      Signed-off-by: default avatarSergey Ryazanov <ryazanov.s.a@gmail.com>
      Cc: Linux MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7539/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: MSP71xx: remove unused plat_irq_dispatch() argument
      
      Remove unused argument to make the plat_irq_dispatch() function
      declaration similar to the realization of other platforms.
      Signed-off-by: default avatarSergey Ryazanov <ryazanov.s.a@gmail.com>
      Cc: Linux MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7538/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: GIC: Remove useless parens from GICBIS().
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: perf: Mark pmu interupt IRQF_NO_THREAD
      
      In RT kernel, I ran into the following calltrace, so PMU interrupts cannot
      be threaded
      
      in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/0
      INFO: lockdep is turned off.
      Call Trace:
      [<ffffffff8088595c>] dump_stack+0x1c/0x50
      [<ffffffff801a958c>] __might_sleep+0x13c/0x148
      [<ffffffff80891c54>] rt_spin_lock+0x3c/0xb0
      [<ffffffff801ad29c>] __wake_up+0x3c/0x80
      [<ffffffff80243ba4>] perf_event_wakeup+0x8c/0xf8
      [<ffffffff80243c50>] perf_pending_event+0x40/0x78
      [<ffffffff8023d88c>] irq_work_run+0x74/0xc0
      [<ffffffff80152640>] mipsxx_pmu_handle_shared_irq+0x110/0x228
      [<ffffffff8015276c>] mipsxx_pmu_handle_irq+0x14/0x30
      [<ffffffff801ffda4>] handle_irq_event_percpu+0xbc/0x470
      [<ffffffff80204478>] handle_percpu_irq+0x98/0xc8
      [<ffffffff801ff284>] generic_handle_irq+0x4c/0x68
      [<ffffffff8089748c>] do_IRQ+0x2c/0x48
      [<ffffffff80105864>] plat_irq_dispatch+0x64/0xd0
      
      [ralf@linux-mips.org: I don't see why based on this register dump the
      handler should be marked IRQF_NO_THREAD - but the handler is manipulating
      per-CPU resources so we don't want it to be rescheduled to another CPU.]
      Signed-off-by: default avatarYang Wei <Wei.Yang@windriver.com>
      Cc: a.p.zijlstra@chello.nl
      Cc: paulus@samba.org
      Cc: mingo@redhat.com
      Cc: acme@kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7506/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: kdump: Set correct value to kexec_indirection_page variable
      
      Since there is not indirection page in crash type, so the vaule of the head
      field of kimage structure is not equal to the address of indirection page but
      IND_DONE. so we have to set kexec_indirection_page variable to the address of
      the head field of image structure.
      
      [ralf@linux-mips.org: Don't add pointless empty line, fix trailing
      whitespace damage.]
      Signed-off-by: default avatarYang Wei <Wei.Yang@windriver.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7499/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: EVA: Add new EVA header
      
      Generic code may need to perform certain operations when EVA is
      enabled, for example, configure the segmentation registers during
      boot. In order to avoid using more CONFIG_EVA ifdefs in the arch code,
      such functions will be added in this header instead.
      Initially this header contains a macro which will be used by generic
      code later on during VPEs configuration on secondary cores.
      All it does is to call the platform specific EVA init code in case
      EVA is enabled.
      Reviewed-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Patchwork: http://patchwork.linux-mips.org/patch/7422/Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      
      (cherry picked from commit 64316467
      f85b71ce)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      b8010212
    • Alex Smith's avatar
      MIPS: asm/reg.h: Make 32- and 64-bit definitions available at the same time · e21f6fcb
      Alex Smith authored
      Get rid of the WANT_COMPAT_REG_H test and instead define both the 32-
      and 64-bit register offset definitions at the same time with
      MIPS{32,64}_ prefixes, then define the existing EF_* names to the
      correct definitions for the kernel's bitness.
      
      This patch is a prerequisite of the following bug fix patch.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: <stable@vger.kernel.org> # v3.13+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7451/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      (cherry picked from commit bcec7c8d)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      e21f6fcb
    • Huacai Chen's avatar
      MIPS: tlbex: Fix a missing statement for HUGETLB · c38a5c1d
      Huacai Chen authored
      In commit 2c8c53e2 (MIPS: Optimize TLB handlers for Octeon CPUs)
      build_r4000_tlb_refill_handler() is modified. But it doesn't compatible
      with the original code in HUGETLB case. Because there is a copy & paste
      error and one line of code is missing. It is very easy to produce a bug
      with LTP's hugemmap05 test.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Signed-off-by: default avatarBinbin Zhou <zhoubb@lemote.com>
      Cc: <stable@vger.kernel.org>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7496/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      (cherry picked from commit 8393c524)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c38a5c1d
    • Paul Burton's avatar
      MIPS: Prevent user from setting FCSR cause bits · 13f665bf
      Paul Burton authored
      If one or more matching FCSR cause & enable bits are set in saved thread
      context then when that context is restored the kernel will take an FP
      exception. This is of course undesirable and considered an oops, leading
      to the kernel writing a backtrace to the console and potentially
      rebooting depending upon the configuration. Thus the kernel avoids this
      situation by clearing the cause bits of the FCSR register when handling
      FP exceptions and after emulating FP instructions.
      
      However the kernel does not prevent userland from setting arbitrary FCSR
      cause & enable bits via ptrace, using either the PTRACE_POKEUSR or
      PTRACE_SETFPREGS requests. This means userland can trivially cause the
      kernel to oops on any system with an FPU. Prevent this from happening
      by clearing the cause bits when writing to the saved FCSR context via
      ptrace.
      
      This problem appears to exist at least back to the beginning of the git
      era in the PTRACE_POKEUSR case.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: stable@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7438/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      (cherry picked from commit b1442d39)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      13f665bf
    • Jeffrey Deans's avatar
      MIPS: GIC: Prevent array overrun · c6763e19
      Jeffrey Deans authored
      A GIC interrupt which is declared as having a GIC_MAP_TO_NMI_MSK
      mapping causes the cpu parameter to gic_setup_intr() to be increased
      to 32, causing memory corruption when pcpu_masks[] is written to again
      later in the function.
      Signed-off-by: default avatarJeffrey Deans <jeffrey.deans@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: stable@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7375/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: GIC: Remove GIC_FLAG_IPI
      
      irq-gic.c:gic_get_int() masks out interrupts from the pending set which
      aren’t in the pcpu_mask. Only interrupts marked with GIC_FLAG_IPI were
      set in pcpu_mask, meaning that peripheral interrupts also had to be
      marked as IPIs. Remove the use of GIC_FLAG_IPI and allow the flags
      member of struct gic_intr_map to be zero.
      Signed-off-by: default avatarJeffrey Deans <jeffrey.deans@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7374/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: GIC: Move GIC_NUM_INTRS into platform irq.h
      
      The value of GIC_NUM_INTRS is platform-specific. Using a default value
      from gic.h will result in incorrect behaviour on some systems, so
      require a suitable definition to be present in the platform's irq.h.
      Signed-off-by: default avatarJeffrey Deans <jeffrey.deans@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7373/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: GIC: move GIC interrupt bitmap declarations
      
      Several bitmaps are declared in arch/mips/include/asm/gic.h, but the
      scope of their use is limited to arch/mips/kernel/irq-gic.c. Move the
      declarations from the header file to the C file.
      Signed-off-by: default avatarJeffrey Deans <jeffrey.deans@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7372/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: kernel: cpu-probe: Detect unique RI/XI exceptions
      
      Detect if the core supports unique exception codes for the
      Read-Inhibit and Execute-Inhibit exceptions and set the
      option accordingly. The RI/XI exception support is detected
      by setting the 27th bit (IEC) of the PageGrain C0 register
      and reading back the value of that register to verify the
      bit is enabled.
      Signed-off-by: default avatarLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7340/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Use dedicated exception handler if CPU supports RI/XI exceptions
      
      Use the regular tlb_do_page_fault_0 (no write) handler to handle
      the RI and XI exceptions. Also skip the RI/XI validation check
      on TLB load handler since it's redundant when the CPU has
      unique RI/XI exceptions.
      Singed-off-by: default avatarLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7339/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Add new option for unique RI/XI exceptions
      
      MIPSr5 added support for unique exception codes for the Read-Inhibit
      and Execute-Inhibit exceptions.
      Signed-off-by: default avatarLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7338/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: mm: Use the Hardware Page Table Walker if the core supports it
      
      The Hardware Page Table Walker aims to speed up TLB refill exceptions
      by handling them in the hardware level instead of having a software
      TLB refill handler. However, a TLB refill exception can still be
      thrown in certain cases such as, synchronus exceptions, or address
      translation or memory errors during the HTW operation. As a result of
      which, HTW must not be considered a complete replacement for the TLB
      refill software handler, but rather a fast-path for it.
      For HTW to work, the PWBase register must contain the task's page
      global directory address so the HTW will kick in on TLB refill
      exceptions.
      
      Due to HTW being a separate engine embedded deep in the CPU pipeline,
      we need to restart the HTW everytime a PTE changes to avoid HTW
      fetching a old entry from the page tables. It's also necessary to
      restart the HTW on context switches to prevent it from fetching a
      page from the previous process. Finally, since HTW is using the
      entryhi register to write the translations to the TLB, it's necessary
      to stop the HTW whenever the entryhi changes (eg for tlb probe
      perations) and enable it back afterwards.
      
      == Performance ==
      
      The following trivial test was used to measure the performance of the
      HTW. Using the same root filesystem, the following command was used
      to measure the number of tlb refill handler executions with and
      without (using 'nohtw' kernel parameter) HTW support.  The kernel was
      modified to use a scratch register as a counter for the TLB refill
      exceptions.
      
      find /usr -type f -exec ls -lh {} \;
      
      HTW Enabled:
      TLB refill exceptions: 12306
      
      HTW Disabled:
      TLB refill exceptions: 17805
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7336/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: kernel: cpu-probe: Add support for the HardWare Table Walker
      
      Detect if the core implements the HTW and set the option accordingly.
      Also, add a new kernel parameter called 'nohtw' allowing
      the user to disable the htw support and fallback to the software
      refill handler.
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7335/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: asm: Add register definitions for Hardware Table Walker
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7326/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: cpu: Add new cpu option for Hardware Table Walker.
      
      Moreover, report hardware page table walker support as 'htw' in the ASE
      list of /proc/cpuinfo, if the core implements this feature.
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7334/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: cpu-info: Change the cpu options variable to unsigned long long
      
      Long integers which are 4 bytes in MIPS32 can't hold new CPU
      options anymore, so the type of the 'options' variable is changed
      to unsigned long long which allows 32 more cpu options to be defined
      for MIPS32
      
      Also, re-arrange the 'options' struct member to avoid potential 4-byte
      alignment gap in the middle of the struct.
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7324/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: perf: Add hardware events for P5600
      
      Add cases in perf_event_mipsxx.c for CPU_P5600. All the event numbers
      listed for proAptiv also apply to P5600, so we use mipsxxcore_event_map2
      and mipsxxcore_cache_map2 too, but the P5600 has 8-bit event numbers so
      bit 8 (256) of the user ABI config is used for the parity bit (to
      specify odd/even counter events).
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7242/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: perf: Allow for more perf events
      
      In mipsxx_pmu_map_raw_event(), set event_id to base_id after the cpu
      type conditional code to allow that code to override the base_id to use
      more bits from the config and a higher bit for parity.
      
      This will allow cores with up to 512 events between all even/odd
      counters (an 8-bit event id) such as P5600 to use bit 8 for parity.
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7243/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: asm/reg.h: Move to uapi
      
      This header defines an exported interface (the register layout used in
      core dumps and the GP regset accessible with PTRACE_{GET,SET}REGSET),
      therefore belongs in uapi.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7458/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Remove asm/user.h
      
      The struct user definition in this file is not used anywhere (the ELF
      core dumper does not use that format). Therefore, remove the header and
      instead enable the asm-generic user.h which is an empty header to
      satisfy a few generic headers which still try to include user.h.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7459/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Remove old core dump functions
      
      Since the core dumper now uses regsets, the old core dump functions are
      now unused. Remove them.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7456/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: ptrace: Fix user pt_regs definition, use in ptrace_{get, set}regs()
      
      In uapi/asm/ptrace.h, a user version of pt_regs is defined wrapped in
      ifndef __KERNEL__. This structure definition does not match anything
      used by any kernel API, in particular it does not match the format used
      by PTRACE_{GET,SET}REGS.
      
      Therefore, replace the structure definition with one matching what is
      used by PTRACE_{GET,SET}REGS. The format used by these is the same for
      both 32-bit and 64-bit.
      
      Also, change the implementation of PTRACE_{GET,SET}REGS to use this new
      structure definition. The structure is renamed to user_pt_regs when
      __KERNEL__ is defined to avoid conflicts with the kernel's own pt_regs.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7457/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: O32/32-bit: Remove outdated comment
      
      A comment in the O32/32-bit system call code is incorrect since commit
      46e12c07 ("MIPS: O32 / 32-bit: Always copy 4 stack arguments.").
      Remove it.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7455/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: O32/32-bit: Fix bug which can cause incorrect system call restarts
      
      On 32-bit/O32, pt_regs has a padding area at the beginning into which the
      syscall arguments passed via the user stack are copied. 4 arguments
      totalling 16 bytes are copied to offset 16 bytes into this area, however
      the area is only 24 bytes long. This means the last 2 arguments overwrite
      pt_regs->regs[{0,1}].
      
      If a syscall function returns an error, handle_sys stores the original
      syscall number in pt_regs->regs[0] for syscall restart. signal.c checks
      whether regs[0] is non-zero, if it is it will check whether the syscall
      return value is one of the ERESTART* codes to see if it must be
      restarted.
      
      Should a syscall be made that results in a non-zero value being copied
      off the user stack into regs[0], and then returns a positive (non-error)
      value that matches one of the ERESTART* error codes, this can be mistaken
      for requiring a syscall restart.
      
      While the possibility for this to occur has always existed, it is made
      much more likely to occur by commit 46e12c07 ("MIPS: O32 / 32-bit:
      Always copy 4 stack arguments."), since now every syscall will copy 4
      arguments and overwrite regs[0], rather than just those with 7 or 8
      arguments.
      
      Since that commit, booting Debian under a 32-bit MIPS kernel almost
      always results in a hang early in boot, due to a wait4 syscall returning
      a PID that matches one of the ERESTART* codes, which then causes an
      incorrect restart of the syscall.
      
      The problem is fixed by increasing the size of the padding area so that
      arguments copied off the stack will not overwrite pt_regs->regs[{0,1}].
      Signed-off-by: default avatarAlex Smith <alex.smith@imgtec.com>
      Cc: <stable@vger.kernel.org> # v3.13+
      Reviewed-by: default avatarAurelien Jarno <aurelien@aurel32.net>
      Tested-by: default avatarAurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7454/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: GIC: Prevent array overrun
      
      A GIC interrupt which is declared as having a GIC_MAP_TO_NMI_MSK
      mapping causes the cpu parameter to gic_setup_intr() to be increased
      to 32, causing memory corruption when pcpu_masks[] is written to again
      later in the function.
      Signed-off-by: default avatarJeffrey Deans <jeffrey.deans@imgtec.com>
      Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: stable@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7375/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: ptrace: Change GP regset to use correct core dump register layout
      
      Commit 6a9c001b ("MIPS: Switch ELF core dumper to use regsets.")
      switched the core dumper to use regsets, however the GP regset code
      simply makes a direct copy of the kernel's pt_regs, which does not
      match the original core dump register layout as defined in asm/reg.h.
      Furthermore, the definition of pt_regs can vary with certain Kconfig
      variables, therefore the GP regset can never be relied upon to return
      registers in the same layout.
      
      Therefore, this patch changes the GP regset to match the original core
      dump layout. The layout differs for 32- and 64-bit processes, so
      separate implementations of the get/set functions are added for the
      32- and 64-bit regsets.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: <stable@vger.kernel.org> # v3.13+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7452/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: asm/reg.h: Make 32- and 64-bit definitions available at the same time
      
      Get rid of the WANT_COMPAT_REG_H test and instead define both the 32-
      and 64-bit register offset definitions at the same time with
      MIPS{32,64}_ prefixes, then define the existing EF_* names to the
      correct definitions for the kernel's bitness.
      
      This patch is a prerequisite of the following bug fix patch.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: <stable@vger.kernel.org> # v3.13+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7451/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: ptrace: Test correct task's flags in task_user_regset_view()
      
      task_user_regset_view() should test for TIF_32BIT_REGS in the flags of
      the specified task, not of the current task.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: <stable@vger.kernel.org> # v3.13+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7450/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: ptrace: Avoid smp_processor_id() when retrieving FPU IR
      
      Whenever ptrace attempts to retrieve the FPU implementation register it
      accesses it through current_cpu_data, which calls smp_processor_id().
      Since the code may execute with preemption enabled, this can trigger
      a warning. Fix this by using boot_cpu_data to get the IR instead.
      Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
      Cc: <stable@vger.kernel.org> # v3.15+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7449/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47XX: Detect more then 128 MiB of RAM (HIGHMEM)
      
      So far BCM47XX can only detect amount of HIGHMEM. It still requires
      adding (registering) and well-testing before enabling by default.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7396/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      Revert "MIPS: Delete unused function add_temporary_entry."
      
      This reverts commit d7a887a7.
      
      Function add_temporary_entry is needed by bcm47xx to support highmem. We
      need to add a temporary entry to check for amount of RAM.
      The only change made in this revert was replacing (ENTER|EXIT)_CRITICAL.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Patchwork: https://patchwork.linux-mips.org/patch/7395/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47XX: Devices database update for 3.17
      
      Detect more devices and register leds & buttons for them.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7394/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47XX: Select SYS_SUPPORTS_HIGHMEM for BCM47XX_BCMA
      
      It seems that bcm47xx can handle only 128 MiB of RAM directly. There
      are few devices with 256 MiB, but Broadcom's SDK uses highmem to handle
      anything above 128 MiB.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Patchwork: https://patchwork.linux-mips.org/patch/7101/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47XX: Move shared symbols to the config BCM47XX
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Patchwork: https://patchwork.linux-mips.org/patch/7100/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47xx: Fix LEDs on WRT54GS V1.0
      Reported-by: default avatarCatalin Patulea <cat@vv.carleton.ca>
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Cc: linux-mips@linux-mips.org
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Patchwork: https://patchwork.linux-mips.org/patch/7113/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47xx: Distinguish WRT54G series devices by boardtype
      
      Catalin reported that GPIOs used by bcm47xx don't match layout of his
      WRT54GS V1.0 board. It seems we need to distinguish these 54G* devices.
      Reported-by: default avatarCatalin Patulea <cat@vv.carleton.ca>
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Patchwork: https://patchwork.linux-mips.org/patch/7112/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Loongson: Rename CONFIG_LEMOTE_MACH3A to CONFIG_LOONGSON_MACH3X
      
      Since this CONFIG option will be used for both Loongson-3A/3B machines,
      and not all Loongson-3 machines are produced by Lemote, we rename
      CONFIG_LEMOTE_MACH3A to CONFIG_LOONGSON_MACH3X.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7190/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Loongson-3: Enable the COP2 usage
      
      Loongson-3 has some specific instructions (MMI/SIMD) in coprocessor 2.
      COP2 isn't independent because it share COP1 (FPU)'s registers. This
      patch enable the COP2 usage so user-space programs can use the MMI/SIMD
      instructions. When COP2 exception happens, we enable both COP1 (FPU)
      and COP2, only in this way the fp context can be saved and restored
      correctly.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7189/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Add Loongson-3B support
      
      Loongson-3B is a 8-cores processor. In general it looks like there are
      two Loongson-3A integrated in one chip: 8 cores are separated into two
      groups (two NUMA node), each node has its own local memory.
      
      Of course there are some differences between one Loongson-3B and two
      Loongson-3A. E.g., the base addresses of IPI registers of each node are
      not the same; Loongson-3A use ChipConfig register to enable/disable
      clock, but Loongson-3B use FreqControl register instead.
      
      There are two revision of Loongson-3B, the first revision is called as
      Loongson-3B1000, whose frequency is 1GHz and has a PRid 0x6306, the
      second revision is called as Loongson-3B1500, whose frequency is 1.5GHz
      and has a PRid 0x6307. Both revisions has a bug that clock cannot be
      disabled at runtime, but this will be fixed in future.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7188/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Add numa api support
      
      Enable sys_mbind()/sys_get_mempolicy()/sys_set_mempolicy() for O32, N32,
      and N64 ABIs. By the way, O32/N32 should use the compat version of
      sys_migrate_pages()/sys_move_pages(), so fix that.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7186/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Add NUMA support for Loongson-3
      
      Multiple Loongson-3A chips can be interconnected with HT0-bus. This is
      a CC-NUMA system that every chip (node) has its own local memory and
      cache coherency is maintained by hardware. The 64-bit physical memory
      address format is as follows:
      
      0x-0000-YZZZ-ZZZZ-ZZZZ
      
      The high 16 bits should be 0, which means the real physical address
      supported by Loongson-3 is 48-bit. The "Y" bits is the base address of
      each node, which can be also considered as the node-id. The "Z" bits is
      the address offset within a node, which means every node has a 44 bits
      address space.
      
      Macros XPHYSADDR and MAX_PHYSMEM_BITS are modified unconditionally,
      because many other MIPS CPUs have also extended their address spaces.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7187/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Loongson: Modify ChipConfig register definition
      
      This patch is prepared for Multi-chip interconnection. Since each chip
      has a ChipConfig register, LOONGSON_CHIPCFG should be an array.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7185/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Support CPU topology files in sysfs
      
      This patch is prepared for Loongson's NUMA support, it offer meaningful
      sysfs files such as physical_package_id, core_id, core_siblings and
      thread_siblings in /sys/devices/system/cpu/cpu?/topology.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Reviewed-by: default avatarAndreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7184/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Support hard limit of cpu count (nr_cpu_ids)
      
      On MIPS currently, only the soft limit of cpu count (maxcpus) has its
      effect, this patch enable the hard limit (nr_cpus) as well. Processor
      cores which greater than maxcpus and less than nr_cpus can be taken up
      via cpu hotplug. The code is borrowed from X86.
      Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
      Reviewed-by: default avatarAndreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7183/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Remove incorrect NULL check in local_flush_tlb_page()
      
      We check that the struct vm_area_struct pointer vma is NULL and then
      dereference it a few lines below. The intent was to make sure vma is
      not NULL but this is not necessary since the bug pre-dates GIT history
      and seem to never have caused a problem. The tlb-4k and tlb-8k versions
      of local_flush_tlb_page() don't bother checking if vma is NULL, also
      vma is dereferenced before being passed to local_flush_tlb_page(),
      thus it is safe to remove this NULL check.
      Signed-off-by: default avatarEmil Goode <emilgoode@gmail.com>
      Reviewed-by: default avatarJonas Gorski <jogo@openwrt.org>
      Acked-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: John Crispin <blogic@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: kernel-janitors@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7264/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: smp-cps: Fix entry code cache flush for systems with coherent I/O
      
      The dma_cache_wback_inv function performs exactly as is required here,
      unless the system has coherent I/O in which case it's a no-op. Call the
      underlying cache writeback functions directly, which is arguably clearer
      anyway given that the code doesn't actually have anything to do with
      DMA in a strict sense.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7282/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: {pm,smp}-cps: use cpu_vpe_id macro
      
      When determining the VPE ID of a CPU, make use of the cpu_vpe_id macro
      which will return 0 in a non-MT kernel build. Most code is already doing
      so but a couple of places weren't. Fixing this prevents a build failure
      for non-MT kernels where struct cpuinfo_mips does not contain the vpe_id
      field:
      
        arch/mips/kernel/pm-cps.c: In function 'cps_pm_enter_state':
        arch/mips/kernel/pm-cps.c:153:51: error: 'struct cpuinfo_mips' has no
            member named 'vpe_id'
          vpe_cfg = &core_cfg->vpe_config[current_cpu_data.vpe_id];
      
        arch/mips/kernel/smp-cps.c: In function 'wait_for_sibling_halt':
        arch/mips/kernel/smp-cps.c:363:33: error: 'struct cpuinfo_mips' has no
            member named 'vpe_id'
          unsigned vpe_id = cpu_data[cpu].vpe_id;
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Reviewed-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Fix potential build failures using cpu_vpe_id on non-MT
      
      When used in a non-MT kernel, the cpu_vpe_id macro never made use of
      its cpuinfo argument. It doesn't actually need to since it is returning
      a constant 0. However not using the argument can lead to build failures
      if the compiler then notices that a variable used as part of the
      argument is unused. Prevent that problem by "using" the argument as far
      as the compiler is concerned, whilst still returning 0 as before.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Reviewed-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7280/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: pm-cps: Select CONFIG_MIPS_CPC
      
      The pm-cps code can run without a CPC, although will be limited to using
      only the 2 wait idle states. However the code does check for CPC
      presence, and in order to work optimally the CPC support is needed. So
      select it.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Reviewed-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7279/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: pm-cps: Prevent use of mips_cps_* without CPS SMP
      
      These symbols will not be defined when CONFIG_MIPS_CPS=n, but although
      the CPS_PM_POWER_GATED state will never be used in that case the
      compiler doesn't have enough information to figure that out. Add checks
      which evaluate to a constant false for CONFIG_MIPS_CPS=n cases in order
      to help the compiler out & eliminate the symbol references.
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      Reviewed-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7278/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47XX: add Microsoft MN-700 and Asus WL500G
      
      This patch adds detection for the Microsoft MN-700 and the Asus WL500G
      router. This is based on some old code from OpenWrt.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Cc: zajec5@gmail.com
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7490/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47XX: fixup broken MAC addresses in nvram
      
      The address prefix 00:90:4C is used by Broadcom in their initial
      configuration. When a mac address with the prefix 00:90:4C is used all
      devices from the same series are sharing the same mac address. To
      prevent mac address collisions we replace them with a mac address based
      on the base address. To generate such addresses we take the main mac
      address from et0macaddr and increase it by two for the first wifi
      device and by 3 for the second one. This matches the printed mac
      address on the device. The main mac address increased by one is used as
      wan address by the vendor code.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Cc: zajec5@gmail.com
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7489/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM47XX: make reboot more relaiable
      
      The reboot on the BCM47XX SoCs is done, by setting the watchdog counter
      to 1 and let it trigger a reboot, when it reaches 0. Some devices with
      a BCM4705/BCM4785 SoC do not reboot when the counter is set to 1 and
      decreased to 0 by the hardware. It looks like it works more reliable
      when we set it to 3. As far as I understand the hardware, this should
      not make any difference, but I do not have access to any documentation
      for this SoC.
      It is still not 100% reliable.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Cc: zajec5@gmail.com
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7488/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: TXx9: Delete an unused variable in tx4927_pcibios_setup
      Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7216/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: TXx9: Add __init_refok annotation to quirk_slc90e66_bridge
      
      This pci fixup routine calls __init functions.
      In general pci fixup routine must not call __init functions,
      but this pci/isa bridge device is not hotpluggable anyway.
      Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7215/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: TXx9: Fix quirk_slc90e66_ide
      
      Fix wrong code spotted by -Werror=array-bounds:
      	arch/mips/txx9/generic/pci.c:334:23: error: array subscript is above array bounds [-Werror=array-bounds]
      	  pci_write_config_byte(dev, regs[i], dat);
      Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7214/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: SB1: Check optional compilation flags one by one
      
      This fixes a regression caused by commit
      bb6c0bd3 [MIPS: SB1: Fix excessive kernel
      warnings.], that makes `-march=r5000' selected for compilation flags
      rather than supposed `-march=sb1' with compilers that do not support the
      ASE selection flags introduced with that change.
      
      For example GCC 4.1.2 supports `-mips3d'/`-mno-mips3d' (and obviously
      `-march=sb1'), however it does not support `-mdmx'/`-mno-mdmx'.  As a
      result the whole selection of flags fails and compilation resorts to using
      `-march=r5000', meant for really old compilers indeed only.
      
      It is always best to pick the flags individually unless we are absolutely
      sure a set of flags was introduced to the toolchain together (`-march=sb1'
      and `-mtune=sb1' would be a good example), and this change makes it happen
      for CONFIG_CPU_SB1.  Consequently the flags ultimately selected with GCC
      4.1.2 are `-march=sb1 -Wa,--trap -mno-mips3d'
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Cc: Richard Sandiford <rdsandiford@googlemail.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7223/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: asm/bitops.h: Guard CLZ with `.set mips32'
      
      This fixes:
      
      {standard input}: Assembler messages:
      {standard input}:145: Error: opcode not supported on this processor: vr5000 (mips4) `clz $2,$2'
      {standard input}:920: Error: opcode not supported on this processor: vr5000 (mips4) `clz $7,$9'
      {standard input}:1797: Error: opcode not supported on this processor: vr5000 (mips4) `clz $7,$7'
      {standard input}:1851: Error: opcode not supported on this processor: vr5000 (mips4) `clz $7,$7'
      {standard input}:2831: Error: opcode not supported on this processor: vr5000 (mips4) `clz $7,$7'
      {standard input}:4209: Error: opcode not supported on this processor: vr5000 (mips4) `clz $7,$7'
      {standard input}:4329: Error: opcode not supported on this processor: vr5000 (mips4) `clz $2,$2'
      make[2]: *** [arch/mips/mm/tlbex.o] Error 1
      
      which triggered due to a regression causing the file to be built with
      `-march=r5000' rather than `-march=sb1', fixed separately.  Nevertheless
      the error should not happen, the other uses of CLZ are appropriately
      guarded.  This change copies the arrangement from one of those other
      places.
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7222/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: c-r4k: Avoid duplicate CPU_74K/CPU_1074K checks
      
      Code in a switch statement in probe_pcache checks the CPU type twice
      unnecessarily for processor implementations that have the alias removal
      feature reported by the CP0 Config7.AR and Config7.IAR bits.  This change
      rewrites the affected fragment avoiding the extraneous check and improving
      readability.
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/7221/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Allow setting affinity for IPIC
      
      Wire up the set_affinity call for the internal PIC if booting on
      a cpu supporting it.
      Affinity is kept to boot cpu as default.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7323/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Use irq_desc as argument for (un)mask
      
      In preparation for applying affinity, use the irq descriptor as the
      argument for (un)mask.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7317/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Wire up the second cpu's irq line
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7322/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Protect irq register accesses
      
      Since we will have the chance of accessing the registers concurrently,
      protect any accesses through a spinlock.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7321/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Add cpu argument to dispatch internal
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7320/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Populate irq_{stat,mask}_addr for second cpu
      
      Set it to zero if there is no second set.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7319/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Append irq line to irq_{stat,mask}*
      
      The SMP capable irq controllers have two interrupt output pins which are
      controlled through separate registers, so make the variables arrays.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7318/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Replace irq dispatch code with a generic version
      
      The generic version uses a variable length of u32 registers instead of u32/u64.
      This allows easier support for "wider" registers without having to rewrite
      everything.
      
      This "generic" version is as fast as the old version in the best case
      (i == next set bit), and twice as fast in the worst case in 64 bits.
      
      Using a macro was chosen over a (forced) inline version because gcc generated
      more compact code with the macro.
      
      The change from (signed) int to unsigned int for i and to_call was intentional
      as the value can be only between 0 and (width - 1) anyway, and allowed gcc to
      optimise the code a bit further.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7316/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Move bcm63xx_init_irq down
      
      Allows up to drop the prototypes from the top.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7315/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Add width to __dispatch_internal
      
      Make it follow the same naming convention as the other functions.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7314/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Remove !RUNTIME_DETECT code for bcmcpu_get_id
      
      Use the same pattern as with get_*_cpu_type() to allow the compiler
      to remove code for non enabled SoC types.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7273/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Remove !RUNTIME_DETECT in cpu-feature-overrides
      
      All three SoCs have in common they have a BMIPS32/BMIPS3300 CPU, so
      we can replace this as no SoC with BMIPS4350 support enabled.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7272/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Remove !RUNTIME_DETECT usage from enet code
      
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7270/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Remove !RUNTIME_DETECT from spi code
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7271/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Remove !RUNTIME_DETECT code from gpio code
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7269/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Remove !RUNTIME_DETECT from reset code
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7268/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Remove !RUNTIME_DETECT from irq setup code
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7267/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Remove !RUNTIME_DETECT code from register sets
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7266/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: BCM63xx: Sync MIPS counters during CPU bringup
      
      We are using the mips counters as the clock source, so we need to ensure
      they are synced, else e.g. gettimeofday will return different values
      depending on which core it was run.
      
      Observed difference was about 8 seconds, causing ~8 seconds ping or time
      running backwards for some programs.
      Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Maxime Bizon <mbizon@freebox.fr>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7265/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: ralink: Use strlcpy to ensure string is always NUL-terminated.
      
      Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
      Signed-off-by: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: John Crispin <blogic@openwrt.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7485/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: remove old clock support
      
      With the clock framework in place, remove unused functions and bits,
      and drop the CLK_IGNORE_UNUSED flag, which is now unneeded.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7473/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: au1xmmc: use clk framework
      
      Use the clock framework to get the peripheral clock rate to
      correctly set the MMC/SD bus clock divider.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7475/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: au1200fb: use clk framework
      
      minimal patch to replace direct clock register hackery with clock
      framework calls.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7472/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: au1100fb: use clk framework
      
      Use the clock framework to en/disable the clock to the au1100
      framebuffer device.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7474/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: irda: use clk framework
      
      Test the existence of the irda_clk clock object, use it to en/dis-
      able it when date is being transferred.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7470/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: db1x00: use clk framework
      
      Make use of the clk framework to set up and enable all PSC clocks.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7469/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: pci: use clk framework to enable PCI clock
      
      Use the clock framework to get at the PCI clock source and enable
      it on driver initialization.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7471/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: usb: use clk framework
      
      Add use of the common clock framework to set and enable the 48MHz
      clock source for the onchip OHCI and UDC blocks.
      
      Tested on a DB1500.  (Au1200 and Au1300 use an external 48MHz crystal).
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7467/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: platform: use clk framework for uarts
      
      Use the clock framework to get the rate of the peripheral clock.
      Remove the now obsolete get_uart_baud_base function.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7468/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: clock framework integration of onchip clocks
      
      This patch introduces common clock framework integration for all
      configurable on-chip clocks on Alchemy chips:
      
      - 2 or 3 PLLs which generate integer multiples of the root rate 12MHz,
      - 6 dividers which take one of the 3 PLLs as input and divide their
        rate by either multiples of 2 or 1 (Au1300).
      - another bank of up to 6 muxes which take either one of the 6
        above dividers or one of the PLLs directly and divide their rate
        further by 1, 2, 3 or 4.
      - a few other sources which are used by onchip peripherals and are
        informational.
      
      This implementation will take the clock tree as it was set up
      by boot firmware: all in-kernel boards should continue to work
      without having to set up the clock tree in board code.
      
      CLK_IGNORE_DISABLED will be removed once all drivers have been
      converted.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Mike Turquette <mturquette@linaro.org>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7466/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: remove au_read/write/sync
      
      replace au_read/write/sync with __raw_read/write and wmb.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7465/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: add helpers to access static memory ctrl registers.
      
      This patch changes the static memory controller registers to offsets
      from base, prefixes them with AU1000_ to avoid silent failures due to
      changed addresses and introduces helpers to access them.
      
      No functional changes, comparing assembly of a few select functions shows
      no differences.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7463/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: introduce helpers to access SYS register block.
      
      This patch changes all absolute SYS_XY registers to offsets from the
      SYS block base, prefixes them with AU1000 to avoid silent failures due
      to changed addresses, and introduces helper functions to read/write
      them.
      
      No functional changes, comparing assembly of a few select functions shows
      no differences.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7464/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: au1000.h move C-code after register definitions.
      
      Move the C-code after all macros:  A follow-on patch which
      introduces helpers to access the SYS_* registers needs this to build.
      
      Just code shuffling, no functional changes.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7461/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: move ethernet registers to ethernet driver
      
      Move the register offsets and bit descriptions from the au1000.h header
      to their only user, the au1000_eth.c driver.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: netdev@vger.kernel.org
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7460/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: Alchemy: au1000.h: remove unused register definitions
      
      Remove the unused SSI I2S and AC97C register definitions.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Linux-MIPS <linux-mips@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/7462/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      MIPS: RB532: Replace parse_mac_addr() with mac_pton().
      Signed-off-by: default avatarDaniel Walter <dwalter@google.com>
      Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/7150/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      
      (cherry picked from commit 6096e114
      ffc8415a)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c6763e19
    • K. Y. Srinivasan's avatar
      Drivers: scsi: storvsc: Filter commands based on the storage protocol version · ed684f84
      K. Y. Srinivasan authored
      Going forward it is possible that some of the commands that are not currently
      implemented will be implemented on future Windows hosts. Even if they are not
      implemented, we are told the host will corrrectly handle unsupported
      commands (by returning appropriate return code and sense information).
      Make command filtering depend on the host version.
      Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      
      (cherry picked from commit 8caf92d8)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      ed684f84
    • K. Y. Srinivasan's avatar
      Drivers: scsi: storvsc: Implement a eh_timed_out handler · af2eb1cf
      K. Y. Srinivasan authored
      On Azure, we have seen instances of unbounded I/O latencies. To deal with
      this issue, implement handler that can reset the timeout. Note that the
      host gaurantees that it will respond to each command that has been issued.
      Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Cc: <stable@vger.kernel.org>
      [hch: added a better comment explaining the issue]
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      
      (cherry picked from commit 56b26e69)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      af2eb1cf
    • Andrey Utkin's avatar
      powerpc/mm/numa: Fix break placement · a079c728
      Andrey Utkin authored
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=81631Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: default avatarAndrey Utkin <andrey.krieger.utkin@gmail.com>
      CC: <stable@vger.kernel.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      
      (cherry picked from commit b00fc6ec)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a079c728
    • Nikesh Oswal's avatar
      regulator: arizona-ldo1: remove bypass functionality · 3395e887
      Nikesh Oswal authored
      WM5110/8280 devices do not support bypass mode for LDO1 so remove
      the bypass callbacks registered with regulator core.
      Signed-off-by: default avatarNikesh Oswal <nikesh@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 5b919f3e)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3395e887
    • Sasha Levin's avatar
      kernel/smp.c:on_each_cpu_cond(): fix warning in fallback path · 7200bc0d
      Sasha Levin authored
      The rarely-executed memry-allocation-failed callback path generates a
      WARN_ON_ONCE() when smp_call_function_single() succeeds.  Presumably
      it's supposed to warn on failures.
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Cc: Christoph Lameter <cl@gentwo.org>
      Cc: Gilad Ben-Yossef <gilad@benyossef.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit 618fde87)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7200bc0d