linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernhard Walle <bernhard@bwalle.de>
To: Peter Chen <peter.chen@nxp.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: chipidea: Fix missing resume call after suspend
Date: Mon, 24 Apr 2017 15:25:21 +0200 (CEST)	[thread overview]
Message-ID: <292472280.32717.1493040322539@office.mailbox.org> (raw)
In-Reply-To: <20170424035109.GA11436@b29397-desktop>

Hi,

> Peter Chen <peter.chen@nxp.com> hat am 24. April 2017 um 05:51 geschrieben:
> > 
> The current code logic is:
> - When the resume is received from host, the ci->dirver->resume is
> called, and suspended is cleared.
> - When the reset is received from host, the isr_reset_handler is called,
> and suspended is cleared by _gadget_stop_activity. Since reset is
> called, so ci->driver->resume doesn't need to be called.

My problem is that dump_stack() doesn't show the complete stackframe. What I see from debug messages is that when I plug a cable (after the host has been suspended) then _gadget_stop_activity is executed before udc_irq. 

My first attempt was to save ci->suspended at the beginning of udc_irq (i.e. before isr_reset_handler is called), but that doesn't work. Even in the beginning of udc_irq ci->suspended is 0. So isr_reset_handler is called before.

The result is that when I unplug a cable and attach it again, driver->suspended has been called but driver->resume doesn't get called.

> There is a patch to fix clear suspended even the ci->driver->resume is
> NULL at v4.12-rc1.
> 
>       usb: chipidea: udc: update gadget state after bus resume

Thanks for the hint. That makes the second part of my patch irrelevant, but the first part (removing the ci->suspended = 0) is needed in order to make my setup working.

Any idea to find the cause why reset is called before resume? According to your explanation, that shouldn't be the case?



Regards,
Bernhard

  reply	other threads:[~2017-04-24 13:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 10:10 [PATCH] usb: chipidea: Fix missing resume call after suspend Bernhard Walle
2017-04-24  3:51 ` Peter Chen
2017-04-24 13:25   ` Bernhard Walle [this message]
2017-04-25  8:14     ` Peter Chen
2017-04-25 13:19       ` Bernhard Walle

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=292472280.32717.1493040322539@office.mailbox.org \
    --to=bernhard@bwalle.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@nxp.com \
    /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).