public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: "Jonathan Nieder" <jrnieder@gmail.com>,
	"Steffen Müller" <steffen.mueller@radio-frei.de>,
	alsa-devel@alsa-project.org,
	"Olivier MATZ" <zer0@droids-corp.org>,
	linux-pm@vger.kernel.org, linux-usb@vger.kernel.org,
	"Oliver Neukum" <oneukum@suse.de>,
	stable@vger.kernel.org, "David Banks" <amoebae@gmail.com>,
	"Ralf Lang" <lang@b1-systems.de>
Subject: Re: [alsa-devel] [PATCH] usb: add USB_QUIRK_RESET_RESUME for M-Audio 49
Date: Mon, 26 Nov 2012 14:58:33 +0100	[thread overview]
Message-ID: <s5htxsch3ee.wl%tiwai@suse.de> (raw)
In-Reply-To: <50B371F1.70508@ladisch.de>

At Mon, 26 Nov 2012 14:43:13 +0100,
Clemens Ladisch wrote:
> 
> Takashi Iwai wrote:
> > Clemens Ladisch wrote:
> >> Takashi Iwai wrote:
> >>> Clemens Ladisch wrote:
> >>>> I'm working on a fix that adds proper power management for input ports,
> >>>> but this requires the driver to be reorganized a little ...
> >>>
> >>> Doesn't a simple patch like below work?
> >>
> >>> +static int substream_open(struct snd_rawmidi_substream *substream, int open)
> >>>  {
> >>> +	if (open && umidi->opened++ == 0) {
> >>> +		err = usb_autopm_get_interface(umidi->iface);
> >>>
> >>>  static int snd_usbmidi_input_open(struct snd_rawmidi_substream *substream)
> >>>  {
> >>> +	return substream_open(substream, 1);
> >>
> >> No, because the input URBs are submitted before the userspace device is
> >> opened.
> >
> > Ah, right.  What's the reason of submitting input urbs for the all
> > time from the beginning?  For loopback?
> 
> For not needing to count open input ports.

So we've spun urbs for all the time just for reducing refcount?
That's bad.

> > If it has to be running, the easiest fix would be the patch like
> > below.  This will turn off the autopm essentially, but better than
> > breakage.
> >
> > @@ -2074,6 +2077,8 @@ static void snd_usbmidi_input_start_ep(struct snd_usb_midi_in_endpoint* ep)
> >
> > +	ep->autopm_reference =
> > +		usb_autopm_get_interface(ep->umidi->iface) >= 0;
> 
> usb_autopm_get_interface() cannot be called from the USB probe callback.

OK, it can call no_resume version by passing an argument.

But judging from your comment above, we should fix the free wheel MIDI
input urbs at first indeed, not only for autopm but in general.


Takashi

      parent reply	other threads:[~2012-11-26 13:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4FA2D481.4070304@droids-corp.org>
     [not found] ` <4FA2DB9D.1040303@droids-corp.org>
     [not found]   ` <20120604110608.GG8248@droids-corp.org>
     [not found]     ` <20120605232432.GE3619@burratino>
     [not found]       ` <4FD06563.7050605@droids-corp.org>
     [not found]         ` <20121125094110.GA21387@elie.Belkin>
     [not found]           ` <50B2815E.2090105@droids-corp.org>
2012-11-25 21:21             ` [PATCH] usb: add USB_QUIRK_RESET_RESUME for M-Audio 49 Jonathan Nieder
     [not found]               ` <20121125212100.GE24024-fcEM2ccDkbL2nhBuCrrZHw@public.gmane.org>
2012-11-25 22:01                 ` [alsa-devel] " Clemens Ladisch
     [not found]                   ` <50B29537.7060007-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2012-11-26  9:35                     ` Takashi Iwai
2012-11-26 12:35                       ` Clemens Ladisch
2012-11-26 13:04                         ` Takashi Iwai
     [not found]                           ` <s5hwqx8h5w1.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2012-11-26 13:43                             ` Clemens Ladisch
2012-11-26 13:54                               ` Oliver Neukum
2012-11-26 16:12                                 ` Alan Stern
     [not found]                                   ` <Pine.LNX.4.44L0.1211261111130.2168-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-11-26 20:12                                     ` Clemens Ladisch
2012-11-26 21:54                                       ` Alan Stern
2012-11-26 13:58                               ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5htxsch3ee.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=amoebae@gmail.com \
    --cc=clemens@ladisch.de \
    --cc=jrnieder@gmail.com \
    --cc=lang@b1-systems.de \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.de \
    --cc=stable@vger.kernel.org \
    --cc=steffen.mueller@radio-frei.de \
    --cc=zer0@droids-corp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox