From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425212AbcBSHUe (ORCPT ); Fri, 19 Feb 2016 02:20:34 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:23699 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424789AbcBSHUc (ORCPT ); Fri, 19 Feb 2016 02:20:32 -0500 X-AuditID: cbfec7f5-f79b16d000005389-3b-56c6c23d0673 Subject: Re: [PATCH] dmaengine: pl330: initialize tasklet after spin_unlock_irqrestore To: Anand Moon References: <1455816110-2799-1-git-send-email-linux.amoon@gmail.com> Cc: Vinod Koul , Dan Williams , dmaengine@vger.kernel.org, Linux Kernel From: Krzysztof Kozlowski Message-id: <56C6C239.3080000@samsung.com> Date: Fri, 19 Feb 2016 16:20:25 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xq7q2h46FGew5w2sxfeoFRovVU/+y Wrx+YWhxedccNot1G2+xW7zs28/iwOaxc9Zddo/Fe14yefRtWcXo8XmTXABLFJdNSmpOZllq kb5dAlfGtp997AWtghUTd29kamC8w9vFyMkhIWAi8Wb1A3YIW0ziwr31bCC2kMBSRom+iVUQ 9lNGiaN9TCC2sECExKeJv8FqRATUJK48XcHaxcgFVHOJUeLrpT5GEIdZYAajxMT9V8CmsgkY S2xevgSsg1dAS+La9X6wOIuAqsSq/ReYQWxRoKmHO7vYIWoEJX5MvscCYnMKBEvcutkNtJkD aKi6xJQpuSBhZgF5ic1r3jJPYBSYhaRjFkLVLCRVCxiZVzGKppYmFxQnpeca6RUn5haX5qXr JefnbmKEBPPXHYxLj1kdYhTgYFTi4a3QOxYmxJpYVlyZe4hRgoNZSYRX1x8oxJuSWFmVWpQf X1Sak1p8iFGag0VJnHfmrvchQgLpiSWp2ampBalFMFkmDk6pBsZODsWskCWHN27kjLCYy1ny Vm7zsVvpJ4I+WHhsTdqdfC/GXGHV24P8a4r9U4z3LWU2n9Pu7LJGil3v74Wo3J+iBj1R6bet he5vfhgfuj9oX2hT5dunmQx7kk6f1omSFbEztP22TkumfNeSQww5lzQfNJl82TZ56or0qUlv tRWMjuSvW7D31xslluKMREMt5qLiRABNEXFxYgIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.02.2016 15:39, Anand Moon wrote: > Hi Krzysztof, > > On 19 February 2016 at 11:36, Krzysztof Kozlowski > wrote: >> 2016-02-19 2:21 GMT+09:00 Anand Moon : >>> From: Anand Moon >>> >>> pl330_tasklet tasklet uses the same spinlock pch->lock for safe IRQ locking. >>> It's safe to initialize pl330_tasklet tasklet after release of the locking. >> >> This is tasklet init, not tasklet execution (which you are referring >> to in first sentence). I don't get how usage of spinlock during >> execution guarantees the safeness during init... Please describe why >> this is safe. >> >> Best regards, >> Krzysztof >> > > http://lxr.free-electrons.com/source/drivers/dma/pl330.c#L1972 > > pl330_tasklet function which is initiated by tasklet_init is trying to lock > using same spin_unlock_irqsave/restore pch->lock. tasklet_init does not call pl330_tasklet (if this is what you mean by "initiated"). What is the correlation? Why are you referring to the locks in pl330_tasklet? > So better release the pch->lock and then initialize the tasklet_init. Why "better"? Best regards, Krzysztof > >>> >>> Signed-off-by: Anand Moon >>> --- >>> drivers/dma/pl330.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c >>> index 17ee758..df2cab1 100644 >>> --- a/drivers/dma/pl330.c >>> +++ b/drivers/dma/pl330.c >>> @@ -2091,10 +2091,10 @@ static int pl330_alloc_chan_resources(struct dma_chan *chan) >>> return -ENOMEM; >>> } >>> >>> - tasklet_init(&pch->task, pl330_tasklet, (unsigned long) pch); >>> - >>> spin_unlock_irqrestore(&pch->lock, flags); >>> >>> + tasklet_init(&pch->task, pl330_tasklet, (unsigned long) pch); >>> + >>> return 1; >>> } >>> >>> -- >>> 1.9.1 >>> >>> -- >>> To unsubscribe from this list: send the line "unsubscribe dmaengine" in >>> the body of a message to majordomo@vger.kernel.org >>> More majordomo info at http://vger.kernel.org/majordomo-info.html > >