From: javi.merino@arm.com (Javi Merino)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] ARM: PL330: Don't call the callbacks if there isn't any active transfer
Date: Tue, 15 Nov 2011 15:51:18 +0000 [thread overview]
Message-ID: <4EC28A76.7080606@arm.com> (raw)
In-Reply-To: <CAJe_Zhf+PAeM+wquQykXNDG74Nc+jQNXrp+RLMKSySCNPum8Tg@mail.gmail.com>
On 15/11/11 07:51, Jassi Brar wrote:
> On 2 November 2011 20:00, Javi Merino <javi.merino@arm.com> wrote:
>> If there are no transactions running it is not only wrong but
>> potentially dangerous to call the callbacks.
>>
> The idea was to have dmac drivers not touch the xfer after it has been submitted
> and before the callback is made upon successful transmission or abort/flush.
Right.
>> There can be a stale struct pl330_req pointer from a previous run, but the
>> memory may be free already.
>>
> Sorry I am unable to fathom the scenario. The pl330_request_channel resets
> both pl330_req pointers. Maybe some real failure you saw, could help
> me understand.
You request a channel, submit a xfer, it finishes successfully and
pl330_update() is called, which calls r->xfer_cb() and marks the request
as done by making req->mc_len = 0 . Then, if you call
pl330_release_channel(), _callback(thrd->req[0].r, PL330_ERR_ABORT) is
called and, as thrd_req[0].r and thrd_req[0].r->xfer_cb are not null,
r->xfer_cb() is called again. That's wrong, the xfer finished (maybe
long time ago) and the callback was called back then. You shouldn't
call it again with an error. You should only do so if the transfer was
running or scheduled to run, that's why I suggest calling _callback() if
!IS_FREE(req).
I'm not sure if this was clear enough, but I always hit this when
releasing channels that I've used. Cheers,
Javi
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
next prev parent reply other threads:[~2011-11-15 15:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-02 14:30 [PATCH 1/4] ARM: PL330: Don't call the callbacks if there isn't any active transfer Javi Merino
2011-11-02 14:30 ` [PATCH 2/4] ARM: PL330: Only register usable channels Javi Merino
2011-11-15 8:48 ` Jassi Brar
2011-11-02 14:30 ` [PATCH 3/4] ARM: PL330: Fix the size of the dst_cache_ctrl field Javi Merino
2011-11-15 9:09 ` Jassi Brar
2011-11-02 14:30 ` [PATCH 4/4] ARM: PL330: Fix typo in _prepare_ccr() Javi Merino
2011-11-15 9:11 ` Jassi Brar
2011-11-15 7:51 ` [PATCH 1/4] ARM: PL330: Don't call the callbacks if there isn't any active transfer Jassi Brar
2011-11-15 15:51 ` Javi Merino [this message]
2011-11-15 17:00 ` Jassi Brar
2011-11-16 6:24 ` Jassi Brar
2011-11-22 17:16 ` Javi Merino
2011-11-23 9:46 ` Javi Merino
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=4EC28A76.7080606@arm.com \
--to=javi.merino@arm.com \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).