1. 07 May, 2019 1 commit
    • Kailang Yang's avatar
      ALSA: hda/realtek - Support low power consumption for ALC295 · d3ba58bb
      Kailang Yang authored
      Enter to close more power control widgets at suspend.
      Remove hp_pin check. Add the default pin 0x21 as headphone.
      Supported low power consumption, it must do depop procedure when
      headset jack was plugged or unplugged.
      So, alc225_init() and alc225_shutup() must run delay when headset
      jack was plugged or unplugged.
      If depop procedure not run with delay, it will have a chance to let
      power consumption raise high.
      
      [ A few compile fixes by tiwai ]
      
      Fixes: 8983eb60 ("ALSA: hda/realtek - Move to ACT_INIT state")
      Signed-off-by: default avatarKailang Yang <kailang@realtek.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d3ba58bb
  2. 06 May, 2019 9 commits
    • Hui Wang's avatar
      ALSA: hda/hdmi - Consider eld_valid when reporting jack event · 7f641e26
      Hui Wang authored
      On the machines with AMD GPU or Nvidia GPU, we often meet this issue:
      after s3, there are 4 HDMI/DP audio devices in the gnome-sound-setting
      even there is no any monitors plugged.
      
      When this problem happens, we check the /proc/asound/cardX/eld#N.M, we
      will find the monitor_present=1, eld_valid=0.
      
      The root cause is BIOS or GPU driver makes the PRESENCE valid even no
      monitor plugged, and of course the driver will not get the valid
      eld_data subsequently.
      
      In this situation, we should not report the jack_plugged event, to do
      so, let us change the function hdmi_present_sense_via_verbs(). In this
      function, it reads the pin_sense via snd_hda_pin_sense(), after
      calling this function, the jack_dirty is 0, and before exiting
      via_verbs(), we change the shadow pin_sense according to both
      monitor_present and eld_valid, then in the snd_hda_jack_report_sync(),
      since the jack_dirty is still 0, it will report jack event according
      to this modified shadow pin_sense.
      
      After this change, the driver will not report Jack_is_plugged event
      through hdmi_present_sense_via_verbs() if monitor_present is 1 and
      eld_valid is 0.
      Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7f641e26
    • Hui Wang's avatar
      ALSA: hda/hdmi - Read the pin sense from register when repolling · 8c2e6728
      Hui Wang authored
      The driver will check the monitor presence when resuming from suspend,
      starting poll or interrupt triggers. In these 3 situations, the
      jack_dirty will be set to 1 first, then the hda_jack.c reads the
      pin_sense from register, after reading the register, the jack_dirty
      will be set to 0. But hdmi_repoll_work() is enabled in these 3
      situations, It will read the pin_sense a couple of times subsequently,
      since the jack_dirty is 0 now, It does not read the register anymore,
      instead it uses the shadow pin_sense which is read at the first time.
      
      It is meaningless to check the shadow pin_sense a couple of times,
      we need to read the register to check the real plugging state, so
      we set the jack_dirty to 1 in the hdmi_repoll_work().
      Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8c2e6728
    • Takashi Iwai's avatar
      Merge tag 'asoc-v5.2' of... · d8164551
      Takashi Iwai authored
      Merge tag 'asoc-v5.2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Updates for v5.2
      
      This is a pretty huge set of changes, it's been a pretty active release
      all round but the big thing with this release is the Sound Open Firmware
      changes from Intel, providing another DSP framework for use with the
      DSPs in their SoCs.  This one works with the firmware of the same name
      which is free software (unlike the previous DSP firmwares and framework)
      and there has been some interest in adoption by other systems already so
      hopefully we will see adoption by other vendors in the future.
      
      Other highlights include:
      
       - Support for MCLK/sample rate ratio setting in the generic cards.
       - Support for pin switches in the generic cards.
       - A big set of improvements to the TLV320AIC32x4 drivers from Annaliese
         McDermond.
       - New drivers for Freescale audio mixers, several Intel machines,
         several Mediatek machines, Meson G12A, Sound Open Firmware and
         Spreadtrum compressed audio and DMA devices.
      d8164551
    • Mark Brown's avatar
      Merge branch 'asoc-5.2' into asoc-next · 378d590c
      Mark Brown authored
      378d590c
    • Mark Brown's avatar
      Merge branch 'asoc-5.1' into asoc-linus · 7f5a466f
      Mark Brown authored
      7f5a466f
    • Baolin Wang's avatar
      ASoC: sprd: Add reserved DMA memory support · 1587a061
      Baolin Wang authored
      For Spreadtrum audio platform driver, it need allocate a larger DMA buffer
      dynamically to copy audio data between userspace and kernel space, but that
      will increase the risk of memory allocation failure especially the system
      is under heavy load situation.
      
      To make sure the audio can work in this scenario, we usually reserve one
      region of memory to be used as a shared pool of DMA buffers for the
      platform component. So add of_reserved_mem_device_init_by_idx() function
      to initialize the shared pool of DMA buffers to be used by the platform
      component.
      Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      1587a061
    • Dan Carpenter's avatar
      ALSA: synth: emux: soundfont.c: divide by zero in calc_gus_envelope_time() · 2854cd34
      Dan Carpenter authored
      This function is called from load_guspatch() and the rate is specified
      by the user.  If they accidentally selected zero then it would crash the
      kernel.  I've just changed the zero to a one.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2854cd34
    • Takashi Iwai's avatar
      Merge branch 'for-linus' into for-next · 17b89c80
      Takashi Iwai authored
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      17b89c80
    • Linus Torvalds's avatar
      Linux 5.1 · e93c9c99
      Linus Torvalds authored
      e93c9c99
  3. 05 May, 2019 5 commits
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7178fb0b
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "I'd like to apologize for this very late pull request: I was dithering
        through the week whether to send the fixes, and then yesterday Jiri's
        crash fix for a regression introduced in this cycle clearly marked
        perf/urgent as 'must merge now'.
      
        Most of the commits are tooling fixes, plus there's three kernel fixes
        via four commits:
      
          - race fix in the Intel PEBS code
      
          - fix an AUX bug and roll back a previous attempt
      
          - fix AMD family 17h generic HW cache-event perf counters
      
        The largest diffstat contribution comes from the AMD fix - a new event
        table is introduced, which is a fairly low risk change but has a large
        linecount"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel: Fix race in intel_pmu_disable_event()
        perf/x86/intel/pt: Remove software double buffering PMU capability
        perf/ring_buffer: Fix AUX software double buffering
        perf tools: Remove needless asm/unistd.h include fixing build in some places
        tools arch uapi: Copy missing unistd.h headers for arc, hexagon and riscv
        tools build: Add -ldl to the disassembler-four-args feature test
        perf cs-etm: Always allocate memory for cs_etm_queue::prev_packet
        perf cs-etm: Don't check cs_etm_queue::prev_packet validity
        perf report: Report OOM in status line in the GTK UI
        perf bench numa: Add define for RUSAGE_THREAD if not present
        tools lib traceevent: Change tag string for error
        perf annotate: Fix build on 32 bit for BPF annotation
        tools uapi x86: Sync vmx.h with the kernel
        perf bpf: Return value with unlocking in perf_env__find_btf()
        MAINTAINERS: Include vendor specific files under arch/*/events/*
        perf/x86/amd: Update generic hardware cache events for Family 17h
      7178fb0b
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 70c9fb57
      Linus Torvalds authored
      Pull scheduler fix from Ingo Molnar:
       "Fix a kobject memory leak in the cpufreq code"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/cpufreq: Fix kobject memleak
      70c9fb57
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 13369e83
      Linus Torvalds authored
      Pull x86 fix from Ingo Molnar:
       "Disable function tracing during early SME setup to fix a boot crash on
        SME-enabled kernels running distro kernels (some of which have
        function tracing enabled)"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm/mem_encrypt: Disable all instrumentation for early SME setup
      13369e83
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 51987aff
      Linus Torvalds authored
      Pull vfs fixes from Al Viro:
      
       - a couple of ->i_link use-after-free fixes
      
       - regression fix for wrong errno on absent device name in mount(2)
         (this cycle stuff)
      
       - ancient UFS braino in large GID handling on Solaris UFS images (bogus
         cut'n'paste from large UID handling; wrong field checked to decide
         whether we should look at old (16bit) or new (32bit) field)
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        ufs: fix braino in ufs_get_inode_gid() for solaris UFS flavour
        Abort file_remove_privs() for non-reg. files
        [fix] get rid of checking for absent device name in vfs_get_tree()
        apparmorfs: fix use-after-free on symlink traversal
        securityfs: fix use-after-free on symlink traversal
      51987aff
    • Jiri Olsa's avatar
      perf/x86/intel: Fix race in intel_pmu_disable_event() · 6f55967a
      Jiri Olsa authored
      New race in x86_pmu_stop() was introduced by replacing the
      atomic __test_and_clear_bit() of cpuc->active_mask by separate
      test_bit() and __clear_bit() calls in the following commit:
      
        3966c3fe ("x86/perf/amd: Remove need to check "running" bit in NMI handler")
      
      The race causes panic for PEBS events with enabled callchains:
      
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
        ...
        RIP: 0010:perf_prepare_sample+0x8c/0x530
        Call Trace:
         <NMI>
         perf_event_output_forward+0x2a/0x80
         __perf_event_overflow+0x51/0xe0
         handle_pmi_common+0x19e/0x240
         intel_pmu_handle_irq+0xad/0x170
         perf_event_nmi_handler+0x2e/0x50
         nmi_handle+0x69/0x110
         default_do_nmi+0x3e/0x100
         do_nmi+0x11a/0x180
         end_repeat_nmi+0x16/0x1a
        RIP: 0010:native_write_msr+0x6/0x20
        ...
         </NMI>
         intel_pmu_disable_event+0x98/0xf0
         x86_pmu_stop+0x6e/0xb0
         x86_pmu_del+0x46/0x140
         event_sched_out.isra.97+0x7e/0x160
        ...
      
      The event is configured to make samples from PEBS drain code,
      but when it's disabled, we'll go through NMI path instead,
      where data->callchain will not get allocated and we'll crash:
      
                x86_pmu_stop
                  test_bit(hwc->idx, cpuc->active_mask)
                  intel_pmu_disable_event(event)
                  {
                    ...
                    intel_pmu_pebs_disable(event);
                    ...
      
      EVENT OVERFLOW ->  <NMI>
                           intel_pmu_handle_irq
                             handle_pmi_common
         TEST PASSES ->        test_bit(bit, cpuc->active_mask))
                                 perf_event_overflow
                                   perf_prepare_sample
                                   {
                                     ...
                                     if (!(sample_type & __PERF_SAMPLE_CALLCHAIN_EARLY))
                                           data->callchain = perf_callchain(event, regs);
      
               CRASH ->              size += data->callchain->nr;
                                   }
                         </NMI>
                    ...
                    x86_pmu_disable_event(event)
                  }
      
                  __clear_bit(hwc->idx, cpuc->active_mask);
      
      Fixing this by disabling the event itself before setting
      off the PEBS bit.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Arcari <darcari@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Lendacky Thomas <Thomas.Lendacky@amd.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Fixes: 3966c3fe ("x86/perf/amd: Remove need to check "running" bit in NMI handler")
      Link: http://lkml.kernel.org/r/20190504151556.31031-1-jolsa@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      6f55967a
  4. 04 May, 2019 1 commit
  5. 03 May, 2019 24 commits