Re: [PATCH 36/37] binder: fix death race conditions

2017-06-29 Thread Greg KH
On Thu, Jun 29, 2017 at 12:02:10PM -0700, Todd Kjos wrote: > From: Martijn Coenen > > A race existed where one thread could register > a death notification for a node, while another > thread was cleaning up that node and sending > out death notifications for its references, > causing simultaneous

Re: [PATCH 00/37] fine-grained locking in binder driver

2017-06-29 Thread Greg KH
On Thu, Jun 29, 2017 at 12:01:34PM -0700, Todd Kjos wrote: > The binder driver uses a global mutex to serialize access to state in a > multi-threaded environment. This global lock has been increasingly > problematic as Android devices have scaled to more cores. The problem is > not so much contenti

[PATCH 2/6] Staging: rtl8712 : os_intfs.c: use octal permission representation

2017-06-29 Thread Jaya Durga
Fix checkpatch.pl Warning: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'. Signed-off-by: Jaya Durga --- drivers/staging/rtl8712/os_intfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/os_intfs.c

Re: [PATCH v3] staging: lustre: lnet: remove dead code and crc32_le() wrapper

2017-06-29 Thread Greg Kroah-Hartman
On Fri, Jun 30, 2017 at 03:52:46AM +, Dmitriy Cherkasov wrote: > After removing code which was premanently disabled with ifdefs, the > function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove > this useless wrapper and instead call crc32_le() directly. > > This also resolves the

Re: [PATCH] staging: ks7010: fix styling WARNINGs

2017-06-29 Thread Frans Klaver
On Fri, Jun 30, 2017 at 6:52 AM, Mark Rogers wrote: > Trivial style changes. There are still 3 "line over 80 characters" > checkpatch.pl warnings, but I think they are best left alone as > breaking the first two warning lines could hurt readability. The third > warning is a message that should not

[PATCH v4] staging: lustre: lnet: remove dead code and crc32_le() wrapper

2017-06-29 Thread Dmitriy Cherkasov
After removing code which was permanently disabled with ifdefs, the function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove this useless wrapper and instead call crc32_le() directly. This also resolves the following checkpatch warning which was triggered by the dead code: WARNING:

[PATCH] staging: ks7010: fix styling WARNINGs

2017-06-29 Thread Mark Rogers
Trivial style changes. There are still 3 "line over 80 characters" checkpatch.pl warnings, but I think they are best left alone as breaking the first two warning lines could hurt readability. The third warning is a message that should not be broken for the sake of grep. All but one of the changes

[PATCH] Stagingdriver cctree: Fix for checkpatch warning

2017-06-29 Thread bincy_k_philip
From: Bincy K Philip Trivial fix for Line over 80 characters Moved the comment to top of the definition Signed-off-by: Bincy K Philip --- drivers/staging/ccree/cc_hw_queue_defs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/ccree/cc_hw_queue_defs.h b/

Re: [PATCH v2] staging: lustre: lnet: remove dead code and crc32_le() wrapper

2017-06-29 Thread Dmitriy Cherkasov
On 06/30/2017, Joe Perches wrote: Please use checkpatch on your proposed patches before sending them. Whoops! Sorry about that. Fixed and re-sent. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/lis

[PATCH v3] staging: lustre: lnet: remove dead code and crc32_le() wrapper

2017-06-29 Thread Dmitriy Cherkasov
After removing code which was premanently disabled with ifdefs, the function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove this useless wrapper and instead call crc32_le() directly. This also resolves the following checkpatch warning which was triggered by the dead code: WARNING:

Re: [PATCH v2] staging: lustre: lnet: remove dead code and crc32_le() wrapper

2017-06-29 Thread Joe Perches
On Fri, 2017-06-30 at 03:29 +, Dmitriy Cherkasov wrote: > After removing code which was premanently disabled with ifdefs, the > function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove > this useless wrapper and instead call crc32_le() directly. > > This also resolves the followi

[PATCH v2] staging: lustre: lnet: remove dead code and crc32_le() wrapper

2017-06-29 Thread Dmitriy Cherkasov
After removing code which was premanently disabled with ifdefs, the function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove this useless wrapper and instead call crc32_le() directly. This also resolves the following checkpatch warning which was triggered by the dead code: WARNING:

RE: [PATCH] vmbus: re-enable tasklet

2017-06-29 Thread KY Srinivasan
> -Original Message- > From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On > Behalf Of KY Srinivasan > Sent: Thursday, June 29, 2017 4:36 PM > To: Stephen Hemminger ; Haiyan Yang > > Cc: de...@linuxdriverproject.org; sta...@vger.kernel.org > Subject: RE: [PATCH] vmbus:

RE: [PATCH] hv: fix msi affinity when device requests all possible CPU's

2017-06-29 Thread Stephen Hemminger
Patch still needed for 4.12 -Original Message- From: Jork Loeser Sent: Thursday, June 29, 2017 3:08 PM To: step...@networkplumber.org; KY Srinivasan ; bhelg...@google.com Cc: linux-...@vger.kernel.org; de...@linuxdriverproject.org; Stephen Hemminger Subject: RE: [PATCH] hv: fix msi aff

RE: [PATCH] vmbus: re-enable tasklet

2017-06-29 Thread KY Srinivasan
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Thursday, June 29, 2017 4:31 PM > To: KY Srinivasan ; Haiyan Yang > > Cc: de...@linuxdriverproject.org; sta...@vger.kernel.org; Greg KH > > Subject: Re: [PATCH] vmbus: re-enable tasklet > > On Th

[PATCH] staging: media: atomisp: Remove unnecessary return statement in void function

2017-06-29 Thread Amitoj Kaur Chawla
Return statement at the end of a void function is useless. The Coccinelle semantic patch used to make this change is as follows: // @@ identifier f; expression e; @@ void f(...) { <... - return e; ...> } // Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/media/atomisp/pci/atomisp2/h

Re: [PATCH] vmbus: re-enable tasklet

2017-06-29 Thread Stephen Hemminger
On Thu, 22 Jun 2017 16:16:54 -0700 Stephen Hemminger wrote: > This problem shows up in 4.11 when netvsc driver is removed and reloaded. > The problem is that the channel is closed during module removal and the > tasklet for processing responses is disabled. When module is reloaded > the channel i

RE: [PATCH] hv: fix msi affinity when device requests all possible CPU's

2017-06-29 Thread Jork Loeser
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Wednesday, June 28, 2017 4:22 PM > To: KY Srinivasan ; bhelg...@google.com > Cc: linux-...@vger.kernel.org; de...@linuxdriverproject.org; Stephen > Hemminger > Subject: [PATCH] hv: fix msi affinity w

Re: [PATCH 3/6] staging: iio: tsl2x7x: remove tsl2x7x_i2c_read()

2017-06-29 Thread Frans Klaver
On Thu, Jun 29, 2017 at 7:03 PM, Brian Masney wrote: > tsl2x7x_i2c_read() would call i2c_smbus_write_byte() and > i2c_smbus_read_byte(). These two i2c functions can be replaced with a > single call to i2c_smbus_read_byte_data(). This patch removes the > tsl2x7x_i2c_read() function and replaces all

Re: [PATCH v2 6/6] Staging: wlan-ng: hfa384x.h:Fix use of volatile is usually wrong

2017-06-29 Thread Joe Perches
On Thu, 2017-06-29 at 18:31 +0530, Jaya Durga wrote: > Fix checkpatch.pl issue > WARNING: Use of volatile is usually wrong: > see Documentation/process/volatile-considered-harmful.rst > > The variables in the private data that are > marked volatile don't need to be. Remove the volatile. If you ex

[PATCH 27/37] binder: use inner lock to sync work dq and node counts

2017-06-29 Thread Todd Kjos
For correct behavior we need to hold the inner lock when dequeuing and processing node work in binder_thread_read. We now hold the inner lock when we enter the switch statement and release it after processing anything that might be affected by other threads. We also need to hold the inner lock to

[PATCH 33/37] binder: use inner lock to protect thread accounting

2017-06-29 Thread Todd Kjos
Use the inner lock to protect thread accounting fields in proc structure: max_threads, requested_threads, requested_threads_started and ready_threads. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff -

[PATCH 09/37] binder: add protection for non-perf cases

2017-06-29 Thread Todd Kjos
Add binder_dead_nodes_lock, binder_procs_lock, and binder_context_mgr_node_lock to protect the associated global lists Signed-off-by: Todd Kjos --- drivers/android/binder.c | 81 +--- 1 file changed, 63 insertions(+), 18 deletions(-) diff --git a/driv

[PATCH 16/37] binder: remove dead code in binder_get_ref_for_node

2017-06-29 Thread Todd Kjos
node is always non-NULL in binder_get_ref_for_node so the conditional and else clause are not needed Signed-off-by: Todd Kjos --- drivers/android/binder.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c ind

[PATCH 08/37] binder: remove binder_debug_no_lock mechanism

2017-06-29 Thread Todd Kjos
With the global lock, there was a mechanism to access binder driver debugging information with the global lock disabled to debug deadlocks or other issues. This mechanism is rarely (if ever) used anymore and wasn't needed during the development of fine-grained locking in the binder driver. Removing

[PATCH 12/37] binder: add log information for binder transaction failures

2017-06-29 Thread Todd Kjos
Add additional information to determine the cause of binder failures. Adds the following to failed transaction log and kernel messages: return_error : value returned for transaction return_error_param : errno returned by binder allocator return_error_line : line number where

[PATCH 19/37] binder: use atomic for transaction_log index

2017-06-29 Thread Todd Kjos
The log->next index for the transaction log was not protected when incremented. This led to a case where log->next++ resulted in an index larger than ARRAY_SIZE(log->entry) and eventually a bad access to memory. Fixed by making the log index an atomic64 and converting to an array by using "% ARRAY

[PATCH 25/37] binder: use node->tmp_refs to ensure node safety

2017-06-29 Thread Todd Kjos
When obtaining a node via binder_get_node(), binder_get_node_from_ref() or binder_new_node(), increment node->tmp_refs to take a temporary reference on the node to ensure the node persists while being used. binder_put_node() must be called to remove the temporary reference. Signed-off-by: Todd Kj

[PATCH 28/37] binder: add spinlocks to protect todo lists

2017-06-29 Thread Todd Kjos
The todo lists in the proc, thread, and node structures are accessed by other procs/threads to place work items on the queue. The todo lists are protected by the new proc->inner_lock. No locks should ever be nested under these locks. As the name suggests, an outer lock will be introduced in a late

[PATCH 29/37] binder: add spinlock to protect binder_node

2017-06-29 Thread Todd Kjos
node->node_lock is used to protect elements of node. No need to acquire for fields that are invariant: debug_id, ptr, cookie. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 220 +++ 1 file changed, 165 insertions(+), 55 deletions(-) diff --gi

[PATCH 34/37] binder: protect binder_ref with outer lock

2017-06-29 Thread Todd Kjos
Use proc->outer_lock to protect the binder_ref structure. The outer lock allows functions operating on the binder_ref to do nested acquires of node and inner locks as necessary to attach refs to nodes atomically. Binder refs must never be accesssed without holding the outer lock. Signed-off-by: T

[PATCH 24/37] binder: refactor binder ref inc/dec for thread safety

2017-06-29 Thread Todd Kjos
Once locks are added, binder_ref's will only be accessed safely with the proc lock held. Refactor the inc/dec paths to make them atomic with the binder_get_ref* paths and node inc/dec. For example, instead of: ref = binder_get_ref(proc, handle, strong); ... binder_dec_ref(ref, strong); we n

[PATCH 05/37] binder: remove unneeded cleanup code

2017-06-29 Thread Todd Kjos
The buffer's transaction has already been freed before binder_deferred_release. No need to do it again. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index

[PATCH 04/37] binder: separate binder allocator structure from binder proc

2017-06-29 Thread Todd Kjos
The binder allocator is logically separate from the rest of the binder drivers. Separating the data structures to prepare for splitting into separate file with separate locking. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 212 + drivers/a

[PATCH 07/37] binder: move binder_alloc to separate file

2017-06-29 Thread Todd Kjos
Move the binder allocator functionality to its own file Continuation of splitting the binder allocator from the binder driver. Split binder_alloc functions from normal binder functions. Add kernel doc comments to functions declared extern in binder_alloc.h Signed-off-by: Todd Kjos --- drivers/

[PATCH 21/37] binder: guarantee txn complete / errors delivered in-order

2017-06-29 Thread Todd Kjos
Since errors are tracked in the return_error/return_error2 fields of the binder_thread object and BR_TRANSACTION_COMPLETEs can be tracked either in those fields or via the thread todo work list, it is possible for errors to be reported ahead of the associated txn complete. Use the thread todo work

[PATCH 13/37] binder: refactor queue management in binder_thread_read

2017-06-29 Thread Todd Kjos
In binder_thread_read, the BINDER_WORK_NODE command is used to communicate the references on the node to userspace. It can take a couple of iterations in the loop to construct the list of commands for user space. When locking is added, the lock would need to be release on each iteration which means

[PATCH 32/37] binder: protect transaction_stack with inner lock.

2017-06-29 Thread Todd Kjos
From: Martijn Coenen This makes future changes to priority inheritance easier, since we want to be able to look at a thread's transaction stack when selecting a thread to inherit priority for. It also allows us to take just a single lock in a few paths, where we used to take two in succession.

[PATCH 31/37] binder: protect proc->threads with inner_lock

2017-06-29 Thread Todd Kjos
proc->threads will need to be accessed with higher locks of other processes held so use proc->inner_lock to protect it. proc->tmp_ref now needs to be protected by proc->inner_lock. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 87 +++- 1 file

[PATCH 17/37] binder: protect against two threads freeing buffer

2017-06-29 Thread Todd Kjos
Adds protection against malicious user code freeing the same buffer at the same time which could cause a crash. Cannot happen under normal use. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 4 ++-- drivers/android/binder_alloc.c | 22 +- drivers/android/binde

[PATCH 35/37] binder: protect against stale pointers in print_binder_transaction

2017-06-29 Thread Todd Kjos
When printing transactions there were several race conditions that could cause a stale pointer to be deferenced. Fixed by reading the pointer once and using it if valid (which is safe). The transaction buffer also needed protection via proc lock, so it is only printed if we are holding the correct

[PATCH 37/37] binder: remove global binder lock

2017-06-29 Thread Todd Kjos
Remove global mutex and rely on fine-grained locking Signed-off-by: Todd Kjos --- drivers/android/binder.c | 46 +++--- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 1e50b034d49a..c

[PATCH 01/37] Revert "android: binder: Sanity check at binder ioctl"

2017-06-29 Thread Todd Kjos
This reverts commit a906d6931f3ccaf7de805643190765ddd7378e27. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index aae4d8d4be36..157bd3e49ff4 100644 --- a/drivers/android/binder.c +

[PATCH 20/37] binder: refactor binder_pop_transaction

2017-06-29 Thread Todd Kjos
binder_pop_transaction needs to be split into 2 pieces to to allow the proc lock to be held on entry to dequeue the transaction stack, but no lock when kfree'ing the transaction. Split into binder_pop_transaction_locked and binder_free_transaction (the actual locks are still to be added). Signed-

[PATCH 10/37] binder: change binder_stats to atomics

2017-06-29 Thread Todd Kjos
From: Badhri Jagan Sridharan Use atomics for stats to avoid needing to lock for increments/decrements Signed-off-by: Todd Kjos --- drivers/android/binder.c | 48 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/android/bin

[PATCH 26/37] binder: introduce locking helper functions

2017-06-29 Thread Todd Kjos
There are 3 main spinlocks which must be acquired in this order: 1) proc->outer_lock : protects most fields of binder_proc, binder_thread, and binder_ref structures. binder_proc_lock() and binder_proc_unlock() are used to acq/rel. 2) node->lock : protects most fields of binder_node.

[PATCH 18/37] binder: add more debug info when allocation fails.

2017-06-29 Thread Todd Kjos
From: Martijn Coenen Display information about allocated/free space whenever binder buffer allocation fails on synchronous transactions. Signed-off-by: Martijn Coenen Signed-off-by: Siqi Lin --- drivers/android/binder_alloc.c | 31 ++- 1 file changed, 30 insertions

[PATCH 23/37] binder: make sure accesses to proc/thread are safe

2017-06-29 Thread Todd Kjos
binder_thread and binder_proc may be accessed by other threads when processing transaction. Therefore they must be prevented from being freed while a transaction is in progress that references them. This is done by introducing a temporary reference counter for threads and procs that indicates that

[PATCH 36/37] binder: fix death race conditions

2017-06-29 Thread Todd Kjos
From: Martijn Coenen A race existed where one thread could register a death notification for a node, while another thread was cleaning up that node and sending out death notifications for its references, causing simultaneous access to ref->death because different locks were held. Signed-off-by:

[PATCH 22/37] binder: make sure target_node has strong ref

2017-06-29 Thread Todd Kjos
When initiating a transaction, the target_node must have a strong ref on it. Then we take a second strong ref to make sure the node survives until the transaction is complete. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 22 +- 1 file changed, 17 insertions(+), 5 d

[PATCH 06/37] binder: separate out binder_alloc functions

2017-06-29 Thread Todd Kjos
Continuation of splitting the binder allocator from the binder driver. Separate binder_alloc functions from normal binder functions. Protect the allocator with a separate mutex. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 649 + drivers/a

[PATCH 14/37] binder: avoid race conditions when enqueuing txn

2017-06-29 Thread Todd Kjos
Currently, the transaction complete work item is queued after the transaction. This means that it is possible for the transaction to be handled and a reply to be enqueued in the current thread before the transaction complete is enqueued, which violates the protocol with userspace who may not expect

[PATCH 00/37] fine-grained locking in binder driver

2017-06-29 Thread Todd Kjos
The binder driver uses a global mutex to serialize access to state in a multi-threaded environment. This global lock has been increasingly problematic as Android devices have scaled to more cores. The problem is not so much contention for the global lock which still remains relatively low, but the

[PATCH 02/37] binder: use group leader instead of open thread

2017-06-29 Thread Todd Kjos
The binder allocator assumes that the thread that called binder_open will never die for the lifetime of that proc. That thread is normally the group_leader, however it may not be. Use the group_leader instead of current. Signed-off-by: Todd Kjos --- drivers/android/binder.c | 4 ++-- 1 file chan

[PATCH 11/37] binder: make binder_last_id an atomic

2017-06-29 Thread Todd Kjos
Use an atomic for binder_last_id to avoid locking it Signed-off-by: Todd Kjos --- drivers/android/binder.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index cd4191d027e1..25f30d81c7d0 100644 --- a/drivers/android

[PATCH 30/37] binder: protect proc->nodes with inner lock

2017-06-29 Thread Todd Kjos
When locks for binder_ref handling are added, proc->nodes will need to be modified while holding the outer lock Signed-off-by: Todd Kjos --- drivers/android/binder.c | 112 +-- 1 file changed, 89 insertions(+), 23 deletions(-) diff --git a/drivers/and

[PATCH 15/37] binder: don't modify thread->looper from other threads

2017-06-29 Thread Todd Kjos
The looper member of struct binder_thread is a bitmask of control bits. All of the existing bits are modified by the affected thread except for BINDER_LOOPER_STATE_NEED_RETURN which can be modified in binder_deferred_flush() by another thread. To avoid adding a spinlock around all read-mod-writes

[PATCH 03/37] binder: Use wake up hint for synchronous transactions.

2017-06-29 Thread Todd Kjos
From: Riley Andrews Use wake_up_interruptible_sync() to hint to the scheduler binder transactions are synchronous wakeups. Disable preemption while waking to avoid ping-ponging on the binder lock. Signed-off-by: Todd Kjos Signed-off-by: Omprakash Dhyade --- drivers/android/binder.c | 8 ++

[PATCH] staging: wilc1000: Neaten refresh_scan - remove always 1 argument

2017-06-29 Thread Joe Perches
All uses of refresh_scan() have a constant 1 as the second argument. Remove it and neaten the function declaration. Miscellanea: o Remove overly deep indentation by using continue; o Remove unnecessary test of the address of a static array as it's always non-zero o Rename and use proper type fo

Re: [PATCH] drivers/staging/media: Prefer using __func__ instead

2017-06-29 Thread Joe Perches
On Thu, 2017-06-29 at 16:59 +0530, Pushkar Jambhlekar wrote: > Function name is hardcoded. replacing with __func__ Please run your proposed patches through checkpatch before you send them. > diff --git a/drivers/staging/media/cxd2099/cxd2099.c > b/drivers/staging/media/cxd2099/cxd2099.c [] > @@

[PATCH v2] staging: ccree: Use __func__ instead of function name

2017-06-29 Thread karthik
From: Karthik Tummala Fixed following checkpatch.pl warning: WARNING: Prefer using '"%s...", __func__' to using the function's name, in a string It is prefered to use '%s & __func__' instead of function name for logging. Signed-off-by: Karthik Tummala --- Changes for v2: v1 was a patch

[PATCH 5/6] staging: iio: tsl2x7x: refactor {read, write}_event_value to allow handling multiple iio_event_infos

2017-06-29 Thread Brian Masney
tsl2x7x_read_thresh() and tsl2x7x_write_thresh() currently assumes that IIO_EV_INFO_VALUE is the only iio_event_info that will be passed in. This patch refactors these two functions so that additional iio_event_infos can be passed in. The functions are renamed from tsl2x7x_{read,write}_thresh() to

[PATCH 6/6] staging: iio: tsl2x7x: use usleep_range() instead of mdelay()

2017-06-29 Thread Brian Masney
This driver in some cases can busy wait for upwards of 15ms. Since the kernel at this point is not running in atomic context, and is running in process context, we can safely use usleep_range() instead. This patch changes the two occurrences of mdelay() to usleep_range(). Signed-off-by: Brian Masn

[PATCH 3/6] staging: iio: tsl2x7x: remove tsl2x7x_i2c_read()

2017-06-29 Thread Brian Masney
tsl2x7x_i2c_read() would call i2c_smbus_write_byte() and i2c_smbus_read_byte(). These two i2c functions can be replaced with a single call to i2c_smbus_read_byte_data(). This patch removes the tsl2x7x_i2c_read() function and replaces all occurances with a call to i2c_smbus_read_byte_data(). Signed

[PATCH 4/6] staging: iio: tsl2x7x: cleaned up i2c calls in tsl2x7x_als_calibrate()

2017-06-29 Thread Brian Masney
The calibration function calls i2c_smbus_write_byte() and i2c_smbus_read_byte(). These two function calls are replaced with a single call to i2c_smbus_read_byte_data() by this patch. This patch also removes an unnecessary call that reads the CNTRL register a second time. One of the error paths retu

[PATCH 2/6] staging: iio: tsl2x7x: remove redundant power_state sysfs attribute

2017-06-29 Thread Brian Masney
The TSL2X7X driver has a custom power_state sysfs attribute. Remove this attribute since the runtime power management code provides a sysfs attribute to control the power state of the device. Signed-off-by: Brian Masney --- drivers/staging/iio/light/tsl2x7x.c | 34 ---

[PATCH 0/6] staging: iio: tsl2x7x: staging cleanups

2017-06-29 Thread Brian Masney
This begins my work to clean this driver up and eventually move it out of staging. Driver changes were tested using a TSL2771 hooked up to a Raspberry Pi 2. Thanks to Jon Brenner at AMS/TAOS for loaning me some hardware samples to test my driver changes. Brian Masney (6): staging: iio: tsl2x7x:

[PATCH 1/6] staging: iio: tsl2x7x: add of_match table for device tree support

2017-06-29 Thread Brian Masney
Add device tree support for the tsl2x7x IIO driver with no custom properties. Signed-off-by: Brian Masney CC: Rob Herring CC: Mark Rutland CC: devicet...@vger.kernel.org --- Documentation/devicetree/bindings/trivial-devices.txt | 10 ++ drivers/staging/iio/light/tsl2x7x.c

Re: [PATCH RESEND 0/7] Introduce MEDIA_VERSION to end KENREL_VERSION abuse in media

2017-06-29 Thread Stephen Hemminger
On Thu, 29 Jun 2017 11:42:59 +0200 Johannes Thumshirn wrote: > On Sat, Jun 24, 2017 at 05:15:07PM -0300, Mauro Carvalho Chehab wrote: > > Sorry, but I can't see any advantage on it. On the downside, it > > includes the media controller header file (media.h) where it > > is not needed. > > My r

[PATCH] staging: fsl-dpaa2/eth: Remove dead code

2017-06-29 Thread Ioana Radulescu
All possible values of the switch statement are explicitly handled, so there's no need to have a default branch. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth

Re: [PATCH v2 4/4] Staging: rtl8712 : ieee80211.c: fixed camelcase coding style issue

2017-06-29 Thread Larry Finger
On 06/29/2017 01:43 AM, Jaya Durga wrote: The following variables and struct name are renamed to avoid camelcase issue Configuration to configuration BeaconPeriod to beacon_period DSConfig to ds_config ATIMWindowto atim_window pnic_Config to pnic_config FHConfig to fh_config Hop

Re: [PATCH] staging: ks7010: Fix unnecessary parentheses checks.

2017-06-29 Thread Greg Kroah-Hartman
On Mon, Jun 26, 2017 at 01:02:27PM -0600, Jonathan Whitaker wrote: > This patch fixes "Unnecessary parentheses" checks reported by > the checkpatch.pl script. > > Signed-off-by: Jonathan Bennion Whitaker > --- >  drivers/staging/ks7010/ks_hostif.c | 6 +++--- >  1 file changed, 3 insertions(+), 3

Re: [PATCH 14/14] staging: ccree: fix block comment style

2017-06-29 Thread Frans Klaver
On Tue, Jun 27, 2017 at 9:27 AM, Gilad Ben-Yossef wrote: > Align block comments according to coding style. > > Signed-off-by: Gilad Ben-Yossef > --- > drivers/staging/ccree/cc_hw_queue_defs.h | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/ccree/c

Re: [PATCH v2 5/8] staging: wilc1000: Add new variable for ac queue management

2017-06-29 Thread Greg KH
On Mon, Jun 26, 2017 at 05:13:27PM +0530, Aditya Shankar wrote: > This patch adds a new variable in the wilc struct to manage > ac queues. > > Signed-off-by: Aditya Shankar > --- > drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 + > 1 file changed, 1 insertion(+) Wait, what is this whole pat

Re: [PATCH] Stagingdriver cctree: Fix for checkpatch warning

2017-06-29 Thread Greg KH
On Tue, Jun 27, 2017 at 11:47:56AM +0530, bincy_k_phi...@yahoo.co.in wrote: > From: Bincy K Philip > > Trivial fix for Line over 80 characters > > Moved the comment to top of the definition > --- > drivers/staging/ccree/cc_hw_queue_defs.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-

Re: [PATCH] staging: lustre: lnet: remove dead code

2017-06-29 Thread Greg Kroah-Hartman
On Wed, Jun 28, 2017 at 09:42:36PM -0700, Dmitriy Cherkasov wrote: > Remove code which was permanently disabled with ifdefs. > > This also resolves the following checkpatch warning which was > triggered by the dead code: > > WARNING: space prohibited before semicolon > > Signed-off-by: Dmitriy C

Re: [PATCH] Staging: unisys: visorbus: Fix coding style warning from checkpatch.pl.

2017-06-29 Thread Greg KH
On Tue, Jun 27, 2017 at 07:49:05PM -0700, Quytelda Kahja wrote: > Replace the literal function name "visorbus_create_instance" with the format > specifier "%s" so it can be dynamically filled by the __func__ macro. > > Signed-off-by: Quytelda Kahja > --- > drivers/staging/unisys/visorbus/visorbu

Re: [PATCH v2 1/2] Staging: rtl8712 : os_intfs.c: use octal permission representation

2017-06-29 Thread Greg KH
On Tue, Jun 27, 2017 at 01:06:00PM +0530, Jaya Durga wrote: > Fix checkpatch.pl Warning: Symbolic permissions 'S_IRUGO | S_IWUSR' are not > preferred. > Consider using octal permissions '0644'. > > Signed-off-by: Jaya Durga > --- > drivers/staging/rtl8712/os_intfs.c | 2 +- > 1 file changed, 1

Re: [PATCH 0/2] staging: ccree: Fix coding style and remove warnings

2017-06-29 Thread Greg Kroah-Hartman
On Thu, Jun 29, 2017 at 04:13:38PM +0530, karthik wrote: > On Wednesday 28 June 2017 03:15 PM, Gilad Ben-Yossef wrote: > > Thank you Karthik, > > > > On Wed, Jun 28, 2017 at 12:37 PM, wrote: > > > From: Karthik Tummala > > > > > > This patch series fixes coding style and removes the following

Re: [PATCH] staging: ccree: constify dev_pm_ops structures.

2017-06-29 Thread Greg KH
On Thu, Jun 29, 2017 at 03:00:28PM +0530, Arvind Yadav wrote: > dev_pm_ops are not supposed to change at runtime. All functions > working with dev_pm_ops provided by work with const > dev_pm_ops. So mark the non-const structs as const. > > File size before: >text data bss dec

[PATCH v2 6/6] Staging: wlan-ng: hfa384x.h:Fix use of volatile is usually wrong

2017-06-29 Thread Jaya Durga
Fix checkpatch.pl issue WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst The variables in the private data that are marked volatile don't need to be. Remove the volatile. Signed-off-by: Jaya Durga --- drivers/staging/wlan-ng/hfa384x.h | 2 +-

Re: 答复: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-29 Thread Greg Kroah-Hartman
A: Top-posting. Q: What is the most annoying thing in e-mail? A: No. Q: Should I include quotations after my reply? http://daringfireball.net/2007/07/on_top On Wed, Jun 28, 2017 at 06:18:57AM +, Teddy Wang 王力强 wrote: > Hi Greg, > > Is the reason Sudip gave you for the question of "wh

Re: [PATCH 6/6] Staging: wlan-ng: hfa384x.h:Fix use of volatile is usually wrong

2017-06-29 Thread Frans Klaver
On Thu, Jun 29, 2017 at 12:25 PM, Jaya Durga wrote: > Fix checkpatch.pl issue > WARNING: Use of volatile is usually wrong: > see Documentation/process/volatile-considered-harmful.rst Now I've only had a very quick look at the code using this. Could you elaborate on why just removing the volatile

[PATCH] drivers/staging/media: Prefer using __func__ instead

2017-06-29 Thread Pushkar Jambhlekar
Function name is hardcoded. replacing with __func__ Signed-off-by: Pushkar Jambhlekar --- drivers/staging/media/cxd2099/cxd2099.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c index f2891

[PATCH] drivers: staging: sm750: Hold lock irrespective of fb numbers.

2017-06-29 Thread Dhananjay Balan
Start holding the lock for all cases irrespective of number of fb, there could be a deadlock since this number could change in the lifetime of this lock Signed-off-by: Dhananjay Balan --- drivers/staging/sm750fb/sm750.c | 26 +- 1 file changed, 13 insertions(+), 13 deleti

Re: [PATCH 0/2] staging: ccree: Fix coding style and remove warnings

2017-06-29 Thread karthik
On Wednesday 28 June 2017 03:15 PM, Gilad Ben-Yossef wrote: Thank you Karthik, On Wed, Jun 28, 2017 at 12:37 PM, wrote: From: Karthik Tummala This patch series fixes coding style and removes the following checkpatch.pl warnings: Prefer using '"%s...", __func__' to using the function's name

[PATCH 6/6] Staging: wlan-ng: hfa384x.h:Fix use of volatile is usually wrong

2017-06-29 Thread Jaya Durga
Fix checkpatch.pl issue WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst Signed-off-by: Jaya Durga --- drivers/staging/wlan-ng/hfa384x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wlan-ng/hfa384x.h b/dr

Re: [PATCH RESEND 0/7] Introduce MEDIA_VERSION to end KENREL_VERSION abuse in media

2017-06-29 Thread Johannes Thumshirn
On Sat, Jun 24, 2017 at 05:15:07PM -0300, Mauro Carvalho Chehab wrote: > Sorry, but I can't see any advantage on it. On the downside, it > includes the media controller header file (media.h) where it > is not needed. My reasoning was the differences in semantics. KERNEL_VERSION() is for encoding t

[PATCH] staging: ccree: constify dev_pm_ops structures.

2017-06-29 Thread Arvind Yadav
dev_pm_ops are not supposed to change at runtime. All functions working with dev_pm_ops provided by work with const dev_pm_ops. So mark the non-const structs as const. File size before: textdata bss dec hex filename 3800 488 0428810c0 drivers/staging/ccree/

Re: [PATCH] [media] staging/imx: remove confusing IS_ERR_OR_NULL usage

2017-06-29 Thread Philipp Zabel
Hi Arnd, thank you for the cleanup. I see two issues below: On Wed, 2017-06-28 at 22:13 +0200, Arnd Bergmann wrote: > While looking at a compiler warning, I noticed the use of > IS_ERR_OR_NULL, which is generally a sign of a bad API design > and should be avoided. > > In this driver, this is fai

[PATCH 5/5] Staging: android: ion_cma_heap.c: fix coding style of kmalloc usage

2017-06-29 Thread Jaya Durga
This patch fixes coding style of kmalloc usage found by checkpatch.pl CHECK: Prefer kmalloc(sizeof(*table)...) over kmalloc(sizeof(struct sg_table)...) Signed-off-by: Jaya Durga --- drivers/staging/android/ion/ion_cma_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dri