17 Apr, 2019
1 commit
-
commit 8f71370f4b02730e8c27faf460af7a3586e24e1f upstream.
If codec registration fails after the ASoC Intel SST driver has been probed,
the kernel will Oops and crash at suspend/resume.general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 PID: 2811 Comm: cat Tainted: G W 4.19.30 #15
Hardware name: GOOGLE Clapper, BIOS Google_Clapper.5216.199.7 08/22/2014
RIP: 0010:snd_soc_suspend+0x5a/0xd21
Code: 03 80 3c 10 00 49 89 d7 74 0b 48 89 df e8 71 72 c4 fe 4c 89
fa 48 8b 03 48 89 45 d0 48 8d 98 a0 01 00 00 48 89 d8 48 c1 e8 03
04 10 84 c0 0f 85 85 0c 00 00 80 3b 00 0f 84 6b 0c 00 00 48 8b
RSP: 0018:ffff888035407750 EFLAGS: 00010202
RAX: 0000000000000034 RBX: 00000000000001a0 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000008 RDI: ffff88805c417098
RBP: ffff8880354077b0 R08: dffffc0000000000 R09: ffffed100b975718
R10: 0000000000000001 R11: ffffffff949ea4a3 R12: 1ffff1100b975746
R13: dffffc0000000000 R14: ffff88805cba4588 R15: dffffc0000000000
FS: 0000794a78e91b80(0000) GS:ffff888068d00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007bd5283ccf58 CR3: 000000004b7aa000 CR4: 00000000001006e0
Call Trace:
? dpm_complete+0x67b/0x67b
? i915_gem_suspend+0x14d/0x1ad
sst_soc_prepare+0x91/0x1dd
? sst_be_hw_params+0x7e/0x7e
dpm_prepare+0x39a/0x88b
dpm_suspend_start+0x13/0x9d
suspend_devices_and_enter+0x18f/0xbd7
? arch_suspend_enable_irqs+0x11/0x11
? printk+0xd9/0x12d
? lock_release+0x95f/0x95f
? log_buf_vmcoreinfo_setup+0x131/0x131
? rcu_read_lock_sched_held+0x140/0x22a
? __bpf_trace_rcu_utilization+0xa/0xa
? __pm_pr_dbg+0x186/0x190
? pm_notifier_call_chain+0x39/0x39
? suspend_test+0x9d/0x9d
pm_suspend+0x2f4/0x728
? trace_suspend_resume+0x3da/0x3da
? lock_release+0x95f/0x95f
? kernfs_fop_write+0x19f/0x32d
state_store+0xd8/0x147
? sysfs_kf_read+0x155/0x155
kernfs_fop_write+0x23e/0x32d
__vfs_write+0x108/0x608
? vfs_read+0x2e9/0x2e9
? rcu_read_lock_sched_held+0x140/0x22a
? __bpf_trace_rcu_utilization+0xa/0xa
? debug_smp_processor_id+0x10/0x10
? selinux_file_permission+0x1c5/0x3c8
? rcu_sync_lockdep_assert+0x6a/0xad
? __sb_start_write+0x129/0x2ac
vfs_write+0x1aa/0x434
ksys_write+0xfe/0x1be
? __ia32_sys_read+0x82/0x82
do_syscall_64+0xcd/0x120
entry_SYSCALL_64_after_hwframe+0x49/0xbeIn the observed situation, the problem is seen because the codec driver
failed to probe due to a hardware problem.max98090 i2c-193C9890:00: Failed to read device revision: -1
max98090 i2c-193C9890:00: ASoC: failed to probe component -1
cht-bsw-max98090 cht-bsw-max98090: ASoC: failed to instantiate card -1
cht-bsw-max98090 cht-bsw-max98090: snd_soc_register_card failed -1
cht-bsw-max98090: probe of cht-bsw-max98090 failed with error -1The problem is similar to the problem solved with commit 2fc995a87f2e
("ASoC: intel: Fix crash at suspend/resume without card registration"),
but codec registration fails at a later point. At that time, the pointer
checked with the above mentioned commit is already set, but it is not
cleared if the device is subsequently removed. Adding a remove function
to clear the pointer fixes the problem.Cc: stable@vger.kernel.org
Cc: Jarkko Nikula
Cc: Curtis Malainey
Signed-off-by: Guenter Roeck
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman
06 Mar, 2019
1 commit
-
[ Upstream commit 906a9abc5de73c383af518f5a806f4be2993a0c7 ]
For some reason this field was set to zero when all other drivers use
.dynamic = 1 for front-ends. This change was tested on Dell XPS13 and
has no impact with the existing legacy driver. The SOF driver also works
with this change which enables it to override the fixed topology.Signed-off-by: Rander Wang
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
Signed-off-by: Sasha Levin
13 Feb, 2019
1 commit
-
[ Upstream commit 1539c7f23f256120f89f8b9ec53160790bce9ed2 ]
Randconfig testing revealed a very old bug, with gcc-8:
sound/soc/intel/atom/sst/sst_loader.c: In function 'sst_load_fw':
sound/soc/intel/atom/sst/sst_loader.c:357:5: error: 'fw' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (fw == NULL) {
^
sound/soc/intel/atom/sst/sst_loader.c:354:25: note: 'fw' was declared here
const struct firmware *fw;We must check the return code of request_firmware() before we look at the
pointer result that may be uninitialized when the function fails.Fixes: 9012c9544eea ("ASoC: Intel: mrfld - Add DSP load and management")
Signed-off-by: Arnd Bergmann
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
Signed-off-by: Sasha Levin
31 Jan, 2019
1 commit
-
commit 44fabd8cdaaa3acb80ad2bb3b5c61ae2136af661 upstream.
snd_pcm_lib_malloc_pages() may fail, so let's check its status and
return its error code upstream.Signed-off-by: Kangjie Lu
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman
10 Jan, 2019
2 commits
-
commit 94ea56cff506c769a509c5dd87904c7fe3806a81 upstream.
The Gnawty model Chromebook uses pmc_plt_clk_0 instead of pmc_plt_clk_3
for the mclk, just like the Clapper and Swanky models.This commit adds a DMI based quirk for this.
This fixing audio no longer working on these devices after
commit 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
that commit fixes us unnecessary keeping unused clocks on, but in case of
the Gnawty that was breaking audio support since we were not using the
right clock in the cht_bsw_max98090_ti machine driver.BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=201787
Cc: stable@vger.kernel.org
Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
Reported-and-tested-by: Jaime Pérez
Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman -
commit 984bfb398a3af6fa9b7e80165e524933b0616686 upstream.
The Clapper model Chromebook uses pmc_plt_clk_0 instead of pmc_plt_clk_3
for the mclk, just like the Swanky model.This commit adds a DMI based quirk for this.
This fixing audio no longer working on these devices after
commit 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
that commit fixes us unnecessary keeping unused clocks on, but in case of
the Clapper that was breaking audio support since we were not using the
right clock in the cht_bsw_max98090_ti machine driver.Cc: stable@vger.kernel.org
Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman
17 Dec, 2018
1 commit
-
[ Upstream commit 4c10473d6ddf12ec124c9ff71a5d23bb5388478b ]
On certain platforms, Display HDMI HDA codec was not going to sleep state
after the use when links are powered down after turning off the display
power. As per the HW recommendation, links are powered down before turning
off the display power to ensure that the codec goes to sleep state.This patch was updated from an earlier version submitted upstream [1]
which conflicted with the changes merged for HDaudio codec support
with the Intel DSP.[1] https://patchwork.kernel.org/patch/10540213/
Signed-off-by: Sriram Periyasamy
Signed-off-by: Sanyog Kale
Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
Signed-off-by: Sasha Levin
06 Dec, 2018
1 commit
-
commit a182ecd3809c8d5a2da80c520f3602e301c5317e upstream.
Some boards such as the Swanky model Chromebooks use pmc_plt_clk_0 for the
mclk instead of pmc_plt_clk_3.This commit adds a DMI based quirk for this.
This fixing audio no longer working on these devices after
commit 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
that commit fixes us unnecessary keeping unused clocks on, but in case
of the Swanky that was breaking audio support since we were not using
the right clock in the cht_bsw_max98090_ti machine driver.Cc: stable@vger.kernel.org
Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL")
Reported-and-tested-by: Dean Wallace
Signed-off-by: Hans de Goede
Signed-off-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman
14 Nov, 2018
1 commit
-
commit 9c80c5a8831471e0a3e139aad1b0d4c0fdc50b2f upstream.
skl_tplg_get_token() misses a break in the big switch() block for
SKL_TKN_U8_CORE_ID entry.
Spotted nicely by -Wimplicit-fallthrough compiler option.Fixes: 6277e83292a2 ("ASoC: Intel: Skylake: Parse vendor tokens to build module data")
Cc:
Signed-off-by: Takashi Iwai
Signed-off-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman
18 Sep, 2018
1 commit
-
…oonie/sound into for-linus
ASoC: Fixes for v4.19
This is the usual set of small fixes scatterd around various drivers,
plus one fix for DAPM and a UAPI build fix. There's not a huge amount
that stands out here relative to anything else.
12 Sep, 2018
2 commits
-
Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
1) sets bus->chip_init to prevent multiple entrances before device
is stopped; 2) enables interrupt.We shouldn't use it for the purpose of resetting device only because
1) when we really want to initialize device, we won't be able to do
so; 2) we are ready to handle interrupt yet, and kernel crashes when
interrupt comes in.Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
device properly.Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe")
Reviewed-by: Takashi Iwai
Signed-off-by: Yu Zhao
Signed-off-by: Mark Brown -
This reverts commit 12eeeb4f4733bbc4481d01df35933fc15beb8b19.
The patch doesn't fix accessing memory with null pointer in
skl_interrupt().There are two problems: 1) skl_init_chip() is called twice, before
and after dma buffer is allocate. The first call sets bus->chip_init
which prevents the second from initializing bus->corb.buf and
rirb.buf from bus->rb.area. 2) snd_hdac_bus_init_chip() enables
interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers.
There is a small window which skl_interrupt() can be called if irq
has been acquired. If so, it crashes when using null dma buffer
pointers.Will fix the problems in the following patches. Also attaching the
crash for future reference.[ 16.949148] general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI
[ 16.950903] Call Trace:
[ 16.950906]
[ 16.950918] skl_interrupt+0x19e/0x2d6 [snd_soc_skl]
[ 16.950926] ? dma_supported+0xb5/0xb5 [snd_soc_skl]
[ 16.950933] __handle_irq_event_percpu+0x27a/0x6c8
[ 16.950937] ? __irq_wake_thread+0x1d1/0x1d1
[ 16.950942] ? __do_softirq+0x57a/0x69e
[ 16.950944] handle_irq_event_percpu+0x95/0x1ba
[ 16.950948] ? _raw_spin_unlock+0x65/0xdc
[ 16.950951] ? __handle_irq_event_percpu+0x6c8/0x6c8
[ 16.950953] ? _raw_spin_unlock+0x65/0xdc
[ 16.950957] ? time_cpufreq_notifier+0x483/0x483
[ 16.950959] handle_irq_event+0x89/0x123
[ 16.950962] handle_fasteoi_irq+0x16f/0x425
[ 16.950965] handle_irq+0x1fe/0x28e
[ 16.950969] do_IRQ+0x6e/0x12e
[ 16.950972] common_interrupt+0x7a/0x7a
[ 16.950974][ 16.951031] RIP: snd_hdac_bus_update_rirb+0x19b/0x4cf [snd_hda_core] RSP: ffff88015c807c08
[ 16.951036] ---[ end trace 58bf9ece1775bc92 ]---Fixes: 2eeeb4f4733b ("ASoC: Intel: Skylake: Acquire irq after RIRB allocation")
Signed-off-by: Yu Zhao
Signed-off-by: Mark Brown
24 Aug, 2018
1 commit
-
Also add these typos to spelling.txt so checkpatch.pl will look for them.
Link: http://lkml.kernel.org/r/88af06b9de34d870cb0afc46cfd24e0458be2575.1529471371.git.fthain@telegraphics.com.au
Signed-off-by: Finn Thain
Cc: Masahiro Yamada
Cc: Joe Perches
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
14 Aug, 2018
2 commits
-
Cold reboot stress test found that the hda irq could access rirb ring
buffer before its memory gets allocated which resulting in null
pointer dereference inside snd_hdac_bus_update_rirb().Fix it by moving the skl_acquire_irq after ring buffer allocation.
While here, also change err return from -EBUSY to actual error code.Signed-off-by: Yong Zhi
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
Add quirks to select the right input-map, jack-detect pin, etc. for:
Linx Linx7 tablet
Onda V975w tabletSigned-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
03 Aug, 2018
1 commit
-
The refcap capture device supports mono recording only, this patch
adds the channel constraints.Signed-off-by: Yong Zhi
Reviewed-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
01 Aug, 2018
1 commit
-
…/kernel/git/tiwai/sound into asoc-4.19
27 Jul, 2018
1 commit
-
As sparse warns, the PCM format type can't be dealt as integer as
found in Intel SST driver codes.Fix them in the following two ways:
- The open code with snd_mask_set() and params->masks reference is
replaced with params_set_format()- The rest codes with snd_mask_set(fmt, SNDRV_PCM_FORMAT_XXX) are
replaced with the new helper, snd_mask_set_format().Reported-by: Pierre-Louis Bossart
Signed-off-by: Takashi Iwai
Signed-off-by: Mark Brown
26 Jul, 2018
6 commits
-
include DAPM Mux and output widgets into the list.
Signed-off-by: Rakesh Ughreja
Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
This looks like a copy/paste issue, but clearly there is an inversion
that is obvious when checking the arguments.Detected with Sparse - now that we have fewer warnings this one was
easy to find.Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
Simplify code and add relevant casts to make Sparse warnings go away
Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
sst_dma_new and sst_dma_free are not used in any other file and don't
have a prototype. Move to static functions and remove
EXPORT_SYMBOL_GPL statement.Reported by sparse warnings.
Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
Make sure definitions are consistent with usage.
Detected with Sparse.Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
Make all Sparse warnings go away by using le16/32_to_cpu.
Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
20 Jul, 2018
1 commit
-
Add a quirk for the "Connect Tablet 9" tablet, this tablet has a
mono-speaker. Otherwise it works fine with the defaults.Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
19 Jul, 2018
5 commits
-
Add quirk table entries for the following tablets:
ITWorks TW701
Ployer Momo7w
Trekstor win7
Yours 8"These all use the default settings, except that they only have a single
speaker and thus need the mono-speaker quirk.Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
During my initial round of bytcr_rt5651 long-name patches I did not include
a difference for mono vs stereo speaker setups in the longname because it
seems that all 5651 devices with only a single speaker do some mixing of
left + right on the PCB.However further testing has shown that while this works great when only
playing audio on the left or right channel, the output becomes garbled
when using both channels at once. Something which does not happen when
using the Stereo DAC MIXL / MIXR switches to mix the channels together
inside the codec and then only outputting on a single channel.So we need to have separate UCM profiles and thus separate long-names
for devices with a mono speaker vs stereo speakers. Just as we already
have for the bytcr_rt5640 case.This commit adds a new BYT_RT5651_MONO_SPEAKER quirk and adds "stereo-spk"
or "mono-spk" to the long-name based on this and enables this mapping on
devices with a mono speaker.Changing the long-name like this is ok for now, since I'm still working
on the UCM profiles, so they are not in upstream alsa-lib yet.This brings the long-name naming scheme fully in sync with the bytcr_rt5640
case, which is good from a consistency pov.Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
During the recent cleanup series 3 of the 6 input mappings where removed
from the bytcr_rt5651 machine driver because testing showed that none of
them were used.However some devices do actually have their internal mic on IN2 (and
only IN2, not IN1 and IN2), this did not show during previous tests
due to a bug in the userspace UCM input device switching code.This commit re-adds the IN2 mapping for devices with the internal mic.
on IN2 and the headser mic on IN3 and enables this mapping on devices
with their internal mic on IN2.This commit also changes the default internal mic input to IN2, because
all my 7 test devices have their mic there.Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
With the default over current detect limit of 1500uA headsets on often
get detected as headphones on the VIOS LTH17 and even when detected as
headset the OVCD current triggers often while plugged in, resulting in
false-positive button press detection.Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
Some boards have I2cSerialBusV2, GpioIo, GpioInt as ACPI resources, other
boards may have I2cSerialBusV2, GpioInt, GpioIo instead. We want the
GpioIo one for the ext-amp-enable-gpio.So far we've been assuming that the GpioIo one always comes first, this
commit adds code to detect which one comes first and to add the right
gpio-mapping.This fixes sound not working on the Vios LTH17 laptop.
Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
16 Jul, 2018
1 commit
-
Patch adds Geminilake I2S machine driver which uses following codecs:
RT5682 and MAX98357A.Signed-off-by: Naveen Manohar
Signed-off-by: Harsha Priya
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
11 Jul, 2018
6 commits
-
Enable reporting of button presses now that the codec driver recently has
gotten support for this.Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
Disable jack-detection and thus the codec IRQ over suspend/resume.
Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
The rt5651 does not have a built-in speaker amplifier, so it is often
used together with an external amplifier. On Cherry Trail boards this
external amplifier's enable pin is driven through a GPIO, which is
given as the first GPIO in the ACPI resources of the codec fwnode.This commit adds support to the bytcr_rt5651 for this GPIO, fixing
the speaker not working on CHT devices with a rt5651 codec.Cc: Carlo Caione
Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
Move the getting of the codec_dev, to add device-props to it, out of
byt_rt5651_add_codec_device_props() and into its caller,
snd_byt_rt5651_mc_probe().This is a preparation patch for adding support for an external amplifier
enable GPIO, which requires further accesses to the codec_dev.Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
Remove is_valleyview helper, this is not necessary, we can simply call
x86_match_cpu() directly instead.Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown -
Add a quirk for the Lenovo Miix2 8 tablet, this tablet uses a digital
mic on DMIC1 and has a mono-speaker. The jack-detect uses the default
settings..Reported-and-tested-by: russianneuromancer@ya.ru
Signed-off-by: Hans de Goede
Acked-by: Pierre-Louis Bossart
Signed-off-by: Mark Brown
28 Jun, 2018
3 commits
-
Add extended ops in the hdac_bus to allow calling the ASoC HDAC library
ops to reuse the legacy HDA codec drivers with ASoC framework.
Extended ops are used by the legacy codec drivers to call into
hdac_hda library, in the subsequent patches..Signed-off-by: Rakesh Ughreja
Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Takashi Iwai -
Remove memory allocation within snd_hdac_ext_bus_device_init, to make
its behaviour identical to snd_hdac_bus_device_init. So that caller
can allocate the parent data structure containing hdac_device.
This API change helps in reusing the legacy HDA codec drivers with
ASoC platform drivers.Signed-off-by: Rakesh Ughreja
Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Takashi Iwai -
This patch removes the hdac_ext_bus structure. The legacy and
enhanced HDaudio capabilities can be handled in a backward-compatible
way without separate definitions.Follow-up patches in this series handle the driver definition.
Signed-off-by: Rakesh Ughreja
Signed-off-by: Pierre-Louis Bossart
Signed-off-by: Takashi Iwai