From: <Kelvin.Cao@microchip.com>
To: <vkoul@kernel.org>
Cc: <dmaengine@vger.kernel.org>, <George.Ge@microchip.com>,
<linux-kernel@vger.kernel.org>, <logang@deltatee.com>,
<christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH v3 1/1] dmaengine: switchtec-dma: Introduce Switchtec DMA engine PCI driver
Date: Fri, 14 Apr 2023 23:33:59 +0000 [thread overview]
Message-ID: <fec615f661c6d244ee37ec082df25b1943add135.camel@microchip.com> (raw)
In-Reply-To: <ZDbkZxppP/bmj7DD@matsya>
On Wed, 2023-04-12 at 22:33 +0530, Vinod Koul wrote:
> > +#include <linux/circ_buf.h>
> > +#include <linux/dmaengine.h>
> > +#include <linux/module.h>
> > +#include <linux/pci.h>
> > +#include <linux/delay.h>
> > +
> > +#include "dmaengine.h"
> > +
> > +MODULE_DESCRIPTION("Switchtec PCIe Switch DMA Engine");
> > +MODULE_VERSION("0.1");
>
> what is the use of this?
Not sure if I get it correctly. As a loadable module, it shows
'version: 0.1' for modinfo
> >
> > +#define HALT_RETRY 100
> > +static int halt_channel(struct switchtec_dma_chan *swdma_chan)
> > +{
> > + u32 status;
> > + struct chan_hw_regs __iomem *chan_hw = swdma_chan-
> > >mmio_chan_hw;
> > + int retry = HALT_RETRY;
> > + struct pci_dev *pdev;
> > + int ret;
> > +
> > + rcu_read_lock();
> > + pdev = rcu_dereference(swdma_chan->swdma_dev->pdev);
>
> that sounds fishy, why does a driver need to use rcu functions
RCU is used to synchronize driver unbind and low level PCI operations.
The unbind issue was first spotted and fixed by Logan:
https://lore.kernel.org/all/20191216190120.21374-1-logang@deltatee.com/
>
Thanks,
Kelvin
prev parent reply other threads:[~2023-04-14 23:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 21:03 [PATCH v3 0/1] Switchtec Switch DMA Engine Driver Kelvin Cao
2023-04-06 21:03 ` [PATCH v3 1/1] dmaengine: switchtec-dma: Introduce Switchtec DMA engine PCI driver Kelvin Cao
2023-04-12 17:03 ` Vinod Koul
2023-04-14 23:33 ` Kelvin.Cao [this message]
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=fec615f661c6d244ee37ec082df25b1943add135.camel@microchip.com \
--to=kelvin.cao@microchip.com \
--cc=George.Ge@microchip.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=vkoul@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox