02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
22 Aug, 2017
1 commit
-
Instead of the callsites choosing between of_cpu_device_node_get if the
CPUs are registered as of_node is populated by then and of_get_cpu_node
when the CPUs are not yet registered as CPU of_nodes are not yet stashed
thereby needing to parse the device tree, we can call of_get_cpu_node
in case the CPUs are not yet registered.This will allow to use of_cpu_device_node_get anywhere hiding the
details from the caller.Cc: Rob Herring
Cc: Frank Rowand
Signed-off-by: Sudeep Holla
Signed-off-by: Rob Herring
10 May, 2017
1 commit
-
Pull IOMMU updates from Joerg Roedel:
- code optimizations for the Intel VT-d driver
- ability to switch off a previously enabled Intel IOMMU
- support for 'struct iommu_device' for OMAP, Rockchip and Mediatek
IOMMUs- header optimizations for IOMMU core code headers and a few fixes that
became necessary in other parts of the kernel because of that- ACPI/IORT updates and fixes
- Exynos IOMMU optimizations
- updates for the IOMMU dma-api code to bring it closer to use per-cpu
iova caches- new command-line option to set default domain type allocated by the
iommu core code- another command line option to allow the Intel IOMMU switched off in
a tboot environment- ARM/SMMU: TLB sync optimisations for SMMUv2, Support for using an
IDENTITY domain in conjunction with DMA ops, Support for SMR masking,
Support for 16-bit ASIDs (was previously broken)- various other small fixes and improvements
* tag 'iommu-updates-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (63 commits)
soc/qbman: Move dma-mapping.h include to qman_priv.h
soc/qbman: Fix implicit header dependency now causing build fails
iommu: Remove trace-events include from iommu.h
iommu: Remove pci.h include from trace/events/iommu.h
arm: dma-mapping: Don't override dma_ops in arch_setup_dma_ops()
ACPI/IORT: Fix CONFIG_IOMMU_API dependency
iommu/vt-d: Don't print the failure message when booting non-kdump kernel
iommu: Move report_iommu_fault() to iommu.c
iommu: Include device.h in iommu.h
x86, iommu/vt-d: Add an option to disable Intel IOMMU force on
iommu/arm-smmu: Return IOVA in iova_to_phys when SMMU is bypassed
iommu/arm-smmu: Correct sid to mask
iommu/amd: Fix incorrect error handling in amd_iommu_bind_pasid()
iommu: Make iommu_bus_notifier return NOTIFY_DONE rather than error code
omap3isp: Remove iommu_group related code
iommu/omap: Add iommu-group support
iommu/omap: Make use of 'struct iommu_device'
iommu/omap: Store iommu_dev pointer in arch_data
iommu/omap: Move data structures to omap-iommu.h
iommu/omap: Drop legacy-style device support
...
20 Apr, 2017
2 commits
-
Failures to look up an IOMMU when parsing the DT iommus property need to
be handled separately from the .of_xlate() failures to support deferred
probing.The lack of a registered IOMMU can be caused by the lack of a driver for
the IOMMU, the IOMMU device probe not having been performed yet, having
been deferred, or having failed.The first case occurs when the device tree describes the bus master and
IOMMU topology correctly but no device driver exists for the IOMMU yet
or the device driver has not been compiled in. Return NULL, the caller
will configure the device without an IOMMU.The second and third cases are handled by deferring the probe of the bus
master device which will eventually get reprobed after the IOMMU.The last case is currently handled by deferring the probe of the bus
master device as well. A mechanism to either configure the bus master
device without an IOMMU or to fail the bus master device probe depending
on whether the IOMMU is optional or mandatory would be a good
enhancement.Tested-by: Marek Szyprowski
Reviewed-by: Robin Murphy
Acked-by: Rob Herring
Signed-off-by: Laurent Pichart
Signed-off-by: Sricharan R
Signed-off-by: Joerg Roedel -
As part of moving DMA initializing to probe time the
of_dma_deconfigure() function will need to be called from different
source files. Make it public and move it to drivers/of/device.c where
the of_dma_configure() function is.Tested-by: Marek Szyprowski
Reviewed-by: Robin Murphy
Acked-by: Rob Herring
Signed-off-by: Laurent Pinchart
Signed-off-by: Joerg Roedel
23 Mar, 2017
1 commit
-
The modalias sysfs attr is lacking a newline for DT aliases on platform
devices. The macio and ibmebus correctly add the newline, but open code it.
Introduce a new function, of_device_modalias(), that fills the buffer with
the modalias including the newline and update users of the old
of_device_get_modalias function.Signed-off-by: Rob Herring
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Frank Rowand
Cc: linuxppc-dev@lists.ozlabs.org
Acked-by: Greg Kroah-Hartman
23 Feb, 2017
1 commit
-
Pull DeviceTree updates from Rob Herring:
"Pretty standard stuff with dtc upstream sync being the biggest piece.- Sync dtc to upstream commit 0931cea3ba20. This picks up overlay
support in dtc.- Set dma_ops for reserved memory users.
- Make references to IOMMU consistent in DT bindings.
- Cleanup references to pm_power_off in bindings.
- Move some display bindings that snuck into the old bindings/video/
path.- Fix some wrong documentation paths caused from binding
restructuring.- Vendor prefixes for Faraday and Fujitsu.
- Fix an of_node ref counting leak in of_find_node_opts_by_path
- Introduce new graph helper of_graph_get_remote_node() which will be
used by DRM drivers in 4.12"* tag 'devicetree-for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (27 commits)
DT: add Faraday Tec. as vendor
of: introduce of_graph_get_remote_node
of: Add missing space at end of pr_fmt().
of: make of_device_make_bus_id() static
of: fix of_node leak caused in of_find_node_opts_by_path
dt-bindings: net: remove reference to fixed link support
dt-bindings: power: reset: qnap-poweroff: Drop reference to pm_power_off
dt-bindings: power: reset: gpio-poweroff: Drop reference to pm_power_off
dt-bindings: mfd: as3722: Drop reference to pm_power_off
dt-bindings: display: move ANX7814 and SiI8620 bridge bindings
of/unittest: Swap arguments of of_unittest_apply_overlay()
Documentation: usb: fix wrong documentation paths
serial: fsl-imx-uart.txt: Remove generic property
devicetree: Add Fujitsu Ltd. vendor prefix
Documentation: display: fix wrong documentation paths
of: remove redundant memset in overlay
bus:qcom : Fix typo in qcom,ebi2.txt
dt-bindings: qman: Remove pool channel node
Documentation: panel-dpi: fix path to display-timing.txt
devicetree: bindings: clk: mvebu: fix description for sata1 on Armada XP
...
09 Feb, 2017
1 commit
-
of_device_make_bus_id() was changed to non-static by commit c66012253800
("of/device: Make of_device_make_bus_id() usable by other code") more than
6 years ago, but there are no users of it outside of platform.c. Make the
function static again.Signed-off-by: Frank Rowand
Signed-off-by: Rob Herring
20 Jan, 2017
1 commit
-
In the case of ULPI devices, we want to be able to load the
driver before registering the device so that we don't get stuck
in a loop waiting for the phy module to appear and failing usb
controller probe. Currently we request the ulpi module via the
ulpi ids, but in the DT case we might need to request it with the
OF based modalias instead. Add a common function that allows
anyone to request a module with the OF based modalias.Acked-by: Rob Herring
Cc:
Signed-off-by: Stephen Boyd
Signed-off-by: Peter Chen
27 Jul, 2015
1 commit
-
With this change the stub has the same signature as the actual function,
preventing this compiler warning when building without CONFIG_OF:drivers/base/property.c: In function 'fwnode_driver_match_device':
>> drivers/base/property.c:608:38: warning: passing argument 2 of 'of_driver_match_device' discards 'const' qualifier from pointer target type
return of_driver_match_device(dev, drv);
^
In file included from drivers/base/property.c:18:0:
include/linux/of_device.h:61:19: note: expected 'struct device_driver *' but argument is of type 'const struct device_driver *'
static inline int of_driver_match_device(struct device *dev,
^Signed-off-by: Tomeu Vizoso
Signed-off-by: Rob Herring
29 May, 2015
1 commit
-
It's a common operation for device drivers to retrive the data
member from of_device_id struct in their probe function.Most driver end up doing:
const struct of_device_id *match;
match = of_match_device(driver_of_match, &pdev->dev);
driver->data = match->data;With the of_device_get_match_data helper function all this can
done in one go.Signed-off-by: Joachim Eastwood
[robh: add missing inline to dummmy declaration]
Signed-off-by: Rob Herring
04 Mar, 2015
1 commit
-
Move of_dma_configure() to device.c so it can be re-used for PCI devices to
obtain DMA configuration from DT. Also add a second argument so that for
PCI, the DT node of root bus host bridge can be used to obtain the DMA
configuration for the slave PCI device.Tested-by: Suravee Suthikulpanit (AMD Seattle)
Signed-off-by: Murali Karicheri
Signed-off-by: Bjorn Helgaas
Reviewed-by: Catalin Marinas
Acked-by: Will Deacon
Acked-by: Rob Herring
CC: Joerg Roedel
CC: Grant Likely
CC: Russell King
CC: Arnd Bergmann
06 Feb, 2014
1 commit
-
If the of_device_id table inside a device driver is protected by #ifdef
CONFIG_OF, the driver still has to provide a dummy declaration of the
table, or wrap it inside of_match_ptr(), when calling of_match_device()
in the CONFIG_OF=n case, else the driver fails to compile with e.g.drivers/spi/spi-rspi.c: In function 'rspi_probe':
drivers/spi/spi-rspi.c:1203:26: error: 'rspi_of_match' undeclared (first use in this function)
drivers/spi/spi-rspi.c:1203:26: note: each undeclared identifier is reported only once for each function it appears inMake of_match_device() nullify the table pointer if CONFIG_OF=n to fix
this.Reported-by: Yoshihiro Shimoda
Signed-off-by: Geert Uytterhoeven
Signed-off-by: Rob Herring
17 Jan, 2014
1 commit
-
Fix a problem that, the platform bus supports the OF style modalias
in .uevent() call, but not in its device 'modalias' sysfs attribute.Signed-off-by: Zhang Rui
Acked-by: Rob Herring
Signed-off-by: Rafael J. Wysocki
21 Aug, 2013
1 commit
-
Multiple drivers need to get the cpu device node from the cpu logical
index and then access the of_node.This patch adds helper function to fetch the device node directly.
Acked-by: Rob Herring
Signed-off-by: Sudeep KarkadaNagesha
12 Jun, 2013
1 commit
-
CONFIG_OF_DEVICE is always selected when CONFIG_OF is enabled, so remove
it and simplify of_platform.h and of_device.h headers. This also fixes
!OF compiles using of_platform_populate.Signed-off-by: Rob Herring
Acked-by: Arnd Bergmann
Tested-by: Benjamin Herrenschmidt
Signed-off-by: Grant Likely
25 Mar, 2012
1 commit
-
Pull avoidance patches from Paul Gortmaker:
"Nearly every subsystem has some kind of header with a proto like:void foo(struct device *dev);
and yet there is no reason for most of these guys to care about the
sub fields within the device struct. This allows us to significantly
reduce the scope of headers including headers. For this instance, a
reduction of about 40% is achieved by replacing the include with the
simple fact that the device is some kind of a struct.Unlike the much larger module.h cleanup, this one is simply two
commits. One to fix the implicit users, and then one
to delete the device.h includes from the linux/include/ dir wherever
possible."* tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
device.h: audit and cleanup users in main include dir
device.h: cleanup users outside of linux/include (C files)
16 Mar, 2012
1 commit
-
The header includes a lot of stuff, and
it in turn gets a lot of use just for the basic "struct device"
which appears so often.Clean up the users as follows:
1) For those headers only needing "struct device" as a pointer
in fcn args, replace the include with exactly that.2) For headers not really using anything from device.h, simply
delete the include altogether.3) For headers relying on getting device.h implicitly before
being included themselves, now explicitly include device.h4) For files in which doing #1 or #2 uncovers an implicit
dependency on some other header, fix by explicitly adding
the required header(s).Any C files that were implicitly relying on device.h to be
present have already been dealt with in advance.Total removals from #1 and #2: 51. Total additions coming
from #3: 9. Total other implicit dependencies from #4: 7.As of 3.3-rc1, there were 110, so a net removal of 42 gives
about a 38% reduction in device.h presence in include/*Signed-off-by: Paul Gortmaker
02 Feb, 2012
1 commit
-
When userspace needs to find a specific device, it currently isn't easy to
resolve a /sys/devices/ path from a specific device tree node. Nor is it
easy to obtain the compatible list for devices.This patch generalizes the code that inserts OF_* values into the uevent
device attribute so that any device that is attached to an OF node will
have that information exported to userspace. Without this patch only
platform devices and some powerpc-specific busses have access to this
data.The original function also creates a MODALIAS property for the compatible
list, but that code has not been generalized into the common case because
it has the potential to break module loading on a lot of bus types. Bus
types are still responsible for their own MODALIAS properties.Boot tested on ARM and compile tested on PowerPC and SPARC.
Signed-off-by: Grant Likely
Acked-by: Greg Kroah-Hartman
Cc: Tobias Klauser
Cc: Frederic Lambert
Cc: Rob Herring
Cc: Mark Brown
Cc: "David S. Miller"
Cc: Benjamin Herrenschmidt
19 May, 2011
2 commits
-
Commit b826291c, "drivercore/dt: add a match table pointer to struct
device" added an of_match pointer to struct device to cache the
of_match_table entry discovered at driver match time. This was unsafe
because matching is not an atomic operation with probing a driver. If
two or more drivers are attempted to be matched to a driver at the
same time, then the cached matching entry pointer could get
overwritten.This patch reverts the of_match cache pointer and reworks all users to
call of_match_device() directly instead.Signed-off-by: Grant Likely
-
If two drivers are probing devices at the same time, both will write
their match table result to the dev->of_match cache at the same time.Only write the result if the device matches.
In a thread titled "SBus devices sometimes detected, sometimes not",
Meelis reported his SBus hme was not detected about 50% of the time.
From the debug suggested by Grant it was obvious another driver matched
some devices between the call to match the hme and the hme discovery
failling.Reported-by: Meelis Roos
Signed-off-by: Milton Miller
[grant.likely: modified to only call of_match_device() once]
Signed-off-by: Grant Likely
28 Feb, 2011
1 commit
-
Add a new .of_match field to struct device which points at the
matching device driver .of_match_table entry when a device is probed
via the device treeSigned-off-by: Grant Likely
Acked-by: Greg Kroah-Hartman
22 Oct, 2010
1 commit
-
The current code allocates and manages platform_devices created from
the device tree manually. It also uses an unsafe shortcut for
allocating the platform_device and the resource table at the same
time. (which I added in the last rework; sorry).This patch refactors the code to use platform_device_alloc() for
allocating new devices. This reduces the amount of custom code
implemented by of_platform, eliminates the unsafe alloc trick, and has
the side benefit of letting the platform_bus code manage freeing the
device data and resources when the device is freed.Signed-off-by: Grant Likely
Cc: Benjamin Herrenschmidt
Cc: Greg Kroah-Hartman
Cc: "David S. Miller"
Cc: Michal Simek
06 Aug, 2010
1 commit
-
of_device is just an alias for platform_device, so remove it entirely. Also
replace to_of_device() with to_platform_device() and update comment blocks.This patch was initially generated from the following semantic patch, and then
edited by hand to pick up the bits that coccinelle didn't catch.@@
@@
-struct of_device
+struct platform_deviceSigned-off-by: Grant Likely
Reviewed-by: David S. Miller
30 Jul, 2010
1 commit
-
The AMBA bus should also use of_device_make_bus_id() when populating device
out of device tree data. This patch makes the function non-static, and
adds a suitable prototype in of_device.hSigned-off-by: Grant Likely
24 Jul, 2010
3 commits
-
of_device is currently just an #define alias to platform_device until it
gets removed entirely. This patch removes references to it from the
include directories and the core drivers/of code.Signed-off-by: Grant Likely
Acked-by: David S. Miller -
It is mostly unused now. Sparc has a few defines left in it, but they
can be moved to other headers. Removing this header means that new
architectures adding CONFIG_OF support don't need to also add this
header file.Signed-off-by: Grant Likely
Acked-by: David S. Miller -
of_platform_bus was being used in the same manner as the platform_bus.
The only difference being that of_platform_bus devices are generated
from data in the device tree, and platform_bus devices are usually
statically allocated in platform code. Having them separate causes
the problem of device drivers having to be registered twice if it
was possible for the same device to appear on either bus.This patch removes of_platform_bus_type and registers all of_platform
bus devices and drivers on the platform bus instead. A previous patch
made the of_device structure an alias for the platform_device structure,
and a shim is used to adapt of_platform_drivers to the platform bus.After all of of_platform_bus drivers are converted to be normal platform
drivers, the shim code can be removed.Signed-off-by: Grant Likely
Acked-by: David S. Miller
06 Jul, 2010
4 commits
-
Some code uses of_device even when CONFIG_OF_DEVICE is not set. This
patch makes of_device valid all the time by moving it outside of the
ifdef CONFIG_OF_DEVICE test.Reported-by: Randy Dunlap
Signed-off-by: Grant Likely
Acked-by: Randy Dunlap -
Add of_driver_match_device() helper function. This function can be used
by bus types to determine if a driver works with a device when using OF
style matching. If CONFIG_OF is unselected, then it is a nop.Signed-off-by: Grant Likely
CC: Greg Kroah-Hartman
CC: Michal Simek
CC: Grant Likely
CC: Benjamin Herrenschmidt
CC: Stephen Rothwell
CC: linux-kernel@vger.kernel.org
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org
CC: devicetree-discuss@lists.ozlabs.org -
Now that the of_node pointer is part of struct device,
of_device_get_modalias could be used on any struct device
that has the device node pointer set. This patch changes
of_device_get_modalias to accept a struct device instead
of a struct of_device.Signed-off-by: Grant Likely
CC: Michal Simek
CC: Benjamin Herrenschmidt
CC: Wolfram Sang
CC: Stephen Rothwell
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org -
Merge common code between powerpc and microblaze
Signed-off-by: Grant Likely
CC: Michal Simek
CC: Wolfram Sang
CC: Stephen Rothwell
CC: Benjamin Herrenschmidt
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org
29 Jun, 2010
1 commit
-
Now that the device tree node pointer has been moved out of struct
of_device and into the common struct device, there isn't anything
unique about of_device anymore. In fact, there isn't much need
for a separate of_bus when all busses have access to OF style
probing.arch/powerpc and arch/microblaze are moving away from using the of_bus
and using the regular platform bus instead for mmio devices. This
patch makes of_device the same as platform_device as a stepping stone
in migrating of_platform_drivers over to the platform bus.Signed-off-by: Grant Likely
Acked-by: David S. Miller
Cc: Michal Simek
Cc: Benjamin Herrenschmidt
Cc: Stephen Rothwell
22 May, 2010
1 commit
-
The of_node pointer is now stored directly in struct device, so
of_match_device() should work with any device, not just struct of_device.This patch changes the interface to of_match_device() to accept a
struct device instead of struct of_device.Signed-off-by: Grant Likely
29 Apr, 2010
1 commit
-
Only process contents of of_platform.h and of_device.h if
CONFIG_OF_DEVICE is set.Signed-off-by: Grant Likely
16 May, 2008
1 commit
-
Commit 140b932f8cb6cced10b96860651a198b1b89cbb9 ("Create modalias file
in sysfs for of_platform bus") needs this to avoid breaking the sparc
builds.Just move the code and add whitespace around some binary operators.
Signed-off-by: Stephen Rothwell
Acked-by: David S. Miller
Signed-off-by: Paul Mackerras
30 Apr, 2008
1 commit
-
Remove the "#ifdef __KERNEL__" tests from unexported header files in
linux/include whose entire contents are wrapped in that preprocessor
test.Signed-off-by: Robert P. J. Day
Cc: David Woodhouse
Cc: Sam Ravnborg
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Jan, 2008
1 commit
-
Similar to of_find_compatible_node(), of_find_matching_node() and
for_each_matching_node() allow you to iterate over the device tree
looking for specific nodes, except that they take of_device_id
tables instead of strings.This also moves of_match_node() from driver/of/device.c to
driver/of/base.c to colocate it with the of_find_matching_node which
depends on it.Signed-off-by: Grant Likely
Signed-off-by: Paul Mackerras
17 Oct, 2007
1 commit
-
Extract generic of_device allocation code from of_platform_device_create()
and move it into of_device.[ch], called of_device_alloc(). Also, there's now
of_device_free() which puts the device node.This way, bus drivers that build on of_platform (like ibmebus will) can
build upon this code instead of reinventing the wheel.Signed-off-by: Joachim Fenkes
Acked-by: Arnd Bergmann
Signed-off-by: Paul Mackerras
20 Jul, 2007
1 commit
-
This just moves the common stuff from the arch of_device.h files to
linux/of_device.h.Signed-off-by: Stephen Rothwell
Acked-by: Paul Mackerras
Acked-by: David S. Miller