Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755996AbbEUQOk (ORCPT ); Thu, 21 May 2015 12:14:40 -0400 Received: from mail-bl2on0084.outbound.protection.outlook.com ([65.55.169.84]:36544 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752832AbbEUQOh (ORCPT ); Thu, 21 May 2015 12:14:37 -0400 Authentication-Results: spf=fail (sender IP is 66.35.236.227) smtp.mailfrom=opensource.altera.com; intel.com; dkim=none (message not signed) header.d=none; Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=dinguyen@opensource.altera.com; Message-ID: <555E0323.6060601@opensource.altera.com> Date: Thu, 21 May 2015 11:09:07 -0500 From: Dinh Nguyen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Krzysztof Kozlowski , Dan Williams , Vinod Koul , , CC: Subject: Re: [PATCH] dmaengine: pl330: Fix hang on dmaengine_terminate_all on certain boards References: <1432168449-18850-1-git-send-email-k.kozlowski@samsung.com> In-Reply-To: <1432168449-18850-1-git-send-email-k.kozlowski@samsung.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: SN1PR12CA0011.namprd12.prod.outlook.com (25.162.96.149) To CY1PR03MB1376.namprd03.prod.outlook.com (25.163.16.30) X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1376;2:guhf3FAwH5NRIA1jxTRZW0q0FxzACcgUB7aPVv3sSU5haRBNdvU9B6osEZDOK0RQ;2:7O5DpTFsMaxsR2QBy+r5Xv6tUg1b2Hvgzwuej2JSe5v726MJGiCqYys9Sewq37/9wGEso3MQUs5E61oFrMdzy4jOZEz4w0ZwrOPpc2RxtKInl4hzAS40am3rzFnhqidLBWglQEcOVMOHzeRFrXwRLQ==;6:GeXbYGdgm8rdGfEkCQK6EB3wO/Lz2L7CGol3cQyFu9wyctySHPTxOHmkplJWJDhgY0jXzK3K9itmYs+QtvwNyVmuEVK3q1rwIQKc/WN2MeDSyNB3ZVD/1M6KAjdnxKFWZhWQSLIF7Q0juxX04c0yug==;3:HNtNpc7jUPPqS21qFkoH2WLkuAxAQbcI2gMbSvYV9Vw3o1UJje/8NoNESjCf4pntRjo1UM+LdEM4cLg8xrhyvfseFOrztFrmibPvzoqAcTg/KKHeBC8D+bG1mCclJEACwS6luvjJwxpUKw4n7GyUKmzkMsZQc/Py4lKsrXBM2SyD2ZFDgeF9XcoM+w96KKp7vilS1TXQaNT61W+Yt9DDTEQUjlN137AiqXd6APKmDQvb4wM4cXGg+Wc7e1sasfRrlX20rEEWsG2i3YFMlALBoDfRMoYM5K2PjH+8IHwwpFg= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1376;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1503;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0847; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR03MB1376;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1376;BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:DM2PR0301MB0847;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0847; X-Forefront-PRVS: 0583A86C08 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(6049001)(6009001)(164054003)(52044002)(479174004)(24454002)(189002)(377454003)(51704005)(199003)(5001960100002)(5001860100001)(86362001)(105586002)(42186005)(80316001)(4001350100001)(59896002)(122386002)(5001830100001)(23746002)(33656002)(189998001)(40100003)(64126003)(5001770100001)(106356001)(87976001)(77096005)(92566002)(68736005)(83506001)(2950100001)(46102003)(64706001)(65816999)(65806001)(4001540100001)(19580405001)(47776003)(76176999)(54356999)(97736004)(77156002)(66066001)(19580395003)(2201001)(101416001)(62966003)(81156007)(50466002)(65956001)(87266999)(50986999);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR03MB1376;H:[137.57.160.210];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:0;LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: =?Windows-1252?Q?1;CY1PR03MB1376;9:MEki05Kqu59J2HDqKdmRk+2eT9MwNqW5BzoaDu?= =?Windows-1252?Q?NwwIulUn11PlfqopmdnIHIt135xRdUdpe7xKhxj3fosf6b+eikP+F1Eh?= =?Windows-1252?Q?bzMJ6/c0e4VvzMmHsUIb+m7CgNjOeS/4cGhLv5nbIE+Om5XKVa+CnIjY?= =?Windows-1252?Q?ey7JpLI8a8USrrKrHzl3Av68gtymPOZN488EpEBb9xtPQGfODTSBWeWv?= =?Windows-1252?Q?fmgElCvYXHeduXysTadz+GW6o3m366nhdNRWMvbRQ6BnGYrxpgA+OSv7?= =?Windows-1252?Q?WnpHAEspRMYr/BnKMXc6No/qOCcKYLdSmZiuMZh2clpcmLgnQtDRfWF9?= =?Windows-1252?Q?6ImKpELrbjDxAhvltp0r1/KDw7WSQtFeUSbmKpAdF4am42ViwnFhXcZL?= =?Windows-1252?Q?vASW3vxBBKkhzU+3IaXi3OuN/uPNU4Ueujah68ihQRozXTG3Cp3AQupc?= =?Windows-1252?Q?WY/4U4s/Sfk17ZtnswPn2/Nk0wKGReNiXvZ31uAEij3NuUR955aMqMZw?= =?Windows-1252?Q?vgRvq50neAHd8Via4oqfJ08e3cjbod6ocTbyUh0zQd7Yg6ctgzafc1Fe?= =?Windows-1252?Q?aQYbOngFiFZNB4jEaFLzkF442nRYlkCuxtZG3AfbQrZvtaRhLchQ2lD2?= =?Windows-1252?Q?vbunueAwHzvTXeRUlvM8/AgFUYAMbPsLltWhFr768p5e2X19sued+UG1?= =?Windows-1252?Q?kLyeZvDcK57bg+hqtL8pyAGemX0PNU4iCCdWdJKcbsQrr73THNeERpV5?= =?Windows-1252?Q?IisIxeAqCAuaNOmpvPg+rTiDP7VyUOs3rKrLyCVSmwElhrktpHKiQJzX?= =?Windows-1252?Q?uc1AQlpXJ1bepTbIMgYXsP9L+PAuwZ6ZqY5VI7PIbcLLsPSQevrTgUnj?= =?Windows-1252?Q?K4iMD1CmyrJV68g3EZNBEXrjs+w53fl7+mvbNbxWlEFMu0lOfL+alQgC?= =?Windows-1252?Q?IU5RQbKBjyJ9QK/3ERO1mVjJyBtGBlNEpQ5Md4rsk09WYjDLlhKLi0Uj?= =?Windows-1252?Q?rqvcDC8R0j2fU+SrnAL5kQ+wZc/V220pu/TJbS7aQfICMB6BefdrKiBr?= =?Windows-1252?Q?C8S9whghDS2xxsS4Uf382vew4kAHfaQktfoQl3+uqzJ4+HKAIicv3EcN?= =?Windows-1252?Q?UZFklG+CB9PIS7PQPa+lJT7MOUEmFm4p4oALDg8SRNIpPXQHQ88s6GQj?= =?Windows-1252?Q?3rRBAYfaq+tb9HoQjm84dRe9x6GLI0MGtjVOO4A4RaPTbPEt9unvLERZ?= =?Windows-1252?Q?AdKpVcr/ZiQxNkbE9AMueNSlxhqbrVk9khws74fiRMXvUgRPjQ2LKOHw?= =?Windows-1252?Q?BGkpLaEiYei4Sgl9wxs8nIBbf4QnhBidsj+DUFolDJVTeNer5iDVUOCA?= =?Windows-1252?Q?BuscPvpFXqTFlR+bx4Esajne6qMkSN5sCxwh8dUsbsspzX41T+il4Yl0?= =?Windows-1252?Q?UoulZ9jZgaZdPKdwvVmiEt5FV01vlYj4vRHOpQzAxzH/Jhrl5tya0DpF?= =?Windows-1252?Q?sI2Ns=3D?= X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1376;3:hSuXeVV9XA5TOLEmGaDsEzXxND7URkGAf8XSbfGd493W+LAFXjSqSyS00VNJqIScAG1omcMqp9layfaYKYwGF8vfa9X3GnYs+5DVOVAk0q/xgpmRgJeOEQ0nwXbTreC1jz2s1JTTRsNLV48HoIVgiw==;10:or2Lpe2ibcUlldZTxh3+880NLztcgQRwRlFxA4eXmACRoZdjhrymIIelvzY8ydi77wAQWU42HdoLiNyaUqS8mF32zNI4itAk5Kivs/iiQRM=;6:JU67QjgIyb5NmUgsK4xrZMdDHUCu/c5pX9asYKbMfrTmD/r4o8RbmUUxxaC+iOjW X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1376 X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1503;2:QPzC+tQPuT+Y7NcNUez73zKw7tN8xsSg9/OE0eeGu+Gj2Fsg7sWl5eNMfQumhzGT;2:Z3p3VLiz9ZUtsMvzS+PRfx6JDHx8C4Ksng0YGfwoXECfe10ZUAQ/0LPXDIg0GBbZj6sBY8inNorjD9/wusyKUJYZbcA+lBKo7jgzhdhU/M3EA0z5MrjhdOjilTb5dbvmELYhrz6PSPjAxDRt0pllog==;9:I7zRpxphUoh23G6TQ/OziFx4yOEFGk70g5we3WxGS1ZNCxMSPuBAkt7J7fUehBDoKM3e95m58MLhsYi9yGNDQJ+j4AVKGzPDbPZWm02/YXPutzD/PABxP6f/NCOHEQ5p2N1xQH+uQ1N/3krRBToyAg== X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BN1BFFO11FD004.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD004;1:UE2ae0jx/XX9036qXmhhqBOJjBKKGWg+bL46Dt55g9H/i5IfBA8wMzsVVHB02s6l9UAdYb8RlQgmKJYkjyreHuz79mlaNs4oOQd8KeKS93GGrSI8sDQXoxr6s+Rv5gcHXKtenZoWPZAAK7kr21YBrBg8U4zGY0CoT6s+UJu/U54uNJmKuHiQ1ekvhd+h2Q+iX8Yk0YrwjsTPtHW5Inn23ANG1b7IR4lLfnEHArpB5iO1IpqaYMIrN5vbkl5HLQ7VQu67gabpoJHf86DpWaQqXSJA5bz7eGb/3R+ey6p5SqXi6nI9iueNDX/WGdK0B5DxOQVP7I8nAvPUyOtMSeZYLA== X-Forefront-Antispam-Report: CIP:66.35.236.227;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(479174004)(377454003)(189002)(24454002)(199003)(51704005)(164054003)(52044002)(86362001)(19580395003)(80316001)(19580405001)(33656002)(50466002)(85426001)(83506001)(5001920100001)(5001830100001)(5001860100001)(2950100001)(46102003)(6070500001)(40100003)(122386002)(77096005)(68736005)(92566002)(47776003)(54356999)(59896002)(76176999)(65816999)(87266999)(50986999)(64706001)(106466001)(65806001)(65956001)(66066001)(4001540100001)(64126003)(6806004)(87936001)(23746002)(5001770100001)(90366008)(5001960100002)(189998001)(81156007)(62966003)(105606002)(77156002)(97736004)(4001350100001)(2201001)(7099028);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0847;H:sj-itexedge03.altera.priv.altera.com;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:3;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0847;2:gWRQ3GcSCTUaysgGMGOHkJPSTUxNQS1JIgBC0DV69j+xPqKCtkeMP2O8eoVL6ick;2:i4Gr6VnU5Bx2k8FaFnTXKuhGCSeohzlJuyN/+BYQ/dOUpjdTUnRFDr3L19nxNwEH54l93dx6trnr0l4176T/F1/L2y5ezFGtTtWKZJ20/05C/+XKg1XTilQNKT68Rf6GJBF6chnxpRl5j5/uyHqCnTm63uxBTg/nzJU5JJ03b47WPFGMEkO8EhVGofBYc1KfE3JZ3GtMrPwVbwSo8NqyqsW0PzmszyyDKwXaMgrmcyk=;6:rDBzXBbs0ysKXcREaMA+sXEmWVH8WbDyex28wwrO35DhW5U1dXXl+8qcxKr+nYP/L5Ca7XRqLpoe2g6pzfN6ZKLvULnALnOQ6DskiOgqYEZ/uSh0ITFcpOiJgYkpE4fBW6zUY8RC8/ww1rMYC5+Igw==;3:6J2dj1ZWCqHfrytKQA7I46M4gP31+NhCial7UMj/WaUrN2ZKAHO9qNTRFd74is0r5OMZSswACf/OWvqV0EeY7U4dbtPMJkG2+Ez3Q3jwG+cEj4h6jw11zHFCKO4z8bNR5kW6iXGgiBHbYjljhPvq4QKEHZVTaF8ebx8Veo07EsVfXkfRLTlaluiK+7q3my2+j0o/vroXP3Blv73KfYV2r3a2PfhWfLb0Pl4TZxA64InmsGLZ8OFqqExafnhKM2Q8i0hNkT31M4NXopxWQUDYGCxz+MFjmTps5LzZDF56dTg= X-Forefront-PRVS: 0583A86C08 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DM2PR0301MB0847;9:3kZOM9Zw6iKXLM7d/KObYzYe0Z3g4DoYcDEC?= =?Windows-1252?Q?6o3gAB+ZMMBAyIvsU9/qD6v7pH1nFHSDfL4jx+5g1XXMBsdftz7BzaC2?= =?Windows-1252?Q?Gm1GOeLnOpnHfLwd/8aWH9M+lgMYkzT1k9ut86eO84+DQZBMz43eIpsn?= =?Windows-1252?Q?N2u3BBgK1HpjEg1/V6yJI2HQ0WWhHWxGyl4cVN9vzcEdOf40YdbSx5nP?= =?Windows-1252?Q?+U0SBF7VG7T5SwDhGbZii5szOnJudjaPSSTgtPPajCpKMYURC9gBmpDA?= =?Windows-1252?Q?rOuITPC5D2KWZtWgodRysjfCWpTo4U00fsyt2udNT1ZXDqcSAzn5Nn1l?= =?Windows-1252?Q?X9roTeFUhFjYF3HTleMdG8siwY4HKoebPnQh0FKsDcnIXiQLHn0/ZMsX?= =?Windows-1252?Q?0ZZyDqSC53C5tUAbzcGoJkbBtof8x7Isx/K4RKN5EsRP8VRctCK0xZ4L?= =?Windows-1252?Q?qRk/xGWalPEgN7nZddITpZyUiQzxn38diTkBi6oIRAPA9FdmRZxJrA1a?= =?Windows-1252?Q?umMj3FgRVhRYz/dBZ9aRoEfX5BKq1bPfzjynODOXsfmeLVnae6Q52ThU?= =?Windows-1252?Q?lNudxUyANZvWqJsGifwKchak9wp8UfLlXewRHBM+ZBCt01Jtsgl7DnNg?= =?Windows-1252?Q?sia71IV/NRdK01Mq4BT9tHYYpFynLmZPyCa9cShvVJzL1OjtUjWbvunH?= =?Windows-1252?Q?y1ZQhTyjeBVQUaWx+Duvmg2GK1mKRiXJU5Thkts8EBH1PkGUXz6S2f17?= =?Windows-1252?Q?U4Kzit18VPZRrji9WQDgKPmWwNCsO7F37hBKYF71Mjeq8NMemVsUH0LI?= =?Windows-1252?Q?dDwiu5QFTw+fUGsIgG3m9nXKOdss0FUybHORAFgLaueZ9lzxmEmwbypl?= =?Windows-1252?Q?o9LcskMMjdbFeyJv90IIgyrYT6Ht/tuh4EzTdabRUUWr6c18gvZukTWK?= =?Windows-1252?Q?ZzfPOEAcZfrHScF4po+fLUp0Hlb52MnChVGd7WDwAtCpjBzOu2QJjtKS?= =?Windows-1252?Q?a7fhsH9BaakZG3sIfmclJZjC6Inw6dFZ4K3LrnLDDlNK97qpJEwA13my?= =?Windows-1252?Q?MfLckrxiUZ5hGb2HsSgC/UYAATOqiZ2cKXS+ul/btJQeIMrYrsK9Jk5y?= =?Windows-1252?Q?ddptyCtt3wzo3RlW6B6lxLP+zI4UOg4VnYKQq/9GAVXK02bS0kRGlrr7?= =?Windows-1252?Q?1GcU1N3xYB9+JK4aXDn7QR/OzzstcXWdjMHYaAsaaWok9g45l7j+xEbL?= =?Windows-1252?Q?FX/cZEPxVBjZNmi6cuo0VTBPMUpIs5jSRoxxV91ZC+0jyO1NDA2FJDGB?= =?Windows-1252?Q?Omk4qaUkf2OlWzVNavoRXeY4TD/SJWkE6PECGYdfoZc7eIwfrMKGoAXb?= =?Windows-1252?Q?IzcTGhTCkwQAhvRxbo6rLLGrl8QjBKcBWqoV9ntYoPMDcyYnm1nnxihA?= =?Windows-1252?Q?tJVe75A9ycpeYgoLcHyw80C1jm1FbgqxueqVQ/KVVXEzIWTli7o2VrWd?= =?Windows-1252?Q?oD9x48FYiL898svCiaNYg8D2ZxecH/cwrC9pbOuikAQbO65ySsqP5m+I?= =?Windows-1252?Q?X1ynwJ6EnJDeLqAtiAVbeKbiH4ow2yenh07/YldTpvnXWO5a+Lkmh2zU?= =?Windows-1252?Q?ag=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0847;3:zvT8UWq1w7yrrkq6D+cPfN5i3Z1M7Wc+MrPisZZHG6JVHNtWts6m8qXmSQUIyd94sJLIXaRIX3TvgPu6/xqoXehc0UlG/9EM3fGvwZ2KpDIbdyXHq/icmvsfCpHM9aGsLUy+cjUpbJ0Oyo40JaHt7w==;10:qmzUFhSbn79eyxu3FRaQuPWuyBJslW5Bpfj+gsJMF86bLN4VM1DSrswUc96OkjquQM5UZUpoVRxd4z5o5xeV6aBjZMuFkEnKjWU63Q99SG0=;6:ARv49ip4xZK46XsOi9gu+atWZ3nxFQA4N5tAa/HrRubDDVVJOXe5koAdRLhNZCiJ X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2015 16:14:31.2900 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a;Ip=[66.35.236.227];Helo=[sj-itexedge03.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0847 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2396 Lines: 65 Hi Krzysztof, On 05/20/2015 07:34 PM, Krzysztof Kozlowski wrote: > The pl330 device could hang infinitely on certain boards when DMA > channels are terminated. > > It was caused by lack of runtime resume when executing > pl330_terminate_all() which calls the _stop() function. _stop() accesses > device register and can loop infinitely while checking for device state. > > The hang was confirmed by Dinh Nguyen on Altera SOCFPGA Cyclone V > board during boot. It can be also triggered with: > > $ echo 1 > /sys/module/dmatest/parameters/iterations > $ echo dma1chan0 > /sys/module/dmatest/parameters/channel > $ echo 1 > /sys/module/dmatest/parameters/run > $ sleep 1 > $ cat /sys/module/dmatest/parameters/run > > Reported-by: Dinh Nguyen > Signed-off-by: Krzysztof Kozlowski > Fixes: ae43b3289186 ("ARM: 8202/1: dmaengine: pl330: Add runtime Power Management support v12") > Cc: > Cc: Dinh Nguyen > --- > drivers/dma/pl330.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c > index a7d9d3029b14..340f9e607cd8 100644 > --- a/drivers/dma/pl330.c > +++ b/drivers/dma/pl330.c > @@ -2127,6 +2127,7 @@ static int pl330_terminate_all(struct dma_chan *chan) > struct pl330_dmac *pl330 = pch->dmac; > LIST_HEAD(list); > > + pm_runtime_get_sync(pl330->ddma.dev); > spin_lock_irqsave(&pch->lock, flags); > spin_lock(&pl330->lock); > _stop(pch->thread); > @@ -2151,6 +2152,8 @@ static int pl330_terminate_all(struct dma_chan *chan) > list_splice_tail_init(&pch->work_list, &pl330->desc_pool); > list_splice_tail_init(&pch->completed_list, &pl330->desc_pool); > spin_unlock_irqrestore(&pch->lock, flags); > + pm_runtime_mark_last_busy(pl330->ddma.dev); > + pm_runtime_put_autosuspend(pl330->ddma.dev); > > return 0; > } > This patch indeeds fixes the pl330 DMA issue for the SoCFPGA platform. The multi_v7_defconfig now completely boots on the platform with this patch. Feel free to add: Tested-by: Dinh Nguyen Thanks, Dinh -- 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/