From: Alex Bounine <alex.bou9@gmail.com>
To: Ioan Nicu <ioan.nicu.ext@nokia.com>,
Andrew Morton <akpm@linuxfoundation.org>,
Barry Wood <barry.wood@idt.com>,
Matt Porter <mporter@kernel.crashing.org>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Al Viro <viro@zeniv.linux.org.uk>,
Logan Gunthorpe <logang@deltatee.com>,
Chris Wilson <chris@chris-wilson.co.uk>,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
Frank Kunz <frank.kunz@nokia.com>,
Alexander Sverdlin <alexander.sverdlin@nokia.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rapidio: use a reference count for struct mport_dma_req
Date: Mon, 9 Apr 2018 15:39:36 -0400 [thread overview]
Message-ID: <2dbed6e5-2244-2de3-ad1a-9d010fa94b5e@gmail.com> (raw)
In-Reply-To: <20180405203342.GA16191@nokia.com>
On 2018-04-05 04:33 PM, Ioan Nicu wrote:
> Once the dma request is passed to the DMA engine, the DMA
> subsystem would hold a pointer to this structure and could
> call the completion callback after do_dma_request() has
> timed out.
>
> The current code deals with this by putting timed out SYNC
> requests to a pending list and freeing them later, when the
> mport cdev device is released. But this still does not
> guarantee that the DMA subsystem is really done with those
> transfers, so in theory dma_xfer_callback/dma_req_free
> could be called after mport_cdev_release_dma and could
> potentially access already freed memory.
>
> This patch simplifies the current handling by using a kref
> in the mport dma request structure, so that it gets freed
> only when nobody uses it anymore.
>
> This also simplifies the code a bit, as FAF transfers are
> now handled in the same way as SYNC and ASYNC transfers.
> There is no need anymore for the pending list and for the
> dma workqueue which was used in case of FAF transfers, so
> we remove them both.
>
> Signed-off-by: Ioan Nicu <ioan.nicu.ext@nokia.com>
> ---
> drivers/rapidio/devices/rio_mport_cdev.c | 122 +++++--------------------------
> 1 file changed, 18 insertions(+), 104 deletions(-)
Acked-by: Alexandre Bounine <alex.bou9@gmail.com>
next prev parent reply other threads:[~2018-04-09 19:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-05 20:33 Ioan Nicu
2018-04-09 19:39 ` Alex Bounine [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-04-03 15:45 Ioan Nicu
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=2dbed6e5-2244-2de3-ad1a-9d010fa94b5e@gmail.com \
--to=alex.bou9@gmail.com \
--cc=akpm@linuxfoundation.org \
--cc=alexander.sverdlin@nokia.com \
--cc=barry.wood@idt.com \
--cc=chris@chris-wilson.co.uk \
--cc=christophe.jaillet@wanadoo.fr \
--cc=frank.kunz@nokia.com \
--cc=ioan.nicu.ext@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=mporter@kernel.crashing.org \
--cc=tvrtko.ursulin@intel.com \
--cc=viro@zeniv.linux.org.uk \
/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
Powered by JetHome