* [PATCH] ALSA: usb-audio: Fix superfluous autosuspend recovery
@ 2021-07-25 10:23 Takashi Iwai
2021-07-26 3:09 ` Kai-Heng Feng
0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2021-07-25 10:23 UTC (permalink / raw)
To: alsa-devel; +Cc: Kai-Heng Feng
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.
Fixes: 9799110825db ("ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend()")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/usb/card.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 2f6a62416c05..a1f8c3a026f5 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -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--;
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ALSA: usb-audio: Fix superfluous autosuspend recovery
2021-07-25 10:23 [PATCH] ALSA: usb-audio: Fix superfluous autosuspend recovery Takashi Iwai
@ 2021-07-26 3:09 ` Kai-Heng Feng
2021-07-26 6:26 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Kai-Heng Feng @ 2021-07-26 3:09 UTC (permalink / raw)
To: Takashi Iwai; +Cc: moderated list:SOUND
On Sun, Jul 25, 2021 at 6:23 PM Takashi Iwai <tiwai@suse.de> wrote:
>
> 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.
>
> Fixes: 9799110825db ("ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend()")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
> sound/usb/card.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/usb/card.c b/sound/usb/card.c
> index 2f6a62416c05..a1f8c3a026f5 100644
> --- a/sound/usb/card.c
> +++ b/sound/usb/card.c
> @@ -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
> + if (chip->quirk_type == QUIRK_SETUP_DISABLE_AUTOSUSPEND)
> usb_enable_autosuspend(interface_to_usbdev(intf));
>
> chip->num_interfaces--;
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ALSA: usb-audio: Fix superfluous autosuspend recovery
2021-07-26 3:09 ` Kai-Heng Feng
@ 2021-07-26 6:26 ` Takashi Iwai
0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2021-07-26 6:26 UTC (permalink / raw)
To: Kai-Heng Feng; +Cc: moderated list:SOUND
On Mon, 26 Jul 2021 05:09:11 +0200,
Kai-Heng Feng wrote:
>
> On Sun, Jul 25, 2021 at 6:23 PM Takashi Iwai <tiwai@suse.de> wrote:
> >
> > 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.
> >
> > Fixes: 9799110825db ("ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend()")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > ---
> > sound/usb/card.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/sound/usb/card.c b/sound/usb/card.c
> > index 2f6a62416c05..a1f8c3a026f5 100644
> > --- a/sound/usb/card.c
> > +++ b/sound/usb/card.c
> > @@ -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...
Gah, the commit message was just wrong.
The revised one is below.
thanks,
Takashi
-- 8< --
From: Takashi Iwai <tiwai@suse.de>
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.
Fixes: 9799110825db ("ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend()")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/usb/card.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 2f6a62416c05..a1f8c3a026f5 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -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--;
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-26 6:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-25 10:23 [PATCH] ALSA: usb-audio: Fix superfluous autosuspend recovery Takashi Iwai
2021-07-26 3:09 ` Kai-Heng Feng
2021-07-26 6:26 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.