Message ID | 1472461238-27304-1-git-send-email-yoshihiro.shimoda.uh@renesas.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Geert Uytterhoeven |
Headers | show
Return-Path: <linux-renesas-soc-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 797F36077C for <patchwork-linux-renesas-soc@patchwork.kernel.org>; Mon, 29 Aug 2016 09:01:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CF012884B for <patchwork-linux-renesas-soc@patchwork.kernel.org>; Mon, 29 Aug 2016 09:01:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6021428853; Mon, 29 Aug 2016 09:01:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53B822884B for <patchwork-linux-renesas-soc@patchwork.kernel.org>; Mon, 29 Aug 2016 09:01:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756832AbcH2JBb (ORCPT <rfc822;patchwork-linux-renesas-soc@patchwork.kernel.org>); Mon, 29 Aug 2016 05:01:31 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:23102 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756940AbcH2JB2 (ORCPT <rfc822;linux-renesas-soc@vger.kernel.org>); Mon, 29 Aug 2016 05:01:28 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 29 Aug 2016 18:01:25 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 10049426FA; Mon, 29 Aug 2016 18:01:26 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id E682C1806F; Mon, 29 Aug 2016 18:01:25 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id DFC7E1800A; Mon, 29 Aug 2016 18:01:25 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id UAJ32700; Mon, 29 Aug 2016 18:01:25 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="218871479" Received: from mail-pu1apc01lp0020.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.20]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 29 Aug 2016 18:01:25 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vtjcbsUZn6OwTUL85823oYMjetZ6Rgh/1kdLdKEMCQU=; b=A7szkkSZJKAumXocQhhFzmbm80kEXzvL5QWFzelyD36Ef+aSkok+mhfmqW6F7inScV8RHSatKhfR+fT0my826n7XSlnYKN2B2hYpHp/1Lsh2F29EEUhh7dZNLIZc2qiX20mr/4NIf8IA4Q7+BlRzAuaw2uU2Zx2y1BSl74LSvmQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by HKXPR06MB0552.apcprd06.prod.outlook.com (10.161.177.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Mon, 29 Aug 2016 09:01:23 +0000 From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> To: <balbi@kernel.org> CC: <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>, <linux-renesas-soc@vger.kernel.org>, <stable@vger.kernel.org>, Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Subject: [PATCH] usb: renesas_usbhs: fix clearing the {BRDY, BEMP}STS condition Date: Mon, 29 Aug 2016 18:00:38 +0900 Message-ID: <1472461238-27304-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR0201CA0026.apcprd02.prod.outlook.com (10.164.90.164) To HKXPR06MB0552.apcprd06.prod.outlook.com (10.161.177.142) X-MS-Office365-Filtering-Correlation-Id: 5c44c21f-a7c6-4cba-31fc-08d3cfeb0d2f X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB0552; 2:ZyG71lGS/BqalVQ5vvpQ8qb72ezuau1O6ZG7fJ3MhAez9AkplpNeMFw8PBZ+jB31PW7Ml7hA22DTEVxvuxMXPzlHhANgqiOtfGWwSRs5j9RzOPAsCwKdXyA5IjQTuH/kAUkIgNPrEv2d7l7EV0K7CAgjsfkRU93/ZFwzejsJWRnGXKuLAY0STiHWhOpjSBhQ; 3:wyP8ACddvWqmvrmqpVdYRXfJiMECcxLo+WiyzS+lj6myQ7sJdMLHxQdD466M3DT1Wn6ltBhUUNmosUEi7FKpQp1/FdhkYjsFrixsxTVhl0JtXsCkY/W4EsNrdkmpxh+V; 25:XGGUYzu3o1l4DwVoLp7AoRJ5p0MrS0k/YRVoQUiRzdYemxzqqUHeSaUjq9iveVjiHLwtdvyAFIh/CT3j1d4BvSa1Unsd2ypEFY50DM66B6sBbt7XXoTX4UIyh+3YikbpnqeNM37Vz21Naki8bpT7uMY8zK9xgQQdLFADJ3M9wdiYDDNcqpo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6Ib2jg3wlF X-Microsoft-Antispam-PRVS: <HKXPR06MB0552B16E8A16EE7D1BFC45AFB8E10@HKXPR06MB0552.apcprd06.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:HKXPR06MB0552; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB0552; X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB0552; 4:e4dASZ7nIiw4BaJ30YtY5taShDemzKsxhswtaxbyty6OVOzABwOoqKH3MmP/8+mGoRuAPKaCGSo6nBsNH3SaxvGr19q9EVRJOXh+bZQrEwxlO/OPqATu9xJCbnN9949wFAGI35W6mrL6F5PeLh9FLm4y3naIedWQpXj1b9SZor5q9WoMAPksB1c12NKOiCmpzTiLmDsQPStUAh9A3L5NT19HBp0VNV9z6IwtmUdw/UqbzaYEi+JnLSRXRQ6saeI2T4wgmqtVhY8TZ4ztl5HcHFVFVSuH+DfzYBxA2a2MlkIpBxUUn+7yqOyXVVhlQmAkbdHU61OrXMAwZrdew74TXB9UaQVTfQwyzQW124xgzWD7vVPYC6gkExbIYJUoRhwheI9kk4aX4Wp9IHJfPsxG8c8H5IlhCPAYDXq8vHe6Bp+b9OcnobNiE6kJ0DnwUqG0 X-Forefront-PRVS: 0049B3F387 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(189998001)(42186005)(33646002)(105586002)(50466002)(229853001)(47776003)(5003940100001)(48376002)(4001430100002)(50986999)(7846002)(586003)(106356001)(19580405001)(3846002)(68736007)(2906002)(8676002)(36756003)(66066001)(78352004)(77096005)(97736004)(5660300001)(81166006)(19580395003)(7736002)(92566002)(305945005)(81156014)(107886002)(110136002)(2351001)(4326007)(6116002)(50226002)(101416001)(142933001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB0552; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HKXPR06MB0552; 23:RdtXwMSFofqMmqmH6qLfmam8NiI+pLZ2YPEkEnbsZ?= =?us-ascii?Q?oInuVe1nrNW8Rlwu0v4puUGeBotzjLsgVL8ldgG39n1PWxQGzA/xmAcyNbaF?= =?us-ascii?Q?S3VyvpJ4wYiQqVfUuzab2jl1kRvsZ0YWhnl4EwMT/t1x+vv+GXmrAgVsCvEP?= =?us-ascii?Q?StJl7OLCPtmGii+Yu6NsrSPreMOdzkKFA2+g6E5Wgt0wrIGX6RQzkTLXHaE6?= =?us-ascii?Q?5FmXJemV9NxFFMTLKi7RnSUMBbo0ka5gRPkPcWZXSwp/kzGHjoEYe2KAa+qd?= =?us-ascii?Q?GYBRDQrYXze01v0MmLzRq05xJWEBwpDNuPd2RpbSbH6t3y97ElNts6t5ncWj?= =?us-ascii?Q?ITmJT8au4Zc/uMcoGSkRkAgMh76UJOoQ4ZPDwZAGlZQ6nNSCM2UCiz2vYBxJ?= =?us-ascii?Q?SuDNeea/qW/fVxEm2JyimE0IsdsnBqfzYPOCULYi7MnhstZ/L+dnFtdzEOO+?= =?us-ascii?Q?FyAkvjU1TNnwFTeo4BLC1Epy9AnDAl+RfTfTxOHoIo+b5FvlXKLLzRRhdGQw?= =?us-ascii?Q?620pBQECIrdG9OIS06VTcysIWQOKqtyoxUCyA4TgKt25xQl3+rZoo021z3VO?= =?us-ascii?Q?hJbjxtIXaifDZtoNXq6vVU08KL2mIEY/sR3P8OlcH1BnbI5/4Ow9a6TuckXT?= =?us-ascii?Q?i37BedV2VV+R8p8Dvqk+0BRFftAKVfopN1irrVClC2Y7AMuUH1zBeIK3EjgM?= =?us-ascii?Q?trrCfQTj2jiYPKck5Kc8n4IA58hnuXn1Ten7dUH4AJImvT8u7vwyUoua5ck1?= =?us-ascii?Q?DxVNmR/B3JosRUlckst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kuTgnuTh/0LbKXj3dXc6ZkTe/Ktq9f0Wl5KjK5yO8bdbtA5m/+Qw=; 7:cBgdY9x4L7oNeMXhlIumiauTogpJEoLFhDO1qzT5xxUyasnPgW7cZKK72IWfHXHWkhMOytm7zMTBuPeiW7ADfOhMZ5rC1Z0O6hrZYkT+/AgIMB95FQuIH+MnZFFdTlv85JeQdpPtoHdx0M7GbO3YGnbQR1UYBSVAfAtmbi9xQQalo4se4KOAWIpDGeQn5o2U3eKu/K2XynUUP2wBmdT2qm5008iQrAMImYpH+jzb08Lv3Q0tY4U1uwFxQEW7iCo4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB0552; 20:x8AATDpuJiCohlHltUc5dFXGdLjlt6ZLy96lL0pj0RvB9mLRotb9rEcQbAkMZUFApToVpy8ZqGWFmjMWr3/GiEJdGbiGYB4VMtNxAqIwUJgdagJg+DC3POdkEoakmNOYblV8XfsPLqlI4nf7ng6rW/XIaFO//RhDOwtEbkWCwtk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2016 09:01:23.0149 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB0552 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: <linux-renesas-soc.vger.kernel.org> X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/usb/renesas_usbhs/mod.c b/drivers/usb/renesas_usbhs/mod.c index d4be5d5..28965ef 100644 --- a/drivers/usb/renesas_usbhs/mod.c +++ b/drivers/usb/renesas_usbhs/mod.c @@ -282,9 +282,16 @@ static irqreturn_t usbhs_interrupt(int irq, void *data) if (usbhs_mod_is_host(priv)) usbhs_write(priv, INTSTS1, ~irq_state.intsts1 & INTSTS1_MAGIC); - usbhs_write(priv, BRDYSTS, ~irq_state.brdysts); + /* + * The driver should not clear the xxxSTS after the line of + * "call irq callback functions" because each "if" statement is + * possible to call the callback function for avoiding any side effects. + */ + if (irq_state.intsts0 & BRDY) + usbhs_write(priv, BRDYSTS, ~irq_state.brdysts); usbhs_write(priv, NRDYSTS, ~irq_state.nrdysts); - usbhs_write(priv, BEMPSTS, ~irq_state.bempsts); + if (irq_state.intsts0 & BEMP) + usbhs_write(priv, BEMPSTS, ~irq_state.bempsts); /* * call irq callback functions
The previous driver is possible to stop the transfer wrongly. For example: 1) An interrupt happens, but not BRDY interruption. 2) Read INTSTS0. And than state->intsts0 is not set to BRDY. 3) BRDY is set to 1 here. 4) Read BRDYSTS. 5) Clear the BRDYSTS. And then. the BRDY is cleared wrongly. Remarks: - The INTSTS0.BRDY is read only. - If any bits of BRDYSTS are set to 1, the BRDY is set to 1. - If BRDYSTS is 0, the BRDY is set to 0. So, this patch adds condition to avoid such situation. (And about NRDYSTS, this is not used for now. But, avoiding any side effects, this patch doesn't touch it.) Fixes: d5c6a1e024dd ("usb: renesas_usbhs: fixup interrupt status clear method") Cc: <stable@vger.kernel.org> # v3.8+ Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> --- drivers/usb/renesas_usbhs/mod.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)