lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170608215828.130455-4-yueyao.zhu@gmail.com>
Date:   Thu,  8 Jun 2017 14:58:28 -0700
From:   Yueyao Zhu <yueyao.zhu@...il.com>
To:     Jiri Kosina <jikos@...nel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc:     linux-usb@...r.kernel.org, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org, Andrew Chant <achant@...gle.com>,
        Badhri Jagan Sridharan <badhri@...gle.com>,
        Dmitry Torokhov <dtor@...gle.com>,
        Yueyao Zhu <yueyao@...gle.com>
Subject: [PATCH 3/3] sound: usb: allow interfaces that the driver claims to autosuspend

From: Yueyao Zhu <yueyao@...gle.com>

Instead of calling usb_enable_autosuspend() to change the configuration
of a USB device as an interface driver, enable autosuspend for every
interfaces that the driver claims.

Signed-off-by: Yueyao Zhu <yueyao@...gle.com>
---
 sound/usb/card.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/usb/card.c b/sound/usb/card.c
index 6640277a725b..79bec2883740 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -184,6 +184,7 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int
 			return -EINVAL;
 		}
 		usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1L);
+		usb_allow_interface_autosuspend(iface);
 
 		return 0;
 	}
@@ -206,6 +207,7 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int
 	if (! snd_usb_parse_audio_interface(chip, interface)) {
 		usb_set_interface(dev, interface, 0); /* reset the current interface */
 		usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1L);
+		usb_allow_interface_autosuspend(iface);
 	}
 
 	return 0;
@@ -618,6 +620,7 @@ static int usb_audio_probe(struct usb_interface *intf,
 	usb_chip[chip->index] = chip;
 	chip->num_interfaces++;
 	usb_set_intfdata(intf, chip);
+	usb_allow_interface_autosuspend(intf);
 	atomic_dec(&chip->active);
 	mutex_unlock(&register_mutex);
 	return 0;
-- 
2.13.0.506.g27d5fe0cd-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ