From patchwork Mon Aug 8 12:50:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 9268263 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: 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 7B47460754 for ; Mon, 8 Aug 2016 12:54:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ADCB2621F for ; Mon, 8 Aug 2016 12:54:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DED727FA9; Mon, 8 Aug 2016 12:54: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 012562621F for ; Mon, 8 Aug 2016 12:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752140AbcHHMym (ORCPT ); Mon, 8 Aug 2016 08:54:42 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:8802 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752044AbcHHMyd (ORCPT ); Mon, 8 Aug 2016 08:54:33 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 08 Aug 2016 21:54:31 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 8132A52FED; Mon, 8 Aug 2016 21:54:31 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 657C1480A4; Mon, 8 Aug 2016 21:54:31 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 5E19748014; Mon, 8 Aug 2016 21:54:31 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id XAF29685; Mon, 8 Aug 2016 21:54:31 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="216948988" Received: from mail-sg2apc01lp0244.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.244]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 08 Aug 2016 21:54:30 +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=a16rLTNA+fGH4nSXdtTf25EhhbbBVka8eTp6X84/FQo=; b=OCu1jYSb7xr8yRiY6ClEWA6o+YgvEYIOpJHbrxyqbuIoE/ks06TzGh5NHE+4hCU4Hb1/kBAxvR/aEfzExsqFfK134z9uad1RxUMuUq72TY0wTDwjIYClYJFPxjS+GiRAAIy6AGX7if/gOcgAxdJDJCmN6tTCJEoBl8lSUYVUEfY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by HK2PR06MB0548.apcprd06.prod.outlook.com (10.161.183.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Mon, 8 Aug 2016 12:54:26 +0000 From: Yoshihiro Shimoda To: CC: , , , , "Yoshihiro Shimoda" Subject: [PATCH 3/3] usb: renesas_usbhs: Use dmac only if the pipe type is bulk Date: Mon, 8 Aug 2016 21:50:53 +0900 Message-ID: <1470660653-21743-4-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470660653-21743-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1470660653-21743-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0025.jpnprd01.prod.outlook.com (10.161.131.163) To HK2PR06MB0548.apcprd06.prod.outlook.com (10.161.183.153) X-MS-Office365-Filtering-Correlation-Id: edc3343a-fa45-4c72-d0bf-08d3bf8b2147 X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 2:41H3dTSpLmFRVCklfRMrzPC+fjwZqUdWy1fAVOH4yjoYGjyfOiZM9zv2QNxgInPLmbvhQLxYqISXIPaAiT2zzFOpzc3ZRC0TSjrebRTE0bF+fuGlLrSeRAJDdQobxw9dXTcyEa2JU404FFfsWjDqkZNYIOjOSsbVqwVAeYmsWddfjAsyRIMya+tlSG4npFeb; 3:ioY1IkwHCAZ4dQlblK4uQL+iE69RsjQVD0Xl7+c1ICpfF3DPOPyJH7o7B4GJxcaMVEGJjFFrtYSn2MUWw9363a4ELiHZzEpLQcGWRXD1ltMu8/oSr3AIxgXppvb8mGcq X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0548; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 25:0R3GU9eY4ZRIf3SfGnLkFj0GC4/pmnJUiWKyKdxpOJ4Y7TpARTb0kGqm664WRK7b73UdcYXvXn5oXDjA6Z6lGvqn1sW8ngxIno+5KKRsd1Q/Ud4xTPpTDKWhdKSSI2gnbVYQPde7aiqTiQhRGLbjbGn6D9vGHJC0Ie2S8NO3GTmDM2uSr1tbTHRcm0EY+n8MN6UUWdDsK70fci5df9hpvEwSAnI8HDNk/t+YwLTpInkh8xDSX05C6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mq2k1FCETt71RqKbKhuguC5SOBDkMdFZ1KGXZOD84K+CBGNli1gPUpvccM0s6zkKBYWHP3xrnxGqkQlM4kz7wrN0MgPzk+qvaBIinfBurhLB7CjKYQVyGKMo34G7HQBLy3hTb9TaxH2IR71aQ7yjAZp4vIyplK73kqMofnXnQ6nuA6iSWE4jiCwzaCWUGmMm1ajo05+mFJ2dbjVjyVtpUQFHr+u8DHtEzVaSYsswXcV0lBLssCv4SvwqMI12/rC8SSvV9zMnfjwB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:HK2PR06MB0548; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0548; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 4:+0KWbWW0NqwZ2FIRwlnH/VRhzQ3GSFZ1KJXW3NUMetA5RW1tCtCF37KM8AQNd5Qn9GF4/JnbnP69Mz5taYEsZjIhRoX0mMdQbgClhl/sndLEGf707kKsIMifRiuxrv7vfluKy2UvXNkEZL/W3qYoOA6344vbo3fFXO1uLfXOSWEUzxZiAVNy7AKXtDCdvHnYtSQaKi57x0O/a2I/Vj1L4jlCuUgS31wYCDFMkdg5kTr40gXK1Qcwr6FzAeZbDZiFTaRsVknC6XaWSGCftT4RUX8krnTA7MEqSiA1JBlqkto7g8hbUbpENr5OZX7bm9u8hpACYLuO7gd8qYzI6nDZfpZCPhxEcE69ilINbPPxKbE1RFiSZJxM82aes4/CakSS/Gorm1Sm68V5f3NHj5SW1AlvARyp+ZLbzXLyCNo4iKsF0lKc9RsjbSJDjzsJL/T7 X-Forefront-PRVS: 00286C0CA6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(106356001)(77096005)(8676002)(2351001)(42186005)(5003940100001)(66066001)(33646002)(586003)(50226002)(4326007)(2950100001)(107886002)(105586002)(92566002)(81166006)(4001430100002)(81156014)(19580395003)(229853001)(19580405001)(110136002)(7846002)(7736002)(78352004)(47776003)(50986999)(76176999)(189998001)(2906002)(48376002)(50466002)(36756003)(6116002)(3846002)(68736007)(305945005)(97736004)(101416001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0548; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB0548; 23:DrpIpqHNwrm4TGZ59Y2gjReewCIe+KWzRF6cJbGnT?= =?us-ascii?Q?bskw7000tPCw14VbhpG5gmlE7c0y3TI2PS0ocsI1VGE+T7SiiY3A90rk/AJk?= =?us-ascii?Q?ukZs2qBLSOI1ZUp0muM2abAWWjtVa+qZOAiFF7+L03driPQlhxbXV3/P2IPC?= =?us-ascii?Q?5BDMG40TlAqubDvwx8ER0Tw0SxsdlvWIzZaAoOdiHa+xYEUyO0HZlYkI+a0W?= =?us-ascii?Q?Zu+cAl7pl7tDefjh7aFE67OlBcHSBTTc3FIFgNYnNzN4SHPAYNJA+z81scB7?= =?us-ascii?Q?P8Kqh15IsdanzXdqWe3NSz+VE3o4aMmKNW6bFRybLBsb3nyS9AsYXDmFMGgI?= =?us-ascii?Q?fJdBpL51xdHcx9EAESFd69a/1S+0iLM9AO5m1ZqGGIfmJH6Ru2LLxO+ilbrl?= =?us-ascii?Q?3GlvFAzWj6rasVL/+Jx1p49RcCYITeGoXrDWPMJCKqy/z0OtWlyi1MleNnjT?= =?us-ascii?Q?Ssj+030qHr2geCnwktD9C9qp6XJI+thQl9WqCL9elig7+SKrJ1sqjl3315u8?= =?us-ascii?Q?fgeejYtkhqoiQRU4b/GRZjj73fxzQbawAOKXpl49hh2fal0681CMOZJBPIPj?= =?us-ascii?Q?RETzcRdQlkNqS6N4MCZqg4P3SXh/Fxgiv2qqocxtk7sozJyP9RKZDBKHJ3h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KPhO5CQTAwC7MGCquw+2Rca/LLMC6VdJO3abU52UOFUG5EvdNmE8qe7hJWk0EZxCaYQYAEWEJZ7g8bl+/z7yLZAj7TN/J80EAYIgHjnBvfA==; 24:invtYPCjuSxYZ31SdPr4kZNtXMjD31TsO43LpHBMAokGdfSYNFpenC1hFKBrGeh6HIlYE0ZiGWuEfy/0n7CY4BKG+k1ixMKLd13e/IvHc5I=; 7:igCJRMDoE3LXBUUlslouisBsZDY/CWMX001pyei2vcA7lPQOdOyUsEigR20yPcnOFtDwuD0DOK5h6/b84TbHynAX10NXljkCXkpsq1G+R62yiileUI8DEwoeNqRKBSbmtf6ZNlJcN2e+82EeiD1HCQNHGpVsDW/BCZZOm0oVThDNiV/J+28ODPUrOH0SbsWS6xhAdm+M+71InitwV9CaGdXMwMNWzu0AjqwjZcAph3aXKktice/sIe2T+DJgpRxU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 20:pijeD5+g4NWowUd3HpSZvjiQuAzADkesmrRyEIDngcvuemOiuPGHG4PtyEqgASj7ntynkD2qe9KJ2GUeU/fGsZyiq+9gyv5LBRtJz2UluT2BscUfcYxAtKg4QM+igqHI86v8VeafG0Z8BSRTbq/AigLIXEogfeqfNdhJROrFoEs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2016 12:54:26.4422 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0548 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes an issue that isochronous transfer's data is possible to be lost as a workaround. Since this driver uses a workqueue to start the dmac, the transfer is possible to be delayed when system load is high. Fixes: 6e4b74e4690d ("usb: renesas: fix scheduling in atomic context bug") Cc: # v3.4+ Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/fifo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 280ed5f..857e783 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -871,7 +871,7 @@ static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done) /* use PIO if packet is less than pio_dma_border or pipe is DCP */ if ((len < usbhs_get_dparam(priv, pio_dma_border)) || - usbhs_pipe_is_dcp(pipe)) + usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_ISOC)) goto usbhsf_pio_prepare_push; /* check data length if this driver don't use USB-DMAC */ @@ -976,7 +976,7 @@ static int usbhsf_dma_prepare_pop_with_usb_dmac(struct usbhs_pkt *pkt, /* use PIO if packet is less than pio_dma_border or pipe is DCP */ if ((pkt->length < usbhs_get_dparam(priv, pio_dma_border)) || - usbhs_pipe_is_dcp(pipe)) + usbhs_pipe_type_is(pipe, USB_ENDPOINT_XFER_ISOC)) goto usbhsf_pio_prepare_pop; fifo = usbhsf_get_dma_fifo(priv, pkt);