1. 19 Apr, 2013 1 commit
    • David S. Miller's avatar
      sparc64: Fix race in TLB batch processing. · f36391d2
      David S. Miller authored
      As reported by Dave Kleikamp, when we emit cross calls to do batched
      TLB flush processing we have a race because we do not synchronize on
      the sibling cpus completing the cross call.
      
      So meanwhile the TLB batch can be reset (tb->tlb_nr set to zero, etc.)
      and either flushes are missed or flushes will flush the wrong
      addresses.
      
      Fix this by using generic infrastructure to synchonize on the
      completion of the cross call.
      
      This first required getting the flush_tlb_pending() call out from
      switch_to() which operates with locks held and interrupts disabled.
      The problem is that smp_call_function_many() cannot be invoked with
      IRQs disabled and this is explicitly checked for with WARN_ON_ONCE().
      
      We get the batch processing outside of locked IRQ disabled sections by
      using some ideas from the powerpc port. Namely, we only batch inside
      of arch_{enter,leave}_lazy_mmu_mode() calls.  If we're not in such a
      region, we flush TLBs synchronously.
      
      1) Get rid of xcall_flush_tlb_pending and per-cpu type
         implementations.
      
      2) Do TLB batch cross calls instead via:
      
      	smp_call_function_many()
      		tlb_pending_func()
      			__flush_tlb_pending()
      
      3) Batch only in lazy mmu sequences:
      
      	a) Add 'active' member to struct tlb_batch
      	b) Define __HAVE_ARCH_ENTER_LAZY_MMU_MODE
      	c) Set 'active' in arch_enter_lazy_mmu_mode()
      	d) Run batch and clear 'active' in arch_leave_lazy_mmu_mode()
      	e) Check 'active' in tlb_batch_add_one() and do a synchronous
                 flush if it's clear.
      
      4) Add infrastructure for synchronous TLB page flushes.
      
      	a) Implement __flush_tlb_page and per-cpu variants, patch
      	   as needed.
      	b) Likewise for xcall_flush_tlb_page.
      	c) Implement smp_flush_tlb_page() to invoke the cross-call.
      	d) Wire up global_flush_tlb_page() to the right routine based
                 upon CONFIG_SMP
      
      5) It turns out that singleton batches are very common, 2 out of every
         3 batch flushes have only a single entry in them.
      
         The batch flush waiting is very expensive, both because of the poll
         on sibling cpu completeion, as well as because passing the tlb batch
         pointer to the sibling cpus invokes a shared memory dereference.
      
         Therefore, in flush_tlb_pending(), if there is only one entry in
         the batch perform a completely asynchronous global_flush_tlb_page()
         instead.
      Reported-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Acked-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
      f36391d2
  2. 31 Mar, 2013 12 commits
    • Sam Ravnborg's avatar
      sparc: use asm-generic version of types.h · cbf1ef6b
      Sam Ravnborg authored
      In sparc headers we use the following pattern:
      
          #if defined(__sparc__) && defined(__arch64__)
      
          sparc64 specific stuff
      
          #else
      
          sparc32 specific stuff
      
          #endif
      
      In types.h this pattern was not followed and here
      we only checked for __sparc__ for no good reason.
      It was a left-over from long time ago.
      
      I checked other architectures - and most of them
      do not have any such checks. And all the recently
      merged versions uses the asm-generic version.
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cbf1ef6b
    • Sam Ravnborg's avatar
      bbc_i2c: fix section mismatch warning · 6e51f857
      Sam Ravnborg authored
      Fix following warning:
      
      WARNING: drivers/sbus/char/bbc.o(.text+0x674): Section mismatch in reference from the function bbc_i2c_probe() to the function .init.text:T.463()
      The function bbc_i2c_probe() references the function __init T.463().
      This is often because bbc_i2c_probe lacks a __init
      annotation or the annotation of T.463 is wrong.
      
      bbc_i2c_probe() referenced the inlined attach_one_i2c().
      As probe may be called after init drop __init annotations
      on all functions used by bbc_i2c_probe()
      
      The warning was seen with a sparc64 defconfig build
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e51f857
    • Sam Ravnborg's avatar
      sparc: use generic headers · a2d34dd4
      Sam Ravnborg authored
      Use "generic-y" to add generic headers where possible
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a2d34dd4
    • Kefeng Wang's avatar
      sparc:cleanup unused code in smp_32.h · bf3aece8
      Kefeng Wang authored
      After genirq and generic clockevent support at sparc32,
      smp4m_irq_rotate(), prof_multiplier() and prof_counter()
      are no longer used and should be removed.
      
      Find more info from commit 6baa9b20 & 62f08283.
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf3aece8
    • Akinobu Mita's avatar
      sparc/iommu: fix typo s/265KB/256KB/ · 9a0ac1b6
      Akinobu Mita authored
      IOMMU_NPTES is 64K PTEs, so the size is 256KB (= 64K * sizeof(iopte_t))
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9a0ac1b6
    • Akinobu Mita's avatar
      sparc/srmmu: clear trailing edge of bitmap properly · 54df2db3
      Akinobu Mita authored
      srmmu_nocache_bitmap is cleared by bit_map_init().  But bit_map_init()
      attempts to clear by memset(), so it can't clear the trailing edge of
      bitmap properly on big-endian architecture if the number of bits is not
      a multiple of BITS_PER_LONG.
      
      Actually, the number of bits in srmmu_nocache_bitmap is not always
      a multiple of BITS_PER_LONG.  It is calculated as below:
      
              bitmap_bits = srmmu_nocache_size >> SRMMU_NOCACHE_BITMAP_SHIFT;
      
      srmmu_nocache_size is decided proportionally by the amount of system RAM
      and it is rounded to a multiple of PAGE_SIZE.  SRMMU_NOCACHE_BITMAP_SHIFT
      is defined as (PAGE_SHIFT - 4).  So it can only be said that bitmap_bits
      is a multiple of 16.
      
      This fixes the problem by using bitmap_clear() instead of memset()
      in bit_map_init() and this also uses BITS_TO_LONGS() to calculate correct
      size at bitmap allocation time.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54df2db3
    • Kefeng Wang's avatar
      sparc:remove unused declaration smp_boot_cpus() · 71196a26
      Kefeng Wang authored
      smp_boot_cpus() was replaced smp_prepare_cpus() long ago, and it no
      longer needed, so delete it.
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71196a26
    • Linus Torvalds's avatar
      Linux 3.9-rc5 · 07961ac7
      Linus Torvalds authored
      07961ac7
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma · 0bb44280
      Linus Torvalds authored
      Pull slave-dmaengine fixes from Vinod Koul:
       "Two fixes for slave-dmaengine.
      
        The first one is for making slave_id value correct for dw_dmac and
        the other one fixes the endieness in DT parsing"
      
      * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
        dw_dmac: adjust slave_id accordingly to request line base
        dmaengine: dw_dma: fix endianess for DT xlate function
      0bb44280
    • Linus Torvalds's avatar
      Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · a7b436d3
      Linus Torvalds authored
      Pull media fixes from Mauro Carvalho Chehab:
       "For a some fixes for Kernel 3.9:
         - subsystem build fix when VIDEO_DEV=y, VIDEO_V4L2=m and I2C=m
         - compilation fix for arm multiarch preventing IR_RX51 to be selected
         - regression fix at bttv crop logic
         - s5p-mfc/m5mols/exynos: a few fixes for cameras on exynos hardware"
      
      * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
        [media] [REGRESSION] bt8xx: Fix too large height in cropcap
        [media] fix compilation with both V4L2 and I2C as 'm'
        [media] m5mols: Fix bug in stream on handler
        [media] s5p-fimc: Do not attempt to disable not enabled media pipeline
        [media] s5p-mfc: Fix encoder control 15 issue
        [media] s5p-mfc: Fix frame skip bug
        [media] s5p-fimc: send valid m2m ctx to fimc_m2m_job_finish
        [media] exynos-gsc: send valid m2m ctx to gsc_m2m_job_finish
        [media] fimc-lite: Fix the variable type to avoid possible crash
        [media] fimc-lite: Initialize 'step' field in fimc_lite_ctrl structure
        [media] ir: IR_RX51 only works on OMAP2
      a7b436d3
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20130331' of git://git.kernel.dk/linux-block · d299c290
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Alright, this time from 10K up in the air.
      
        Collection of fixes that have been queued up since the merge window
        opened, hence postponed until later in the cycle.  The pull request
        contains:
      
         - A bunch of fixes for the xen blk front/back driver.
      
         - A round of fixes for the new IBM RamSan driver, fixing various
           nasty issues.
      
         - Fixes for multiple drives from Wei Yongjun, bad handling of return
           values and wrong pointer math.
      
         - A fix for loop properly killing partitions when being detached."
      
      * tag 'for-linus-20130331' of git://git.kernel.dk/linux-block: (25 commits)
        mg_disk: fix error return code in mg_probe()
        rsxx: remove unused variable
        rsxx: enable error return of rsxx_eeh_save_issued_dmas()
        block: removes dynamic allocation on stack
        Block: blk-flush: Fixed indent code style
        cciss: fix invalid use of sizeof in cciss_find_cfgtables()
        loop: cleanup partitions when detaching loop device
        loop: fix error return code in loop_add()
        mtip32xx: fix error return code in mtip_pci_probe()
        xen-blkfront: remove frame list from blk_shadow
        xen-blkfront: pre-allocate pages for requests
        xen-blkback: don't store dev_bus_addr
        xen-blkfront: switch from llist to list
        xen-blkback: fix foreach_grant_safe to handle empty lists
        xen-blkfront: replace kmalloc and then memcpy with kmemdup
        xen-blkback: fix dispatch_rw_block_io() error path
        rsxx: fix missing unlock on error return in rsxx_eeh_remap_dmas()
        Adding in EEH support to the IBM FlashSystem 70/80 device driver
        block: IBM RamSan 70/80 error message bug fix.
        block: IBM RamSan 70/80 branding changes.
        ...
      d299c290
    • Paul Walmsley's avatar
      Revert "lockdep: check that no locks held at freeze time" · dbf520a9
      Paul Walmsley authored
      This reverts commit 6aa97070.
      
      Commit 6aa97070 ("lockdep: check that no locks held at freeze time")
      causes problems with NFS root filesystems.  The failures were noticed on
      OMAP2 and 3 boards during kernel init:
      
        [ BUG: swapper/0/1 still has locks held! ]
        3.9.0-rc3-00344-ga937536b #1 Not tainted
        -------------------------------------
        1 lock held by swapper/0/1:
         #0:  (&type->s_umount_key#13/1){+.+.+.}, at: [<c011e84c>] sget+0x248/0x574
      
        stack backtrace:
          rpc_wait_bit_killable
          __wait_on_bit
          out_of_line_wait_on_bit
          __rpc_execute
          rpc_run_task
          rpc_call_sync
          nfs_proc_get_root
          nfs_get_root
          nfs_fs_mount_common
          nfs_try_mount
          nfs_fs_mount
          mount_fs
          vfs_kern_mount
          do_mount
          sys_mount
          do_mount_root
          mount_root
          prepare_namespace
          kernel_init_freeable
          kernel_init
      
      Although the rootfs mounts, the system is unstable.  Here's a transcript
      from a PM test:
      
        http://www.pwsan.com/omap/testlogs/test_v3.9-rc3/20130317194234/pm/37xxevm/37xxevm_log.txt
      
      Here's what the test log should look like:
      
        http://www.pwsan.com/omap/testlogs/test_v3.8/20130218214403/pm/37xxevm/37xxevm_log.txt
      
      Mailing list discussion is here:
      
        http://lkml.org/lkml/2013/3/4/221
      
      Deal with this for v3.9 by reverting the problem commit, until folks can
      figure out the right long-term course of action.
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Mandeep Singh Baines <msb@chromium.org>
      Cc: Jeff Layton <jlayton@redhat.com>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: <maciej.rutecki@gmail.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ben Chan <benchan@chromium.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dbf520a9
  3. 30 Mar, 2013 1 commit
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 13d2080d
      Linus Torvalds authored
      Pull SCSI target fixes from Nicholas Bellinger:
       "This includes the bug-fix for a >= v3.8-rc1 regression specific to
        iscsi-target persistent reservation conflict handling (CC'ed to
        stable), and a tcm_vhost patch to drop VIRTIO_RING_F_EVENT_IDX usage
        so that in-flight qemu vhost-scsi-pci device code can detect the
        proper vhost feature bits.
      
        Also, there are two more tcm_vhost patches still being discussed by
        MST and Asias for v3.9 that will be required for the in-flight qemu
        vhost-scsi-pci device patch to function properly, and that should
        (hopefully) be the last target fixes for this round."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        target: Fix RESERVATION_CONFLICT status regression for iscsi-target special case
        tcm_vhost: Avoid VIRTIO_RING_F_EVENT_IDX feature bit
      13d2080d
  4. 29 Mar, 2013 12 commits
  5. 28 Mar, 2013 14 commits