From: Vinod Koul <vkoul@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: Eric Anholt <eric@anholt.net>,
Stefan Wahren <stefan.wahren@i2se.com>,
Frank Pavlic <f.pavlic@kunbus.de>,
Martin Sperl <kernel@martin.sperl.org>,
Florian Meier <florian.meier@koalo.de>,
dmaengine@vger.kernel.org, linux-rpi-kernel@lists.infradead.org
Subject: [5/5] dmaengine: bcm2835: Remove dead code
Date: Mon, 7 Jan 2019 13:58:33 +0530 [thread overview]
Message-ID: <20190107082833.GB13372@vkoul-mobl.Dlink> (raw)
On 22-12-18, 08:28, Lukas Wunner wrote:
> The BCM2835 DMA driver deletes a channel from a list upon termination
> without having added it to a list first. Moreover that operation is
> protected by a spinlock which isn't taken anywhere else. These appear
> to be remnants of an older version of the driver which accidentally
> got mainlined. Remove the dead code.
>
> While at it remove an outdated comment claiming the driver only supports
Ditto, whenever you use also, while at it... think if this is a
candidate for splitting up.
A patch should do one thing only..
> cyclic transactions. The driver has been supporting other transaction
> types for more than two years.
>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: Frank Pavlic <f.pavlic@kunbus.de>
> Cc: Martin Sperl <kernel@martin.sperl.org>
> Cc: Florian Meier <florian.meier@koalo.de>
> ---
> drivers/dma/bcm2835-dma.c | 13 -------------
> 1 file changed, 13 deletions(-)
>
> diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
> index e424e232a3d0..633be2ee7f33 100644
> --- a/drivers/dma/bcm2835-dma.c
> +++ b/drivers/dma/bcm2835-dma.c
> @@ -2,9 +2,6 @@
> /*
> * BCM2835 DMA engine support
> *
> - * This driver only supports cyclic DMA transfers
> - * as needed for the I2S module.
> - *
> * Author: Florian Meier <florian.meier@koalo.de>
> * Copyright 2013
> *
> @@ -42,7 +39,6 @@
>
> struct bcm2835_dmadev {
> struct dma_device ddev;
> - spinlock_t lock;
> void __iomem *base;
> struct device_dma_parameters dma_parms;
> };
> @@ -64,7 +60,6 @@ struct bcm2835_cb_entry {
>
> struct bcm2835_chan {
> struct virt_dma_chan vc;
> - struct list_head node;
>
> struct dma_slave_config cfg;
> unsigned int dreq;
> @@ -772,17 +767,11 @@ static int bcm2835_dma_slave_config(struct dma_chan *chan,
> static int bcm2835_dma_terminate_all(struct dma_chan *chan)
> {
> struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
> - struct bcm2835_dmadev *d = to_bcm2835_dma_dev(c->vc.chan.device);
> unsigned long flags;
> LIST_HEAD(head);
>
> spin_lock_irqsave(&c->vc.lock, flags);
>
> - /* Prevent this channel being scheduled */
> - spin_lock(&d->lock);
> - list_del_init(&c->node);
> - spin_unlock(&d->lock);
> -
> /* stop DMA activity */
> if (c->desc) {
> vchan_terminate_vdesc(&c->desc->vd);
> @@ -815,7 +804,6 @@ static int bcm2835_dma_chan_init(struct bcm2835_dmadev *d, int chan_id,
>
> c->vc.desc_free = bcm2835_dma_desc_free;
> vchan_init(&c->vc, &d->ddev);
> - INIT_LIST_HEAD(&c->node);
>
> c->chan_base = BCM2835_DMA_CHANIO(d->base, chan_id);
> c->ch = chan_id;
> @@ -918,7 +906,6 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
> od->ddev.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
> od->ddev.dev = &pdev->dev;
> INIT_LIST_HEAD(&od->ddev.channels);
> - spin_lock_init(&od->lock);
>
> platform_set_drvdata(pdev, od);
>
> --
> 2.19.2
next reply other threads:[~2019-01-07 8:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-07 8:28 Vinod Koul [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-01-08 17:09 [5/5] dmaengine: bcm2835: Remove dead code Vinod Koul
2019-01-08 14:18 Lukas Wunner
2018-12-28 15:27 Stefan Wahren
2018-12-28 13:55 Lukas Wunner
2018-12-28 13:26 Stefan Wahren
2018-12-22 7:28 Lukas Wunner
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=20190107082833.GB13372@vkoul-mobl.Dlink \
--to=vkoul@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=eric@anholt.net \
--cc=f.pavlic@kunbus.de \
--cc=florian.meier@koalo.de \
--cc=kernel@martin.sperl.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=lukas@wunner.de \
--cc=stefan.wahren@i2se.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