Skip to content

Commit

Permalink
Merge tag 'dmaengine-3.17' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/djbw/dmaengine

Pull dmaengine updates from Dan Williams:
 "Even though this has fixes marked for -stable, given the size and the
  needed conflict resolutions this is 3.18-rc1/merge-window material.

  These patches have been languishing in my tree for a long while.  The
  fact that I do not have the time to do proper/prompt maintenance of
  this tree is a primary factor in the decision to step down as
  dmaengine maintainer.  That and the fact that the bulk of drivers/dma/
  activity is going through Vinod these days.

  The net_dma removal has not been in -next.  It has developed simple
  conflicts against mainline and net-next (for-3.18).

  Continuing thanks to Vinod for staying on top of drivers/dma/.

  Summary:

   1/ Step down as dmaengine maintainer see commit 08223d8
      "dmaengine maintainer update"

   2/ Removal of net_dma, as it has been marked 'broken' since 3.13
      (commit 7787380 "net_dma: mark broken"), without reports of
      performance regression.

   3/ Miscellaneous fixes"

* tag 'dmaengine-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/dmaengine:
  net: make tcp_cleanup_rbuf private
  net_dma: revert 'copied_early'
  net_dma: simple removal
  dmaengine maintainer update
  dmatest: prevent memory leakage on error path in thread
  ioat: Use time_before_jiffies()
  dmaengine: fix xor sources continuation
  dma: mv_xor: Rename __mv_xor_slot_cleanup() to mv_xor_slot_cleanup()
  dma: mv_xor: Remove all callers of mv_xor_slot_cleanup()
  dma: mv_xor: Remove unneeded mv_xor_clean_completed_slots() call
  ioat: Use pci_enable_msix_exact() instead of pci_enable_msix()
  drivers: dma: Include appropriate header file in dca.c
  drivers: dma: Mark functions as static in dma_v3.c
  dma: mv_xor: Add DMA API error checks
  ioat/dca: Use dev_is_pci() to check whether it is pci device
  • Loading branch information
torvalds committed Oct 8, 2014
2 parents bdf428f + 3f33407 commit d0cd848
Show file tree
Hide file tree
Showing 33 changed files with 129 additions and 955 deletions.
8 changes: 8 additions & 0 deletions Documentation/ABI/removed/net_dma
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
What: tcp_dma_copybreak sysctl
Date: Removed in kernel v3.13
Contact: Dan Williams <[email protected]>
Description:
Formerly the lower limit, in bytes, of the size of socket reads
that will be offloaded to a DMA copy engine. Removed due to
coherency issues of the cpu potentially touching the buffers
while dma is in flight.
6 changes: 0 additions & 6 deletions Documentation/networking/ip-sysctl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -580,12 +580,6 @@ tcp_workaround_signed_windows - BOOLEAN
not receive a window scaling option from them.
Default: 0

tcp_dma_copybreak - INTEGER
Lower limit, in bytes, of the size of socket reads that will be
offloaded to a DMA copy engine, if one is present in the system
and CONFIG_NET_DMA is enabled.
Default: 4096

tcp_thin_linear_timeouts - BOOLEAN
Enable dynamic triggering of linear timeouts for thin streams.
If set, a check is performed upon retransmission by timeout to
Expand Down
19 changes: 6 additions & 13 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1025,24 +1025,20 @@ F: arch/arm/mach-pxa/colibri-pxa270-income.c

ARM/INTEL IOP32X ARM ARCHITECTURE
M: Lennert Buytenhek <[email protected]>
M: Dan Williams <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Maintained

ARM/INTEL IOP33X ARM ARCHITECTURE
M: Dan Williams <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Maintained
S: Orphan

ARM/INTEL IOP13XX ARM ARCHITECTURE
M: Lennert Buytenhek <[email protected]>
M: Dan Williams <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Maintained

ARM/INTEL IQ81342EX MACHINE SUPPORT
M: Lennert Buytenhek <[email protected]>
M: Dan Williams <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Maintained

Expand All @@ -1067,7 +1063,6 @@ F: drivers/pcmcia/pxa2xx_stargate2.c

ARM/INTEL XSC3 (MANZANO) ARM CORE
M: Lennert Buytenhek <[email protected]>
M: Dan Williams <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Maintained

Expand Down Expand Up @@ -1562,9 +1557,9 @@ F: drivers/platform/x86/asus*.c
F: drivers/platform/x86/eeepc*.c

ASYNCHRONOUS TRANSFERS/TRANSFORMS (IOAT) API
M: Dan Williams <[email protected]>
R: Dan Williams <[email protected]>
W: http://sourceforge.net/projects/xscaleiop
S: Maintained
S: Odd fixes
F: Documentation/crypto/async-tx-api.txt
F: crypto/async_tx/
F: drivers/dma/
Expand Down Expand Up @@ -2995,13 +2990,11 @@ T: git git://git.linaro.org/people/sumitsemwal/linux-dma-buf.git

DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
M: Vinod Koul <[email protected]>
M: Dan Williams <[email protected]>
L: [email protected]
Q: https://patchwork.kernel.org/project/linux-dmaengine/list/
S: Supported
S: Maintained
F: drivers/dma/
F: include/linux/dma*
T: git git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx.git
T: git git://git.infradead.org/users/vkoul/slave-dma.git (slave-dma)

DME1737 HARDWARE MONITOR DRIVER
Expand Down Expand Up @@ -4754,8 +4747,8 @@ F: arch/x86/kernel/cpu/microcode/core*
F: arch/x86/kernel/cpu/microcode/intel*

INTEL I/OAT DMA DRIVER
M: Dan Williams <[email protected]>
M: Dave Jiang <[email protected]>
R: Dan Williams <[email protected]>
L: [email protected]
Q: https://patchwork.kernel.org/project/linux-dmaengine/list/
S: Supported
Expand All @@ -4770,7 +4763,7 @@ F: drivers/iommu/intel-iommu.c
F: include/linux/intel-iommu.h

INTEL IOP-ADMA DMA DRIVER
M: Dan Williams <[email protected]>
R: Dan Williams <[email protected]>
S: Odd fixes
F: drivers/dma/iop-adma.c

Expand Down
3 changes: 1 addition & 2 deletions crypto/async_tx/async_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ do_async_xor(struct dma_chan *chan, struct dmaengine_unmap_data *unmap,
tx = dma->device_prep_dma_xor(chan, dma_dest, src_list,
xor_src_cnt, unmap->len,
dma_flags);
src_list[0] = tmp;


if (unlikely(!tx))
async_tx_quiesce(&submit->depend_tx);
Expand All @@ -92,6 +90,7 @@ do_async_xor(struct dma_chan *chan, struct dmaengine_unmap_data *unmap,
xor_src_cnt, unmap->len,
dma_flags);
}
src_list[0] = tmp;

dma_set_unmap(tx, unmap);
async_tx_submit(chan, tx, submit);
Expand Down
12 changes: 0 additions & 12 deletions drivers/dma/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,6 @@ config DMA_OF
comment "DMA Clients"
depends on DMA_ENGINE

config NET_DMA
bool "Network: TCP receive copy offload"
depends on DMA_ENGINE && NET
default (INTEL_IOATDMA || FSL_DMA)
depends on BROKEN
help
This enables the use of DMA engines in the network stack to
offload receive copy-to-user operations, freeing CPU cycles.

Say Y here if you enabled INTEL_IOATDMA or FSL_DMA, otherwise
say N.

config ASYNC_TX_DMA
bool "Async_tx: Offload support for the async_tx api"
depends on DMA_ENGINE
Expand Down
1 change: 0 additions & 1 deletion drivers/dma/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ obj-$(CONFIG_DMA_VIRTUAL_CHANNELS) += virt-dma.o
obj-$(CONFIG_DMA_ACPI) += acpi-dma.o
obj-$(CONFIG_DMA_OF) += of-dma.o

obj-$(CONFIG_NET_DMA) += iovlock.o
obj-$(CONFIG_INTEL_MID_DMAC) += intel_mid_dma.o
obj-$(CONFIG_DMATEST) += dmatest.o
obj-$(CONFIG_INTEL_IOATDMA) += ioat/
Expand Down
104 changes: 0 additions & 104 deletions drivers/dma/dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,110 +1081,6 @@ dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags)
}
EXPORT_SYMBOL(dmaengine_get_unmap_data);

/**
* dma_async_memcpy_pg_to_pg - offloaded copy from page to page
* @chan: DMA channel to offload copy to
* @dest_pg: destination page
* @dest_off: offset in page to copy to
* @src_pg: source page
* @src_off: offset in page to copy from
* @len: length
*
* Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus
* address according to the DMA mapping API rules for streaming mappings.
* Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident
* (kernel memory or locked user space pages).
*/
dma_cookie_t
dma_async_memcpy_pg_to_pg(struct dma_chan *chan, struct page *dest_pg,
unsigned int dest_off, struct page *src_pg, unsigned int src_off,
size_t len)
{
struct dma_device *dev = chan->device;
struct dma_async_tx_descriptor *tx;
struct dmaengine_unmap_data *unmap;
dma_cookie_t cookie;
unsigned long flags;

unmap = dmaengine_get_unmap_data(dev->dev, 2, GFP_NOWAIT);
if (!unmap)
return -ENOMEM;

unmap->to_cnt = 1;
unmap->from_cnt = 1;
unmap->addr[0] = dma_map_page(dev->dev, src_pg, src_off, len,
DMA_TO_DEVICE);
unmap->addr[1] = dma_map_page(dev->dev, dest_pg, dest_off, len,
DMA_FROM_DEVICE);
unmap->len = len;
flags = DMA_CTRL_ACK;
tx = dev->device_prep_dma_memcpy(chan, unmap->addr[1], unmap->addr[0],
len, flags);

if (!tx) {
dmaengine_unmap_put(unmap);
return -ENOMEM;
}

dma_set_unmap(tx, unmap);
cookie = tx->tx_submit(tx);
dmaengine_unmap_put(unmap);

preempt_disable();
__this_cpu_add(chan->local->bytes_transferred, len);
__this_cpu_inc(chan->local->memcpy_count);
preempt_enable();

return cookie;
}
EXPORT_SYMBOL(dma_async_memcpy_pg_to_pg);

/**
* dma_async_memcpy_buf_to_buf - offloaded copy between virtual addresses
* @chan: DMA channel to offload copy to
* @dest: destination address (virtual)
* @src: source address (virtual)
* @len: length
*
* Both @dest and @src must be mappable to a bus address according to the
* DMA mapping API rules for streaming mappings.
* Both @dest and @src must stay memory resident (kernel memory or locked
* user space pages).
*/
dma_cookie_t
dma_async_memcpy_buf_to_buf(struct dma_chan *chan, void *dest,
void *src, size_t len)
{
return dma_async_memcpy_pg_to_pg(chan, virt_to_page(dest),
(unsigned long) dest & ~PAGE_MASK,
virt_to_page(src),
(unsigned long) src & ~PAGE_MASK, len);
}
EXPORT_SYMBOL(dma_async_memcpy_buf_to_buf);

/**
* dma_async_memcpy_buf_to_pg - offloaded copy from address to page
* @chan: DMA channel to offload copy to
* @page: destination page
* @offset: offset in page to copy to
* @kdata: source address (virtual)
* @len: length
*
* Both @page/@offset and @kdata must be mappable to a bus address according
* to the DMA mapping API rules for streaming mappings.
* Both @page/@offset and @kdata must stay memory resident (kernel memory or
* locked user space pages)
*/
dma_cookie_t
dma_async_memcpy_buf_to_pg(struct dma_chan *chan, struct page *page,
unsigned int offset, void *kdata, size_t len)
{
return dma_async_memcpy_pg_to_pg(chan, page, offset,
virt_to_page(kdata),
(unsigned long) kdata & ~PAGE_MASK, len);
}
EXPORT_SYMBOL(dma_async_memcpy_buf_to_pg);

void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx,
struct dma_chan *chan)
{
Expand Down
4 changes: 2 additions & 2 deletions drivers/dma/dmatest.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,14 +688,14 @@ static int dmatest_func(void *data)
runtime = ktime_us_delta(ktime_get(), ktime);

ret = 0;
err_dstbuf:
for (i = 0; thread->dsts[i]; i++)
kfree(thread->dsts[i]);
err_dstbuf:
kfree(thread->dsts);
err_dsts:
err_srcbuf:
for (i = 0; thread->srcs[i]; i++)
kfree(thread->srcs[i]);
err_srcbuf:
kfree(thread->srcs);
err_srcs:
kfree(pq_coefs);
Expand Down
13 changes: 7 additions & 6 deletions drivers/dma/ioat/dca.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include "dma.h"
#include "registers.h"
#include "dma_v2.h"

/*
* Bit 7 of a tag map entry is the "valid" bit, if it is set then bits 0:6
Expand Down Expand Up @@ -147,7 +148,7 @@ static int ioat_dca_add_requester(struct dca_provider *dca, struct device *dev)
u16 id;

/* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type)
if (!dev_is_pci(dev))
return -ENODEV;
pdev = to_pci_dev(dev);
id = dcaid_from_pcidev(pdev);
Expand Down Expand Up @@ -179,7 +180,7 @@ static int ioat_dca_remove_requester(struct dca_provider *dca,
int i;

/* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type)
if (!dev_is_pci(dev))
return -ENODEV;
pdev = to_pci_dev(dev);

Expand Down Expand Up @@ -320,7 +321,7 @@ static int ioat2_dca_add_requester(struct dca_provider *dca, struct device *dev)
u16 global_req_table;

/* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type)
if (!dev_is_pci(dev))
return -ENODEV;
pdev = to_pci_dev(dev);
id = dcaid_from_pcidev(pdev);
Expand Down Expand Up @@ -354,7 +355,7 @@ static int ioat2_dca_remove_requester(struct dca_provider *dca,
u16 global_req_table;

/* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type)
if (!dev_is_pci(dev))
return -ENODEV;
pdev = to_pci_dev(dev);

Expand Down Expand Up @@ -496,7 +497,7 @@ static int ioat3_dca_add_requester(struct dca_provider *dca, struct device *dev)
u16 global_req_table;

/* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type)
if (!dev_is_pci(dev))
return -ENODEV;
pdev = to_pci_dev(dev);
id = dcaid_from_pcidev(pdev);
Expand Down Expand Up @@ -530,7 +531,7 @@ static int ioat3_dca_remove_requester(struct dca_provider *dca,
u16 global_req_table;

/* This implementation only supports PCI-Express */
if (dev->bus != &pci_bus_type)
if (!dev_is_pci(dev))
return -ENODEV;
pdev = to_pci_dev(dev);

Expand Down
3 changes: 1 addition & 2 deletions drivers/dma/ioat/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ int ioat_dma_setup_interrupts(struct ioatdma_device *device)
for (i = 0; i < msixcnt; i++)
device->msix_entries[i].entry = i;

err = pci_enable_msix(pdev, device->msix_entries, msixcnt);
err = pci_enable_msix_exact(pdev, device->msix_entries, msixcnt);
if (err)
goto msi;

Expand Down Expand Up @@ -1222,7 +1222,6 @@ int ioat1_dma_probe(struct ioatdma_device *device, int dca)
err = ioat_probe(device);
if (err)
return err;
ioat_set_tcp_copy_break(4096);
err = ioat_register(device);
if (err)
return err;
Expand Down
7 changes: 0 additions & 7 deletions drivers/dma/ioat/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,6 @@ __dump_desc_dbg(struct ioat_chan_common *chan, struct ioat_dma_descriptor *hw,
#define dump_desc_dbg(c, d) \
({ if (d) __dump_desc_dbg(&c->base, d->hw, &d->txd, desc_id(d)); 0; })

static inline void ioat_set_tcp_copy_break(unsigned long copybreak)
{
#ifdef CONFIG_NET_DMA
sysctl_tcp_dma_copybreak = copybreak;
#endif
}

static inline struct ioat_chan_common *
ioat_chan_by_index(struct ioatdma_device *device, int index)
{
Expand Down
4 changes: 2 additions & 2 deletions drivers/dma/ioat/dma_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,8 @@ int ioat2_check_space_lock(struct ioat2_dma_chan *ioat, int num_descs)
* called under bh_disabled so we need to trigger the timer
* event directly
*/
if (jiffies > chan->timer.expires && timer_pending(&chan->timer)) {
if (time_is_before_jiffies(chan->timer.expires)
&& timer_pending(&chan->timer)) {
struct ioatdma_device *device = chan->device;

mod_timer(&chan->timer, jiffies + COMPLETION_TIMEOUT);
Expand Down Expand Up @@ -899,7 +900,6 @@ int ioat2_dma_probe(struct ioatdma_device *device, int dca)
err = ioat_probe(device);
if (err)
return err;
ioat_set_tcp_copy_break(2048);

list_for_each_entry(c, &dma->channels, device_node) {
chan = to_chan_common(c);
Expand Down
Loading

0 comments on commit d0cd848

Please sign in to comment.