Scott Matheina [Wed, 11 Jan 2017 04:34:17 +0000 (22:34 -0600)]
staging:vt6656:mac.c Aligned to match open parenthesis
Fixes checkpatch warning: Alignment should match open parenthesis
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Eric Salem [Wed, 11 Jan 2017 04:48:51 +0000 (22:48 -0600)]
staging: wlan-ng: Fix sparse warnings about endianness
Fixed sparse warnings about endianness. E.g.:
warning: cast to restricted __le16
Signed-off-by: Eric Salem <ericsalem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Arnd Bergmann [Wed, 11 Jan 2017 14:53:08 +0000 (15:53 +0100)]
staging: rtl: fix possible NULL pointer dereference
gcc-7 detects that wlanhdr_to_ethhdr() in two drivers calls memcpy() with
a destination argument that an earlier function call may have set to NULL:
staging/rtl8188eu/core/rtw_recv.c: In function 'wlanhdr_to_ethhdr':
staging/rtl8188eu/core/rtw_recv.c:1318:2: warning: argument 1 null where non-null expected [-Wnonnull]
staging/rtl8712/rtl871x_recv.c: In function 'r8712_wlanhdr_to_ethhdr':
staging/rtl8712/rtl871x_recv.c:649:2: warning: argument 1 null where non-null expected [-Wnonnull]
I'm fixing this by adding a NULL pointer check and returning failure
from the function, which is hopefully already handled properly.
This seems to date back to when the drivers were originally added,
so backporting the fix to stable seems appropriate. There are other
related realtek drivers in the kernel, but none of them contain a
function with a similar name or produce this warning.
Cc: stable@vger.kernel.org
Fixes:
1cc18a22b96b ("staging: r8188eu: Add files for new driver - part 5")
Fixes:
2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Javier Rodriguez [Wed, 11 Jan 2017 21:59:06 +0000 (22:59 +0100)]
staging: rtl8192u: Removed multiple white lines.
Remove one unnecessary white line.
Signed-off-by: Javier Rodriguez <jrodbar@yahoo.es>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Javier Rodriguez [Wed, 11 Jan 2017 21:59:05 +0000 (22:59 +0100)]
staging: rtl8192u: Add character '*' in all lines of the block comments.
Correct code style error. Add a character in every line of the
comment block.
Signed-off-by: Javier Rodriguez <jrodbar@yahoo.es>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Sun, 15 Jan 2017 00:53:58 +0000 (13:53 +1300)]
Staging: media: davinci_vpfe: style fix, using octal file permissions
Change file permissions to octal style.
Found using checkpatch.
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Wittman [Sat, 14 Jan 2017 23:26:07 +0000 (17:26 -0600)]
staging: ks7010: Fix brace style issue in ks_wlan_net.c
This change fixes a checkpatch error for "that open brace { should be
on the previous line" as well as a related spacing warning.
Signed-off-by: David Wittman <dwittman@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Omri Arad [Sat, 14 Jan 2017 16:58:02 +0000 (18:58 +0200)]
drivers: staging: rts5208: fix endianness handling
'cb' and 'sgb' were assigned __le values but were not marked as such,
this fixes the following sparse warnings:
drivers/staging/rts5208/rtsx_transport.c:220:34: warning: incorrect type in assignment (different base types)
drivers/staging/rts5208/rtsx_transport.c:220:34: expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:220:34: got restricted __le32 [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:319:44: warning: incorrect type in assignment (different base types)
drivers/staging/rts5208/rtsx_transport.c:319:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:319:44: got restricted __le64 [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:319:44: warning: incorrect type in assignment (different base types)
drivers/staging/rts5208/rtsx_transport.c:319:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident>
drivers/staging/rts5208/rtsx_transport.c:319:44: got restricted __le64 [usertype] <noident>
Signed-off-by: Omri Arad <omriarad3@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philip Thiemann [Thu, 12 Jan 2017 13:00:26 +0000 (14:00 +0100)]
staging: vme: vme_user.c: fix warning 'line over 80 characters'
Removed checkpatch.pl warning 'line over 80 characters' by inserting a
linebreak in the comment line 50.
Signed-off-by: Philip Thiemann <philip.thiemann@fau.de>
Signed-off-by: Fabian Arnold <fabian.arnold@fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Eric Salem [Wed, 11 Jan 2017 01:38:35 +0000 (19:38 -0600)]
staging: most: hdm-usb: Fix mismatch between types used in sizeof operator
Fixed mismatch between types used in sizeof operator.
Signed-off-by: Eric Salem <ericsalem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Roman Sommer [Fri, 13 Jan 2017 20:54:51 +0000 (21:54 +0100)]
staging: greybus: fix checkpatch unsigned warnings
Fix checkpatch warnings for parameter type unsigned in greybus.
Note that this patch does not fix all checkpatch warnings for the
affected files.
Signed-off-by: Christian Bewermeyer <christian.bewermeyer@fau.de>
Signed-off-by: Roman Sommer <roman.sommer@fau.de>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Abdul Rauf [Wed, 11 Jan 2017 00:55:59 +0000 (00:55 +0000)]
staging: greybus: fix checkpatch braces not necessary warning
Fix the following warnings:
braces {} are not necessary for any arm of this statement
Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Abdul Rauf [Wed, 11 Jan 2017 01:29:36 +0000 (01:29 +0000)]
staging: greybus: loopback_test: fix checkpatch bad function definition error
Fix the following Errors:
Bad function definition - void abort() should probably be void abort(void)
Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Thu, 12 Jan 2017 04:59:40 +0000 (17:59 +1300)]
Staging: greybus: style fix, permissions as octal
Changed permissions to be in octal style.
Found by checkpatch.
Signed-off-by: Derek Robson <robsonde@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Sun, 15 Jan 2017 08:14:07 +0000 (11:14 +0300)]
staging: lustre: ptlrpc: silence a shift wrapping warning
"svcpt->scp_hist_seq" is a u64 so static checkers complain that 1U
should be 1ULL. I looked at REQS_SEQ_SHIFT() a little and it seems to
be capped by the number of CPUs online and the amount of memory, but I
think it could go above 32 possibly.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 04:42:53 +0000 (22:42 -0600)]
staging:vt6656:main_usb.c Removed un-needed blank lines
Fixed the following checkpatch warnings by deleting blank lines
Blank lines aren't necessary before a close brace '}'
Blank lines aren't necessary after an open brace '{'
Please don't use multiple blank lines
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 04:42:52 +0000 (22:42 -0600)]
staging:vt6656:main_usb.c Aligned code to match open parenthesis
Fixed Alignment should match open parenthesis from checkpatch
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 04:42:51 +0000 (22:42 -0600)]
staging:vt6656:mac.c Aligned code to match open parenthesis
Fixed Alignment should match open parenthesis checkpatch CHECK
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 04:42:50 +0000 (22:42 -0600)]
staging:vt6656:key.c Aligned code with open parenthesis
Fixed Alignment should match open parenthesis checkpatch CHECK
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:18 +0000 (18:15 +0000)]
staging: vc04_services: Fix space issues
This fixes the space coding styles issues complained by checkpatch.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:17 +0000 (18:15 +0000)]
staging: vc04_services: Fix indentation
This should fix the indentation issues found by checkpatch.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:16 +0000 (18:15 +0000)]
staging: vc04_services: Drop vchiq_2835.h
There is no need for a vchiq_2835.h with its 2 local defines.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:15 +0000 (18:15 +0000)]
staging: vc04_services: Improve readability of kthread names
This patch tries to make the kernel thread names of vchiq a little
bit more self explaining and look closer to the existing ones:
slot handler: VCHIQ-%d -> vchiq-slot/%d
recycle thread: VCHIQr-%d -> vchiq-recy/%d
sync thread: VCHIQs-%d -> vhciq-sync/%d
keep-alive thread: VCHIQka-%d -> vchiq-keep/%d
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:14 +0000 (18:15 +0000)]
staging: vc04_services: Use preferred kernel types
This patch fixes issues reported by checkpatch.pl about preferred
kernel types.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:13 +0000 (18:15 +0000)]
staging: vchiq_core: make local spinlock static
The quota_spinlock is only local. So make it static.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:11 +0000 (18:15 +0000)]
staging: vchiq_core: remove unused variable type
This variable is assigned a value, but never used. So remove it.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:12 +0000 (18:15 +0000)]
staging: vc04_services: make local functions static
The functions vchiq_dump_shared_state() and vchiq_is_connected() are only
used locally. So make them static.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sun, 8 Jan 2017 18:15:10 +0000 (18:15 +0000)]
staging: vchiq_arm: remove vchiq_platform_check_resume
This function is never used, so we could remove it.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Yamanappagouda Patil [Sat, 7 Jan 2017 14:55:42 +0000 (20:25 +0530)]
staging: rtl8188eu: fixed 'braces are not necessary for single statement blocks'.
Fixed checkpatch.pl warnings in rtl8188eu module core folder files.
Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 02:23:27 +0000 (20:23 -0600)]
staging:sm750fb:ddk750_chip.c removes un-necessary blank lines
Fixes checkpatch warning - Please don't use multiple blank lines
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 02:23:26 +0000 (20:23 -0600)]
staging:sm750fb:ddk750_chip.c Adds braces to last arm of statement
Fixes absence of braces on last arm of statement, identified by
checkpatch
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 02:10:00 +0000 (20:10 -0600)]
staging:rtl8192u:r819xU_cmdpkt.c Removes un-necessary blank lines
Fixes checkpatch.pl warning - Blank lines aren't necessary before a
close brace '}' & Please don't use multiple blank lines
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Tue, 10 Jan 2017 02:09:59 +0000 (20:09 -0600)]
staging:rtl8192u:r819xU_cmdpkt.c Fix Alignment should match open parenthesis
Fixes Alignment should match open parenthesis in checkpatch
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emmanuil Chatzipetru [Sun, 8 Jan 2017 13:37:07 +0000 (14:37 +0100)]
staging: olpc_dcon: olpc_dcon_xo_1_5: Remove multiple blank lines.
This issue is caught by checkpatch.pl and is related to the following
warning:
- CHECK: Please don't use multiple blank lines
Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emmanuil Chatzipetru [Sun, 8 Jan 2017 13:37:06 +0000 (14:37 +0100)]
staging: olpc_dcon: olpc_dcon: Fix spaces between operator and variables.
This issue is caught by checkpatch.pl and is related to the following
warning:
- CHECK: spaces preferred around that '/' (ctx:VxV)
Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emmanuil Chatzipetru [Sun, 8 Jan 2017 13:37:05 +0000 (14:37 +0100)]
staging: olpc_dcon: olpc_dcon_xo_1_5: Remove redundant return statement.
dcon_was_irq(); should return a boolean value if PMIO_Rx50[6] is either
set or unset, which is evaluated in the first return statement. Therefore,
the following return statement is redundant and thus, removed.
Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emmanuil Chatzipetru [Sun, 8 Jan 2017 13:37:04 +0000 (14:37 +0100)]
staging: olpc_dcon: olpc_dcon: Fix open parenthesis alignment.
This issue is caught by checkpatch.pl and is related to the following
warning:
- CHECK: Alignment should match open parenthesis
Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Abdul Rauf [Sun, 8 Jan 2017 02:45:59 +0000 (02:45 +0000)]
staging: sm750fb: fix checkpatch 80 characters warning
Fix the following warnings:
line over 80 characters
Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Abdul Rauf [Sun, 8 Jan 2017 02:45:22 +0000 (02:45 +0000)]
staging: sm750fb: fix checkpatch multiple blank lines check
Fix the following checks:
Please don't use multiple blank lines
Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cheah Kok Cheong [Sat, 7 Jan 2017 11:13:12 +0000 (19:13 +0800)]
Staging: comedi: comedi_fops: Remove unused stat.h header
Unused after commit
6e3029397698 ("staging: comedi: comedi_fops:
coding style fixes") - Fixed coding style in comedi_fops.c
Symbolic to octal permission.
Anyway it's included in module.h
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cheah Kok Cheong [Sat, 7 Jan 2017 11:13:11 +0000 (19:13 +0800)]
Staging: comedi: comedi_fops: Remove unused vmalloc.h header
Unused after commit
d18431325be0 ("staging: comedi:
deprecate loading firmware with comedi_config").
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cheah Kok Cheong [Sat, 7 Jan 2017 11:13:10 +0000 (19:13 +0800)]
Staging: comedi: comedi_fops: Remove redundant init.h header
After commit
0fd972a7d91d ("module: relocate module_init
from init.h to module.h"), including module.h will do and
init.h is also thrown in.
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cheah Kok Cheong [Sat, 7 Jan 2017 11:13:09 +0000 (19:13 +0800)]
Staging: comedi: comedi_fops: Remove unused kmod.h header
Unused after commit
f30f2c2d417b ("staging: comedi:
remove check for CONFIG_KMOD").
Anyway it's included in module.h
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:47 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use pci_id_table 'driver_data'
The driver's COMEDI "auto-attach" handler `db2k_auto_attach()` calls
`db2k_find_boardinfo()` to find an element of our board information
array `db2k_boardtypes[]` that matches the probed PCI device. The
driver's PCI device table matches several boards in the DaqBoard/2000
series that match a single PCI vendor and device ID combination.
`db2k_find_boardinfo()` uses the probed PCI device's subvendor and
subdevice IDs to find the matching board information, returning `NULL`
for no match.
Change the driver's PCI device table `db2k_pci_table[]` to match
supported PCI vendor, device, subvendor and subdevice IDs, and set the
`.driver_data` member of each element to the index of the matching
element of `db2k_boardtypes[]`. That index gets passed through to the
COMEDI auto-attach handler `db2k_auto_attach()`. Use it to index
directly into `db2k_boardtypes[]` instead of calling
`db2k_find_boardinfo()` to find the match.
Use array index designators in the initializer of `db2k_boardtypes[]`.
Use enumerated constants defined by new type `enum db2k_boardids` to
name the board type indices.
The `id` member of `struct db2k_boardtype` is no longer used, so remove
it. Also remove the subdevice ID macros `DB2K_SUBSYSTEM_IDS2` and
`DB2K_SUBSYSTEM_IDS4` as the subdevice IDs are now specified as numbers
in the PCI device table. Remove `db2k_find_boardinfo()` as it is no
longer used.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:46 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: change COMEDI device names
The COMEDI device name strings are currently set to "ids2" for the
DaqBoard/2000, and to "ids4" for the DaqBoard/2001. Change them to
"daqboard2000" and "daqboard2001" respectively. (The COMEDI driver name
string is also "daqboard2000".)
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:45 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: support 4 AO channels
The driver supports DaqBoard/2000 and DaqBoard/2001. DaqBoard/2000 has 2
AO channels, but DaqBoard/2001 has 4 AO channels. The driver currently
only supports 2 AO channels, but supporting 4 channels is just a case of
setting the `n_chan` member of the COMEDI subdevice to 4 instead of 2.
Add a new boolean flag member `has_2_ao` to `struct db2k_boardtype` to
be set to `true` if the board only has 2 AO channels. Set this to
`true` in the element of `db2k_boardtypes[]` that corresponds to the
DaqBoard/2000. Use it in `db2k_auto_attach()` to initialize the number
of AO channels to 2 or 4, as appropriate.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:44 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use designated initializers
Replace the undesignated initializers for each element of
`db2k_boardtypes[]` with an equivalent designated initializer for ease
of future maintenance.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:43 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use shorter, consistent prefix
Use a consistent prefix of `db2k_` or `DB2K_` for identifiers. The
existing prefixes `DAQBOARD2000_` and `daqboard2000_` are a bit on the
lengthy side.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:42 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: remove unused 'card' member
The `card` member of `struct daqboard2000_private` and the enumerated
constant `card_daqboard_2000` are not used. Remove them.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:41 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: check CPLD status before writing firmware data
According to an old GPL'ed driver at
<ftp://ftp.mccdaq.com/downloads/iotech_software/DaqBoard_1000_2000_Series/Linux_driver_kernelv2.4.x/>,
The CPLD status register can be checked to make sure that it is ready to
accept the next 16-bit word of FPGA firmware data, but that doesn't work
on older versions of the CPLD, where a simple delay should be used
between successive writes. The current version of the Comedi driver
just uses a delay between successive writes. Change it to check for the
newer CPLD in the `daqboard2000_load_firmware()`, and change the
firmware word writing function `daqboard2000_write_cpld()` to wait for
the status bit (`DB2K_CPLD_STATUS_TXREADY`, previously called
`DB2K_CPLD_TXDONE`) to be set for newer CPLD, or just delay for older CPLD.
Return an error if it times out waiting for the status bit.
The wait for the `DB2K_CPLD_STATUS_TXREADY` status bit to be set is
performed by new function `daqboard2000_wait_cpld_txready()`, which
returns 0 if the status bit is set within 100 microseconds, or
`-ETIMEDOUT` if not.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:40 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: check result of FPGA programming
According to an old, GPL'ed Linux driver at
<ftp://ftp.mccdaq.com/downloads/iotech_software/DaqBoard_1000_2000_Series/Linux_driver_kernelv2.4.x/>,
after programming the FPGA, the General Purpose Input (USERI) of the PLX
PCI-9080 should go high shortly after a valid FPGA bitstream has been
loaded. Add a new function `daqboard2000_wait_fpga_programmed()` to
wait for that, performing up to 200 checks over a 20 ms period (this is
loosely based on `pollFPGADone()` in the above-mentioned old driver).
Return 0 if the FPGA appears to have loaded successfully, or
`-ETIMEDOUT` if it runs out of checks. Call it from the firmware
loading callback `daqboard2000_load_firmware()` after writing the
firmware to the FPGA to check it is programmed successfully.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:39 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: change daqboard2000_write_cpld() return value
`daqboard2000_write_cpld()` currently returns 1 on success, or 0 on
failure. Change it to return 0 on success, or `-EIO` on failure.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:38 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: replace daqboard2000_poll_cpld()
`daqboard2000_poll_cpld()` waits for a specified status bit in the CPLD
status register to be set, giving up after 50 tries over a period of
about 5 milliseconds. It returns 1 if the status bit is set, otherwise
0. It is only ever called to check the "INIT" status bit. Replace it
with new function `daqboard2000_wait_cpld_init()`, which returns 0 if
the "INIT" status bit becomes set within 50 tries, or `-ETIMEDOUT` if
not set within 50 tries. The firmware loading callback
`daqboard2000_load_firmware()` may return the error result from
`daqboard2000_wait_cpld_init()` if it has used up all its firmware
loading attempts and that was the last error.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:37 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: check firmware length
Firmware files for DAQBoard/2000 have a header, which is skipped,
followed by a sequence of FPGA configuration bytes to be programmed in
pairs. The FPGA configuration bytes start with the sequence 0xff, 0x20.
Make the firmware loading callback function
`daqboard2000_load_firmware()` return an error `-EINVAL` if the FPGA
start sequence is not found, or the remaining length is not a multiple
of 2.
The firmware loading callback tries to program the FPGA up to 3 times
until it succeeds or it has tried too many times. Currently, it
searches for the FPGA start sequence in the firmware data each time
through the retry loop. Change it to adjust the start position and
length before entering the loop.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:36 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use type 'u16' for CPLD data and status
The CPLD status and data registers used to load firmware are 16 bits
wide. Use the type `u16` to represent data and status values instead of
`int`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:35 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: define macros for CPLD registers
The Daqboard/2000 uses a write-only data register and a read-only status
register in a pre-programmed CPLD device to program the main firmware on
the board. Both registers are at offset 0x1000 from PCI BAR 2. Define
macros for the register offsets. Rename the existing macros for the
status register values for consistency. (Two status bits are defined,
but the driver code only seems to use one of them.)
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 4 Jan 2017 10:55:34 +0000 (10:55 +0000)]
staging: comedi: daqboard2000: use macros from "plx9080.h"
The Daqboard/2000 uses a PLX PCI-9080 chip to interface with the PCI
bus. The "daqboard2000" driver uses the PCI-9080 "CNTRL" register to
perform various tasks, but defines its own macros for the register
values. Use the macros from "plx9080.h" instead. The various functions
that change the CNTRL register just wiggle individual bits up and down,
but they ignore the current register value - the old macros defined the
full value to be written to the register. Change them to read and
modify the register value.
Also remove a read of the CNTRL register in `daqboard2000_auto_attach()`
where the value is just thrown away, as it seems to serve no purpose
there (such as flushing PCI writes).
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Markus Buettner [Mon, 9 Jan 2017 16:43:31 +0000 (17:43 +0100)]
staging: wlan-ng: remove unnecessary blank lines
checkpatch.pl complained about two unnecessary blank lines after an
opening '{' in prism2mib.c. Those were removed in order to get rid
of those warnings.
There are more issues pointed out by checkpatch.pl. Those require
additional work to be done.
Signed-off-by: Markus Buettner <markus.buettner@fau.de>
Signed-off-by: Artur Wasinger <artur.wasinger@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Mon, 9 Jan 2017 04:35:57 +0000 (17:35 +1300)]
Staging: speakup: style fix, octal file permissions
Changed file permission to octal style,
Can't use __ATTR_RW() as the handler is in standard format.
Found using checkpatch
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aditya Shankar [Mon, 9 Jan 2017 06:12:15 +0000 (11:42 +0530)]
staging: wilc1000: Connect to highest RSSI value for required SSID
Connect to the highest rssi with the required SSID in the shadow
table if the connection criteria is based only on the SSID.
For the first matching SSID, an index to the table is saved.
Later the index is updated if matching SSID has a higher
RSSI value than the last saved index.
However if decision is made based on BSSID, there is only one match
in the table and corresponding index is used.
changes in v2:
initialize sel_bssi_idx to UINT_MAX.
Combine two checks for identifying
sel_bssi_idx value for a SSID.
Signed-off-by: Aditya Shankar <aditya.shankar@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Abdul Rauf [Tue, 10 Jan 2017 01:12:05 +0000 (01:12 +0000)]
staging: unisys: fix checkpatch block comments warning
Fix the following warnings:
Block comments should align the * on each line
Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Sat, 7 Jan 2017 22:08:22 +0000 (11:08 +1300)]
Staging: unisys: visorbus: visorchipset.c: style fix
Changed file permissions to octal sytle.
Found using checkpatch.
Acked-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Sat, 7 Jan 2017 22:08:01 +0000 (11:08 +1300)]
Staging: unisys: visorbus: visorbus_main.c: fixed style
Changed file permissions to octal sytle.
Found using checkpatch.
Acked-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tim Sell [Mon, 9 Jan 2017 18:02:27 +0000 (13:02 -0500)]
staging: unisys: remove redundant unlocks of visornic_devdata.priv_lock
These redundant unlocks of visornic_devdata.priv_lock would result in
the RHEL 7.2 guests hanging during service partition recovery testing.
__Testing__
* An scp of a large file was started from a remote host TO the RHEL 7.2
Linux guest.
* During the scp transfer, s-Par service partition recovery was forced
twice. After each occasion, I verified that the guest recovered
completely (all s-Par guest devices), and that the file transfer
resumed.
* Within the RHEL 7.2 guest environment, copied the large file to
another location in the local filesystem.
* During the copy, s-Par service partition recovery was again forced
twice. After each occasion, I verified that the guest recovered
completely (all s-Par guest devices), and that the copy resumed.
* An scp of the new copy of the large file was started FROM the RHEL 7.2
guest to a remote host.
* During the scp transfer, s-Par service partition recovery was forced
twice. After each occasion, I verified that the guest recovered
completely (all s-Par guest devices), and that the file transfer
resumed.
* Used cmp to verify that the large file had successfully survived the
round-trip without becoming corrupted.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Mon, 9 Jan 2017 18:02:26 +0000 (13:02 -0500)]
staging: unisys: visornic: Remove errant -EIO returns
Remove errant -EIOs that prevent us from calling either
netif_start_queue() or napi_disable().
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Mon, 9 Jan 2017 18:02:25 +0000 (13:02 -0500)]
staging: unisys: visornic: Reorder logic in visornic_enable_with_timeout()
Moves the call to napi_enable() before the call to init_rcv_bufs(),
ensuring that messages are not put into the receive queue until the guest
is ready to receive interrupts.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Binder [Mon, 9 Jan 2017 18:02:24 +0000 (13:02 -0500)]
staging: unisys: visorbus: Remove duplicate invocation of init_rcv_bufs()
Removes the invocation to init_rcv_bufs() in visornic_resume() because that
function is already called in visornic_enable_with_timeout().
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Mon, 9 Jan 2017 18:02:23 +0000 (13:02 -0500)]
staging: unisys: visorbus: Replace parser_param_start with parser_name_get
Replace the general CONTROLVM string parser setup which only handled the
name string with a specific name string retrieval function.
Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tim Sell [Mon, 9 Jan 2017 18:02:22 +0000 (13:02 -0500)]
staging: unisys: visorbus: relocate error-check from isr to registration
It just makes more sense to do the NULL-pointer check when the function is
called to enable interrupts, rather than on *every* interrupt.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Mon, 9 Jan 2017 18:02:21 +0000 (13:02 -0500)]
staging: unisys: visorbus: Remove unused enum members
Visorchipset used to parse CONTROLVM messages with a variety of string
information. All but the name string have been removed, but the code
to handle this information remained. This patch removes the other values
and handlers.
Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Mon, 9 Jan 2017 06:58:34 +0000 (07:58 +0100)]
Merge 4.10-rc3 into staging-next
We want the IIO and staging driver fixes in here as well to handle merge
issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linus Torvalds [Sun, 8 Jan 2017 22:18:17 +0000 (14:18 -0800)]
Linux 4.10-rc3
Linus Torvalds [Sun, 8 Jan 2017 19:42:04 +0000 (11:42 -0800)]
Merge tag 'usb-4.10-rc3' of git://git./linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH:
"Here are a bunch of USB fixes for 4.10-rc3. Yeah, it's a lot, an
artifact of the holiday break I think.
Lots of gadget and the usual XHCI fixups for reported issues (one day
that driver will calm down...) Also included are a bunch of usb-serial
driver fixes, and for good measure, a number of much-reported MUSB
driver issues have finally been resolved.
All of these have been in linux-next with no reported issues"
* tag 'usb-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (72 commits)
USB: fix problems with duplicate endpoint addresses
usb: ohci-at91: use descriptor-based gpio APIs correctly
usb: storage: unusual_uas: Add JMicron JMS56x to unusual device
usb: hub: Move hub_port_disable() to fix warning if PM is disabled
usb: musb: blackfin: add bfin_fifo_offset in bfin_ops
usb: musb: fix compilation warning on unused function
usb: musb: Fix trying to free already-free IRQ 4
usb: musb: dsps: implement clear_ep_rxintr() callback
usb: musb: core: add clear_ep_rxintr() to musb_platform_ops
USB: serial: ti_usb_3410_5052: fix NULL-deref at open
USB: serial: spcp8x5: fix NULL-deref at open
USB: serial: quatech2: fix sleep-while-atomic in close
USB: serial: pl2303: fix NULL-deref at open
USB: serial: oti6858: fix NULL-deref at open
USB: serial: omninet: fix NULL-derefs at open and disconnect
USB: serial: mos7840: fix misleading interrupt-URB comment
USB: serial: mos7840: remove unused write URB
USB: serial: mos7840: fix NULL-deref at open
USB: serial: mos7720: remove obsolete port initialisation
USB: serial: mos7720: fix parallel probe
...
Linus Torvalds [Sun, 8 Jan 2017 19:37:44 +0000 (11:37 -0800)]
Merge tag 'char-misc-4.10-rc3' of git://git./linux/kernel/git/gregkh/char-misc
Pull char/misc fixes from Greg KH:
"Here are a few small char/misc driver fixes for 4.10-rc3.
Two MEI driver fixes, and three NVMEM patches for reported issues, and
a new Hyper-V driver MAINTAINER update. Nothing major at all, all have
been in linux-next with no reported issues"
* tag 'char-misc-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
hyper-v: Add myself as additional MAINTAINER
nvmem: fix nvmem_cell_read() return type doc
nvmem: imx-ocotp: Fix wrong register size
nvmem: qfprom: Allow single byte accesses for read/write
mei: move write cb to completion on credentials failures
mei: bus: fix mei_cldev_enable KDoc
Linus Torvalds [Sun, 8 Jan 2017 19:22:00 +0000 (11:22 -0800)]
Merge tag 'staging-4.10-rc3' of git://git./linux/kernel/git/gregkh/staging
Pull staging/IIO fixes from Greg KH:
"Here are some staging and IIO driver fixes for 4.10-rc3.
Most of these are minor IIO fixes of reported issues, along with one
network driver fix to resolve an issue. And a MAINTAINERS update with
a new mailing list. All of these, except the MAINTAINERS file update,
have been in linux-next with no reported issues (the MAINTAINERS patch
happened on Friday...)"
* tag 'staging-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
MAINTAINERS: add greybus subsystem mailing list
staging: octeon: Call SET_NETDEV_DEV()
iio: accel: st_accel: fix LIS3LV02 reading and scaling
iio: common: st_sensors: fix channel data parsing
iio: max44000: correct value in illuminance_integration_time_available
iio: adc: TI_AM335X_ADC should depend on HAS_DMA
iio: bmi160: Fix time needed to sleep after command execution
iio: 104-quad-8: Fix active level mismatch for the preset enable option
iio: 104-quad-8: Fix off-by-one errors when addressing IOR
iio: 104-quad-8: Fix index control configuration
Johannes Weiner [Sat, 7 Jan 2017 00:21:43 +0000 (19:21 -0500)]
mm: workingset: fix use-after-free in shadow node shrinker
Several people report seeing warnings about inconsistent radix tree
nodes followed by crashes in the workingset code, which all looked like
use-after-free access from the shadow node shrinker.
Dave Jones managed to reproduce the issue with a debug patch applied,
which confirmed that the radix tree shrinking indeed frees shadow nodes
while they are still linked to the shadow LRU:
WARNING: CPU: 2 PID: 53 at lib/radix-tree.c:643 delete_node+0x1e4/0x200
CPU: 2 PID: 53 Comm: kswapd0 Not tainted 4.10.0-rc2-think+ #3
Call Trace:
delete_node+0x1e4/0x200
__radix_tree_delete_node+0xd/0x10
shadow_lru_isolate+0xe6/0x220
__list_lru_walk_one.isra.4+0x9b/0x190
list_lru_walk_one+0x23/0x30
scan_shadow_nodes+0x2e/0x40
shrink_slab.part.44+0x23d/0x5d0
shrink_node+0x22c/0x330
kswapd+0x392/0x8f0
This is the WARN_ON_ONCE(!list_empty(&node->private_list)) placed in the
inlined radix_tree_shrink().
The problem is with
14b468791fa9 ("mm: workingset: move shadow entry
tracking to radix tree exceptional tracking"), which passes an update
callback into the radix tree to link and unlink shadow leaf nodes when
tree entries change, but forgot to pass the callback when reclaiming a
shadow node.
While the reclaimed shadow node itself is unlinked by the shrinker, its
deletion from the tree can cause the left-most leaf node in the tree to
be shrunk. If that happens to be a shadow node as well, we don't unlink
it from the LRU as we should.
Consider this tree, where the s are shadow entries:
root->rnode
|
[0 n]
| |
[s ] [sssss]
Now the shadow node shrinker reclaims the rightmost leaf node through
the shadow node LRU:
root->rnode
|
[0 ]
|
[s ]
Because the parent of the deleted node is the first level below the
root and has only one child in the left-most slot, the intermediate
level is shrunk and the node containing the single shadow is put in
its place:
root->rnode
|
[s ]
The shrinker again sees a single left-most slot in a first level node
and thus decides to store the shadow in root->rnode directly and free
the node - which is a leaf node on the shadow node LRU.
root->rnode
|
s
Without the update callback, the freed node remains on the shadow LRU,
where it causes later shrinker runs to crash.
Pass the node updater callback into __radix_tree_delete_node() in case
the deletion causes the left-most branch in the tree to collapse too.
Also add warnings when linked nodes are freed right away, rather than
wait for the use-after-free when the list is scanned much later.
Fixes:
14b468791fa9 ("mm: workingset: move shadow entry tracking to radix tree exceptional tracking")
Reported-by: Dave Chinner <david@fromorbit.com>
Reported-by: Hugh Dickins <hughd@google.com>
Reported-by: Andrea Arcangeli <aarcange@redhat.com>
Reported-and-tested-by: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Chris Leech <cleech@redhat.com>
Cc: Lee Duncan <lduncan@suse.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Matthew Wilcox <mawilcox@linuxonhyperv.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Hugh Dickins [Sat, 7 Jan 2017 23:37:31 +0000 (15:37 -0800)]
mm: stop leaking PageTables
4.10-rc loadtest (even on x86, and even without THPCache) fails with
"fork: Cannot allocate memory" or some such; and /proc/meminfo shows
PageTables growing.
Commit
953c66c2b22a ("mm: THP page cache support for ppc64") that got
merged in rc1 removed the freeing of an unused preallocated pagetable
after do_fault_around() has called map_pages().
This is usually a good optimization, so that the followup doesn't have
to reallocate one; but it's not sufficient to shift the freeing into
alloc_set_pte(), since there are failure cases (most commonly
VM_FAULT_RETRY) which never reach finish_fault().
Check and free it at the outer level in do_fault(), then we don't need
to worry in alloc_set_pte(), and can restore that to how it was (I
cannot find any reason to pte_free() under lock as it was doing).
And fix a separate pagetable leak, or crash, introduced by the same
change, that could only show up on some ppc64: why does do_set_pmd()'s
failure case attempt to withdraw a pagetable when it never deposited
one, at the same time overwriting (so leaking) the vmf->prealloc_pte?
Residue of an earlier implementation, perhaps? Delete it.
Fixes:
953c66c2b22a ("mm: THP page cache support for ppc64")
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Neuling <mikey@neuling.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sat, 7 Jan 2017 17:47:43 +0000 (09:47 -0800)]
Merge branch 'rc-fixes' of git://git./linux/kernel/git/mmarek/kbuild
Pull kbuild fix from Michal Marek:
"The asm-prototypes.h file added in the last merge window results in
invalid code with CONFIG_KMEMCHECK=y. The net result is that genksyms
segfaults.
This pull request fixes the header, the genksyms fix is in my kbuild
branch for 4.11"
* 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
asm-prototypes: Clear any CPP defines before declaring the functions
Greg Kroah-Hartman [Fri, 6 Jan 2017 07:20:03 +0000 (08:20 +0100)]
MAINTAINERS: add greybus subsystem mailing list
The Greybus driver subsystem has a mailing list, so list it in the
MAINTAINERS file so that people know to send patches there as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emil Gedda [Thu, 5 Jan 2017 18:49:38 +0000 (19:49 +0100)]
staging: gdm724x: cleanup long lines to conform to kernel coding style
Refactor code to remove multi-line derefs and code duplication
Signed-off-by: Emil Gedda <emil.gedda@emilgedda.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Fri, 6 Jan 2017 00:25:18 +0000 (18:25 -0600)]
staging:rtl8188eu:rtw_ap.c remove unnecessary braces
Removed unnecessary braces
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Baruch Nissenbaum [Fri, 6 Jan 2017 12:16:45 +0000 (14:16 +0200)]
Staging: vt6656: Align lines to match open parenthesis
fixing checkpatch.pl check: Alignment should match open parenthesis
Signed-off-by: Baruch Nissenbaum <baruch@ibn-labs.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Fri, 6 Jan 2017 00:25:19 +0000 (18:25 -0600)]
staging:rtl8188eu:core Fixes Alignment should match opening brace
Fixed style issue: Alignment should match open brace
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Sat, 7 Jan 2017 02:14:31 +0000 (20:14 -0600)]
staging:rtl8712 Aligned code with open parenthesis
Aligned code with open parenthesis to fix a checkpatch warning
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott Matheina [Sat, 7 Jan 2017 02:14:30 +0000 (20:14 -0600)]
staging:rtl8712: Removed unnecessary parentheses
Removed unnecessary parentheses identified by checkpatch
Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Thu, 5 Jan 2017 17:39:12 +0000 (18:39 +0100)]
staging: greybus: remove timesync protocol support
While the timesync protocol was a great idea, it never ended up getting
implemented by any known hardware devices. It's also a bit
"interesting" in how it ties into the platform controller.
So, just remove it for now. It's not needed, no one uses it, and it's a
stumbling block in getting the greybus core code merged out of the
staging tree. If anyone wants it in the future, reverting this patch is
a great place to start from.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Alex Elder <elder@kernel.org>
Acked-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linus Torvalds [Fri, 6 Jan 2017 23:38:39 +0000 (15:38 -0800)]
Merge tag 'sound-4.10-rc3' of git://git./linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Nothing particular stands out, only a few small fixes for USB-audio,
HD-audio and Firewire. The USB-audio fix is the respin of the previous
race fix after a revert due to the regression"
* tag 'sound-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
Revert "ALSA: firewire-lib: change structure member with proper type"
ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion
ALSA: usb-audio: Fix irq/process data synchronization
ALSA: hda - Apply asus-mode8 fixup to ASUS X71SL
ALSA: hda - Fix up GPIO for ASUS ROG Ranger
ALSA: firewire-lib: change structure member with proper type
ALSA: firewire-tascam: Fix to handle error from initialization of stream data
ALSA: fireworks: fix asymmetric API call at unit removal
Linus Torvalds [Fri, 6 Jan 2017 23:35:27 +0000 (15:35 -0800)]
Merge tag 'clk-fixes-for-linus' of git://git./linux/kernel/git/clk/linux
Pull clk fixes from Stephen Boyd:
"One fix for a broken driver on Renesas RZ/A1 SoCs with bootloaders
that don't turn all the clks on and another fix for stm32f4 SoCs where
we have multiple drivers attaching to the same DT node"
* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
clk: stm32f4: Use CLK_OF_DECLARE_DRIVER initialization method
clk: renesas: mstp: Support 8-bit registers for r7s72100
Linus Torvalds [Fri, 6 Jan 2017 23:32:40 +0000 (15:32 -0800)]
Merge tag 'hwmon-for-linus-v4.10-rc3' of git://git./linux/kernel/git/groeck/linux-staging
Pull hwmon fix from Guenter Roeck:
"Fix temp1_max_alarm attribute in lm90 driver"
* tag 'hwmon-for-linus-v4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (lm90) fix temp1_max_alarm attribute
Linus Torvalds [Fri, 6 Jan 2017 23:27:17 +0000 (15:27 -0800)]
Merge tag 'for-linus' of git://git./virt/kvm/kvm
Pull KVM fixes from Radim Krčmář:
"MIPS:
- fix host kernel crashes when receiving a signal with 64-bit
userspace
- flush instruction cache on all vcpus after generating entry code
(both for stable)
x86:
- fix NULL dereference in MMU caused by SMM transitions (for stable)
- correct guest instruction pointer after emulating some VMX errors
- minor cleanup"
* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: VMX: remove duplicated declaration
KVM: MIPS: Flush KVM entry code from icache globally
KVM: MIPS: Don't clobber CP0_Status.UX
KVM: x86: reset MMU on KVM_SET_VCPU_EVENTS
KVM: nVMX: fix instruction skipping during emulated vm-entry
Linus Torvalds [Fri, 6 Jan 2017 23:18:58 +0000 (15:18 -0800)]
Merge tag 'arm64-fixes' of git://git./linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas:
- re-introduce the arm64 get_current() optimisation
- KERN_CONT fallout fix in show_pte()
* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: restore get_current() optimisation
arm64: mm: fix show_pte KERN_CONT fallout
Linus Torvalds [Fri, 6 Jan 2017 19:19:03 +0000 (11:19 -0800)]
Merge tag 'vfio-v4.10-rc3' of git://github.com/awilliam/linux-vfio
Pull VFIO fixes from Alex Williamson:
- Add mtty sample driver properly into build system (Alex Williamson)
- Restore type1 mapping performance after mdev (Alex Williamson)
- Fix mdev device race (Alex Williamson)
- Cleanups to the mdev ABI used by vendor drivers (Alex Williamson)
- Build fix for old compilers (Arnd Bergmann)
- Fix sample driver error path (Dan Carpenter)
- Handle pci_iomap() error (Arvind Yadav)
- Fix mdev ioctl return type (Paul Gortmaker)
* tag 'vfio-v4.10-rc3' of git://github.com/awilliam/linux-vfio:
vfio-mdev: fix non-standard ioctl return val causing i386 build fail
vfio-pci: Handle error from pci_iomap
vfio-mdev: fix some error codes in the sample code
vfio-pci: use 32-bit comparisons for register address for gcc-4.5
vfio-mdev: Make mdev_device private and abstract interfaces
vfio-mdev: Make mdev_parent private
vfio-mdev: de-polute the namespace, rename parent_device & parent_ops
vfio-mdev: Fix remove race
vfio/type1: Restore mapping performance with mdev support
vfio-mdev: Fix mtty sample driver building
Linus Torvalds [Fri, 6 Jan 2017 18:53:21 +0000 (10:53 -0800)]
Merge branch 'stable/for-linus-4.10' of git://git./linux/kernel/git/konrad/swiotlb
Pull swiotlb fixes from Konrad Rzeszutek Wilk:
"This has one fix to make i915 work when using Xen SWIOTLB, and a
feature from Geert to aid in debugging of devices that can't do DMA
outside the 32-bit address space.
The feature from Geert is on top of v4.10 merge window commit
(specifically you pulling my previous branch), as his changes were
dependent on the Documentation/ movement patches.
I figured it would just easier than me trying than to cherry-pick the
Documentation patches to satisfy git.
The patches have been soaking since 12/20, albeit I updated the last
patch due to linux-next catching an compiler error and adding an
Tested-and-Reported-by tag"
* 'stable/for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb:
swiotlb: Export swiotlb_max_segment to users
swiotlb: Add swiotlb=noforce debug option
swiotlb: Convert swiotlb_force from int to enum
x86, swiotlb: Simplify pci_swiotlb_detect_override()
Linus Torvalds [Fri, 6 Jan 2017 18:49:36 +0000 (10:49 -0800)]
Merge tag 'iommu-fixes-v4.10-rc2' of git://git./linux/kernel/git/joro/iommu
Pull IOMMU fixes from Joerg Roedel:
"Three fixes queued up:
- fix an issue with command buffer overflow handling in the AMD IOMMU
driver
- add an additional context entry flush to the Intel VT-d driver to
make sure any old context entry from kdump copying is flushed out
of the cache
- correct the encoding of the PASID table size in the Intel VT-d
driver"
* tag 'iommu-fixes-v4.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
iommu/amd: Fix the left value check of cmd buffer
iommu/vt-d: Fix pasid table size encoding
iommu/vt-d: Flush old iommu caches for kdump when the device gets context mapped
Linus Torvalds [Fri, 6 Jan 2017 18:40:17 +0000 (10:40 -0800)]
Merge tag 'acpi-4.10-rc3' of git://git./linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki:
"These fix a device enumeration problem related to _ADR matching and an
IOMMU initialization issue related to the DMAR table missing, remove
an excessive function call from the core ACPI code, update an error
message in the ACPI WDAT watchdog driver and add a way to work around
problems with unhandled GPE notifications.
Specifics:
- Fix a device enumeration issue leading to incorrect associations
between ACPI device objects and platform device objects
representing physical devices if the given device object has both
_ADR and _HID (Rafael Wysocki).
- Avoid passing NULL to acpi_put_table() during IOMMU initialization
which triggers a (rightful) warning from ACPICA (Rafael Wysocki).
- Drop an excessive call to acpi_dma_deconfigure() from the core code
that binds ACPI device objects to device objects representing
physical devices (Lorenzo Pieralisi).
- Update an error message in the ACPI WDAT watchdog driver to make it
provide more useful information (Mika Westerberg).
- Add a mechanism to work around issues with unhandled GPE
notifications that occur during system initialization and cannot be
prevented by means of sysfs (Lv Zheng)"
* tag 'acpi-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / DMAR: Avoid passing NULL to acpi_put_table()
ACPI / scan: Prefer devices without _HID/_CID for _ADR matching
ACPI / watchdog: Print out error number when device creation fails
ACPI / sysfs: Provide quirk mechanism to prevent GPE flooding
ACPI: Drop misplaced acpi_dma_deconfigure() call from acpi_bind_one()
Linus Torvalds [Fri, 6 Jan 2017 18:37:50 +0000 (10:37 -0800)]
Merge tag 'pm-4.10-rc3' of git://git./linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki:
"These fix a few issues in the intel_pstate driver, a documetation
issue, a false-positive compiler warning in the generic power domains
framework and two problems in the devfreq subsystem. They also update
the MAINTAINERS entry for devfreq and add a new "compatible" string to
the generic cpufreq-dt driver.
Specifics:
- Fix a few intel_pstate driver issues: add missing locking it two
places, avoid exposing a useless debugfs interface and keep the
attribute values in sysfs in sync (Rafael Wysocki).
- Drop confusing kernel-doc references related to power management
and ACPI from the driver API manual (Rafael Wysocki).
- Make a false-positive compiler warning in the generic power domains
framework go away (Augusto Mecking Caringi).
- Fix two initialization issues in the devfreq subsystem and update
the MAINTAINERS entry for it (Chanwoo Choi).
- Add a new "compatible" string for APM X-Gene 2 to the generic DT
cpufreq driver (Hoan Tran)"
* tag 'pm-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: dt: Add support for APM X-Gene 2
PM / devfreq: exynos-bus: Fix the wrong return value
PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL
MAINTAINERS: Add myself as reviewer for DEVFREQ subsystem support
PM / docs: Drop confusing kernel-doc references from infrastructure.rst
PM / domains: Fix 'may be used uninitialized' build warning
cpufreq: intel_pstate: Always keep all limits settings in sync
cpufreq: intel_pstate: Use locking in intel_cpufreq_verify_policy()
cpufreq: intel_pstate: Use locking in intel_pstate_resume()
cpufreq: intel_pstate: Do not expose PID parameters in passive mode
Konrad Rzeszutek Wilk [Tue, 20 Dec 2016 15:02:02 +0000 (10:02 -0500)]
swiotlb: Export swiotlb_max_segment to users
So they can figure out what is the optimal number of pages
that can be contingously stitched together without fear of
bounce buffer.
We also expose an mechanism for sub-users of SWIOTLB API, such
as Xen-SWIOTLB to set the max segment value. And lastly
if swiotlb=force is set (which mandates we bounce buffer everything)
we set max_segment so at least we can bounce buffer one 4K page
instead of a giant 512KB one for which we may not have space.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reported-and-Tested-by: Juergen Gross <jgross@suse.com>
Rafael J. Wysocki [Fri, 6 Jan 2017 13:36:30 +0000 (14:36 +0100)]
Merge branches 'acpi-scan', 'acpi-sysfs', 'acpi-wdat' and 'acpi-tables'
* acpi-scan:
ACPI / scan: Prefer devices without _HID/_CID for _ADR matching
ACPI: Drop misplaced acpi_dma_deconfigure() call from acpi_bind_one()
* acpi-sysfs:
ACPI / sysfs: Provide quirk mechanism to prevent GPE flooding
* acpi-wdat:
ACPI / watchdog: Print out error number when device creation fails
* acpi-tables:
ACPI / DMAR: Avoid passing NULL to acpi_put_table()
Rafael J. Wysocki [Fri, 6 Jan 2017 13:35:32 +0000 (14:35 +0100)]
Merge branches 'pm-domains', 'pm-docs' and 'pm-devfreq'
* pm-domains:
PM / domains: Fix 'may be used uninitialized' build warning
* pm-docs:
PM / docs: Drop confusing kernel-doc references from infrastructure.rst
* pm-devfreq:
PM / devfreq: exynos-bus: Fix the wrong return value
PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL
MAINTAINERS: Add myself as reviewer for DEVFREQ subsystem support
Rafael J. Wysocki [Fri, 6 Jan 2017 13:34:52 +0000 (14:34 +0100)]
Merge branch 'pm-cpufreq'
* pm-cpufreq:
cpufreq: dt: Add support for APM X-Gene 2
cpufreq: intel_pstate: Always keep all limits settings in sync
cpufreq: intel_pstate: Use locking in intel_cpufreq_verify_policy()
cpufreq: intel_pstate: Use locking in intel_pstate_resume()
cpufreq: intel_pstate: Do not expose PID parameters in passive mode