* [PATCH AUTOSEL 5.4 02/12] ASoC: nau8822: Fix incorrect type in assignment and cast to restricted __be16
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
@ 2023-12-11 14:01 ` Sasha Levin
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 03/12] ASoC: Intel: Skylake: mem leak in skl register function Sasha Levin
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: David Lin, kernel test robot, Mark Brown, Sasha Levin, lgirdwood,
perex, tiwai, francesco.dolcini, emanuele.ghidoli,
u.kleine-koenig, linux-sound
From: David Lin <CTLIN0@nuvoton.com>
[ Upstream commit c1501f2597dd08601acd42256a4b0a0fc36bf302 ]
This issue is reproduced when W=1 build in compiler gcc-12.
The following are sparse warnings:
sound/soc/codecs/nau8822.c:199:25: sparse: sparse: incorrect type in assignment
sound/soc/codecs/nau8822.c:199:25: sparse: expected unsigned short
sound/soc/codecs/nau8822.c:199:25: sparse: got restricted __be16
sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16
sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16
sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16
sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311122320.T1opZVkP-lkp@intel.com/
Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20231117043011.1747594-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/nau8822.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c
index cd163978792e9..1450a84df4e87 100644
--- a/sound/soc/codecs/nau8822.c
+++ b/sound/soc/codecs/nau8822.c
@@ -184,6 +184,7 @@ static int nau8822_eq_get(struct snd_kcontrol *kcontrol,
struct soc_bytes_ext *params = (void *)kcontrol->private_value;
int i, reg;
u16 reg_val, *val;
+ __be16 tmp;
val = (u16 *)ucontrol->value.bytes.data;
reg = NAU8822_REG_EQ1;
@@ -192,8 +193,8 @@ static int nau8822_eq_get(struct snd_kcontrol *kcontrol,
/* conversion of 16-bit integers between native CPU format
* and big endian format
*/
- reg_val = cpu_to_be16(reg_val);
- memcpy(val + i, ®_val, sizeof(reg_val));
+ tmp = cpu_to_be16(reg_val);
+ memcpy(val + i, &tmp, sizeof(tmp));
}
return 0;
@@ -216,6 +217,7 @@ static int nau8822_eq_put(struct snd_kcontrol *kcontrol,
void *data;
u16 *val, value;
int i, reg, ret;
+ __be16 *tmp;
data = kmemdup(ucontrol->value.bytes.data,
params->max, GFP_KERNEL | GFP_DMA);
@@ -228,7 +230,8 @@ static int nau8822_eq_put(struct snd_kcontrol *kcontrol,
/* conversion of 16-bit integers between native CPU format
* and big endian format
*/
- value = be16_to_cpu(*(val + i));
+ tmp = (__be16 *)(val + i);
+ value = be16_to_cpup(tmp);
ret = snd_soc_component_write(component, reg + i, value);
if (ret) {
dev_err(component->dev,
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 03/12] ASoC: Intel: Skylake: mem leak in skl register function
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 02/12] ASoC: nau8822: Fix incorrect type in assignment and cast to restricted __be16 Sasha Levin
@ 2023-12-11 14:01 ` Sasha Levin
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 04/12] ASoC: cs43130: Fix the position of const qualifier Sasha Levin
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Kamil Duljas, Amadeusz Sławiński, Mark Brown,
Sasha Levin, cezary.rojewski, pierre-louis.bossart,
liam.r.girdwood, peter.ujfalusi, yung-chuan.liao,
ranjani.sridharan, kai.vehmanen, perex, tiwai, zhangyiqun,
kuninori.morimoto.gx, suhui, alsa-devel, linux-sound
From: Kamil Duljas <kamil.duljas@gmail.com>
[ Upstream commit f8ba14b780273fd290ddf7ee0d7d7decb44cc365 ]
skl_platform_register() uses krealloc. When krealloc is fail,
then previous memory is not freed. The leak is also when soc
component registration failed.
Signed-off-by: Kamil Duljas <kamil.duljas@gmail.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20231116224112.2209-2-kamil.duljas@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/intel/skylake/skl-pcm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 19176ae272742..3256f7c4eb747 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -1492,6 +1492,7 @@ int skl_platform_register(struct device *dev)
dais = krealloc(skl->dais, sizeof(skl_fe_dai) +
sizeof(skl_platform_dai), GFP_KERNEL);
if (!dais) {
+ kfree(skl->dais);
ret = -ENOMEM;
goto err;
}
@@ -1504,8 +1505,10 @@ int skl_platform_register(struct device *dev)
ret = devm_snd_soc_register_component(dev, &skl_component,
skl->dais, num_dais);
- if (ret)
+ if (ret) {
+ kfree(skl->dais);
dev_err(dev, "soc component registration failed %d\n", ret);
+ }
err:
return ret;
}
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 04/12] ASoC: cs43130: Fix the position of const qualifier
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 02/12] ASoC: nau8822: Fix incorrect type in assignment and cast to restricted __be16 Sasha Levin
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 03/12] ASoC: Intel: Skylake: mem leak in skl register function Sasha Levin
@ 2023-12-11 14:01 ` Sasha Levin
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 05/12] ASoC: cs43130: Fix incorrect frame delay configuration Sasha Levin
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Maciej Strozek, Charles Keepax, Mark Brown, Sasha Levin,
james.schulman, david.rhodes, rf, lgirdwood, perex, tiwai,
alsa-devel, patches, linux-sound
From: Maciej Strozek <mstrozek@opensource.cirrus.com>
[ Upstream commit e7f289a59e76a5890a57bc27b198f69f175f75d9 ]
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231117141344.64320-2-mstrozek@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs43130.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index 8f70dee958786..285806868c405 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -1683,7 +1683,7 @@ static ssize_t cs43130_show_dc_r(struct device *dev,
return cs43130_show_dc(dev, buf, HP_RIGHT);
}
-static u16 const cs43130_ac_freq[CS43130_AC_FREQ] = {
+static const u16 cs43130_ac_freq[CS43130_AC_FREQ] = {
24,
43,
93,
@@ -2364,7 +2364,7 @@ static const struct regmap_config cs43130_regmap = {
.use_single_write = true,
};
-static u16 const cs43130_dc_threshold[CS43130_DC_THRESHOLD] = {
+static const u16 cs43130_dc_threshold[CS43130_DC_THRESHOLD] = {
50,
120,
};
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 05/12] ASoC: cs43130: Fix incorrect frame delay configuration
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
` (2 preceding siblings ...)
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 04/12] ASoC: cs43130: Fix the position of const qualifier Sasha Levin
@ 2023-12-11 14:01 ` Sasha Levin
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 06/12] ASoC: rt5650: add mutex to avoid the jack detection failure Sasha Levin
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Maciej Strozek, Charles Keepax, Mark Brown, Sasha Levin,
james.schulman, david.rhodes, rf, lgirdwood, perex, tiwai,
alsa-devel, patches, linux-sound
From: Maciej Strozek <mstrozek@opensource.cirrus.com>
[ Upstream commit aa7e8e5e4011571022dc06e4d7a2f108feb53d1a ]
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231117141344.64320-3-mstrozek@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs43130.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index 285806868c405..02fb9317b6970 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -578,7 +578,7 @@ static int cs43130_set_sp_fmt(int dai_id, unsigned int bitwidth_sclk,
break;
case SND_SOC_DAIFMT_LEFT_J:
hi_size = bitwidth_sclk;
- frm_delay = 2;
+ frm_delay = 0;
frm_phase = 1;
break;
case SND_SOC_DAIFMT_DSP_A:
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 06/12] ASoC: rt5650: add mutex to avoid the jack detection failure
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
` (3 preceding siblings ...)
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 05/12] ASoC: cs43130: Fix incorrect frame delay configuration Sasha Levin
@ 2023-12-11 14:01 ` Sasha Levin
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 07/12] nouveau/tu102: flush all pdbs on vmm flush Sasha Levin
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:01 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Shuming Fan, Mark Brown, Sasha Levin, oder_chiou, lgirdwood,
perex, tiwai, linux-sound
From: Shuming Fan <shumingf@realtek.com>
[ Upstream commit cdba4301adda7c60a2064bf808e48fccd352aaa9 ]
This patch adds the jd_mutex to protect the jack detection control flow.
And only the headset type could check the button status.
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20231122100123.2831753-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5645.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 9fda0e5548dc6..c9512e97c12e5 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -421,6 +421,7 @@ struct rt5645_priv {
struct regulator_bulk_data supplies[ARRAY_SIZE(rt5645_supply_names)];
struct rt5645_eq_param_s *eq_param;
struct timer_list btn_check_timer;
+ struct mutex jd_mutex;
int codec_type;
int sysclk;
@@ -3179,6 +3180,8 @@ static int rt5645_jack_detect(struct snd_soc_component *component, int jack_inse
rt5645_enable_push_button_irq(component, true);
}
} else {
+ if (rt5645->en_button_func)
+ rt5645_enable_push_button_irq(component, false);
snd_soc_dapm_disable_pin(dapm, "Mic Det Power");
snd_soc_dapm_sync(dapm);
rt5645->jack_type = SND_JACK_HEADPHONE;
@@ -3259,6 +3262,8 @@ static void rt5645_jack_detect_work(struct work_struct *work)
if (!rt5645->component)
return;
+ mutex_lock(&rt5645->jd_mutex);
+
switch (rt5645->pdata.jd_mode) {
case 0: /* Not using rt5645 JD */
if (rt5645->gpiod_hp_det) {
@@ -3283,7 +3288,7 @@ static void rt5645_jack_detect_work(struct work_struct *work)
if (!val && (rt5645->jack_type == 0)) { /* jack in */
report = rt5645_jack_detect(rt5645->component, 1);
- } else if (!val && rt5645->jack_type != 0) {
+ } else if (!val && rt5645->jack_type == SND_JACK_HEADSET) {
/* for push button and jack out */
btn_type = 0;
if (snd_soc_component_read32(rt5645->component, RT5645_INT_IRQ_ST) & 0x4) {
@@ -3339,6 +3344,8 @@ static void rt5645_jack_detect_work(struct work_struct *work)
rt5645_jack_detect(rt5645->component, 0);
}
+ mutex_unlock(&rt5645->jd_mutex);
+
snd_soc_jack_report(rt5645->hp_jack, report, SND_JACK_HEADPHONE);
snd_soc_jack_report(rt5645->mic_jack, report, SND_JACK_MICROPHONE);
if (rt5645->en_button_func)
@@ -4041,6 +4048,7 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
}
timer_setup(&rt5645->btn_check_timer, rt5645_btn_check_callback, 0);
+ mutex_init(&rt5645->jd_mutex);
INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work);
INIT_DELAYED_WORK(&rt5645->rcclock_work, rt5645_rcclock_work);
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 07/12] nouveau/tu102: flush all pdbs on vmm flush
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
` (4 preceding siblings ...)
2023-12-11 14:01 ` [PATCH AUTOSEL 5.4 06/12] ASoC: rt5650: add mutex to avoid the jack detection failure Sasha Levin
@ 2023-12-11 14:02 ` Sasha Levin
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 08/12] net/tg3: fix race condition in tg3_reset_task() Sasha Levin
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Dave Airlie, Danilo Krummrich, Sasha Levin, kherbst, lyude,
airlied, daniel, bskeggs, dri-devel, nouveau
From: Dave Airlie <airlied@redhat.com>
[ Upstream commit cb9c919364653eeafb49e7ff5cd32f1ad64063ac ]
This is a hack around a bug exposed with the GSP code, I'm not sure
what is happening exactly, but it appears some of our flushes don't
result in proper tlb invalidation for out BAR2 and we get a BAR2
fault from GSP and it all dies.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231130010852.4034774-1-airlied@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c
index be91cffc3b52a..315000b2f8e3e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmtu102.c
@@ -32,7 +32,7 @@ tu102_vmm_flush(struct nvkm_vmm *vmm, int depth)
type = 0x00000001; /* PAGE_ALL */
if (atomic_read(&vmm->engref[NVKM_SUBDEV_BAR]))
- type |= 0x00000004; /* HUB_ONLY */
+ type |= 0x00000006; /* HUB_ONLY | ALL PDB (hack) */
mutex_lock(&subdev->mutex);
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 08/12] net/tg3: fix race condition in tg3_reset_task()
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
` (5 preceding siblings ...)
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 07/12] nouveau/tu102: flush all pdbs on vmm flush Sasha Levin
@ 2023-12-11 14:02 ` Sasha Levin
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 09/12] ASoC: da7219: Support low DC impedance headset Sasha Levin
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Thinh Tran, Venkata Sai Duggi, David Christensen, Michael Chan,
Jakub Kicinski, Sasha Levin, pavan.chebbi, mchan, davem, edumazet,
pabeni, netdev
From: Thinh Tran <thinhtr@linux.vnet.ibm.com>
[ Upstream commit 16b55b1f2269962fb6b5154b8bf43f37c9a96637 ]
When an EEH error is encountered by a PCI adapter, the EEH driver
modifies the PCI channel's state as shown below:
enum {
/* I/O channel is in normal state */
pci_channel_io_normal = (__force pci_channel_state_t) 1,
/* I/O to channel is blocked */
pci_channel_io_frozen = (__force pci_channel_state_t) 2,
/* PCI card is dead */
pci_channel_io_perm_failure = (__force pci_channel_state_t) 3,
};
If the same EEH error then causes the tg3 driver's transmit timeout
logic to execute, the tg3_tx_timeout() function schedules a reset
task via tg3_reset_task_schedule(), which may cause a race condition
between the tg3 and EEH driver as both attempt to recover the HW via
a reset action.
EEH driver gets error event
--> eeh_set_channel_state()
and set device to one of
error state above scheduler: tg3_reset_task() get
returned error from tg3_init_hw()
--> dev_close() shuts down the interface
tg3_io_slot_reset() and
tg3_io_resume() fail to
reset/resume the device
To resolve this issue, we avoid the race condition by checking the PCI
channel state in the tg3_reset_task() function and skip the tg3 driver
initiated reset when the PCI channel is not in the normal state. (The
driver has no access to tg3 device registers at this point and cannot
even complete the reset task successfully without external assistance.)
We'll leave the reset procedure to be managed by the EEH driver which
calls the tg3_io_error_detected(), tg3_io_slot_reset() and
tg3_io_resume() functions as appropriate.
Adding the same checking in tg3_dump_state() to avoid dumping all
device registers when the PCI channel is not in the normal state.
Signed-off-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>
Tested-by: Venkata Sai Duggi <venkata.sai.duggi@ibm.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20231201001911.656-1-thinhtr@linux.vnet.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/tg3.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 90bfaea6d6292..74710f523f356 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -6460,6 +6460,14 @@ static void tg3_dump_state(struct tg3 *tp)
int i;
u32 *regs;
+ /* If it is a PCI error, all registers will be 0xffff,
+ * we don't dump them out, just report the error and return
+ */
+ if (tp->pdev->error_state != pci_channel_io_normal) {
+ netdev_err(tp->dev, "PCI channel ERROR!\n");
+ return;
+ }
+
regs = kzalloc(TG3_REG_BLK_SIZE, GFP_ATOMIC);
if (!regs)
return;
@@ -11196,7 +11204,8 @@ static void tg3_reset_task(struct work_struct *work)
rtnl_lock();
tg3_full_lock(tp, 0);
- if (tp->pcierr_recovery || !netif_running(tp->dev)) {
+ if (tp->pcierr_recovery || !netif_running(tp->dev) ||
+ tp->pdev->error_state != pci_channel_io_normal) {
tg3_flag_clear(tp, RESET_TASK_PENDING);
tg3_full_unlock(tp);
rtnl_unlock();
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 09/12] ASoC: da7219: Support low DC impedance headset
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
` (6 preceding siblings ...)
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 08/12] net/tg3: fix race condition in tg3_reset_task() Sasha Levin
@ 2023-12-11 14:02 ` Sasha Levin
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 10/12] nvme: introduce helper function to get ctrl state Sasha Levin
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: David Rau, Mark Brown, Sasha Levin, support.opensource, lgirdwood,
perex, tiwai, linux-sound
From: David Rau <David.Rau.opensource@dm.renesas.com>
[ Upstream commit 5f44de697383fcc9a9a1a78f99e09d1838704b90 ]
Change the default MIC detection impedance threshold to 200ohm
to support low mic DC impedance headset.
Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com>
Link: https://lore.kernel.org/r/20231201042933.26392-1-David.Rau.opensource@dm.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/da7219-aad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c
index befe26749bc2b..e4e314604c0a1 100644
--- a/sound/soc/codecs/da7219-aad.c
+++ b/sound/soc/codecs/da7219-aad.c
@@ -655,7 +655,7 @@ static struct da7219_aad_pdata *da7219_aad_fw_to_pdata(struct snd_soc_component
aad_pdata->mic_det_thr =
da7219_aad_fw_mic_det_thr(component, fw_val32);
else
- aad_pdata->mic_det_thr = DA7219_AAD_MIC_DET_THR_500_OHMS;
+ aad_pdata->mic_det_thr = DA7219_AAD_MIC_DET_THR_200_OHMS;
if (fwnode_property_read_u32(aad_np, "dlg,jack-ins-deb", &fw_val32) >= 0)
aad_pdata->jack_ins_deb =
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 10/12] nvme: introduce helper function to get ctrl state
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
` (7 preceding siblings ...)
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 09/12] ASoC: da7219: Support low DC impedance headset Sasha Levin
@ 2023-12-11 14:02 ` Sasha Levin
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 11/12] drm/exynos: fix a potential error pointer dereference Sasha Levin
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 12/12] drm/exynos: fix a wrong error checking Sasha Levin
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:02 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Keith Busch, Sagi Grimberg, Sasha Levin, linux-nvme
From: Keith Busch <kbusch@kernel.org>
[ Upstream commit 5c687c287c46fadb14644091823298875a5216aa ]
The controller state is typically written by another CPU, so reading it
should ensure no optimizations are taken. This is a repeated pattern in
the driver, so start with adding a convenience function that returns the
controller state with READ_ONCE().
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/nvme.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 17c0d6ae3eeeb..c492d7d323987 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -292,6 +292,11 @@ struct nvme_ctrl {
struct nvme_fault_inject fault_inject;
};
+static inline enum nvme_ctrl_state nvme_ctrl_state(struct nvme_ctrl *ctrl)
+{
+ return READ_ONCE(ctrl->state);
+}
+
enum nvme_iopolicy {
NVME_IOPOLICY_NUMA,
NVME_IOPOLICY_RR,
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 11/12] drm/exynos: fix a potential error pointer dereference
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
` (8 preceding siblings ...)
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 10/12] nvme: introduce helper function to get ctrl state Sasha Levin
@ 2023-12-11 14:02 ` Sasha Levin
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 12/12] drm/exynos: fix a wrong error checking Sasha Levin
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Xiang Yang, Inki Dae, Sasha Levin, sw0312.kim, kyungmin.park,
airlied, daniel, krzysztof.kozlowski, dri-devel, linux-arm-kernel,
linux-samsung-soc
From: Xiang Yang <xiangyang3@huawei.com>
[ Upstream commit 73bf1c9ae6c054c53b8e84452c5e46f86dd28246 ]
Smatch reports the warning below:
drivers/gpu/drm/exynos/exynos_hdmi.c:1864 hdmi_bind()
error: 'crtc' dereferencing possible ERR_PTR()
The return value of exynos_drm_crtc_get_by_type maybe ERR_PTR(-ENODEV),
which can not be used directly. Fix this by checking the return value
before using it.
Signed-off-by: Xiang Yang <xiangyang3@huawei.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/exynos/exynos_hdmi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 0073a2b3b80a2..93b2af4936d0e 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1850,6 +1850,8 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
return ret;
crtc = exynos_drm_crtc_get_by_type(drm_dev, EXYNOS_DISPLAY_TYPE_HDMI);
+ if (IS_ERR(crtc))
+ return PTR_ERR(crtc);
crtc->pipe_clk = &hdata->phy_clk;
ret = hdmi_create_connector(encoder);
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH AUTOSEL 5.4 12/12] drm/exynos: fix a wrong error checking
2023-12-11 14:01 [PATCH AUTOSEL 5.4 01/12] ASoC: Intel: Skylake: Fix mem leak in few functions Sasha Levin
` (9 preceding siblings ...)
2023-12-11 14:02 ` [PATCH AUTOSEL 5.4 11/12] drm/exynos: fix a potential error pointer dereference Sasha Levin
@ 2023-12-11 14:02 ` Sasha Levin
10 siblings, 0 replies; 12+ messages in thread
From: Sasha Levin @ 2023-12-11 14:02 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Inki Dae, Sasha Levin, sw0312.kim, kyungmin.park, airlied, daniel,
krzysztof.kozlowski, dri-devel, linux-arm-kernel,
linux-samsung-soc
From: Inki Dae <inki.dae@samsung.com>
[ Upstream commit 8d1b7809684c688005706125b804e1f9792d2b1b ]
Fix a wrong error checking in exynos_drm_dma.c module.
In the exynos_drm_register_dma function, both arm_iommu_create_mapping()
and iommu_get_domain_for_dev() functions are expected to return NULL as
an error.
However, the error checking is performed using the statement
if(IS_ERR(mapping)), which doesn't provide a suitable error value.
So check if 'mapping' is NULL, and if it is, return -ENODEV.
This issue[1] was reported by Dan.
Changelog v1:
- fix build warning.
[1] https://lore.kernel.org/all/33e52277-1349-472b-a55b-ab5c3462bfcf@moroto.mountain/
Reported-by : Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/exynos/exynos_drm_dma.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c
index a3c9d8b9e1a18..e07d31b9a921a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dma.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c
@@ -133,18 +133,16 @@ int exynos_drm_register_dma(struct drm_device *drm, struct device *dev,
return 0;
if (!priv->mapping) {
- void *mapping;
+ void *mapping = NULL;
if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU))
mapping = arm_iommu_create_mapping(&platform_bus_type,
EXYNOS_DEV_ADDR_START, EXYNOS_DEV_ADDR_SIZE);
else if (IS_ENABLED(CONFIG_IOMMU_DMA))
mapping = iommu_get_domain_for_dev(priv->dma_dev);
- else
- mapping = ERR_PTR(-ENODEV);
- if (IS_ERR(mapping))
- return PTR_ERR(mapping);
+ if (!mapping)
+ return -ENODEV;
priv->mapping = mapping;
}
--
2.42.0
^ permalink raw reply related [flat|nested] 12+ messages in thread