28 Jul, 2020

8 commits

  • So far, all flags that can be set in an fanotify mark mask can be set
    explicitly by a call to fanotify_mark(2).

    Prepare for defining implicit event flags that cannot be set by user with
    fanotify_mark(2), similar to how inotify/dnotify implicitly set the
    FS_EVENT_ON_CHILD flag.

    Implicit event flags cannot be removed by user and mark gets destroyed
    when only implicit event flags remain in the mask.

    Link: https://lore.kernel.org/r/20200716084230.30611-7-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • The special event flags (FAN_ONDIR, FAN_EVENT_ON_CHILD) never had
    any meaning in ignored mask. Mask them out explicitly.

    Link: https://lore.kernel.org/r/20200716084230.30611-6-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • As preparation for new flags that report fids, define a bit set
    of flags for a group reporting fids, currently containing the
    only bit FAN_REPORT_FID.

    Link: https://lore.kernel.org/r/20200716084230.30611-5-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • In fanotify_encode_fh(), both cases of NULL inode and failure to encode
    ended up with fh type FILEID_INVALID.

    Distiguish the case of NULL inode, by setting fh type to FILEID_ROOT.
    This is just a semantic difference at this point.

    Remove stale comment and unneeded check from fid event compare helpers.

    Link: https://lore.kernel.org/r/20200716084230.30611-4-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • An event on directory should never be merged with an event on
    non-directory regardless of the event struct type.

    This change has no visible effect, because currently, with struct
    fanotify_path_event, the relevant events will not be merged because
    event path of dir will be different than event path of non-dir.

    Link: https://lore.kernel.org/r/20200716084230.30611-3-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • In fanotify_group_event_mask() there is logic in place to make sure we
    are not going to handle an event with no type and just FAN_ONDIR flag.
    Generalize this logic to any FANOTIFY_EVENT_FLAGS.

    There is only one more flag in this group at the moment -
    FAN_EVENT_ON_CHILD. We never report it to user, but we do pass it in to
    fanotify_alloc_event() when group is reporting fid as indication that
    event happened on child. We will have use for this indication later on.

    Link: https://lore.kernel.org/r/20200716084230.30611-2-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • It was never enabled in uapi and its functionality is about to be
    superseded by events FAN_CREATE, FAN_DELETE, FAN_MOVE with group
    flag FAN_REPORT_NAME.

    Keep a place holder variable name_event instead of removing the
    name recording code since it will be used by the new events.

    Link: https://lore.kernel.org/r/20200708111156.24659-17-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • The 'inode' argument to handle_event(), sometimes referred to as
    'to_tell' is somewhat obsolete.
    It is a remnant from the times when a group could only have an inode mark
    associated with an event.

    We now pass an iter_info array to the callback, with all marks associated
    with an event.

    Most backends ignore this argument, with two exceptions:
    1. dnotify uses it for sanity check that event is on directory
    2. fanotify uses it to report fid of directory on directory entry
    modification events

    Remove the 'inode' argument and add a 'dir' argument.
    The callback function signature is deliberately changed, because
    the meaning of the argument has changed and the arguments have
    been documented.

    The 'dir' argument is set to when 'file_name' is specified and it is
    referring to the directory that the 'file_name' entry belongs to.

    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     

15 Jul, 2020

9 commits

  • Break up fanotify_alloc_event() into helpers by event struct type.

    Suggested-by: Jan Kara
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • The special overflow event is allocated as struct fanotify_path_event,
    but with a null path.

    Use a special event type to identify the overflow event, so the helper
    fanotify_has_event_path() will always indicate a non null path.

    Allocating the overflow event doesn't need any of the fancy stuff in
    fanotify_alloc_event(), so create a simplified helper for allocating the
    overflow event.

    There is also no need to store and report the pid with an overflow event.

    Link: https://lore.kernel.org/r/20200708111156.24659-7-amir73il@gmail.com
    Suggested-by: Jan Kara
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • inotify's event->wd is the object identifier.
    Compare that instead of the common fsnotidy event objectid, so
    we can get rid of the objectid field later.

    Link: https://lore.kernel.org/r/20200708111156.24659-6-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • When creating an FS_MODIFY event on inode itself (not on parent)
    the file_name argument should be NULL.

    The change to send a non NULL name to inode itself was done on purpuse
    as part of another commit, as Tejun writes: "...While at it, supply the
    target file name to fsnotify() from kernfs_node->name.".

    But this is wrong practice and inconsistent with inotify behavior when
    watching a single file. When a child is being watched (as opposed to the
    parent directory) the inotify event should contain the watch descriptor,
    but not the file name.

    Fixes: df6a58c5c5aa ("kernfs: don't depend on d_find_any_alias()...")
    Link: https://lore.kernel.org/r/20200708111156.24659-5-amir73il@gmail.com
    Acked-by: Tejun Heo
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • The inode argument to handle_event() is about to become obsolete.

    Link: https://lore.kernel.org/r/20200708111156.24659-4-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • Return non const inode pointer from fsnotify_data_inode().
    None of the fsnotify hooks pass const inode pointer as data and
    callers often need to cast to a non const pointer.

    Link: https://lore.kernel.org/r/20200708111156.24659-3-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • All (two) callers of fsnotify_parent() also call fsnotify() to notify
    the child inode. Move the second fsnotify() call into fsnotify_parent().

    This will allow more flexibility in making decisions about which of the
    two event falvors should be sent.

    Using 'goto notify_child' in the inline helper seems a bit strange, but
    it mimics the code in __fsnotify_parent() for clarity and the goto
    pattern will become less strage after following patches are applied.

    Link: https://lore.kernel.org/r/20200708111156.24659-2-amir73il@gmail.com
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Amir Goldstein
     
  • The fsnotify paths are trivial to hit even when there are no watchers and
    they are surprisingly expensive. For example, every successful vfs_write()
    hits fsnotify_modify which calls both fsnotify_parent and fsnotify unless
    FMODE_NONOTIFY is set which is an internal flag invisible to userspace.
    As it stands, fsnotify_parent is a guaranteed functional call even if there
    are no watchers and fsnotify() does a substantial amount of unnecessary
    work before it checks if there are any watchers. A perf profile showed
    that applying mnt->mnt_fsnotify_mask in fnotify() was almost half of the
    total samples taken in that function during a test. This patch rearranges
    the fast paths to reduce the amount of work done when there are no
    watchers.

    The test motivating this was "perf bench sched messaging --pipe". Despite
    the fact the pipes are anonymous, fsnotify is still called a lot and
    the overhead is noticeable even though it's completely pointless. It's
    likely the overhead is negligible for real IO so this is an extreme
    example. This is a comparison of hackbench using processes and pipes on
    a 1-socket machine with 8 CPU threads without fanotify watchers.

    5.7.0 5.7.0
    vanilla fastfsnotify-v1r1
    Amean 1 0.4837 ( 0.00%) 0.4630 * 4.27%*
    Amean 3 1.5447 ( 0.00%) 1.4557 ( 5.76%)
    Amean 5 2.6037 ( 0.00%) 2.4363 ( 6.43%)
    Amean 7 3.5987 ( 0.00%) 3.4757 ( 3.42%)
    Amean 12 5.8267 ( 0.00%) 5.6983 ( 2.20%)
    Amean 18 8.4400 ( 0.00%) 8.1327 ( 3.64%)
    Amean 24 11.0187 ( 0.00%) 10.0290 * 8.98%*
    Amean 30 13.1013 ( 0.00%) 12.8510 ( 1.91%)
    Amean 32 13.9190 ( 0.00%) 13.2410 ( 4.87%)

    5.7.0 5.7.0
    vanilla fastfsnotify-v1r1
    Duration User 157.05 152.79
    Duration System 1279.98 1219.32
    Duration Elapsed 182.81 174.52

    This is showing that the latencies are improved by roughly 2-9%. The
    variability is not shown but some of these results are within the noise
    as this workload heavily overloads the machine. That said, the system CPU
    usage is reduced by quite a bit so it makes sense to avoid the overhead
    even if it is a bit tricky to detect at times. A perf profile of just 1
    group of tasks showed that 5.14% of samples taken were in either fsnotify()
    or fsnotify_parent(). With the patch, 2.8% of samples were in fsnotify,
    mostly function entry and the initial check for watchers. The check for
    watchers is complicated enough that inlining it may be controversial.

    [Amir] Slightly simplify with mnt_or_sb_mask => marks_mask

    Link: https://lore.kernel.org/r/20200708111156.24659-1-amir73il@gmail.com
    Signed-off-by: Mel Gorman
    Signed-off-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Mel Gorman
     
  • When user provides large buffer for events and there are lots of events
    available, we can try to copy them all to userspace without scheduling
    which can softlockup the kernel (furthermore exacerbated by the
    contention on notification_lock). Add a scheduling point after copying
    each event.

    Note that usually the real underlying problem is the cost of fanotify
    event merging and the resulting contention on notification_lock but this
    is a cheap way to somewhat reduce the problem until we can properly
    address that.

    Reported-by: Francesco Ruggeri
    Link: https://lore.kernel.org/lkml/20200714025417.A25EB95C0339@us180.sjc.aristanetworks.com
    Reviewed-by: Amir Goldstein
    Signed-off-by: Jan Kara

    Jan Kara
     

09 Jul, 2020

3 commits

  • Update Documentation for the gcc v4.9 upgrade requirement.

    Fixes: 5429ef62bcf3 ("compiler/gcc: Raise minimum GCC version for kernel builds to 4.8")
    Fixes: 6ec4476ac825 ("Raise gcc version requirement to 4.9")
    Signed-off-by: Randy Dunlap
    Acked-by: Jonathan Corbet
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Pull sound fixes from Takashi Iwai:
    "A collection of small, mostly device-specific fixes.

    The significant one is the regression fix for USB-audio implicit
    feedback devices due to the incorrect frame size calculation, which
    landed in 5.8 and stable trees.

    In addition, a few usual HD-audio and USB-audio quirks, Intel HDMI
    fixes, ASoC fsl and rt5682 fixes, as well as the fix in
    compress-offload partial drain operation"

    * tag 'sound-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: compress: fix partial_drain completion state
    ALSA: usb-audio: Add implicit feedback quirk for RTX6001
    ALSA: usb-audio: add quirk for MacroSilicon MS2109
    ALSA: hda/realtek: Enable headset mic of Acer Veriton N4660G with ALC269VC
    ALSA: hda/realtek: Enable headset mic of Acer C20-820 with ALC269VC
    ALSA: hda/realtek - Enable audio jacks of Acer vCopperbox with ALC269VC
    ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk subdevice id
    ALSA: hda/hdmi: improve debug traces for stream lookups
    ALSA: hda/hdmi: fix failures at PCM open on Intel ICL and later
    ALSA: opl3: fix infoleak in opl3
    ALSA: usb-audio: Replace s/frame/packet/ where appropriate
    ALSA: usb-audio: Fix packet size calculation
    AsoC: amd: add missing snd- module prefix to the acp3x-rn driver kernel module
    ALSA: hda - let hs_mic be picked ahead of hp_mic
    ASoC: rt5682: fix the pop noise while OMTP type headset plugin
    ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable
    ASoC: fsl_mqs: Don't check clock is NULL before calling clk API

    Linus Torvalds
     
  • I realize that we fairly recently raised it to 4.8, but the fact is, 4.9
    is a much better minimum version to target.

    We have a number of workarounds for actual bugs in pre-4.9 gcc versions
    (including things like internal compiler errors on ARM), but we also
    have some syntactic workarounds for lacking features.

    In particular, raising the minimum to 4.9 means that we can now just
    assume _Generic() exists, which is likely the much better replacement
    for a lot of very convoluted built-time magic with conditionals on
    sizeof and/or __builtin_choose_expr() with same_type() etc.

    Using _Generic also means that you will need to have a very recent
    version of 'sparse', but thats easy to build yourself, and much less of
    a hassle than some old gcc version can be.

    The latest (in a long string) of reasons for minimum compiler version
    upgrades was commit 5435f73d5c4a ("efi/x86: Fix build with gcc 4").

    Ard points out that RHEL 7 uses gcc-4.8, but the people who stay back on
    old RHEL versions persumably also don't build their own kernels anyway.
    And maybe they should cross-built or just have a little side affair with
    a newer compiler?

    Acked-by: Ard Biesheuvel
    Acked-by: Peter Zijlstra
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

08 Jul, 2020

6 commits

  • Pull perf tooling fixes from Arnaldo Carvalho de Melo:

    - Intel PT fixes for PEBS-via-PT with registers

    - Fixes for Intel PT python based GUI

    - Avoid duplicated sideband events with Intel PT in system wide tracing

    - Remove needless 'dummy' event from TUI menu, used when synthesizing
    meta data events for pre-existing processes

    - Fix corner case segfault when pressing enter in a screen without
    entries in the TUI for report/top

    - Fixes for time stamp handling in libtraceevent

    - Explicitly set utf-8 encoding in perf flamegraph

    - Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy',
    silencing perf build warning

    * tag 'perf-tools-fixes-2020-07-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
    perf report TUI: Remove needless 'dummy' event from menu
    perf intel-pt: Fix PEBS sample for XMM registers
    perf intel-pt: Fix displaying PEBS-via-PT with registers
    perf intel-pt: Fix recording PEBS-via-PT with registers
    perf report TUI: Fix segmentation fault in perf_evsel__hists_browse()
    tools lib traceevent: Add proper KBUFFER_TYPE_TIME_STAMP handling
    tools lib traceevent: Add API to read time information from kbuffer
    perf scripts python: exported-sql-viewer.py: Fix time chart call tree
    perf scripts python: exported-sql-viewer.py: Fix zero id in call tree 'Find' result
    perf scripts python: exported-sql-viewer.py: Fix zero id in call graph 'Find' result
    perf scripts python: exported-sql-viewer.py: Fix unexpanded 'Find' result
    perf record: Fix duplicated sideband events with Intel PT system wide tracing
    perf scripts python: export-to-postgresql.py: Fix struct.pack() int argument
    tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy'
    perf flamegraph: Explicitly set utf-8 encoding

    Linus Torvalds
     
  • Pull MTD fixes from Miquel Raynal:
    "MTD:
    - Set a missing master partition panic write flag

    Raw NAND:
    - Fix build issue in the xway driver
    - Fix a wrong return code"

    * tag 'mtd/fixes-for-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
    mtd: rawnand: xway: Fix build issue
    mtd: set master partition panic write flag
    nandsim: Fix return code testing of ns_find_operation()

    Linus Torvalds
     
  • Pull btrfs fixes from David Sterba:

    - regression fix of a leak in global block reserve accounting

    - fix a (hard to hit) race of readahead vs releasepage that could lead
    to crash

    - convert all remaining uses of comment fall through annotations to the
    pseudo keyword

    - fix crash when mounting a fuzzed image with -o recovery

    * tag 'for-5.8-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
    btrfs: reset tree root pointer after error in init_tree_roots
    btrfs: fix reclaim_size counter leak after stealing from global reserve
    btrfs: fix fatal extent_buffer readahead vs releasepage race
    btrfs: convert comments to fallthrough annotations

    Linus Torvalds
     
  • Pull ARC fixes from Vineet Gupta:

    - User build systems to pass -mcpu

    - Fix potential EFA clobber in syscall handler

    - Fix ARCompact 2 levels of interrupts build

    - Detect newer HS CPU releases

    - misc other fixes

    * tag 'arc-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
    ARCv2: support loop buffer (LPB) disabling
    ARC: build: remove deprecated toggle for arc700 builds
    ARC: build: allow users to specify -mcpu
    ARCv2: boot log: detect newer/upconing HS3x/HS4x releases
    ARC: elf: use right ELF_ARCH
    ARC: [arcompact] fix bitrot with 2 levels of interrupt
    ARC: entry: fix potential EFA clobber when TIF_SYSCALL_TRACE

    Linus Torvalds
     
  • Pull tpm fix from Jarkko Sakkinen:
    "Revert commit e918e570415c ("tpm_tis: Remove the HID IFX0102").

    Removing IFX0102 from tpm_tis was not a right move because both
    tpm_tis and tpm_infineon use the same device ID.

    A real fix requires quirks added to both drivers. It can probably wait
    until v5.9 as the bug has existed since 2006"

    * tag 'tpmdd-next-v5.8-rc5' of git://git.infradead.org/users/jjs/linux-tpmdd:
    Revert commit e918e570415c ("tpm_tis: Remove the HID IFX0102")

    Linus Torvalds
     
  • This MIPS driver does not support COMPILE_TEST yet and failed to build
    under my radar.

    Replace 'mtd' chich is not defined in the scope of xway_nand_remove()
    by nand_to_mtd(chip). The mistake has been added in the long series
    dropping nand_release().

    Tested with a 7.3.0 MIPS GCC toolchain built with Buildroot.

    Fixes: 9fdd78f7bcda ("mtd: rawnand: xway: Stop using nand_release()")
    Reported-by: kernel test robot
    Signed-off-by: Miquel Raynal
    Link: https://lore.kernel.org/linux-mtd/20200626065511.16424-1-miquel.raynal@bootlin.com

    Miquel Raynal
     

07 Jul, 2020

14 commits

  • On partial_drain completion we should be in SNDRV_PCM_STATE_RUNNING
    state, so set that for partially draining streams in
    snd_compr_drain_notify() and use a flag for partially draining streams

    While at it, add locks for stream state change in
    snd_compr_drain_notify() as well.

    Fixes: f44f2a5417b2 ("ALSA: compress: fix drain calls blocking other compress functions (v6)")
    Reviewed-by: Srinivas Kandagatla
    Tested-by: Srinivas Kandagatla
    Reviewed-by: Charles Keepax
    Tested-by: Charles Keepax
    Signed-off-by: Vinod Koul
    Link: https://lore.kernel.org/r/20200629134737.105993-4-vkoul@kernel.org
    Signed-off-by: Takashi Iwai

    Vinod Koul
     
  • USB Audio analyzer RTX6001 uses the same implicit feedback quirk
    as other XMOS-based devices.

    Signed-off-by: Pavel Hofman
    Tested-by: Pavel Hofman
    Cc:
    Link: https://lore.kernel.org/r/822f0f20-1886-6884-a6b2-d11c685cbafa@ivitera.com
    Signed-off-by: Takashi Iwai

    Pavel Hofman
     
  • These devices claim to be 96kHz mono, but actually are 48kHz stereo with
    swapped channels and unaligned transfers.

    Cc: stable@vger.kernel.org
    Signed-off-by: Hector Martin
    Link: https://lore.kernel.org/r/20200702071433.237843-1-marcan@marcan.st
    Signed-off-by: Takashi Iwai

    Hector Martin
     
  • The Acer Veriton N4660G desktop's audio (1025:1248) with ALC269VC cannot
    detect the headset microphone until ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE
    quirk maps the NID 0x18 as the headset mic pin.

    Signed-off-by: Jian-Hong Pan
    Cc:
    Link: https://lore.kernel.org/r/20200706071826.39726-3-jian-hong@endlessm.com
    Signed-off-by: Takashi Iwai

    Jian-Hong Pan
     
  • The Acer Aspire C20-820 AIO's audio (1025:1065) with ALC269VC can't
    detect the headset microphone until ALC269VC_FIXUP_ACER_HEADSET_MIC
    quirk maps the NID 0x18 as the headset mic pin.

    Signed-off-by: Jian-Hong Pan
    Signed-off-by: Daniel Drake
    Cc:
    Link: https://lore.kernel.org/r/20200706071826.39726-2-jian-hong@endlessm.com
    Signed-off-by: Takashi Iwai

    Jian-Hong Pan
     
  • The Acer desktop vCopperbox with ALC269VC cannot detect the MIC of
    headset, the line out and internal speaker until
    ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS quirk applied.

    Signed-off-by: Jian-Hong Pan
    Signed-off-by: Chris Chiu
    Cc:
    Link: https://lore.kernel.org/r/20200706071826.39726-1-jian-hong@endlessm.com
    Signed-off-by: Takashi Iwai

    Jian-Hong Pan
     
  • 1)
    In snd_hda_pick_fixup(), quirks are first matched by PCI SSID and then, if
    there is no match, by codec SSID. The Lenovo "ThinkPad X1 Carbon 7th" has
    an audio chip with PCI SSID 0x2292 and codec SSID 0x2293[1]. Therefore, fix
    the quirk meant for that device to match on .subdevice == 0x2292.

    2)
    The "Thinkpad X1 Yoga 7th" does not exist. The companion product to the
    Carbon 7th is the Yoga 4th. That device has an audio chip with PCI SSID
    0x2292 and codec SSID 0x2292[2]. Given the behavior of
    snd_hda_pick_fixup(), it is not possible to have a separate quirk for the
    Yoga based on SSID. Therefore, merge the quirks meant for the Carbon and
    Yoga. This preserves the current behavior for the Yoga.

    [1] This is the case on my own machine and can also be checked here
    https://github.com/linuxhw/LsPCI/tree/master/Notebook/Lenovo/ThinkPad
    https://gist.github.com/hamidzr/dd81e429dc86f4327ded7a2030e7d7d9#gistcomment-3225701
    [2]
    https://github.com/linuxhw/LsPCI/tree/master/Convertible/Lenovo/ThinkPad
    https://gist.github.com/hamidzr/dd81e429dc86f4327ded7a2030e7d7d9#gistcomment-3176355

    Fixes: d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen")
    Fixes: 54a6a7dc107d ("ALSA: hda/realtek - Add quirk for the bass speaker on Lenovo Yoga X1 7th gen")
    Cc: Jaroslav Kysela
    Cc: Kailang Yang
    Tested-by: Vincent Bernat
    Tested-by: Even Brenden
    Signed-off-by: Benjamin Poirier
    Cc:
    Link: https://lore.kernel.org/r/20200703080005.8942-2-benjamin.poirier@gmail.com
    Signed-off-by: Takashi Iwai

    Benjamin Poirier
     
  • The HDMI codec driver has two debug traces printed from different
    functions but with identical message content:

    "HDMI: hinfo 000000006a6b84d9 not registered"

    Fix this duplication and also add a bit more context in addition to raw
    object pointer, to help analysis of kernel logs.

    Reviewed-by: Ranjani Sridharan
    Reviewed-by: Pierre-Louis Bossart
    Signed-off-by: Kai Vehmanen
    Link: https://lore.kernel.org/r/20200703153818.2808592-2-kai.vehmanen@linux.intel.com
    Signed-off-by: Takashi Iwai

    Kai Vehmanen
     
  • When HDMI PCM devices are opened in a specific order, with at least one
    HDMI/DP receiver connected, ALSA PCM open fails to -EBUSY on the
    connected monitor, on recent Intel platforms (ICL/JSL and newer). While
    this is not a typical sequence, at least Pulseaudio does this every time
    when it is started, to discover the available PCMs.

    The rootcause is an invalid assumption in hdmi_add_pin(), where the
    total number of converters is assumed to be known at the time the
    function is called. On older Intel platforms this held true, but after
    ICL/JSL, the order how pins and converters are in the subnode list as
    returned by snd_hda_get_sub_nodes(), was changed. As a result,
    information for some converters was not stored to per_pin->mux_nids.
    And this means some pins cannot be connected to all converters, and
    application instead gets -EBUSY instead at open.

    The assumption that converters are always before pins in the subnode
    list, is not really a valid one. Fix the problem in hdmi_parse_codec()
    by introducing separate loops for discovering converters and pins.

    BugLink: https://github.com/thesofproject/linux/issues/1978
    BugLink: https://github.com/thesofproject/linux/issues/2216
    BugLink: https://github.com/thesofproject/linux/issues/2217
    Reviewed-by: Ranjani Sridharan
    Reviewed-by: Pierre-Louis Bossart
    Signed-off-by: Kai Vehmanen
    Link: https://lore.kernel.org/r/20200703153818.2808592-1-kai.vehmanen@linux.intel.com
    Signed-off-by: Takashi Iwai

    Kai Vehmanen
     
  • The stack object “info” in snd_opl3_ioctl() has a leaking problem.
    It has 2 padding bytes which are not initialized and leaked via
    “copy_to_user”.

    Signed-off-by: xidongwang
    Cc:
    Link: https://lore.kernel.org/r/1594006058-30362-1-git-send-email-wangxidong_97@163.com
    Signed-off-by: Takashi Iwai

    xidongwang
     
  • Removing IFX0102 from tpm_tis was not a right move because both tpm_tis
    and tpm_infineon use the same device ID. Revert the commit and add a
    remark about a bug caused by commit 93e1b7d42e1e ("[PATCH] tpm: add HID
    module parameter").

    Fixes: e918e570415c ("tpm_tis: Remove the HID IFX0102")
    Reported-by: Peter Huewe
    Reviewed-by: Jerry Snitselaar
    Signed-off-by: Jarkko Sakkinen

    Jarkko Sakkinen
     
  • Pull kvm fixes from Paolo Bonzini:
    "Bugfixes and a one-liner patch to silence a sparse warning"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM: arm64: Stop clobbering x0 for HVC_SOFT_RESTART
    KVM: arm64: PMU: Fix per-CPU access in preemptible context
    KVM: VMX: Use KVM_POSSIBLE_CR*_GUEST_BITS to initialize guest/host masks
    KVM: x86: Mark CR4.TSD as being possibly owned by the guest
    KVM: x86: Inject #GP if guest attempts to toggle CR4.LA57 in 64-bit mode
    kvm: use more precise cast and do not drop __user
    KVM: x86: bit 8 of non-leaf PDPEs is not reserved
    KVM: X86: Fix async pf caused null-ptr-deref
    KVM: arm64: vgic-v4: Plug race between non-residency and v4.1 doorbell
    KVM: arm64: pvtime: Ensure task delay accounting is enabled
    KVM: arm64: Fix kvm_reset_vcpu() return code being incorrect with SVE
    KVM: arm64: Annotate hyp NMI-related functions as __always_inline
    KVM: s390: reduce number of IO pins to 1

    Linus Torvalds
     
  • Pull s390 fixes from Heiko Carstens:

    - Initialize jump labels before early command line parsing in order to
    make init_on_alloc and init_on_free options work

    - Fix vfio-ccw build error due to missing include

    - Prevent callchain data collection with hardware sampling, since the
    callchains simply do not exist

    - Prevent multiple registrations of the same zPCI function

    - Update defconfigs

    * tag 's390-5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    vfio-ccw: Fix a build error due to missing include of linux/slab.h
    s390: update defconfigs
    s390/cpum_sf: prohibit callchain data collection
    s390/setup: init jump labels before command line parsing
    s390/maccess: add no DAT mode to kernel_write
    s390/pci: fix enabling a reserved PCI function

    Linus Torvalds
     
  • …kvmarm/kvmarm into kvm-master

    KVM/arm fixes for 5.8, take #3

    - Disable preemption on context-switching PMU EL0 state happening
    on system register trap
    - Don't clobber X0 when tearing down KVM via a soft reset (kexec)

    Paolo Bonzini