Jinshan Xiong [Tue, 16 Aug 2016 20:18:58 +0000 (16:18 -0400)]
staging: lustre: llite: Fix the deadlock in balance_dirty_pages()
If the page is already dirtied in ll_write_end() and kernel tries
to call balance_dirty_pages() to write back dirty pages in the same
thread, this is deadlock case if the page is already held by clio.
This can also fix the issue of LU-4873.
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4977
Reviewed-on: http://review.whamcloud.com/10149 Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: lustre: Remove static declaration in anonymous union
It is not permitted in C++ to have a static declaration inside
of an anonymous union. The g++ compiler will complaine with an
error like this:
error: struct ost_id::<anonymous union>::ostid invalid; an
anonymous union can only have non-static data members [-fpermissive]
This patch changes the code to use an unnamed struct in place of
"struct ostid" inside of the anonymous union. That name declaration
was completely unnecessary anyway, since it was not used anywhere else.
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4987
Reviewed-on: http://review.whamcloud.com/10176 Reviewed-by: Robert Read <robert.read@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gregoire Pichon [Tue, 16 Aug 2016 20:18:56 +0000 (16:18 -0400)]
staging: lustre: llite: fix inconsistencies of root squash feature
Root squash exhibits inconsistent behaviour on a client when
enabled. If a file is not cached on the client, then root will get
a permission denied error when accessing the file. When
the file has recently been accessed by a regular user and is
still in cache, root will be able to access the file without error
because the permission check is only done by the client that
isn't aware of root squash.
While the only real security benefit from root squash is to deny
clients access to files owned by root itself, it also makes sense
to treat file access on the client in a consistent manner
regardless of whether the file is in cache or not.
This patch adds root squash settings to llite so that client is able
to apply root squashing when it is relevant.
Configuration of MDT root squash settings will automatically be
applied to llite config log as well.
Update cfs_str2num_check() routine by removing any modification
of the specified string parameter. Since string can come from ls_str
field of a lstr structure, this avoids inconsistent ls_len field.
John L. Hammond [Tue, 16 Aug 2016 20:18:55 +0000 (16:18 -0400)]
staging: lustre: llite: validate names
In ll_prep_md_op_data() validate names according to the same formula
used in mdd_name_check(). Add mdc_pack_name() to validate the name
actually packed in the request.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4992
Reviewed-on: http://review.whamcloud.com/10198 Reviewed-by: wangdi <di.wang@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wang di [Tue, 16 Aug 2016 20:18:54 +0000 (16:18 -0400)]
staging: lustre: lmv: separate master object with master stripe
Separate master stripe with master object, so
1. stripeEA only exists on master object.
2. sub-stripe object will be inserted into master object
as sub-directory, and it can get the master object by "..".
By this, it will remove those specilities for stripe0 in
LMV and LOD. And also simplify LFSCK, i.e. consistency check
would be easier.
When then master object becomes an orphan, we should
mark all of its sub-stripes as dead object as well,
otherwise client might still be able to create files
under these stripes.
A few fixes for striped directory layout lock:
1. stripe 0 should be locked as EX, same as other stripes.
2. Acquire the layout for directory, when it is being unliked.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4690
Reviewed-on: http://review.whamcloud.com/9511 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chris Horn [Tue, 16 Aug 2016 20:18:53 +0000 (16:18 -0400)]
staging: lustre: ptlrpc: Early replies need to honor at_max
When determining whether an early reply can be sent the server will
calculate the new deadline based on an offset from the request
arrival time. However, when actually setting the new deadline
the server offsets the current time. This can result in deadlines
being extended more than at_max seconds past the request arrival
time. Instead, the server should offset the arrival time when updating
its request timeout.
When a client receives an early reply it doesn't know the server side
arrival time so we use the original sent time as an approximation.
Signed-off-by: Chris Horn <hornc@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4578
Reviewed-on: http://review.whamcloud.com/9100 Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Christopher J. Morrone <chris.morrone.llnl@gmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wang di [Tue, 16 Aug 2016 20:18:52 +0000 (16:18 -0400)]
staging: lustre: llite: add error handler in inode prepare phase
Add error handler during inode inialization, so inode will
become bad inode if something bad happens during inode prepare
phase, otherwise the striped directory will not get its layout
and being mis-regarded as normal directory.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4930
Reviewed-on: http://review.whamcloud.com/10170 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John L. Hammond [Tue, 16 Aug 2016 20:18:51 +0000 (16:18 -0400)]
staging: lustre: move ioctls to lustre_ioctl.h
Move ioctl definitions and related functions from lustre_dlm.h,
lustre_lib.h, obd.h, to lustre_ioctl.h. Replace the definitions of
retired ioctls with comment.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4961
Reviewed-on: http://review.whamcloud.com/10139 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Robert Read <robert.read@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vitaly Fertman [Tue, 16 Aug 2016 20:18:50 +0000 (16:18 -0400)]
staging: lustre: ldlm: flock completion fixes.
Move checks for FAILED, DESTROYED flags under ldlm spinlock,
destroy flock atomically with the check it is not destroyed yet.
Do not put the granted flock into the resource if this is
UNLOCK, TEST, or DEADLOCK'ed flock.
Later a regression for this patch was reported under LU-7626.
The refcount nonzero (1) after lock cleanup errors was reported.
The reason is that the case LCK_NL was not handled for obdecho.
Patch 17791 resolved this issue which has been combined into
this upstream patch.
Fan Yong [Tue, 16 Aug 2016 20:18:49 +0000 (16:18 -0400)]
staging: lustre: reorder LOV_MAGIC_* definition
Since all the LOV_MAGIC_* definitions have the same
postfix values break that value out into its own
definition. With this we can check whether the magic's
postfix match the LOV_MAGIC_MAGIC or not: if yes,
then it is quite possible that the clients has
encountered an newer LOV magic. This extra information
can let us handle those cases more gracefully.
Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4941
Reviewed-on: http://review.whamcloud.com/10045 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jinshan Xiong [Tue, 16 Aug 2016 20:18:44 +0000 (16:18 -0400)]
staging: lustre: llite: avoid a deadlock in page write
For a partial page write, it will have to issue a READ RPC firstly
to get a full uptodate page. If another page is already locked by
this thread it can easily cause deadlock.
wang di [Tue, 16 Aug 2016 20:18:42 +0000 (16:18 -0400)]
staging: lustre: lmv: lookup remote migrating object in LMV
If remote object is being found in a migrating directory,
it should continue to lookup the object in remote MDT,
instead of return.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4805
Reviewed-on: http://review.whamcloud.com/9806 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John L. Hammond [Tue, 16 Aug 2016 20:18:41 +0000 (16:18 -0400)]
staging: lustre: lmv: access lum_stripe_offset as little endian
By the time that a struct lmv_user_md reaches lmv_placement_policy()
it has already been converted to little endian. Therefore use the
appropriate macros around accesses to this this field. This issue was
found by rewriting the definition of struct lmv_user_md to use the
__leXX typedefs and running sparse.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4738
Reviewed-on: http://review.whamcloud.com/9671 Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Swapnil Pimpale <spimpale@ddn.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In mdc_ioc_swap_layouts() cancel *any* unused locks with LAYOUT or
XATTR IBITS set on the two files. (This matches the locks acquired in
mdt_swap_layouts(). Previously only locks that conflicted with a CR
LAYOUT lock were cancelled.)
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4320
Reviewed-on: http://review.whamcloud.com/9329 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Faccini Bruno <bruno.faccini@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wang di [Tue, 16 Aug 2016 20:18:35 +0000 (16:18 -0400)]
staging: lustre: llite: a few fixes for migration.
1. Clear the client dentry cache before migrating file/directory
to the remote MDT.
2. Do not return stripe information to client, if it did not get
the layout lock.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4682
Reviewed-on: http://review.whamcloud.com/9522 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jinshan Xiong [Tue, 16 Aug 2016 20:18:34 +0000 (16:18 -0400)]
staging: lustre: osc: allow to call brw_commit() multiple times
Sometimes the rq_commit_cb of BRW RPC can be called twice if that RPC
has already committed at reply time. This will cause inaccuracy of
unstable pages accounting and then assertion.
Ryan Haasken [Tue, 16 Aug 2016 20:18:32 +0000 (16:18 -0400)]
staging: lustre: libcfs: Only dump log once per sec. to avoid EEXIST
Since the log file name contains the current time in seconds, dumping
the logs more than once per second causes EEXIST errors to be emitted.
Add a static variable to libcfs_debug_dumplog_internal that records
the time of the last Lustre log dump. If the current time in seconds
is equal to the last time, do not dump logs again.
Note that this is not thread-safe. However, in the rare case that two
threads try to access last_dump_time simultaneously, the worst thing
that could happen is that one of the threads will get an EEXIST error
when trying to write the log file. This is no worse than the current
situation, and it is not likely to happen.
Signed-off-by: Ryan Haasken <haasken@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4129
Reviewed-on: http://review.whamcloud.com/8964 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wang di [Tue, 16 Aug 2016 20:18:30 +0000 (16:18 -0400)]
staging: lustre: add ability to migrate inodes.
Add client support to migrate the individual inodes
from one MDT to another MDT, and this functionality
will only migrate inode layout on MDT but not touch
data object on OST.
The directory will be migrated from top to the bottom,
i.e. migrating parent first, then migrating the child.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2430
Reviewed-on: http://review.whamcloud.com/6662 Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fan Yong [Tue, 16 Aug 2016 20:18:29 +0000 (16:18 -0400)]
staging: lustre: obdclass: bug fixes for lu_device_type handling
There was no protection when inc/dec lu_device_type::ldt_device_nr,
which may caused the ldt_device_nr to be wrong and trigger assert.
This patch redefine lu_device_type::ldt_device_nr as atomic type.
There was no protection when add/del lu_device_type::ldt_linkage
into/from the global lu_device_types list, which may caused bad
address accessing. This patch uses the existing obd_types_lock
to protect related operations.
We do NOT need lu_types_stop() any longer. Such function scans
the global lu_device_types list, and for each type item on it
which has zerod lu_device_type::ldt_device_nr, call its stop()
method. In fact, the lu_device_type::ldt_device_nr only will be
zero when the last lu_device_fini() is called, and at that time,
inside the lu_device_fini(), its stop() method will be called.
So it is unnecessary to call the stop() again via lu_types_stop().
Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4604
Reviewed-on: http://review.whamcloud.com/8694 Reviewed-by: Jian Yu <jian.yu@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jian Yu [Tue, 16 Aug 2016 20:18:28 +0000 (16:18 -0400)]
staging: lustre: obdclass: fix lmd_parse() to handle comma-separated NIDs
This patch handles the upgrade situation that old mountdata already
contains comma-separated NIDs. The correct way to fix the original
issue is to parse comma-separated NIDs in lmd_parse().
wang di [Tue, 16 Aug 2016 20:18:27 +0000 (16:18 -0400)]
staging: lustre: delete striped directory
Add delete striped directory, it includes
1. enable sync log between MDTs, so slave objects will
be delete by unlink log, which is similar as deleting ost
object.
2. retrieve layout information of striped directory on MDT,
then lock all of the slave objects before unlink.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-on: http://review.whamcloud.com/7445 Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
Reviewed-on: http://review.whamcloud.com/7228 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wang di [Tue, 16 Aug 2016 20:18:25 +0000 (16:18 -0400)]
staging: lustre: create striped directory
1. client send create request to the master MDT, which
will allocate FIDs and create slaves. for all of slaves.
2. Client needs to revalidate slaves during intent getattr
and open request.
3. lmv_stripe_md will include attributes(size, nlink etc)
from all of stripe, which will be protected by UPDATE lock.
client needs to merge these attributes when update inode.
4. send create request to the MDT where the file is located,
which can help creating master stripe of striped directory.
Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3529
Reviewed-on: http://review.whamcloud.com/7196 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wang di [Tue, 16 Aug 2016 20:18:22 +0000 (16:18 -0400)]
staging: lustre: lmv: change handling of lmv striping information
The lmv_[un]pack_md function are used to calculate the
size of the data used to represent the LMV striping data.
The original code was straight forward in its calculate
with lmv_get_easize since only one type of data format
could exist. We want to be able to support different
version of this data in the future so this patch moves
to generating the size of the data using the stripe count
and which LMV_MAGIC_* version.
Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/7043
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wang di [Tue, 16 Aug 2016 20:18:19 +0000 (16:18 -0400)]
staging: lustre: mdc: don't take rpc lock for readdir case
If the operation is IT_READDIR don't need to handle the
mdc RPC lock.
Signed-off-by: wang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/10761
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4906 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The networking AIM does not use the *_irqsave and *_irqrestore flavored
spinlock functions. The rx_completion callback, however, can be called
from an interrupt context.
Christian Gromm [Thu, 18 Aug 2016 14:58:46 +0000 (16:58 +0200)]
staging: most: dim2-hdm: initialize DBR memory of synchronous channels
In the time after a synchronous DIM2 channel is enabled and before the
first buffer travels this channel, the DIM2 macro is babbling random
random data to the network.
This patch initializes the internal DBR memory of the DIM2 that is used
to transfer the synchronous data.
Tim Sell [Sat, 11 Jun 2016 01:48:26 +0000 (21:48 -0400)]
staging: unisys: visorinput: make lock_visor_dev a mutex
Since lock_visor_dev is a binary semaphore it makes more sense to
use a mutex lock.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ensure we properly lock between visorinput_channel_interrupt(),
visorinput_open(), and devdata_create(). We now guarantee that:
* interrupts will be disabled and remain disabled during device creation,
by setting 'paused = true' across device creation
* we canNOT get into visorinput_open() until the device structure is
totally initialized, by delaying the input_register_device() until the
end of device initialization
We also now ensure that lock_visor_dev is held across updates of devdata
state, to ensure state consistency.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Sat, 11 Jun 2016 01:48:24 +0000 (21:48 -0400)]
staging: unisys: Move vbushelper.h to visorbus directory
Only visorbus needs this header file so move it to visorbus
directory.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch ONLY touches comment lines, i.e., NO executable code is
affected.
Comments were fixed in visorbus_private.h:
* Minor typos were corrected.
* Useless comments were removed.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Sat, 11 Jun 2016 01:48:22 +0000 (21:48 -0400)]
staging: unisys: visorbus: Rename function to follow existing convention
Renames visorchipset_device_pause_response to device_pause_response,
thereby following the convention that other responder functions follow.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Sat, 11 Jun 2016 01:48:21 +0000 (21:48 -0400)]
staging: unisys: visorbus: Remove notifier-related code from visorbus
When this functionality was first implemented, visorchipset and visorbus
were separate drivers, which necessitated a registration mechanism for
them to communicate. More-recently, visorchipset and visorbus were
combined into a single driver, and now exist as separate source files
within the same driver, known as 'visorbus'. This eliminated the need
for a registration mechanism, but it has remained nevertheless until now.
For the sake of simplification, this registration mechanism is now being
removed.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Sat, 11 Jun 2016 01:48:19 +0000 (21:48 -0400)]
staging: unisys: visorbus: Move visorbus-unique functions to private header
Moves function prototypes that are unique to visorbus from
include/visorbus.h to visorbus/visorbus_private.h.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Sat, 11 Jun 2016 01:48:18 +0000 (21:48 -0400)]
staging: unisys: visorbus: Rectify commenting in visorchipset.c
Adds kerneldoc formatting to appropriate functions. Other multi-line
comments now use proper formatting.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch ONLY touches comment lines, i.e., NO executable code is
affected.
Comments were fixed in visorchannel.c:
* All functions worthy of documenting now use standard kerneldoc
formatting.
* Multi-line comments were tweaked so as to use appropriate conventions.
* Minor typos were corrected.
* Useless comments were removed.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: David Binder <david.binder@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Sat, 11 Jun 2016 01:48:16 +0000 (21:48 -0400)]
staging: unisys: visorbus: fix commenting in visorbus_main.c
This patch ONLY touches comment lines, i.e., NO executable code is
affected.
* All functions worthy of documenting now use standard kerneldoc
formatting.
* Improper uses of kerneldoc formatting were converted to standard
multi-line comments.
* Multi-line comments were tweaked so as to use appropriate conventions.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Sat, 11 Jun 2016 01:48:15 +0000 (21:48 -0400)]
staging: unisys: visorbus: fix commenting in vbusdevinfo.h
This patch ONLY touches comment lines, i.e., NO executable code is
affected.
* All functions worthy of documenting now use standard kerneldoc
formatting.
* Multi-line comments were tweaked so as to use appropriate conventions.
* Minor typos were corrected.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tim Sell [Sat, 11 Jun 2016 01:48:14 +0000 (21:48 -0400)]
staging: unisys: visorbus: remove unused parameter from function
The off parameter to visorchannel_create_guts() was never used, so it was
removed.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove visorbus_clear_channel, visorchannel_signalqueue_slots_avail,
visorchannel_signalqueue_max_slots, visorchannel_clear, and
visorchannel_debug which are no longer called by any driver.
Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The driver that is now visorbus started out as multiple separate drivers,
and when they were merged the EXPORT_SYMBOL statements that were required
for separate drivers were left in the code. This patch removes those now
unnecessary exports.
Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These files were made no-longer-necessary by recent commits.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tim Sell [Sat, 11 Jun 2016 01:48:08 +0000 (21:48 -0400)]
staging: unisys: visorbus: use kernel timer instead of workqueue
A kernel timer is now used as the vehicle to periodically call the
channel_interrupt function of registered visor drivers, instead of a
workqueue.
This simplifies a lot of things by making periodic_work.c and
periodic_work.h no longer necessary. This change also means that the
channel_interrupt() callbacks registered by visor drivers (via
visorbus_register_visor_driver()) will now be called in atomic context
(i.e., canNOT sleep) rather than kernel thread context (CAN sleep).
Fortunately this did NOT necessitate any change to the existing
channel_interrupt() callbacks, because none of them ever perform any
operations that would be invalid in atomic context.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Locking in the _interrupt() function is NOT necessary so long as we ensure
that interrupts have been stopped whenever we need to pause or resume the
device, which we now do.
While a device is paused, we ensure that interrupts stay disabled, i.e.
that the _interrupt() function will NOT be called, yet remember the desired
state in devdata->interrupts_enabled if open() or close() are called are
called while the device is paused. Then when the device is resumed, we
restore the actual state of interrupts (i.e., whether _interrupt() is going
to be called or not) to the desired state in devdata->interrupts_enabled.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
periodic_test_workqueue was an unused relic from the past, and was removed.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Sat, 11 Jun 2016 01:48:05 +0000 (21:48 -0400)]
staging: unisys: include: Remove thread-related enum members
Code relating to ktheads was previously removed from s-Par driver code.
This patch cleans up lingering remnants of kthreads by removing thread-
related enum types.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Sat, 11 Jun 2016 01:48:03 +0000 (21:48 -0400)]
staging: unisys: visorbus: modify format string to match argument
Modifies the format string of snprintf to expect an unsigned int
instead of a signed one, per the supplied argument.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Sat, 11 Jun 2016 01:48:02 +0000 (21:48 -0400)]
staging: unisys: visorbus: remove unused struct
Removes unused struct definition, channel_size_info, in response to
findings by SonarQube.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Removes unused module parameters from visorbus_main.c, in response to
findings by SonarQube.
Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch modifies the caller of parahotplug_request_complete()
to check the return value and return appropriate result.
Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Erik Arfvidson [Sat, 11 Jun 2016 01:47:59 +0000 (21:47 -0400)]
staging: unisys: visorbus: remove return values for write_vbus functions
This patch removes the return values from the write_vbus_* channel
functions. Nobody was checking the return values and the value stored
into the vbus info is not critical to the functioning of the device.
Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Acked-By: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Gromm [Mon, 27 Jun 2016 13:00:32 +0000 (15:00 +0200)]
staging: most: core: remove debug print
This patch removes the debug print in case an HDM ran out of rx buffers.
This is not needed since the status is reflected in the sysfs
channel_starving flag. Additionally, it prevents the system form slowing
down.
Christian Gromm [Mon, 13 Jun 2016 14:24:25 +0000 (16:24 +0200)]
staging: most: dim2-hdm: fix possible kernel freeze when reusing a dim2 channel
If a DIM2 channel is being closed while it is busy, the channels's status
flag could possibly stay active for this very channel. This causes the
kernel to freeze by the time the channel is opened again.
Christian Gromm [Mon, 13 Jun 2016 14:24:23 +0000 (16:24 +0200)]
staging: most: dim2-hdm: fix race condition when closing a channel
This patch fixes race between the function poison_channel that clears
the state is_initialized and the tasklet function dim2_tasklet_fn that
checks the state is_initialized.
The function aim_register_videodev() uses the variables 'ret' and
'retval' to represent the same value.
This patch removes 'retval' and replaces it with 'ret'. Further, it
replaces the constant return value '-ENODEV' with the result returned by
function video_register_device() in the event something went wrong.
Colin Ian King [Mon, 9 May 2016 22:22:14 +0000 (23:22 +0100)]
staging: speakup: ensure we do not overrun synths array
synth_add allows one to add MAXSYNTHS synths to the synths array;
however it always NULLifies the next synth in the array which
means that on the MAXSYNTHS synth we get an out-of-bounds write of
the NULL to the synths array. Make the synths array MAXSYNTHS + 1
elements in size to allow for the final NULL sentinal to avoid the
out-of-bounds write.
Issue found wit CoverityScan, CID#744671
Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>