Skip to content
Snippets Groups Projects
  1. Dec 02, 2024
    • Sebastian Reichel's avatar
      clk: divider: Fix divisor masking on 64 bit platforms · 4ee6549f
      Sebastian Reichel authored and Sebastian Reichel's avatar Sebastian Reichel committed
      
      The clock framework handles clock rates as "unsigned long", so u32 on
      32-bit architectures and u64 on 64-bit architectures.
      
      The current code casts the dividend to u64 on 32-bit to avoid a
      potential overflow. For example DIV_ROUND_UP(3000000000, 1500000000)
      = (3.0G + 1.5G - 1) / 1.5G = = OVERFLOW / 1.5G, which has been
      introduced in commit 9556f9da ("clk: divider: handle integer overflow
      when dividing large clock rates").
      
      On 64 bit platforms this masks the divisor, so that only the lower
      32 bit are used. Thus requesting a frequency >= 4.3GHz results
      in incorrect values. For example requesting 4300000000 (4.3 GHz) will
      effectively request ca. 5 MHz. Requesting clk_round_rate(clk, ULONG_MAX)
      is a bit of a special case, since that still returns correct values as
      long as the parent clock is below 8.5 GHz.
      
      Fix this by switching to DIV_ROUND_UP_NO_OVERFLOW, which cannot
      overflow. This avoids any requirements on the arguments (except
      that divisor should not be 0 obviously).
      
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      4ee6549f
    • Sebastian Reichel's avatar
      math.h: add DIV_ROUND_UP_NO_OVERFLOW · e716f310
      Sebastian Reichel authored and Sebastian Reichel's avatar Sebastian Reichel committed
      
      Add a new DIV_ROUND_UP helper, which cannot overflow when
      big numbers are being used.
      
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      e716f310
    • Sebastian Reichel's avatar
      arm64: dts: rockchip: rk3588-rock5b: add USB-C support · d8869298
      Sebastian Reichel authored and Sebastian Reichel's avatar Sebastian Reichel committed
      
      Add hardware description for the USB-C port in the Radxa Rock 5 Model B.
      This describes the OHCI, EHCI and XHCI USB parts, but not yet the
      DisplayPort AltMode (bindings are not yet upstream).
      
      For now the fusb302 node is marked with status "fail", since the board
      is usually powered through the USB-C port. Handling of errors can result
      in hard resets, which removed the bus power for some time resulting in
      a board reset.
      
      The main problem right now is that devices are supposed to interact with
      the power-supply within 5 seconds after the plug event according to the
      USB PD specification. This is more or less impossible to achieve when
      the kernel is the first software communicating with the power-supply.
      
      Currently the most likely workaround will be USB-PD handling added to
      U-Boot. In that case U-Boot can update the status to "okay". That way
      booting a kernel with the updated DT on an old U-Boot avoids a reset
      loop.
      
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      d8869298
    • Christopher Obbard's avatar
      [NOUPSTREAM] Add GitLab CI support · a97311c7
      Christopher Obbard authored and Sebastian Reichel's avatar Sebastian Reichel committed
      
      Add CI support. This will do the following:
      
      1. Run dt_binding_check to make sure no major flaws were introduced in
         the DT bindings
      2. Run dtbs_check, for Rock 5A, Rock 5B and EVB1. If warnings are
         generated the CI will report that as warning
      3. Build a Kernel .deb package
      4. Generate a test job for LAVA and run it
      
      Co-developed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      Co-developed-by: default avatarSjoerd Simons <sjoerd@collabora.com>
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      Signed-off-by: default avatarSjoerd Simons <sjoerd@collabora.com>
      Signed-off-by: default avatarChristopher Obbard <chris.obbard@collabora.com>
      a97311c7
  2. Dec 01, 2024
    • Linus Torvalds's avatar
      Linux 6.13-rc1 · 40384c84
      Linus Torvalds authored
      40384c84
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.13-rc1-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · a14bf463
      Linus Torvalds authored
      Pull i2c component probing support from Wolfram Sang:
       "Add OF component probing.
      
        Some devices are designed and manufactured with some components having
        multiple drop-in replacement options. These components are often
        connected to the mainboard via ribbon cables, having the same signals
        and pin assignments across all options. These may include the display
        panel and touchscreen on laptops and tablets, and the trackpad on
        laptops. Sometimes which component option is used in a particular
        device can be detected by some firmware provided identifier, other
        times that information is not available, and the kernel has to try to
        probe each device.
      
        Instead of a delicate dance between drivers and device tree quirks,
        this change introduces a simple I2C component probe function. For a
        given class of devices on the same I2C bus, it will go through all of
        them, doing a simple I2C read transfer and see which one of them
        responds. It will then enable the device that responds"
      
      * tag 'i2c-for-6.13-rc1-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        MAINTAINERS: fix typo in I2C OF COMPONENT PROBER
        of: base: Document prefix argument for of_get_next_child_with_prefix()
        i2c: Fix whitespace style issue
        arm64: dts: mediatek: mt8173-elm-hana: Mark touchscreens and trackpads as fail
        platform/chrome: Introduce device tree hardware prober
        i2c: of-prober: Add GPIO support to simple helpers
        i2c: of-prober: Add simple helpers for regulator support
        i2c: Introduce OF component probe function
        of: base: Add for_each_child_of_node_with_prefix()
        of: dynamic: Add of_changeset_update_prop_string
      a14bf463
    • Linus Torvalds's avatar
      Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · 88862eeb
      Linus Torvalds authored
      Pull bprintf() removal from Steven Rostedt:
      
       - Remove unused bprintf() function, that was added with the rest of the
         "bin-printf" functions.
      
         These are functions that are used by trace_printk() that allows to
         quickly save the format and arguments into the ring buffer without
         the expensive processing of converting numbers to ASCII. Then on
         output, at a much later time, the ring buffer is read and the string
         processing occurs then. The bprintf() was added for consistency but
         was never used. It can be safely removed.
      
      * tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        printf: Remove unused 'bprintf'
      88862eeb
    • Linus Torvalds's avatar
      Merge tag 'timers_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f788b5ef
      Linus Torvalds authored
      Pull timer fixes from Borislav Petkov:
      
       - Fix a case where posix timers with a thread-group-wide target would
         miss signals if some of the group's threads are exiting
      
       - Fix a hang caused by ndelay() calling the wrong delay function
         __udelay()
      
       - Fix a wrong offset calculation in adjtimex(2) when using ADJ_MICRO
         (microsecond resolution) and a negative offset
      
      * tag 'timers_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        posix-timers: Target group sigqueue to current task only if not exiting
        delay: Fix ndelay() spuriously treated as udelay()
        ntp: Remove invalid cast in time offset math
      f788b5ef
    • Linus Torvalds's avatar
      Merge tag 'irq_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 63f4993b
      Linus Torvalds authored
      Pull irq fixes from Borislav Petkov:
      
       - Move the ->select callback to the correct ops structure in
         irq-mvebu-sei to fix some Marvell Armada platforms
      
       - Add a workaround for Hisilicon ITS erratum 162100801 which can cause
         some virtual interrupts to get lost
      
       - More platform_driver::remove() conversion
      
      * tag 'irq_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip: Switch back to struct platform_driver::remove()
        irqchip/gicv3-its: Add workaround for hip09 ITS erratum 162100801
        irqchip/irq-mvebu-sei: Move misplaced select() callback to SEI CP domain
      63f4993b
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 58ac609b
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Add a terminating zero end-element to the array describing AMD CPUs
         affected by erratum 1386 so that the matching loop actually
         terminates instead of going off into the weeds
      
       - Update the boot protocol documentation to mention the fact that the
         preferred address to load the kernel to is considered in the
         relocatable kernel case too
      
       - Flush the memory buffer containing the microcode patch after applying
         microcode on AMD Zen1 and Zen2, to avoid unnecessary slowdowns
      
       - Make sure the PPIN CPU feature flag is cleared on all CPUs if PPIN
         has been disabled
      
      * tag 'x86_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/CPU/AMD: Terminate the erratum_1386_microcode array
        x86/Documentation: Update algo in init_size description of boot protocol
        x86/microcode/AMD: Flush patch buffer mapping after application
        x86/mm: Carve out INVLPG inline asm for use by others
        x86/cpu: Fix PPIN initialization
      58ac609b
    • Linus Torvalds's avatar
      strscpy: write destination buffer only once · 9022ed0e
      Linus Torvalds authored
      
      The point behind strscpy() was to once and for all avoid all the
      problems with 'strncpy()' and later broken "fixed" versions like
      strlcpy() that just made things worse.
      
      So strscpy not only guarantees NUL-termination (unlike strncpy), it also
      doesn't do unnecessary padding at the destination.  But at the same time
      also avoids byte-at-a-time reads and writes by _allowing_ some extra NUL
      writes - within the size, of course - so that the whole copy can be done
      with word operations.
      
      It is also stable in the face of a mutable source string: it explicitly
      does not read the source buffer multiple times (so an implementation
      using "strnlen()+memcpy()" would be wrong), and does not read the source
      buffer past the size (like the mis-design that is strlcpy does).
      
      Finally, the return value is designed to be simple and unambiguous: if
      the string cannot be copied fully, it returns an actual negative error,
      making error handling clearer and simpler (and the caller already knows
      the size of the buffer).  Otherwise it returns the string length of the
      result.
      
      However, there was one final stability issue that can be important to
      callers: the stability of the destination buffer.
      
      In particular, the same way we shouldn't read the source buffer more
      than once, we should avoid doing multiple writes to the destination
      buffer: first writing a potentially non-terminated string, and then
      terminating it with NUL at the end does not result in a stable result
      buffer.
      
      Yes, it gives the right result in the end, but if the rule for the
      destination buffer was that it is _always_ NUL-terminated even when
      accessed concurrently with updates, the final byte of the buffer needs
      to always _stay_ as a NUL byte.
      
      [ Note that "final byte is NUL" here is literally about the final byte
        in the destination array, not the terminating NUL at the end of the
        string itself. There is no attempt to try to make concurrent reads and
        writes give any kind of consistent string length or contents, but we
        do want to guarantee that there is always at least that final
        terminating NUL character at the end of the destination array if it
        existed before ]
      
      This is relevant in the kernel for the tsk->comm[] array, for example.
      Even without locking (for either readers or writers), we want to know
      that while the buffer contents may be garbled, it is always a valid C
      string and always has a NUL character at 'comm[TASK_COMM_LEN-1]' (and
      never has any "out of thin air" data).
      
      So avoid any "copy possibly non-terminated string, and terminate later"
      behavior, and write the destination buffer only once.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9022ed0e
    • Dr. David Alan Gilbert's avatar
      printf: Remove unused 'bprintf' · f69e6375
      Dr. David Alan Gilbert authored
      bprintf() is unused. Remove it. It was added in the commit 4370aa4a
      ("vsprintf: add binary printf") but as far as I can see was never used,
      unlike the other two functions in that patch.
      
      Link: https://lore.kernel.org/20241002173147.210107-1-linux@treblig.org
      
      
      Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
      Acked-by: default avatarPetr Mladek <pmladek@suse.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <linux@treblig.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      f69e6375
    • Linus Torvalds's avatar
      Merge tag 'turbostat-2024.11.30' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux · bcc8eda6
      Linus Torvalds authored
      Pull turbostat updates from Len Brown:
      
       - assorted minor bug fixes
      
       - assorted platform specific tweaks
      
       - initial RAPL PSYS (SysWatt) support
      
      * tag 'turbostat-2024.11.30' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
        tools/power turbostat: 2024.11.30
        tools/power turbostat: Add RAPL psys as a built-in counter
        tools/power turbostat: Fix child's argument forwarding
        tools/power turbostat: Force --no-perf in --dump mode
        tools/power turbostat: Add support for /sys/class/drm/card1
        tools/power turbostat: Cache graphics sysfs file descriptors during probe
        tools/power turbostat: Consolidate graphics sysfs access
        tools/power turbostat: Remove unnecessary fflush() call
        tools/power turbostat: Enhance platform divergence description
        tools/power turbostat: Add initial support for GraniteRapids-D
        tools/power turbostat: Remove PC3 support on Lunarlake
        tools/power turbostat: Rename arl_features to lnl_features
        tools/power turbostat: Add back PC8 support on Arrowlake
        tools/power turbostat: Remove PC7/PC9 support on MTL
        tools/power turbostat: Honor --show CPU, even when even when num_cpus=1
        tools/power turbostat: Fix trailing '\n' parsing
        tools/power turbostat: Allow using cpu device in perf counters on hybrid platforms
        tools/power turbostat: Fix column printing for PMT xtal_time counters
        tools/power turbostat: fix GCC9 build regression
      bcc8eda6
    • Linus Torvalds's avatar
      Merge tag 'pci-v6.13-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci · 0cb71708
      Linus Torvalds authored
      Pull PCI fix from Bjorn Helgaas:
      
       - When removing a PCI device, only look up and remove a platform device
         if there is an associated device node for which there could be a
         platform device, to fix a merge window regression (Brian Norris)
      
      * tag 'pci-v6.13-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
        PCI/pwrctrl: Unregister platform device only if one actually exists
      0cb71708
    • Linus Torvalds's avatar
      Merge tag 'lsm-pr-20241129' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm · 8a6a03ad
      Linus Torvalds authored
      Pull ima fix from Paul Moore:
       "One small patch to fix a function parameter / local variable naming
        snafu that went up to you in the current merge window"
      
      * tag 'lsm-pr-20241129' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm:
        ima: uncover hidden variable in ima_match_rules()
      8a6a03ad
  3. Nov 30, 2024
Loading