1. 08 Apr, 2023 12 commits
  2. 07 Apr, 2023 4 commits
  3. 06 Apr, 2023 15 commits
  4. 05 Apr, 2023 9 commits
    • Daniel Vetter's avatar
      Merge tag 'drm-misc-fixes-2023-04-05' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 3dfa8926
      Daniel Vetter authored
      Short summary of fixes pull:
      
       * ivpu: DMA fence and suspend fixes
       * nouveau: Color-depth fixes
       * panfrost: Fix mmap error handling
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230405182855.GA1551@linux-uq9g
      3dfa8926
    • Hans de Goede's avatar
      ACPI: video: Add acpi_backlight=video quirk for Lenovo ThinkPad W530 · a5b2781d
      Hans de Goede authored
      The Lenovo ThinkPad W530 uses a nvidia k1000m GPU. When this gets used
      together with one of the older nvidia binary driver series (the latest
      series does not support it), then backlight control does not work.
      
      This is caused by commit 3dbc80a3 ("ACPI: video: Make backlight
      class device registration a separate step (v2)") combined with
      commit 5aa9d943 ("ACPI: video: Don't enable fallback path for
      creating ACPI backlight by default").
      
      After these changes the acpi_video# backlight device is only registered
      when requested by a GPU driver calling acpi_video_register_backlight()
      which the nvidia binary driver does not do.
      
      I realize that using the nvidia binary driver is not a supported use-case
      and users can workaround this by adding acpi_backlight=video on the kernel
      commandline, but the ThinkPad W530 is a popular model under Linux users,
      so it seems worthwhile to add a quirk for this.
      
      I will also email Nvidia asking them to make the driver call
      acpi_video_register_backlight() when an internal LCD panel is detected.
      So maybe the next maintenance release of the drivers will fix this...
      
      Fixes: 5aa9d943 ("ACPI: video: Don't enable fallback path for creating ACPI backlight by default")
      Cc: All applicable <stable@vger.kernel.org>
      Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a5b2781d
    • Hans de Goede's avatar
      ACPI: video: Add acpi_backlight=video quirk for Apple iMac14,1 and iMac14,2 · 26991079
      Hans de Goede authored
      On the Apple iMac14,1 and iMac14,2 all-in-ones (monitors with builtin "PC")
      the connection between the GPU and the panel is seen by the GPU driver as
      regular DP instead of eDP, causing the GPU driver to never call
      acpi_video_register_backlight().
      
      (GPU drivers only call acpi_video_register_backlight() when an internal
       panel is detected, to avoid non working acpi_video# devices getting
       registered on desktops which unfortunately is a real issue.)
      
      Fix the missing acpi_video# backlight device on these all-in-ones by
      adding a acpi_backlight=video DMI quirk, so that video.ko will
      immediately register the backlight device instead of waiting for
      an acpi_video_register_backlight() call.
      
      Fixes: 5aa9d943 ("ACPI: video: Don't enable fallback path for creating ACPI backlight by default")
      Cc: All applicable <stable@vger.kernel.org>
      Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      26991079
    • Hans de Goede's avatar
      ACPI: video: Make acpi_backlight=video work independent from GPU driver · e506731c
      Hans de Goede authored
      Commit 3dbc80a3 ("ACPI: video: Make backlight class device
      registration a separate step (v2)") combined with
      commit 5aa9d943 ("ACPI: video: Don't enable fallback path for
      creating ACPI backlight by default")
      
      Means that the video.ko code now fully depends on the GPU driver calling
      acpi_video_register_backlight() for the acpi_video# backlight class
      devices to get registered.
      
      This means that if the GPU driver does not do this, acpi_backlight=video
      on the cmdline, or DMI quirks for selecting acpi_video# will not work.
      
      This is a problem on for example Apple iMac14,1 all-in-ones where
      the monitor's LCD panel shows up as a regular DP connection instead of
      eDP so the GPU driver will not call acpi_video_register_backlight() [1].
      
      Fix this by making video.ko directly register the acpi_video# devices
      when these have been explicitly requested either on the cmdline or
      through DMI quirks (rather then auto-detection being used).
      
      [1] GPU drivers only call acpi_video_register_backlight() when an internal
      panel is detected, to avoid non working acpi_video# devices getting
      registered on desktops which unfortunately is a real issue.
      
      Fixes: 5aa9d943 ("ACPI: video: Don't enable fallback path for creating ACPI backlight by default")
      Cc: All applicable <stable@vger.kernel.org>
      Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e506731c
    • Hans de Goede's avatar
      ACPI: video: Add auto_detect arg to __acpi_video_get_backlight_type() · 78dfc9d1
      Hans de Goede authored
      Allow callers of __acpi_video_get_backlight_type() to pass a pointer
      to a bool which will get set to false if the backlight-type comes from
      the cmdline or a DMI quirk and set to true if auto-detection was used.
      
      And make __acpi_video_get_backlight_type() non static so that it can
      be called directly outside of video_detect.c .
      
      While at it turn the acpi_video_get_backlight_type() and
      acpi_video_backlight_use_native() wrappers into static inline functions
      in include/acpi/video.h, so that we need to export one less symbol.
      
      Fixes: 5aa9d943 ("ACPI: video: Don't enable fallback path for creating ACPI backlight by default")
      Cc: All applicable <stable@vger.kernel.org>
      Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      78dfc9d1
    • Ard Biesheuvel's avatar
      arm64: compat: Work around uninitialized variable warning · 32d85999
      Ard Biesheuvel authored
      Dan reports that smatch complains about a potential uninitialized
      variable being used in the compat alignment fixup code.
      
      The logic is not wrong per se, but we do end up using an uninitialized
      variable if reading the instruction that triggered the alignment fault
      from user space faults, even if the fault ensures that the uninitialized
      value doesn't propagate any further.
      
      Given that we just give up and return 1 if any fault occurs when reading
      the instruction, let's get rid of the 'success handling' pattern that
      captures the fault in a variable and aborts later, and instead, just
      return 1 immediately if any of the get_user() calls result in an
      exception.
      
      Fixes: 3fc24ef3 ("arm64: compat: Implement misalignment fixups for multiword loads")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reported-by: default avatarDan Carpenter <error27@gmail.com>
      Link: https://lore.kernel.org/r/202304021214.gekJ8yRc-lkp@intel.com/Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Link: https://lore.kernel.org/r/20230404103625.2386382-1-ardb@kernel.orgSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      32d85999
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · 99ddf225
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - Fix timerlat notification, as it was not triggering the notify to
         users when a new max latency was hit.
      
       - Do not trigger max latency if the tracing is off.
      
         When tracing is off, the ring buffer is not updated, it does not make
         sense to notify when there's a new max latency detected by the
         tracer, as why that latency happened is not available. The tracing
         logic still runs when the ring buffer is disabled, but it should not
         be triggering notifications.
      
       - Fix race on freeing the synthetic event "last_cmd" variable by adding
         a mutex around it.
      
       - Fix race between reader and writer of the ring buffer by adding
         memory barriers. When the writer is still on the reader page it must
         have its content visible on the buffer before it moves the commit
         index that the reader uses to know how much content is on the page.
      
       - Make get_lock_parent_ip() always inlined, as it uses _THIS_IP_ and
         _RET_IP_, which gets broken if it is not inlined.
      
       - Make __field(int, arr[5]) in a TRACE_EVENT() macro fail to build.
      
         The field formats of trace events are calculated by using
         sizeof(type) and other means by what is passed into the structure
         macros like __field(). The __field() macro is only meant for atom
         types like int, long, short, pointer, etc. It is not meant for
         arrays.
      
         The code will currently compile with arrays, but then the format
         produced will be inaccurate, and user space parsing tools will break.
      
         Two bugs have already been fixed, now add code that will make the
         kernel fail to build if another trace event includes this buggy field
         format.
      
       - Fix boot up snapshot code:
      
         Boot snapshots were triggering when not even asked for on the kernel
         command line. This was caused by two bugs:
      
          1) It would trigger a snapshot on any instance if one was created
             from the kernel command line.
      
          2) The error handling would only affect the top level instance.
             So the fact that a snapshot was done on a instance that didn't
             allocate a buffer triggered a warning written into the top level
             buffer, and worse yet, disabled the top level buffer.
      
       - Fix memory leak that was caused when an error was logged in a trace
         buffer instance, and then the buffer instance was removed.
      
         The allocated error log messages still needed to be freed.
      
      * tag 'trace-v6.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tracing: Free error logs of tracing instances
        tracing: Fix ftrace_boot_snapshot command line logic
        tracing: Have tracing_snapshot_instance_cond() write errors to the appropriate instance
        tracing: Error if a trace event has an array for a __field()
        tracing/osnoise: Fix notify new tracing_max_latency
        tracing/timerlat: Notify new max thread latency
        ftrace: Mark get_lock_parent_ip() __always_inline
        ring-buffer: Fix race while reader and writer are on the same page
        tracing/synthetic: Fix races on freeing last_cmd
      99ddf225
    • Steven Rostedt (Google)'s avatar
      tracing: Free error logs of tracing instances · 3357c6e4
      Steven Rostedt (Google) authored
      When a tracing instance is removed, the error messages that hold errors
      that occurred in the instance needs to be freed. The following reports a
      memory leak:
      
       # cd /sys/kernel/tracing
       # mkdir instances/foo
       # echo 'hist:keys=x' > instances/foo/events/sched/sched_switch/trigger
       # cat instances/foo/error_log
       [  117.404795] hist:sched:sched_switch: error: Couldn't find field
         Command: hist:keys=x
                            ^
       # rmdir instances/foo
      
      Then check for memory leaks:
      
       # echo scan > /sys/kernel/debug/kmemleak
       # cat /sys/kernel/debug/kmemleak
      unreferenced object 0xffff88810d8ec700 (size 192):
        comm "bash", pid 869, jiffies 4294950577 (age 215.752s)
        hex dump (first 32 bytes):
          60 dd 68 61 81 88 ff ff 60 dd 68 61 81 88 ff ff  `.ha....`.ha....
          a0 30 8c 83 ff ff ff ff 26 00 0a 00 00 00 00 00  .0......&.......
        backtrace:
          [<00000000dae26536>] kmalloc_trace+0x2a/0xa0
          [<00000000b2938940>] tracing_log_err+0x277/0x2e0
          [<000000004a0e1b07>] parse_atom+0x966/0xb40
          [<0000000023b24337>] parse_expr+0x5f3/0xdb0
          [<00000000594ad074>] event_hist_trigger_parse+0x27f8/0x3560
          [<00000000293a9645>] trigger_process_regex+0x135/0x1a0
          [<000000005c22b4f2>] event_trigger_write+0x87/0xf0
          [<000000002cadc509>] vfs_write+0x162/0x670
          [<0000000059c3b9be>] ksys_write+0xca/0x170
          [<00000000f1cddc00>] do_syscall_64+0x3e/0xc0
          [<00000000868ac68c>] entry_SYSCALL_64_after_hwframe+0x72/0xdc
      unreferenced object 0xffff888170c35a00 (size 32):
        comm "bash", pid 869, jiffies 4294950577 (age 215.752s)
        hex dump (first 32 bytes):
          0a 20 20 43 6f 6d 6d 61 6e 64 3a 20 68 69 73 74  .  Command: hist
          3a 6b 65 79 73 3d 78 0a 00 00 00 00 00 00 00 00  :keys=x.........
        backtrace:
          [<000000006a747de5>] __kmalloc+0x4d/0x160
          [<000000000039df5f>] tracing_log_err+0x29b/0x2e0
          [<000000004a0e1b07>] parse_atom+0x966/0xb40
          [<0000000023b24337>] parse_expr+0x5f3/0xdb0
          [<00000000594ad074>] event_hist_trigger_parse+0x27f8/0x3560
          [<00000000293a9645>] trigger_process_regex+0x135/0x1a0
          [<000000005c22b4f2>] event_trigger_write+0x87/0xf0
          [<000000002cadc509>] vfs_write+0x162/0x670
          [<0000000059c3b9be>] ksys_write+0xca/0x170
          [<00000000f1cddc00>] do_syscall_64+0x3e/0xc0
          [<00000000868ac68c>] entry_SYSCALL_64_after_hwframe+0x72/0xdc
      
      The problem is that the error log needs to be freed when the instance is
      removed.
      
      Link: https://lore.kernel.org/lkml/76134d9f-a5ba-6a0d-37b3-28310b4a1e91@alu.unizg.hr/
      Link: https://lore.kernel.org/linux-trace-kernel/20230404194504.5790b95f@gandalf.local.home
      
      Cc: stable@vger.kernel.org
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Thorsten Leemhuis <regressions@leemhuis.info>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Eric Biggers <ebiggers@kernel.org>
      Fixes: 2f754e77 ("tracing: Have the error logs show up in the proper instances")
      Reported-by: default avatarMirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
      Tested-by: default avatarMirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      3357c6e4
    • Oliver Hartkopp's avatar
      can: isotp: fix race between isotp_sendsmg() and isotp_release() · 05173743
      Oliver Hartkopp authored
      As discussed with Dae R. Jeong and Hillf Danton here [1] the sendmsg()
      function in isotp.c might get into a race condition when restoring the
      former tx.state from the old_state.
      
      Remove the old_state concept and implement proper locking for the
      ISOTP_IDLE transitions in isotp_sendmsg(), inspired by a
      simplification idea from Hillf Danton.
      
      Introduce a new tx.state ISOTP_SHUTDOWN and use the same locking
      mechanism from isotp_release() which resolves a potential race between
      isotp_sendsmg() and isotp_release().
      
      [1] https://lore.kernel.org/linux-can/ZB%2F93xJxq%2FBUqAgG@dragonet
      
      v1: https://lore.kernel.org/all/20230331102114.15164-1-socketcan@hartkopp.net
      v2: https://lore.kernel.org/all/20230331123600.3550-1-socketcan@hartkopp.net
          take care of signal interrupts for wait_event_interruptible() in
          isotp_release()
      v3: https://lore.kernel.org/all/20230331130654.9886-1-socketcan@hartkopp.net
          take care of signal interrupts for wait_event_interruptible() in
          isotp_sendmsg() in the wait_tx_done case
      v4: https://lore.kernel.org/all/20230331131935.21465-1-socketcan@hartkopp.net
          take care of signal interrupts for wait_event_interruptible() in
          isotp_sendmsg() in ALL cases
      
      Cc: Dae R. Jeong <threeearcat@gmail.com>
      Cc: Hillf Danton <hdanton@sina.com>
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Fixes: 4f027cba ("can: isotp: split tx timer into transmission and timeout")
      Link: https://lore.kernel.org/all/20230331131935.21465-1-socketcan@hartkopp.net
      Cc: stable@vger.kernel.org
      [mkl: rephrase commit message]
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      05173743