1. 29 Sep, 2015 30 commits
  2. 21 Sep, 2015 10 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.1.8 · 36311a9e
      Greg Kroah-Hartman authored
      36311a9e
    • Caesar Wang's avatar
      ARM: rockchip: fix broken build · 77798915
      Caesar Wang authored
      commit cb8cc37f upstream.
      
      The following was seen in branch[0] build.
      
      arch/arm/mach-rockchip/platsmp.c:154:23: error:
          'rockchip_secondary_startup' undeclared (first use in this function)
      
      branch[0]:
      git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
      v4.3-armsoc/soc
      
      The broken build is caused by the commit fe4407c0
      ("ARM: rockchip: fix the CPU soft reset").
      Signed-off-by: default avatarCaesar Wang <wxt@rock-chips.com>
      
      The breakage was a result of it being wrongly merged in my branch with
      the cache invalidation rework from Russell 02b4e275
      ("ARM: v7 setup function should invalidate L1 cache").
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Cc: Willy Tarreau <w@1wt.eu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      77798915
    • Kees Cook's avatar
      fs: create and use seq_show_option for escaping · d3b428f0
      Kees Cook authored
      commit a068acf2 upstream.
      
      Many file systems that implement the show_options hook fail to correctly
      escape their output which could lead to unescaped characters (e.g.  new
      lines) leaking into /proc/mounts and /proc/[pid]/mountinfo files.  This
      could lead to confusion, spoofed entries (resulting in things like
      systemd issuing false d-bus "mount" notifications), and who knows what
      else.  This looks like it would only be the root user stepping on
      themselves, but it's possible weird things could happen in containers or
      in other situations with delegated mount privileges.
      
      Here's an example using overlay with setuid fusermount trusting the
      contents of /proc/mounts (via the /etc/mtab symlink).  Imagine the use
      of "sudo" is something more sneaky:
      
        $ BASE="ovl"
        $ MNT="$BASE/mnt"
        $ LOW="$BASE/lower"
        $ UP="$BASE/upper"
        $ WORK="$BASE/work/ 0 0
        none /proc fuse.pwn user_id=1000"
        $ mkdir -p "$LOW" "$UP" "$WORK"
        $ sudo mount -t overlay -o "lowerdir=$LOW,upperdir=$UP,workdir=$WORK" none /mnt
        $ cat /proc/mounts
        none /root/ovl/mnt overlay rw,relatime,lowerdir=ovl/lower,upperdir=ovl/upper,workdir=ovl/work/ 0 0
        none /proc fuse.pwn user_id=1000 0 0
        $ fusermount -u /proc
        $ cat /proc/mounts
        cat: /proc/mounts: No such file or directory
      
      This fixes the problem by adding new seq_show_option and
      seq_show_option_n helpers, and updating the vulnerable show_option
      handlers to use them as needed.  Some, like SELinux, need to be open
      coded due to unusual existing escape mechanisms.
      
      [akpm@linux-foundation.org: add lost chunk, per Kees]
      [keescook@chromium.org: seq_show_option should be using const parameters]
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Acked-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
      Acked-by: default avatarJan Kara <jack@suse.com>
      Acked-by: default avatarPaul Moore <paul@paul-moore.com>
      Cc: J. R. Okajima <hooanon05g@gmail.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d3b428f0
    • Mikulas Patocka's avatar
      hpfs: update ctime and mtime on directory modification · 213abaf9
      Mikulas Patocka authored
      commit f49a26e7 upstream.
      
      Update ctime and mtime when a directory is modified. (though OS/2 doesn't
      update them anyway)
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      213abaf9
    • Eric W. Biederman's avatar
      fs: Set the size of empty dirs to 0. · 16e327d3
      Eric W. Biederman authored
      commit 4b75de86 upstream.
      
      Before the make_empty_dir_inode calls were introduce into proc, sysfs,
      and sysctl those directories when stated reported an i_size of 0.
      make_empty_dir_inode started reporting an i_size of 2.  At least one
      userspace application depended on stat returning i_size of 0.  So
      modify make_empty_dir_inode to cause an i_size of 0 to be reported for
      these directories.
      Reported-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16e327d3
    • Grant Likely's avatar
      drivercore: Fix unregistration path of platform devices · ad2fee66
      Grant Likely authored
      commit 7f5dcaf1 upstream.
      
      The unregister path of platform_device is broken. On registration, it
      will register all resources with either a parent already set, or
      type==IORESOURCE_{IO,MEM}. However, on unregister it will release
      everything with type==IORESOURCE_{IO,MEM}, but ignore the others. There
      are also cases where resources don't get registered in the first place,
      like with devices created by of_platform_populate()*.
      
      Fix the unregister path to be symmetrical with the register path by
      checking the parent pointer instead of the type field to decide which
      resources to unregister. This is safe because the upshot of the
      registration path algorithm is that registered resources have a parent
      pointer, and non-registered resources do not.
      
      * It can be argued that of_platform_populate() should be registering
        it's resources, and they argument has some merit. However, there are
        quite a few platforms that end up broken if we try to do that due to
        overlapping resources in the device tree. Until that is fixed, we need
        to solve the immediate problem.
      
      Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
      Cc: Wolfram Sang <wsa@the-dreams.de>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      Tested-by: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
      Tested-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ad2fee66
    • Jiang Liu's avatar
      ACPI, PCI: Penalize legacy IRQ used by ACPI SCI · f4e4aaa5
      Jiang Liu authored
      commit 5d0ddfeb upstream.
      
      Nick Meier reported a regression with HyperV that "
        After rebooting the VM, the following messages are logged in syslog
        when trying to load the tulip driver:
          tulip: Linux Tulip drivers version 1.1.15 (Feb 27, 2007)
          tulip: 0000:00:0a.0: PCI INT A: failed to register GSI
          tulip: Cannot enable tulip board #0, aborting
          tulip: probe of 0000:00:0a.0 failed with error -16
        Errors occur in 3.19.0 kernel
        Works in 3.17 kernel.
      "
      
      According to the ACPI dump file posted by Nick at
      https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1440072
      
      The ACPI MADT table includes an interrupt source overridden entry for
      ACPI SCI:
      [236h 0566  1]                Subtable Type : 02 <Interrupt Source Override>
      [237h 0567  1]                       Length : 0A
      [238h 0568  1]                          Bus : 00
      [239h 0569  1]                       Source : 09
      [23Ah 0570  4]                    Interrupt : 00000009
      [23Eh 0574  2]        Flags (decoded below) : 000D
                                         Polarity : 1
                                     Trigger Mode : 3
      
      And in DSDT table, we have _PRT method to define PCI interrupts, which
      eventually goes to:
              Name (PRSA, ResourceTemplate ()
              {
                  IRQ (Level, ActiveLow, Shared, )
                      {3,4,5,7,9,10,11,12,14,15}
              })
              Name (PRSB, ResourceTemplate ()
              {
                  IRQ (Level, ActiveLow, Shared, )
                      {3,4,5,7,9,10,11,12,14,15}
              })
              Name (PRSC, ResourceTemplate ()
              {
                  IRQ (Level, ActiveLow, Shared, )
                      {3,4,5,7,9,10,11,12,14,15}
              })
              Name (PRSD, ResourceTemplate ()
              {
                  IRQ (Level, ActiveLow, Shared, )
                      {3,4,5,7,9,10,11,12,14,15}
              })
      
      According to the MADT and DSDT tables, IRQ 9 may be used for:
       1) ACPI SCI in level, high mode
       2) PCI legacy IRQ in level, low mode
      So there's a conflict in polarity setting for IRQ 9.
      
      Prior to commit cd68f6bd ("x86, irq, acpi: Get rid of special
      handling of GSI for ACPI SCI"), ACPI SCI is handled specially and
      there's no check for conflicts between ACPI SCI and PCI legagy IRQ.
      And it seems that the HyperV hypervisor doesn't make use of the
      polarity configuration in IOAPIC entry, so it just works.
      
      Commit cd68f6bd gets rid of the specially handling of ACPI SCI,
      and then the pin attribute checking code discloses the conflicts
      between ACPI SCI and PCI legacy IRQ on HyperV virtual machine,
      and rejects the request to assign IRQ9 to PCI devices.
      
      So penalize legacy IRQ used by ACPI SCI and mark it unusable if ACPI
      SCI attributes conflict with PCI IRQ attributes.
      
      Please refer to following links for more information:
      https://bugzilla.kernel.org/show_bug.cgi?id=101301
      https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1440072
      
      Fixes: cd68f6bd ("x86, irq, acpi: Get rid of special handling of GSI for ACPI SCI")
      Reported-and-tested-by: default avatarNick Meier <nmeier@microsoft.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4e4aaa5
    • Heiko Stuebner's avatar
      ARM: dts: rockchip: fix rk3288 watchdog irq · 33a0064c
      Heiko Stuebner authored
      commit 1a1b698b upstream.
      
      The watchdog irq is actually SPI 79, which translates to the original
      111 in the manual where the SPI irqs start at 32.
      The current dw_wdt driver does not use the irq at all, so this issue
      never surfaced. Nevertheless fix this for a time we want to use the irq.
      
      Fixes: 2ab557b7 ("ARM: dts: rockchip: add core rk3288 dtsi")
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      33a0064c
    • Caesar Wang's avatar
      ARM: rockchip: fix the CPU soft reset · 322ce3c5
      Caesar Wang authored
      commit fe4407c0 upstream.
      
      We need different orderings when turning a core on and turning a core
      off.  In one case we need to assert reset before turning power off.
      In ther other case we need to turn power on and the deassert reset.
      
      In general, the correct flow is:
      
      CPU off:
          reset_control_assert
          regmap_update_bits(pmu, PMU_PWRDN_CON, BIT(pd), BIT(pd))
          wait_for_power_domain_to_turn_off
      CPU on:
          regmap_update_bits(pmu, PMU_PWRDN_CON, BIT(pd), 0)
          wait_for_power_domain_to_turn_on
          reset_control_deassert
      
      This is needed for stressing CPU up/down, as per:
          cd /sys/devices/system/cpu/
          for i in $(seq 10000); do
              echo "================= $i ============"
              for j in $(seq 100); do
                  while [[ "$(cat cpu1/online)$(cat cpu2/online)$(cat cpu3/online)" != "000"" ]]
                      echo 0 > cpu1/online
                      echo 0 > cpu2/online
                      echo 0 > cpu3/online
                  done
                  while [[ "$(cat cpu1/online)$(cat cpu2/online)$(cat cpu3/online)" != "111" ]]; do
                      echo 1 > cpu1/online
                      echo 1 > cpu2/online
                      echo 1 > cpu3/online
                  done
              done
          done
      
      The following is reproducable log:
          [34466.186812] PM: noirq suspend of devices complete after 0.669 msecs
          [34466.186824] Disabling non-boot CPUs ...
          [34466.187509] CPU1: shutdown
          [34466.188672] CPU2: shutdown
          [34473.736627] Kernel panic - not syncing:Watchdog detected hard LOCKUP on cpu 0
          .......
      or others similar log:
          .......
          [ 4072.454453] CPU1: shutdown
          [ 4072.504436] CPU2: shutdown
          [ 4072.554426] CPU3: shutdown
          [ 4072.577827] CPU1: Booted secondary processor
          [ 4072.582611] CPU2: Booted secondary processor
          <hang>
      
          Tested by cpu up/down scripts, the results told us need delay more time
      before write the sram. The wait time is affected by many aspects
      (e.g: cpu frequency, bootrom frequency, sram frequency, bus speed, ...).
      
          Although the cpus other than cpu0 will write the sram, the speedy is
      no the same as cpu0, if the cpu0 early wake up, perhaps the other cpus
      can't startup. As we know, the cpu0 can wake up when the cpu1/2/3 write
      the 'sram+4/8' and send the sev.
          Anyway.....
          At the moment, 1ms delay will be happy work for cpu up/down scripts test.
      Signed-off-by: default avatarCaesar Wang <wxt@rock-chips.com>
      Reviewed-by: default avatarDoug Anderson <dianders@chromium.org>
      Reviewed-by: default avatarKever Yang <kever.yang@rock-chips.com>
      Fixes: 3ee851e2 ("ARM: rockchip: add basic smp support for rk3288")
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      322ce3c5
    • Vignesh R's avatar
      ARM: OMAP2+: DRA7: clockdomain: change l4per2_7xx_clkdm to SW_WKUP · 23df8019
      Vignesh R authored
      commit b9e23f32 upstream.
      
      Legacy IPs like PWMSS, present under l4per2_7xx_clkdm, cannot support
      smart-idle when its clock domain is in HW_AUTO on DRA7 SoCs. Hence,
      program clock domain to SW_WKUP.
      Signed-off-by: default avatarVignesh R <vigneshr@ti.com>
      Acked-by: default avatarTero Kristo <t-kristo@ti.com>
      Reviewed-by: default avatarPaul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      23df8019