* [PATCH AUTOSEL 6.1 1/5] drm: panel-orientation-quirks: Add quirk for OrangePi Neo
@ 2024-08-05 17:58 Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 2/5] scsi: ufs: core: Bypass quick recovery if force reset is needed Sasha Levin
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Sasha Levin @ 2024-08-05 17:58 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Philip Mueller, Hans de Goede, Sasha Levin, maarten.lankhorst,
mripard, tzimmermann, airlied, daniel, dri-devel
From: Philip Mueller <philm@manjaro.org>
[ Upstream commit d60c429610a14560085d98fa6f4cdb43040ca8f0 ]
This adds a DMI orientation quirk for the OrangePi Neo Linux Gaming
Handheld.
Signed-off-by: Philip Mueller <philm@manjaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240715045818.1019979-1-philm@manjaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c
index 5db52d6c5c35c..039da0d1a613b 100644
--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c
+++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c
@@ -414,6 +414,12 @@ static const struct dmi_system_id orientation_data[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"),
},
.driver_data = (void *)&lcd1600x2560_leftside_up,
+ }, { /* OrangePi Neo */
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "OrangePi"),
+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "NEO-01"),
+ },
+ .driver_data = (void *)&lcd1200x1920_rightside_up,
}, { /* Samsung GalaxyBook 10.6 */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 6.1 2/5] scsi: ufs: core: Bypass quick recovery if force reset is needed
2024-08-05 17:58 [PATCH AUTOSEL 6.1 1/5] drm: panel-orientation-quirks: Add quirk for OrangePi Neo Sasha Levin
@ 2024-08-05 17:58 ` Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 3/5] ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown Sasha Levin
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2024-08-05 17:58 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Peter Wang, Bean Huo, Bart Van Assche, Martin K . Petersen,
Sasha Levin, James.Bottomley, matthias.bgg,
angelogioacchino.delregno, manivannan.sadhasivam, avri.altman,
ahalaney, linux-scsi, linux-arm-kernel, linux-mediatek
From: Peter Wang <peter.wang@mediatek.com>
[ Upstream commit 022587d8aec3da1d1698ddae9fb8cfe35f3ad49c ]
If force_reset is true, bypass quick recovery. This will shorten error
recovery time.
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Link: https://lore.kernel.org/r/20240712094506.11284-1-peter.wang@mediatek.com
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ufs/core/ufshcd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 5922cb5a1de0d..aba1f239099c2 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -6302,7 +6302,8 @@ static void ufshcd_err_handler(struct work_struct *work)
if (ufshcd_err_handling_should_stop(hba))
goto skip_err_handling;
- if (hba->dev_quirks & UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS) {
+ if ((hba->dev_quirks & UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS) &&
+ !hba->force_reset) {
bool ret;
spin_unlock_irqrestore(hba->host->host_lock, flags);
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 6.1 3/5] ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown
2024-08-05 17:58 [PATCH AUTOSEL 6.1 1/5] drm: panel-orientation-quirks: Add quirk for OrangePi Neo Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 2/5] scsi: ufs: core: Bypass quick recovery if force reset is needed Sasha Levin
@ 2024-08-05 17:58 ` Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 4/5] ALSA: hda/conexant: Mute speakers at suspend / shutdown Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 5/5] Input: MT - limit max slots Sasha Levin
3 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2024-08-05 17:58 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Sasha Levin, perex, tiwai, hkallweit1, linux-sound
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 6cd23b26b348fa52c88e1adf9c0e48d68e13f95e ]
Some devices indicate click noises at suspend or shutdown when the
speakers are unmuted. This patch adds a helper,
snd_hda_gen_shutup_speakers(), to work around it. The new function is
supposed to be called at suspend or shutdown by the codec driver, and
it mutes the speakers.
The mute status isn't cached, hence the original mute state will be
restored at resume again.
Link: https://patch.msgid.link/20240726142625.2460-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/hda_generic.c | 63 +++++++++++++++++++++++++++++++++++++
sound/pci/hda/hda_generic.h | 1 +
2 files changed, 64 insertions(+)
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index dbf7aa88e0e31..992cf82da1024 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -4952,6 +4952,69 @@ void snd_hda_gen_stream_pm(struct hda_codec *codec, hda_nid_t nid, bool on)
}
EXPORT_SYMBOL_GPL(snd_hda_gen_stream_pm);
+/* forcibly mute the speaker output without caching; return true if updated */
+static bool force_mute_output_path(struct hda_codec *codec, hda_nid_t nid)
+{
+ if (!nid)
+ return false;
+ if (!nid_has_mute(codec, nid, HDA_OUTPUT))
+ return false; /* no mute, skip */
+ if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
+ snd_hda_codec_amp_read(codec, nid, 1, HDA_OUTPUT, 0) &
+ HDA_AMP_MUTE)
+ return false; /* both channels already muted, skip */
+
+ /* direct amp update without caching */
+ snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
+ AC_AMP_SET_OUTPUT | AC_AMP_SET_LEFT |
+ AC_AMP_SET_RIGHT | HDA_AMP_MUTE);
+ return true;
+}
+
+/**
+ * snd_hda_gen_shutup_speakers - Forcibly mute the speaker outputs
+ * @codec: the HDA codec
+ *
+ * Forcibly mute the speaker outputs, to be called at suspend or shutdown.
+ *
+ * The mute state done by this function isn't cached, hence the original state
+ * will be restored at resume.
+ *
+ * Return true if the mute state has been changed.
+ */
+bool snd_hda_gen_shutup_speakers(struct hda_codec *codec)
+{
+ struct hda_gen_spec *spec = codec->spec;
+ const int *paths;
+ const struct nid_path *path;
+ int i, p, num_paths;
+ bool updated = false;
+
+ /* if already powered off, do nothing */
+ if (!snd_hdac_is_power_on(&codec->core))
+ return false;
+
+ if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) {
+ paths = spec->out_paths;
+ num_paths = spec->autocfg.line_outs;
+ } else {
+ paths = spec->speaker_paths;
+ num_paths = spec->autocfg.speaker_outs;
+ }
+
+ for (i = 0; i < num_paths; i++) {
+ path = snd_hda_get_path_from_idx(codec, paths[i]);
+ if (!path)
+ continue;
+ for (p = 0; p < path->depth; p++)
+ if (force_mute_output_path(codec, path->path[p]))
+ updated = true;
+ }
+
+ return updated;
+}
+EXPORT_SYMBOL_GPL(snd_hda_gen_shutup_speakers);
+
/**
* snd_hda_gen_parse_auto_config - Parse the given BIOS configuration and
* set up the hda_gen_spec
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 34eba40cc6e67..fb3ce68e2d717 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -352,5 +352,6 @@ int snd_hda_gen_add_mute_led_cdev(struct hda_codec *codec,
int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec,
int (*callback)(struct led_classdev *,
enum led_brightness));
+bool snd_hda_gen_shutup_speakers(struct hda_codec *codec);
#endif /* __SOUND_HDA_GENERIC_H */
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 6.1 4/5] ALSA: hda/conexant: Mute speakers at suspend / shutdown
2024-08-05 17:58 [PATCH AUTOSEL 6.1 1/5] drm: panel-orientation-quirks: Add quirk for OrangePi Neo Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 2/5] scsi: ufs: core: Bypass quick recovery if force reset is needed Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 3/5] ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown Sasha Levin
@ 2024-08-05 17:58 ` Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 5/5] Input: MT - limit max slots Sasha Levin
3 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2024-08-05 17:58 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Sasha Levin, perex, tiwai, bo.liu, songxiebing,
linux-sound
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 4f61c8fe35202702426cfc0003e15116a01ba885 ]
Use the new helper to mute speakers at suspend / shutdown for avoiding
click noises.
Link: https://bugzilla.suse.com/show_bug.cgi?id=1228269
Link: https://patch.msgid.link/20240726142625.2460-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/patch_conexant.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index e8209178d87bb..083d640fe348c 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -212,6 +212,8 @@ static void cx_auto_shutdown(struct hda_codec *codec)
{
struct conexant_spec *spec = codec->spec;
+ snd_hda_gen_shutup_speakers(codec);
+
/* Turn the problematic codec into D3 to avoid spurious noises
from the internal speaker during (and after) reboot */
cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 6.1 5/5] Input: MT - limit max slots
2024-08-05 17:58 [PATCH AUTOSEL 6.1 1/5] drm: panel-orientation-quirks: Add quirk for OrangePi Neo Sasha Levin
` (2 preceding siblings ...)
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 4/5] ALSA: hda/conexant: Mute speakers at suspend / shutdown Sasha Levin
@ 2024-08-05 17:58 ` Sasha Levin
3 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2024-08-05 17:58 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Tetsuo Handa, syzbot, Dmitry Torokhov, Linus Torvalds,
Sasha Levin, linux-input
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
[ Upstream commit 99d3bf5f7377d42f8be60a6b9cb60fb0be34dceb ]
syzbot is reporting too large allocation at input_mt_init_slots(), for
num_slots is supplied from userspace using ioctl(UI_DEV_CREATE).
Since nobody knows possible max slots, this patch chose 1024.
Reported-by: syzbot <syzbot+0122fa359a69694395d5@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=0122fa359a69694395d5
Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/input-mt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index 14b53dac1253b..6b04a674f832a 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -46,6 +46,9 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
return 0;
if (mt)
return mt->num_slots != num_slots ? -EINVAL : 0;
+ /* Arbitrary limit for avoiding too large memory allocation. */
+ if (num_slots > 1024)
+ return -EINVAL;
mt = kzalloc(struct_size(mt, slots, num_slots), GFP_KERNEL);
if (!mt)
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-05 17:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-05 17:58 [PATCH AUTOSEL 6.1 1/5] drm: panel-orientation-quirks: Add quirk for OrangePi Neo Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 2/5] scsi: ufs: core: Bypass quick recovery if force reset is needed Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 3/5] ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 4/5] ALSA: hda/conexant: Mute speakers at suspend / shutdown Sasha Levin
2024-08-05 17:58 ` [PATCH AUTOSEL 6.1 5/5] Input: MT - limit max slots Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox