Commit Graph

616432 Commits

Author SHA1 Message Date
Finley Xiao b3149f4e33 nvmem: rockchip-efuse: update compatible strings for Rockchip efuse
Rk3399-efuse is organized as 32bits by 32 one-time programmable electrical
fuses. The efuse of earlier SoCs are organized as 32bits by 8 one-time
programmable electrical fuses with random access interface.

Add different device tree compatible string for different SoCs to be able
to differentiate between the two. The old binding is of course preserved,
though deprecated.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 17:22:51 +02:00
Alex Ng db886e4d24 Drivers: hv: utils: Check VSS daemon is listening before a hot backup
Hyper-V host will send a VSS_OP_HOT_BACKUP request to check if guest is
ready for a live backup/snapshot. The driver should respond to the check
only if the daemon is running and listening to requests. This allows the
host to fallback to standard snapshots in case the VSS daemon is not
running.

Signed-off-by: Alex Ng <alexng@messages.microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 17:22:51 +02:00
Alex Ng 497af84b81 Drivers: hv: utils: Continue to poll VSS channel after handling requests.
Multiple VSS_OP_HOT_BACKUP requests may arrive in quick succession, even
though the host only signals once. The driver wass handling the first
request while ignoring the others in the ring buffer. We should poll the
VSS channel after handling a request to continue processing other requests.

Signed-off-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 17:22:51 +02:00
K. Y. Srinivasan 509879bdb3 Drivers: hv: Introduce a policy for controlling channel affinity
Introduce a mechanism to control how channels will be affinitized. We will
support two policies:

1. HV_BALANCED: All performance critical channels will be dstributed
evenly amongst all the available NUMA nodes. Once the Node is assigned,
we will assign the CPU based on a simple round robin scheme.

2. HV_LOCALIZED: Only the primary channels are distributed across all
NUMA nodes. Sub-channels will be in the same NUMA node as the primary
channel. This is the current behaviour.

The default policy will be the HV_BALANCED as it can minimize the remote
memory access on NUMA machines with applications that span NUMA nodes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 17:22:51 +02:00
Vitaly Kuznetsov bb08d431a9 Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw()
With wrap around mappings in place we can always provide drivers with
direct links to packets on the ring buffer, even when they wrap around.
Do the required updates to get_next_pkt_raw()/put_pkt_raw()

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Tested-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 17:22:51 +02:00
Vitaly Kuznetsov f24f0b495b Drivers: hv: ring_buffer: use wrap around mappings in hv_copy{from, to}_ringbuffer()
With wrap around mappings for ring buffers we can always use a single
memcpy() to do the job.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Tested-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 17:22:51 +02:00
Vitaly Kuznetsov 9988ce6856 Drivers: hv: ring_buffer: wrap around mappings for ring buffers
Make it possible to always use a single memcpy() or to provide a direct
link to a packet on the ring buffer by creating virtual mapping for two
copies of the ring buffer with vmap(). Utilize currently empty
hv_ringbuffer_cleanup() to do the unmap.

While on it, replace sizeof(struct hv_ring_buffer) check
in hv_ringbuffer_init() with BUILD_BUG_ON() as it is a compile time check.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Tested-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 17:22:51 +02:00
Vitaly Kuznetsov 98f531b10d Drivers: hv: cleanup vmbus_open() for wrap around mappings
In preparation for doing wrap around mappings for ring buffers cleanup
vmbus_open() function:
- check that ring sizes are PAGE_SIZE aligned (they are for all in-kernel
  drivers now);
- kfree(open_info) on error only after we kzalloc() it (not an issue as it
  is valid to call kfree(NULL);
- rename poorly named labels;
- use alloc_pages() instead of __get_free_pages() as we need struct page
  pointer for future.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Tested-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 17:22:51 +02:00
Zubair Lutfullah Kakakhel 7789e5a2ac serial: pch_uart: Add support for reading clock-frequency from DT
The MIPS based Boston platform provides a 25MHz clock to the UART.

Enable the driver for MIPS and add support in the driver to read
the frequency from device tree.

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 15:45:19 +02:00
Zubair Lutfullah Kakakhel bed3d7baba misc: pch_phub: Add UART_CLK quirk for Boston platform
The EG20T has 4 UART blocks. The clock source for the UART block is
configured to receive a clock from an external pin by default.

An internal 25MHz clock in the EG20T can also be used as a clock source
for the clock.

The MIPS based Boston platform ties the external clock pin down and relies
on the internal clock source for the UART to function.

Boston is based on device tree.

Add a quirk to allow Boston to be detected via device tree and set the
correct clock source for UART.

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 15:45:18 +02:00
Zubair Lutfullah Kakakhel 549ce8f134 misc: pch_phub: Read prefetch value from device tree if passed
The default prefetch value for the eg20t device is hard coded to
0x000affaa.

Add support for an alternative to be read from DT if available

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 15:45:18 +02:00
Baoyou Xie aeb83d7054 fix:memory:of_memory:add missing header dependencies
We get 2 warnings when biuld kernel with W=1:
drivers/memory/of_memory.c:30:30: warning: no previous prototype for 'of_get_min_tck' [-Wmissing-prototypes]
drivers/memory/of_memory.c:106:30: warning: no previous prototype for 'of_get_ddr_timings' [-Wmissing-prototypes]

In fact, these functions are declared in drivers/memory/of_memory.h
so this patch add missing header dependencies.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 15:21:18 +02:00
Robin Murphy 148a1bc843 drivers: char: mem: Check {read,write}_kmem() addresses
Arriving at read_kmem() with an offset representing a bogus kernel
address (e.g. 0 from a simple "cat /dev/kmem") leads to copy_to_user
faulting on the kernel-side read.

x86_64 happens to get away with this since the optimised implementation
uses "rep movs*", thus the user write (which is allowed to fault) and
the kernel read are the same instruction, the kernel-side fault falls
into the user-side fixup handler and the chain of events which
transpires ends up returning an error as one might expect, even if it's
an inappropriate -EFAULT. On other architectures, though, the read is
not covered by the fixup entry for the write, and we get a big scary
"Unable to hande kernel paging request..." dump.

The more typical use-case of mmap_kmem() has always (within living
memory at least) returned -EIO for addresses which don't satisfy
pfn_valid(), so let's make that consistent across {read,write}_kem()
too.

Reported-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 15:21:18 +02:00
Eli Billauer d61f3088ea char: xillybus: Fix spelling mistake and comment
This patch fixes two minor issues:

(1) An inaccurate comment
(2) A spelling mistake in dev_err message ("upgarde" -> "upgrade")

Reported-by: Joe Perches <joe@perches.com>
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 14:47:54 +02:00
Zhouyi Zhou c1e8ad2311 snsc: check return value of class_create
return value of class_create should be considered in
module init function.

Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 14:47:54 +02:00
Arnd Bergmann 26ec99b105 char/mwave: remove custom BOOLEAN type
The mwave driver has its own macros for the BOOLEAN type and the
TRUE/FALSE values. This is redundant because the kernel already
has bool/true/false, and it clashes with the ACPI headers that
also define these types. The linux/acpi.h header is now included
implicitly from mwave through the mc146818rtc.h header, as
reported by Stephen Rothwell:

In file included from drivers/char/mwave/smapi.c:51:0:
drivers/char/mwave/smapi.h:52:0: warning: "TRUE" redefined
 #define TRUE 1
 ^
In file included from include/acpi/acpi.h:58:0,
                 from include/linux/acpi.h:33,
                 from include/linux/mc146818rtc.h:21,
                 from drivers/char/mwave/smapi.c:50:
include/acpi/actypes.h:438:0: note: this is the location of the previous definition
 #define TRUE                            (1 == 1)
 ^

This removes the private types from mwave and uses the standard
types instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Fixes: fd09cc80165c ("rtc: cmos: move mc146818rtc code out of asm-generic/rtc.h")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 14:22:49 +02:00
Sudip Mukherjee 8b7d3a9d90 ppdev: use new parport device model
Modify ppdev driver to use the new parallel port device model.

Initially submitted and committed as:
e7223f1860 ("ppdev: use new parport device model")

But due to some regression it was reverted by:
1701f68040 ("Revert "ppdev: use new parport device model"")

Now that the original source of regression is fixed by:
bbca503b2e ("parport: use subsys_initcall") we can again modify ppdev
to use device model.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 14:22:49 +02:00
Frank Haverkamp 5ed22cebba GenWQE: Change default access rights for device node
Since it should always be ok for normal users to operate the accelerator,
it makes sense to change it in our driver, rather than adding udev rules
for all Linux distributions.

Signed-off-by: Frank Haverkamp <haver@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 14:22:49 +02:00
PrasannaKumar Muralidharan d6a38c0ba7 miscdevice: Use module_misc_device() macro
This patch removes module_init()/module_exit() from driver code by using
module_misc_device() macro. All modules in this patch has a print
statement which is removed when module_misc_device() macro is used.
If undesirable this patch can be dropped entirely, this is the only
purpose of making this as a separate patch.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 14:12:35 +02:00
PrasannaKumar Muralidharan ca75d601b5 miscdevice: Add helper macro for misc device boilerplate
Many modules call misc_register and misc_deregister in its module init
and exit methods without any additional code. This ends up being
boilerplate. This patch adds helper macro module_misc_device(), that
replaces module_init()/ module_exit() with template functions.

This patch also converts drivers to use new macro.

Change since v1:
Add device.h include in miscdevice.h as module_driver macro was not
available from other include files in some architectures.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 14:12:35 +02:00
Linus Walleij 832c8232dd misc: retire the old BMP085 driver
Patches merged to the IIO BMP085 driver makes it fully compliant
with all features found in this old misc driver. Retire this old
driver in favor of the new one in the proper subsystem.

Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Marek Belisko <marek@goldelico.com>
Acked-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 14:11:33 +02:00
Alexander Kapshuk 9b9e7d36bd ver_linux: rename ver_linux.awk to ver_linux
ver_linux.awk renamed to ver_linux.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:59:31 +02:00
Alexander Kapshuk b88396e417 ver_linux: shell implementation removed
The shell implementation removed. To be replaced with an all-awk implementation via consecutive patch.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:59:31 +02:00
Alexander Kapshuk 2d187d5855 ver_linux: complete awk implementation
The algorithm that extracts the version number of the utility being
queried, and prints the name of the utility and its version number is
currently implemented in awk. The code is used throughout the script,
making its use repetative. The proposed implementation confines the
algorithm in question to a function, which makes the script easier to
read overall, as well as considerably reduces the number of lines of
code. Every attempt has been made to retain the look and the format
generated by the current implementation.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:59:31 +02:00
Wei Yongjun a46b195ca0 w1: fix timeout_us parameter description
Fix 'timeout_us' parameter description.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:56:05 +02:00
Ben Werbowyj 368451ea74 drivers: w1: style corrections-pointers-blanklines-comparisons
Correct pointer notations to include whitespace between
variable type and "*" character. Inserted blank line
after variable declatations at two locations.
Rearranged comparison within an if statment to have the
constant on the right-hand side.

Signed-off-by: Ben Werbowyj <ben.werbowyj@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:56:04 +02:00
Ben Werbowyj aaf16f7d98 drivers: w1: removed assignment from within if statement
Assignment of variable count removed from within an if statment.
This was done at two locations in the file.

Signed-off-by: Ben Werbowyj <ben.werbowyj@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:56:04 +02:00
Ben Werbowyj d4c3f97a06 drivers: w1: style corrections for parenthesis and braces
Inserted whitespace between command and open parenthesis
at two locations. Removed new line between open brace and
command/declaration at two locations.

Signed-off-by: Ben Werbowyj <ben.werbowyj@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:56:04 +02:00
Benedikt Spranger 34924b2311 MAINTAINERS: Saying goodbye to Hans J. Koch
We had to say goodbye when Hans passed away recently. Hans was a
free-software enthusiast and an active contributor. He was the main author
and maintainer of the UIO subsystem and contributed in various ways to the
Linux kernel as a professional and hobbyist. He is greatly missed.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:44:32 +02:00
Martyn Welch 658bcdae9c vme: Adding Fake VME driver
This patch introduces a fake VME bridge driver. This driver currently
emulates a subset of the VME bridge functionality. This allows some VME
subsystem development and even some VME device driver development to be
carried out in the absence of a proper VME bus.

Signed-off-by: Martyn Welch <martyn@welchs.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:21:12 +02:00
Paul Gortmaker 050c3d52cc vme: make core vme support explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/vme/Kconfig:menuconfig VME_BUS
drivers/vme/Kconfig:    bool "VME bridge support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We replace module.h and moduleparam.h (unused) with init.h and also
export.h ; the latter since this file does export some syms.

Since this is a struct bus_type and not a platform_driver, we don't
have any ".suppress_bind_attrs" to be concerned about when we
drop the ".remove" code from this file.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

Cc: Manohar Vanga <manohar.vanga@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Martyn Welch <martyn@welchs.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:20:16 +02:00
Alessio Igor Bogani 553ebb8e40 vme: Fix module autoload
These drivers have a PCI device ID table but the PCI module
alias information is not created so module autoloading won't work.

Signed-off-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Acked-by: Martyn Welch <martyn@welchs.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:20:16 +02:00
Martyn Welch 76deefa3b7 vme: Update documentation to match api
The vme_register_driver() api changed in commit 5d6abf379d ("staging:
vme: make match() driver specific to improve non-VME64x support") but the
documentation wasn't updated. Update the documentation to match the API.

Signed-off-by: Martyn Welch <martyn@welchs.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:20:16 +02:00
Aaron Sierra fa54b32680 vme: change LM callback argument to void pointer
Make the location monitor callback function prototype more useful by
changing the argument from an integer to a void pointer.

All VME bridge drivers were simply passing the location monitor index
(e.g. 0-3) as the argument to these callbacks. It is much more useful
to pass back a pointer to data that the callback-registering driver
cares about.

There appear to be no in-kernel callers of vme_lm_attach (or
vme_lme_request for that matter), so this change only affects the VME
subsystem and bridge drivers.

This has been tested with Tsi148 hardware, but the CA91Cx42 changes
have only been compiled.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Acked-by: Martyn Welch <martyn@welchs.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:20:15 +02:00
Muhammad Falak R Wani 655745b0d1 VMCI: use memdup_user().
Use memdup_user to duplicate a memory region from user-space to
kernel-space, instead of open coding using kmalloc & copy_from_user.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:18:10 +02:00
Johannes Thumshirn b58189b3c5 mcb: remove sub-device handling code
The MEN Chameleon specification states that a chameleon FPGA can include a
bridge descriptor, which then opens up a new bus behind this bridge. MCB
included subdevice handling code in the core, but no support for bus
descriptors in the parser, due to a lack of hardware access.

As this is technically dead code, but it gets executed on a device add,
I've decided to remove it.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:16:24 +02:00
Johannes Thumshirn 68d9671a84 mcb: Introduce type safety for to_mcb_*
The to_mcb_{bus,device,driver}() macros lacked type safety, so convert them to
inline functions to enforce compile time type checking.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:16:24 +02:00
Andreas Werner ffc7bb3857 mcb: Added bar descriptor support for non PCI bus MCB carrier
Added support for the bar descriptor. This type is used for FPGAs
connect to the LPC or to a non PCI bus.

The Bar descriptor could have a maximum of 6 BARs. Each of the
devices within the FPGA could be mapped to a different BAR.
The BAR descriptor is comparable to the PCI header.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
[ free bar descriptor in the non-error case ]
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:16:24 +02:00
Andreas Werner 73edc8f7cc mcb: Added support for LPC or non PCI based MCB carrier
Add support for MCB bases FPGAs connected to the LPC or
non PCI Bus.

This driver currently supports the SC24 board. The FPGA
is connected to the LPC bus and is identified using the BIOS
DMI string.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:16:24 +02:00
Jan Viktorin 4d31a2588a uio: fix dmem_region_start computation
The variable i contains a total number of resources (including
IORESOURCE_IRQ). However, we want the dmem_region_start to point
after the last resource of type IORESOURCE_MEM. The original behaviour
leads (very likely) to skipping several UIO mapping regions and makes
them useless. Fix this by computing dmem_region_start from the uiomem
which points to the last used UIO mapping.

Fixes: 0a0c3b5a24 ("Add new uio device for dynamic memory allocation")

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:07:30 +02:00
Mathieu Poirier e97b1c6a8d coresight: etm4x: adding configurable start/stop filtering
With this patch we add start/stop filtering as specified on
the perf cmd line.  When the IP matches the start address
trace generation gets triggered.  The stop condition is
achieved when the IP matches the stop address.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:44 +02:00
Mathieu Poirier 2703d74c13 coresight: etm4x: adding configurable address range filtering
This patch adds the capability to specify address ranges from
the perf cmd line using the --filter option.  If the IP
falls within the range(s) program flow traces are generated.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:44 +02:00
Mathieu Poirier f0d30cc30e coresight: etm4x: configuring include/exclude function
The include/exclude function of a tracer is applicable to address
range and start/stop filters.  To avoid duplication and reuse code
moving the include/exclude configuration to a function of its own.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:44 +02:00
Mathieu Poirier 6cccf66354 coresight: etm4x: adding range filter configuration function
Introducing a new function to do address range configuration
generic enough to work for any address range and any comparator.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:43 +02:00
Mathieu Poirier 5edd944b43 coresight: etm4x: cleaning up default filter configuration
The default filter configuration was hard to read and included
some redundancy.  This patch attempts to stream line configuration
and improve readability.

No change of functionality is included.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:43 +02:00
Mathieu Poirier 2a5695a585 coresight: etm4x: split default and filter configuration
Splitting the steps involved in the configuration of a tracer.
The first part is generic and can be reused for both sysFS and
Perf methods.

The second part pertains to the configuration of filters
themselves where the source of the information used to
configure the filters will vary depending on the access
methods.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:43 +02:00
Mathieu Poirier ca878b1466 coresight: etm-perf: configuring filters from perf core
This patch implements the required API needed to access
and retrieve range and start/stop filters from the perf core.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:43 +02:00
Mathieu Poirier 2b7adc460f coresight: remove duplicated enumeration
Both ETMv3 and ETMv4 drivers are declaring an 'enum etm_addr_type',
creating reduncancy.

This patch removes the enumeration from the driver files and adds
it to a common header.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:43 +02:00
Mathieu Poirier 68905d73df coresight: etm-perf: pass struct perf_event to source::enable/disable()
With this commit [1] address range filter information is now found
in the struct hw_perf_event::addr_filters.  As such pass the event
itself to the coresight_source::enable/disable() functions so that
both event attribute and filter can be accessible for configuration.

[1] 'commit 375637bc52 ("perf/core: Introduce address range filtering")'

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:43 +02:00
Sudeep Holla 3224dcc5a6 coresight: fix handling of ETM trace register access via sysfs
The ETM registers are classified into 2 categories: trace and management.
The core power domain contains most of the trace unit logic including
all(except TRCOSLAR and TRCOSLSR) the trace registers. The debug power
domain contains the external debugger interface including all management
registers.

This patch adds coresight unit specific function coresight_simple_func
which can be used for ETM trace registers by providing a ETM specific
read function which does smp cross call to ensure the trace core is
powered up before the register is accessed.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-31 13:05:43 +02:00