Jia-Ju Bai [Tue, 12 Dec 2017 13:08:06 +0000 (21:08 +0800)]
rtl8188eu: Fix a possible sleep-in-atomic bug in set_tx_beacon_cmd
The driver may sleep under a spinlock.
The function call path is:
update_beacon (acquire the spinlock)
update_BCNTIM
set_tx_beacon_cmd
kzalloc(GFP_KERNEL) --> may sleep
kmemdup(GFP_KERNEL) --> may sleep
To fix it, GFP_KERNEL is replaced with GFP_ATOMIC.
This bug is found by my static analysis tool(DSAC) and checked by my code review.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Neil Singh [Sun, 10 Dec 2017 04:38:35 +0000 (11:38 +0700)]
staging: rtl8712: Cleanup codestyle, change spaces to tabs
Cleanup below checkpatch issues:
ERROR:CODE_INDENT: code indent should use tabs where possible
1409: FILE: rtl871x_security.c:1409:
+ from_timer(padapter, t, securitypriv.tkip_timer);$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
1409: FILE: rtl871x_security.c:1409:
+ from_timer(padapter, t, securitypriv.tkip_timer);$
Signed-off-by: Neil Singh <neil2468@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Neil Singh [Sun, 10 Dec 2017 04:38:34 +0000 (11:38 +0700)]
staging: rtl8712: Cleanup codestyle, break up long line
Cleanup below checkpatch issue:
WARNING:LONG_LINE: line over 80 characters
1000: FILE: rtl871x_security.c:1000:
+static void construct_ctr_preload(u8 *ctr_preload, sint a4_exists, sint qc_exists,
Signed-off-by: Neil Singh <neil2468@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nipun Gupta [Mon, 11 Dec 2017 15:45:38 +0000 (21:15 +0530)]
staging: fsl-mc: do not print error in case of defer probe error
Devices on MC bus can be deferred because of dependencies on other modules
(such as IOMMU). Those are not the actual errors; as probing is again
done by the kernel at later stages. So this patch avoids the error print
in such case.
Nipun Gupta [Mon, 11 Dec 2017 15:45:37 +0000 (21:15 +0530)]
staging: fsl-mc: Allocate IRQ's before scanning DPRC objects
Following is the current scenario when the devices are probed:
FSL_MC Bus probe ---> dprc probe ---> dprc devices scan --->
probe devices in DPRC container ---> allocate IRQ's
In case the devices being probed in the DPRC container need the IRQ's;
probing of that device will fail.
In current scenario the devices which need IRQ's such as DPIO gets
deferred because they aren't registered when first time the probing
of these devices is done in the dprc scan.
So they are probed once IRQ's have been allocated.
In case where DPRC probing itself gets deferred, which does in case
IOMMU is enabled; all the devices in DPRC container gets probed before
IRQ's are allocated. This causes devices using IRQ's (such as DPIO)
to fail.
So having IRQ's allocated before any of the devices in the DPRC container
are probed is more legitimate.
After this patch following is the flow of execution:
FSL_MC Bus probe ---> dprc probe ---> dprc devices scan --->
allocate IRQ's ---> probe of devices in DPRC container.
The code freeing the SRAM memory address was zeroing the address
on release although there is nothing secret about it. Simplify
the code by simply calling kfree directly.
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:58 +0000 (14:52 +0000)]
staging: ccree: fix cipher naming convention
The blkcipher files were using a func naming convention which was
inconsistent (ssi vs. cc), included a long prefix (ssi_ablkcipher)
and often too long.
Make the code more readable by switching to a simpler, consistent naming
convention.
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:55 +0000 (14:52 +0000)]
staging: ccree: fix reg mgr naming convention
The request manager files were using a func naming convention which was
inconsistent (ssi vs. cc), included a useless prefix (ssi_request_mgr)
and often too long.
Make the code more readable by switching to a simpler, consistent naming
convention.
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:48 +0000 (14:52 +0000)]
staging: ccree: fix hash naming convention
The hash files were using a naming convention which was inconsistent
(ssi vs. cc), included a useless prefix (ssi_hash) and often used too
long function names producing monster such as
ssi_ahash_get_initial_digest_len_sram_addr() that made the call site
hard to read.
Make the code more readable by switching to a simpler, consistent naming
convention for the file.
Gilad Ben-Yossef [Tue, 12 Dec 2017 14:52:47 +0000 (14:52 +0000)]
staging: ccree: remove ahash wrappers
Remove a no longer needed abstraction around ccree hash crypto API
internals that used to allow same ops to be used in synchronous and
asynchronous fashion.
drivers: lustre: obdclass: check result of register_shrinker()
lu_global_init() does not check result of register_shrinker()
which was tagged __must_check recently, reported by sparse.
Patch also fixes missed cleanup of resources allocated prior to
register_shrinker() invocation and not freed after any failure.
NeilBrown [Wed, 13 Dec 2017 03:15:55 +0000 (14:15 +1100)]
staging: lustre: libcfs: discard MKSTR() macro
This is only used for tracing when some strings might
be NULL. NULL strings are not a problem for tracing,
vnsprintf() will report them as "(null)" which is probably
better (easier to parse) than an empty string.
Also remove a nearby comment that doesn't relate to the
(remaining) code at all.
1/ Use kvmalloc() instead of kmalloc or vmalloc
2/ Discard the _GFP() interfaces that are never used.
We only ever do GFP_NOFS and GFP_ATOMIC allocations,
so support each of those explicitly.
David Kershner [Thu, 7 Dec 2017 17:11:07 +0000 (12:11 -0500)]
drivers: visorbus: move driver out of staging
Move the visorbus driver out of staging (drivers/staging/unisys/visorbus)
and to drivers/visorbus. Modify the configuration and makefiles so they
now reference the new location. The s-Par header file visorbus.h that is
referenced by all s-Par drivers, is being moved into include/linux.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Marcin Ciupak [Fri, 8 Dec 2017 15:31:54 +0000 (15:31 +0000)]
staging: pi433: Fix validation of rf69_get_modulation value
Checking of modulation in rf69_set_modulation_shaping is done by
if-else and since else part covers OOK and UNDEF values it possible to
set modulation shaping for undefined modulation type.
To fix this validation should be done by switch clause and in case of
undefined modulation error returned.
Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Marcin Ciupak [Fri, 8 Dec 2017 15:31:28 +0000 (15:31 +0000)]
staging: pi433: Fix missing 'undefined' value in enum modulation
It is possible that rf69_get_modulation() function will return
'undefined' value and this value is missing in enum modulation. Fix this
by adding appropriate entry in enum modulation.
Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ioana Radulescu [Fri, 8 Dec 2017 12:47:57 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Compute needed headroom per frame
For non-linear skbs we build scatter-gather frames and allocate
a new buffer for the S/G table in which we reserve the required
headroom, so the actual skb headroom size doesn't matter.
Rather than use a one-size-fits-all approach, decide when to
enforce headroom requirements on a frame by frame basis.
Ioana Radulescu [Fri, 8 Dec 2017 12:47:56 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Don't enable FAS on Tx
For Tx confirmed frames that have an error indication in the frame
descriptor, we look at the Frame Annotation Status field (in the
buffer headroom) for details on the root cause and then print
a debug message with that information.
While useful in initial development stages, it doesn't bring
enough added value to justify reserving 64B of headroom for all
Tx frames (FAS is only 8B long, but we must reserve chunks of 64B
from the hardware annotation area).
If we remove the need for FAS field from egress frames, we can
renounce hardware annotation completely, since FAS is the only
HWA field we currently use.
Ioana Radulescu [Fri, 8 Dec 2017 12:47:54 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Don't set netdev->needed_headroom
Commit 4b2d9fe87950 ("staging: fsl-dpaa2/eth: Extra headroom in RX
buffers") tried to avoid the performance penalty of doing skb
reallocations in the network stack for IP forwarded frames between
two DPAA2 Ethernet interfaces. This led to a (too) complicated
formula that relies on the stack's internal implementation.
Instead, it's safer and easier to just not request any guarantee
from the stack. We already double check in the driver the required
headroom size of egress frames and realloc the skb if needed, so
we don't need to add any extra code.
On forwarding between two of our own interfaces, there is no
functional change; for traffic forwarded from a different device or
generated on the core, skb realloc operations are moved from the stack
to our driver, with no visible impact on performance.
Ioana Radulescu [Fri, 8 Dec 2017 12:47:53 +0000 (06:47 -0600)]
staging: fsl-dpaa2/eth: Fix access to FAS field
Commit 4b2d9fe87950 ("staging: fsl-dpaa2/eth: Extra headroom in RX
buffers") removes the software annotation (SWA) area from the RX
buffer layout, as it's not used by anyone, but fails to update the
macros for accessing hardware annotation (HWA) fields, which is
right after the SWA in the buffer headroom.
This may lead to some frame annotation status fields (e.g. indication
if L3/L4 checksum is valid) to be read incorrectly.
Turn the accessor macros into inline functions and add a bool param
to specify if SWA is present or not.
Fixes: 4b2d9fe87950 ("staging: fsl-dpaa2/eth: Extra headroom in RX buffers") Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The macro calls its argument -a function- twice, makes the calling
function return prematurely -skipping resource cleanup code- and hurts
understandability.
Simon Sandström [Wed, 6 Dec 2017 20:42:22 +0000 (21:42 +0100)]
staging: pi433: Combine all rf69_set_amplifier_x()
Replaces the functions rf69_set_amplifier_1, _2, _3 with two
functions: rf69_enable_amplifier(dev, amp_mask) and
rf69_disable_amplifier(dev, amp_mask).
Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Marcus Wolf [Mon, 4 Dec 2017 21:45:16 +0000 (23:45 +0200)]
staging: pi433: rf69.c: Replace macros READ_REG and WRITE_REG with smarter functions
To increase the readability of the register accesses, the abstraction
of the helpers was increased from simple read and write to set bit,
clear bit and read modify write bit.
Annotation: This patch contains a lot of long lines and camel case
var names. These long lines and camel case vars weren't introduced
by this patch, but were long and camel cased before.
Signed-off-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simon Sandström [Tue, 5 Dec 2017 22:08:42 +0000 (23:08 +0100)]
staging: pi433: Rename enum optionOnOff in rf69_enum.h
Renames the enum optionOnOff and its values optionOn, optionOff to enum
option_on_off and OPTION_ON, OPTION_OFF. Fixes checkpatch.pl warnings:
"Avoid CamelCase: <optionOnOff>, <optionOn>, <optionOff>".
Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simon Sandström [Tue, 5 Dec 2017 22:08:41 +0000 (23:08 +0100)]
staging: pi433: Rename variable in struct pi433_rx_cfg
Renames variable thresholdDecrement in struct pi433_rx_cfg to
threshold_decrement to get rid of checkpatch.pl warning
"Avoid CamelCase: <thresholdDecrement>".
Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>