Skip to content
  1. Sep 28, 2016
    • Deepa Dinamani's avatar
      fs: Replace current_fs_time() with current_time() · c2050a45
      Deepa Dinamani authored
      
      
      current_fs_time() uses struct super_block* as an argument.
      As per Linus's suggestion, this is changed to take struct
      inode* as a parameter instead. This is because the function
      is primarily meant for vfs inode timestamps.
      Also the function was renamed as per Arnd's suggestion.
      
      Change all calls to current_fs_time() to use the new
      current_time() function instead. current_fs_time() will be
      deleted.
      
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      c2050a45
    • Deepa Dinamani's avatar
      fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps · 02027d42
      Deepa Dinamani authored
      
      
      CURRENT_TIME_SEC is not y2038 safe. current_time() will
      be transitioned to use 64 bit time along with vfs in a
      separate patch.
      There is no plan to transistion CURRENT_TIME_SEC to use
      y2038 safe time interfaces.
      
      current_time() will also be extended to use superblock
      range checking parameters when range checking is introduced.
      
      This works because alloc_super() fills in the the s_time_gran
      in super block to NSEC_PER_SEC.
      
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Acked-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      02027d42
    • Deepa Dinamani's avatar
      fs: Replace CURRENT_TIME with current_time() for inode timestamps · 078cd827
      Deepa Dinamani authored
      
      
      CURRENT_TIME macro is not appropriate for filesystems as it
      doesn't use the right granularity for filesystem timestamps.
      Use current_time() instead.
      
      CURRENT_TIME is also not y2038 safe.
      
      This is also in preparation for the patch that transitions
      vfs timestamps to use 64 bit time and hence make them
      y2038 safe. As part of the effort current_time() will be
      extended to do range checks. Hence, it is necessary for all
      file system timestamps to use current_time(). Also,
      current_time() will be transitioned along with vfs to be
      y2038 safe.
      
      Note that whenever a single call to current_time() is used
      to change timestamps in different inodes, it is because they
      share the same time granularity.
      
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarFelipe Balbi <balbi@kernel.org>
      Acked-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      Acked-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Acked-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      078cd827
    • Deepa Dinamani's avatar
      fs: proc: Delete inode time initializations in proc_alloc_inode() · 2554c72e
      Deepa Dinamani authored
      
      
      proc uses new_inode_pseudo() to allocate a new inode.
      This in turn calls the proc_inode_alloc() callback.
      But, at this point, inode is still not initialized
      with the super_block pointer which only happens just
      before alloc_inode() returns after the call to
      inode_init_always().
      
      Also, the inode times are initialized again after the
      call to new_inode_pseudo() in proc_inode_alloc().
      The assignemet in proc_alloc_inode() is redundant and
      also doesn't work after the current_time() api is
      changed to take struct inode* instead of
      struct *super_block.
      
      This bug was reported after current_time() was used to
      assign times in proc_alloc_inode().
      
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Reported-by: Fengguang Wu <fengguang.wu@intel.com> [0-day test robot]
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      2554c72e
    • Deepa Dinamani's avatar
      vfs: Add current_time() api · 3cd88666
      Deepa Dinamani authored
      current_fs_time() is used for inode timestamps.
      
      Change the signature of the function to take inode pointer
      instead of superblock as per Linus's suggestion.
      
      Also, move the api under vfs as per the discussion on the
      thread: https://lkml.org/lkml/2016/6/9/36
      
       . As per Arnd's
      suggestion on the thread, changing the function name.
      
      current_fs_time() will be deleted after all the references
      to it are replaced by current_time().
      
      There was a bug reported by kbuild test bot with the change
      as some of the calls to current_time() were made before the
      super_block was initialized. Catch these accidental assignments
      as timespec_trunc() does for wrong granularities. This allows
      for the function to work right even in these circumstances.
      But, adds a warning to make the user aware of the bug.
      
      A coccinelle script was used to identify all the current
      .alloc_inode super_block callbacks that updated inode timestamps.
      proc filesystem was the only one that was modifying inode times
      as part of this callback. The series includes a patch to fix that.
      
      Note that timespec_trunc() will also be moved to fs/inode.c
      in a separate patch when this will need to be revamped for
      bounds checking purposes.
      
      Signed-off-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      3cd88666
  2. Sep 12, 2016
    • Linus Torvalds's avatar
      Linux 4.8-rc6 · 9395452b
      Linus Torvalds authored
      9395452b
    • Linus Torvalds's avatar
      nvme: make NVME_RDMA depend on BLOCK · bd0b841f
      Linus Torvalds authored
      Commit aa719874
      
       ("nvme: fabrics drivers don't need the nvme-pci
      driver") removed the dependency on BLK_DEV_NVME, but the cdoe does
      depend on the block layer (which used to be an implicit dependency
      through BLK_DEV_NVME).
      
      Otherwise you get various errors from the kbuild test robot random
      config testing when that happens to hit a configuration with BLOCK
      device support disabled.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Jay Freyensee <james_p_freyensee@linux.intel.com>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bd0b841f
    • Linus Torvalds's avatar
      Merge tag 'staging-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 2afe669a
      Linus Torvalds authored
      Pull IIO fixes from Greg KH:
       "Here are a few small IIO fixes for 4.8-rc6.
      
        Nothing major, full details are in the shortlog, all of these have
        been in linux-next with no reported issues"
      
      * tag 'staging-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        iio:core: fix IIO_VAL_FRACTIONAL sign handling
        iio: ensure ret is initialized to zero before entering do loop
        iio: accel: kxsd9: Fix scaling bug
        iio: accel: bmc150: reset chip at init time
        iio: fix pressure data output unit in hid-sensor-attributes
        tools:iio:iio_generic_buffer: fix trigger-less mode
      2afe669a
    • Linus Torvalds's avatar
      Merge tag 'usb-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 61c3dae6
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small USB gadget, phy, and xhci fixes for 4.8-rc6.
      
        All of these resolve minor issues that have been reported, and all
        have been in linux-next with no reported issues"
      
      * tag 'usb-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: chipidea: udc: fix NULL ptr dereference in isr_setup_status_phase
        xhci: fix null pointer dereference in stop command timeout function
        usb: dwc3: pci: fix build warning on !PM_SLEEP
        usb: gadget: prevent potenial null pointer dereference on skb->len
        usb: renesas_usbhs: fix clearing the {BRDY,BEMP}STS condition
        usb: phy: phy-generic: Check clk_prepare_enable() error
        usb: gadget: udc: renesas-usb3: clear VBOUT bit in DRD_CON
        Revert "usb: dwc3: gadget: always decrement by 1"
      61c3dae6
  3. Sep 11, 2016
    • Linus Torvalds's avatar
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 98ac9a60
      Linus Torvalds authored
      Pull libnvdimm fixes from Dan Williams:
       "nvdimm fixes for v4.8, two of them are tagged for -stable:
      
         - Fix devm_memremap_pages() to use track_pfn_insert().  Otherwise,
           DAX pmd mappings end up with an uncached pgprot, and unusable
           performance for the device-dax interface.  The device-dax interface
           appeared in 4.7 so this is tagged for -stable.
      
         - Fix a couple VM_BUG_ON() checks in the show_smaps() path to
           understand DAX pmd entries.  This fix is tagged for -stable.
      
         - Fix a mis-merge of the nfit machine-check handler to flip the
           polarity of an if() to match the final version of the patch that
           Vishal sent for 4.8-rc1.  Without this the nfit machine check
           handler never detects / inserts new 'badblocks' entries which
           applications use to identify lost portions of files.
      
         - For test purposes, fix the nvdimm_clear_poison() path to operate on
           legacy / simulated nvdimm memory ranges.  Without this fix a test
           can set badblocks, but never clear them on these ranges.
      
         - Fix the range checking done by dax_dev_pmd_fault().  This is not
           tagged for -stable since this problem is mitigated by specifying
           aligned resources at device-dax setup time.
      
        These patches have appeared in a next release over the past week.  The
        recent rebase you can see in the timestamps was to drop an invalid fix
        as identified by the updated device-dax unit tests [1].  The -mm
        touches have an ack from Andrew"
      
      [1]: "[ndctl PATCH 0/3] device-dax test for recent kernel bugs"
         https://lists.01.org/pipermail/linux-nvdimm/2016-September/006855.html
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        libnvdimm: allow legacy (e820) pmem region to clear bad blocks
        nfit, mce: Fix SPA matching logic in MCE handler
        mm: fix cache mode of dax pmd mappings
        mm: fix show_smap() for zone_device-pmd ranges
        dax: fix mapping size check
      98ac9a60
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · b8db3714
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Mostly driver bugfixes, but also a few cleanups which are nice to have
        out of the way"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: rk3x: Restore clock settings at resume time
        i2c: Spelling s/acknowedge/acknowledge/
        i2c: designware: save the preset value of DW_IC_SDA_HOLD
        Documentation: i2c: slave-interface: add note for driver development
        i2c: mux: demux-pinctrl: run properly with multiple instances
        i2c: bcm-kona: fix inconsistent indenting
        i2c: rcar: use proper device with dma_mapping_error
        i2c: sh_mobile: use proper device with dma_mapping_error
        i2c: mux: demux-pinctrl: invalidate properly when switching fails
      b8db3714
    • Linus Torvalds's avatar
      Merge tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 6905732c
      Linus Torvalds authored
      Pull fscrypto fixes fromTed Ts'o:
       "Fix some brown-paper-bag bugs for fscrypto, including one one which
        allows a malicious user to set an encryption policy on an empty
        directory which they do not own"
      
      * tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        fscrypto: require write access to mount to set encryption policy
        fscrypto: only allow setting encryption policy on directories
        fscrypto: add authorization check for setting encryption policy
      6905732c
  4. Sep 10, 2016
  5. Sep 09, 2016
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 2771fc8e
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Fixes marked for stable:
         - Don't alias user region to other regions below PAGE_OFFSET from
           Paul Mackerras
         - Fix again csum_partial_copy_generic() on 32-bit from Christophe
           Leroy
         - Fix corrupted PE allocation bitmap on releasing PE from Gavin Shan
      
        Fixes for code merged this cycle:
         - Fix crash on releasing compound PE from Gavin Shan
         - Fix processor numbers in OPAL ICP from Benjamin Herrenschmidt
         - Fix little endian build with CONFIG_KEXEC=n from Thiago Jung
           Bauermann"
      
      * tag 'powerpc-4.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/mm: Don't alias user region to other regions below PAGE_OFFSET
        powerpc/32: Fix again csum_partial_copy_generic()
        powerpc/powernv: Fix corrupted PE allocation bitmap on releasing PE
        powerpc/powernv: Fix crash on releasing compound PE
        powerpc/xics/opal: Fix processor numbers in OPAL ICP
        powerpc/pseries: Fix little endian build with CONFIG_KEXEC=n
      2771fc8e
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm · 53d5f1dc
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "A few ARM fixes:
      
         - Robin Murphy noticed that the non-secure privileged entry was
           relying on undefined behaviour, which needed to be fixed.
      
         - Vladimir Murzin noticed that prov-v7 fails to build for MMUless
           configurations because a required header file wasn't included.
      
         - A bunch of fixes for StrongARM regressions found while testing
           4.8-rc on such platforms"
      
      * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: sa1100: clear reset status prior to reboot
        ARM: 8600/1: Enforce some NS-SVC initialisation
        ARM: 8599/1: mm: pull asm/memory.h explicitly
        ARM: sa1100: register clocks early
        ARM: sa1100: fix 3.6864MHz clock
      53d5f1dc
    • Greg Kroah-Hartman's avatar
      Merge tag 'fixes-for-v4.8-rc6' of... · 6b98174b
      Greg Kroah-Hartman authored
      Merge tag 'fixes-for-v4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
      
      Felipe writes:
      
      usb: fixes for v4.8-rc6
      
      Unfortunately we have a bogus dwc3 patch leaked through the cracks and
      got merged into Linus' HEAD. That patch ended up causing off-by-1 error
      in our TRB accounting logic. Thankfully John Youn found out the problem
      and we provided a revert to the bogus dwc3 patch in no time.
      
      Apart from this off-by-1 error, we have two fixes to the Renesas drivers,
      a small fix to our generic phy driver, a NULL pointer dereference fix for
      f_eem and a build warning fix in dwc3.
      6b98174b
    • Greg Kroah-Hartman's avatar
      Merge tag 'usb-ci-v4.8-rc6' of... · 1b49dae1
      Greg Kroah-Hartman authored
      Merge tag 'usb-ci-v4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-linus
      
      Peter writes:
      
      Fix the possible kernel panic when the hardware signal is bad for chipidea udc.
      1b49dae1
    • Greg Kroah-Hartman's avatar
      Merge tag 'iio-fixes-for-4.8b' of... · 72d508ad
      Greg Kroah-Hartman authored
      Merge tag 'iio-fixes-for-4.8b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
      
      Jonathan writes:
      
      Second set of IIO fixes for the 4.8 cycle.
      
      We have a big rework of the kxsd9 driver queued up behind the fix below and
      a fix for a recent fix that was marked for stable.
      Hence this fix series is perhaps a little more urgent than average for IIO.
      * core
        - a fix for a fix in the last set.  The recent fix for blocking ops when
         ! task running left a path (unlikely one) in which the function return
         value was not set - so initialise it to 0.
        - The IIO_TYPE_FRACTIONAL code previously didn't cope with negative
        fractions.  Turned out a fix for this was in Analog's tree but hadn't made
        it upstream.
      * bmc150
        - reset chip at init time. At least one board out there ends up coming up
        in an unstable state due to noise during power up.  The reset does no
        harm on other boards.
      * kxsd9
        - Fix a bug in the reported scaling due to failing to set the integer
        part to 0.
      * hid-sensors-pressure
        - Output was in the wrong units to comply with the IIO ABI.
      * tools
        - iio_generic_buffer: Fix the trigger-less mode by ensuring we don't fault
          out for having no trigger when we explicitly said we didn't want to have
          one.
      72d508ad
    • Chunyan Zhang's avatar
      arm64: use preempt_disable_notrace in _percpu_read/write · 2b974344
      Chunyan Zhang authored
      When debug preempt or preempt tracer is enabled, preempt_count_add/sub()
      can be traced by function and function graph tracing, and
      preempt_disable/enable() would call preempt_count_add/sub(), so in Ftrace
      subsystem we should use preempt_disable/enable_notrace instead.
      
      In the commit 345ddcc8
      
       ("ftrace: Have set_ftrace_pid use the bitmap
      like events do") the function this_cpu_read() was added to
      trace_graph_entry(), and if this_cpu_read() calls preempt_disable(), graph
      tracer will go into a recursive loop, even if the tracing_on is
      disabled.
      
      So this patch change to use preempt_enable/disable_notrace instead in
      this_cpu_read().
      
      Since Yonghui Yang helped a lot to find the root cause of this problem,
      so also add his SOB.
      
      Signed-off-by: default avatarYonghui Yang <mark.yang@spreadtrum.com>
      Signed-off-by: default avatarChunyan Zhang <zhang.chunyan@linaro.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      2b974344
    • Will Deacon's avatar
      arm64: spinlocks: implement smp_mb__before_spinlock() as smp_mb() · 872c63fb
      Will Deacon authored
      
      
      smp_mb__before_spinlock() is intended to upgrade a spin_lock() operation
      to a full barrier, such that prior stores are ordered with respect to
      loads and stores occuring inside the critical section.
      
      Unfortunately, the core code defines the barrier as smp_wmb(), which
      is insufficient to provide the required ordering guarantees when used in
      conjunction with our load-acquire-based spinlock implementation.
      
      This patch overrides the arm64 definition of smp_mb__before_spinlock()
      to map to a full smp_mb().
      
      Cc: <stable@vger.kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Reported-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      872c63fb
    • Clemens Gruber's avatar
      usb: chipidea: udc: fix NULL ptr dereference in isr_setup_status_phase · 6f3c4fb6
      Clemens Gruber authored
      
      
      Problems with the signal integrity of the high speed USB data lines or
      noise on reference ground lines can cause the i.MX6 USB controller to
      violate USB specs and exhibit unexpected behavior.
      
      It was observed that USBi_UI interrupts were triggered first and when
      isr_setup_status_phase was called, ci->status was NULL, which lead to a
      NULL pointer dereference kernel panic.
      
      This patch fixes the kernel panic, emits a warning once and returns
      -EPIPE to halt the device and let the host get stalled.
      It also adds a comment to point people, who are experiencing this issue,
      to their USB hardware design.
      
      Cc: <stable@vger.kernel.org> #4.1+
      Signed-off-by: default avatarClemens Gruber <clemens.gruber@pqgruber.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
      6f3c4fb6
    • Jean Delvare's avatar
      cpufreq-stats: Minor documentation fix · 3732b30a
      Jean Delvare authored
      
      
      The cpufreq-stats code can no longer be built as a module, so it now
      appears with square brackets in menuconfig.
      
      Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
      Fixes: 1aefc75b
      
       (cpufreq: stats: Make the stats code non-modular)
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3732b30a
    • Doug Anderson's avatar
      i2c: rk3x: Restore clock settings at resume time · cbfff439
      Doug Anderson authored
      
      
      Depending on a number of factors including:
      - Which exact Rockchip SoC we're working with
      - How deep we suspend
      - Which i2c port we're on
      
      We might lose the state of the i2c registers at suspend time.
      Specifically we've found that on rk3399 the i2c ports that are not in
      the PMU power domain lose their state with the current suspend depth
      configured by ARM Tursted Firmware.
      
      Note that there are very few actual i2c registers that aren't configured
      per transfer anyway so all we actually need to re-configure are the
      clock config registers.  We'll just add a call to rk3x_i2c_adapt_div()
      at resume time and be done with it.
      
      NOTE: On rk3399 on ports whose power was lost, I put printouts in at
      resume time.  I saw things like:
        before: con=0x00010300, div=0x00060006
        after:  con=0x00010200, div=0x00180025
      
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarDavid Wu <david.wu@rock-chips.com>
      Tested-by: default avatarDavid Wu <david.wu@rock-chips.com>
      [wsa: removed duplicate const]
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      cbfff439