11 Mar, 2014
1 commit
-
GFP_THISNODE is for callers that implement their own clever fallback to
remote nodes. It restricts the allocation to the specified node and
does not invoke reclaim, assuming that the caller will take care of it
when the fallback fails, e.g. through a subsequent allocation request
without GFP_THISNODE set.However, many current GFP_THISNODE users only want the node exclusive
aspect of the flag, without actually implementing their own fallback or
triggering reclaim if necessary. This results in things like page
migration failing prematurely even when there is easily reclaimable
memory available, unless kswapd happens to be running already or a
concurrent allocation attempt triggers the necessary reclaim.Convert all callsites that don't implement their own fallback strategy
to __GFP_THISNODE. This restricts the allocation a single node too, but
at the same time allows the allocator to enter the slowpath, wake
kswapd, and invoke direct reclaim if necessary, to make the allocation
happen when memory is full.Signed-off-by: Johannes Weiner
Acked-by: Rik van Riel
Cc: Jan Stancek
Cc: Mel Gorman
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
19 Feb, 2014
1 commit
-
In mei_cl_read_start(), if it fails to send flow control request, it
will release "cl->read_cb" but forget to set pointer to NULL, leaving
"cl->read_cb" still pointing to random memory, next time this client is
operated like mei_release(), it has chance to refer to this wrong pointer.Fixes: PANIC at kfree in mei_release()
[228781.826904] Call Trace:
[228781.829737] [] ? mei_cl_unlink+0x48/0xa0
[228781.835283] [] mei_io_cb_free+0x17/0x30
[228781.840733] [] mei_release+0xa8/0x180
[228781.845989] [] ? __fsnotify_parent+0xa0/0xf0
[228781.851925] [] __fput+0xd9/0x200
[228781.856696] [] ____fput+0xd/0x10
[228781.861467] [] task_work_run+0x81/0xb0
[228781.866821] [] do_exit+0x283/0xa00
[228781.871786] [] ? kprobe_flush_task+0x66/0xc0
[228781.877722] [] ? __dequeue_signal+0x18/0x1a0
[228781.883657] [] ? dequeue_signal+0x32/0x190
[228781.889397] [] do_group_exit+0x34/0xa0
[228781.894750] [] get_signal_to_deliver+0x206/0x610
[228781.901075] [] do_signal+0x38/0x100
[228781.906136] [] ? mei_read+0x42c/0x4e0
[228781.911393] [] ? wake_up_bit+0x30/0x30
[228781.916745] [] ? mei_poll+0x120/0x120
[228781.922001] [] ? vfs_read+0x89/0x160
[228781.927158] [] ? mei_poll+0x120/0x120
[228781.932414] [] ? fget_light+0x44/0xe0
[228781.937670] [] ? SyS_read+0x68/0x80
[228781.942730] [] do_notify_resume+0x55/0x70
[228781.948376] [] work_notifysig+0x29/0x30
[228781.953827] [] ? bad_area+0x5/0x3eCc: stable # 3.9+
Signed-off-by: Chao Bi
Signed-off-by: Tomas Winkler
Signed-off-by: Greg Kroah-Hartman
15 Feb, 2014
2 commits
-
Pull char/misc fixes from Greg KH:
"Here are some small char/misc driver fixes, along with some
documentation updates, for 3.14-rc3. Nothing major, just a number of
fixes for reported issues"* tag 'char-misc-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
Revert "misc: eeprom: sunxi: Add new compatibles"
Revert "ARM: sunxi: dt: Convert to the new SID compatibles"
misc: mic: fix possible signed underflow (undefined behavior) in userspace API
ARM: sunxi: dt: Convert to the new SID compatibles
misc: eeprom: sunxi: Add new compatibles
misc: genwqe: Fix potential memory leak when pinning memory
Documentation:Update Documentation/zh_CN/arm64/memory.txt
Documentation:Update Documentation/zh_CN/arm64/booting.txt
Documentation:Chinese translation of Documentation/arm64/tagged-pointers.txt
raw: set range for MAX_RAW_DEVS
raw: test against runtime value of max_raw_minors
Drivers: hv: vmbus: Don't timeout during the initial connection with host
Drivers: hv: vmbus: Specify the target CPU that should receive notification
VME: Correct read/write alignment algorithm
mei: don't unset read cb ptr on reset
mei: clear write cb from waiting list on reset -
This reverts commit f0de8e04a7201a2000f3c6d09732c11e7f35d42d, it is
incorrect, a future patch will fix this up properly.Cc: Maxime Ripard
Signed-off-by: Greg Kroah-Hartman
11 Feb, 2014
1 commit
-
I was reviewing this and noticed that unlocking should be conditional on
the error path. I've changed it to unlock and return directly since we
only do it once and it seems unlikely to change in the near future.Signed-off-by: Dan Carpenter
Acked-by: Dimitri Sivanich
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Feb, 2014
5 commits
-
iovcnt is declared as a signed integer in both the userspace API and
as a local variable in mic_virtio.c. The while() loop in mic_virtio.c
iterates until the local variable iovcnt reaches the value 0. If
userspace passes e.g. INT_MIN as iovcnt field, this loop then appears
to depend on an undefined behavior (signed underflow) to complete.
The fix is to use unsigned integers in both the userspace API and
the local variable.This issue was reported @ https://lkml.org/lkml/2014/1/10/10
Reported-by: Mathieu Desnoyers
Reviewed-by: Ashutosh Dixit
Signed-off-by: Sudeep Dutt
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
The Allwinner A10 compatibles were following a slightly different compatible
patterns than the rest of the SoCs for historical reasons. Add compatibles
matching the other pattern to the SID driver for consistency, and keep the
older one for backward compatibility.Signed-off-by: Maxime Ripard
Signed-off-by: Greg Kroah-Hartman -
Fix a memory leak in the genwqe_pin_mem() error path as called by
ioctl GENWQE_PIN_MEM. In case there is an error encountered when
mapping memory, the already allocated dma_mapping struct needs to
be freed correctly.Detected by Coverity: CID 1162606.
Signed-off-by: Christian Engelmayer
Acked-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
Don't set read callback to NULL during reset as
this leads to memory leak of both cb and its buffer.
The memory is correctly freed during mei_release.The memory leak is detectable by kmemleak if
application has open read call while system is going through
suspend/resume.unreferenced object 0xecead780 (size 64):
comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
hex dump (first 32 bytes):
00 01 10 00 00 02 20 00 00 bf 30 f1 00 00 00 00 ...... ...0.....
00 00 00 00 00 00 00 00 36 01 00 00 00 70 da e2 ........6....p..
backtrace:
[] kmemleak_alloc+0x3c/0xa0
[] kmem_cache_alloc_trace+0xc6/0x190
[] mei_io_cb_init+0x29/0x50
[] mei_cl_read_start+0x102/0x360
[] mei_read+0x103/0x4e0
[] vfs_read+0x89/0x160
[] SyS_read+0x4f/0x80
[] syscall_call+0x7/0xb
[] 0xffffffff
unreferenced object 0xe2da7000 (size 512):
comm "AsyncTask #1", pid 1018, jiffies 4294949621 (age 152.440s)
hex dump (first 32 bytes):
00 6c da e2 7c 00 00 00 00 00 00 00 c0 eb 0c 59 .l..|..........Y
1b 00 00 00 01 00 00 00 02 10 00 00 01 00 00 00 ................
backtrace:
[] kmemleak_alloc+0x3c/0xa0
[] __kmalloc+0xe7/0x1d0
[] mei_io_cb_alloc_resp_buf+0x2e/0x60
[] mei_cl_read_start+0x12c/0x360
[] mei_read+0x103/0x4e0
[] vfs_read+0x89/0x160
[] SyS_read+0x4f/0x80
[] syscall_call+0x7/0xb
[] 0xffffffffSigned-off-by: Alexander Usyskin
Signed-off-by: Tomas Winkler
Cc: stable
Signed-off-by: Greg Kroah-Hartman -
Clear write callbacks sitting in write_waiting list on reset.
Otherwise these callbacks are left dangling and cause memory leak.Signed-off-by: Alexander Usyskin
Signed-off-by: Tomas Winkler
Cc: stable
Signed-off-by: Greg Kroah-Hartman
30 Jan, 2014
2 commits
-
Pull hwmon updates from Jean Delvare:
"This include it87 driver improvements, and a tree-wide change of my
e-mail address"* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
Update Jean Delvare's e-mail address
hwmon: (it87) Print proper names for the IT8771E and IT8772E
hwmon: (it87) Add support for the ITE IT8603E -
Signed-off-by: Jean Delvare
23 Jan, 2014
1 commit
-
Pull trivial tree updates from Jiri Kosina:
"Usual rocket science stuff from trivial.git"* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
neighbour.h: fix comment
sched: Fix warning on make htmldocs caused by wait.h
slab: struct kmem_cache is protected by slab_mutex
doc: Fix typo in USB Gadget Documentation
of/Kconfig: Spelling s/one/once/
mkregtable: Fix sscanf handling
lp5523, lp8501: comment improvements
thermal: rcar: comment spelling
treewide: fix comments and printk msgs
IXP4xx: remove '1 &&' from a condition check in ixp4xx_restart()
Documentation: update /proc/uptime field description
Documentation: Fix size parameter for snprintf
arm: fix comment header and macro name
asm-generic: uaccess: Spelling s/a ny/any/
mtd: onenand: fix comment header
doc: driver-model/platform.txt: fix a typo
drivers: fix typo in DEVTMPFS_MOUNT Kconfig help text
doc: Fix typo (acces_process_vm -> access_process_vm)
treewide: Fix typos in printk
drivers/gpu/drm/qxl/Kconfig: reformat the help text
...
21 Jan, 2014
1 commit
-
Pull driver core / sysfs patches from Greg KH:
"Here's the big driver core and sysfs patch set for 3.14-rc1.There's a lot of work here moving sysfs logic out into a "kernfs" to
allow other subsystems to also have a virtual filesystem with the same
attributes of sysfs (handle device disconnect, dynamic creation /
removal as needed / unneeded, etc)This is primarily being done for the cgroups filesystem, but the goal
is to also move debugfs to it when it is ready, solving all of the
known issues in that filesystem as well. The code isn't completed
yet, but all should be stable now (there is a big section that was
reverted due to problems found when testing)There's also some other smaller fixes, and a driver core addition that
allows for a "collection" of objects, that the DRM people will be
using soon (it's in this tree to make merges after -rc1 easier)All of this has been in linux-next with no reported issues"
* tag 'driver-core-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (113 commits)
kernfs: associate a new kernfs_node with its parent on creation
kernfs: add struct dentry declaration in kernfs.h
kernfs: fix get_active failure handling in kernfs_seq_*()
Revert "kernfs: fix get_active failure handling in kernfs_seq_*()"
Revert "kernfs: replace kernfs_node->u.completion with kernfs_root->deactivate_waitq"
Revert "kernfs: remove KERNFS_ACTIVE_REF and add kernfs_lockdep()"
Revert "kernfs: remove KERNFS_REMOVED"
Revert "kernfs: restructure removal path to fix possible premature return"
Revert "kernfs: invoke kernfs_unmap_bin_file() directly from __kernfs_remove()"
Revert "kernfs: remove kernfs_addrm_cxt"
Revert "kernfs: make kernfs_get_active() block if the node is deactivated but not removed"
Revert "kernfs: implement kernfs_{de|re}activate[_self]()"
Revert "kernfs, sysfs, driver-core: implement kernfs_remove_self() and its wrappers"
Revert "pci: use device_remove_file_self() instead of device_schedule_callback()"
Revert "scsi: use device_remove_file_self() instead of device_schedule_callback()"
Revert "s390: use device_remove_file_self() instead of device_schedule_callback()"
Revert "sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()"
Revert "kernfs: remove unnecessary NULL check in __kernfs_remove()"
kernfs: remove unnecessary NULL check in __kernfs_remove()
drivers/base: provide an infrastructure for componentised subsystems
...
14 Jan, 2014
2 commits
-
give up reseting after 3 unsuccessful tries
Signed-off-by: Tomas Winkler
Signed-off-by: Alexander Usyskin
Signed-off-by: Greg Kroah-Hartman -
1. MEI_DEV_RESETTING device state spans only hardware reset flow
while starting dev state is saved into a local variable for further
reference, this let us to reduce big if statements in case we
are trying to avoid nested resets2. During initializations if the reset ended in MEI_DEV_DISABLED device
state we bail out with -ENODEV3. Remove redundant interrupts_enabled parameter as this
can be deduced from the starting dev_state4. mei_reset propagates error code to the caller
5. Add mei_restart function to wrap the pci resume
Signed-off-by: Tomas Winkler
Signed-off-by: Alexander Usyskin
Signed-off-by: Greg Kroah-Hartman
10 Jan, 2014
1 commit
-
When host capabilities check failed or when we were unable to register doorbell
bitmap we were forgetting to set error code and were returning 0 which would
make upper layers believe that probe was successful.Reported-by: Julia Lawall
Acked-by: Andy King
Signed-off-by: Dmitry Torokhov
Signed-off-by: Greg Kroah-Hartman
09 Jan, 2014
9 commits
-
Fix syntax errors in comments and debug strings
Signed-off-by: Alexander Usyskin
Signed-off-by: Tomas Winkler
Signed-off-by: Greg Kroah-Hartman -
nfc_nfc_free unlink clients from the device list
and has to be called under mei mutexSigned-off-by: Tomas Winkler
Reviewed-by: Alexander Usyskin
Signed-off-by: Greg Kroah-Hartman -
When reset is caused by hbm protocol mismatch or timeout
we might end up in an endless reset loop and hbm protocol
will never syncCc:
Signed-off-by: Tomas Winkler
Signed-off-by: Alexander Usyskin
Signed-off-by: Greg Kroah-Hartman -
This fixes a potential deadlock in case of a firmware
initiated resetmei_reset has a dialog with the interrupt thread hence
it has to be run from an another work itemMost of the mei_resets were called from mei_hbm_dispatch
which is called in interrupt thread context so this
function underwent major revamp. The error code is
propagated to the interrupt thread and if needed
the reset is scheduled from there.Signed-off-by: Tomas Winkler
Signed-off-by: Alexander Usyskin
Signed-off-by: Greg Kroah-Hartman -
In case of error, the function device_create_with_groups()
returns ERR_PTR() and never returns NULL. The NULL test in
the return value check should be replaced with IS_ERR().Signed-off-by: Wei Yongjun
Acked-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
dma_addr_t was not used, where it should have been used.
Some format strings were not optimal.Reported-by: kbuild test robot
Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
The header which contained the declaration for kcalloc() was not
inlcuded.Reported-by: kbuild test robot
Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
Instead of remaining bytes of a failing copy_to_user, the flash-update
ioctl is returning now -EFAULT. In addtion Dan discovered user triggerable
dev_errs(). Those I removed now from card_dev.c too. Some dev_infos()
were deleted and some others turned into dev_dbgs().Reported-by: Dan Carpenter
Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
interruptible_sleep_on_timeout is deprecated and going away soon.
The use in the sgi-xp driver leaves me puzzled, so I'd prefer not
to touch it. This patch replaces it with an open-coded prepare_to_wait
and finish_wait pair, which should be completely equivalent, so it
doesn't fix an existing race, but lets us get away with removing
the function so we can not get any new users.In order to remove the typical sleep_on race, one would have to
replace the call with wait_event_interruptible_timeout and add
a condition to wait for. The fact that there is a one-jiffy timeout
suggests that we don't actually expect to get woken up properly
and the caller just uses this as a short sleeping function
if it doesn't wake up properly.Signed-off-by: Arnd Bergmann
Cc: Cliff Whickman
Acked-by: Robin Holt
Signed-off-by: Greg Kroah-Hartman
07 Jan, 2014
1 commit
-
This patch fixed several typo in printk from various
part of kernel source.Signed-off-by: Masanari Iida
Signed-off-by: Jiri Kosina
25 Dec, 2013
1 commit
-
We want these fixes here to handle some merge issues.
Signed-off-by: Greg Kroah-Hartman
21 Dec, 2013
3 commits
-
Fix a casting to u32 where u64 would be appropriate.
The bad casting made the driver unusable.Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
As requested by Greg, replacing the hexdump function from dynamic_debug.h
with one defined in printk.h. I hope I picked the right one.Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman -
Fengguang Wu used CF=-D__CHECK_ENDIAN__ to check the GenWQE driver for
endian issues. Sparse found a couple of those. Most of them were caused
by not correctly handling __be64/32 and __u64/32. Those I was able to
fix with appropriate castings.One more serious issue was the ATS entry in struct genwqe_ddcb_cmd.
The kernel expected it in big-endian, but the type was defined __u64.
I decided that it is better to keep the interface consistent using
host endian byte-odering instead of having a mixture. With this change
the kernel likes to see host endian byte order for the ATS entry. That
would have been an interface change, if someone would have used the
driver already. Since this is not the case, I hope it is ok to fix it
now.For the genqwe_readq/writeq/readl/writel functions I enforced the casts.
It still complains, as far as I can see, about some copy_to/from_user()
usages:CHECK char-misc/drivers/misc/genwqe/card_dev.c
char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
char-misc/arch/x86/include/asm/uaccess.h:625:18: expected void *
char-misc/arch/x86/include/asm/uaccess.h:625:18: got void const *from
char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
char-misc/arch/x86/include/asm/uaccess.h:625:18: expected void *
char-misc/arch/x86/include/asm/uaccess.h:625:18: got void const *from
char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
char-misc/arch/x86/include/asm/uaccess.h:625:18: expected void *
char-misc/arch/x86/include/asm/uaccess.h:625:18: got void const *from
char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
char-misc/arch/x86/include/asm/uaccess.h:625:18: expected void *
char-misc/arch/x86/include/asm/uaccess.h:625:18: got void const *from
CC [M] drivers/misc/genwqe/card_dev.o
CHECK char-misc/drivers/misc/genwqe/card_ddcb.c
char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
char-misc/arch/x86/include/asm/uaccess.h:625:18: expected void *
char-misc/arch/x86/include/asm/uaccess.h:625:18: got void const *from
char-misc/arch/x86/include/asm/uaccess.h:625:18: warning: incorrect type in argument 1 (different modifiers)
char-misc/arch/x86/include/asm/uaccess.h:625:18: expected void *
char-misc/arch/x86/include/asm/uaccess.h:625:18: got void const *from
CC [M] drivers/misc/genwqe/card_ddcb.o
LD [M] drivers/misc/genwqe/genwqe_card.oI appreciate some help from you to figure out what is causig those, and
making a proposal how to fix them.I included the missing header file to fix the
implicit-function-declaration warning when using dynamic_hex_dump.Signed-off-by: Frank Haverkamp
Signed-off-by: Greg Kroah-Hartman
19 Dec, 2013
9 commits
-
Enable possiblity to configure and build this driver.
Signed-off-by: Frank Haverkamp
Co-authors: Joerg-Stephan Vogt ,
Michael Jung ,
Michael Ruettger
Signed-off-by: Greg Kroah-Hartman -
Sysfs interfaces for the GenWQE card. There are attributes to query
the version of the bitstream as well as some for the driver. For
debugging, please also see the debugfs interfaces of this driver.Signed-off-by: Frank Haverkamp
Co-authors: Joerg-Stephan Vogt ,
Michael Jung ,
Michael Ruettger
Signed-off-by: Greg Kroah-Hartman -
Debugfs interfaces for the GenWQE card. Help to debug potential
problems. Dump internal chip state for debugging and failure
determination.Signed-off-by: Frank Haverkamp
Co-authors: Joerg-Stephan Vogt ,
Michael Jung ,
Michael Ruettger
Signed-off-by: Greg Kroah-Hartman -
Miscelanous functionality used in the other GenWQE driver parts.
Signed-off-by: Frank Haverkamp
Co-authors: Joerg-Stephan Vogt ,
Michael Jung ,
Michael Ruettger
Signed-off-by: Greg Kroah-Hartman -
The GenWQE card itself provides access to a generic work queue into
which the work can be put, which should be executed, e.g. compression
or decompression request, or whatever the card was configured to do.Each request comes with a set of input data (ASV) and will produce some
output data (ASIV). The request will also contain a sequence number,
some timestamps and a command code/subcode plus some fields for hardware-/
software-interaction.A request can contain references to blocks of memory. Since the card
requires DMA-addresses of that memory, the driver provides two ways to
solve that task:
1) The drivers mmap() will allocate some DMAable memory for the user.
The driver has a lookup table such that the virtual userspace
address can properly be replaced and checked.
2) The user allocates memory and the driver will pin/unpin that
memory and setup a scatter gatherlist with matching DMA addresses.Currently work requests are synchronous.
Signed-off-by: Frank Haverkamp
Co-authors: Joerg-Stephan Vogt ,
Michael Jung ,
Michael Ruettger
Signed-off-by: Greg Kroah-Hartman -
Module initialization and PCIe setup. Card health monitoring and
recovery functionality. Character device creation and deletion are
controlled from here.Signed-off-by: Frank Haverkamp
Co-authors: Joerg-Stephan Vogt ,
Michael Jung ,
Michael Ruettger
Signed-off-by: Greg Kroah-Hartman -
This patch marks the function ad_dpot_add_files() and
ad_dpot_remove_files() as static in ad525x_dpot.c because they are not
used outside this file.Thus, it also eliminates the following warnings in ad525x_dpot.c:
drivers/misc/ad525x_dpot.c:644:5: warning: no previous prototype for ‘ad_dpot_add_files’ [-Wmissing-prototypes]
drivers/misc/ad525x_dpot.c:669:13: warning: no previous prototype for ‘ad_dpot_remove_files’ [-Wmissing-prototypes]Signed-off-by: Rashika Kheria
Reviewed-by: Josh Triplett
Acked-by: Michael Hennerich
Signed-off-by: Greg Kroah-Hartman -
This patch marks the function jp_generic_ide_ioctl() as static in
lkdtm.c because it is not used outside this file.Thus, it also eliminates the following warnings in lkdtm.c:
drivers/misc/lkdtm.c:227:5: warning: no previous prototype for ‘jp_generic_ide_ioctl’ [-Wmissing-prototypes]Signed-off-by: Rashika Kheria
Reviewed-by: Josh Triplett
Signed-off-by: Greg Kroah-Hartman -
ME device is 64bit DMA capable
We assume both coherent and consistent memory to matchSigned-off-by: Tomas Winkler
Signed-off-by: Greg Kroah-Hartman