ALSA: usb-audio: Fix superfluous autosuspend recovery
PATCH 1/1 ALSA: usb-audio: Fix superfluous autosuspend recovery
The change to restore the autosuspend from the disabled state uses a wrong check: namely, it should have been the exact comparison of the quirk_type instead of the logical and (&&). Otherwise it matches wrongly with the other quirk types.
Although re-enabling the autosuspend for the already enabled device shouldn't matter much, it's better to fix the unbalanced call.
--- sound/usb/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/card.c +1 -1
@@ -907,7 +907,7 @@ static void usb_audio_disconnect(struct usb_interface *intf) } } -if (chip->quirk_type &QUIRK_SETUP_DISABLE_AUTOSUSPEND ) +if (chip->quirk_type ==QUIRK_SETUP_DISABLE_AUTOSUSPEND )usb_enable_autosuspend (interface_to_usbdev (intf)); chip->num_interfaces--;
Signature · 1 line
2.26.2
Quoted 21 lines · Takashi Iwai
The change to restore the autosuspend from the disabled state uses a wrong check: namely, it should have been the exact comparison of the
quirk_typeinstead of the logical and (&&). Otherwise it matches wrongly with the other quirk types.Although re-enabling the autosuspend for the already enabled device shouldn't matter much, it's better to fix the unbalanced call.
Fixes 9799110825db ("ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend()")Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>--- sound/usb/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)sound/usb/card.c +0
-0
sound/usb/card.c static void usb_audio_disconnect(struct usb_interface *intf) · line 910
Quoted 4 lines
sound/usb/card.c +0
-1@@ -907,7 +907,7 @@ static void usb_audio_disconnect(struct usb_interface *intf) } } -if (chip->quirk_type &QUIRK_SETUP_DISABLE_AUTOSUSPEND )
It was bitwise and, not logical and...
Kai-Heng
Quoted 7 lines
sound/usb/card.c +1
-1+if (chip->quirk_type ==QUIRK_SETUP_DISABLE_AUTOSUSPEND )usb_enable_autosuspend (interface_to_usbdev (intf)); chip->num_interfaces--; --2.26.2
Quoted 26 lines · Kai-Heng Feng
Quoted 24 lines · Takashi Iwai
The change to restore the autosuspend from the disabled state uses a wrong check: namely, it should have been the exact comparison of the
quirk_typeinstead of the logical and (&&). Otherwise it matches wrongly with the other quirk types.Although re-enabling the autosuspend for the already enabled device shouldn't matter much, it's better to fix the unbalanced call.
Fixes 9799110825db ("ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend()")Cc <[email protected]>Signed-off-by Takashi Iwai <[email protected]>--- sound/usb/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)sound/usb/card.c +0
-0@@ -907,7 +907,7 @@ static void usb_audio_disconnect(struct usb_interface *intf) } }
Quoted 3 lines
sound/usb/card.c static void usb_audio_disconnect(struct usb_interface *intf) · line 910
Quoted 1 line
sound/usb/card.c +0
-1-if (chip->quirk_type &QUIRK_SETUP_DISABLE_AUTOSUSPEND )It was bitwise and, not logical and...
Gah, the commit message was just wrong.
The revised one is below.
thanks,
Takashi
-- 8< --
From: Takashi Iwai <[email protected]>
Subject: [PATCH v2] ALSA: usb-audio: Fix superfluous autosuspend recovery
The change to restore the autosuspend from the disabled state uses a wrong check: namely, it should have been the exact comparison of the quirk_type instead of the bitwise and (&). Otherwise it matches wrongly with the other quirk types.
Although re-enabling the autosuspend for the already enabled device shouldn't matter much, it's better to fix the unbalanced call.
--- sound/usb/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/card.c +1 -1
@@ -907,7 +907,7 @@ static void usb_audio_disconnect(struct usb_interface *intf) } } -if (chip->quirk_type &QUIRK_SETUP_DISABLE_AUTOSUSPEND ) +if (chip->quirk_type ==QUIRK_SETUP_DISABLE_AUTOSUSPEND )usb_enable_autosuspend (interface_to_usbdev (intf)); chip->num_interfaces--;
Signature · 1 line
2.26.2