linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Jagdish Gedia <jvgediya@gmail.com>
Cc: linux-kernel@vger.kernel.org, <linux-usb@vger.kernel.org>
Subject: Re: Delivery Status Notification (Failure)
Date: Thu, 6 Mar 2014 10:25:38 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1403061022510.1467-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <CAOAoqGs_391XuB4apV+BQOXxv24=z=9qa6Muh-Ry-0PecqrUDQ@mail.gmail.com>

On Thu, 6 Mar 2014, Jagdish Gedia wrote:

> Hi Alan,
> 
> Thanks for you informative reply.
> I will try your suggestion. yes, i will not get more than one wakeup per second.
> 
> I have tried below things.
> My usb device is using the cdc-acm.c driver.
> 
> inside cdc-acm.c file,
> 
> static struct usb_device *usb_device;
> 
> static int acm_probe(........, ....)
> {
>     usb_device = interface_to_usbdev(intf);
>     ..........
> }
> 
> inside interrupt handler
> 
> static irqhandle_t int_handler(..., ..)
> {
>    usb_lock_device(usb_device);
>    usb_remote_wakeup(usb_device);
>    usb_unlock_device(usb_device);
>    return IRQ_HANDLED;
> }
> 
> but these things are not working. kernel is crashing when interrupt occurs.

Because you didn't do what I said: Call pm_request_resume.  Not 
usb_remote_wakeup.

> I have some other doubt also.
> 
> 1. If usb is runtime suspended and if global suspend happens , do i
> need to do anything special to wakeup the usb device?

No.

> 2. How can i address particularly my usb device. right now, i am using
> usb_device = interface_to_usbdev(intf) to get pointer to my usb device
> inside probe function,

That's a perfectly good way to do it.  Lots of other drivers do the 
same thing.

>  but probe function is getting called for every
> interface of the device. Is there any other way through which i can
> get the pointer to my usb device like i can traverse all the available
> usb device and on basis of vendor and product id i can address my usb
> device or by any other way?

You can't get the device pointer unless you have something to start 
from.  For example, if you already have an interface pointer then you 
can use interface_to_usbdev.

Alan Stern


  reply	other threads:[~2014-03-06 15:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOAoqGuLffRn8SgkB0967U0Qvg8HWnxvL5Uq4EZk7Vxw1jiSJw@mail.gmail.com>
     [not found] ` <001a11c2fcca7727e504f3e8d518@google.com>
2014-03-06  5:03   ` Delivery Status Notification (Failure) Jagdish Gedia
2014-03-06 15:25     ` Alan Stern [this message]
2018-05-11 11:34 Not able to set smp_affinity for an IRQ on i.MX7 Pintu Kumar
     [not found] ` <5af57fea.1c69fb81.885f0.2377.GMRIR@mx.google.com>
2018-05-11 11:37   ` Delivery Status Notification (Failure) Pintu Kumar
2018-05-11 12:39     ` Russell King - ARM Linux
2018-05-11 13:04       ` Lucas Stach
2018-05-11 14:37         ` Pintu Kumar
2018-05-14 12:12           ` Pintu Kumar
2018-05-14 13:11             ` Lucas Stach
2018-05-14 14:28               ` Pintu Kumar
2018-05-17 13:28                 ` Pintu Kumar
2018-05-21 18:51                   ` Pintu Kumar
     [not found] <CANQmPXicmUAVwHHs0VrbRd3MU_41wnv-Ant2r7c3FOuvEOuROQ@mail.gmail.com>
     [not found] ` <e89a8f235453a906b704c472eacd@google.com>
2012-07-17 11:09   ` Chen

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=Pine.LNX.4.44L0.1403061022510.1467-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=jvgediya@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).