From: Logan Gunthorpe <logang@deltatee.com>
To: Jiasen Lin <linjiasen@hygon.cn>,
linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org,
Vinod Koul <vkoul@kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>, Kit Chow <kchow@gigaio.com>
Subject: Re: [PATCH v2 4/5] dmaengine: plx-dma: Implement hardware initialization and cleanup
Date: Tue, 10 Dec 2019 10:55:22 -0700 [thread overview]
Message-ID: <23d2c1a3-54fa-db6c-32ee-312a667ac0c9@deltatee.com> (raw)
In-Reply-To: <eb5603ae-d884-ea13-7f7a-4d578e4fa6ee@hygon.cn>
On 2019-12-09 11:49 p.m., Jiasen Lin wrote:
> Integrated DMA engine of PEX87xx series switch support various
> interrupts. According to my personal experience, I suggest that
> enable error interrupt, invalid decscriptor interrupt, abort done
> interrupt, graceful puse done interrupt, and
> immediate pasue done interrupt by write DMA Channel x Interrupt
> Control/Status register.
Well, that depends on what we want to do with these interrupts:
1) We shouldn't need to handle the error/invalid descriptor interrupt.
We instead just see that a specific descriptor failed (in the usual way)
and handle it accordingly. (Though this isn't really documented well).
An invalid descriptor should really never happen unless we have a driver
bug. I suppose I could print an error message if either occur.
2) We never send an abort or immediate pause to the device, so neither
interrupt can ever fire. So there's nothing to do if they do fire and
thus no sense enabling them.
3) We do send a graceful pause to the device on teardown but prefer to
poll for the end of the pause instead of adding the extra complexity to
waiting for an interrupt. So no need for the interrupt.
Logan
>
> Thanks,
> Jiasen Lin
>
>> kref_init(&plxdev->ref);
>> INIT_WORK(&plxdev->release_work, plx_dma_release_work);
>> + spin_lock_init(&plxdev->ring_lock);
>> + tasklet_init(&plxdev->desc_task, plx_dma_desc_task,
>> + (unsigned long)plxdev);
>>
>> + RCU_INIT_POINTER(plxdev->pdev, pdev);
>> plxdev->bar = pcim_iomap_table(pdev)[0];
>>
>> dma = &plxdev->dma_dev;
>> @@ -169,6 +501,16 @@ static void plx_dma_remove(struct pci_dev *pdev)
>>
>> free_irq(pci_irq_vector(pdev, 0), plxdev);
>>
>> + rcu_assign_pointer(plxdev->pdev, NULL);
>> + synchronize_rcu();
>> +
>> + spin_lock_bh(&plxdev->ring_lock);
>> + plxdev->ring_active = false;
>> + spin_unlock_bh(&plxdev->ring_lock);
>> +
>> + __plx_dma_stop(plxdev);
>> + plx_dma_abort_desc(plxdev);
>> +
>> plxdev->bar = NULL;
>> plx_dma_put(plxdev);
>>
>>
next prev parent reply other threads:[~2019-12-10 17:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 0:24 [PATCH v2 0/5] PLX Switch DMA Engine Driver Logan Gunthorpe
2019-12-10 0:24 ` [PATCH v2 1/5] dmaengine: Store module owner in dma_device struct Logan Gunthorpe
2019-12-10 0:24 ` [PATCH v2 2/5] dmaengine: Call module_put() after device_free_chan_resources() Logan Gunthorpe
2019-12-10 0:24 ` [PATCH v2 3/5] dmaengine: plx-dma: Introduce PLX DMA engine PCI driver skeleton Logan Gunthorpe
2019-12-10 2:33 ` Jiasen Lin
2019-12-10 17:44 ` Logan Gunthorpe
2019-12-10 0:24 ` [PATCH v2 4/5] dmaengine: plx-dma: Implement hardware initialization and cleanup Logan Gunthorpe
2019-12-10 6:49 ` Jiasen Lin
2019-12-10 17:55 ` Logan Gunthorpe [this message]
2019-12-10 0:24 ` [PATCH v2 5/5] dmaengine: plx-dma: Implement descriptor submission Logan Gunthorpe
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=23d2c1a3-54fa-db6c-32ee-312a667ac0c9@deltatee.com \
--to=logang@deltatee.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=kchow@gigaio.com \
--cc=linjiasen@hygon.cn \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®