Age | Commit message (Collapse) | Author | Files | Lines |
|
Most users of IS_ERR_VALUE() in the kernel are wrong, as they
pass an 'int' into a function that takes an 'unsigned long'
argument. This happens to work because the type is sign-extended
on 64-bit architectures before it gets converted into an
unsigned type.
However, anything that passes an 'unsigned short' or 'unsigned int'
argument into IS_ERR_VALUE() is guaranteed to be broken, as are
8-bit integers and types that are wider than 'unsigned long'.
Andrzej Hajda has already fixed a lot of the worst abusers that
were causing actual bugs, but it would be nice to prevent any
users that are not passing 'unsigned long' arguments.
This patch changes all users of IS_ERR_VALUE() that I could find
on 32-bit ARM randconfig builds and x86 allmodconfig. For the
moment, this doesn't change the definition of IS_ERR_VALUE()
because there are probably still architecture specific users
elsewhere.
Almost all the warnings I got are for files that are better off
using 'if (err)' or 'if (err < 0)'.
The only legitimate user I could find that we get a warning for
is the (32-bit only) freescale fman driver, so I did not remove
the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
For 9pfs, I just worked around one user whose calling conventions
are so obscure that I did not dare change the behavior.
I was using this definition for testing:
#define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
which ends up making all 16-bit or wider types work correctly with
the most plausible interpretation of what IS_ERR_VALUE() was supposed
to return according to its users, but also causes a compile-time
warning for any users that do not pass an 'unsigned long' argument.
I suggested this approach earlier this year, but back then we ended
up deciding to just fix the users that are obviously broken. After
the initial warning that caused me to get involved in the discussion
(fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
asked me to send the whole thing again.
[ Updated the 9p parts as per Al Viro - Linus ]
Signed-off-by: Arnd Bergmann <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Andrew Morton <[email protected]>
Link: https://lkml.org/lkml/2016/1/7/363
Link: https://lkml.org/lkml/2016/5/27/486
Acked-by: Srinivas Kandagatla <[email protected]> # For nvmem part
Signed-off-by: Linus Torvalds <[email protected]>
|
|
The host1x unit found in Tegra210 SoCs is very similar to the unit in
Tegra124, but it has 2 additional channels for a total of 14 channels.
Signed-off-by: Thierry Reding <[email protected]>
|
|
MLOCK's debug info, spewed on CDMA timeout, contains meaningless MLOCK
owner channel ID because HOST1X_SYNC_MLOCK_OWNER_CHID_F() returns shifted
value, while unshifted should be used. Fix it by changing '_F' to '_V'.
Signed-off-by: Dmitry Osipenko <[email protected]>
Reviewed-By: Terje Bergstrom <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Consistently use a format of %pad+%#x to print address/offset in debug
messages.
Signed-off-by: Thierry Reding <[email protected]>
|
|
Signed-off-by: Thierry Reding <[email protected]>
|
|
This reduces the amount of casting that needs to be done to get rid of
annoying warnings on 64-bit builds.
Signed-off-by: Thierry Reding <[email protected]>
|
|
Rather than cast to a u32 use the struct host1x_bo pointers directly.
This avoid annoying warnings for 64-bit builds.
Signed-off-by: Thierry Reding <[email protected]>
|
|
BIT_WORD() truncates rather than rounds, so the loops in
syncpt_thresh_isr() and _host1x_intr_disable_all_syncpt_intrs() use <=
rather than < in an attempt to process the correct number of registers
when rounding of the conversion of count of bits to count of words is
necessary. However, when rounding isn't necessary because the value is
already a multiple of the divisor (as is the case for all values of
nb_pts the code actually sees), this causes one too many registers to
be processed.
Solve this by using and explicit DIV_ROUND_UP() call, rather than
BIT_WORD(), and comparing with < rather than <=.
Fixes: 7ede0b0bf3e2 ("gpu: host1x: Add syncpoint wait and interrupts")
Cc: <[email protected]> # 3.10
Signed-off-by: Stephen Warren <[email protected]>
Acked-By: Terje Bergstrom <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Nothing from the asm/mach/irq.h header is needed in this file, so there
is no need to include it.
Signed-off-by: Thierry Reding <[email protected]>
|
|
Tegra124 has 192 syncpoints whereas its predecessors had 32 syncpoints.
This required changes to the hardware register layout.
Signed-off-by: Arto Merilainen <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
An earlier patch added a subset of the required HW specific header files
but didn't actually include the right ones when compiling for host1x02.
Signed-off-by: Thierry Reding <[email protected]>
|
|
When building with LPAE=y (64-bit dma_addr_t), the following warnings are seen:
drivers/gpu/host1x/hw/cdma_hw.c:57:3: warning: format '%x' expects
argument of type 'unsigned int', but argument 5 has type 'dma_addr_t'
drivers/gpu/host1x/hw/debug_hw.c:167:10: warning: format '%x' expects
argument of type 'unsigned int', but argument 3 has type 'dma_addr_t'
The agreed-to solution for this is upcast to u64 and using %llx.
Signed-off-by: Olof Johansson <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
This patch adds support for hardware syncpoint bases. This creates
a simple mechanism to stall the command FIFO until an operation is
completed.
Signed-off-by: Arto Merilainen <[email protected]>
Reviewed-by: Terje Bergstrom <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Tegra114 uses a slightly updated version of host1x with an additional
syncpoint.
Signed-off-by: Thierry Reding <[email protected]>
|
|
This is slightly safer than adding -Idrivers/gpu/host1x to cflags-y.
Signed-off-by: Thierry Reding <[email protected]>
|
|
Expose the buffer objects, syncpoint and channel functionality in the
public public header so that drivers can use them.
Signed-off-by: Thierry Reding <[email protected]>
|
|
In preparation to support host1x clients other than DRM, move this
header into a public location.
Signed-off-by: Thierry Reding <[email protected]>
|
|
Most of the included files are either not required or already included
by some other header file.
Signed-off-by: Thierry Reding <[email protected]>
|
|
Signed-off-by: Thierry Reding <[email protected]>
|
|
This patch merges host1x_syncpt_cpu_incr to host1x_syncpt_incr() as
they are in practise doing the same thing. host1x_syncpt_incr() is
also modified to return error codes. User space interface is modified
accordingly to pass return values.
Signed-off-by: Arto Merilainen <[email protected]>
Acked-By: Terje Bergstrom <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Add support for host1x debugging. Adds debugfs entries, and dumps
channel state to UART in case of stuck job.
Signed-off-by: Arto Merilainen <[email protected]>
Signed-off-by: Terje Bergstrom <[email protected]>
Reviewed-by: Thierry Reding <[email protected]>
Tested-by: Thierry Reding <[email protected]>
Tested-by: Erik Faye-Lund <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Add support for host1x client modules, and host1x channels to submit
work to the clients.
Signed-off-by: Arto Merilainen <[email protected]>
Signed-off-by: Terje Bergstrom <[email protected]>
Reviewed-by: Thierry Reding <[email protected]>
Tested-by: Thierry Reding <[email protected]>
Tested-by: Erik Faye-Lund <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Add support for sync point interrupts, and sync point wait. Sync
point wait used interrupts for unblocking wait.
Signed-off-by: Arto Merilainen <[email protected]>
Signed-off-by: Terje Bergstrom <[email protected]>
Reviewed-by: Thierry Reding <[email protected]>
Tested-by: Thierry Reding <[email protected]>
Tested-by: Erik Faye-Lund <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|
|
Add host1x, the driver for host1x and its client unit 2D. The Tegra
host1x module is the DMA engine for register access to Tegra's
graphics- and multimedia-related modules. The modules served by
host1x are referred to as clients. host1x includes some other
functionality, such as synchronization.
Signed-off-by: Arto Merilainen <[email protected]>
Signed-off-by: Terje Bergstrom <[email protected]>
Reviewed-by: Thierry Reding <[email protected]>
Tested-by: Thierry Reding <[email protected]>
Tested-by: Erik Faye-Lund <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
|