05 Aug, 2018
1 commit
-
Return statements in functions returning bool should use true or false
instead of an integer value.This code was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva
Signed-off-by: Greg Kroah-Hartman
03 Jul, 2018
1 commit
-
The variables val16, type, pci_dev and type are set but are never used
hence they are redundant and can be removed.Cleans up clang warnings:
warning: variable 'type' set but not used [-Wunused-but-set-variable]
warning: variable 'val16' set but not used [-Wunused-but-set-variable]
warning: variable 'pci_dev' set but not used [-Wunused-but-set-variable]
warning: variable 'type' set but not used [-Wunused-but-set-variable]Signed-off-by: Colin Ian King
Signed-off-by: Greg Kroah-Hartman
13 Jun, 2018
1 commit
-
The kzalloc() function has a 2-factor argument form, kcalloc(). This
patch replaces cases of:kzalloc(a * b, gfp)
with:
kcalloc(a * b, gfp)as well as handling cases of:
kzalloc(a * b * c, gfp)
with:
kzalloc(array3_size(a, b, c), gfp)
as it's slightly less ugly than:
kzalloc_array(array_size(a, b), c, gfp)
This does, however, attempt to ignore constant size factors like:
kzalloc(4 * 1024, gfp)
though any constants defined via macros get caught up in the conversion.
Any factors with a sizeof() of "unsigned char", "char", and "u8" were
dropped, since they're redundant.The Coccinelle script used for this was:
// Fix redundant parens around sizeof().
@@
type TYPE;
expression THING, E;
@@(
kzalloc(
- (sizeof(TYPE)) * E
+ sizeof(TYPE) * E
, ...)
|
kzalloc(
- (sizeof(THING)) * E
+ sizeof(THING) * E
, ...)
)// Drop single-byte sizes and redundant parens.
@@
expression COUNT;
typedef u8;
typedef __u8;
@@(
kzalloc(
- sizeof(u8) * (COUNT)
+ COUNT
, ...)
|
kzalloc(
- sizeof(__u8) * (COUNT)
+ COUNT
, ...)
|
kzalloc(
- sizeof(char) * (COUNT)
+ COUNT
, ...)
|
kzalloc(
- sizeof(unsigned char) * (COUNT)
+ COUNT
, ...)
|
kzalloc(
- sizeof(u8) * COUNT
+ COUNT
, ...)
|
kzalloc(
- sizeof(__u8) * COUNT
+ COUNT
, ...)
|
kzalloc(
- sizeof(char) * COUNT
+ COUNT
, ...)
|
kzalloc(
- sizeof(unsigned char) * COUNT
+ COUNT
, ...)
)// 2-factor product with sizeof(type/expression) and identifier or constant.
@@
type TYPE;
expression THING;
identifier COUNT_ID;
constant COUNT_CONST;
@@(
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * (COUNT_ID)
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * COUNT_ID
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * (COUNT_CONST)
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * COUNT_CONST
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * (COUNT_ID)
+ COUNT_ID, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * COUNT_ID
+ COUNT_ID, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * (COUNT_CONST)
+ COUNT_CONST, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * COUNT_CONST
+ COUNT_CONST, sizeof(THING)
, ...)
)// 2-factor product, only identifiers.
@@
identifier SIZE, COUNT;
@@- kzalloc
+ kcalloc
(
- SIZE * COUNT
+ COUNT, SIZE
, ...)// 3-factor product with 1 sizeof(type) or sizeof(expression), with
// redundant parens removed.
@@
expression THING;
identifier STRIDE, COUNT;
type TYPE;
@@(
kzalloc(
- sizeof(TYPE) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kzalloc(
- sizeof(TYPE) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kzalloc(
- sizeof(TYPE) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kzalloc(
- sizeof(TYPE) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kzalloc(
- sizeof(THING) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kzalloc(
- sizeof(THING) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kzalloc(
- sizeof(THING) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kzalloc(
- sizeof(THING) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
)// 3-factor product with 2 sizeof(variable), with redundant parens removed.
@@
expression THING1, THING2;
identifier COUNT;
type TYPE1, TYPE2;
@@(
kzalloc(
- sizeof(TYPE1) * sizeof(TYPE2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kzalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kzalloc(
- sizeof(THING1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kzalloc(
- sizeof(THING1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kzalloc(
- sizeof(TYPE1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
|
kzalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
)// 3-factor product, only identifiers, with redundant parens removed.
@@
identifier STRIDE, SIZE, COUNT;
@@(
kzalloc(
- (COUNT) * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- COUNT * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- COUNT * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- (COUNT) * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- COUNT * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- (COUNT) * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- (COUNT) * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kzalloc(
- COUNT * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
)// Any remaining multi-factor products, first at least 3-factor products,
// when they're not all constants...
@@
expression E1, E2, E3;
constant C1, C2, C3;
@@(
kzalloc(C1 * C2 * C3, ...)
|
kzalloc(
- (E1) * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
|
kzalloc(
- (E1) * (E2) * E3
+ array3_size(E1, E2, E3)
, ...)
|
kzalloc(
- (E1) * (E2) * (E3)
+ array3_size(E1, E2, E3)
, ...)
|
kzalloc(
- E1 * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
)// And then all remaining 2 factors products when they're not all constants,
// keeping sizeof() as the second factor argument.
@@
expression THING, E1, E2;
type TYPE;
constant C1, C2, C3;
@@(
kzalloc(sizeof(THING) * C2, ...)
|
kzalloc(sizeof(TYPE) * C2, ...)
|
kzalloc(C1 * C2 * C3, ...)
|
kzalloc(C1 * C2, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * (E2)
+ E2, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(TYPE) * E2
+ E2, sizeof(TYPE)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * (E2)
+ E2, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- sizeof(THING) * E2
+ E2, sizeof(THING)
, ...)
|
- kzalloc
+ kcalloc
(
- (E1) * E2
+ E1, E2
, ...)
|
- kzalloc
+ kcalloc
(
- (E1) * (E2)
+ E1, E2
, ...)
|
- kzalloc
+ kcalloc
(
- E1 * E2
+ E1, E2
, ...)
)Signed-off-by: Kees Cook
27 Mar, 2018
1 commit
-
Add a missing character in two words of these descriptions.
Signed-off-by: Markus Elfring
Acked-by: Frank Haverkamp
Signed-off-by: Jiri Kosina
19 Dec, 2017
3 commits
-
This is a clean-up patch, no functional changes intended.
It removes the unused parameter of type "struct ddcb_requ*" from
the functions genwqe_user_vmap() and genwqe_user_vunmap().Signed-off-by: Guilherme G. Piccoli
Signed-off-by: Greg Kroah-Hartman -
This is a clean-up patch, no functional changes intended.
It makes all defines uppercase, following a "tradition"
that helps to make code clearer.Signed-off-by: Guilherme G. Piccoli
Signed-off-by: Greg Kroah-Hartman -
This is a clean-up patch, no functional changes intended.
It removes an unused variable from do_execute_ddcb() and
also renames the function free_user_pages(), prepending
"genwqe" prefix in order to clarify the code.Signed-off-by: Guilherme G. Piccoli
Signed-off-by: Greg Kroah-Hartman
23 Oct, 2017
1 commit
-
Currently we assume userspace pages are always writable when doing
memory pinning. This is not true, specially since userspace applications
may allocate their memory the way they want, we have no control over it.
If a read-only page is set for pinning, currently the driver fails due
to get_user_pages_fast() refusing to map read-only pages as writable.This patch changes this behavior, by taking the permission flags of the
pages into account in both pinning/unpinning process, as well as in the
DMA data copy-back to userpace (which we shouldn't try to do blindly,
since it will fail in case of read-only-pages).Signed-off-by: Frank Haverkamp
Signed-off-by: Guilherme G. Piccoli
Signed-off-by: Greg Kroah-Hartman
02 Mar, 2017
1 commit
-
We are going to split out of , which
will have to be picked up from other headers and a couple of .c files.Create a trivial placeholder file that just
maps to to make this patch obviously correct and
bisectable.Include the new header in the files that are going to need it.
Acked-by: Linus Torvalds
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar
23 Feb, 2017
1 commit
-
Pull char/misc driver updates from Greg KH:
"Here is the big char/misc driver patchset for 4.11-rc1.Lots of different driver subsystems updated here: rework for the
hyperv subsystem to handle new platforms better, mei and w1 and extcon
driver updates, as well as a number of other "minor" driver updates.All of these have been in linux-next for a while with no reported
issues"* tag 'char-misc-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (169 commits)
goldfish: Sanitize the broken interrupt handler
x86/platform/goldfish: Prevent unconditional loading
vmbus: replace modulus operation with subtraction
vmbus: constify parameters where possible
vmbus: expose hv_begin/end_read
vmbus: remove conditional locking of vmbus_write
vmbus: add direct isr callback mode
vmbus: change to per channel tasklet
vmbus: put related per-cpu variable together
vmbus: callback is in softirq not workqueue
binder: Add support for file-descriptor arrays
binder: Add support for scatter-gather
binder: Add extra size to allocator
binder: Refactor binder_transact()
binder: Support multiple /dev instances
binder: Deal with contexts in debugfs
binder: Support multiple context managers
binder: Split flat_binder_object
auxdisplay: ht16k33: remove private workqueue
auxdisplay: ht16k33: rework input device initialization
...
14 Jan, 2017
1 commit
-
Since we need to change the implementation, stop exposing internals.
Provide kref_read() to read the current reference count; typically
used for debug messages.Kills two anti-patterns:
atomic_read(&kref->refcount)
kref->refcount.counterSigned-off-by: Peter Zijlstra (Intel)
Cc: Andrew Morton
Cc: Greg Kroah-Hartman
Cc: Linus Torvalds
Cc: Paul E. McKenney
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar
11 Jan, 2017
1 commit
-
In AER recovery, pci_error_handlers.link_reset() is never called,
drop it now.Signed-off-by: Cao jin
Signed-off-by: Greg Kroah-Hartman
31 Oct, 2016
1 commit
-
Simply the interrupt setup by using the new PCI layer helpers.
One odd thing about this driver is that it looks like it could request
multiple MSI vectors, but it will then only ever use a single one.Signed-off-by: Christoph Hellwig
Acked-by: Gabriel Krisman Bertazi
Acked-by: Frank Haverkamp =
Signed-off-by: Greg Kroah-Hartman
28 Oct, 2016
1 commit
-
When interrupting an application which was allocating DMAable
memory, it was possible, that the DMA memory was deallocated
twice, leading to the error symptoms below.Thanks to Gerald, who analyzed the problem and provided this
patch.I agree with his analysis of the problem: ddcb_cmd_fixups() ->
genwqe_alloc_sync_sgl() (fails in f/lpage, but sgl->sgl != NULL
and f/lpage maybe also != NULL) -> ddcb_cmd_cleanup() ->
genwqe_free_sync_sgl() (double free, because sgl->sgl != NULL and
f/lpage maybe also != NULL)In this scenario we would have exactly the kind of double free that
would explain the WARNING / Bad page state, and as expected it is
caused by broken error handling (cleanup).Using the Ubuntu git source, tag Ubuntu-4.4.0-33.52, he was able to reproduce
the "Bad page state" issue, and with the patch on top he could not reproduce
it any more.------------[ cut here ]------------
WARNING: at /build/linux-o03cxz/linux-4.4.0/arch/s390/include/asm/pci_dma.h:141
Modules linked in: qeth_l2 ghash_s390 prng aes_s390 des_s390 des_generic sha512_s390 sha256_s390 sha1_s390 sha_common genwqe_card qeth crc_itu_t qdio ccwgroup vmur dm_multipath dasd_eckd_mod dasd_mod
CPU: 2 PID: 3293 Comm: genwqe_gunzip Not tainted 4.4.0-33-generic #52-Ubuntu
task: 0000000032c7e270 ti: 00000000324e4000 task.ti: 00000000324e4000
Krnl PSW : 0404c00180000000 0000000000156346 (dma_update_cpu_trans+0x9e/0xa8)
R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3
Krnl GPRS: 00000000324e7bcd 0000000000c3c34a 0000000027628298 000000003215b400
0000000000000400 0000000000001fff 0000000000000400 0000000116853000
07000000324e7b1e 0000000000000001 0000000000000001 0000000000000001
0000000000001000 0000000116854000 0000000000156402 00000000324e7a38
Krnl Code: 000000000015633a: 95001000 cli 0(%r1),0
000000000015633e: a774ffc3 brc 7,1562c4
#0000000000156342: a7f40001 brc 15,156344
>0000000000156346: 92011000 mvi 0(%r1),1
000000000015634a: a7f4ffbd brc 15,1562c4
000000000015634e: 0707 bcr 0,%r7
0000000000156350: c00400000000 brcl 0,156350
0000000000156356: eb7ff0500024 stmg %r7,%r15,80(%r15)
Call Trace:
([] dma_update_trans+0x90/0x228)
[] s390_dma_unmap_pages+0x64/0x160
[] s390_dma_free+0x62/0x98
[] __genwqe_free_consistent+0x56/0x70 [genwqe_card]
[] genwqe_free_sync_sgl+0xf8/0x160 [genwqe_card]
[] ddcb_cmd_cleanup+0x86/0xa8 [genwqe_card]
[] do_execute_ddcb+0x110/0x348 [genwqe_card]
[] genwqe_ioctl+0x51c/0xc20 [genwqe_card]
[] do_vfs_ioctl+0x3b2/0x518
[] SyS_ioctl+0xa4/0xb8
[] system_call+0xd6/0x264
[] 0x3ff9e8e520a
Last Breaking-Event-Address:
[] dma_update_cpu_trans+0x9a/0xa8
---[ end trace 35996336235145c8 ]---
BUG: Bad page state in process jbd2/dasdb1-8 pfn:3215b
page:000003d100c856c0 count:-1 mapcount:0 mapping: (null) index:0x0
flags: 0x3fffc0000000000()
page dumped because: nonzero _countSigned-off-by: Gerald Schaefer
Signed-off-by: Frank Haverkamp
Cc: stable
Signed-off-by: Greg Kroah-Hartman
27 Sep, 2016
1 commit
-
Genwqe uses dma_alloc_coherent and depends on zero initialized memory. On
one occasion it ueses an explicit memset on others it uses un-initialized
memory.This bug was covered because some archs actually return zero initialized
memory when using dma_alloc_coherent but this is by no means guaranteed.
Simply switch to dma_zalloc_coherent.Signed-off-by: Sebastian Ott
Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman
31 Aug, 2016
1 commit
-
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
Reviewed-by: Gabriel Krisman Bertazi
Signed-off-by: Greg Kroah-Hartman
22 Jun, 2016
1 commit
-
Now that we do have pci_request_mem_regions() and pci_release_mem_regions()
at hand, use it in the genwqe driver.[bhelgaas: fix build issues]
Suggested-by: Christoph Hellwig
Signed-off-by: Johannes Thumshirn
Signed-off-by: Bjorn Helgaas
Reviewed-by: Christoph Hellwig
CC: Frank Haverkamp
CC: Greg Kroah-Hartman
09 Feb, 2016
1 commit
-
Use kobj_to_dev() instead of open-coding it.
Signed-off-by: Geliang Tang
Signed-off-by: Greg Kroah-Hartman
04 Oct, 2015
2 commits
-
Just fix a typo in the code comment.
Signed-off-by: Geliang Tang
Signed-off-by: Greg Kroah-Hartman -
we received reports of failed allocations in genwqe code:
[ 733.550955] genwqe_gzip: page allocation failure: order:1, mode:0x20
[ 733.550964] CPU: 2 PID: 1846 Comm: genwqe_gzip Not tainted 4.3.0-rc3-00042-g3225031 #78
[ 733.550968] 000000002782b830 000000002782b8c0 0000000000000002 0000000000000000
000000002782b960 000000002782b8d8 000000002782b8d8 00000000001134a0
0000000000000000 0000000000892b2a 0000000000871d0a 000000000000000b
000000002782b920 000000002782b8c0 0000000000000000 0000000000000000
0000000000000000 00000000001134a0 000000002782b8c0 000000002782b920
[ 733.551003] Call Trace:
[ 733.551013] ([] show_trace+0xf8/0x158)
[ 733.551018] [] show_stack+0x6a/0xe8
[ 733.551024] [] dump_stack+0x7c/0xd8
[ 733.551031] [] warn_alloc_failed+0xda/0x150
[ 733.551036] [] __alloc_pages_nodemask+0x94e/0xbc0
[ 733.551041] [] s390_dma_alloc+0x70/0x1a0
[ 733.551054] [] __genwqe_alloc_consistent+0x84/0xd0 [genwqe_card]
[ 733.551063] [] genwqe_alloc_sync_sgl+0x13a/0x328 [genwqe_card]
[ 733.551066] [] do_execute_ddcb+0x1f8/0x388 [genwqe_card]
[ 733.551069] [] genwqe_ioctl+0x598/0xd50 [genwqe_card]
[ 733.551072] [] do_vfs_ioctl+0x3f4/0x590
[ 733.551074] [] SyS_ioctl+0x9e/0xb0
[ 733.551078] [] system_call+0xd6/0x258
[ 733.551080] [] 0x3fffd25819a
[ 733.551082] no locks held by genwqe_gzip/1846.This specific allocation and some others in genwqe are unnecessary flagged
as atomic.All of genwqe's atomic allocations happen in a context where it's allowed
to sleep. Change these to use GFP_KERNEL.Signed-off-by: Sebastian Ott
Acked-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman
11 Sep, 2015
1 commit
-
With two exceptions (drm/qxl and drm/radeon) all vm_operations_struct
structs should be constant.Signed-off-by: Kirill A. Shutemov
Reviewed-by: Oleg Nesterov
Cc: "H. Peter Anvin"
Cc: Andy Lutomirski
Cc: Dave Hansen
Cc: Ingo Molnar
Cc: Minchan Kim
Cc: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Jan, 2015
1 commit
-
Based on versioncheck.
Signed-off-by: Fabian Frederick
Signed-off-by: Greg Kroah-Hartman
15 Dec, 2014
1 commit
-
Pull char/misc driver updates from Greg KH:
"Here's the big char/misc driver update for 3.19-rc1Lots of little things all over the place in different drivers, and a
new subsystem, "coresight" has been added. Full details are in the
shortlog"* tag 'char-misc-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (73 commits)
parport: parport_pc, do not remove parent devices early
spmi: Remove shutdown/suspend/resume kernel-doc
carma-fpga-program: drop videobuf dependency
carma-fpga: drop videobuf dependency
carma-fpga-program.c: fix compile errors
i8k: Fix temperature bug handling in i8k_get_temp()
cxl: Name interrupts in /proc/interrupt
CXL: Return error to PSL if IRQ demultiplexing fails & print clearer warning
coresight-replicator: remove .owner field for driver
coresight: fixed comments in coresight.h
coresight: fix typo in comment in coresight-priv.h
coresight: bindings for coresight drivers
coresight: Adding ABI documentation
w1: support auto-load of w1_bq27000 module.
w1: avoid potential u16 overflow
cn: verify msg->len before making callback
mei: export fw status registers through sysfs
mei: read and print all six FW status registers
mei: txe: add cherrytrail device id
mei: kill cached host and me csr values
...
20 Nov, 2014
1 commit
-
Signed-off-by: Al Viro
08 Nov, 2014
1 commit
-
`genwqe_user_vmap()` calls `get_user_pages_fast()` and if the return
value is less than the number of pages requested, it frees the pages and
returns an error (`-EFAULT`). However, it fails to consider a negative
error return value from `get_user_pages_fast()`. In that case, the test
`if (rc < m->nr_pages)` will be false (due to promotion of `rc` to a
large `unsigned int`) and the code will continue on to call
`genwqe_map_pages()` with an invalid list of page pointers. Fix it by
bailing out if `get_user_pages_fast()` returns a negative error value.Signed-off-by: Ian Abbott
Cc: # 3.14.x # 3.15.x # 3.16.x # 3.17.x
Signed-off-by: Greg Kroah-Hartman
24 Sep, 2014
8 commits
-
When the GenWQE hardware queue was busy, the driver returned simply
-EBUSY. This caused polling by applications which increased the load
on the already busy system. This change implements the possiblity to
sleep on a waitqueue instead when the DDCB queue is busy. The
requestor is woken up when there is free space on the queue again.
The old way to get -EBUSY is still available if the device is openend
with O_NONBLOCKING. The default is now blocking behavior.Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
This patch fixes a problem we found during debug on PPC64 when
reading HSI status and Retc.Signed-off-by: Eberhard S. Amann
Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
The checkpatch.pl script got improved. I ran it on the latest GenWQE
sources and fixed what it complained about.Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
Forgetting to check this, can lead to problems on systems which
do not support SRIOV.Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
Follow up patch to the one from Sebastian Ott. There is no need to
change the return code once it fails. And Sebastians version is tested
now and works nicely on our test-system.Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
Updated email address of co-author.
Signed-off-by: Frank Haverkamp
Signed-off-by: Michael Jung
Signed-off-by: Greg Kroah-Hartman -
A special sysfs entry to display the driver version is not
needed. We left the driver version and adjusted it to the
naming a lot of other drivers use. The information can be
retrieved by using modinfo genwqe_card.modinfo genwqe_card will provide the same information.
Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
Currently the driver is using the pci_get_totalvfs() return code
directly in a loop. To avoid problems with potentially negative
returns in case of errors, we are adding some more sanity checking
code.Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman
19 Jul, 2014
1 commit
-
Removes DEFINE_PCI_DEVICE_TABLE from drivers/misc/genwqe/card_base.c,
drivers/misc/genwqe/card_base.c, and drivers/misc/vmw_vmci/vmci_guest.c
in preferance of a "real" structure definition.Signed-off-by: Greg Kroah-Hartman
11 Jul, 2014
1 commit
-
The include for the UAPI header file from card_base.c can be removed
since it's already included on card_base.h.Signed-off-by: Kleber Sacilotto de Souza
Signed-off-by: Greg Kroah-Hartman
10 Jul, 2014
5 commits
-
GenWQE used to call pci_enable_msi_block to allocate a desired number
of MSI's. If that was not possible pci_enable_msi_block returned with a
smaller number which might be possible to allocate. GenWQE then called
pci_enable_msi_block with that number.Since commit a30d0108b
"GenWQE: Use pci_enable_msi_exact() instead of pci_enable_msi_block()"
pci_enable_msi_exact is used which fails if the desired number of MSI's
was not possible to allocate. Change GenWQE to use pci_enable_msi_range
to restore the old behavior.Signed-off-by: Sebastian Ott
Reviewed-by: Alexander Gordeev
Signed-off-by: Greg Kroah-Hartman -
Increase genwqe driver version number.
Signed-off-by: Kleber Sacilotto de Souza
Acked-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
Currently, in the event of a fatal hardware error, the driver tries a
recovery procedure that calls pci_reset_function() to reset the card.
This is not sufficient in some cases, needing a fundamental reset to
bring the card back.This patch implements a call to the platform fundamental reset procedure
on the error recovery path if GENWQE_PLATFORM_ERROR_RECOVERY is enabled.
This is implemented by default only on PPC64, since this can cause
problems on other archs, e.g. zSeries, where the platform has its own
recovery procedures, leading to a potencial race conditition. For these
cases, the recovery is kept as it was before.Signed-off-by: Kleber Sacilotto de Souza
Acked-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
This patch implements the callbacks and functions necessary to have EEH
recovery support.It adds a config option to enable or disable explicit calls to trigger
platform specific mechanisms on error recovery paths. This option is
enabled by default only on PPC64 systems and can be overritten via
debugfs. If this option is enabled, on the error recovery path the
driver will call pci_channel_offline() to check for error condition and
issue non-raw MMIO reads to trigger early EEH detection in case of
hardware failures. This is necessary since the driver MMIO helper
funtions use raw accessors.Signed-off-by: Kleber Sacilotto de Souza
Acked-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
This patch adds an interface on sysfs for userspace to request a card
bitstream reload. It sets the appropriate register and try to perform a
fundamental reset on the PCIe slot for the card to reload the bitstream
from the chosen partition.Signed-off-by: Kleber Sacilotto de Souza
Acked-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman