History log of /linux-master/drivers/dca/dca-core.c
Revision Date Author Comments
# 3ac39d20 27-Feb-2023 Dan Carpenter <error27@gmail.com>

dca: delete unnecessary variable

It's more readable to just pass NULL directly instead of using a variable
for that.

Link: https://lkml.kernel.org/r/Y/yAlDytLH0ZNLNz@kili
Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>


# e62d9491 20-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 33

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
59 temple place suite 330 boston ma 02111 1307 usa the full gnu
general public license is included in this distribution in the file
called copying

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 7 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190520170857.277062491@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 064223c1 23-Apr-2018 Colin Ian King <colin.king@canonical.com>

dca: make function dca_common_get_tag static

Function dca_common_get_tag is local to the source and does not need to be
in global scope, so make it static.

Cleans up sparse warning:
drivers/dca/dca-core.c:273:4: warning: symbol 'dca_common_get_tag' was
not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 2bb129eb 12-Nov-2015 Julia Lawall <julia.lawall@lip6.fr>

dmaengine: ioatdma: constify dca_ops structures

The dca_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>


# c419fcfd 23-May-2012 Maciej Sosnowski <maciej.sosnowski@intel.com>

dca: check against empty dca_domains list before unregister provider

When providers get blocked unregister_dca_providers() is called ending up
with dca_providers and dca_domain lists emptied. Dca should be prevented from
trying to unregister any provider if dca_domain list is found empty.

Cc: <stable@vger.kernel.org>
Reported-by: Jiang Liu <jiang.liu@huawei.com>
Tested-by: Gaohuai Han <hangaohuai@huawei.com>
Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <djbw@fb.com>


# d229807f 03-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

drivers/dca: Add module.h to dca-core.c

This file really needs the full module.h header file present, but
was just getting it implicitly before. Call it out in advance so
that we don't get future build failures on this.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# a1741e7f 07-Jul-2010 Mike Galbraith <efault@gmx.de>

locking, drivers/dca: Annotate dca_lock as raw

The dca_lock can be taken in atomic context:

[ 25.607536] Call Trace:
[ 25.607557] [<ffffffff820078a1>] try_stack_unwind+0x151/0x1a0
[ 25.607566] [<ffffffff820062c2>] dump_trace+0x92/0x370
[ 25.607573] [<ffffffff8200731c>] show_trace_log_lvl+0x5c/0x80
[ 25.607578] [<ffffffff82007355>] show_trace+0x15/0x20
[ 25.607587] [<ffffffff823f4588>] dump_stack+0x77/0x8f
[ 25.607595] [<ffffffff82043f2a>] __might_sleep+0x11a/0x130
[ 25.607602] [<ffffffff823f7b93>] rt_spin_lock+0x83/0x90
[ 25.607611] [<ffffffffa0209138>] dca_common_get_tag+0x28/0x80 [dca]
[ 25.607622] [<ffffffffa02091c8>] dca3_get_tag+0x18/0x20 [dca]
[ 25.607634] [<ffffffffa0244e71>] igb_update_dca+0xb1/0x1d0 [igb]
[ 25.607649] [<ffffffffa0244ff5>] igb_setup_dca+0x65/0x80 [igb]
[ 25.607663] [<ffffffffa02535a6>] igb_probe+0x946/0xe4d [igb]
[ 25.607678] [<ffffffff82247517>] local_pci_probe+0x17/0x20
[ 25.607686] [<ffffffff82248661>] pci_device_probe+0x121/0x130
[ 25.607699] [<ffffffff822e4832>] driver_probe_device+0xd2/0x2e0
[ 25.607707] [<ffffffff822e4adb>] __driver_attach+0x9b/0xa0
[ 25.607714] [<ffffffff822e3d1b>] bus_for_each_dev+0x6b/0xa0
[ 25.607720] [<ffffffff822e4591>] driver_attach+0x21/0x30
[ 25.607727] [<ffffffff822e3425>] bus_add_driver+0x1e5/0x350
[ 25.607734] [<ffffffff822e4e41>] driver_register+0x81/0x160
[ 25.607742] [<ffffffff8224890f>] __pci_register_driver+0x6f/0xf0
[ 25.607752] [<ffffffffa011505b>] igb_init_module+0x5b/0x5d [igb]
[ 25.607769] [<ffffffff820001dd>] do_one_initcall+0x3d/0x1a0
[ 25.607778] [<ffffffff820961f6>] sys_init_module+0xe6/0x270
[ 25.607786] [<ffffffff82003232>] system_call_fastpath+0x16/0x1b
[ 25.607794] [<00007f84d6783f4a>] 0x7f84d6783f4a

and thus must not be preempted on -rt.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Mike Galbraith <efault@gmx.de>
[ Fixed the domain allocation which was calling kzalloc from the irq disabled section ]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


# 3bb598fb 22-Mar-2011 Kirill A. Shutemov <kirill@shutemov.name>

drivers/dca/dca-core.c: use list_move() instead of list_del()/list_add() combination

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# f0f2c2b5 12-Jan-2011 Dan Carpenter <error27@gmail.com>

dca: remove unneeded NULL check

The return here doesn't release the locks or re-enable IRQs. But as
Andrew Morton points out, domain is never NULL. list_first_entry()
essentially never returns NULL and also we already verified that the list
is not empty.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 4e8cec26 16-Sep-2010 Sosnowski, Maciej <maciej.sosnowski@intel.com>

dca: disable dca on IOAT ver.3.0 multiple-IOH platforms

Direct Cache Access is not supported on IOAT ver.3.0 multiple-IOH platforms.
This patch blocks registering of dca providers when multiple IOH detected with IOAT ver.3.0.

Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# 084dac53 13-Sep-2009 Stephen Hemminger <shemminger@linux-foundation.org>

dca: module load should not be an error message

The message (if it must exist) should not be an error message.
IMHO such messages are useless.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 1a5aeeec 10-Sep-2009 Maciej Sosnowski <maciej.sosnowski@intel.com>

dca: registering requesters in multiple dca domains

This patch enables DCA support on multiple-IOH/multiple-IIO architectures.
It modifies dca module by replacing single dca_providers list
with dca_domains list, each domain containing separate list of providers.
This approach lets dca driver manage multiple domains, i.e. sets of providers
and requesters mapped back to the same PCI root complex device.
The driver takes care to register each requester to a provider
from the same domain.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>


# 211a22ce 26-Feb-2009 Maciej Sosnowski <maciej.sosnowski@intel.com>

I/OAT: update driver version and copyright dates

Together with new fixes update driver version
and extend copyright dates ranges.

Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# eb4400e3 03-Feb-2009 Maciej Sosnowski <maciej.sosnowski@intel.com>

dca: redesign locks to fix deadlocks

Change spin_locks to irqsave to prevent dead-locks.
Protect adding and deleting to/from dca_providers list.
Drop the lock during dca_sysfs_add_req() and dca_sysfs_remove_req() calls
as they might sleep (use GFP_KERNEL allocation).

Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 652afc27 06-Jan-2009 Dan Williams <dan.j.williams@intel.com>

dmaengine: bump initcall level to arch_initcall

There are dmaengine users that would like to register dma devices at
subsys_initcall time to ensure channels are available by device_initcall
time.

Cc: Maciej Sosnowski <maciej.sosnowski@intel.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 1207e795 06-Nov-2008 Dan Williams <dan.j.williams@intel.com>

[4/4] dca: fixup initialization dependency

Mark dca_init as a subsys_initcall since it needs to be ready to go
before dependent drivers start registering themselves.

Cc: <stable@kernel.org>
Reported-and-tested-by: Mark Rustad <mark_rustad@Xiotech.com>
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 7f1b358a 22-Jul-2008 Maciej Sosnowski <maciej.sosnowski@intel.com>

I/OAT: I/OAT version 3.0 support

This patch adds to ioatdma and dca modules
support for Intel I/OAT DMA engine ver.3 (aka CB3 device).
The main features of I/OAT ver.3 are:
* 8 single channel DMA devices (8 channels total)
* 8 DCA providers, each can accept 2 requesters
* 8-bit TAG values and 32-bit extended APIC IDs

Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 7589670f 16-Oct-2007 Shannon Nelson <shannon.nelson@intel.com>

DCA: Add Direct Cache Access driver

Direct Cache Access (DCA) is a method for warming the CPU cache before data
is used, with the intent of lessening the impact of cache misses. This
patch adds a manager and interface for matching up client requests for DCA
services with devices that offer DCA services.

In order to use DCA, a module must do bus writes with the appropriate tag
bits set to trigger a cache read for a specific CPU. However, different
CPUs and chipsets can require different sets of tag bits, and the methods
for determining the correct bits may be simple hardcoding or may be a
hardware specific magic incantation. This interface is a way for DCA
clients to find the correct tag bits for the targeted CPU without needing
to know the specifics.

[Dave Miller] use DEFINE_SPINLOCK()

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>