firefly-linux-kernel-4.4.55.git
9 years agostaging: sm750fb: add space after close brace
Juston Li [Wed, 15 Jul 2015 04:14:36 +0000 (21:14 -0700)]
staging: sm750fb: add space after close brace

Fixes checkpatch.pl error:
ERROR: space required after that close brace '}'

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: add space before open brace
Juston Li [Wed, 15 Jul 2015 04:14:35 +0000 (21:14 -0700)]
staging: sm750fb: add space before open brace

Fixes checkpatch.pl error:
ERROR: space required before the open brace '{'

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove space between function name and parenthesis
Juston Li [Wed, 15 Jul 2015 04:14:34 +0000 (21:14 -0700)]
staging: sm750fb: remove space between function name and parenthesis

Fixes checkpatch.pl warning:
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: add space before open parenthesis
Juston Li [Wed, 15 Jul 2015 04:14:33 +0000 (21:14 -0700)]
staging: sm750fb: add space before open parenthesis

Fixes checkpatch.pl error:
ERROR: space required before the open parenthesis '('

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove space before close parenthesis
Juston Li [Wed, 15 Jul 2015 04:14:32 +0000 (21:14 -0700)]
staging: sm750fb: remove space before close parenthesis

Fixes checkpatch.pl error:
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove spacing after open parenthesis
Juston Li [Wed, 15 Jul 2015 04:14:31 +0000 (21:14 -0700)]
staging: sm750fb: remove spacing after open parenthesis

Fixes checkpatch.pl warning:
ERROR: space prohibited after that open parenthesis '('

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: use tabs for indentation
Juston Li [Wed, 15 Jul 2015 04:14:30 +0000 (21:14 -0700)]
staging: sm750fb: use tabs for indentation

Replace spaces with tabs for indentation to fix the checkpatch.pl error
ERROR: code indent should use tabs where possible
WARNING: please, no spaces at the start of a line

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme_user: remove okcount variable
Dmitry Kalinkin [Fri, 26 Jun 2015 20:39:44 +0000 (23:39 +0300)]
staging: vme_user: remove okcount variable

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme_user: remove distracting comment
Dmitry Kalinkin [Fri, 26 Jun 2015 20:39:43 +0000 (23:39 +0300)]
staging: vme_user: remove distracting comment

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme_user: remove unused variable
Dmitry Kalinkin [Fri, 26 Jun 2015 20:39:42 +0000 (23:39 +0300)]
staging: vme_user: remove unused variable

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme_user: switch to returning -EFAULT on __copy_*_user errors
Dmitry Kalinkin [Fri, 26 Jun 2015 20:39:41 +0000 (23:39 +0300)]
staging: vme_user: switch to returning -EFAULT on __copy_*_user errors

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme_user: allow large read()/write()
Dmitry Kalinkin [Fri, 26 Jun 2015 20:39:40 +0000 (23:39 +0300)]
staging: vme_user: allow large read()/write()

This changes large master transfers to do shorter read/write rather than
return -EINVAL. User space will now be able to optimistically request a
large transfer and get at least some data.

This also removes comments suggesting on how to implement large
transfers. Current vme_master_* read and write implementations use CPU
copies that don't produce burst PCI accesses and subsequently no block
transfer on VME bus. In the end overall performance is quiet low and it
can't be fixed by doing direct copy to user space. Much easier solution
would be to just reuse kernel buffer.

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme_user: fix kmalloc style
Dmitry Kalinkin [Fri, 26 Jun 2015 20:39:39 +0000 (23:39 +0300)]
staging: vme_user: fix kmalloc style

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme_user: fix NULL comparison style
Dmitry Kalinkin [Fri, 26 Jun 2015 20:39:38 +0000 (23:39 +0300)]
staging: vme_user: fix NULL comparison style

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme_user: fix blank lines
Dmitry Kalinkin [Fri, 26 Jun 2015 20:39:37 +0000 (23:39 +0300)]
staging: vme_user: fix blank lines

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vme_user: fix code alignment
Dmitry Kalinkin [Fri, 26 Jun 2015 20:39:36 +0000 (23:39 +0300)]
staging: vme_user: fix code alignment

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging:vt6655: remove checks around dev_kfree_skb
Maninder Singh [Wed, 15 Jul 2015 03:22:51 +0000 (08:52 +0530)]
staging:vt6655: remove checks around dev_kfree_skb

dev_kfree_skb checks for NULL pointer itself,
Thus no need of explicit NULL check.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ion: debugfs to shrink pool
Gioh Kim [Mon, 6 Jul 2015 06:14:41 +0000 (15:14 +0900)]
staging: ion: debugfs to shrink pool

This patch enables debugfs file /sys/kernel/debug/ion/heaps/system_shrink
to shrink pool and get pool size. This technically enables debugfs
shrinking for all heaps, not just the system heap although the system heap
is the only one with a shrinker right now. It is already implemented
but not complete. This patch completes and enables it.

Reading the file returns pool size
in page unit and writing the number of pages shrinks pool.
It flushes all pages to write zero at the file.

Signed-off-by: Gioh Kim <gioh.kim@lge.com>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ion: shrink page-pool by page unit
Gioh Kim [Mon, 6 Jul 2015 06:14:40 +0000 (15:14 +0900)]
staging: ion: shrink page-pool by page unit

This patch shrink page-pool by page unit.

The system shrinker calls ion_heap_shrink_count() to get nr_to_scan,
and pass it to ion_heap_shrink_scan().
The problem is the return value of ion_heap_shrink_count() is the number
of pages but ion_system_heap_shrink(), which is called by
ion_heap_shrink_scan(), gets the number of chunk.

The main root of this is that ion_page_pool_shrink() returns page count
via ion_page_pool_total() if it have to check pool size. But it frees
chunks of pages if it have to free pools.

This patch first fix ion_page_pool_shrink() to count only pages,
not chunks. And then ion_system_heap_shrink() to work on pages.

Signed-off-by: Gioh Kim <gioh.kim@lge.com>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192e: Replace memset with eth_zero_addr
Vaishali Thakkar [Fri, 26 Jun 2015 04:07:25 +0000 (09:37 +0530)]
Staging: rtl8192e: Replace memset with eth_zero_addr

Use eth_zero_addr to assign the zero address to the given address
array instead of memset when second argument is address of zero.
Note that the 6 in the third argument of memset appears to represent
an ethernet address size (ETH_ALEN).

The Coccinelle semantic patch that makes this change is as follows:

// <smpl>
@eth_zero_addr@
expression e;
@@

-memset(e,0x00,6);
+eth_zero_addr(e);
// </smpl>

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: rtllib_softmac: Make functions static
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:26 +0000 (22:04 +0200)]
staging: rtl8192e: rtllib_softmac: Make functions static

Make as many functions as possible static in rtllib_softmac.c.

The following functions were affected:
- rtllib_sta_wakeup
- rtllib_TURBO_Info
- rtllib_get_beacon_
- rtllib_send_probe_requests
- rtllib_update_active_chan_map
- rtllib_softmac_scan_syncro

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Make rtllib_rx_mgt() static
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:25 +0000 (22:04 +0200)]
staging: rtl8192e: Make rtllib_rx_mgt() static

Function is not referenced outside of rtllib_rx.c

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: rtllib_tx: Make functions static
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:24 +0000 (22:04 +0200)]
staging: rtl8192e: rtllib_tx: Make functions static

Make as many functions as possible static in rtllib_tx.c.

The following functions were affected:
- rtllib_xmit_inter
- rtllib_query_seqnum
- rtllib_put_snap

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Make rtl8192_QueryIsShort() static
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:23 +0000 (22:04 +0200)]
staging: rtl8192e: Make rtl8192_QueryIsShort() static

Relocate function within file to avoid unnecessary fw decl.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: r8192e_phy: Make functions static
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:22 +0000 (22:04 +0200)]
staging: rtl8192e: r8192e_phy: Make functions static

Make as many functions as possible static in r8192E_phy.c.

The following functions were affected:
- rtl8192_phyConfigBB
- rtl8192_SwChnl_WorkItem
- rtl8192_SetBWModeWorkItem

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: rtl_core: Make functions static
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:21 +0000 (22:04 +0200)]
staging: rtl8192e: rtl_core: Make functions static

Make as many functions as possible static in rtl_core.c.
If needed - move fw declaration from header.

The following functions were affected:
- rtl8192_is_tx_queue_empty
- rtl819x_watchdog_wqcallback
- watch_dog_timer_callback
- rtl8192_data_hard_stop
- rtl8192_data_hard_resume
- rtl8192_hard_data_xmit
- rtl8192_hard_start_xmit
- rtl8192_tx_cmd
- rtl8192_tx
- rtl8192_pci_initdescring
- rtl8192_irq_tx_tasklet
- rtl8192_irq_rx_tasklet
- rtl8192_cancel_deferred_work
- _rtl8192_up
- rtl8192_up
- rtl8192_down
- rtl8192_restart
- rtl8192_update_cap

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Make phy_RF8256_Config_ParaFile() static
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:20 +0000 (22:04 +0200)]
staging: rtl8192e: Make phy_RF8256_Config_ParaFile() static

Relocate function in driver to avoid adding unnecessary fw decl.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: rtllib_HTProc: Make functions static
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:19 +0000 (22:04 +0200)]
staging: rtl8192e: rtllib_HTProc: Make functions static

Make as many functions as possible static in rtllib_HTProc.c.

The following functions were affected:
- HTMcsToDataRate
- HTFilterMCSRate

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: rtl_dm: Make functions static
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:18 +0000 (22:04 +0200)]
staging: rtl8192e: rtl_dm: Make functions static

Make as many functions as possible static in rtllib_dm.c.

The following functions were affected:
- dm_check_fsync
- dm_CheckRfCtrlGPIO
- dm_fsync_timer_callback

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove rtl8192_rx_cmd()
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:17 +0000 (22:04 +0200)]
staging: rtl8192e: Remove rtl8192_rx_cmd()

Function is empty.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: probe: Remove bdma64 check
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:16 +0000 (22:04 +0200)]
staging: rtl8192e: probe: Remove bdma64 check

It is always false.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove rtl819x_process_cck_rxpathsel()
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:15 +0000 (22:04 +0200)]
staging: rtl8192e: Remove rtl819x_process_cck_rxpathsel()

Function is empty.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove DMESG macro
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:14 +0000 (22:04 +0200)]
staging: rtl8192e: Remove DMESG macro

It is used in several places, but expands to nothing.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove read|write_nic_io_(d)word|byte()
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:13 +0000 (22:04 +0200)]
staging: rtl8192e: Remove read|write_nic_io_(d)word|byte()

None of this functions was used.
Also remove PlatformIOCheckPageLegalAndGetRegMask() used by them.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove DOT11D_GetMaxTxPwrInDbm()
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:12 +0000 (22:04 +0200)]
staging: rtl8192e: Remove DOT11D_GetMaxTxPwrInDbm()

Function is not used.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove unused rtllib_device::freq_band
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:11 +0000 (22:04 +0200)]
staging: rtl8192e: Remove unused rtllib_device::freq_band

Member is never referenced.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove unused ether_header structure
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:10 +0000 (22:04 +0200)]
staging: rtl8192e: Remove unused ether_header structure

Structure is not used in the driver.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove rtllib_stats structure
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:09 +0000 (22:04 +0200)]
staging: rtl8192e: Remove rtllib_stats structure

Two remaining fields of rtllib_stats are only incremented, but
never read.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove unused fields from rtllib_stats
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:08 +0000 (22:04 +0200)]
staging: rtl8192e: Remove unused fields from rtllib_stats

None of them are used in the driver.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove unused enums
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:07 +0000 (22:04 +0200)]
staging: rtl8192e: Remove unused enums

Remove ack_policy enum and some unused RTL_DEBUG enums.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove undefs
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:06 +0000 (22:04 +0200)]
staging: rtl8192e: Remove undefs

They relate to macros that are not used in the driver.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove unused defines
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:05 +0000 (22:04 +0200)]
staging: rtl8192e: Remove unused defines

Remove most of unused defines (excluding phyreg/hw registers).

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove ToLegalChannel()
Mateusz Kulikowski [Tue, 14 Jul 2015 20:04:04 +0000 (22:04 +0200)]
staging: rtl8192e: Remove ToLegalChannel()

Function is not used.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: Drop owner assignment from i2c_driver
Krzysztof Kozlowski [Fri, 10 Jul 2015 06:34:28 +0000 (15:34 +0900)]
staging: Drop owner assignment from i2c_driver

i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: style fix for octeon/ethernet-tx.c
Jacob Kiefer [Fri, 10 Jul 2015 05:26:30 +0000 (01:26 -0400)]
staging: style fix for octeon/ethernet-tx.c

Broke line with greater than 80 characters into two lines and
improved logical operator readability in hardware checksum if statement.

Signed-off-by: Jacob Kiefer <jtk54@cornell.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rts5208: Fix checkpatch warning: else is not generally useful
Leung Timothy Chi King [Wed, 1 Jul 2015 16:44:13 +0000 (09:44 -0700)]
Staging: rts5208: Fix checkpatch warning: else is not generally useful

The following checkpatch warning was fixed:

WARNING: else is not generally useful after a break or return

Signed-off-by: Leung Timothy Chi King <contact@timothyleung.co>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: ozwpan: ozusbsvc1.c: Fix missing blank line after declarations
Johannes Postma [Wed, 8 Jul 2015 12:41:46 +0000 (13:41 +0100)]
Staging: ozwpan: ozusbsvc1.c: Fix missing blank line after declarations

This patch fixes a missing line after declarations issue.

Signed-off-by: Johannes Postma <jgmpostma@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: fold rtl8188e_read_chip_version() into rtl8188e_SetHalODMVar()
Jakub Sitnicki [Fri, 10 Jul 2015 16:52:21 +0000 (18:52 +0200)]
staging: rtl8188eu: fold rtl8188e_read_chip_version() into rtl8188e_SetHalODMVar()

Both rtl8188e_read_chip_version() and ReadChipVersion8188E() are used
only in one place.  Make ReadChipVersion8188E() a void function and
eliminate its wrapper - rtl8188e_read_chip_version().

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: remove ROMVer from struct HAL_VERSION
Jakub Sitnicki [Fri, 10 Jul 2015 16:52:20 +0000 (18:52 +0200)]
staging: rtl8188eu: remove ROMVer from struct HAL_VERSION

ROM version on RTL8188EU is always 0.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: remove RFtype from struct HAL_VERSION
Jakub Sitnicki [Fri, 10 Jul 2015 16:52:19 +0000 (18:52 +0200)]
staging: rtl8188eu: remove RFtype from struct HAL_VERSION

RFtype in struct HAL_VERSION duplicates rf_type in struct
hal_data_8188e, and does not change.  Remove it and the macros that test
it.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: remove ICtype from struct HAL_VERSION
Jakub Sitnicki [Fri, 10 Jul 2015 16:52:18 +0000 (18:52 +0200)]
staging: rtl8188eu: remove ICtype from struct HAL_VERSION

IC type on RTL8188EU is always 8188E.  Remove it and all the macros that
check it.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: remove RegulatorMode from struct hal_data_8188e
Jakub Sitnicki [Fri, 10 Jul 2015 16:52:17 +0000 (18:52 +0200)]
staging: rtl8188eu: remove RegulatorMode from struct hal_data_8188e

This field is not used anywhere.  Also, kill the rt_regulator_mode enum
which exists just for this field.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: core: Fixed 80 character length warning
Sreenath Madasu [Wed, 8 Jul 2015 22:43:00 +0000 (18:43 -0400)]
staging: rtl8188eu: core: Fixed 80 character length warning

When the checkpatch.pl script was run, it showed lines with length
more than 80 characters in rtw_ap.c file. Fixed line number 382 by
breaking it up into two lines within 80 characters.

Signed-off-by: Sreenath Madasu <Sreenath.Madasu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: core: rtw_mlme: remove space before ','
Sunil Shahu [Tue, 7 Jul 2015 09:25:44 +0000 (14:55 +0530)]
staging: rtl8188eu: core: rtw_mlme: remove space before ','

Fix coding style error by removing spaces before ',' as suggested by
checkpatch.pl script.

Signed-off-by: Sunil Shahu <shshahu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging:rtl8188eu: Code cleanup fix reported by coccinelle
Prasanna Karthik [Mon, 29 Jun 2015 12:57:35 +0000 (12:57 +0000)]
staging:rtl8188eu: Code cleanup fix reported by coccinelle

bool check modified

Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: don't duplicate ieee80211 WLAN_CAPABILITY_* constants
Jakub Sitnicki [Fri, 26 Jun 2015 05:50:34 +0000 (07:50 +0200)]
staging: rtl8188eu: don't duplicate ieee80211 WLAN_CAPABILITY_* constants

linux/ieee80211.h already defines constants for capability bits.
Include it where needed, resolve discrepancies in naming, and remove the
duplicated definitions.

Also, make use of WLAN_CAPABILITY_IS_STA_BSS() macro to check if neither
ESS nor IBSS capability bits are set.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm7xxfb: use kernel commandline
Sudip Mukherjee [Tue, 7 Jul 2015 08:14:35 +0000 (13:44 +0530)]
staging: sm7xxfb: use kernel commandline

We were only using the kernel commandline to set the mode if this driver
is builtin, but when it is built as a module we were not having any way
to set the mode. Start using commandline even if it is built as a
module.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm7xxfb: fix error handling
Sudip Mukherjee [Tue, 7 Jul 2015 08:14:34 +0000 (13:44 +0530)]
staging: sm7xxfb: fix error handling

We were checking smtc_regbaseaddress and that too at a place where it
can never be NULL. Real check should be on sfb->lfb immediately after
we do ioremap.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm7xxfb: remove unused macros
Sudip Mukherjee [Tue, 7 Jul 2015 08:14:33 +0000 (13:44 +0530)]
staging: sm7xxfb: remove unused macros

These macros were only defined but not used anywhere.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: speakup: fix indentation
Luis de Bethencourt [Thu, 25 Jun 2015 12:56:13 +0000 (14:56 +0200)]
staging: speakup: fix indentation

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: mt29f_spinand: Remove redundant spi driver bus initialization
Antonio Borneo [Tue, 23 Jun 2015 14:52:39 +0000 (22:52 +0800)]
staging: mt29f_spinand: Remove redundant spi driver bus initialization

In ancient times it was necessary to manually initialize the bus
field of an spi_driver to spi_bus_type. These days this is done in
spi_register_driver(), so we can drop the manual assignment.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/xgifb: Move register helper functions to header
Peter Huewe [Mon, 13 Jul 2015 22:44:09 +0000 (00:44 +0200)]
staging/xgifb: Move register helper functions to header

and mark them as static inline.
This shrinks the compiled module from 137442 to 117732 bytes and we also
get rid of vb_util.c

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: xgifb: prefer using the BIT macro
Hari Prasath Gujulan Elango [Thu, 9 Jul 2015 06:05:09 +0000 (06:05 +0000)]
staging: xgifb: prefer using the BIT macro

This patch uses the  BIT macro for bit shift operation.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agortl8712:Fix checkpatch warning
Ravi Teja Darbha [Mon, 29 Jun 2015 20:48:56 +0000 (02:18 +0530)]
rtl8712:Fix checkpatch warning

Fix line over 80 characters warning.

Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8712: rtl871x_security.c: remove unnecessary variable initialization
Sunil Shahu [Fri, 26 Jun 2015 14:12:24 +0000 (19:42 +0530)]
staging: rtl8712: rtl871x_security.c: remove unnecessary variable initialization

Variable "u32 c" always re-initialize in for loop.
Initialized value of "u32 c" is not used in function
and is redundant, hence removed.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sunil Shahu <shshahu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agodrivers: staging: rtl8712: remove unnecessary else statement
Sunil Shahu [Mon, 22 Jun 2015 11:28:41 +0000 (16:58 +0530)]
drivers: staging: rtl8712: remove unnecessary else statement

"else" statement after "if" is unnecessary, hence removed.

Signed-off-by: Sunil Shahu <shshahu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ft1000: convert pack pragma to __packed
Giedrius Statkevičius [Thu, 25 Jun 2015 17:34:43 +0000 (20:34 +0300)]
staging: ft1000: convert pack pragma to __packed

Convert a Microsoft compiler specific directive "#pragma pack(1)" to a
GCC equivalent __packed. Also, by doing this we save
ourselves from trouble if any other struct definitions are added after
the #pragma because it will be applied to all of the definitions
following it.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ft1000-usb: shorten lines to under 80 characters
Peter Karlsson [Sun, 21 Jun 2015 11:29:51 +0000 (13:29 +0200)]
staging: ft1000-usb: shorten lines to under 80 characters

Wrap function arguments to shorten lines to under 80 characters.

Signed-off-by: Peter Karlsson <peter@zapto.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ft1000-usb: fixed table alignment
Peter Karlsson [Sun, 21 Jun 2015 11:29:50 +0000 (13:29 +0200)]
staging: ft1000-usb: fixed table alignment

Fixed alignment to 8 bytes per line.

Signed-off-by: Peter Karlsson <peter@zapto.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Replace memset with eth_zero_addr
Vaishali Thakkar [Fri, 26 Jun 2015 04:24:00 +0000 (09:54 +0530)]
Staging: rtl8192u: Replace memset with eth_zero_addr

Use eth_zero_addr to assign the zero address to the given address
array instead of memset when second argument is address of zero.
Note that the 6 in the third argument of memset appears to represent
an ethernet address size (ETH_ALEN).

The Coccinelle semantic patch that makes this change is as follows:

// <smpl>
@eth_zero_addr@
expression e;
@@

-memset(e,0x00,6);
+eth_zero_addr(e);
// </smpl>

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agodrivers: staging: rtl8192u: Fix "space required after that ','" errors
Greg Donald [Sat, 20 Jun 2015 16:06:48 +0000 (11:06 -0500)]
drivers: staging: rtl8192u: Fix "space required after that ','" errors

Fix checkpatch.pl "space required after that ','" errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging:rtl8723au:odm.c:Removing trailing whitespaces
Joglekar Tejas [Sat, 20 Jun 2015 12:46:16 +0000 (12:46 +0000)]
staging:rtl8723au:odm.c:Removing trailing whitespaces

This patch removes the trailing whitespace error given
by checkpatch.pl

Signed-off-by: Joglekar Tejas <tjogleka@visteon.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: vt6655: Remove do { } while (0) from single-statement macros in upc.h.
Nicholas Parkanyi [Sun, 12 Jul 2015 12:17:52 +0000 (08:17 -0400)]
Staging: vt6655: Remove do { } while (0) from single-statement macros in upc.h.

This patch fixes checkpatch.pl warnings in upc.h regarding single-statement macros
embedded within do { } while (0) blocks.

Signed-off-by: Nicholas Parkanyi <n.parkanyi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: vt6655: Replace C99 comments in rf.h and rf.c.
Nicholas Parkanyi [Sun, 12 Jul 2015 13:20:31 +0000 (09:20 -0400)]
Staging: vt6655: Replace C99 comments in rf.h and rf.c.

This patch replaces C99 comments in rf.h and rf.c, with
C89 comments, fixing the checkpatch.pl errors.

Signed-off-by: Nicholas Parkanyi <n.parkanyi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: Fix missing power saving support
Malcolm Priestley [Thu, 9 Jul 2015 16:01:25 +0000 (17:01 +0100)]
staging: vt6655: Fix missing power saving support

Add IEEE80211_HW_SUPPORTS_PS to ieee80211_hw flags
enabling this feature.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: Correct listen interval TBTT wake up
Malcolm Priestley [Sun, 21 Jun 2015 10:05:55 +0000 (11:05 +0100)]
staging: vt6655: Correct listen interval TBTT wake up

PSbIsNextTBTTWakeUp is called at beacon intervals.

The should listen to next beacon on count down of wake_up_count == 1.

This restores this back to vendors code but modified for mac80211.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: vnt_tx_packet don't wakeup from power saving.
Malcolm Priestley [Sun, 21 Jun 2015 10:05:54 +0000 (11:05 +0100)]
staging: vt6655: vnt_tx_packet don't wakeup from power saving.

mac80211 changes the wake state before attempting to tx data

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6656: Fixed two lines over 80 characters long
Arjun Krishna Babu [Sat, 20 Jun 2015 04:46:50 +0000 (12:46 +0800)]
staging: vt6656: Fixed two lines over 80 characters long

The presence of comments originally caused the two lines
to be over 80 characters long.

The issue is fixed by moving the comments into a separate line.

Signed-off-by: Arjun Krishna Babu <arjunkrishnababu96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: Add support for the Ultrachip UC1611 LCD controller
Henri Chain [Tue, 14 Jul 2015 12:59:39 +0000 (14:59 +0200)]
Staging: fbtft: Add support for the Ultrachip UC1611 LCD controller

This is a driver chip for 240x160 4-bit greyscale LCDs.
It is capable of 4-wire (8 bit) or 3-wire (9 bit) SPI that have both been
tested. (It also has a 6800 or 8080-style parallel interface, but I have
not included support for it.)

Signed-off-by: Henri Chain <henri.chain@eleves.ec-nantes.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: Add reset to fbtft_init_display_dt()
Noralf Trønnes [Sat, 11 Jul 2015 16:57:04 +0000 (18:57 +0200)]
staging: fbtft: Add reset to fbtft_init_display_dt()

When an init sequence is present in the Device Tree,
fbtft_init_display_dt() is used to initialize the display.
Add missing reset function call and activation of
chip select for parallel bus.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: Fix spacing coding style issue
Fabio Falzoi [Tue, 30 Jun 2015 06:43:17 +0000 (08:43 +0200)]
Staging: fbtft: Fix spacing coding style issue

This patch fixes the following checkpatch.pl error:

CHECK:SPACING at line 318.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: Fix parenthesis alignment coding style issue
Fabio Falzoi [Tue, 30 Jun 2015 06:43:16 +0000 (08:43 +0200)]
Staging: fbtft: Fix parenthesis alignment coding style issue

This patch fixes the following checkpatch.pl error:

CHECK:PARENTHESIS_ALIGNMENT at line 217.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: Remove unnecessary multiple blank lines
Fabio Falzoi [Tue, 30 Jun 2015 06:43:09 +0000 (08:43 +0200)]
Staging: fbtft: Remove unnecessary multiple blank lines

This patch removes some unnecessary multiple blank lines to fix the
following checkpatch errors:

CHECK:LINE_SPACING at lines 29, 67, 131, 287, 299, 312, 326, 351 and
364.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: Remove paragraph about writing to FSF
Fabio Falzoi [Tue, 30 Jun 2015 06:43:08 +0000 (08:43 +0200)]
Staging: fbtft: Remove paragraph about writing to FSF

Remove paragraph about writing to the Free Software Foundation's
mailing address from GPL notice.
This patch fixes the following checkpatch error:

CHECK:FSF_MAILING_ADDRESS at line 17.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: fix random hangs with network stress in visornic
Tim Sell [Tue, 14 Jul 2015 18:43:30 +0000 (14:43 -0400)]
staging: unisys: fix random hangs with network stress in visornic

We learned that it was possible for the core networking code to call
visornic_xmit() within ISR context, resulting in the need for us to
use spin_lock_irqsave() / spin_lock_irqrestore() to lock accesses to our
virtual device channels.

Without the correct locking added in this patch, random hangs would occur
on typical kernels while stressing the netork.  When using a kernel with
CONFIG_DEBUG_SPINLOCK=y, a stackdump would occur at the time of the hang
reporting:

    BUG: spinlock recursion on CPU#0, vnic_incoming/<pid>

(see below for more details)

We considered the possibility of adding a protocol between a visordriver
and visorbus where the visordriver could specify which type of locking it
required for its virtual device channels (essentially indicating whether
or not it was possible for the channel to be accessed in ISR context), but
decided this extra complexity was NOT needed, and that channel queues
should always be accessed with the most-stringent locking.  So that is
what is implemented in this commit.

Below is an example stackdump illustrating the spinlock recursion that is
fixed by this commit.  Note that we are first in virtnic_rx() writing to
the device channel when an APIC timer interrupt occurs.  Within the core
networking code, net_rx_action() calls process_backlog(), which eventually
lands up back up in virtnic_xmit() in the code attempting to also write to
the device channel.

    BUG: spinlock recursion on CPU#0, vnic_incoming/262
     lock: 0xffff88002db810c0, .magic: dead4ead, .owner: vnic_incoming/262,
                               .owner_cpu: 0
    CPU: 0 PID: 262 Comm: vnic_incoming
                    Tainted: G         C      4.2.0-rc1-ARCH+ #56
    Hardware name: Dell Inc. PowerEdge T110/ , BIOS 1.23 12/15/2009
     ffff8800216ac200 ffff88002c803388 ffffffff81476364 0000000000000106
     ffff88002db810c0 ffff88002c8033a8 ffffffff8109e2bc ffff88002db810c0
     ffffffff817631d4 ffff88002c8033c8 ffffffff8109e330 ffff88002db810c0
    Call Trace:
     <IRQ>  [<ffffffff81476364>] dump_stack+0x4f/0x73
     [<ffffffff8109e2bc>] spin_dump+0x7c/0xc0
     [<ffffffff8109e330>] spin_bug+0x30/0x40
     [<ffffffff8109e547>] do_raw_spin_lock+0x127/0x140
     [<ffffffff8147bad0>] _raw_spin_lock+0x40/0x50
     [<ffffffffa0151fa6>] ? visorchannel_signalinsert+0x46/0x70 [visorbus]
     [<ffffffffa0151fa6>] visorchannel_signalinsert+0x46/0x70 [visorbus]
     [<ffffffffa01683a2>] visornic_xmit+0x302/0x5d0 [visornic]
     [<ffffffff813b2f30>] dev_hard_start_xmit+0x2e0/0x510
     [<ffffffff813b2b75>] ? validate_xmit_skb+0x235/0x310
     [<ffffffff813d79e7>] sch_direct_xmit+0xf7/0x1d0
     [<ffffffff813b34d3>] __dev_queue_xmit+0x203/0x640
     [<ffffffff813b3320>] ? __dev_queue_xmit+0x50/0x640
     [<ffffffff813f3f6f>] ? ip_finish_output+0x1df/0x310
     [<ffffffff813b3933>] dev_queue_xmit_sk+0x13/0x20
     [<ffffffff813f3a5c>] ip_finish_output2+0x22c/0x470
     [<ffffffff813f3f6f>] ? ip_finish_output+0x1df/0x310
     [<ffffffff810987e0>] ? __lock_is_held+0x50/0x70
     [<ffffffff813f3f6f>] ip_finish_output+0x1df/0x310
     [<ffffffff813f4c31>] ip_output+0xb1/0x100
     [<ffffffff813f41be>] ip_local_out_sk+0x3e/0x80
     [<ffffffff813f4388>] ip_queue_xmit+0x188/0x4a0
     [<ffffffff813f4200>] ? ip_local_out_sk+0x80/0x80
     [<ffffffff8139fcd6>] ? __alloc_skb+0x86/0x1e0
     [<ffffffff8140bd5b>] tcp_transmit_skb+0x4cb/0x9c0
     [<ffffffff8139f0dc>] ? __kmalloc_reserve+0x3c/0x90
     [<ffffffff8139fcea>] ? __alloc_skb+0x9a/0x1e0
     [<ffffffff8140c47d>] tcp_send_ack+0x10d/0x150
     [<ffffffff814060ee>] __tcp_ack_snd_check+0x5e/0x90
     [<ffffffff81408eb4>] tcp_rcv_established+0x354/0x710
     [<ffffffff81412182>] tcp_v4_do_rcv+0x162/0x3f0
     [<ffffffff81414412>] tcp_v4_rcv+0xb22/0xb50
     [<ffffffff813ee2bc>] ? ip_local_deliver_finish+0x4c/0x2d0
     [<ffffffff813ee350>] ip_local_deliver_finish+0xe0/0x2d0
     [<ffffffff813ee2bc>] ? ip_local_deliver_finish+0x4c/0x2d0
     [<ffffffff813ee72e>] ip_local_deliver+0xae/0xc0
     [<ffffffff813edeaf>] ip_rcv_finish+0x14f/0x510
     [<ffffffff813aab2d>] ? __netif_receive_skb_core+0x9d/0xb70
     [<ffffffff813eea13>] ip_rcv+0x2d3/0x3b0
     [<ffffffff81097110>] ? cpuacct_css_alloc+0xb0/0xb0
     [<ffffffff813ab0f3>] __netif_receive_skb_core+0x663/0xb70
     [<ffffffff813aab2d>] ? __netif_receive_skb_core+0x9d/0xb70
     [<ffffffff810971a9>] ? cpuacct_charge+0x99/0xb0
     [<ffffffff81097110>] ? cpuacct_css_alloc+0xb0/0xb0
     [<ffffffff810987e0>] ? __lock_is_held+0x50/0x70
     [<ffffffff813ab72c>] ? process_backlog+0xbc/0x150
     [<ffffffff813ab78b>] ? process_backlog+0x11b/0x150
     [<ffffffff813ab627>] __netif_receive_skb+0x27/0x70
     [<ffffffff813ab702>] process_backlog+0x92/0x150
     [<ffffffff813afffd>] net_rx_action+0x13d/0x350
     [<ffffffff81036b2d>] ? lapic_next_event+0x1d/0x30
     [<ffffffff81058694>] __do_softirq+0x104/0x320
     [<ffffffff810c0788>] ? hrtimer_interrupt+0xc8/0x1a0
     [<ffffffff81074e70>] ? blocking_notifier_chain_cond_register+0x70/0x70
     [<ffffffff81058ab9>] irq_exit+0x79/0xa0
     [<ffffffff8147ecca>] smp_apic_timer_interrupt+0x4a/0x60
     [<ffffffff8147d2c8>] apic_timer_interrupt+0x68/0x70
     <EOI>  [<ffffffff81271c02>] ? __memcpy+0x12/0x20
     [<ffffffffa01517da>] ? visorchannel_write+0x4a/0x80 [visorbus]
     [<ffffffffa0151eb8>] signalinsert_inner+0x88/0x130 [visorbus]
     [<ffffffffa0151fb5>] visorchannel_signalinsert+0x55/0x70 [visorbus]
     [<ffffffffa0166e57>] visornic_rx+0x12e7/0x19d0 [visornic]
     [<ffffffffa01677c9>] process_incoming_rsps+0x289/0x690 [visornic]
     [<ffffffff814771c5>] ? preempt_schedule+0x25/0x30
     [<ffffffff81001026>] ? ___preempt_schedule+0x12/0x14
     [<ffffffff81093080>] ? wait_woken+0x90/0x90
     [<ffffffffa0167540>] ? visornic_rx+0x19d0/0x19d0 [visornic]
     [<ffffffffa0167540>] ? visornic_rx+0x19d0/0x19d0 [visornic]
     [<ffffffff81073a39>] kthread+0xe9/0x110
     [<ffffffff81073950>] ? __init_kthread_worker+0x70/0x70
     [<ffffffff8147c89f>] ret_from_fork+0x3f/0x70
     [<ffffffff81073950>] ? __init_kthread_worker+0x70/0x70

Fixes: b12fdf7da ('staging: unisys: rework signal remove/insert to avoid sparse lock warnings')
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Lock visorchannels associated with devices
David Kershner [Tue, 14 Jul 2015 18:43:29 +0000 (14:43 -0400)]
staging: unisys: Lock visorchannels associated with devices

A visorchannel associated with a device should have its writing to
the channel protected by a lock.

Fixes: b32c4997c ('staging: unisys: Move channel creation up the stack')
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Reduce indent
Christophe JAILLET [Mon, 13 Jul 2015 18:52:26 +0000 (20:52 +0200)]
staging: unisys: Reduce indent

Remove some extra tabs in order to improve readalibility.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Use kzalloc instead of kmalloc/memset
Christophe JAILLET [Mon, 13 Jul 2015 18:51:32 +0000 (20:51 +0200)]
staging: unisys: Use kzalloc instead of kmalloc/memset

This patch turns a kmalloc/memset into an equivalent kzalloc.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: fix random memory corruption in visorchannel_write()
Tim Sell [Mon, 13 Jul 2015 18:51:24 +0000 (14:51 -0400)]
staging: unisys: fix random memory corruption in visorchannel_write()

visorchannel_write() and it's user visorbus_write_channel() are
exported, so all visorbus function drivers (i.e., drivers that call
visorbus_register_visor_driver()) are potentially affected by the bug.

Because of pointer-arithmetic rules, the address being written to in the
affected code was actually at byte offset:

    sizeof(struct channel_header) * offset

instead of just <offset> bytes as intended.

The bug could cause some very difficult-to-diagnose symptoms.  The
particular problem that led me on this chase was a kernel fault that
would occur during 'insmod visornic' after a previous 'rmmod visornic',
where we would fault during netdev_register_kobject() within
pm_runtime_set_memalloc_noio() while traversing a device list, which
occurred because dev->parent for the visorbus device had become
corrupted.

Fixes: 0abb60c1c ('staging: unisys: visorchannel_write(): Handle...')
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: correctly NULL-terminate visorbus sysfs attribute array
Tim Sell [Mon, 13 Jul 2015 18:51:23 +0000 (14:51 -0400)]
staging: unisys: correctly NULL-terminate visorbus sysfs attribute array

I'm not sure what adverse runtime effects the previously-omitted
NULL-termination would cause, but the code was definitely wrong.

Fixes: 795731627c ('staging: unisys: Clean up device sysfs attributes')
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Fix broken build when ARCH=um
Ken Cox [Thu, 9 Jul 2015 17:28:56 +0000 (13:28 -0400)]
staging: unisys: Fix broken build when ARCH=um

When building with ARCH=um you get the following error:

arch/x86/include/asm/cpufeature.h:252:42: error: 'REQUIRED_MASK0'
undeclared

The Unisys drivers should not be compiled for UML, so this patch addresses
that by adding a dependency to kconfig for !UML.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Tested-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Allow visorbus to autoload
David Kershner [Thu, 9 Jul 2015 17:27:53 +0000 (13:27 -0400)]
staging: unisys: Allow visorbus to autoload

We inadvertently remove the MODULE_DEVICE_TABLE line for visorbus,
this patch adds it back in.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Fixes: d5b3f1dccee4 ('staging: unisys: move timskmod.h functionality')
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic: prevent erroneous kfree of devdata pointer
Tim Sell [Thu, 9 Jul 2015 17:27:52 +0000 (13:27 -0400)]
staging: unisys: visornic: prevent erroneous kfree of devdata pointer

A struct visornic_devdata for each visornic device is actually allocated as
part of alloc_etherdev(), here in visornic_probe():

    netdev = alloc_etherdev(sizeof(struct visornic_devdata));

But code in devdata_release() was treating devdata as a pointer that needed
to be kfree()d!  This was causing all sorts of weird behavior after doing
an rmmod of visornic, both because free_netdev() was actually freeing the
memory used for devdata, and because devdata wasn't pointing to
dynamically-allocated memory in the first place.

The kfree(devdata) and the kref that tracked devdata's usage have been
appropriately deleted.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic: use preferred interface for setting netdev's parent
Tim Sell [Thu, 9 Jul 2015 17:27:51 +0000 (13:27 -0400)]
staging: unisys: visornic: use preferred interface for setting netdev's parent

Just switch this line so it uses the correct function call.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic: delay start of worker thread until netdev created
Tim Sell [Thu, 9 Jul 2015 17:27:50 +0000 (13:27 -0400)]
staging: unisys: visornic: delay start of worker thread until netdev created

This only makes sense, since the worker thread depends upon the netdev
existing.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic: don't destroy global workqueues until devs destroyed
Tim Sell [Thu, 9 Jul 2015 17:27:49 +0000 (13:27 -0400)]
staging: unisys: visornic: don't destroy global workqueues until devs destroyed

visornic_cleanup() was previously incorrectly destroying its global
workqueues prior to cleaning up the devices which used them.  This patch
corrects the order of these operations.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic: correctly clean up device on removal
Tim Sell [Thu, 9 Jul 2015 17:27:48 +0000 (13:27 -0400)]
staging: unisys: visornic: correctly clean up device on removal

visornic_remove() is called to logically detach the visornic driver from a
visorbus-supplied device, which can happen either just prior to a
visorbus-supplied device disappearing, or as a result of an rmmod of
visornic.  Prior to this patch, logic was missing to properly clean up for
this removal, which was fixed via the following changes:

* A going_away flag is now used to interlock between device destruction and
  workqueue operations, protected by priv_lock.  I.e., setting
  going_away=true under lock guarantees that no new work items can get
  queued to the work queues.  going_away=true also short-circuits other
  operations to enable device destruction to proceed.

* Missing clean-up operations for the workqueues, netdev, debugfs entries,
  and the worker thread were added.

* Memory referenced from the visornic private devdata struct is now freed
  as part of devdata destruction.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic: correct obvious double-allocation of workqueues
Tim Sell [Thu, 9 Jul 2015 17:27:47 +0000 (13:27 -0400)]
staging: unisys: visornic: correct obvious double-allocation of workqueues

Looks like an errant patch fitting caused us to redundantly allocate the
workqueues at both the beginning and end of visornic_init().  This was
corrected by removing the allocations at the beginning.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Fixes: 68905a14e49c ('staging: unisys: Add s-Par visornic ethernet driver')
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: add error messages to visornic
Tim Sell [Thu, 9 Jul 2015 17:27:46 +0000 (13:27 -0400)]
staging: unisys: add error messages to visornic

Add error message to genuine rare error paths, and debug messages
to enable relatively non-verbose tracing of code paths

You can enable debug messages by including this on the kernel command line:

    visornic.dyndbg=+p

or by this from the command line:

    echo "module visornic +p" > <debugfs>/dynamic_debug/control

Refer to Documentation/dynamic-debug-howto.txt for more details.

In addition to the new debug and error messages, a message like the
following will be logged every time a visornic device is probed, which
will enable you to map back-and-forth between visorbus device names
(e.g., "vbus2:dev0") and netdev names (e.g., "eth0"):

    visornic vbus2:dev0: visornic_probe success netdev=eth0

With this patch and visornic debugging enabled, you should expect to see
messages like the following in the most-common scenarios:

* driver loaded:

      visornic_init

* device probed:

      visornic vbus2:dev0: visornic_probe
      visor_thread_start
      visor_thread_start success

* network interface configured (ifconfig):

      net eth0: visornic_open
      net eth0: visornic_enable_with_timeout
      net eth0: visornic_enable_with_timeout success
      net eth0: visornic_open success

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: neglect to NULL rcvbuf pointer
Tim Sell [Thu, 9 Jul 2015 17:27:45 +0000 (13:27 -0400)]
staging: unisys: neglect to NULL rcvbuf pointer

Neglect to NULL rcvbuf pointer array could result in faults later

This problem would exhibit itself as a fault when when attempting to stop
any visornic device (i.e., in visornic_disable_with_timeout() or
visornic_serverdown_complete()) that had never been started (i.e., for
which init_rcv_bufs() had never been called).  Because the array of rcvbuf
was never cleared to NULLs, we would mistakenly attempt to call kfree_skb()
on garbage memory.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>