Stuart Yoder [Tue, 23 Aug 2016 22:14:23 +0000 (17:14 -0500)]
staging: fsl-mc: make order of includes consistent
There are 3 kinds of headers included in the bus driver components--
misc linux/include files, public bus driver includes, and includes
private to the bus driver.
Cleanup the order and formatting of includes in the bus driver to be
consistent:
#include <linux/include/[file].h>
#include ../include/[file].h // public bus driver includes (eventually
// destined for: linux/include/fsl)
[blank line]
#include "[file].h" // private bus driver includes
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stuart Yoder [Tue, 23 Aug 2016 22:14:14 +0000 (17:14 -0500)]
staging: fsl-mc: split mc-io definitions into a separate file
An mc-io is a software abstraction of a dpmcp object (an MC portal).
Routines to create/initialize/reset this portal abstraction were split
between the allocator and mc-sys.c (MC command interface). Move
mc-io/portal related definitions into one source file.
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stuart Yoder [Tue, 23 Aug 2016 22:13:30 +0000 (17:13 -0500)]
staging: fsl-mc: create private include for fsl-mc bus components
The mc-bus.h header file is intended to be public for system related
drivers that may need to make fsl-mc bus specific calls-- gic its,
smmu, vfio. But, currently it contains definitions private/internal
to the fsl-mc bus itself. Split those definitions out into a new
fsl-mc bus private header.
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stuart Yoder [Tue, 23 Aug 2016 22:13:24 +0000 (17:13 -0500)]
staging: fsl-mc: move resource pool init/cleanup into allocator
The resource pool init/cleanup functions logically belong in the
allocator. Move them to the allocator and rename to reflect the
move out of the dprc-driver.
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stuart Yoder [Tue, 23 Aug 2016 22:13:12 +0000 (17:13 -0500)]
staging: fsl-mc: improve naming of source files
The mc- prefix on the source files names of some internal components
of the fsl-mc bus driver makes things less clear that they could be.
The string "mc" generally refers to hardware-- the physical DPAA
'management complex'. Names like "mc-allocator.c" have nothing to
with the "MC" hardware per se. Improve clarity by using the prefix
string "fsl-mc" instead which is what we are calling this bus.
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stuart Yoder [Tue, 23 Aug 2016 22:13:04 +0000 (17:13 -0500)]
staging: fsl-mc: rename mc-private.h to mc-bus.h
The definitions in mc-private.h are not strictly speaking
'private', they are bus-related definitions expected to be
referenced by bus driver components as well as system components
(gic, smmu, vfio). Rename mc-private.h to mc-bus.h to more
accurately reflect expected use.
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Julia Lawall [Wed, 31 Aug 2016 07:30:43 +0000 (09:30 +0200)]
staging: slicoss: constify ethtool_ops structures
Check for ethtool_ops structures that are only stored in the ethtool_ops
field of a net_device structure or passed as the second argument to
netdev_set_default_ethtool_ops. These contexts are declared const, so
ethtool_ops structures that have these properties can be declared as const
also.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
Claudiu Beznea [Fri, 26 Aug 2016 17:58:17 +0000 (20:58 +0300)]
Staging: wlan-ng: replace switch-case statements with macro
This patch removes multiple switch-case statements
with a new macro. The macro will generate the
corresponding bit mask based on the key index
received as input.
Claudiu Beznea [Tue, 23 Aug 2016 18:26:42 +0000 (21:26 +0300)]
Staging: wlan-ng: Improved case statements in p80211req_mibset_mibget()
This patch improves code from p80211req_mibset_mibget() function by
taking into account that every
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKeyX with
X in {0, 1, 2, 3} is a bit mask where the (P80211DID_MASK_ITEM <<
P80211DID_LSB_ITEM) mask aka 0x0x0003f000 mask keeps bits representing
the DID item number. To get this item number use P80211DID_ITEM().
Binoy Jayan [Mon, 22 Aug 2016 04:39:42 +0000 (10:09 +0530)]
rtl8712: pwrctrl_priv: Replace semaphore lock with mutex
The semaphore 'lock' in 'pwrctrl_priv' is used as a simple mutex, so it
should be written as one. Semaphores are going away in the future.
_enter_pwrlock was using down_interruptible(), so the lock could be broken
by sending a signal. This could be a bug, because nothing checks the return
code here. Hence, using mutex_lock instead of the interruptible version.
Removing the now unused _enter_pwrlock and _down_sema.
Check for ethtool_ops structures that are only stored in the ethtool_ops
field of a net_device structure or passed as the second argument to
netdev_set_default_ethtool_ops. These contexts are declared const, so
ethtool_ops structures that have these properties can be declared as const
also.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
Oleg Drokin [Thu, 25 Aug 2016 17:50:59 +0000 (13:50 -0400)]
staging/lustre: Fix max_dirty_mb output in sysfs
%ul definitely was supposed to be %lu in the format string,
so we print long unsigned int value, not just unsigned int
with a letter l added at the end.
Arnd Bergmann [Mon, 29 Aug 2016 12:20:01 +0000 (14:20 +0200)]
staging: lustre: hide unused variable
After a code cleanup, we get a harmless warning about a variable
that is unused when CONFIG_FS_POSIX_ACL is disabled:
drivers/staging/lustre/lustre/llite/xattr.c: In function 'll_xattr_get_common':
drivers/staging/lustre/lustre/llite/xattr.c:312:24: error: unused variable 'lli' [-Werror=unused-variable]
This puts the variable declaration into the same #ifdef.
Arnd Bergmann [Mon, 29 Aug 2016 12:20:00 +0000 (14:20 +0200)]
staging: lustre: fix unstable pages tracking
A patch to change to page accounting code (in v4.8-rc1) conflicts with
a change to lustre (in staging-next for v4.9), and fortunately gets
detected using a gcc warning:
In file included from /git/arm-soc/include/linux/mm.h:1001:0,
from /git/arm-soc/include/linux/highmem.h:7,
from /git/arm-soc/drivers/staging/lustre/lustre/osc/../../include/linux/libcfs/linux/libcfs.h:46,
from /git/arm-soc/drivers/staging/lustre/lustre/osc/../../include/linux/libcfs/libcfs.h:36,
from /git/arm-soc/drivers/staging/lustre/lustre/osc/osc_cl_internal.h:45,
from /git/arm-soc/drivers/staging/lustre/lustre/osc/osc_page.c:40:
drivers/staging/lustre/lustre/osc/osc_page.c: In function 'unstable_page_accounting':
include/linux/vmstat.h:117:2: error: array subscript is above array bounds [-Werror=array-bounds]
atomic_long_add(x, &vm_zone_stat[item]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:117:2: error: array subscript is above array bounds [-Werror=array-bounds]
atomic_long_add(x, &vm_zone_stat[item]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This changes the function to use the correct interface for accounting in the
"node" rather than the "zone".
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: d806f30e639b ("staging: lustre: osc: revise unstable pages accounting") Fixes: 11fb998986a7 ("mm: move most file-based accounting to the node") Reviewed-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Currently it is not possible to send LNet traffic between
two nodes using infiniband hardware that have different
page sizes for the case when RDMA fragments are used.
When two nodes establish a connection they tell the other
node the maximum number of RDMA fragments they support.
The issue is that the units are pages, and 256 64K pages
corresponds to 16MB of data, whereas a 4K page system is
limited to messages with 1MB of data. The solution is to
report over the wire the maximum number of fragments in
4K unites regardless of the native page size. The recipient
then uses its native page size to translate into the
maximum number of pages sized fragments it can send to
the other node.
staging/lustre/llite: changes to avoid cache corruption
ll_find_alias is responsible for getting alias for inode
which can be reused. Directories are assumed to have unique
alias, where in case of non-directories there can be multiple
aliases. In case of lustre there can be two type of aliases
i.e. discon_alias and invalid_alias. Usage of discon_alias in
case of non-directories may corrupt dcache and leads to kernel
crash. Changes made to avoid use of discon_alias in case of
non-directories.
staging/lustre: avoid clearing i_nlink for inodes in use
The patch removes find_cbdata callbacks and clear_nlink
from dentry_iput path, since this piece of code makes
a few races possible.
The test case reproduces one of the possible races
described in LU-7925:
1) two hard links are created for the same file
2) the test calls stat(2) for link #1
3) in the middle of 2) the test opens and closes link #2
4) in the middle of 2) the test drops the ldlm locks and
forces dentry reclaim via vm.drop_caches=2
5) in the middle of 2) ll_d_iput() clears i_nlink for
the inode
6) the initial stat(2) continues and copies the wrong
i_nlink value into st_nlink
Signed-off-by: Andrew Perepechko <andrew.perepechko@seagate.com>
Seagate-bug-id: MRP-3271
Reviewed-on: http://review.whamcloud.com/19164
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7925 Reviewed-by: Wally Wang <wang@cray.com> Reviewed-by: Lai Siyao <lai.siyao@intel.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alexander Boyko [Wed, 24 Aug 2016 15:11:52 +0000 (11:11 -0400)]
staging/lustre/mdc: fix panic at mdc_free_open()
Assertion was happened for open request when rq_replay is set
to 1.
ASSERTION(mod->mod_open_req->rq_replay == 0)
But this situation is not fatal for client, and could happened
when mdc_close() failed.
The fix allow to free such requests. If mdc_close fail, MDS doesn`t
receive close request from client. And in a worst case client would
be evicted.
The test recreates issue when mdc_close failed and
client asserts:
ASSERTION( mod->mod_open_req->rq_replay == 0 ) failed
Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com>
Seagate-bug-id: MRP-3156
Reviewed-on: http://review.whamcloud.com/17495
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5282 Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daeseok Youn [Mon, 22 Aug 2016 01:43:59 +0000 (10:43 +0900)]
staging: dgnc: check the type of print before calling
The dgnc_maxcps_room() function must be called only for print device.
The if-statement for checking print device checks before calling
dgnc_maxcps_room() and also this function doesn't need to have any
data except channel_t.
The function icn_writecmd() was used to copy from userspace and also
from the kernelspace. Add another argument to the function to have two
separate pointers, one for the userspace and one for the kernelspace.
Based on the value of user as passed from the caller we use one of
the two pointers.
Sudip Mukherjee [Mon, 22 Aug 2016 16:34:55 +0000 (22:04 +0530)]
staging: i4l: act2000: remove unused macro
The macro EVAL_PLCI and MAKE_PLCI are not being used. Remove them.
But keep the comment preceding them as it contains information
regarding message format.
Sudip Mukherjee [Mon, 22 Aug 2016 16:34:54 +0000 (22:04 +0530)]
staging: i4l: act2000: remove unused argument
The macro EVAL_NCCI was only being used in capi.c and the argument
controller was not used. Remove the argument and at the same time
remove the variable which now becomes unused.
Sudip Mukherjee [Tue, 23 Aug 2016 14:13:21 +0000 (19:43 +0530)]
staging: i4l: icn: use memdup_user
Its better to use memdup_user which does the same thing which this
code has implemented. Also removed a related warning as we will be
warned if allocation fails.