1. 17 12月, 2015 12 次提交
  2. 16 12月, 2015 1 次提交
    • D
      powerpc: Remove broken GregorianDay() · 00b912b0
      Daniel Axtens 提交于
      GregorianDay() is supposed to calculate the day of the week
      (tm->tm_wday) for a given day/month/year. In that calcuation it
      indexed into an array called MonthOffset using tm->tm_mon-1. However
      tm_mon is zero-based, not one-based, so this is off-by-one. It also
      means that every January, GregoiranDay() will access element -1 of
      the MonthOffset array.
      
      It also doesn't appear to be a correct algorithm either: see in
      contrast kernel/time/timeconv.c's time_to_tm function.
      
      It's been broken forever, which suggests no-one in userland uses
      this. It looks like no-one in the kernel uses tm->tm_wday either
      (see e.g. drivers/rtc/rtc-ds1305.c:319).
      
      tm->tm_wday is conventionally set to -1 when not available in
      hardware so we can simply set it to -1 and drop the function.
      (There are over a dozen other drivers in drivers/rtc that do
      this.)
      
      Found using UBSAN.
      
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Andrew Morton <akpm@linux-foundation.org> # as an example of what UBSan finds.
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
      Cc: rtc-linux@googlegroups.com
      Signed-off-by: NDaniel Axtens <dja@axtens.net>
      Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      00b912b0
  3. 14 12月, 2015 4 次提交
  4. 26 11月, 2015 2 次提交
  5. 24 11月, 2015 1 次提交
  6. 28 10月, 2015 3 次提交
  7. 22 10月, 2015 4 次提交
  8. 21 10月, 2015 6 次提交
    • P
      powerpc/powernv: Handle irq_happened flag correctly in off-line loop · 53c656c4
      Paul Mackerras 提交于
      This fixes a bug where it is possible for an off-line CPU to fail to go
      into a low-power state (nap/sleep/winkle), and to become unresponsive to
      requests from the KVM subsystem to wake up and run a VCPU. What can
      happen is that a maskable interrupt of some kind (external, decrementer,
      hypervisor doorbell, or HMI) after we have called local_irq_disable() at
      the beginning of pnv_smp_cpu_kill_self() and before interrupts are
      hard-disabled inside power7_nap/sleep/winkle(). In this situation, the
      pending event is marked in the irq_happened flag in the PACA. This
      pending event prevents power7_nap/sleep/winkle from going to the
      requested low-power state; instead they return immediately. We don't
      deal with any of these pending event flags in the off-line loop in
      pnv_smp_cpu_kill_self() because power7_nap et al. return 0 in this case,
      so we will have srr1 == 0, and none of the processing to clear
      interrupts or doorbells will be done.
      
      Usually, the most obvious symptom of this is that a KVM guest will fail
      with a console message saying "KVM: couldn't grab cpu N".
      
      This fixes the problem by making sure we handle the irq_happened flags
      properly. First, we hard-disable before the off-line loop. Once we have
      hard-disabled, the irq_happened flags can't change underneath us. We
      unconditionally clear the DEC and HMI flags: there is no processing of
      timer interrupts while off-line, and the necessary HMI processing is all
      done in lower-level code. We leave the EE and DBELL flags alone for the
      first iteration of the loop, so that we won't fail to respond to a
      split-core request that came in just before hard-disabling. Within the
      loop, we handle external interrupts if the EE bit is set in irq_happened
      as well as if the low-power state was interrupted by an external
      interrupt. (We don't need to do the msgclr for a pending doorbell in
      irq_happened, because doorbells are edge-triggered and don't remain
      pending in hardware.) Then we clear both the EE and DBELL flags, and
      once clear, they cannot be set again (until this CPU comes online again,
      that is).
      
      This also fixes the debug check to not be done when we just ran a KVM
      guest or when the sleep didn't happen because of a pending event in
      irq_happened.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      53c656c4
    • G
      powerpc/eeh: Fix recursive fenced PHB on Broadcom shiner adapter · 353169ac
      Gavin Shan 提交于
      Similar to commit b6541db1 ("powerpc/eeh: Block PCI config access
      upon frozen PE"), this blocks the PCI config space of Broadcom
      Shiner adapter until PE reset is completed, to avoid recursive
      fenced PHB when dumping PCI config registers during the period
      of error recovery.
      
         ~# lspci -ns 0003:03:00.0
         0003:03:00.0 0200: 14e4:168a (rev 10)
         ~# lspci -s 0003:03:00.0
         0003:03:00.0 Ethernet controller: Broadcom Corporation \
                      NetXtreme II BCM57800 1/10 Gigabit Ethernet (rev 10)
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      353169ac
    • G
      powerpc/powernv: Simplify pnv_eeh_set_option() · f9433718
      Gavin Shan 提交于
      This simplifies pnv_eeh_set_option() to avoid unnecessary nested
      if statements, to improve readability. No functional changes.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Reviewed-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      f9433718
    • G
      powerpc/powernv: Remove pnv_eeh_cap_start() · 4d6186ca
      Gavin Shan 提交于
      This moves the logic of pnv_eeh_cap_start() to pnv_eeh_find_cap()
      as the function is only called by pnv_eeh_find_cap(). The logic
      of both functions are pretty simple. No need to have separate
      functions.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Reviewed-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      4d6186ca
    • G
      powerpc/powernv: Cleanup on EEH comments · 608fb9c2
      Gavin Shan 提交于
      This applies cleanup on eeh-powernv.c, no functional changes:
      
         * Remove unnecessary comments and empty line.
         * Correct inaccurate comments.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      608fb9c2
    • G
      powerpc/pseries: Cleanup on pseries_eeh_get_state() · 00ba05a1
      Gavin Shan 提交于
      This cleans up pseries_eeh_get_state(), no functional changes:
      
         * Return EEH_STATE_NOT_SUPPORT early when the 2nd RTAS output
           argument is zero to avoid nested if statements.
         * Skip clearing bits in the PE state represented by variable
           "result" to simplify the code.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Reviewed-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      00ba05a1
  9. 19 10月, 2015 1 次提交
    • M
      powerpc/cell: Drop CONFIG_TUNE_CELL in favour of CONFIG_CELL_CPU · bed08b7e
      Michael Ellerman 提交于
      The TUNE_CELL option allows you to build a kernel that runs on multiple
      CPUs but is tuned (ie. optimised) to run on Cell CPUs. Now days no one
      is building a distro in that fashion, and any users who are building
      custom kernels for their Cell machines are better off building with
      CONFIG_CELL_CPU, which builds a kernel that only runs on Cell and
      therefore can be optimised even more aggresively.
      
      Dropping the option also avoids confusing other users, who are presented
      with an option to tune for Cell when they are not building for a Cell
      CPU at all.
      Suggested-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      bed08b7e
  10. 17 10月, 2015 5 次提交
  11. 15 10月, 2015 1 次提交