All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Yoshii <takashi.yoshii.zj@renesas.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] sh-sci: fix a race of DMA submit_tx on transfer
Date: Tue, 13 Mar 2012 11:08:49 +0000	[thread overview]
Message-ID: <4F5F2AC1.8060305@renesas.com> (raw)
In-Reply-To: <4F5DC485.8020607@renesas.com>

Thank you for your reply.

> It looks like sci_start_tx() can be called asynchronously - before the 
> previous request has completed. In such a case we have to actually protect 
> the whole function. 
Perhaps.
Low level debugging shows sci_start_tx() called twice before work_fn_tx(), just before the issue occurs.
I don't know if this frequent calls is an erroneous behavior or not, though.

> ... Please, check whether this slightly simpler patch 
> works for you too. 
Not working. (it crashes)

I applied only
> +	    !s->desc_tx)
(You mean *!*s->desc_tx, don't you? Otherwise no output)

Spin-locks are not needed (and should not be) here, because this function
is called with lock held.

> ... If it does, we can then actually completely remove the 
> cookie_tx member of struct sci_port:
Doing same as my patch with desc_tx instead of cookie_tx, introducing
other special value like desc_tx=1 or so, is OK. Because what is done
by the patch is manual mutex by flag variable, choice of the variable
is not a problem.

The problem seems to be that I don't know how the .start_tx() should
be called. Shall we go to linux-serial ML?

Cheers,
/yoshii

  parent reply	other threads:[~2012-03-13 11:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12  9:40 [PATCH] sh-sci: fix a race of DMA submit_tx on transfer Yoshii Takashi
2012-03-12 13:36 ` Guennadi Liakhovetski
2012-03-13 11:08 ` Takashi Yoshii [this message]
2012-03-13 11:47 ` Guennadi Liakhovetski
2012-03-14  7:14 ` Takashi Yoshii
2012-03-15  6:09 ` Paul Mundt
2012-03-15 10:50   ` Guennadi Liakhovetski
2012-03-15 10:50     ` Guennadi Liakhovetski
2012-03-28  6:11     ` Paul Mundt
2012-03-28  6:11       ` Paul Mundt
2012-03-15  9:54 ` Takashi Yoshii

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=4F5F2AC1.8060305@renesas.com \
    --to=takashi.yoshii.zj@renesas.com \
    --cc=linux-sh@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.