1. 25 Feb, 2023 8 commits
    • Changbin Du's avatar
      alpha: in_irq() cleanup · 290ec1d5
      Changbin Du authored
      Replace the obsolete and ambiguos macro in_irq() with new
      macro in_hardirq().
      Signed-off-by: default avatarChangbin Du <changbin.du@gmail.com>
      Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
      290ec1d5
    • Al Viro's avatar
      alpha: lazy FPU switching · 05096666
      Al Viro authored
      	On each context switch we save the FPU registers on stack
      of old process and restore FPU registers from the stack of new one.
      That allows us to avoid doing that each time we enter/leave the
      kernel mode; however, that can get suboptimal in some cases.
      
      	For one thing, we don't need to bother saving anything
      for kernel threads.  For another, if between entering and leaving
      the kernel a thread gives CPU up more than once, it will do
      useless work, saving the same values every time, only to discard
      the saved copy as soon as it returns from switch_to().
      
      	Alternative solution:
      
      * move the array we save into from switch_stack to thread_info
      * have a (thread-synchronous) flag set when we save them
      * have another flag set when they should be restored on return to userland.
      * do *NOT* save/restore them in do_switch_stack()/undo_switch_stack().
      * restore on the exit to user mode if the restore flag had
      been set.  Clear both flags.
      * on context switch, entry to fork/clone/vfork, before entry into do_signal()
      and on entry into straced syscall save the registers and set the 'saved' flag
      unless it had been already set.
      * on context switch set the 'restore' flag as well.
      * have copy_thread() set both flags for child, so the registers would be
      restored once the child returns to userland.
      * use the saved data in setup_sigcontext(); have restore_sigcontext() set both flags
      and copy from sigframe to save area.
      * teach ptrace to look for FPU registers in thread_info instead of
      switch_stack.
      * teach isolated accesses to FPU registers (rdfpcr, wrfpcr, etc.)
      to check the 'saved' flag (under preempt_disable()) and work with the save area
      if it's been set; if 'saved' flag is found upon write access, set 'restore' flag
      as well.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
      05096666
    • Al Viro's avatar
      alpha/boot/misc: trim unused declarations · a7acb188
      Al Viro authored
      gzip_mark() and gzip_release() are gone; there used to be two
      forward declarations of each and the patch removing those suckers
      had left one of each behind...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
      a7acb188
    • Al Viro's avatar
      alpha/boot/tools/objstrip: fix the check for ELF header · a4c082f2
      Al Viro authored
      Just memcmp() with ELFMAG - that's the normal way to do it in userland
      code, which that thing is.  Besides, that has the benefit of actually
      building - str_has_prefix() is *NOT* present in <string.h>.
      
      Fixes: 5f14596e "alpha: Replace strncmp with str_has_prefix"
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
      a4c082f2
    • Al Viro's avatar
      56efd34f
    • Al Viro's avatar
      alpha: fix FEN fault handling · d3c51b70
      Al Viro authored
      Type 3 instruction fault (FPU insn with FPU disabled) is handled
      by quietly enabling FPU and returning.  Which is fine, except that
      we need to do that both for fault in userland and in the kernel;
      the latter *can* legitimately happen - all it takes is this:
      
      .global _start
      _start:
      	call_pal 0xae
      	lda $0, 0
      	ldq $0, 0($0)
      
      - call_pal CLRFEN to clear "FPU enabled" flag and arrange for
      a signal delivery (SIGSEGV in this case).
      
      Fixed by moving the handling of type 3 into the common part of
      do_entIF(), before we check for kernel vs. user mode.
      
      Incidentally, check for kernel mode is unidiomatic; the normal
      way to do that is !user_mode(regs).  The difference is that
      the open-coded variant treats any of bits 63..3 of regs->ps being
      set as "it's user mode" while the normal approach is to check just
      the bit 3.  PS is a 4-bit register and regs->ps always will have
      bits 63..4 clear, so the open-code variant here is actually equivalent
      to !user_mode(regs).  Harder to follow, though...
      
      Reproducer above will crash any box where CLRFEN is not ignored by
      PAL (== any actual hardware, AFAICS; PAL used in qemu doesn't
      bother implementing that crap).
      
      Cc: stable@vger.kernel.org # all way back...
      Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
      d3c51b70
    • Joe Perches's avatar
      alpha: Avoid comma separated statements · 4da2bd30
      Joe Perches authored
      Use semicolons and braces.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
      4da2bd30
    • rj1's avatar
      alpha: fixed a typo in core_cia.c · 6b6b64ab
      rj1 authored
      Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
      6b6b64ab
  2. 14 Feb, 2023 9 commits
  3. 13 Feb, 2023 2 commits
  4. 12 Feb, 2023 10 commits
  5. 11 Feb, 2023 5 commits
  6. 10 Feb, 2023 6 commits
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 420b2d43
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "Two clk driver fixes
      
         - Use devm_kasprintf() to avoid overflows when forming clk names in
           the Microchip PolarFire driver
      
         - Fix the pretty broken Ingenic JZ4760 M/N/OD calculation to actually
           work and find proper divisors"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: ingenic: jz4760: Update M/N/OD calculation algorithm
        clk: microchip: mpfs-ccc: Use devm_kasprintf() for allocating formatted strings
      420b2d43
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 545c80ab
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Some assorted pin control fixes, the most interesting will be the
        Intel patch fixing a classic problem: laptop touchpad IRQs...
      
         - Some pin drive register fixes in the Mediatek driver.
      
         - Return proper error code in the Aspeed driver, and revert and
           ill-advised force-disablement patch that needs to be reworked.
      
         - Fix AMD driver debug output.
      
         - Fix potential NULL dereference in the Single driver.
      
         - Fix a group definition error in the Qualcomm SM8450 LPASS driver.
      
         - Restore pins used in direct IRQ mode in the Intel driver (This
           fixes some laptop touchpads!)"
      
      * tag 'pinctrl-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: intel: Restore the pins that used to be in Direct IRQ mode
        pinctrl: qcom: sm8450-lpass-lpi: correct swr_rx_data group
        pinctrl: aspeed: Revert "Force to disable the function's signal"
        pinctrl: single: fix potential NULL dereference
        pinctrl: amd: Fix debug output for debounce time
        pinctrl: aspeed: Fix confusing types in return value
        pinctrl: mediatek: Fix the drive register definition of some Pins
      545c80ab
    • Linus Torvalds's avatar
      Merge tag 'pci-v6.2-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci · 4cfd5afc
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - Move to a shared PCI git tree (Bjorn Helgaas)
      
       - Add Krzysztof Wilczyński as another PCI maintainer (Lorenzo
         Pieralisi)
      
       - Revert a couple ASPM patches to fix suspend/resume regressions (Bjorn
         Helgaas)
      
      * tag 'pci-v6.2-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
        Revert "PCI/ASPM: Refactor L1 PM Substates Control Register programming"
        Revert "PCI/ASPM: Save L1 PM Substates Capability for suspend/resume"
        MAINTAINERS: Promote Krzysztof to PCI controller maintainer
        MAINTAINERS: Move to shared PCI tree
      4cfd5afc
    • Bjorn Helgaas's avatar
      Revert "PCI/ASPM: Refactor L1 PM Substates Control Register programming" · ff209ecc
      Bjorn Helgaas authored
      This reverts commit 5e85eba6.
      
      Thomas Witt reported that 5e85eba6 ("PCI/ASPM: Refactor L1 PM Substates
      Control Register programming") broke suspend/resume on a Tuxedo
      Infinitybook S 14 v5, which seems to use a Clevo L140CU Mainboard.
      
      The main symptom is:
      
        iwlwifi 0000:02:00.0: Unable to change power state from D3hot to D0, device inaccessible
        nvme 0000:03:00.0: Unable to change power state from D3hot to D0, device inaccessible
      
      and the machine is only partially usable after resume.  It can't run dmesg
      and can't do a clean reboot.  This happens on every suspend/resume cycle.
      
      Revert 5e85eba6 until we can figure out the root cause.
      
      Fixes: 5e85eba6 ("PCI/ASPM: Refactor L1 PM Substates Control Register programming")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=216877Reported-by: default avatarThomas Witt <kernel@witt.link>
      Tested-by: default avatarThomas Witt <kernel@witt.link>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Cc: stable@vger.kernel.org	# v6.1+
      Cc: Vidya Sagar <vidyas@nvidia.com>
      ff209ecc
    • Bjorn Helgaas's avatar
      Revert "PCI/ASPM: Save L1 PM Substates Capability for suspend/resume" · a7152be7
      Bjorn Helgaas authored
      This reverts commit 4ff116d0.
      
      Tasev Nikola and Mark Enriquez reported that resume from suspend was broken
      in v6.1-rc1.  Tasev bisected to a47126ec ("PCI/PTM: Cache PTM
      Capability offset"), but we can't figure out how that could be related.
      
      Mark saw the same symptoms and bisected to 4ff116d0 ("PCI/ASPM: Save L1
      PM Substates Capability for suspend/resume"), which does have a connection:
      it restores L1 Substates configuration while ASPM L1 may be enabled:
      
        pci_restore_state
          pci_restore_aspm_l1ss_state
            aspm_program_l1ss
              pci_write_config_dword(PCI_L1SS_CTL1, ctl1)         # L1SS restore
          pci_restore_pcie_state
            pcie_capability_write_word(PCI_EXP_LNKCTL, cap[i++])  # L1 restore
      
      which is a problem because PCIe r6.0, sec 5.5.4, requires that:
      
        If setting either or both of the enable bits for ASPM L1 PM
        Substates, both ports must be configured as described in this
        section while ASPM L1 is disabled.
      
      Separately, Thomas Witt reported that 5e85eba6 ("PCI/ASPM: Refactor L1
      PM Substates Control Register programming") broke suspend/resume, and it
      depends on 4ff116d0.
      
      Revert 4ff116d0 ("PCI/ASPM: Save L1 PM Substates Capability for
      suspend/resume") to fix the resume issue and enable revert of 5e85eba6
      to fix the issue Thomas reported.
      
      Note that reverting 4ff116d0 means L1 Substates config may be lost on
      suspend/resume.  As far as we know the system will use more power but will
      still *work* correctly.
      
      Fixes: 4ff116d0 ("PCI/ASPM: Save L1 PM Substates Capability for suspend/resume")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=216782
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=216877Reported-by: default avatarTasev Nikola <tasev.stefanoska@skynet.be>
      Reported-by: default avatarMark Enriquez <enriquezmark36@gmail.com>
      Reported-by: default avatarThomas Witt <kernel@witt.link>
      Tested-by: default avatarMark Enriquez <enriquezmark36@gmail.com>
      Tested-by: default avatarThomas Witt <kernel@witt.link>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Cc: stable@vger.kernel.org	# v6.1+
      Cc: Vidya Sagar <vidyas@nvidia.com>
      a7152be7
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 4f72a263
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "All the changes this time are minor devicetree corrections, the
        majority being for 64-bit Rockchip SoC support. These are a couple of
        corrections for properties that are in violation of the binding, some
        that put the machine into safer operating points for the eMMC and
        thermal settings, and missing properties that prevented rk356x PCIe
        and ethernet from working correctly.
      
        The changes for amlogic and mediatek address incorrect properties that
        were preventing the display support on MT8195 and the MMC support on
        various Meson SoCs from working correctly.
      
        The stihxxx-b2120 change fixes the GPIO polarity for the DVB tuner to
        allow this to be used correctly after a futre driver change, though it
        has no effect on older kernels"
      
      * tag 'soc-fixes-6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        arm64: dts: meson-gx: Make mmc host controller interrupts level-sensitive
        arm64: dts: meson-g12-common: Make mmc host controller interrupts level-sensitive
        arm64: dts: meson-axg: Make mmc host controller interrupts level-sensitive
        ARM: dts: stihxxx-b2120: fix polarity of reset line of tsin0 port
        arm64: dts: mediatek: mt8195: Fix vdosys* compatible strings
        arm64: dts: rockchip: align rk3399 DMC OPP table with bindings
        arm64: dts: rockchip: set sdmmc0 speed to sd-uhs-sdr50 on rock-3a
        arm64: dts: rockchip: fix probe of analog sound card on rock-3a
        arm64: dts: rockchip: add missing #interrupt-cells to rk356x pcie2x1
        arm64: dts: rockchip: fix input enable pinconf on rk3399
        ARM: dts: rockchip: add power-domains property to dp node on rk3288
        arm64: dts: rockchip: add io domain setting to rk3566-box-demo
        arm64: dts: rockchip: remove unsupported property from sdmmc2 for rock-3a
        arm64: dts: rockchip: drop unused LED mode property from rk3328-roc-cc
        arm64: dts: rockchip: reduce thermal limits on rk3399-pinephone-pro
        arm64: dts: rockchip: use correct reset names for rk3399 crypto nodes
      4f72a263