Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1651907
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 22/27] thunderbolt: Add support for DMA configuration based mailbox |
| Date | 2017-05-27 18:10 +0200 |
| Message-ID | <tLMrT-6fP-1@gated-at.bofh.it> (permalink) |
| References | <tLq81-87A-5@gated-at.bofh.it> <tLq84-87A-73@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, May 26, 2017 at 7:09 PM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> The DMA (NHI) port of a switch provides access to the NVM of the host
> controller (and devices starting from Intel Alpine Ridge). The NVM
> contains also more complete DROM for the root switch including vendor
> and device identification strings.
> + ret = dma_port_flash_read_block(dma, address, dma->buf,
> + ALIGN(nbytes, 4));
> + if (ret) {
> + if (ret == -ETIMEDOUT) {
> + if (retries--)
> + continue;
> + ret = -EIO;
> + }
> + return ret;
> + }
> +
> + memcpy(buf, dma->buf + offset, nbytes);
> + do {
> + u32 nbytes = min_t(u32, size, MAIL_DATA_DWORDS * 4);
> + int ret;
> +
> + memcpy(dma->buf + offset, buf, nbytes);
> +
> + ret = dma_port_flash_write_block(dma, address, buf, nbytes);
> + if (ret) {
> + if (ret == -ETIMEDOUT) {
> + if (retries--)
> + continue;
> + ret = -EIO;
> + }
> + return ret;
> + }
Just to be sure I didn't miss anything.
Can't we just map buffer into DMA capable address space instead of memcpy()'ing?
--
With Best Regards,
Andy Shevchenko
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 22/27] thunderbolt: Add support for DMA configuration based mailbox Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-26 18:20 +0200
Re: [PATCH v2 22/27] thunderbolt: Add support for DMA configuration based mailbox Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 18:10 +0200
Re: [PATCH v2 22/27] thunderbolt: Add support for DMA configuration based mailbox Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-28 11:20 +0200
csiph-web