platform/kernel/linux-exynos.git
8 years agoStaging: lustre: statahead: Remove sa_first_received_entry wrapper
Shivani Bhardwaj [Sat, 7 Nov 2015 09:50:59 +0000 (15:20 +0530)]
Staging: lustre: statahead: Remove sa_first_received_entry wrapper

Remove the function sa_first_received_entry() and replace all its calls
with the function list_entry() that it wraps.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: statahead: Remove ll_sa_entry_unhashed wrapper
Shivani Bhardwaj [Sat, 7 Nov 2015 09:50:21 +0000 (15:20 +0530)]
Staging: lustre: statahead: Remove ll_sa_entry_unhashed wrapper

Remove the function ll_sa_entry_unhashed() and replace all its calls
with the function list_empty() that it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: lustre_mds: Remove unused md_should_create
Shraddha Barke [Sat, 7 Nov 2015 09:44:24 +0000 (15:14 +0530)]
Staging: lustre: lustre_mds: Remove unused md_should_create

md_should_create has been defined in header file but not used.
Thus remove it.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: rw: Remove wrapper stride_page_count
Shivani Bhardwaj [Sat, 7 Nov 2015 08:02:07 +0000 (13:32 +0530)]
Staging: lustre: rw: Remove wrapper stride_page_count

Remove the function stride_page_count() and replace its calls with the
function stride_pg_count() that it wraps.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Fix module parameter spelling
Jubin John [Fri, 18 Dec 2015 00:24:14 +0000 (19:24 -0500)]
staging/rdma/hfi1: Fix module parameter spelling

Fix the spelling of user_credit_return_threshold, it was incorrectly
spelled as user_credit_return_theshold causing two module parameters,
one with typo, to be shown in modinfo

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Remove incorrect link credit check
Dean Luick [Fri, 18 Dec 2015 00:24:13 +0000 (19:24 -0500)]
staging/rdma/hfi1: Remove incorrect link credit check

Remove an invalid sanity check that compares the local link
credits with the peer link credits.  The two have no dependency
on each other.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Change num_rcv_contexts to num_user_contexts and its meaning
Sebastian Sanchez [Fri, 11 Dec 2015 13:44:48 +0000 (08:44 -0500)]
staging/rdma/hfi1: Change num_rcv_contexts to num_user_contexts and its meaning

num_rcv_contexts sets the number of user contexts, both receive and send.
Renaming it to num_user_contexts makes sense to reflect its true meaning.
When num_rcv_contexts is 0, the default behavior is the number of CPU
cores instead of 0 contexts. This commit changes the variable
num_rcv_contexts to num_user_contexts, and it also makes any negative
value for this variable default to the number of CPU cores, so if
num_user_contexts is set >= 0, the value will number of contexts.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Fix for module parameter hdrq_entsize when it's 0
Sebastian Sanchez [Thu, 10 Dec 2015 21:02:49 +0000 (16:02 -0500)]
staging/rdma/hfi1: Fix for module parameter hdrq_entsize when it's 0

If driver is loaded with parameter hdrq_entsize=0, then
there's a NULL dereference when the driver gets unloaded.
This causes a kernel Oops and prevents the module  from
being unloaded. This patch fixes this issue by making sure
-EINVAL gets returned when hdrq_entsize=0.

Reviewed-by: Chegondi, Harish <harish.chegondi@intel.com>
Reviewed-by: Haralanov, Mitko <mitko.haralanov@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Fix a possible null pointer dereference
Easwar Hariharan [Thu, 10 Dec 2015 16:13:38 +0000 (11:13 -0500)]
staging/rdma/hfi1: Fix a possible null pointer dereference

A code inspection pointed out that kmalloc_array may return NULL and
memset doesn't check the input pointer for NULL, resulting in a possible
NULL dereference. This patch fixes this.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: HFI now sends OPA Traps instead of IBTA
Erik E. Kahn [Thu, 10 Dec 2015 14:59:40 +0000 (09:59 -0500)]
staging/rdma/hfi1: HFI now sends OPA Traps instead of IBTA

send_trap() was still using old ib_smp instead of opa_smp
for formatting and sending traps.

Reviewed-by: Arthur Kepner <arthur.kepner@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Erik E. Kahn <erik.kahn@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: add definitions for OPA traps
Jubin John [Thu, 10 Dec 2015 14:59:34 +0000 (09:59 -0500)]
staging/rdma/hfi1: add definitions for OPA traps

These new definitions will be used by follow-on
patches for formating and sending OPA traps.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rdma:Delete unnecessary NULL check before calling function "kmem_cache_destroy"
Yash Shah [Tue, 8 Dec 2015 10:24:17 +0000 (10:24 +0000)]
Staging: rdma:Delete unnecessary NULL check before calling function "kmem_cache_destroy"

The kmem_cache_destroy() function tests whether its argument is NULL
and then returns immediately.
Thus the NULL check before calling this function is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Yash Shah <yshah1@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: convert buffers allocated atomic to per cpu
Mike Marciniszyn [Mon, 7 Dec 2015 20:39:22 +0000 (15:39 -0500)]
staging/rdma/hfi1: convert buffers allocated atomic to per cpu

Profiling has shown the the atomic is a performance issue
for the pio hot path.

If multiple cpus allocated an sc's buffer, the cacheline
containing the atomic will bounce from L0 to L0.

Convert the atomic to a percpu variable.

Reviewed-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: fix sdma build failures to always clean up
Mike Marciniszyn [Thu, 3 Dec 2015 21:41:05 +0000 (16:41 -0500)]
staging/rdma/hfi1: fix sdma build failures to always clean up

There are holes in the sdma build support routines that do
not clean any partially built sdma descriptors after mapping or
allocate failures.

This patch corrects these issues.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: fix pio progress routine race with allocator
Mike Marciniszyn [Thu, 3 Dec 2015 19:34:18 +0000 (14:34 -0500)]
staging/rdma/hfi1: fix pio progress routine race with allocator

The allocation code assumes that the shadow ring cannot
be overrun because the credits will limit the allocation.

Unfortuately, the progress mechanism in sc_release_update() updates
the free count prior to processing the shadow ring, allowing the
shadow ring to be overrun by an allocation.

Reviewed-by: Mark Debbage <mark.debbage@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Detect SDMA transmission error early
Mitko Haralanov [Tue, 8 Dec 2015 22:10:12 +0000 (17:10 -0500)]
staging/rdma/hfi1: Detect SDMA transmission error early

It is possible for an SDMA transmission error to happen
during the processing of an user SDMA transfer. In that
case it is better to detect it early and abort any further
attempts to send more packets.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Clean-up unnecessary goto statements
Mitko Haralanov [Tue, 8 Dec 2015 22:10:11 +0000 (17:10 -0500)]
staging/rdma/hfi1: Clean-up unnecessary goto statements

Clean-up unnecessary goto statements based on feedback from the
mailing list on previous patch submissions.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Add page lock limit check for SDMA requests
Mitko Haralanov [Tue, 8 Dec 2015 22:10:13 +0000 (17:10 -0500)]
staging/rdma/hfi1: Add page lock limit check for SDMA requests

The driver pins pages on behalf of user processes in two
separate instances - when the process has submitted a
SDMA transfer and when the process programs an expected
receive buffer.

When pinning pages, the driver is required to observe the
locked page limit set by the system administrator and refuse
to lock more pages than allowed. Such a check was done for
expected receives but was missing from the SDMA transfer
code path.

This commit adds the missing check for SDMA transfers. As of
this commit, user SDMA or expected receive requests will be
rejected if the number of pages required to be pinned will
exceed the set limit.

Due to the fact that the driver needs to take the MM semaphore
in order to update the locked page count (which can sleep), this
cannot be done by the callback function as it [the callback] is
executed in interrupt context. Therefore, it is necessary to put
all the completed SDMA tx requests onto a separate list (txcmp) and
offload the actual clean-up and unpinning work to a workqueue.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Convert to use get_user_pages_fast
Mitko Haralanov [Tue, 8 Dec 2015 22:10:09 +0000 (17:10 -0500)]
staging/rdma/hfi1: Convert to use get_user_pages_fast

Convert hfi1_get_user_pages() to use get_user_pages_fast(),
which is much fatster. The mm semaphore is still taken to
update the pinned page count but is for a much shorter
amount of time.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Unconditionally clean-up SDMA queues
Mitko Haralanov [Tue, 8 Dec 2015 22:10:10 +0000 (17:10 -0500)]
staging/rdma/hfi1: Unconditionally clean-up SDMA queues

There is no need to cleck if the packet queue is allocated
when cleaning up a user context. The hfi1_user_sdma_free_queues()
function already does all the required checks.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Return immediately on error
Dennis Dalessandro [Wed, 2 Dec 2015 05:43:38 +0000 (00:43 -0500)]
staging/rdma/hfi1: Return immediately on error

Now that the spinlock is not taken throughout hfi1_ioctl it is safe to return
early rather than setting a variable and falling through the switch.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Reduce snoop locking scope in IOCTL handler.
Dennis Dalessandro [Wed, 2 Dec 2015 05:43:37 +0000 (00:43 -0500)]
staging/rdma/hfi1: Reduce snoop locking scope in IOCTL handler.

This patch avoids issues while calling into copy from/to user while holding the
lock by only taking the lock when it is absolutely required.

The only commands which require the snoop lock are: *Set Filter *Clear Filter
*Clear Queue

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Further clean up hfi1_ioctl parameter checks
Ira Weiny [Wed, 2 Dec 2015 05:43:36 +0000 (00:43 -0500)]
staging/rdma/hfi1: Further clean up hfi1_ioctl parameter checks

Final clean up of the if/then/else clause for the parameter checks of
hfi1_ioctl

Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: hfi1_ioctl remove setlink state
Ira Weiny [Wed, 2 Dec 2015 05:43:35 +0000 (00:43 -0500)]
staging/rdma/hfi1: hfi1_ioctl remove setlink state

Set link state is not supported remove from the switch statement and allow the
default to return -ENOTTY

Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Return early from hfi1_ioctl parameter errors
Ira Weiny [Wed, 2 Dec 2015 05:43:34 +0000 (00:43 -0500)]
staging/rdma/hfi1: Return early from hfi1_ioctl parameter errors

Rather than have a switch in a large else clause make the parameter checks
return immediately.

Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Fix camel case variables
Ira Weiny [Wed, 2 Dec 2015 05:43:33 +0000 (00:43 -0500)]
staging/rdma/hfi1: Fix camel case variables

physState, linkState, and devState should be phys_state, link_state, and
dev_state

Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: diag.c correct sizeof parameter
Ira Weiny [Wed, 2 Dec 2015 05:43:32 +0000 (00:43 -0500)]
staging/rdma/hfi1: diag.c correct sizeof parameter

sizeof should use the variable rather than the struct definition to ensure that
type changes are properly accounted for.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: diag.c add missing braces
Ira Weiny [Wed, 2 Dec 2015 05:43:31 +0000 (00:43 -0500)]
staging/rdma/hfi1: diag.c add missing braces

Else statements should continue using braces even if there is only 1 line in
the block.  Found by checkpatch --strict

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: diag.c change null comparisons
Ira Weiny [Wed, 2 Dec 2015 05:43:30 +0000 (00:43 -0500)]
staging/rdma/hfi1: diag.c change null comparisons

Use !foo rather than (foo == NULL) as recommended by checkpatch --strict

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: diag.c fix white space errors
Ira Weiny [Wed, 2 Dec 2015 05:43:29 +0000 (00:43 -0500)]
staging/rdma/hfi1: diag.c fix white space errors

Add or remove whitespace according to checkpatch --strict

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: diag.c fix logical continuations
Ira Weiny [Wed, 2 Dec 2015 05:43:28 +0000 (00:43 -0500)]
staging/rdma/hfi1: diag.c fix logical continuations

Place logical operators at the end of the previous line when using a multi-line
statement.  Found by checkpatch --strict

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: diag.c fix alignment
Ira Weiny [Wed, 2 Dec 2015 05:43:27 +0000 (00:43 -0500)]
staging/rdma/hfi1: diag.c fix alignment

Fix line alignment in various places as caught by checkpatch --strict.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: diag.c use BIT macros
Ira Weiny [Wed, 2 Dec 2015 05:43:26 +0000 (00:43 -0500)]
staging/rdma/hfi1: diag.c use BIT macros

Use BIT macros rather than shifts.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Adding counter resolutions for DataPortCounters
Andrea Lowe [Tue, 1 Dec 2015 20:38:26 +0000 (15:38 -0500)]
staging/rdma/hfi1: Adding counter resolutions for DataPortCounters

Changing the 32-bit reserved field in opa_port_data_counters_msg
to the new 'resolution' field. PMA will use resolutions to right-
shift values for LocalLinkIntegrity and LinkErrorRecovery when
computing the ErrorCounterSummary for a DataPortCounters request.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Andrea Lowe <andrea.l.lowe@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Consider VL15 MTU also when calculating the maximum VL MTU
Harish Chegondi [Tue, 1 Dec 2015 20:38:24 +0000 (15:38 -0500)]
staging/rdma/hfi1: Consider VL15 MTU also when calculating the maximum VL MTU

Currently, only MTUs of VLs 0-7 are checked when calculating the maximum VL
MTU which is used to set the port MTU capability in DCC_CFG_PORT_CONFIG CSR
This can cause a port MTU capability to be set to 0 if MTUs of VLs 0-7 is 0
This would affect the VL15 traffic.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Reviewed-by: Arthur Kepner <arthur.kepner@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: unknown frame messages are not errors
Dean Luick [Tue, 1 Dec 2015 20:38:23 +0000 (15:38 -0500)]
staging/rdma/hfi1: unknown frame messages are not errors

Change reported unknown frame messages into a counter.
These are informational, no errors.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: remove SPC freeze error messages
Dean Luick [Tue, 1 Dec 2015 20:38:22 +0000 (15:38 -0500)]
staging/rdma/hfi1: remove SPC freeze error messages

An SPC freeze is not an error.  Remove the messages.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Unexpected link up pkey values are not an error
Dean Luick [Tue, 1 Dec 2015 20:38:21 +0000 (15:38 -0500)]
staging/rdma/hfi1: Unexpected link up pkey values are not an error

Only warn when link up pkeys are not what we expect.  Also, allow
for the pkey to already be initialized.

Reviewed-by: Arthur Kepner <arthur.kepner@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Destroy workqueues if hfi1_register_ib_device() call returns error
Harish Chegondi [Tue, 1 Dec 2015 20:38:20 +0000 (15:38 -0500)]
staging/rdma/hfi1: Destroy workqueues if hfi1_register_ib_device() call returns error

Currently, if hfi1_register_ib_device() call is unsuccessful, workqueues
are not being destroyed before bailing out. This patch fixes this issue.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Adds software counters for bitfields within various error status...
Joel Rosenzweig [Tue, 1 Dec 2015 20:38:19 +0000 (15:38 -0500)]
staging/rdma/hfi1: Adds software counters for bitfields within various error status fields

Provides error status counters for CceErrStatus, Send*ErrStatus,
RcvErrStatus and MISC_ERR_STATUS

Reviewed-by: Mitko Haralanov <mitko.haralanov@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Joel Rosenzweig <joel.b.rosenzweig@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Correctly limit VLs against SDMA engines
Dean Luick [Tue, 1 Dec 2015 20:38:18 +0000 (15:38 -0500)]
staging/rdma/hfi1: Correctly limit VLs against SDMA engines

Correctly reduce the number of VLs when limited by the number
of SDMA engines.

The hardware has multiple egress mechanisms, SDMA and pio, and multiples
of those. These mechanisms are chosen using the VL (8)

The fix corrects a panic issue with one of the platforms that doesn't have
enough SDMA (4) mechanisms for the typical number of VLs.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Add a credit push on diagpkt allocate fail
Dean Luick [Tue, 1 Dec 2015 20:38:17 +0000 (15:38 -0500)]
staging/rdma/hfi1: Add a credit push on diagpkt allocate fail

When sending a diagnostic packet, if the send context does not
have enough room, force a credit return and try again.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Extend quiet timeout
Dean Luick [Tue, 1 Dec 2015 20:38:16 +0000 (15:38 -0500)]
staging/rdma/hfi1: Extend quiet timeout

The longest quiet timeout is now 6s.  Extend the driver wait to 6s.

The driver wasn't following our internal specification: 6 seconds.
This patch corrects that issue.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Add one-time LCB reset
Dean Luick [Tue, 1 Dec 2015 20:38:15 +0000 (15:38 -0500)]
staging/rdma/hfi1: Add one-time LCB reset

Add one-time LCB reset on driver load to pre-emptively work
around any LCB power cycle issues.

Reviewed-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Fix qp.h comments
Kaike Wan [Tue, 1 Dec 2015 20:38:13 +0000 (15:38 -0500)]
staging/rdma/hfi1: Fix qp.h comments

This patch fixes a few incorrect header file comments in qp.h

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Add aeth name syndrome decode
Dean Luick [Tue, 1 Dec 2015 20:38:12 +0000 (15:38 -0500)]
staging/rdma/hfi1: Add aeth name syndrome decode

Add aeth name syndrome decode to enhance debugging.

The IBTA RC ACK contains an ACK extended transport header.

Part of that header is the syndrome field that qualifies the RC ACK as an
ACK, NAK, or RNR NAK.

Without the patch here is the syndrome decode:
aeth syn 0x00

Here is the decode with the fix:
aeth syn 0x00 ACK

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Decode CNP opcode
Dean Luick [Tue, 1 Dec 2015 20:38:11 +0000 (15:38 -0500)]
staging/rdma/hfi1: Decode CNP opcode

Add CNP opcode decode.

Prior to this patch the trace appeared like:

<idle>-0     [001] d.h. 94062.578932: input_ibhdr: [0000:05:00.0] vl 0
lver 0 sl 0 lnh 2,LRH_BTH dlid 0003 len 6 slid 0001 op 0x80,0x80 se 0 m 0
pad 0 tver 0 pkey 0x8001 f 0 b 0 qpn 0x001234 a 0 psn 0x00000000

Note the "op 0x80,0x80".

With this patch:

<idle>-0     [000] d.h. 233975.912059: input_ibhdr: [0000:05:00.0] vl 0
lver 0 sl 0 lnh 2,LRH_BTH dlid 0015 len 6 slid 0014 op 0x80,CNP se 0 m 0
pad 0 tver 0 pkey 0x8001 f 0 b 0 qpn 0x001234 a 0 psn 0x00000000

Note the "op 0x80,CNP"

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Support alternate firmware names
Dean Luick [Tue, 1 Dec 2015 20:38:10 +0000 (15:38 -0500)]
staging/rdma/hfi1: Support alternate firmware names

Add support for an automatic fallback for firmware names to support
debug-signed and production-signed firmware images.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Eliminate WARN_ON when VL is invalid
Ira Weiny [Sat, 21 Nov 2015 00:43:47 +0000 (19:43 -0500)]
staging/rdma/hfi1: Eliminate WARN_ON when VL is invalid

sdma_select_engine_vl only needs to protect itself from an invalid VL.
Something higher up the stack should be warning the user when they try
to use an SL which maps to an invalid VL.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Ira Weiny <iweiny@gmail.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Fix error in hfi1 driver build
Jubin John [Fri, 20 Nov 2015 23:13:08 +0000 (18:13 -0500)]
staging/rdma/hfi1: Fix error in hfi1 driver build

hfi1 driver build fails with the following error:
In function â€˜handle_receive_interrupt’:
error: implicit declaration of function â€˜skip_rcv_packet’ [-Werror=implicit-function-declaration]
    last = skip_rcv_packet(&packet, thread);
    ^
This is due to the inclusion of the skip_rcv_packet() in the
CONFIG_PRESCAN_RXQ ifdef block. This function is independent of
CONFIG_PRESCAN_RXQ and should be outside this block.

Fixes: 82c2611daaf0 ("staging/rdma/hfi1: Handle packets with invalid RHF on context 0")
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Adjust EPROM partitions, add EPROM commands
Dean Luick [Tue, 17 Nov 2015 02:59:35 +0000 (21:59 -0500)]
staging/rdma/hfi1: Adjust EPROM partitions, add EPROM commands

Add a new EPROM partition, adjusting partition placement.

Add EPROM range commands as a supserset of the partition
commands.  Remove old partition commands.

Enhance EPROM erase, creating a range function and using the
largest erase (sub) commands when possible.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Read EFI variable for device description
Dean Luick [Tue, 17 Nov 2015 02:59:34 +0000 (21:59 -0500)]
staging/rdma/hfi1: Read EFI variable for device description

Read an EFI variable for the device description.  Create the
infrastructure for additional variable reads.

Reviewed-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: rework is_a0() and is_bx()
Mike Marciniszyn [Tue, 17 Nov 2015 02:59:29 +0000 (21:59 -0500)]
staging/rdma/hfi1: rework is_a0() and is_bx()

The current is_bx() will incorrectly match on other steppings.

is_a0() is removed in favor of is_ax().

Reviewed-by: Mark Debbage <mark.debbage@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Add space between concatenated string elements
Jubin John [Tue, 17 Nov 2015 02:59:27 +0000 (21:59 -0500)]
staging/rdma/hfi1: Add space between concatenated string elements

Space between concantenated string elements is more human
readable and fixes the checkpatch issue:
CHECK: Concatenated strings should use spaces between elements

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Remove rcv bubbles code
Ira Weiny [Tue, 17 Nov 2015 02:59:26 +0000 (21:59 -0500)]
staging/rdma/hfi1: Remove rcv bubbles code

Rcv bubbles were improperly calculated for HFIs, fix that here.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Arthur Kepner <arthur.kepner@intel.com>
Signed-off-by: Ira Weiny <iweiny@gmail.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: remove RxCtxRHQS from hfi1stats
Vennila Megavannan [Tue, 17 Nov 2015 02:59:25 +0000 (21:59 -0500)]
staging/rdma/hfi1: remove RxCtxRHQS from hfi1stats

Removed the RxCtxRHQS counter being dumped into dev_cntrs

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Vennila Megavannan <vennila.megavannan@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/rdma/hfi1: Fix downgrade race
Dean Luick [Tue, 17 Nov 2015 02:59:24 +0000 (21:59 -0500)]
staging/rdma/hfi1: Fix downgrade race

A link downgrade can race with link up. Avoid the race
in two ways. First, by having the downgrade application logic
take the link state mutex for all of its checking. Second, by
waiting for the link to move out of the going up state.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoandroid: unconditionally remove callbacks in sync_fence_free()
Dmitry Torokhov [Tue, 15 Dec 2015 01:34:08 +0000 (17:34 -0800)]
android: unconditionally remove callbacks in sync_fence_free()

Using fence->status to determine whether or not there are callbacks
remaining on the sync_fence is racy since fence->status may have been
decremented to 0 on another CPU before fence_check_cb_func() has
completed.  By unconditionally calling fence_remove_callback() for each
fence in the sync_fence, we guarantee that each callback has either
completed (since fence_remove_callback() grabs the fence lock) or been
removed.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/android/sync: add sync_fence_create_dma
Maarten Lankhorst [Fri, 11 Dec 2015 13:11:50 +0000 (13:11 +0000)]
staging/android/sync: add sync_fence_create_dma

This allows users of dma fences to create a android fence.

v2: Added kerneldoc. (Tvrtko Ursulin).

v4: Updated comments from review feedback my Maarten.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: devel@driverdev.osuosl.org
Cc: Riley Andrews <riandrews@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/android/sync: Support sync points created from dma-fences
Maarten Lankhorst [Fri, 11 Dec 2015 13:11:49 +0000 (13:11 +0000)]
staging/android/sync: Support sync points created from dma-fences

Debug output assumes all sync points are built on top of Android sync points
and when we start creating them from dma-fences will NULL ptr deref unless
taught about this.

v4: Corrected patch ownership.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: devel@driverdev.osuosl.org
Cc: Riley Andrews <riandrews@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: android: ashmem.c: destroy slabs when init fails
Wenwei Tao [Tue, 8 Dec 2015 16:15:52 +0000 (00:15 +0800)]
staging: android: ashmem.c: destroy slabs when init fails

when ashmem init fails, destroy the slabs, leave
no garbage.

Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoarm64: dts: Add dts files to enable ION on Hi6220 SoC.
Chen Feng [Mon, 12 Oct 2015 07:00:17 +0000 (15:00 +0800)]
arm64: dts: Add dts files to enable ION on Hi6220 SoC.

Add ION node to enable ION on hi6220 SoC platform

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Yu Dongbin <yudongbin@hisilicon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: android: ion: Add ion driver for Hi6220 SoC platform
Chen Feng [Mon, 12 Oct 2015 07:00:16 +0000 (15:00 +0800)]
staging: android: ion: Add ion driver for Hi6220 SoC platform

Add ion support for hi6220 SoC platform.

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Yu Dongbin <yudongbin@hisilicon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodocs: dts: Add documentation for hi6220 SoC ION node
Chen Feng [Mon, 12 Oct 2015 07:00:15 +0000 (15:00 +0800)]
docs: dts: Add documentation for hi6220 SoC ION node

Documentation for hi6220 SoC ION node

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Yu Dongbin <yudongbin@hisilicon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: bug fix on memory free
Glen Lee [Mon, 21 Dec 2015 05:18:50 +0000 (14:18 +0900)]
staging: wilc1000: bug fix on memory free

Set tx_buffer to NULL not to free again the memory that is already freed,
which could cause system crash when device is failed.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: set hif_drv before it is used
Glen Lee [Mon, 21 Dec 2015 05:18:49 +0000 (14:18 +0900)]
staging: wilc1000: set hif_drv before it is used

We are using hif_drv of vif, so it needs to be set before it is used.
Set hif_drv to vif->hifdrv soon after it is allocated.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove wilc of struct host_if_drv
Glen Lee [Mon, 21 Dec 2015 05:18:48 +0000 (14:18 +0900)]
staging: wilc1000: remove wilc of struct host_if_drv

vif has wilc in it's members so no need to have wilc in host_if_drv.
It is redundant so just remove it and use wilc of vif.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove drv of struct host_if_msg
Glen Lee [Mon, 21 Dec 2015 05:18:47 +0000 (14:18 +0900)]
staging: wilc1000: remove drv of struct host_if_msg

This patch remove drv of struct host_if msg and it's related codes.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove used functions
Glen Lee [Mon, 21 Dec 2015 05:18:46 +0000 (14:18 +0900)]
staging: wilc1000: remove used functions

This patch remove unused functions add_handler_in_list and
remove_handler_in_list, and it's related global variable wfidrv_list and codes.
label fail_timer_2 and it's codes are removed since label is not used anymore.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: change join_req_drv type and it's name
Glen Lee [Mon, 21 Dec 2015 05:18:45 +0000 (14:18 +0900)]
staging: wilc1000: change join_req_drv type and it's name

To use wilc_get_vif_idx instead of the last get_id_from_handler, join_req_drv
needs to be changed it's type with wilc_vif and name as well.
As a result, get_id_from_handler is not used anymore, so remove it.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_set_wfi_drv_handler: pass vif index
Glen Lee [Mon, 21 Dec 2015 05:18:44 +0000 (14:18 +0900)]
staging: wilc1000: wilc_set_wfi_drv_handler: pass vif index

Pass index of vif instead of hif_drv. wilc_get_vif_idx is used to get correct
index of vif.
In the handler function handle_set_wfi_drv_handler, use vif instead of hif_drv,
and use hif_drv_handler->handler instead of hif_drv when deinitialize wilc
device.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use vif index to communicate with wilc device
Glen Lee [Mon, 21 Dec 2015 05:18:43 +0000 (14:18 +0900)]
staging: wilc1000: use vif index to communicate with wilc device

We now have vif index in all functions related with host interface thread.
wilc_get_vif_idx and wilc_get_vif_from_idx are added to get id and vif
respectively.
Relace get_id_from_handler with wilc_get_vif_idx and get_handler_from_id with
wilc_get_vif_from_idx. Remove unused function get_handler_from_id as well.
We get vif where wilc_get_vif_from_idx is called, so pass vif to msg.vif.

There are two get_id_from_handler left. They will be removed in later patch.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: pass struct wilc
Glen Lee [Mon, 21 Dec 2015 05:18:42 +0000 (14:18 +0900)]
staging: wilc1000: pass struct wilc

Pass struct wilc to the following functions. The functions need wilc to
get proper vif using id from wilc device.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: take vif instead of drv in hostIFthread
Glen Lee [Mon, 21 Dec 2015 05:18:41 +0000 (14:18 +0900)]
staging: wilc1000: take vif instead of drv in hostIFthread

In the first patch, we sent vif to hostIFthread. we can use vif instead of
drv in the all functions which handle the commands from cfg operations.
Change first argument host_if_drv with wilc_vif and use hif_drv of wilc_vif.
Pass vif to the functions as well.
In case of timer callback functions, set vif to the data and use vif instead
of hif_drv.
Lastly, initialize u32RcvdAssocRespInfoLen since changing hif_drv with vif
causes one uninitialied build warning.
Now we have vif that currently being used so we can use interface index of
wilc_vif to send to wilc device.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove argument hif_drv
Glen Lee [Mon, 21 Dec 2015 05:18:40 +0000 (14:18 +0900)]
staging: wilc1000: remove argument hif_drv

In previous patch we add new argument vif which has hif_drv in it's member.
Therefore, no need to pass hif_drv in those functions. Remove argument
struct host_if_drv and use hif_drv of vif.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: pass vif to hostIFthread
Glen Lee [Mon, 21 Dec 2015 05:18:39 +0000 (14:18 +0900)]
staging: wilc1000: pass vif to hostIFthread

We will pass vif, which is currently being used as net_device, instead of
hif_dev. This is the first step to use index of vif to pass to the driver.
Add new argument vif to all the functions that send message to hostIFthread and
set vif to msg.vif. As a result, hostIfthread will get vif.
In later patch, we will remove drv of host_if_msg and use vif instead of it.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove duplicate netdev
Glen Lee [Mon, 21 Dec 2015 05:18:38 +0000 (14:18 +0900)]
staging: wilc1000: remove duplicate netdev

There are two net_device pointer which is the same because two structures
are merged into wilc_vif in previous patch. Remove wilc_netdev and change
with ndev.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: change vif to pointer to refence real private data
Glen Lee [Mon, 21 Dec 2015 05:18:37 +0000 (14:18 +0900)]
staging: wilc1000: change vif to pointer to refence real private data

vif of struct has it's own memory which is not necessary because we have
allocated vif from netdev_priv.
Change vif to pointer type and assign vif which is netdev private data.
Change it's operator on related codes as well.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: move perInterface_wlan_t to wilc_vif
Glen Lee [Mon, 21 Dec 2015 05:18:36 +0000 (14:18 +0900)]
staging: wilc1000: move perInterface_wlan_t to wilc_vif

perInterface_wlan_t and wilc_vif are all about interface control informations.
We will combine those two structures and maintain as one network interface
control information.
Move all the members of perInterface_wlan_t to wilc_vif and remove the
structure. Rename perInterace_wlan_t to wilc_vif and rename variable name nic
to vif which is proper name for it.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove unneeded extern variable
Glen Lee [Mon, 21 Dec 2015 05:18:35 +0000 (14:18 +0900)]
staging: wilc1000: remove unneeded extern variable

This patch removes unnedded extern variable WILC_WFI_devs[] which is not used.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove unused files
Glen Lee [Mon, 21 Dec 2015 05:18:34 +0000 (14:18 +0900)]
staging: wilc1000: remove unused files

This patch removes linux_wlan_spi.[ch] which are not used anymore.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_wlan_spi.c: move all the codes to wilc_spi.c
Glen Lee [Mon, 21 Dec 2015 05:18:33 +0000 (14:18 +0900)]
staging: wilc1000: linux_wlan_spi.c: move all the codes to wilc_spi.c

This patch moves all the codes in linux_wlan_spi.c to wilc_spi.c to make
one spi module. Make wilc_spi_tx, wilc_spi_rx and wilc_spi_tx_rx static
functions. Remove function declaration in linux_wlan_spi.h, which is unnedded
now. No modification has been made inside the codes.
linux_wlan_spi.[ch] will be remove in the next patch.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove unneeded function
Glen Lee [Mon, 21 Dec 2015 05:18:32 +0000 (14:18 +0900)]
staging: wilc1000: remove unneeded function

wilc_spi_init in linux_wlan_spi.c is unneeded. It just return true. Rename
_wilc_spi_init in wlan_spi.c to wilc_spi_init.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: rename spi function names
Glen Lee [Mon, 21 Dec 2015 05:18:31 +0000 (14:18 +0900)]
staging: wilc1000: rename spi function names

There are several similar function names, such as wilc_spi_write and
_wilc_spi_write. It is likely to be confused after merging linux_wlan_spi.c and
wilc_spi.c, so rename following functions properly.
Rename wilc_spi_write to wilc_spi_tx, wilc_spi_read to wilc_spi_rx,
wilc_spi_write_read to wilc_spi_tx_rx, _wilc_spi_write to wilc_spi_write,
_wilc_spi_read to wilc_spi_read.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove unused files
Glen Lee [Mon, 21 Dec 2015 05:18:30 +0000 (14:18 +0900)]
staging: wilc1000: remove unused files

This patch removes linux_wlan_sdio.[ch] which is not used anymore.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_wlan_sdio.c: move all the codes to wilc_sdio.c
Glen Lee [Mon, 21 Dec 2015 05:18:29 +0000 (14:18 +0900)]
staging: wilc1000: linux_wlan_sdio.c: move all the codes to wilc_sdio.c

To Combine linux_wlan_sdio.c and wilc_sdio.c as one file, move all the codes
in linux_wlan_sdio.c to wilc_sdio.c, and make functions static only.
No Modification has not been made except static, just moved them.
Function declaration in linux_wlan_sdio.h is needless, so just remove them.
linux_wlan_sdio.[ch] will be deleted in the next patch.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_sdio_probe: use return value
Glen Lee [Mon, 21 Dec 2015 05:18:28 +0000 (14:18 +0900)]
staging: wilc1000: linux_sdio_probe: use return value

Return ret from wilc_netdev_init instead of -1 for proper error handling.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_wlan_spi.c: return linux error value
Glen Lee [Mon, 21 Dec 2015 05:18:27 +0000 (14:18 +0900)]
staging: wilc1000: linux_wlan_spi.c: return linux error value

return linux error value instead of 0 or 1 and use -EINVAL. Related codes
also changed together.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_deinit(): fixes inconsistent returns
Leo Kim [Mon, 21 Dec 2015 05:18:26 +0000 (14:18 +0900)]
staging: wilc1000: wilc_deinit(): fixes inconsistent returns

This patch fixes the warning reported by smatch.
 - wilc_deinit() warn: inconsistent returns 'sem:&hif_drv->sem_cfg_values'

This semaphore protect a cfg_values variable but cfg_values variables was not
used here. So, just remove this line.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_init(): fixes inconsistent returns
Leo Kim [Mon, 21 Dec 2015 05:18:25 +0000 (14:18 +0900)]
staging: wilc1000: wilc_init(): fixes inconsistent returns

This patch fixes the warning reported by smatch.
 - wilc_init() warn: inconsistent returns 'sem:&hif_drv->sem_cfg_values'

No need to up the sema here since down was not called before get here.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: fixes potential null dereference 'wid.val'
Leo Kim [Mon, 21 Dec 2015 05:18:24 +0000 (14:18 +0900)]
staging: wilc1000: fixes potential null dereference 'wid.val'

This patch fixes the error reported by smatch.
 - Handle_ListenStateExpired() error: potential null dereference 'wid.val'
If kmalloc failed, referenced to a NULL pointer.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: replace explicit NULL comparisons with !
Leo Kim [Mon, 21 Dec 2015 05:18:23 +0000 (14:18 +0900)]
staging: wilc1000: replace explicit NULL comparisons with !

This patch replace explicit NULL comparison with ! operator to simplify code.
Reported by checkpatch.pl for Comparison to NULL could be written !XXX" or "XXX".

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_wlan_spi.c: fix NULL comparison style
Glen Lee [Mon, 21 Dec 2015 05:18:22 +0000 (14:18 +0900)]
staging: wilc1000: linux_wlan_spi.c: fix NULL comparison style

This patch fixes checkpatch CHECK:comparison to NULL could be written "b".

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_wlan_spi.c: add a blank
Glen Lee [Mon, 21 Dec 2015 05:18:21 +0000 (14:18 +0900)]
staging: wilc1000: linux_wlan_spi.c: add a blank

This patch fixes checkpatch warning: missing a blank like after declarations.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_wlan_spi.c: remove braces for single statement
Glen Lee [Mon, 21 Dec 2015 05:18:20 +0000 (14:18 +0900)]
staging: wilc1000: linux_wlan_spi.c: remove braces for single statement

This patches fixes checkpatch warning: braces {} are not necessary for single
statement blocks. Remove some comments also.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_sdio_cmd52: return linux error value
Glen Lee [Mon, 21 Dec 2015 05:18:19 +0000 (14:18 +0900)]
staging: wilc1000: wilc_sdio_cmd52: return linux error value

This patch changes return value with linux error value, not 1 or 0.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_sdio_cmd53: return linux error value
Glen Lee [Mon, 21 Dec 2015 05:18:18 +0000 (14:18 +0900)]
staging: wilc1000: wilc_sdio_cmd53: return linux error value

This patch changes return value with linux error value, not 1 or 0.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_wlan_sdio.c: remove braces
Glen Lee [Mon, 21 Dec 2015 05:18:17 +0000 (14:18 +0900)]
staging: wilc1000: linux_wlan_sdio.c: remove braces

This patch fixes checkpatch warning braces{} are not necessary for single
statment blocks.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: linux_wlan_sdio.c: fix checkpatch warning line over 80
Glen Lee [Mon, 21 Dec 2015 05:18:16 +0000 (14:18 +0900)]
staging: wilc1000: linux_wlan_sdio.c: fix checkpatch warning line over 80

This patch fixes checkpatch warning line over 80 characters.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove unused functions
Glen Lee [Mon, 21 Dec 2015 05:18:15 +0000 (14:18 +0900)]
staging: wilc1000: remove unused functions

This patch removes unused function pointer hif_sync and hif_clear_int, and
removes it's related functions sdio_clear_int, sdio_sync, wilc_spi_clear_int
and wilc_spi_sync.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>