J. German Rivera [Wed, 23 Sep 2015 21:11:02 +0000 (16:11 -0500)]
staging: fsl-mc: up-rev dpcon binary interface to v2.0
dpcon object minor version number updated to match latest
MC firmware. This change is needed because the dpcon
object binds to the allocator and the current driver match
logic uses object version numbers.
Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
J. German Rivera [Wed, 23 Sep 2015 21:11:01 +0000 (16:11 -0500)]
staging: fsl-mc: up-rev dpmcp binary interface to v2.0
Add cmd_flags parameter to all dpbp APIs to comply
with the dpmcp 2.0 MC interface. Updated version
major number. Pass irq args in struct instead of
separate args.
Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
J. German Rivera [Wed, 23 Sep 2015 21:11:00 +0000 (16:11 -0500)]
staging: fsl-mc: up-rev dpbp binary interface to v2.0
Add cmd_flags parameter to all dpbp APIs to comply
with the dpbp 2.0 MC interface. Updated MC version
major number. Pass irq args in struct instead of
separate args.
Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
J. German Rivera [Wed, 23 Sep 2015 21:10:58 +0000 (16:10 -0500)]
staging: fsl-mc: Add new flags field to MC command header
The Management Complex (MC) binary interface added a new "flags"
field to the command header.
Add the definitions for this field in preparation for adding the
new cmd_flags parameter to all MC interface APIs.
Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
We exit the above loop either if curroff >= (HFA384x_PDA_LEN_MAX / 2 - 1)
or if we found the END marker in the element beyond the current one. The
first case is checked for in the preceding if statement, therefore the
second if statement is redundant and can be removed.
staging: wlan-ng fix buffer overflow in firmware handling
We test for an END marker in the element beyond the current one, this
effectively limits the size of the array to be HFA384x_PDA_LEN_MAX/2 - 1
not HFA384x_PDR_END_OF_PDA/2. This patch fixes a possible buffer
overflow in case there was no END marker.
Mike Rapoport [Tue, 22 Sep 2015 07:52:16 +0000 (10:52 +0300)]
staging: sm750fb: sm750_help.h: spacing fix
Remove unnecessary space in sm750_help.h to fix the following
checkpatch.pl error:
drivers/staging/sm750fb/sm750_help.h:46: space prohibited after that '~' (ctx:ExW)
Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgap: fix returned errno code in dgap_parsefile()
The driver is using -1 instead of the -ENOMEM defined macro to specify
that a buffer allocation failed. Since the error number is propagated,
the caller will get a -EPERM which is the wrong error condition.
Also, the smatch tool complains with the following warning:
dgap_parsefile() warn: returning -1 instead of -ENOMEM is sloppy
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Thu, 24 Sep 2015 15:00:40 +0000 (11:00 -0400)]
staging: unisys: Add s-Par visorhba
This driver create a host bus adapter device when s-Par sends a
device create message to create a storage adapter on the visorbus.
When the message is received by visorbus, the visorhba_probe function
is called and the hba device is created and managed by the visorhba
driver.
Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging/lustre: partially use time64_t for capa expiry
Here, we actually have a problem in 2038 or at the latest in 2106 when
the lc_expiry variable on the wire protocol overflows, including on
64-bit architectures.
Now that the actual code was removed, only on-the wire structure
is left so we add in a y2038 warning to remind whoever gets to
implement it again about this problem.
staging/lustre: Remove mds/ost capabilities support
Client capabilities is an outdated feature that never worked properly,
so let's get rid of the client support since modern servers
don't have this support either.
The patch is big, but since it just removes one large feature,
so it's hopefully easy to verify.
These particular helpers are unused so let's get rid of them:
ldebugfs_add_symlink, lprocfs_rd_u64, lprocfs_rd_atomic,
lprocfs_wr_atomic, lprocfs_rd_name, lprocfs_seq_read_frac_helper
Most of the code in llog.c and llog_cat.c is completely unused
on the client and can be removed, as a preparation for removing
the dt_object code.
Two tricky parts are:
- In llog_cat_close(), we rely on the fact that llh_flags never
contains LLOG_F_ZAP_WHEN_EMPTY, because nobody ever sets that
flag.
- In llog_read_header(), we check the return value of the lpi_cb
callback, and again we know that it cannot be LLOG_PROC_BREAK
or LLOG_DEL_RECORD and can remove the respective code path.
This is only used on the server to keep track of alive clients
and feeds into ping evictor (that was removed from the client code).
Also remove struct obd's obd_exports_timed and
struct obd_export's exp_obd_chain_timed used to keep track of that
staging/lustre: remove unused time handling functions
A bunch of API functions deal with time values but are now
completely unused in lustre. This removes them in order to
remove all references to time_t from the header files.
staging/lustre: remove wrappers for timer functions
This is a simple cleanup that I did after noticing that the abstraction
for the timer functions in completely pointless, and the one user (ptlrpc)
can just as well call the native Linux functions.
For good measure, this also removes the empty libcfs_arch_init()
and libcfs_arch_cleanup() functions that are defined in the
same file.
staging/lustre: use 64-bit times for request times
All request timestamps and deadlines in lustre are recorded in time_t
and timeval units, which overflow in 2038 on 32-bit systems.
In this patch, I'm converting them to time64_t and timespec64,
respectively. Unfortunately, this makes a relatively large patch,
but I could not find an obvious way to split it up some more without
breaking atomicity of the change.
Also unfortunately, this introduces two instances of div_u64_rem()
in the request path, which can be slow on 32-bit architectures. This
can probably be avoided by a larger restructuring of the code, but
it is unlikely that lustre is used in performance critical setups
on 32-bit architectures, so it seems better to optimize for correctness
rather than speed here.
Here we use an unsigned long to store the timeout for gc,
which is probably safe until 2106, but this patch converts it
to use ktime_get_real_seconds() and time64_t for consistency.
staging/lustre: use 64-bit times for ptlrpc sec expiry
The exp_flvr_expire and imp_sec_expire are defined as 'unsigned long',
which doesn't overflow until 2106, but to be on the safe side, this
changes the code to use time64_t like we do everywhere else.
These three are timestamps that are sent over the wire in mdc_lib
and the obd logging 64-bit values, but are generated using the 32-bit
get_seconds() function, which will eventually overflow.
Changing them to use 64-bit ktime_get_real_seconds() solves the problem.
staging/lustre: use 64-bit times in another debug print
The ll_setattr_raw() function prints the new inode timestamps
along with the current time using '%lu', which overflows in
2106. This changes the printing of the current time for
now, the other two will change when we migrate the VFS code
to use 64-bit timestamps.
staging/lustre: use 64-bit times in ptlrpc_enc_page_pool
ptlrpc_enc_page_pool computes time deltas using 'long' values from
get_seconds(). This is probably safe beyond y2038, but it's better
to go use monotonic times and 64-bit here for consistency.
staging/lustre: use 64-bit llite debugfs timestamps
The llite debugfs interface contains timestamps that are computed
from timeval, which overflows in 2038 on 32-bit systems.
This changes the output to use a timespec64 type to avoid the
overflow. I also change the format to print the sub-second portion
as 9 digits (nanoseconds) for clarity, rather than printing six
digits without leading zeroes.
staging/lustre: use 64-bit timestamps for selftest
The wire protocol for the ping uses a 64-bit seconds/microseconds
pair, but this won't work when one side uses a 32-bit timeval
to look up the current time beyond 2038.
This changes the code to use ktime_get_real_ts64() to create
a timestamp that has the right format on all machines.
staging/lustre: use 64-bit computation in s2dhms()
The s2dhms computes the day/hour/minute/second values from a time_t,
which stops working in 2038. This changes the code to take a time64_t
argument, and use div_u64_rem() to implement the first division.
staging/lustre: use 64-bit times for cfs_srand seed
Several functions in Lustre call cfs_srand with do_gettimeofday
as the seed to get a pseudo-random number.
There is no bug here, but changing it to use ktime_get_ts64()
gets us closer to deprecating do_gettimeofday() and makes it slightly
more random.
Affected functions are:
lnet_shuffle_seed, init_lustre_lite and class_handle_init
staging/lustre: use 64-bit ibn_incarnation computation
ibn_incarnation is a 64-bit value, but using timeval to compute
it will cause an overflow in 2038. This changes it to use
ktime_get_real_ts64() instead.
staging/lustre: use jiffies_to_*() instead of cfs_duration_usec
The cfs_duration_usec() function has a timeval as its output, which we
want to avoid in general because of the y2038 problem.
There are only two locations remaining in lustre, so we can for now
replace one with jiffies_to_timeval(), which is a generic kernel function
that does the same thing, the other can just use jiffies_to_usecs()
and completely avoid the timeval.
This is not a full solution yet, but it's a small step that lets us
build a larger portion of lustre without this reference to timeval in
a header file, and avoid triggering automated checking tools that wants
to warn about timeval.
staging/lustre: use 'long' return type for cfs_duration_sec()
The cfs_duration_sec() converts a relative jiffies value into seconds,
and returns that number as a time_t. We know that a 32-bit type is
enough here, because the result is order of magnitudes smaller than
the difference in jiffies that is also expressed as a 'long', so
we can safely replace the time_t type with long as well.
The lnet_eq_wait_locked tries to wait for time to pass or an event to
wake up the wait queue. The entire logic seems to be a very elaborate
reimplementation of wait_event().
I'm not trying to clean up the entire logic here, but this at least
gets rid of the multi-way conversion between miliseconds, timeval
and jiffies.
The rq_at_index member of ptlrpc_request is incorrectly declared as
time_t, when it is only used as an index into an array, and assigned
from a __u32 variable.
This changes the type to u32, so we can kill off another use of time_t.
The l_last_activity struct member is used to keep track lock hold
times, and it is printed for debugging purposes. For the elapsed
time, we can use 'long' here, but it's better to use time64_t
for storing the real time to avoid an overflow in 2038.
which seems completely backwards, as the microsecond portion of
a time stamp will always fit into a __u32 value, while the second
portion will overflow in 2038 or 2106 (in case of unsigned seconds).
Changing this would unfortunately change the format in an incompatible
way, breaking all existing user space tools that access the data.
This uses ktime_get_real_ts64() to replace the insufficient
do_gettimeofday() and then truncates the seconds portion to
an u32 type, along with comments to explain the result.
A possible alternative would be the use of ktime_get_ts64() to
read a monotonic timestamp that never overflows, but this would
trigger a check in user space 'hdr->ph_sec < (1 << 30)' that
attempts to ensure that the values are within a reasonable range.
staging/lustre: use 64-bit inode timestamps internally
Lustre has 64-bit timestamps in its network data structures, but
on 32 bit systems, it converts them directly into time_t, which is
32 bit wide.
This changes the code to use 64-bit time stamps for files. The Linux
VFS code still uses time_t though, and will be changed in a separate
patch series.
staging/lustre: use jiffies for lp_last_query times
The recently introduced lnet_peer_set_alive() function uses
get_seconds() to read the current time into a shared variable,
but all other uses of that variable compare it to jiffies values.
This changes the current use to jiffies as well for consistency.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: af3fa7c71bf ("staging/lustre/lnet: peer aliveness status and NI status") Cc: Liang Zhen <liang.zhen@intel.com> Cc: James Simmons <uja.ornl@gmail.com> Cc: Isaac Huang <he.huang@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Please use a blank line after function/struct/union/enum declarations
FILE: drivers/staging/rdma/amso1100/c2_mq.c:158:
FILE: drivers/staging/rdma/hfi1/file_ops.c:2069:
FILE: drivers/staging/rdma/hfi1/sdma.c:744:
FILE: drivers/staging/rdma/hfi1/verbs.c:1202:
Fixes the following sparse warning:
drivers/staging/rdma/hfi1/device.c:127:12:
warning: symbol 'class_name_user' was not declared. Should it be static?
Nicolas Iooss [Sun, 20 Sep 2015 14:07:15 +0000 (16:07 +0200)]
staging/rdma/hfi1: do not use u8 to store a 32-bit integer
hfi1_rc_hdrerr() stores the result of be32_to_cpu() into opcode, which
is a local variable declared as u8. Later this variable is used in a
24-bit logical right shift, which makes clang complains (when building
an allmodconfig kernel with LLVMLinux patches):
drivers/staging/rdma/hfi1/rc.c:2399:9: warning: shift count >= width
of type [-Wshift-count-overflow]
opcode >>= 24;
^ ~~
All of this lead to the point that opcode may have been designed to be
a 32-bit integer instead of an 8-bit one. Therefore make this variable
u32.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>