Power down device when an error occurs in order to avoid wasting
power. Move powerdown function up to be seen by the new call and
align parameters for the ltr501_write_contr() call.
Ioana Ciornei [Mon, 30 Mar 2015 23:29:35 +0000 (02:29 +0300)]
staging: dgnc_sysfs: Replace printk(KERN_ERR ) with pr_err()
Fix the following checkpatch warning:
WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
Staging: lustre: Mark internal functions static in llog_cat.c
This patch marks functions llog_cat_set_first_idx and cat_cancel_cb
static as these are used only within this file. Also since cat_cancel_cb
is made static do not export it.
This eliminates the following sparse warning:
warning: symbol * was not declared. Should it be static?
Staging: lustre: Include header for functions prototypes
This patch includes the header lustre/include/lclient.h that declares
the functions lov_lsm_put and lov_read_and_clear_async_rc defined in
lov_object.c.
This eliminates warnings reported by sparse:
warning: symbol was not declared. Should it be static?
Staging: lustre: Add function prototypes in console.h
Sparse reported the following warnings:
warning: symbol 'lstcon_console_init' was not declared. Should it be static?
warning: symbol 'lstcon_console_fini' was not declared. Should it be static?
warning: symbol 'lstcon_ioctl_entry' was not declared. Should it be static?
However since these functions are used in other files,
they cannot be made static, so add protoypes for the same in console.h.
Staging: rtl8712: Use memdup_user() instead of copy_from_user()
Use memdup_user() to avoid its duplicated implementation and simplify
code. memdup_user() uses GFP_KERNEL instead of GFP_ATOMIC,
which is valid because copy_from_user() might sleep and it's useless
to make the allocation atomic. Found with coccinelle.
Merge tag 'iio-for-4.1b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second set of new devices, functionality and cleanup for IIO in the 4.1 cycle.
New Functionality
* Watermark logic for buffers. Allows for blocking reads to block until
their requested amount is available - previously they only blocked until
a single scan of data was available. Also allows for polling for a
watermark amount of data to be available. This feature was first proposed
some time ago to good responses, but not taken further by the original author
Octavian has picked up the gauntlet and taken it through
to merging (along with the hardware fifo support that follows).
* New approach to hardware fifo handling - in particular handling the
interaction of a hardware fifo feeding into a software fifo and their
watershed events. We don't have every possible case well covered yet,
but this is certainly a good, flexible starting point. This will replace
the previous approach used in ancient drivers (sca3000) where we just
exposed the hardware buffer directly to userspace. Very few pieces of
hardware have sufficiently long buffers for that to be an adequate solution.
* bmc150_accel - hardware fifo support.
* mlx90614 - support dual IR sensor devices + some refactoring to clean up the
code and allow some other functionality currently under review.
* L3GD20H gyroscope support added to the st_gyro driver.
* lis3lv02d accelerometer added to the st_gyro driver. Note this part is
also supported by the older lis3 driver under misc. A lengthy discussion
took place and concluded that holding parts out on the basis that whole
driver would be subsumed into this one was counter productive. Better
to add part support and add additional features as people need them.
Basically there was not advantage in not merging the support.
* max517 driver gains support for MAX520 and MAX521 DACs.
Documentation
* 3.20 -> 4.0 renaming for recent docs. Whilst technically a fix, I think
people will cope until the next merge merge window.
* An ABI typo hat -> What: More ABIs should have hats.
* Document in_rot_offset, illuminance_raw and illuminance_scale.
Cleanups
* Fix a scale extraction bug in generic_buffer.c example.
* Constify a load of device tree related structures.
Octavian Purdila [Sun, 22 Mar 2015 18:33:40 +0000 (20:33 +0200)]
iio: bmc150_accel: add support for hardware fifo
We only advertise hardware fifo support if the I2C bus supports full
I2C or smbus I2C block data reads since it is mandatory to read the
full frame in one read (otherwise the rest of the frame is discarded).
The hardware fifo is enabled only when triggers are not active because:
(a) when using the any-motion trigger the user expects to see samples
based on ROC events, but the fifo stores samples based on the sample
frequency
(b) the data-ready trigger is waking the CPU for for every sample, so
using the hardware fifo does not have any benefit
Octavian Purdila [Sun, 22 Mar 2015 18:33:39 +0000 (20:33 +0200)]
iio: add support for hardware fifo
Some devices have hardware buffers that can store a number of samples
for later consumption. Hardware usually provides interrupts to notify
the processor when the FIFO is full or when it has reached a certain
watermark level. This helps with reducing the number of interrupts to
the host processor and thus it helps decreasing the power consumption.
This patch enables usage of hardware FIFOs for IIO devices in
conjunction with software device buffers. When the hardware FIFO is
enabled the samples are stored in the hardware FIFO. The samples are
later flushed to the device software buffer when the number of entries
in the hardware FIFO reaches the hardware watermark or when a flush
operation is triggered by the user when doing a non-blocking read
on an empty software device buffer.
In order to implement hardware FIFO support the device drivers must
implement the following new operations: setting and getting the
hardware FIFO watermark level, flushing the hardware FIFO to the
software device buffer. The device must also expose information about
the hardware FIFO such it's minimum and maximum watermark and if
necessary a list of supported watermark values. Finally, the device
driver must activate the hardware FIFO when the device buffer is
enabled, if the current device settings allows it.
The software device buffer watermark is passed by the IIO core to the
device driver as a hint for the hardware FIFO watermark. The device
driver can adjust this value to allow for hardware limitations (such
as capping it to the maximum hardware watermark or adjust it to a
value that is supported by the hardware). It can also disable the
hardware watermark (and implicitly the hardware FIFO) it this value is
below the minimum hardware watermark.
Since a driver may support hardware FIFO only when not in triggered
buffer mode (due to different semantics of hardware FIFO sampling and
triggered sampling) this patch changes the IIO core code to allow
falling back to non-triggered buffered mode if no trigger is enabled.
Currently the IIO buffer blocking read only wait until at least one
data element is available.
This patch makes the reader sleep until enough data is collected before
returning to userspace. This should limit the read() calls count when
trying to get data in batches.
When using generic_buffer to read data, the scale is not properly
detected for scale shared by type. This is caused by a problem
with the generation of generic name out of the full name.
E.g.: for current->name in_accel_z, the extracted generic name
is "in" (when it should be "in_accel"). This is used in generic_buffer
to generate scale and offset paths (in_accel_scale).
Consider the in_ or out_ prefix when extracting the generic name
from the full name.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: Add ABI documentation for illuminance raw and scale values in light
This patchset adds ABI documentation for the following attributes:
in_illuminance_scale, used atleast once in al3320a staging/iio/light/
in_illuminance_calibscale, used atleast once in cm32181
in_illuminance_input, used in cm3232 at least once
in_illuminance_raw used atleast once in al3320a
in_illuminance_clear_raw and in_illuminance_ir_raw exposed by
gp2ap020a00f with modifiers IIO_MOD_LIGHT_CLEAR and
IIO_MOD_LIGHT_IR respectively.
Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Helen Fornazier [Thu, 26 Mar 2015 17:09:15 +0000 (14:09 -0300)]
staging: sm750fb: Fix for statement style
This patch fixes the checkpatch.pl warnings:
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<=' (ctx:VxV)
ERROR: spaces required around that '>' (ctx:VxV)
ERROR: space required before the open parenthesis '('
ERROR: space required after that ';' (ctx:VxV)
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ERROR: that open brace { should be on the previous line
ERROR: else should follow close brace '}'
WARNING: braces {} are not necessary for single statement blocks
ERROR: space required before the open brace '{'
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sudip Mukherjee [Tue, 24 Mar 2015 15:17:28 +0000 (20:47 +0530)]
staging: unisys: use local variable in cleanup
the dev_t was being stored in visorchipset_platform_device.dev.devt
while initializing the module. so pass that value as an argument to
cleanup() so that it can use this local variable instead of the global
variable.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sudip Mukherjee [Tue, 24 Mar 2015 15:17:27 +0000 (20:47 +0530)]
staging: unisys: use local variable
we are getting dev_t as an argument in the function, so use the local
variable instead of the global variable "majordev".
this global variable will be removed in one of the next patch of the
series.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sudip Mukherjee [Tue, 24 Mar 2015 15:17:26 +0000 (20:47 +0530)]
staging: unisys: remove redundant variable
remove the variable "registered", which was used in the cleanup() to
detect if the driver has successfully initialized. the cleanup()
is called from module_exit, so its obvious that the module has
successfully initialized. if the initialization had failed, then
we will never be in the cleanup().
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Joe Perches [Wed, 25 Mar 2015 19:54:25 +0000 (12:54 -0700)]
staging: rts5208: Remove TRACE_RET and TRACE_GOTO macros
Remove these flow hiding macros.
Miscellanea:
o Add a macro and function to replace a large inline
o Simplify #includes
o Add trace.c and update Makefile
o Remove static inline filename function and use kbasename instead
This reduces object size quite a lot: ~350KB (x86-64 allyesconfig)
$ size drivers/staging/rts5208/built-in.o*
text data bss dec hex filename
248385 36728 77888 363001 589f9 drivers/staging/rts5208/built-in.o.new
506691 83352 115896 705939 ac593 drivers/staging/rts5208/built-in.o.old
Joe Perches [Tue, 24 Mar 2015 23:06:44 +0000 (16:06 -0700)]
staging: rtl8723au: Update RT_TRACE macro and uses
Create an rt_trace function using %pV to reduce overall code size.
Update the macro uses to remove unnecessary and now harmful parentheses.
Miscellanea around these changes:
o Coalesce formats
o Realign arguments
o Remove commented-out RT_TRACE uses
o Spelling fixes in formats
o Add missing newlines to formats
o Remove multiple newlines from formats
o Neaten formats where noticed
o Use %pM in one instance
Lorenzo Stoakes [Fri, 20 Mar 2015 15:22:14 +0000 (15:22 +0000)]
staging: sm750fb: Fix __iomem pointer types
This patch annotates pointers as referring to I/O mapped memory where they ought
to be, removes now unnecessary ugly casts, eliminates an incorrect deref on I/O
mapped memory by using iowrite16 instead, and updates the pointer arithmetic
accordingly to take into account that the pointers are now byte-sized. This
fixes the following sparse warnings:-
drivers/staging/sm750fb/sm750_cursor.c:113:19: warning: cast removes address space of expression
drivers/staging/sm750fb/sm750_cursor.c:204:19: warning: cast removes address space of expression
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lorenzo Stoakes [Fri, 20 Mar 2015 15:22:12 +0000 (15:22 +0000)]
staging: sm750fb: Make internal functions static
This patch declares externally unavailable functions static. This fixes
the following sparse warnings:-
drivers/staging/sm750fb/ddk750_hwi2c.c:63:6: warning: symbol 'hwI2CWaitTXDone' was not declared. Should it be static?
drivers/staging/sm750fb/ddk750_hwi2c.c:93:14: warning: symbol 'hwI2CWriteData' was not declared. Should it be static?
drivers/staging/sm750fb/ddk750_hwi2c.c:160:14: warning: symbol 'hwI2CReadData' was not declared. Should it be static?
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lorenzo Stoakes [Fri, 20 Mar 2015 15:22:11 +0000 (15:22 +0000)]
staging: sm750fb: Use memset_io instead of memset
This patch takes into account that cursor->vstart, crtc->vScreen and
share->pvMem are pointers to memory-mapped I/O and thus we should use memset_io
to make this explicit. In addition, some architectures require special treatment
of memory-mapped I/O so the previous code could actually break without this
change.
This fixes the following sparse warnings:-
drivers/staging/sm750fb/sm750.c:489:17: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:490:17: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:501:17: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:502:17: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:833:5: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/sm750fb/sm750.c:1154:9: warning: incorrect type in argument 1 (different address spaces)
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Niu Yawei [Thu, 26 Mar 2015 01:53:25 +0000 (21:53 -0400)]
staging/lustre: update timestamps after buiding rpc
The mtime/atime/ctime in the write RPC has to be updated after
the RPC is built (where xid is generated), otherwise, it could
race with the setattr and updating wrong timestamps on OST side.
Seems this regression was introduced when landing clio code.
Andriy Skulysh [Thu, 26 Mar 2015 02:07:07 +0000 (22:07 -0400)]
staging/lustre/ptlrpc: fix import state during replay
Client doesn't restore import state correctly
on reconnect during replay. It resends lock replay
when final ping was queued by server.
Server fails with "target_queue_recovery_request())
ASSERTION( req->rq_export->exp_lock_replay_needed ) failed"
Add imp_replay_state to store last replay state.
imp_state is restored from imp_replay_state
during reconnect.
Bobi Jam [Thu, 26 Mar 2015 01:53:21 +0000 (21:53 -0400)]
staging/lustre/mgc: detach MGC dev on error
lustre_start_mgc() creates MGC device, if error happens later on
ll_fill_super(), this device is still attached, and later mount
fails by keep complaining that the MGC device's already in the
client node.
It turns out that the device was referenced by mgc config llog data
which is arranged in the mgc lock requeue thread re-trying to get its
mgc lock, and in normal case, this llog reference only released in
mgc_blocking_ast() when the system is umount.
This patch make mgc_precleanup() to wake up requeue thread to handle
the config llog data.
This patch also makes mgc_setup() wait for mgc_requeue_thread() start
before moving on.
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Reviewed-on: http://review.whamcloud.com/11765
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4943 Reviewed-by: Ryan Haasken <haasken@cray.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Liang Zhen [Thu, 26 Mar 2015 01:53:19 +0000 (21:53 -0400)]
staging/lustre/ptlrpc: false alarm in AT network latency measuring
If early reply of client RPC is lost and client RPC is expired and
resent, server will drop the resent RPC because it's already in
processing, server may also send reply or early reply to client,
which can still match reply buffer of the original request.
In this case, client is measuring time from resent time, but server
is reporting service time of original RPC, which is longer than
the time measured by client.
staging/lustre/mdc: Handle empty but non-zero acl xattr
We have found that posix_acl_access can have a value
of \002\000\000\000. In that case body->aclsize is
non-zero, but the there are no actuall acls stored
in the xattr.
In mdc_unpack_acl(), it only checks IS_ERR() on the
pointer returned by posix_acl_from_xattr(), it does not
check for NULL. Because of the above situation, the
xattr aclsize can be non-zero, but posic_acl_from_xattr()
still returns NULL. Passing NULL to posix_acl_valid()
crashes the kernel.
We add a check to properly handle the NULL return value.
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/11989
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5150 Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add new function ft1000_read_dsp_timer() replacing recurring code block for
reading DSP timer. Such code refactoring solves all remaining "line over 80
characters" warnings reported by checkpatch.pl.
ft1000-pcmcia: ft1000_hw.c: fix style issues not requiring code refactoring
Fix all the trivial style issues (as reported by checkpatch.pl) not requiring
code refactoring. A following patch is expected to fix the remaining issues by
performing some code refactoring.
Sudip Mukherjee [Tue, 24 Mar 2015 10:59:32 +0000 (16:29 +0530)]
staging: panel: fix lcd type
the lcd type as defined in the Kconfig is not matching in the code.
as a result the rs, rw and en pins were getting interchanged.
Kconfig defines the value of PANEL_LCD to be 1 if we select custom
configuration but in the code LCD_TYPE_CUSTOM is defined as 5.
my hardware is LCD_TYPE_CUSTOM, but the pins were assigned to it
as pins of LCD_TYPE_OLD, and it was not working.
Now values are corrected with referenece to the values defined in
Kconfig and it is working.
checked on JHD204A lcd with LCD_TYPE_CUSTOM configuration.
staging: android: sync: Fix memory corruption in sync_timeline_signal().
The android_fence_release() function checks for active sync points
by calling list_empty() on the list head embedded on the sync
point. However, it is only valid to use list_empty() on nodes that
have been initialized with INIT_LIST_HEAD() or list_del_init().
Because the list entry has likely been removed from the active list
by sync_timeline_signal(), there is a good chance that this
WARN_ON_ONCE() will be hit due to dangling pointers pointing at
freed memory (even though the sync drivers did nothing wrong)
and memory corruption will ensue as the list entry is removed for
a second time, corrupting the active list.
This problem can be reproduced quite easily with CONFIG_DEBUG_LIST=y
and fences with more than one sync point.
Helen Fornazier [Wed, 25 Mar 2015 23:56:43 +0000 (20:56 -0300)]
staging: fbtft: Remove do {} while(0) in single statement macro
This patch fixes the checkpatch.pl warning:
WARNING: Single statement macros should not use a do {} while (0) loop
+#define write_reg(par, ...) \
+do { \
+ par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__); \
+} while (0)
Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
l1 = int (p1[0].line)
l2 = int (p2[0].line)
l3 = int (p3[0].line)
c1 = int (p1[0].column_end)
c2 = int (p2[0].column)
c3 = int (p3[0].column)
if (l1 != l2):
cocci.include_match(False)
if (l2 == l3 and c3 + 2 == c2):
cocci.include_match(False)
@@
position r.p1,r.p2,r.p3;
expression r.E;
@@
-if@p1 (E) @p3{@p2
+if (E) {
...
}
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haneen Mohammed [Wed, 25 Mar 2015 05:07:06 +0000 (08:07 +0300)]
Staging: rtl8192u: Add space before open parenthesis
Space is required before the open parenthesis.
This patch adds space after if to address that issue.
This was done with the help of the following Coccinelle script: