The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Douglas Anderson <dianders@chromium.org>,
	John Youn <John.Youn@synopsys.com>
Cc: "Yunzhi Li" <lyz@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	linux-rockchip@lists.infradead.org,
	"Julius Werner" <jwerner@chromium.org>,
	gregory.herrero@intel.com, yousaf.kaukab@intel.com,
	dinguyen@opensource.altera.com,
	"Douglas Anderson" <dianders@chromium.org>,
	johnyoun@synopsys.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] usb: dwc2: host: Clear interrupts before handling them
Date: Fri, 20 Nov 2015 09:40:16 -0600	[thread overview]
Message-ID: <87y4dsd6hr.fsf@saruman.tx.rr.com> (raw)
In-Reply-To: <1447968195-32097-2-git-send-email-dianders@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 2000 bytes --]


Hi,

Douglas Anderson <dianders@chromium.org> writes:
> In general it is wise to clear interrupts before processing them.  If
> you don't do that, you can get:
>  1. Interrupt happens
>  2. You look at system state and process interrupt
>  3. A new interrupt happens
>  4. You clear interrupt without processing it.
>
> This patch was actually a first attempt to fix missing device insertions
> as described in (usb: dwc2: host: Fix missing device insertions) and it
> did solve some of the signal bouncing problems but not all of
> them (which is why I submitted the other patch).  Specifically, this
> patch itself would sometimes change:
>  1. hardware sees connect
>  2. hardware sees disconnect
>  3. hardware sees connect
>  4. dwc2_port_intr() - clears connect interrupt
>  5. dwc2_handle_common_intr() - calls dwc2_hcd_disconnect()
>
> ...to:
>  1. hardware sees connect
>  2. hardware sees disconnect
>  3. dwc2_port_intr() - clears connect interrupt
>  4. hardware sees connect
>  5. dwc2_handle_common_intr() - calls dwc2_hcd_disconnect()
>
> ...but with different timing then sometimes we'd still miss cable
> insertions.
>
> In any case, though this patch doesn't fix any (known) problems, it
> still seems wise as a general policy to clear interrupt before handling
> them.
>
> Note that for dwc2_handle_usb_port_intr(), instead of moving the clear
> of PRTINT to the beginning of the function we remove it completely.  The
> only way to clear PRTINT is to clear the sources that set it in the
> first place.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> Acked-by: John Youn <johnyoun@synopsys.com>
> Tested-by: John Youn <johnyoun@synopsys.com>

$ patch -p1 --dry-run < patch.diff
checking file drivers/usb/dwc2/core_intr.c
checking file drivers/usb/dwc2/hcd_intr.c
Hunk #4 FAILED at 365.
Hunk #5 succeeded at 388 (offset 11 lines).
1 out of 5 hunks FAILED

Care to rebase on top of my testing/next ?

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  reply	other threads:[~2015-11-20 15:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 21:23 [PATCH v4 1/2] usb: dwc2: host: Fix missing device insertions Douglas Anderson
2015-11-19 21:23 ` [PATCH v4 2/2] usb: dwc2: host: Clear interrupts before handling them Douglas Anderson
2015-11-20 15:40   ` Felipe Balbi [this message]
2015-11-20 16:49     ` Doug Anderson
2015-11-20 17:04       ` Doug Anderson

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=87y4dsd6hr.fsf@saruman.tx.rr.com \
    --to=balbi@ti.com \
    --cc=John.Youn@synopsys.com \
    --cc=dianders@chromium.org \
    --cc=dinguyen@opensource.altera.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.herrero@intel.com \
    --cc=heiko@sntech.de \
    --cc=johnyoun@synopsys.com \
    --cc=jwerner@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lyz@rock-chips.com \
    --cc=yousaf.kaukab@intel.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