OSDN Git Service

tomoyo/tomoyo-test1.git
15 months agoMerge tag 'asoc-fix-v6.3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Fri, 3 Mar 2023 13:21:13 +0000 (14:21 +0100)]
Merge tag 'asoc-fix-v6.3' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.3

Almost all of this is driver specific fixes and new IDs that have come
in during the merge window.  A good chunk of them are simple ones from
me which came about due to a bunch of Mediatek Chromebooks being enabled
in KernelCI, there's more where that came from.

We do have one small feature added to the PCM core by Claudiu Beznea in
order to allow the sequencing required to resolve a noise issue with the
Microchip PDMC driver.

15 months agoMerge branch 'for-next' into for-linus
Takashi Iwai [Fri, 3 Mar 2023 13:20:56 +0000 (14:20 +0100)]
Merge branch 'for-next' into for-linus

15 months agoASoC: mediatek: mt8195: add missing initialization
Trevor Wu [Wed, 1 Mar 2023 11:02:00 +0000 (19:02 +0800)]
ASoC: mediatek: mt8195: add missing initialization

In etdm dai driver, dai_etdm_parse_of() function is used to parse dts
properties to get parameters. There are two for-loops which are
sepearately for all etdm and etdm input only cases. In etdm in only
loop, dai_id is not initialized, so it keeps the value intiliazed in
another loop.

In the patch, add the missing initialization to fix the unexpected
parsing problem.

Fixes: 1de9a54acafb ("ASoC: mediatek: mt8195: support etdm in platform driver")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230301110200.26177-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mediatek: mt8188: add missing initialization
Trevor Wu [Wed, 1 Mar 2023 11:01:59 +0000 (19:01 +0800)]
ASoC: mediatek: mt8188: add missing initialization

In etdm dai driver, dai_etdm_parse_of() function is used to parse dts
properties to get parameters. There are two for-loops which are
sepearately for all etdm and etdm input only cases. In etdm in only
loop, dai_id is not initialized, so it keeps the value intiliazed in
another loop.

In the patch, add the missing initialization to fix the unexpected
parsing problem.

Fixes: 2babb4777489 ("ASoC: mediatek: mt8188: support etdm in platform driver")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230301110200.26177-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt8183: Fixes from an initial glance at a
Mark Brown [Tue, 28 Feb 2023 17:59:21 +0000 (17:59 +0000)]
ASoC: mt8183: Fixes from an initial glance at a

Merge series from Mark Brown <broonie@kernel.org>:

This is a collection of fixes I came up after glancing through an
initial test run with the snappily named Kukui Jacuzzi SKU16 Chromebook
on KernelCI.  There are more issues flagged, this is just what I fixed
thus far.

15 months agoASoC: mchp-pdmc: fix poc noises when starting
Mark Brown [Tue, 28 Feb 2023 17:59:15 +0000 (17:59 +0000)]
ASoC: mchp-pdmc: fix poc noises when starting

Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>:

To start capture on Microchip PDMC the enable bits for each supported
microphone need to be set. After this bit is set the PDMC starts to
receive data from microphones and it considers this data as valid data.
Thus if microphones are not ready the PDMC captures anyway data from its
lines. This data is interpreted by the human ear as poc noises.

To avoid this the following software workaround need to be applied when
starting capture:
1/ enable PDMC channel
2/ wait 150ms
3/ execute 16 dummy reads from RHR
4/ clear interrupts
5/ enable interrupts
6/ enable DMA channel

For this workaround to work step 6 need to be executed at the end.
For step 6 was added patch 1/3 from this series. With this, component
DAI driver sets its struct snd_soc_component_driver::start_dma_last = 1
and proper action is taken based on this flag when starting DAI trigger
vs DMA.

15 months agoASoC: mt6358: Fixes from an initial glance at a
Mark Brown [Tue, 28 Feb 2023 17:59:09 +0000 (17:59 +0000)]
ASoC: mt6358: Fixes from an initial glance at a

Merge series from Mark Brown <broonie@kernel.org>:

This is a collection of fixes I came up after glancing through an
initial test run with the snappily named Kukui Jacuzzi SKU16 Chromebook
on KernelCI.  There are more issues flagged, this is just what I fixed
thus far.

15 months agoASoC: mt8192: Fixes from initial glance at kselftest
Mark Brown [Tue, 28 Feb 2023 17:59:03 +0000 (17:59 +0000)]
ASoC: mt8192: Fixes from initial glance at kselftest

Merge series from Mark Brown <broonie@kernel.org>:

This is a collection of fixes I came up after glancing through an
initial test run with the Spherion Chromebook on KernelCI.  There are
more issues flagged, this is just what I fixed thus far - the volume
controls on the MT6359 have issues for example, and a lot of controls
aren't marked as Switches like they should be.

15 months agoASoC: amd: yc: Add DMI entries to support HP OMEN 16-n0xxx (8A43)
Duc Anh Le [Mon, 27 Feb 2023 23:49:21 +0000 (00:49 +0100)]
ASoC: amd: yc: Add DMI entries to support HP OMEN 16-n0xxx (8A43)

This model requires an additional detection quirk to enable the internal microphone.

Signed-off-by: Duc Anh Le <lub.the.studio@gmail.com>
Link: https://lore.kernel.org/r/20230227234921.7784-1-lub.the.studio@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: zl38060 add gpiolib dependency
Arnd Bergmann [Mon, 27 Feb 2023 08:58:26 +0000 (09:58 +0100)]
ASoC: zl38060 add gpiolib dependency

Without gpiolib, this driver fails to link:

arm-linux-gnueabi-ld: sound/soc/codecs/zl38060.o: in function `chip_gpio_get':
zl38060.c:(.text+0x30): undefined reference to `gpiochip_get_data'
arm-linux-gnueabi-ld: sound/soc/codecs/zl38060.o: in function `zl38_spi_probe':
zl38060.c:(.text+0xa18): undefined reference to `devm_gpiochip_add_data_with_key'

This appears to have been in the driver since the start, but is hard to
hit in randconfig testing since gpiolib is almost always selected by something
else.

Fixes: 52e8a94baf90 ("ASoC: Add initial ZL38060 driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230227085850.2503725-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: sam9g20ek: Disable capture unless building with microphone input
Mark Brown [Sat, 25 Feb 2023 21:48:13 +0000 (21:48 +0000)]
ASoC: sam9g20ek: Disable capture unless building with microphone input

Without modification the AT91SAM9G20-EK has no capture support, none of the
inputs of the CODEC are wired to anything to useful and there are no paths
supporting loopback. Since the audio is clocked from the CODEC and the DAPM
inputs are marked as unusable this means that capture will fail to transfer
any data as the ADC path can't be powered up.

Flag this in the device description so apps don't see unusable capture
support, guarded with the existing optional define for mic input.

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230225-asoc-sam9g20ek-v1-1-9baeb4893142@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt8192: Fix range for sidetone positive gain
Mark Brown [Fri, 24 Feb 2023 14:03:58 +0000 (14:03 +0000)]
ASoC: mt8192: Fix range for sidetone positive gain

The Sidetone_Positive_Gain_dB control reports a range of 0..100 as valid
but the put() function rejects anything larger than 24. Fix this.

There are numerous other problems with this control, the name is very non
idiomatic and it should be a TLV, but it's ABI so probably we should leave
those alone.

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230223-asoc-mt8192-quick-fixes-v1-4-9a85f90368e1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt8192: Report an error if when an invalid sidetone gain is written
Mark Brown [Fri, 24 Feb 2023 14:03:57 +0000 (14:03 +0000)]
ASoC: mt8192: Report an error if when an invalid sidetone gain is written

Reporting an error on invalid values is optional but helpful to userspace
so do so.

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230223-asoc-mt8192-quick-fixes-v1-3-9a85f90368e1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt8192: Fix event generation for controls
Mark Brown [Fri, 24 Feb 2023 14:03:56 +0000 (14:03 +0000)]
ASoC: mt8192: Fix event generation for controls

ALSA controls put() operations should return 1 if the value changed and 0
if it remains the same, fix the mt8192 driver to do so.

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230223-asoc-mt8192-quick-fixes-v1-2-9a85f90368e1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt8192: Remove spammy log messages
Mark Brown [Fri, 24 Feb 2023 14:03:55 +0000 (14:03 +0000)]
ASoC: mt8192: Remove spammy log messages

There are a lot of info level log messages in the mt8192 ADDA driver which
are trivially triggerable from userspace, many in normal operation. Remove
these to avoid spamming the console.

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230223-asoc-mt8192-quick-fixes-v1-1-9a85f90368e1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mchp-pdmc: fix poc noise at capture startup
Claudiu Beznea [Tue, 28 Feb 2023 11:01:45 +0000 (13:01 +0200)]
ASoC: mchp-pdmc: fix poc noise at capture startup

Microchip PDMC IP doesn't filter microphone noises on startup. By default,
it captures data received from digital microphones after
the MCHP_PDMC_MR.EN bits are set. Thus when enable is set on PDMC side the
digital microphones might not be ready yet and PDMC captures data from then
in this time. This data captured is poc noise. To avoid this the software
workaround is to the following:
1/ enable PDMC channel
2/ wait 150ms (on SAMA7G5-EK setup)
3/ execute 16 dummy reads from RHR
4/ clear interrupts
5/ enable interrupts
6/ enable DMA channel

Fixes: 50291652af52 ("ASoC: atmel: mchp-pdmc: add PDMC driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230228110145.3770525-4-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: sama7g5-pdmc: add microchip,startup-delay-us binding
Claudiu Beznea [Tue, 28 Feb 2023 11:01:44 +0000 (13:01 +0200)]
ASoC: dt-bindings: sama7g5-pdmc: add microchip,startup-delay-us binding

PDMC can work with different types of microphones, thus different boards
could have different microphones. Depending on microphone type the PDMC
would need to wait longer or shorter period (at startup) than the default
chosen one to filter unwanted noise. Thus add microchip,startup-delay-us
binding to let PDMC users to specify startup delay.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230228110145.3770525-3-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc-pcm: add option to start DMA after DAI
Claudiu Beznea [Tue, 28 Feb 2023 11:01:43 +0000 (13:01 +0200)]
ASoC: soc-pcm: add option to start DMA after DAI

Add option to start DMA component after DAI trigger. This is done
by filling the new struct snd_soc_component_driver::start_dma_last.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230228110145.3770525-2-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt8183: Fix event generation for I2S DAI operations
Mark Brown [Sun, 26 Feb 2023 12:49:57 +0000 (12:49 +0000)]
ASoC: mt8183: Fix event generation for I2S DAI operations

ALSA control put() operations should return 0 if the value changed so that
events can be generated appropriately for userspace but the custom control
in the MT8183 I2S DAI driver doesn't do that, fix it.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230224-asoc-mt8183-quick-fixes-v1-2-041f29419ed5@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt8183: Remove spammy logging from I2S DAI driver
Mark Brown [Sun, 26 Feb 2023 12:49:56 +0000 (12:49 +0000)]
ASoC: mt8183: Remove spammy logging from I2S DAI driver

There is a lot of dev_info() logging in normal operation in the I2S DAI
driver, remove it to avoid spamming the console.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230224-asoc-mt8183-quick-fixes-v1-1-041f29419ed5@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt6358: Remove undefined HPx Mux enumeration values
Mark Brown [Sun, 26 Feb 2023 12:47:58 +0000 (12:47 +0000)]
ASoC: mt6358: Remove undefined HPx Mux enumeration values

The HPx Mux enumerations define values 5, 6 and 7 but describe them as
"undefined" and map them to the value 0 on writing. Given the descriptions
and behaviour it seems that these values are invalid and should not be
present in the register, the current behaviour is detected as problematic
by mixer-test:

# # HPL Mux.0 expected 5 but read 0, is_volatile 0
# # HPL Mux.0 expected 6 but read 0, is_volatile 0
# # HPL Mux.0 expected 7 but read 0, is_volatile 0

Remove the values from the enumeration, this will prevent userspace setting
them.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230224-asoc-mt6358-quick-fixes-v1-3-747d9186be4b@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt6358: Validate Wake on Voice 2 writes
Mark Brown [Sun, 26 Feb 2023 12:47:57 +0000 (12:47 +0000)]
ASoC: mt6358: Validate Wake on Voice 2 writes

Currently the Wake on Voice 2 control accepts and stores any value written
but it reports that only 0 and 1 are valid values. Reject any out of range
values written by userspace.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230224-asoc-mt6358-quick-fixes-v1-2-747d9186be4b@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mt6358: Fix event generation for wake on voice stage 2 switch
Mark Brown [Sun, 26 Feb 2023 12:47:56 +0000 (12:47 +0000)]
ASoC: mt6358: Fix event generation for wake on voice stage 2 switch

ALSA control put() operations should return 0 if the value changed so that
events can be generated appropriately for userspace but the custom control
for wake on voice stage 2 doesn't do this, fix it.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230224-asoc-mt6358-quick-fixes-v1-1-747d9186be4b@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: apple: mca: Improve handling of unavailable DMA channels
Martin Povišer [Fri, 24 Feb 2023 15:33:02 +0000 (16:33 +0100)]
ASoC: apple: mca: Improve handling of unavailable DMA channels

When we fail to obtain a DMA channel, don't return a blanket -EINVAL,
instead return the original error code if there's one. This makes
deferring work as it should. Also don't print an error message for
-EPROBE_DEFER.

Fixes: 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA channels")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20230224153302.45365-3-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: apple: mca: Fix SERDES reset sequence
Martin Povišer [Fri, 24 Feb 2023 15:33:01 +0000 (16:33 +0100)]
ASoC: apple: mca: Fix SERDES reset sequence

Fix the reset sequence of reads and writes that we invoke from within
the early trigger. It looks like there never was a SERDES_CONF_SOME_RST
bit that should be involved in the reset sequence, and its presence in
the driver code is a mistake from earlier.

Instead, the reset sequence should go as follows: We should switch the
the SERDES unit's SYNC_SEL mux to the value of 7 (so outside the range
of 1...6 representing cluster's SYNCGEN units), then raise the RST bit
in SERDES_STATUS and wait for it to clear.

Properly resetting the SERDES unit fixes frame desynchronization hazard
in case of long frames (longer than 4 used slots). The desynchronization
manifests itself by rotating the PCM channels.

Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20230224153302.45365-2-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: apple: mca: Fix final status read on SERDES reset
Martin Povišer [Fri, 24 Feb 2023 15:33:00 +0000 (16:33 +0100)]
ASoC: apple: mca: Fix final status read on SERDES reset

From within the early trigger we are doing a reset of the SERDES unit,
but the final status read is on a bad address. Add the missing SERDES
unit offset in calculation of the address.

Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20230224153302.45365-1-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: adau7118: don't disable regulators on device unbind
Nuno Sá [Fri, 24 Feb 2023 10:45:51 +0000 (11:45 +0100)]
ASoC: adau7118: don't disable regulators on device unbind

The regulators are supposed to be controlled through the
set_bias_level() component callback. Moreover, the regulators are not
enabled during probe and so, this would lead to a regulator unbalanced
use count.

Fixes: ca514c0f12b02 ("ASOC: Add ADAU7118 8 Channel PDM-to-I2S/TDM Converter driver")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20230224104551.1139981-1-nuno.sa@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: apple,mca: Add t8112-mca compatible
Janne Grunau [Sun, 12 Feb 2023 15:41:24 +0000 (16:41 +0100)]
ASoC: dt-bindings: apple,mca: Add t8112-mca compatible

The block found on Apple's M2 SoC is compatible with the existing driver
so add its per-SoC compatible.

Signed-off-by: Janne Grunau <j@jannau.net>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20230202-asahi-t8112-dt-v1-14-cb5442d1c229@jannau.net
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: Intel: sof_rt5682: Add quirk for Rex board with mx98360a amplifier
Dharageswari.R [Mon, 20 Feb 2023 08:06:52 +0000 (10:06 +0200)]
ASoC: Intel: sof_rt5682: Add quirk for Rex board with mx98360a amplifier

Add mtl_mx98360a_rt5682 driver data for Chrome Rex board support.

Signed-off-by: Dharageswari.R <dharageswari.r@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230220080652.23136-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: mediatek: mt8188: correct etdm control return value
Trevor Wu [Wed, 15 Feb 2023 12:50:16 +0000 (20:50 +0800)]
ASoC: mediatek: mt8188: correct etdm control return value

In mt8188_etdm_clk_src_sel_put() function, val retrieved by FIELD_PREP
is shifted to the corresponding bit filed, so it can compare with the
register value directly.

Originally, the redundant bit shift of the register value results in
the wrong comparison result, so we remove bit shift operation in the
patch.

Fixes: 2babb4777489 ("ASoC: mediatek: mt8188: support etdm in platform driver")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230215125017.16044-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SMA1303: Change the value for right output
Kiseok Jo [Fri, 17 Feb 2023 00:44:03 +0000 (00:44 +0000)]
ASoC: SMA1303: Change the value for right output

This device can output mono, left or right.
LR data should be swapped to output right data.

Signed-off-by: Kiseok Jo <kiseok.jo@irondevice.com>
Link: https://lore.kernel.org/r/20230217004403.10220-1-kiseok.jo@irondevice.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoMerge tag 'asoc-fix-v6.2-rc8-2' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Fri, 17 Feb 2023 07:56:33 +0000 (08:56 +0100)]
Merge tag 'asoc-fix-v6.2-rc8-2' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: One more fix for v6.2

One more fix from Peter which he'd very much like to get into
v6.2.

15 months agoASoC: amd: yp: Add OMEN by HP Gaming Laptop 16z-n000 to quirks
Joseph Hunkeler [Thu, 16 Feb 2023 15:50:07 +0000 (10:50 -0500)]
ASoC: amd: yp: Add OMEN by HP Gaming Laptop 16z-n000 to quirks

Enables display microphone on the HP OMEN 16z-n000 (8A42) laptop

Signed-off-by: Joseph Hunkeler <jhunkeler@gmail.com>
Link: https://lore.kernel.org/r/20230216155007.26143-1-jhunkeler@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda-dai: fix possible stream_tag leak
Pierre-Louis Bossart [Thu, 16 Feb 2023 16:23:40 +0000 (18:23 +0200)]
ASoC: SOF: Intel: hda-dai: fix possible stream_tag leak

The HDaudio stream allocation is done first, and in a second step the
LOSIDV parameter is programmed for the multi-link used by a codec.

This leads to a possible stream_tag leak, e.g. if a DisplayAudio link
is not used. This would happen when a non-Intel graphics card is used
and userspace unconditionally uses the Intel Display Audio PCMs without
checking if they are connected to a receiver with jack controls.

We should first check that there is a valid multi-link entry to
configure before allocating a stream_tag. This change aligns the
dma_assign and dma_cleanup phases.

Complements: b0cd60f3e9f5 ("ALSA/ASoC: hda: clarify bus_get_link() and bus_link_get() helpers")
Link: https://github.com/thesofproject/linux/issues/4151
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230216162340.19480-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoMerge branch 'for-linus' into for-next
Takashi Iwai [Thu, 16 Feb 2023 14:06:18 +0000 (15:06 +0100)]
Merge branch 'for-linus' into for-next

Pull the pending fixes for 6.3

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoMerge tag 'asoc-v6.3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Thu, 16 Feb 2023 13:32:04 +0000 (14:32 +0100)]
Merge tag 'asoc-v6.3' of https://git./linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v6.3

There's been quite a lot of activity this release, but not really
one big feature - lots of new devices, plus a lot of cleanup and
modernisation work spread throughout the subsystem:

 - More factoring out of common operations into helper functions
   by Morimoto-san.
 - DT schema conversons and stylistic nits.
 - Continued work on building out the new SOF IPC4 scheme.
 - Support for Awinc AT88395, Infineon PEB2466, Iron Device
   SMA1303, Mediatek MT8188, Realtek RT712, Renesas IDT821034,
   Samsung/Tesla FSD SoC I2S, and TI TAS5720A-Q1.

15 months agoMerge tag 'asoc-fix-v6.2-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Thu, 16 Feb 2023 13:29:54 +0000 (14:29 +0100)]
Merge tag 'asoc-fix-v6.2-rc8' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Fix for v6.2

One non-urgent fix for v6.2, this could possibly wait till the
merge window.

15 months agoMerge branch 'topic/apple-gmux' into for-next
Takashi Iwai [Thu, 16 Feb 2023 13:18:54 +0000 (14:18 +0100)]
Merge branch 'topic/apple-gmux' into for-next

Pull vga_switcheroo fix for Macs

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoALSA: hda/hdmi: Register with vga_switcheroo on Dual GPU Macbooks
Orlando Chamberlain [Thu, 16 Feb 2023 10:34:51 +0000 (21:34 +1100)]
ALSA: hda/hdmi: Register with vga_switcheroo on Dual GPU Macbooks

Commit 586bc4aab878 ("ALSA: hda/hdmi - fix vgaswitcheroo detection for
AMD") caused only AMD gpu's with PX to have their audio component register
with vga_switcheroo. This meant that Apple Macbooks with apple-gmux as the
gpu switcher no longer had the audio client registering, so when the gpu is
powered off by vga_switcheroo snd_hda_intel is unaware that it should have
suspended the device:

amdgpu: switched off
snd_hda_intel 0000:03:00.1:
    Unable to change power state from D3hot to D0, device inaccessible
snd_hda_intel 0000:03:00.1: CORB reset timeout#2, CORBRP = 65535

To resolve this, we use apple_gmux_detect() and register a
vga_switcheroo audio client when apple-gmux is detected.

Fixes: 586bc4aab878 ("ALSA: hda/hdmi - fix vgaswitcheroo detection for AMD")
Link: https://lore.kernel.org/all/20230210044826.9834-9-orlandoch.dev@gmail.com/
Signed-off-by: Orlando Chamberlain <orlandoch.dev@gmail.com>
Link: https://lore.kernel.org/r/20230216103450.12925-1-orlandoch.dev@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoASoC: rsnd: adg: Fix BRG typos
Geert Uytterhoeven [Wed, 15 Feb 2023 14:17:41 +0000 (15:17 +0100)]
ASoC: rsnd: adg: Fix BRG typos

"BRG" stands for "Baud Rate Generator", but is frequently misspelled as
"RBG".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/ac6365c17861d71fbc89d823089db4aafdb763ed.1676470202.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: da7219: Improve the IRQ process to increase the stability
David Rau [Wed, 15 Feb 2023 10:10:45 +0000 (10:10 +0000)]
ASoC: da7219: Improve the IRQ process to increase the stability

Remove the sleep control in IRQ thread
and create an individual task to handel it for Jack plug in event.

This commit improves the control of ground switches in the AAD IRQ.

Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Link: https://lore.kernel.org/r/20230215101045.21456-1-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc-ac97: Return correct error codes
Andy Shevchenko [Wed, 15 Feb 2023 13:23:43 +0000 (15:23 +0200)]
ASoC: soc-ac97: Return correct error codes

With the switching to dev_err_probe(), during the conversion
of GPIO calls, the return code is passed is a paratemer to it.
At the same time a copy'n'paste mistake was made, so the wrong
variable has been taken for the error reporting. Fix this.

Fixes: 3ee0d39c50dc ("ASoC: soc-ac97: Convert to agnostic GPIO API")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230215132343.35547-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc-dapm.h: fixup warning struct snd_pcm_substream not declared
Lucas Tanure [Wed, 15 Feb 2023 13:28:51 +0000 (13:28 +0000)]
ASoC: soc-dapm.h: fixup warning struct snd_pcm_substream not declared

Add struct snd_pcm_substream forward declaration

Fixes: 078a85f2806f ("ASoC: dapm: Only power up active channels from a DAI")
Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230215132851.1626881-1-lucas.tanure@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: cs35l45: Remove separate namespace for tables
Charles Keepax [Wed, 15 Feb 2023 10:58:18 +0000 (10:58 +0000)]
ASoC: cs35l45: Remove separate namespace for tables

Now tables isn't a separate module, definitely no need to have a
separate namespace for it.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230215105818.3315925-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: cs35l45: Remove separate tables module
Charles Keepax [Wed, 15 Feb 2023 10:58:17 +0000 (10:58 +0000)]
ASoC: cs35l45: Remove separate tables module

There is no reason to have a separate module for the tables file it just
holds regmap callbacks and register patches used by the main part of the
driver. Remove the separate module and merge it into the main driver
module.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230215105818.3315925-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: soc-ac97: Convert to agnostic GPIO API
Andy Shevchenko [Mon, 13 Feb 2023 16:17:13 +0000 (18:17 +0200)]
ASoC: soc-ac97: Convert to agnostic GPIO API

The of_gpio.h is going to be removed. In preparation of that convert
the driver to the agnostic API.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230213161713.1450-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: renesas,rsnd.yaml: drop "dmas/dma-names" from "rcar_sound,ssi"
Kuninori Morimoto [Mon, 13 Feb 2023 02:13:18 +0000 (02:13 +0000)]
ASoC: dt-bindings: renesas,rsnd.yaml: drop "dmas/dma-names" from "rcar_sound,ssi"

SSI is supporting both "PIO mode" and "DMA mode", thus "dmas/dma-names"
are not mandatory property. Drop these from rcar_sound,ssi's required:.
This is prepare for Gen4 support. See more details on Link

Link: https://lore.kernel.org/all/87zg9vk0ex.wl-kuninori.morimoto.gx@renesas.com/#r
Link: https://lore.kernel.org/all/87r0v2uvm7.wl-kuninori.morimoto.gx@renesas.com/#r
Link: https://lore.kernel.org/all/87r0v1t02h.wl-kuninori.morimoto.gx@renesas.com/#r
Link: https://lore.kernel.org/all/87y1p7bpma.wl-kuninori.morimoto.gx@renesas.com/#r
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/87r0uu8g8x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel/ipc4: Support for low power playback
Mark Brown [Tue, 14 Feb 2023 17:59:59 +0000 (17:59 +0000)]
ASoC: SOF: Intel/ipc4: Support for low power playback

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

The following series will enable the the Low Power Audio (LPA)
playback on Intel platforms when using IPC4.

The support is closely follows how IPC3 supports similar use case.

All depending patches are upstream and our CI have been testing
this feature for some time without issues.

15 months agoALSA: hda/realtek: Enable mute/micmute LEDs and speaker support for HP Laptops
Andy Chi [Tue, 14 Feb 2023 14:04:31 +0000 (22:04 +0800)]
ALSA: hda/realtek: Enable mute/micmute LEDs and speaker support for HP Laptops

On HP Laptops, requires the ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED quirk to
make its audio LEDs and speaker work.

Signed-off-by: Andy Chi <andy.chi@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230214140432.39654-1-andy.chi@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoALSA: hda: cs35l41: Enable Amp High Pass Filter
Stefan Binding [Mon, 13 Feb 2023 14:50:08 +0000 (14:50 +0000)]
ALSA: hda: cs35l41: Enable Amp High Pass Filter

This helps smooth out pops and clicks in the amps.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230213145008.1215849-4-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoALSA: hda: cs35l41: Ensure firmware/tuning pairs are always loaded
Stefan Binding [Mon, 13 Feb 2023 14:50:07 +0000 (14:50 +0000)]
ALSA: hda: cs35l41: Ensure firmware/tuning pairs are always loaded

To ensure firmware for cs35l41 is correctly running, it is necessary
that a corresponding tuning file is also loaded. Without both,
the firmware may not be performing correctly
Ensure that if we load the firmware, we have also loaded the correct
tuning file. Otherwise, fall back to default firmware and tuning.
If default tuning is also missing, then disable DSP firmware.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230213145008.1215849-3-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoALSA: hda: cs35l41: Correct error condition handling
Vitaly Rodionov [Mon, 13 Feb 2023 14:50:06 +0000 (14:50 +0000)]
ALSA: hda: cs35l41: Correct error condition handling

Function cs_dsp_coeff_write_ctrl() can return 3 possible values:
0 - no change, 1 - value has changed and -1 - error, so positive value
is not an error.
Fixes: 7406bdbc4fb8 ("ASoC: wm_adsp: Return whether changed when writing controls")

Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230213145008.1215849-2-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoASoC: codecs: wcd934x: Use min macro for comparison and assignment
Deepak R Varma [Mon, 13 Feb 2023 17:40:46 +0000 (23:10 +0530)]
ASoC: codecs: wcd934x: Use min macro for comparison and assignment

Simplify code by using min helper macro for logical evaluation and value
assignment. The change also facilitates code realignment for improved
readability.
Proposed change is identified using minmax.cocci Coccinelle script.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Link: https://lore.kernel.org/r/Y+p2Hn0nrtHiKwPR@ubun2204.myguest.virtualbox.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: Intel: Skylake: Fix struct definition
Amadeusz Sławiński [Mon, 13 Feb 2023 20:52:23 +0000 (21:52 +0100)]
ASoC: Intel: Skylake: Fix struct definition

The kernel is globally removing the ambiguous 0-length and 1-element
arrays in favor of flexible arrays, so that we can gain both compile-time
and run-time array bounds checking[1]. In this instance, struct
skl_cpr_cfg contains struct skl_cpr_gtw_cfg, which defined "config_data"
as a 1-element array.

However, case present in sound/soc/intel/skylake/skl-topology.h is not a
simple one as the structure takes part in IPC communication. Apparently
original definition missed one field, which while not used by AudioDSP
firmware when there is no additional data, is still expected to be part
of an IPC message. Currently this works because of how 'config_data' is
declared: 'config_data[1]'. Now when one replaces it with a flexible
array there would be one field missing. Update struct declaration to fix
this.

Reported-by: Sasa Ostrouska <casaxa@gmail.com>
Link: https://lore.kernel.org/all/CALFERdwvq5day_sbDfiUsMSZCQu9HG8-SBpOZDNPeMdZGog6XA@mail.gmail.com/
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: alsa-devel@alsa-project.org
CC: Kees Cook <keescook@chromium.org>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230213205223.2679357-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: tlv320adcx140: extend list of supported samplerates
Steffen Aschbacher [Tue, 14 Feb 2023 09:10:51 +0000 (11:10 +0200)]
ASoC: tlv320adcx140: extend list of supported samplerates

The 'tlv320adcx140' driver currently supports 3 devices: TLV320ADC3140,
TLV320ADC5140 and TLV320ADC6140.

All 3 devices, support higher samplerates, up to 768-kHz according to their
datasheets.

In our applications, we only tested (and worked) with 96 kHz and 192 kHz.

This change extends the list of supported sample-rates for these devices
with 96 & 192 kHz.

References:
  https://www.ti.com/product/TLV320ADC3140
  https://www.ti.com/product/TLV320ADC5140
  https://www.ti.com/product/TLV320ADC6140

Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de>
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Link: https://lore.kernel.org/r/20230214091051.16323-1-alex@shruggie.ro
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: imx-pcm-rpmsg: Remove unused variable
Deepak R Varma [Mon, 13 Feb 2023 18:13:03 +0000 (23:43 +0530)]
ASoC: imx-pcm-rpmsg: Remove unused variable

Variable ret is initialed but is never modified or used except for
returning the initial value 0. The value can be directly returned
instead and the variable definition can be dropped.
Issue identified using returnvar.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Link: https://lore.kernel.org/r/Y+p9r5y9DPSJkPVf@ubun2204.myguest.virtualbox.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoSoC: rt5682s: Disable jack detection interrupt during suspend
Matthias Kaehlcke [Thu, 9 Feb 2023 01:20:23 +0000 (01:20 +0000)]
SoC: rt5682s: Disable jack detection interrupt during suspend

The rt5682s driver switches its regmap to cache-only when the
device suspends and back to regular mode on resume. When the
jack detect interrupt fires rt5682s_irq() schedules the jack
detect work. This can result in invalid reads from the regmap
in cache-only mode if the work runs before the device has
resumed:

[   19.672162] rt5682s 2-001a: ASoC: error at soc_component_read_no_lock on rt5682s.2-001a for register: [0x000000f0] -16

Disable the jack detection interrupt during suspend and
re-enable it on resume. The driver already schedules the
jack detection work on resume, so any state change during
suspend is still handled.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/20230209012002.1.Ib4d6481f1d38a6e7b8c9e04913c02ca88c216cf6@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda-dsp: Set streaming flag for d0i3
Rander Wang [Tue, 14 Feb 2023 10:33:45 +0000 (12:33 +0200)]
ASoC: SOF: Intel: hda-dsp: Set streaming flag for d0i3

Enable d0i3 streaming if all the active streams can
work in d0i3 state and playback is enabled.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: Enable d0i3 work for ipc4
Rander Wang [Tue, 14 Feb 2023 10:33:44 +0000 (12:33 +0200)]
ASoC: SOF: Intel: Enable d0i3 work for ipc4

Schedule a delayed work for d0i3 entry after every non-pm ipc msg.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: ipc4: Wake up dsp core before sending ipc msg
Rander Wang [Tue, 14 Feb 2023 10:33:43 +0000 (12:33 +0200)]
ASoC: SOF: ipc4: Wake up dsp core before sending ipc msg

The driver shall update the power state to D0i0 before sending
a generic IPC. Power-related IPCs are the exception to the rule,
they may be sent even when the power-state is D0i3

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Intel: hda-dsp: use set_pm_gate according to ipc version
Rander Wang [Tue, 14 Feb 2023 10:33:42 +0000 (12:33 +0200)]
ASoC: SOF: Intel: hda-dsp: use set_pm_gate according to ipc version

Use set_pm_gate to unify pm gate setting for different
ipc version.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: SOF: Introduce a new set_pm_gate() IPC PM op
Rander Wang [Tue, 14 Feb 2023 10:33:41 +0000 (12:33 +0200)]
ASoC: SOF: Introduce a new set_pm_gate() IPC PM op

Set_pm_gate depends on ipc version. This patch defines
the ops for both IPC3 and IPC4.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230214103345.30669-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoALSA: hda/realtek: fix mute/micmute LEDs don't work for a HP platform.
Andy Chi [Tue, 14 Feb 2023 03:58:51 +0000 (11:58 +0800)]
ALSA: hda/realtek: fix mute/micmute LEDs don't work for a HP platform.

There is a HP platform needs ALC236_FIXUP_HP_GPIO_LED quirk to
make mic-mute/audio-mute working.

Signed-off-by: Andy Chi <andy.chi@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230214035853.31217-1-andy.chi@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoASoC: codecs: Remove unneeded semicolon
Yang Li [Mon, 13 Feb 2023 01:05:47 +0000 (09:05 +0800)]
ASoC: codecs: Remove unneeded semicolon

./sound/soc/codecs/peb2466.c:1851:2-3: Unneeded semicolon
./sound/soc/codecs/peb2466.c:1887:2-3: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4045
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20230213010547.105312-1-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: tlv320adcx140: fix 'ti,gpio-config' DT property init
Steffen Aschbacher [Mon, 13 Feb 2023 07:38:05 +0000 (09:38 +0200)]
ASoC: tlv320adcx140: fix 'ti,gpio-config' DT property init

When the 'ti,gpio-config' property is not defined, the
device_property_count_u32() will return an error, rather than zero.

The current check, only handles a return value of zero, which assumes that
the property is defined and has nothing defined.

This change extends the check to also check for an error case (most likely
to be hit by the case that the 'ti,gpio-config' is not defined).

In case that the 'ti,gpio-config' and the returned 'gpio_count' is not
correct, there is a 'if (gpio_count != ADCX140_NUM_GPIO_CFGS)' check, a few
lines lower that will return -EINVAL.
This means that someone tried to define 'ti,gpio-config', but with the
wrong number of GPIOs.

Fixes: d5214321498a ("ASoC: tlv320adcx140: Add support for configuring GPIO pin")
Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de>
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Link: https://lore.kernel.org/r/20230213073805.14640-1-alex@shruggie.ro
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: Modify error implicit declaration of function 'gpiod_set_value_cansleep'
Weidong Wang [Mon, 13 Feb 2023 09:36:49 +0000 (17:36 +0800)]
ASoC: codecs: Modify error implicit declaration of function 'gpiod_set_value_cansleep'

Add select GPIOLIB to the sound/soc/codecs/Kconfig file

Signed-off-by: Ben Yi <yijiangtao@awinic.com>
Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230213093649.22928-4-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: Modify the log print statement
Weidong Wang [Mon, 13 Feb 2023 09:36:48 +0000 (17:36 +0800)]
ASoC: codecs: Modify the log print statement

Change hdrlen to hdr_len

Signed-off-by: Ben Yi <yijiangtao@awinic.com>
Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230213093649.22928-3-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: codecs: Fixed a spelling error in the function name
Weidong Wang [Mon, 13 Feb 2023 09:36:47 +0000 (17:36 +0800)]
ASoC: codecs: Fixed a spelling error in the function name

Change the function name aw88395_plack_event to aw88395_playback_event

Signed-off-by: Ben Yi <yijiangtao@awinic.com>
Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230213093649.22928-2-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: dt-bindings: maxim,max98095: Convert to dtschema
Krzysztof Kozlowski [Sat, 11 Feb 2023 13:47:55 +0000 (14:47 +0100)]
ASoC: dt-bindings: maxim,max98095: Convert to dtschema

Convert the Maxim Integrated MAX98095 audio codec bindings to DT schema.
Add missing sound-dai-cells during conversion.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230211134755.86061-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: ep93xx: ignore 0 Hz sysclk
Alexander Sverdlin [Sun, 12 Feb 2023 22:09:23 +0000 (23:09 +0100)]
ASoC: ep93xx: ignore 0 Hz sysclk

Commit 2458adb8f92a
("SoC: simple-card-utils: set 0Hz to sysclk when shutdown")
added a call to snd_soc_dai_set_sysclk() with 0 Hz frequency. Being
propagated further it causes a division by zero in clk-ep93xx driver:

Division by zero in kernel.
CPU: 0 PID: 52 Comm: aplay Tainted: G        W          6.2.0-rc4-... #1
Hardware name: Generic DT based system
 unwind_backtrace from show_stack+0x10/0x18
 show_stack from dump_stack_lvl+0x28/0x34
 dump_stack_lvl from __div0+0x10/0x1c
 __div0 from Ldiv0+0x8/0x1c
 Ldiv0 from ep93xx_mux_determine_rate+0x78/0x1d0
 ep93xx_mux_determine_rate from clk_core_round_rate_nolock+0x48/0xc8
 clk_core_round_rate_nolock from clk_core_set_rate_nolock+0x48/0x160
 clk_core_set_rate_nolock from clk_set_rate+0x30/0x8c
 clk_set_rate from ep93xx_i2s_set_sysclk+0x30/0x6c
 ep93xx_i2s_set_sysclk from snd_soc_dai_set_sysclk+0x3c/0xa4
 snd_soc_dai_set_sysclk from asoc_simple_shutdown+0xb8/0x164
 asoc_simple_shutdown from snd_soc_link_shutdown+0x44/0x54
 snd_soc_link_shutdown from soc_pcm_clean+0x78/0x180
 soc_pcm_clean from soc_pcm_close+0x28/0x40
 soc_pcm_close from snd_pcm_release_substream.part.0+0x3c/0x84
 snd_pcm_release_substream.part.0 from snd_pcm_release+0x40/0x88
 snd_pcm_release from __fput+0x74/0x278

There has been commit f1879d7b98dc ("ASoC: rockchip: ignore 0Hz sysclk"),
but it prepared by far not all drivers.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://lore.kernel.org/r/20230212220923.258414-1-alexander.sverdlin@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoALSA: hda/realtek - fixed wrong gpio assigned
Kailang Yang [Mon, 13 Feb 2023 06:54:22 +0000 (14:54 +0800)]
ALSA: hda/realtek - fixed wrong gpio assigned

GPIO2 PIN use for output. Mask Dir and Data need to assign for 0x4. Not 0x3.
This fixed was for Lenovo Desktop(0x17aa1056). GPIO2 use for AMP enable.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/8d02bb9ac8134f878cd08607fdf088fd@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoLinux 6.2-rc8 v6.2-rc8
Linus Torvalds [Sun, 12 Feb 2023 22:10:17 +0000 (14:10 -0800)]
Linux 6.2-rc8

15 months agoMAINTAINERS: Add myself as maintainer for arch/sh (SUPERH)
John Paul Adrian Glaubitz [Tue, 7 Feb 2023 16:57:15 +0000 (17:57 +0100)]
MAINTAINERS: Add myself as maintainer for arch/sh (SUPERH)

Both Rich Felker and Yoshinori Sato haven't done any work on arch/sh
for a while. As I have been maintaining Debian's sh4 port since 2014,
I am interested to keep the architecture alive.

Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Acked-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 months agoMerge tag 'trace-v6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
Linus Torvalds [Sun, 12 Feb 2023 21:52:17 +0000 (13:52 -0800)]
Merge tag 'trace-v6.2-rc7' of git://git./linux/kernel/git/trace/linux-trace

Pull tracing fix from Steven Rostedt:
 "Fix showing of TASK_COMM_LEN instead of its value

  The TASK_COMM_LEN was converted from a macro into an enum so that BTF
  would have access to it. But this unfortunately caused TASK_COMM_LEN
  to display in the format fields of trace events, as they are created
  by the TRACE_EVENT() macro and such, macros convert to their values,
  where as enums do not.

  To handle this, instead of using the field itself to be display, save
  the value of the array size as another field in the trace_event_fields
  structure, and use that instead.

  Not only does this fix the issue, but also converts the other trace
  events that have this same problem (but were not breaking tooling).

  With this change, the original work around b3bc8547d3be6 ("tracing:
  Have TRACE_DEFINE_ENUM affect trace event types as well") could be
  reverted (but that should be done in the merge window)"

* tag 'trace-v6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  tracing: Fix TASK_COMM_LEN in trace event format file

15 months agoMerge tag 'for-6.2-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
Linus Torvalds [Sun, 12 Feb 2023 19:26:36 +0000 (11:26 -0800)]
Merge tag 'for-6.2-rc7-tag' of git://git./linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:

 - one more fix for a tree-log 'write time corruption' report, update
   the last dir index directly and don't keep in the log context

 - do VFS-level inode lock around FIEMAP to prevent a deadlock with
   concurrent fsync, the extent-level lock is not sufficient

 - don't cache a single-device filesystem device to avoid cases when a
   loop device is reformatted and the entry gets stale

* tag 'for-6.2-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: free device in btrfs_close_devices for a single device filesystem
  btrfs: lock the inode in shared mode before starting fiemap
  btrfs: simplify update of last_dir_index_offset when logging a directory

15 months agoMerge tag 'usb-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 12 Feb 2023 19:18:57 +0000 (11:18 -0800)]
Merge tag 'usb-6.2-rc8' of git://git./linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are 2 small USB driver fixes that resolve some reported
  regressions and one new device quirk. Specifically these are:

   - new quirk for Alcor Link AK9563 smartcard reader

   - revert of u_ether gadget change in 6.2-rc1 that caused problems

   - typec pin probe fix

  All of these have been in linux-next with no reported problems"

* tag 'usb-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: core: add quirk for Alcor Link AK9563 smartcard reader
  usb: typec: altmodes/displayport: Fix probe pin assign check
  Revert "usb: gadget: u_ether: Do not make UDC parent of the net device"

15 months agoMerge tag 'efi-fixes-for-v6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 12 Feb 2023 19:13:29 +0000 (11:13 -0800)]
Merge tag 'efi-fixes-for-v6.2-4' of git://git./linux/kernel/git/efi/efi

Pull EFI fix from Ard Biesheuvel:
 "A fix from Darren to widen the SMBIOS match for detecting Ampere Altra
  machines with problematic firmware. In the mean time, we are working
  on a more precise check, but this is still work in progress"

* tag 'efi-fixes-for-v6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  arm64: efi: Force the use of SetVirtualAddressMap() on eMAG and Altra Max machines

15 months agoMerge tag 'powerpc-6.2-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
Linus Torvalds [Sun, 12 Feb 2023 19:08:15 +0000 (11:08 -0800)]
Merge tag 'powerpc-6.2-5' of git://git./linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

 - Fix interrupt exit race with security mitigation switching.

 - Don't select ARCH_WANTS_NO_INSTR until warnings are fixed.

 - Build fix for CONFIG_NUMA=n.

Thanks to Nicholas Piggin, Randy Dunlap, and Sachin Sant.

* tag 'powerpc-6.2-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/64s/interrupt: Fix interrupt exit race with security mitigation switch
  powerpc/kexec_file: fix implicit decl error
  powerpc: Don't select ARCH_WANTS_NO_INSTR

15 months agoFix page corruption caused by racy check in __free_pages
David Chen [Thu, 9 Feb 2023 17:48:28 +0000 (17:48 +0000)]
Fix page corruption caused by racy check in __free_pages

When we upgraded our kernel, we started seeing some page corruption like
the following consistently:

  BUG: Bad page state in process ganesha.nfsd  pfn:1304ca
  page:0000000022261c55 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x1304ca
  flags: 0x17ffffc0000000()
  raw: 0017ffffc0000000 ffff8a513ffd4c98 ffffeee24b35ec08 0000000000000000
  raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000
  page dumped because: nonzero mapcount
  CPU: 0 PID: 15567 Comm: ganesha.nfsd Kdump: loaded Tainted: P    B      O      5.10.158-1.nutanix.20221209.el7.x86_64 #1
  Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
  Call Trace:
   dump_stack+0x74/0x96
   bad_page.cold+0x63/0x94
   check_new_page_bad+0x6d/0x80
   rmqueue+0x46e/0x970
   get_page_from_freelist+0xcb/0x3f0
   ? _cond_resched+0x19/0x40
   __alloc_pages_nodemask+0x164/0x300
   alloc_pages_current+0x87/0xf0
   skb_page_frag_refill+0x84/0x110
   ...

Sometimes, it would also show up as corruption in the free list pointer
and cause crashes.

After bisecting the issue, we found the issue started from commit
e320d3012d25 ("mm/page_alloc.c: fix freeing non-compound pages"):

if (put_page_testzero(page))
free_the_page(page, order);
else if (!PageHead(page))
while (order-- > 0)
free_the_page(page + (1 << order), order);

So the problem is the check PageHead is racy because at this point we
already dropped our reference to the page.  So even if we came in with
compound page, the page can already be freed and PageHead can return
false and we will end up freeing all the tail pages causing double free.

Fixes: e320d3012d25 ("mm/page_alloc.c: fix freeing non-compound pages")
Link: https://lore.kernel.org/lkml/BYAPR02MB448855960A9656EEA81141FC94D99@BYAPR02MB4488.namprd02.prod.outlook.com/
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@vger.kernel.org
Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 months agotracing: Fix TASK_COMM_LEN in trace event format file
Yafang Shao [Sun, 12 Feb 2023 15:13:03 +0000 (15:13 +0000)]
tracing: Fix TASK_COMM_LEN in trace event format file

After commit 3087c61ed2c4 ("tools/testing/selftests/bpf: replace open-coded 16 with TASK_COMM_LEN"),
the content of the format file under
/sys/kernel/tracing/events/task/task_newtask was changed from
  field:char comm[16];    offset:12;    size:16;    signed:0;
to
  field:char comm[TASK_COMM_LEN];    offset:12;    size:16;    signed:0;

John reported that this change breaks older versions of perfetto.
Then Mathieu pointed out that this behavioral change was caused by the
use of __stringify(_len), which happens to work on macros, but not on enum
labels. And he also gave the suggestion on how to fix it:
  :One possible solution to make this more robust would be to extend
  :struct trace_event_fields with one more field that indicates the length
  :of an array as an actual integer, without storing it in its stringified
  :form in the type, and do the formatting in f_show where it belongs.

The result as follows after this change,
$ cat /sys/kernel/tracing/events/task/task_newtask/format
        field:char comm[16];    offset:12;      size:16;        signed:0;

Link: https://lore.kernel.org/lkml/Y+QaZtz55LIirsUO@google.com/
Link: https://lore.kernel.org/linux-trace-kernel/20230210155921.4610-1-laoar.shao@gmail.com/
Link: https://lore.kernel.org/linux-trace-kernel/20230212151303.12353-1-laoar.shao@gmail.com
Cc: stable@vger.kernel.org
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Kajetan Puchalski <kajetan.puchalski@arm.com>
CC: Qais Yousef <qyousef@layalina.io>
Fixes: 3087c61ed2c4 ("tools/testing/selftests/bpf: replace open-coded 16 with TASK_COMM_LEN")
Reported-by: John Stultz <jstultz@google.com>
Debugged-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Suggested-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
15 months agoMerge tag 'spi-fix-v6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Linus Torvalds [Sun, 12 Feb 2023 00:39:05 +0000 (16:39 -0800)]
Merge tag 'spi-fix-v6.2-rc7' of git://git./linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A couple of hopefully final fixes for spi: one driver specific fix for
  an issue with very large transfers and a fix for an issue with the
  locking fixes in spidev merged earlier this release cycle which was
  missed"

* tag 'spi-fix-v6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: spidev: fix a recursive locking error
  spi: dw: Fix wrong FIFO level setting for long xfers

15 months agoMerge tag 'x86-urgent-2023-02-11' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 11 Feb 2023 19:17:21 +0000 (11:17 -0800)]
Merge tag 'x86-urgent-2023-02-11' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
 "Fix a kprobes bug, plus add a new Intel model number to the upstream
  <asm/intel-family.h> header for drivers to use"

* tag 'x86-urgent-2023-02-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/cpu: Add Lunar Lake M
  x86/kprobes: Fix 1 byte conditional jump target

15 months agoMerge tag 'locking-urgent-2023-02-11' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 11 Feb 2023 19:11:18 +0000 (11:11 -0800)]
Merge tag 'locking-urgent-2023-02-11' of git://git./linux/kernel/git/tip/tip

Pull locking fix from Ingo Molnar:
 "Fix an rtmutex missed-wakeup bug"

* tag 'locking-urgent-2023-02-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  rtmutex: Ensure that the top waiter is always woken up

15 months agoMerge tag 'cxl-fixes-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl
Linus Torvalds [Sat, 11 Feb 2023 19:03:25 +0000 (11:03 -0800)]
Merge tag 'cxl-fixes-6.2' of git://git./linux/kernel/git/cxl/cxl

Pull cxl fixes from Dan Williams:
 "Two fixups for CXL (Compute Express Link) in presence of passthrough
  decoders.

  This primarily helps developers using the QEMU CXL emulation, but with
  the impending arrival of CXL switches these types of topologies will
  be of interest to end users.

   - Fix a crash when shutting down regions in the presence of
     passthrough decoders

   - Fix region creation to understand passthrough decoders instead of
     the narrower definition of passthrough ports"

* tag 'cxl-fixes-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl:
  cxl/region: Fix passthrough-decoder detection
  cxl/region: Fix null pointer dereference for resetting decoder

15 months agoMerge tag 'libnvdimm-fixes-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 11 Feb 2023 18:58:36 +0000 (10:58 -0800)]
Merge tag 'libnvdimm-fixes-6.2' of git://git./linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:
 "A fix for an issue that could causes users to inadvertantly reserve
  too much capacity when debugging the KMSAN and persistent memory
  namespace, a lockdep fix, and a kernel-doc build warning:

   - Resolve the conflict between KMSAN and NVDIMM with respect to
     reserving pmem namespace / volume capacity for larger sizeof(struct
     page)

   - Fix a lockdep warning in the the NFIT code

   - Fix a kernel-doc build warning"

* tag 'libnvdimm-fixes-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  nvdimm: Support sizeof(struct page) > MAX_STRUCT_PAGE_SIZE
  ACPI: NFIT: fix a potential deadlock during NFIT teardown
  dax: super.c: fix kernel-doc bad line warning

15 months agoMerge tag 'fixes-2023-02-11' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt...
Linus Torvalds [Sat, 11 Feb 2023 18:51:45 +0000 (10:51 -0800)]
Merge tag 'fixes-2023-02-11' of git://git./linux/kernel/git/rppt/memblock

Pull memblock revert from Mike Rapoport:
 "Revert 'mm: Always release pages to the buddy allocator in
  memblock_free_late()'

  The pages being freed by memblock_free_late() have already been
  initialized, but if they are in the deferred init range,
  __free_one_page() might access nearby uninitialized pages when trying
  to coalesce buddies, which will cause a crash.

  A proper fix will be more involved so revert this change for the time
  being"

* tag 'fixes-2023-02-11' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
  Revert "mm: Always release pages to the buddy allocator in memblock_free_late()."

15 months agoALSA: hda: make kobj_type structure constant
Thomas Weißschuh [Sat, 11 Feb 2023 03:33:53 +0000 (03:33 +0000)]
ALSA: hda: make kobj_type structure constant

Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.

Take advantage of this to constify the structure definition to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20230211-kobj_type-sound-v1-1-17107ceb25b7@weissschuh.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoALSA: hda: Fix codec device field initializan
Cezary Rojewski [Fri, 10 Feb 2023 16:55:41 +0000 (17:55 +0100)]
ALSA: hda: Fix codec device field initializan

Commit f2bd1c5ae2cb ("ALSA: hda: Fix page fault in
snd_hda_codec_shutdown()") relocated initialization of several codec
device fields. Due to differences between codec_exec_verb() and
snd_hdac_bus_exec_bus() in how they handle VERB execution - the latter
does not touch PM - assigning ->exec_verb to codec_exec_verb() causes PM
to be engaged before it is configured for the device. Configuration of
PM for the ASoC HDAudio sound card is done with snd_hda_set_power_save()
during skl_hda_audio_probe() whereas the assignment happens early, in
snd_hda_codec_device_init().

Revert to previous behavior to avoid problems caused by too early PM
manipulation.

Suggested-by: Jason Montleon <jmontleo@redhat.com>
Link: https://lore.kernel.org/regressions/CALFERdzKUodLsm6=Ub3g2+PxpNpPtPq3bGBLbff=eZr9_S=YVA@mail.gmail.com
Fixes: f2bd1c5ae2cb ("ALSA: hda: Fix page fault in snd_hda_codec_shutdown()")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230210165541.3543604-1-cezary.rojewski@intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 months agoMerge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 10 Feb 2023 23:28:08 +0000 (15:28 -0800)]
Merge tag 'clk-fixes-for-linus' of git://git./linux/kernel/git/clk/linux

Pull clk fixes from Stephen Boyd:
 "Two clk driver fixes

   - Use devm_kasprintf() to avoid overflows when forming clk names in
     the Microchip PolarFire driver

   - Fix the pretty broken Ingenic JZ4760 M/N/OD calculation to actually
     work and find proper divisors"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk: ingenic: jz4760: Update M/N/OD calculation algorithm
  clk: microchip: mpfs-ccc: Use devm_kasprintf() for allocating formatted strings

15 months agoMerge tag 'pinctrl-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Fri, 10 Feb 2023 23:02:16 +0000 (15:02 -0800)]
Merge tag 'pinctrl-v6.2-3' of git://git./linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
 "Some assorted pin control fixes, the most interesting will be the
  Intel patch fixing a classic problem: laptop touchpad IRQs...

   - Some pin drive register fixes in the Mediatek driver.

   - Return proper error code in the Aspeed driver, and revert and
     ill-advised force-disablement patch that needs to be reworked.

   - Fix AMD driver debug output.

   - Fix potential NULL dereference in the Single driver.

   - Fix a group definition error in the Qualcomm SM8450 LPASS driver.

   - Restore pins used in direct IRQ mode in the Intel driver (This
     fixes some laptop touchpads!)"

* tag 'pinctrl-v6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: intel: Restore the pins that used to be in Direct IRQ mode
  pinctrl: qcom: sm8450-lpass-lpi: correct swr_rx_data group
  pinctrl: aspeed: Revert "Force to disable the function's signal"
  pinctrl: single: fix potential NULL dereference
  pinctrl: amd: Fix debug output for debounce time
  pinctrl: aspeed: Fix confusing types in return value
  pinctrl: mediatek: Fix the drive register definition of some Pins

15 months agoMerge tag 'pci-v6.2-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
Linus Torvalds [Fri, 10 Feb 2023 22:18:48 +0000 (14:18 -0800)]
Merge tag 'pci-v6.2-fixes-2' of git://git./linux/kernel/git/pci/pci

Pull PCI fixes from Bjorn Helgaas:

 - Move to a shared PCI git tree (Bjorn Helgaas)

 - Add Krzysztof Wilczyński as another PCI maintainer (Lorenzo
   Pieralisi)

 - Revert a couple ASPM patches to fix suspend/resume regressions (Bjorn
   Helgaas)

* tag 'pci-v6.2-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
  Revert "PCI/ASPM: Refactor L1 PM Substates Control Register programming"
  Revert "PCI/ASPM: Save L1 PM Substates Capability for suspend/resume"
  MAINTAINERS: Promote Krzysztof to PCI controller maintainer
  MAINTAINERS: Move to shared PCI tree

15 months agoRevert "PCI/ASPM: Refactor L1 PM Substates Control Register programming"
Bjorn Helgaas [Fri, 3 Feb 2023 19:57:39 +0000 (13:57 -0600)]
Revert "PCI/ASPM: Refactor L1 PM Substates Control Register programming"

This reverts commit 5e85eba6f50dc288c22083a7e213152bcc4b8208.

Thomas Witt reported that 5e85eba6f50d ("PCI/ASPM: Refactor L1 PM Substates
Control Register programming") broke suspend/resume on a Tuxedo
Infinitybook S 14 v5, which seems to use a Clevo L140CU Mainboard.

The main symptom is:

  iwlwifi 0000:02:00.0: Unable to change power state from D3hot to D0, device inaccessible
  nvme 0000:03:00.0: Unable to change power state from D3hot to D0, device inaccessible

and the machine is only partially usable after resume.  It can't run dmesg
and can't do a clean reboot.  This happens on every suspend/resume cycle.

Revert 5e85eba6f50d until we can figure out the root cause.

Fixes: 5e85eba6f50d ("PCI/ASPM: Refactor L1 PM Substates Control Register programming")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216877
Reported-by: Thomas Witt <kernel@witt.link>
Tested-by: Thomas Witt <kernel@witt.link>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org # v6.1+
Cc: Vidya Sagar <vidyas@nvidia.com>
15 months agoRevert "PCI/ASPM: Save L1 PM Substates Capability for suspend/resume"
Bjorn Helgaas [Fri, 3 Feb 2023 19:57:29 +0000 (13:57 -0600)]
Revert "PCI/ASPM: Save L1 PM Substates Capability for suspend/resume"

This reverts commit 4ff116d0d5fd8a025604b0802d93a2d5f4e465d1.

Tasev Nikola and Mark Enriquez reported that resume from suspend was broken
in v6.1-rc1.  Tasev bisected to a47126ec29f5 ("PCI/PTM: Cache PTM
Capability offset"), but we can't figure out how that could be related.

Mark saw the same symptoms and bisected to 4ff116d0d5fd ("PCI/ASPM: Save L1
PM Substates Capability for suspend/resume"), which does have a connection:
it restores L1 Substates configuration while ASPM L1 may be enabled:

  pci_restore_state
    pci_restore_aspm_l1ss_state
      aspm_program_l1ss
        pci_write_config_dword(PCI_L1SS_CTL1, ctl1)         # L1SS restore
    pci_restore_pcie_state
      pcie_capability_write_word(PCI_EXP_LNKCTL, cap[i++])  # L1 restore

which is a problem because PCIe r6.0, sec 5.5.4, requires that:

  If setting either or both of the enable bits for ASPM L1 PM
  Substates, both ports must be configured as described in this
  section while ASPM L1 is disabled.

Separately, Thomas Witt reported that 5e85eba6f50d ("PCI/ASPM: Refactor L1
PM Substates Control Register programming") broke suspend/resume, and it
depends on 4ff116d0d5fd.

Revert 4ff116d0d5fd ("PCI/ASPM: Save L1 PM Substates Capability for
suspend/resume") to fix the resume issue and enable revert of 5e85eba6f50d
to fix the issue Thomas reported.

Note that reverting 4ff116d0d5fd means L1 Substates config may be lost on
suspend/resume.  As far as we know the system will use more power but will
still *work* correctly.

Fixes: 4ff116d0d5fd ("PCI/ASPM: Save L1 PM Substates Capability for suspend/resume")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216782
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216877
Reported-by: Tasev Nikola <tasev.stefanoska@skynet.be>
Reported-by: Mark Enriquez <enriquezmark36@gmail.com>
Reported-by: Thomas Witt <kernel@witt.link>
Tested-by: Mark Enriquez <enriquezmark36@gmail.com>
Tested-by: Thomas Witt <kernel@witt.link>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org # v6.1+
Cc: Vidya Sagar <vidyas@nvidia.com>
15 months agoMerge tag 'soc-fixes-6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Linus Torvalds [Fri, 10 Feb 2023 17:48:42 +0000 (09:48 -0800)]
Merge tag 'soc-fixes-6.2-4' of git://git./linux/kernel/git/soc/soc

Pull ARM SoC fixes from Arnd Bergmann:
 "All the changes this time are minor devicetree corrections, the
  majority being for 64-bit Rockchip SoC support. These are a couple of
  corrections for properties that are in violation of the binding, some
  that put the machine into safer operating points for the eMMC and
  thermal settings, and missing properties that prevented rk356x PCIe
  and ethernet from working correctly.

  The changes for amlogic and mediatek address incorrect properties that
  were preventing the display support on MT8195 and the MMC support on
  various Meson SoCs from working correctly.

  The stihxxx-b2120 change fixes the GPIO polarity for the DVB tuner to
  allow this to be used correctly after a futre driver change, though it
  has no effect on older kernels"

* tag 'soc-fixes-6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
  arm64: dts: meson-gx: Make mmc host controller interrupts level-sensitive
  arm64: dts: meson-g12-common: Make mmc host controller interrupts level-sensitive
  arm64: dts: meson-axg: Make mmc host controller interrupts level-sensitive
  ARM: dts: stihxxx-b2120: fix polarity of reset line of tsin0 port
  arm64: dts: mediatek: mt8195: Fix vdosys* compatible strings
  arm64: dts: rockchip: align rk3399 DMC OPP table with bindings
  arm64: dts: rockchip: set sdmmc0 speed to sd-uhs-sdr50 on rock-3a
  arm64: dts: rockchip: fix probe of analog sound card on rock-3a
  arm64: dts: rockchip: add missing #interrupt-cells to rk356x pcie2x1
  arm64: dts: rockchip: fix input enable pinconf on rk3399
  ARM: dts: rockchip: add power-domains property to dp node on rk3288
  arm64: dts: rockchip: add io domain setting to rk3566-box-demo
  arm64: dts: rockchip: remove unsupported property from sdmmc2 for rock-3a
  arm64: dts: rockchip: drop unused LED mode property from rk3328-roc-cc
  arm64: dts: rockchip: reduce thermal limits on rk3399-pinephone-pro
  arm64: dts: rockchip: use correct reset names for rk3399 crypto nodes

15 months agoMerge tag 'riscv-for-linus-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 10 Feb 2023 17:27:52 +0000 (09:27 -0800)]
Merge tag 'riscv-for-linus-6.2-rc8' of git://git./linux/kernel/git/riscv/linux

Pull RISC-V fixes from Palmer Dabbelt:
 "This is a little bigger that I'd hope for this late in the cycle, but
  they're all pretty concrete fixes and the only one that's bigger than
  a few lines is pmdp_collapse_flush() (which is almost all
  boilerplate/comment). It's also all bug fixes for issues that have
  been around for a while.

  So I think it's not all that scary, just bad timing.

   - avoid partial TLB fences for huge pages, which are disallowed by
     the ISA

   - avoid missing a frame when dumping stacks

   - avoid misaligned accesses (and possibly overflows) in kprobes

   - fix a race condition in tracking page dirtiness"

* tag 'riscv-for-linus-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  riscv: Fixup race condition on PG_dcache_clean in flush_icache_pte
  riscv: kprobe: Fixup misaligned load text
  riscv: stacktrace: Fix missing the first frame
  riscv: mm: Implement pmdp_collapse_flush for THP

15 months agoMerge tag 'ceph-for-6.2-rc8' of https://github.com/ceph/ceph-client
Linus Torvalds [Fri, 10 Feb 2023 17:04:00 +0000 (09:04 -0800)]
Merge tag 'ceph-for-6.2-rc8' of https://github.com/ceph/ceph-client

Pull ceph fix from Ilya Dryomov:
 "A fix for a pretty embarrassing omission in the session flush handler
  from Xiubo, marked for stable"

* tag 'ceph-for-6.2-rc8' of https://github.com/ceph/ceph-client:
  ceph: flush cap releases when the session is flushed

15 months agoMerge tag 'block-6.2-2023-02-10' of git://git.kernel.dk/linux
Linus Torvalds [Fri, 10 Feb 2023 16:55:09 +0000 (08:55 -0800)]
Merge tag 'block-6.2-2023-02-10' of git://git.kernel.dk/linux

Pull block fix from Jens Axboe:
 "A single fix for a smatch regression introduced in this merge window"

* tag 'block-6.2-2023-02-10' of git://git.kernel.dk/linux:
  nvme-auth: mark nvme_auth_wq static

15 months agoMerge tag 'sound-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
Linus Torvalds [Fri, 10 Feb 2023 16:37:48 +0000 (08:37 -0800)]
Merge tag 'sound-6.2-rc8' of git://git./linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Hopefully the last one for 6.2, a collection of the fixes that have
  been gathered since the last pull.

  All changes are small and trivial device-specific fixes"

* tag 'sound-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek: Add Positivo N14KP6-TG
  ASoC: topology: Return -ENOMEM on memory allocation failure
  ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control()
  ASoC: fsl_sai: fix getting version from VERID
  ALSA: hda/realtek: fix mute/micmute LEDs don't work for a HP platform.
  ALSA: hda/realtek: Add quirk for ASUS UM3402 using CS35L41
  ASoC: codecs: es8326: Fix DTS properties reading
  ASoC: tas5805m: add missing page switch.
  ASoC: tas5805m: rework to avoid scheduling while atomic.
  ALSA: hda/realtek: Enable mute/micmute LEDs on HP Elitebook, 645 G9
  ASoC: SOF: amd: Fix for handling spurious interrupts from DSP
  ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book2 Pro 360
  ALSA: pci: lx6464es: fix a debug loop
  ASoC: rt715-sdca: fix clock stop prepare timeout issue

15 months agoASoC: rt712-sdca: fix coding style and unconditionally return issues
Shuming Fan [Fri, 10 Feb 2023 08:21:41 +0000 (16:21 +0800)]
ASoC: rt712-sdca: fix coding style and unconditionally return issues

This patch fixes
1. coding style issues
2. check if the setting was set already in rt712_sdca_mux_put callback

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230210082141.24077-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoASoC: rsnd: core.c: indicate warning if strange TDM width was set
Kuninori Morimoto [Fri, 10 Feb 2023 05:13:43 +0000 (05:13 +0000)]
ASoC: rsnd: core.c: indicate warning if strange TDM width was set

Current rsnd silently uses default TDM width if it was strange
settings. It is difficult to notice about it.
This patch indicates warning for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lel6ksqn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>