public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Anand Moon <linux.amoon@gmail.com>
Cc: Vinod Koul <vinod.koul@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	dmaengine@vger.kernel.org,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: pl330: initialize tasklet after spin_unlock_irqrestore
Date: Fri, 19 Feb 2016 16:20:25 +0900	[thread overview]
Message-ID: <56C6C239.3080000@samsung.com> (raw)
In-Reply-To: <CANAwSgS2WOxirQOP3Yh7Y56yQVKrGU-4FopaK7PXupmgz5UrNQ@mail.gmail.com>

On 19.02.2016 15:39, Anand Moon wrote:
> Hi Krzysztof,
> 
> On 19 February 2016 at 11:36, Krzysztof Kozlowski
> <k.kozlowski@samsung.com> wrote:
>> 2016-02-19 2:21 GMT+09:00 Anand Moon <linux.amoon@gmail.com>:
>>> From: Anand Moon <linux.amoon@gmail.com>
>>>
>>> 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 <linux.amoon@gmail.com>
>>> ---
>>>  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
> 
> 

  reply	other threads:[~2016-02-19  7:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 17:21 [PATCH] dmaengine: pl330: initialize tasklet after spin_unlock_irqrestore Anand Moon
2016-02-19  6:06 ` Krzysztof Kozlowski
2016-02-19  6:39   ` Anand Moon
2016-02-19  7:20     ` Krzysztof Kozlowski [this message]
2016-02-19  8:10       ` Anand Moon
2016-02-19  8:15         ` Lars-Peter Clausen
2016-02-19  8:46           ` Anand Moon
2016-02-21 17:34           ` Anand Moon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56C6C239.3080000@samsung.com \
    --to=k.kozlowski@samsung.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux.amoon@gmail.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox