All of lore.kernel.org
 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 --]

WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: John Youn <John.Youn-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
Cc: gregory.herrero-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	"Heiko Stübner" <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Douglas Anderson"
	<dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	yousaf.kaukab-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	"Yunzhi Li" <lyz-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	"Julius Werner" <jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	dinguyen-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.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-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2108 bytes --]


Hi,

Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Acked-by: John Youn <johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
> Tested-by: John Youn <johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>

$ 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 #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

[-- Attachment #2: Type: text/plain, Size: 200 bytes --]

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

Thread overview: 6+ 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 15:40     ` Felipe Balbi
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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.