Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163170AbbKTPlA (ORCPT ); Fri, 20 Nov 2015 10:41:00 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:49279 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934421AbbKTPk6 (ORCPT ); Fri, 20 Nov 2015 10:40:58 -0500 From: Felipe Balbi To: Douglas Anderson , John Youn CC: Yunzhi Li , Heiko =?utf-8?Q?St=C3=BCbner?= , , Julius Werner , , , , Douglas Anderson , , , , Subject: Re: [PATCH v4 2/2] usb: dwc2: host: Clear interrupts before handling them In-Reply-To: <1447968195-32097-2-git-send-email-dianders@chromium.org> References: <1447968195-32097-1-git-send-email-dianders@chromium.org> <1447968195-32097-2-git-send-email-dianders@chromium.org> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 20 Nov 2015 09:40:16 -0600 Message-ID: <87y4dsd6hr.fsf@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3172 Lines: 87 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Douglas Anderson 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 > Acked-by: John Youn > Tested-by: John Youn $ 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 ? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWTz7hAAoJEIaOsuA1yqRE1HMQAI3GmhuXQijQBgILREWy93AJ qcEhsa47L30NkfiSCkW3yo4isKhb3TIJd/i8dXEP/khmn+FoLx2nncZOIz9BdhwP GrM1ypUw7oV6ErF3ARt9Swz0t38LhO1N6T9tdqLshGOI8pAmFBFZouCSofCGPZxW xe1mnBi2SBbfp2cOtcURYlrMGdKuh5MR5yWJqsxWdF4vGjc1Bfeuk8sh+Sn/a7ur 3mTUe5y1FIJ10EyTNnITGq8uC7WuRxV4ZIr3DbVR05JZmKOKmcWivf5ukczg9CKw DxDDZeVIS9oIJ0wG0+jL92fzUtfRWOfGXpwGc6+DH5lLsDpDkKlLXEa1zAdBbdXG pXleL7OmsB9d02Q9NkSfEd8pkcpRmOn1+5LzfBrdRmNbMv2NrpzMQ3rpwS0z0iEb RQSZGjzCw/E0s5d6dUPZuaRpasPAXLgH5YquxHcNn8r/Qvbk8x/Bv38ub/NUAh7c dEBBSFQVWJaDiTVqchDeMOLQbA3yrfRlHnFSz88qu9drDgJf2mXgcAolTP9ZI5Vd Iera9tOhMPDYiVJzx/MvNBgv78NDMmazEeCYJEUqzZMWvzdYyWTKaq8afumyl2J/ F1UfzRyMMql6fF75Vdj4vrPQqh7jpnFZKmZ9muE5ZnqT/PSnVaW2Q/tjCcnqqxiI +mMt7rkWeOD7hKzRgAAV =8O+W -----END PGP SIGNATURE----- --=-=-=-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/