From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932445AbbEUQSF (ORCPT ); Thu, 21 May 2015 12:18:05 -0400 Received: from mail-by2on0053.outbound.protection.outlook.com ([207.46.100.53]:14085 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756486AbbEUQRx (ORCPT ); Thu, 21 May 2015 12:17:53 -0400 Authentication-Results: spf=fail (sender IP is 66.35.236.227) smtp.mailfrom=opensource.altera.com; lixom.net; dkim=none (message not signed) header.d=none; Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=dinguyen@opensource.altera.com; Message-ID: <555E03EA.2060407@opensource.altera.com> Date: Thu, 21 May 2015 11:12:26 -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 CC: , Dinh Nguyen , , , , olof Johansson Subject: Re: [PATCH] dmaengine: pl300: enable the clock to PL330 dma References: <1430713734-12175-1-git-send-email-dinguyen@opensource.altera.com> <55477413.2020908@opensource.altera.com> <55477CEC.1050600@opensource.altera.com> <5547CDEF.5050003@opensource.altera.com> <5548DA1B.2080604@opensource.altera.com> <5549187E.7050802@opensource.altera.com> <555CEEDA.4050309@opensource.altera.com> <555D23E5.7060200@samsung.com> <555D286C.2000901@samsung.com> In-Reply-To: <555D286C.2000901@samsung.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: BY1PR0501CA0018.namprd05.prod.outlook.com (25.162.139.28) To BLUPR03MB1364.namprd03.prod.outlook.com (25.163.80.30) X-Microsoft-Exchange-Diagnostics-untrusted: 1;BLUPR03MB1364;2:2/1qjtcTVf7voF5o375rKD8SgU60qG1JVAVKLfOFufyrggfSFSglPPnY1LicjNkr;2:cdZ1QxLKeGQgiNZRDOBHR+a3zhdaTH65AdhNIO8LbsV3hsWt2a18TIiLhpmeE3iCx6XHBCxjhREV4j6rmlpoLzNiNqBgdQ1f/KBtEVrq+Gs7Ix8LXW+s3V7wEyuq3C1eaUrDb5fFr9lK3ieR3YGblg==;6:xgbDcZxm/rtU9FZSjclBoNM6GHoMT0fRsajMA/M34JxNYRUhZ6ty8R7qlKdbf81CMgkMXBKOtQuN+h6wD8OVvOUKun75DeDBTdKE66oQtuA3b2u0gDIcueT+a7PEUNRlQz1MzT/4PXDM5sS0XBS72A==;3:kyFL5888EIf7G/9KkUgIt2db/gve0GP01yDjfFd7rYiEefKJ/0xcqoa2D50EWvr8EeXYTcbKl1EUi1v8VjiRQrTZfu4IOFubShzyO5tWK3eoByAvtZ/cKNgHseb6+UgnSmY0tdZbA1Ba4mfYwt6st62I406ipNwROhf/wi26pVOfmJmOSwKicbNkzQFXCLt4dBXr8ddxvaeEAAzsc79uXgKQmsPIXSvD5orFt6rkO6nX9A9RhNrYHcKC4tp+Yu6M1H+uPWUlNZ7kMV+ZRMf7UZbemJeLwQ+EXV0Jqy1+OGs= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1364;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0846; 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:BLUPR03MB1364;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1364;BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:DM2PR0301MB0846;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0846; X-Forefront-PRVS: 0583A86C08 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(6009001)(6049001)(479174004)(189002)(199003)(51704005)(24454002)(377454003)(377424004)(92566002)(189998001)(33656002)(5001860100001)(62966003)(40100003)(122386002)(83506001)(19580405001)(80316001)(19580395003)(23746002)(76176999)(5001830100001)(50986999)(54356999)(87266999)(50466002)(101416001)(86362001)(77156002)(65816999)(5001960100002)(64126003)(110136002)(575784001)(93886004)(105586002)(64706001)(47776003)(87976001)(81156007)(4001350100001)(77096005)(68736005)(2950100001)(97736004)(15975445007)(59896002)(106356001)(42186005)(66066001)(65806001)(46102003)(4001540100001)(65956001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR03MB1364;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;BLUPR03MB1364;9:CA9kDwFa9VmdVfH/a7rTnkWxU2DM+bkWuSSJVo?= =?Windows-1252?Q?AIwEcKJZxGwB0y2EAxaYMa77Bec0t4JRgk0e9m+Ih57rNsGF6cG89F8m?= =?Windows-1252?Q?ZDYGxdX3qu7rgXGSyU4XjpnISt0bAHCQ7F6YJVnJ0EQIDznggQQxL2w7?= =?Windows-1252?Q?17JNTyaaDsC3xpV/pDi/QPVuDET2dqeeOCtt64IcSgd/dX1Mz4oxjof4?= =?Windows-1252?Q?nYbPVQSetN7ulN0JX1VkiXRbdXy0rnX0R6u7KgJ6Y7FTbsrEWMui5ljF?= =?Windows-1252?Q?NhnwRyRvb6vC+oOdguU/bm4zkrKCifHBLvKMBjDYEUi46cGnAcEAXmgz?= =?Windows-1252?Q?u3G2oZSAWbqL9Ebog9eNJHfJbsNdXAzuCZAjDGrrteWcEOAfelsvfjAJ?= =?Windows-1252?Q?vEWX53gd874t9/7s6t1yT2DIhKbCPx0bFHYDbUTXHIByy5uCaoVQrTcG?= =?Windows-1252?Q?Te/DI9Lqh9JpQkqCfZmT5w/b87/WkuTv727mLjr0GlTHoONDlJja0zXX?= =?Windows-1252?Q?6t6TFbzt+4BuNsgqv+IC/eT3ltKrvfGXeuwRP/21BFmMQ6FNo8VxVlAE?= =?Windows-1252?Q?QkZ5iOCnZUpu6+iPugifvgQz1tsAa6EJ9mYqjmSSOOQ7yskLBhCe/NY9?= =?Windows-1252?Q?SwHgcqPhwxsMp5+iUUfnpbYEA1Gp1OEOvEZ6KyIYsSrzPEJo+ptVG1f1?= =?Windows-1252?Q?4aC4k791uqTFFlNCdljsWuqlVrb0xCm3pMg1oy1kdEaDexg87wwvKvgy?= =?Windows-1252?Q?fK0IOx1N3w4rilYE2DITk2XR6RSYX2gvbprt4hQVHhqJi9XKooHRWJpP?= =?Windows-1252?Q?2PmlWG3U4meqR+hk38d/mlHdensaDpIvP+ev9x+jYZ0+wY3ug65a3LO4?= =?Windows-1252?Q?my8V68JDnCImWkriKZ59G8F2oU46o9vL2T3xU0RZsgkjirGioFpMogBP?= =?Windows-1252?Q?BSiBI2qqQOu4CWHyGMUInQaupwdZUkgUOowZ/fyEmb5kZ71/8q2njRt2?= =?Windows-1252?Q?moJPN+9KCi4TQo78LmktQmB0F29CwsLMohBF51vQVH26L8sL7IzIe0Xx?= =?Windows-1252?Q?Mhgvez7rmRHwxX+nIFWB7jzXQNPlHPea5CEo+p9snY+67YXmbw469qO6?= =?Windows-1252?Q?DxdbLYPDvaRx+OuzhSiECFFnMWMKMMgiSUdfFYl6pnBaFemQQZVMXyA5?= =?Windows-1252?Q?KoN7MJSPBFsKtwS4Twxi9S2IQXYIUSsotyMtukDYTowCaqBmd+yE5oat?= =?Windows-1252?Q?obySuZ+mrR3o9gSUOVp0AukHYDw6uhnsKd+bsomCjR+rOn4WOU5TbpgN?= =?Windows-1252?Q?kLyQ9OiqmLHLEi9+tH0WdZ14dC6BO0KBzQJIjPbv7rWhoLUW/yzv4Jok?= =?Windows-1252?Q?HGOdxQ10m/z1LvruxjkMxjxG7vWbhAot2RwPycn9RF5ECOR8YD+9h1De?= =?Windows-1252?Q?ieEBKGQR1avym0icDqlY8M2FVMxxiB9FS+oD+eX03TnuGeXHhTxk/wMd?= =?Windows-1252?Q?HjQA4TJo0uJ0APraiAxhhZlCKh?= X-Microsoft-Exchange-Diagnostics-untrusted: 1;BLUPR03MB1364;3:q4p06wZYKZL3LaBHYiXF8T1WNNaRPMP7YX32I1XbgwhfHWGgk6L03Pe1xApgUr/H7EXQqW3Mr2asSFc2Hnr8rfns6rIWn4Aaa3eQipT4raAGq3x+yHOlrOQVBnohL2IHiDXyYQcFCvjOv0+o6UjSZw==;10:qWXiT4SJQNCYrCRA1GvFxgzQTjlGN13Se5x/BPfOX5pPRLtzWZvTppGSZUUiQmIR/1Q9R49PXE/rk8eeJE+v5IP4vQTZ7a4N1d3V4KrP6Rs=;6:UqYVh2ioNEtPpXFJg9FZOucks6ES9Ya5QS4Kw1dELIu5fqsHrPzk5u1MAU1/kcHa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1364 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BY2FFO11OLC011.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11OLC011;1:UaGTeXFejN9ZGNiWhIfzkFiF2+34+MyQeXrftJzDkXE9WYSSoz+eA94q9bwp7Ov4rfnXcBPIGbG/w87Xtkn2KXpbIzhewXobYWhs0KowFyNrVT+f5Uh8jMFF3humUQ/kJsTfe0tAlU1dqFM1FQw308BBH4IEJdsaOSAR+KBjWz96DLXgXDyfyJWnXCtlHl9+sfIWX85WA/Rrxtf6iTkdzOu3ak7aPYPTrzX/z6klpsN9lVTAezLB1bq1ZZkcxstYHezy35qyFWI0OmmRMPHLfqIfeMFZm2Mv70GaYYEWv1ZxpxJpMoGibWonoO3OiiK7IVJNS3zAx1WNZ5/yuWXq9g== X-Forefront-Antispam-Report: CIP:66.35.236.227;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(51704005)(479174004)(377454003)(377424004)(189002)(24454002)(199003)(65806001)(65956001)(66066001)(54356999)(64706001)(47776003)(87266999)(65816999)(6806004)(50986999)(76176999)(106466001)(92566002)(86362001)(575784001)(83506001)(85426001)(64126003)(33656002)(87936001)(23746002)(105606002)(90366008)(50466002)(80316001)(19580395003)(19580405001)(5001920100001)(5001860100001)(77096005)(68736005)(15975445007)(5001830100001)(16796002)(2950100001)(5001960100002)(46102003)(110136002)(93886004)(77156002)(62966003)(59896002)(97736004)(40100003)(81156007)(4001350100001)(189998001)(4001540100001)(122386002)(6070500001)(7099028);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0846;H:sj-itexedge03.altera.priv.altera.com;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:0;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0846;2:6TDqiyGGe+ARmcmEHpx64X+CNwUkj56NqzICs07bFL31kJiW7AyvHnPpTaMWQQuV;2:ROT/Ycd//PNn80eN8p5Fi2+IuxLHc6JLD1y4GaE+18t85+j6cfHH7jW9T7GDy3e0YtN84vFF6xIa58yOx3bPxNemfSCQPOprHNX8X0Ug6557ImtnEwADKpZf4MI8sdyJo+JP43mbkDrl51eHvfSbt6R4LbU8smGY64srmpNy3WZmwMAm0R39lL1CrMWk1MrZNpCpV3nzbV8QXY2BMrI9TxOMNuemju3BGeITkyoGp6A=;6:E1BGrJ/SkJ+iY3Aj+T7/lh0KvPVIpJ8A9raodQokXJ1RY0iULIzy2J6SaZt4Pjf8hlpSiAaItF3Baltt/qJnaPidPMgPWXh1YWYZRe4NSN++HptU+ztc/eAeICEzQUlLDaasZQyD58cQK4vFZeSH0g==;3:nKLHrxoZ7J8NbD602pTRa/jLwzSR9/H/KGqqcBGKztXF8p/cenZDxGUcW5l/UacB6tQsgFQ+m1U0GMtbguZu7spv1ri2/gVceLvG2ldLPsDb9d7iLrkYR1B550mJ97QJ0yHiX6NTeWNzdfh3ZeY/S5cj57beHhQFPApP1gG7DHd4/X3b2n5DKLXZzl5a/GiIpWxe/8LwPE/HJhn5xFwfcO77gSNN7yptXIApaubEhQUhzRwgz8ZFs31ItLwqFPyF9eFx2kqz0n2FqFdxObCNT+fcjFPC9x7xJE8Lqr1vdsY= X-Forefront-PRVS: 0583A86C08 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DM2PR0301MB0846;9:zuKw2VktebMOvNL4qMeBpcy38eIgeJ16JWbk?= =?Windows-1252?Q?3KQ4YcGh/MQl1ynCqACRRuegzJyJzYXETvHE7xKsSu1pBrMB+NhRgKad?= =?Windows-1252?Q?m8ZOPpHoqIKRqQfukTtOj5BqWf8HBHh5mxmnGLL18DCOOMQ8Z1gv1ntC?= =?Windows-1252?Q?JGmtd979Ce8zW0nlfeQzOOgnNjWfzd2C0xUHJu1nMDVv5mPA+AQkWwK+?= =?Windows-1252?Q?D+DTDypcmkBuLH5wKXS1fUHa1QrJea/Vx7TWQfsqDni9srfSt6HxWnNw?= =?Windows-1252?Q?y7iuZ1FRcg5szAVdu7vywGJVCbJqRKs5wIp96wSEDG2h5mX7M2K7hsC0?= =?Windows-1252?Q?/88SxupL1/7gQK+ZruBMqiemzGQQYIKZwvk9yP9wSPq53sZVjdfv3Iig?= =?Windows-1252?Q?1YXAw3Ivl5rxrg9lzL0Uc5lPomEIFpag6U8FS4OK24p6IciX86WV7ahg?= =?Windows-1252?Q?47DDC9AYGs7X9dN9YMMVz+sSsMVJOZb7R4W+QbbsmWkeAgkpWVWsWYuG?= =?Windows-1252?Q?KJ38uqatk8bLrDocEa3q/NYUOTfAP1ooti1ESOG8hy1NAXJV4Hh989y4?= =?Windows-1252?Q?q6JrF6a/yvXmDGimAPH7N/5iT7k4HV9wUdvYp4QJ+JSCJy3Owg4vwvdl?= =?Windows-1252?Q?D41OYYEljlwadE28jVTTkBgmxOz0QMSWTO6Cn/SnsP/Rba/SYCrVZuPf?= =?Windows-1252?Q?9weIA36wxRdikqF+lhwxvrCWnsAY0gaI1lqnfe3EGlrET1vLUQbaFwG3?= =?Windows-1252?Q?xbwOJWyTgM3arZ6TITtAb3F8AM0KtbMsj3X1Fai9vwlz1VmPtHvN0tP2?= =?Windows-1252?Q?fhiKjNxAS1NCi8d7LXG0dRcaClfgAC/EdWVlG6qXjD/YFfpfk+bffXsu?= =?Windows-1252?Q?B9+NRXpTyD6r91Ai+vu+hVEr8lZcgd0Fuv1q808ieaSTPOa+KEItK7SO?= =?Windows-1252?Q?jxFprAOvGegi8y+HkyuKmhvh8A+eqYtOHfpAalnyK3wRhsZmz9mTbo3T?= =?Windows-1252?Q?sNMGVT0rtZlovu9M9MjFVBPBip/c+F+GCMxzwhiplsHoSAJ7Hzoe4uMz?= =?Windows-1252?Q?wUrD6fefjbE5uu+F8jeaM6x89BXrTPq/16XgePGpg7ysUgHNb182qhks?= =?Windows-1252?Q?zmgmkHvRUW/mZN50yRg3gy0X5oo9V7dKNJDR5N+nM8PnbvwVnv4hMv/3?= =?Windows-1252?Q?QaEsJtGfHeMcr4OTSQ2kWfXRrpqroRyrvpIXAw/ZayckJg1S4qHce7hj?= =?Windows-1252?Q?uWKjsPnoX3BQTK59W7DAGMBxQxhCtb0HPecg4JAEi9sWLF0/4J2jxzkW?= =?Windows-1252?Q?zl08cRugPEefYTSWxxRHYowpPTgsmL6dfXCkZuWqs/g7x8CJg0GAOOUF?= =?Windows-1252?Q?6+mH9eOM8bFYvn8Ioh+tC/04jXza1W1qHV6x4OgzfjC+K9R3bgKY486N?= =?Windows-1252?Q?peuXPkICzIqiIGhWnXuBqIxZYUx0fdVaJxuyZdGBAYAbGe0Y5RWnDcEz?= =?Windows-1252?Q?fvyxgB17AS6vJZUHuNe1F3yA+UxAu/lGNFgGxlIYtQtjnHWjScAW//da?= =?Windows-1252?Q?VKZCO7PEMOlTH47VLi7/oy66+LMwztn6asRYpgEXy901r4P0b2ckBwyS?= =?Windows-1252?Q?2cSljqzsCuwFstrlv2VkavfloSRLLJ2B4jS2l8J+Zv/w?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0846;3:jYbQ+/6EMdicuEYCk2nWhuJAXyzKA1o8ucip9wLB4FlRhAPbxJw7BzIzaMFZLOfbtKdZhqs5b3+FXrPbmDrpI7OP9RPE9Wvbt2j5Jd9RjiDX+ihGqx5HAaGgNv129pxmk/vtUboZXFkBiCfFLPKJrw==;10:e+d6EgPejDeYXiMIHt0OL4KWDHpGNVJPymYkAm2TU9r+5119fsLHx03HyC667b0UVhVAGBHRPNjAuQGJhDM9iR7oueJJK0AJh7WEG0Vzdw0=;6:8fmUv90nTmeP7WlRMgYlum5eYdybPLizJk7JB7Qo/Y+L+VU8u3KVSHkEsDRuQ237 X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2015 16:17:49.9070 (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: DM2PR0301MB0846 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/20/2015 07:35 PM, Krzysztof Kozlowski wrote: > On 21.05.2015 09:16, Krzysztof Kozlowski wrote: >> On 21.05.2015 05:30, Dinh Nguyen wrote: >>> Hi Krzysztof, >>> >>> On 05/05/2015 02:22 PM, Dinh Nguyen wrote: >>>> On 05/05/2015 09:56 AM, Dinh Nguyen wrote: >>>>> On 05/04/2015 10:55 PM, Krzysztof Kozlowski wrote: >>>>>> 2015-05-05 4:52 GMT+09:00 Dinh Nguyen : >>>>>>> On 05/04/2015 09:06 AM, Dinh Nguyen wrote: >>>>>>>> +CC Olof >>>>>>>> >>>>>>>> On 5/4/15 8:50 AM, Krzysztof Kozlowski wrote: >>>>>>>>> 2015-05-04 22:28 GMT+09:00 Dinh Nguyen : >>>>>>>>>> Hi Krzystof, >>>>>>>>>> >>>>>>>>>> On 5/4/15 12:30 AM, Krzysztof Kozlowski wrote: >>>>>>>>>>> 2015-05-04 13:28 GMT+09:00 : >>>>>>>>>>>> From: Dinh Nguyen >>>>>>>>>>>> >>>>>>>>>>>> Turn on the clock to the PL330 DMA if there is a clock node provided. >>>>>>>>>>> >>>>>>>>>>> Why? There is no explanation in the patch for this important question - why? >>>>>>>>>>> >>>>>>>>>>> Amba bus already does this and provide a wrapper function. >>>>>>>>>>> Additionally that would mess up with runtime PM and clock >>>>>>>>>>> enable/disable. >>>>>>>>>> >>>>>>>>>> I don't see the clock for the DMA getting turned on at all, which is why >>>>>>>>>> after the kernel has booted, the filesystem tries to open up a serial >>>>>>>>>> port using DMA and the system hangs. The failure is seen here: >>>>>>>>>> >>>>>>>>>> http://arm-soc.lixom.net/bootlogs/next/next-20150504/socfpga-arm-multi_v7_defconfig.html >>>>>>>>> >>>>>>>>> Thanks! >>>>>>>>> >>>>>>>>> The amba bus and pl330 should enable the clock and then disable it >>>>>>>>> after probing: >>>>>>>>> static int amba_probe(struct device *dev) >>>>>>>>> { >>>>>>>>> ... >>>>>>>>> ret = amba_get_enable_pclk(pcdev); >>>>>>>>> ... >>>>>>>>> >>>>>>>>> I wonder why do you think it is not enabled at all? >>>>>>>> >>>>>>>> I've checked it down to the register level that the gate for this clock >>>>>>>> does not get set. >>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> This only happens with the multi_v7_defconfig, because the PL330 DMA is >>>>>>>>>> getting built into the kernel, while the socfpga_defconfig does not >>>>>>>>>> enable the PL330. >>>>>>>>> >>>>>>>>> It makes sense. If pl330 driver is not enabled then necessary clocks >>>>>>>>> are turned on by bootloader. Probing pl330 effectively disables the >>>>>>>>> clock (if DMA is not used). >>>>>>>>> >>>>>>>>>> The DTS for the socfpga platform looks like this: >>>>>>>>>> >>>>>>>>>> pdma: pdma@ffe01000 { >>>>>>>>>> compatible = "arm,pl330", "arm,primecell"; >>>>>>>>>> reg = <0xffe01000 0x1000>; >>>>>>>>>> interrupts = <0 104 4>, >>>>>>>>>> <0 105 4>, >>>>>>>>>> ... >>>>>>>>>> #dma-cells = <1>; >>>>>>>>>> #dma-channels = <8>; >>>>>>>>>> #dma-requests = <32>; >>>>>>>>>> clocks = <&l4_main_clk>; >>>>>>>>>> clock-names = "apb_pclk"; >>>>>>>>>> }; >>>>>>>>>> >>>>>>>>>> Perhaps I have the wrong designation for clock-names and the amba bus is >>>>>>>>>> not able to pick up the correct clock? >>>>>>>>> >>>>>>>>> I have two ideas: >>>>>>>>> 1. Is this really the clock for the DMA? If DMA is not used then >>>>>>>>> disabling it should be OK. >>>>>>>> >>>>>>>> Yes, this is the clock for the DMA. Yeah, leaving this clock off is >>>>>>>> fine, until the DMA gets used. Up until v4.0, SoCFPGA was not using the >>>>>>>> DMA at all, but in v4.0, there was a patch to assign the UARTs to it's >>>>>>>> DMA channel. >>>>>>>> >>>>>>>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/socfpga.dtsi?id=78c03c7af89721bd8a4428408a8cc7b53972e4b8 >>>>>>>> >>>>>>>>> 2. Disabling the clock may effectively disable its parent or >>>>>>>>> grandparent if there are not more users. Maybe some other driver needs >>>>>>>>> these parents to be enabled? This was the issue for at least one >>>>>>>>> similar error (on Exynos boards). >>>>>>>>> >>>>>>>> >>>>>>>> I'll check up on these issues. When I was debugging this issue, the >>>>>>>> l4_main_clk is only used by the DMA, so it was not getting turned on by >>>>>>>> an other drivers. >>>>>>>> >>>>>>> >>>>>>> Ah, it looks like perhaps there's a problem with the serial driver and >>>>>>> suspend/resume? If disable CONFIG_PM, then the DMA seems to be working >>>>>>> fine with the debug uart. It appears the DMA is getting suspended and >>>>>>> doesn't get resumed. >>>>>>> >>>>>> >>>>>> You mean runtime PM suspend and resume or system sleep? During boot >>>>>> only the first one should happen. >>>>> >>>>> It's runtime PM suspend/resume. >>>>> >>>>>> >>>>>> Could you test the DMA with dmatest? Disable the DMA in UART and >>>>>> compile with CONFIG_DMATEST. Syntax for testing is here: >>>>>> Documentation/dmaengine/dmatest.txt >>>>>> >>>>> >>>>> # echo Y > /sys/module/dmatest/parameters/run >>>>> [ 93.143775] dmatest: Started 1 threads using dma0chan0 >>>>> [ 93.149227] pm_generic_runtime_resume >>>>> [ 93.153334] dmatest: Started 1 threads using dma0chan1 >>>>> [ 93.159380] dmatest: Started 1 threads using dma0chan2 >>>>> [ 93.165041] dmatest: Started 1 threads using dma0chan3 >>>>> [ 93.170280] dmatest: Started 1 threads using dma0chan4 >>>>> [ 93.175996] dmatest: Started 1 threads using dma0chan5 >>>>> [ 93.181642] dmatest: Started 1 threads using dma0chan6 >>>>> [ 93.188754] dmatest: dma0chan1-copy0: summary 10 tests, 0 failures >>>>> 282 iops 2008 KB/s (0) >>>>> [ 93.197091] dmatest: Started 1 threads using dma0chan7 >>>>> [ 93.199353] dmatest: dma0chan3-copy0: summary 10 tests, 0 failures >>>>> 297 iops 2260 KB/s (0) >>>>> [ 93.205407] dmatest: dma0chan0-copy0: summary 10 tests, 0 failures >>>>> 177 iops 1364 KB/s (0) >>>>> [ 93.215599] dmatest: dma0chan2-copy0: summary 10 tests, 0 failures >>>>> 196 iops 1450 KB/s (0) >>>>> [ 93.219994] dmatest: dma0chan4-copy0: summary 10 tests, 0 failures >>>>> 225 iops 1554 KB/s (0) >>>>> [ 93.224322] dmatest: dma0chan5-copy0: summary 10 tests, 0 failures >>>>> 231 iops 1948 KB/s (0) >>>>> [ 93.230065] dmatest: dma0chan6-copy0: summary 10 tests, 0 failures >>>>> 231 iops 1759 KB/s (0) >>>>> [ 93.231251] dmatest: dma0chan7-copy0: summary 10 tests, 0 failures >>>>> 298 iops 2331 KB/s (0) >>>>> [ 93.243523] pm_generic_runtime_suspend >>>>> root@socfpga_cyclone5:~# >>>>> >>>> >>>> If I run dmatest the 2nd time it fails. It does not look like >>>> amba_pm_runtime_resume() is getting called to turn on the clocks on the >>>> subsequent tries. >>>> >>> >>> >>> I managed to track this down the call dmaengine_terminate_all(), which >>> then calls into pl330_terminate_all(). So in pl330_terminate_all(), it >>> call _stop, which hits a infinite loop, UNTIL. But since the >>> amba_pm_runtime_resume() has not been called yet, the clock is turned >>> off. Thus, we're stuck in an infinite loop. >>> >>> I'm not sure what would be right approach to fix this? >> >> Good catch. I confirmed that device is not runtime resumed. I wonder why >> it works in my case (pl330 on Exynos4412)... >> >> Anyway I have an idea to fix it. I'll send a patch. > > I sent a patch. Could you test on your board and confirm that this fixes > the issue? > Thanks alot for the patch! It does indeed fixes the issue for me. Dinh