Commit graph

677986 commits

Author SHA1 Message Date
Paolo Cretaro 7e4e3bca89 staging: android: ion: set init function as static
Fix warning issued by sparse:
symbol 'ion_device_create' was not declared. Should it be static?

Signed-off-by: Paolo Cretaro <melko@frugalware.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:56:44 +02:00
Dan Carpenter e45423d76f staging: speakup: signedness bug in spk_ttyio_in_nowait()
On most of the common arches char is signed so it can't ever == 0xff.
Let's fix this by making it a u8.

Fixes: 6b9ad1c742 ("staging: speakup: add send_xchar, tiocmset and input functionality for tty")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:56:32 +02:00
Sameer Wadgaonkar d70dd24521 staging: unisys: visorbus: remove channel_addr check in handle_command
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:14 +02:00
Sameer Wadgaonkar d36c4857cb staging: unisys: visorbus: add comment to explain polling logic in controlvm_periodic_work
Added a comment to explain polling frequency variation logic in
controlvm_periodic_logic() in visorchipset.c.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:14 +02:00
Sameer Wadgaonkar 172f4c367c staging: unisys: include: renamed structure spar_io_channel_protocol in iochannel.h to match driver namespace
Renamed structure spar_io_channel_protocol to visor_io_channel and
changed "visor bus" to "visorbus" in a comment in visornic_main.c
and visorhba_main.c.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:14 +02:00
Sameer Wadgaonkar 68646323cd staging: unisys: include: renamed #defines in iochannel.h to match driver namespace
Renamed #defines
* ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE to
		VISOR_VHBA_CHANNEL_SIGNATURE
* ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE to
		VISOR_VNIC_CHANNEL_SIGNATURE
* ULTRA_VSWITCH_CHANNEL_PROTOCOL_SIGNATURE to
		VISOR_VSWITCH_CHANNEL_SIGNATURE
* ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID to
		VISOR_VHBA_CHANNEL_VERSIONID
* ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID to
		VISOR_VNIC_CHANNEL_VERSIONID
* ULTRA_VSWITCH_CHANNEL_PROTOCOL_VERSIONID to
		VISOR_VSWITCH_CHANNEL_VERSIONID
* SPAR_VHBA_CHANNEL_OK_CLIENT to VISOR_VHBA_CHANNEL_OK_CLIENT
* SPAR_VNIC_CHANNEL_OK_CLIENT to VISOR_VNIC_CHANNEL_OK_CLIENT

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar c75ebe5e30 staging: unisys: include: renamed #defines in channel.h to match driver namespace
Renamed #defines
* ULTRA_CHANNEL_PROTOCOL_SIGNATURE to
		VISOR_CHANNEL_SIGNATURE
* SPAR_CHANNEL_SERVER_READY to
		VISOR_CHANNEL_SERVER_READY
* ULTRA_VALID_CHANNELCLI_TRANSITION
		VISOR_VALID_CHANNELCLI_TRANSITION
* ULTRA_CLIERRORBOOT_THROTTLEMSG_DISABLED to
		VISOR_CLIERRORBOOT_THROTTLEMSG_DISABLED
* ULTRA_CLIERRORBOOT_THROTTLEMSG_NOTATTACHED to
		VISOR_CLIERRORBOOT_THROTTLEMSG_NOTATTACHED
* ULTRA_CLIERRORBOOT_THROTTLEMSG_BUSY to
		VISOR_CLIERRORBOOT_THROTTLEMSG_BUSY
* ULTRA_IO_DRIVER_ENABLES_INTS to
		VISOR_DRIVER_ENABLES_INTS
* ULTRA_IO_CHANNEL_IS_POLLING to
		VISOR_CHANNEL_IS_POLLING
* ULTRA_IO_IOVM_IS_OK_WITH_DRIVER_DISABLING_INTS to
		VISOR_IOVM_OK_DRIVER_DISABLING_INTS
* ULTRA_IO_DRIVER_DISABLES_INTS to
		VISOR_DRIVER_DISABLES_INTS
* ULTRA_IO_DRIVER_SUPPORTS_ENHANCED_RCVBUF_CHECKING to
		VISOR_DRIVER_ENHANCED_RCVBUF_CHECKING
* ULTRA_CHANNEL_ENABLE_INTS to
		VISOR_CHANNEL_ENABLE_INTS
* SPAR_VHBA_CHANNEL_PROTOCOL_UUID to VISOR_VHBA_CHANNEL_UUID
* SPAR_VHBA_CHANNEL_PROTOCOL_UUID_STR to
		VISOR_VHBA_CHANNEL_UUID_STR
* SPAR_VNIC_CHANNEL_PROTOCOL_UUID to VISOR_VNIC_CHANNEL_UUID
* SPAR_VNIC_CHANNEL_PROTOCOL_UUID_STR to
		VISOR_VNIC_CHANNEL_UUID_STR
* SPAR_SIOVM_UUID to VISOR_SIOVM_UUID

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar 315dfc84d1 staging: unisys: include: renamed function spar_check_channel in channel.h to match driver namespace
Renamed function spar_check_channel() to visor_check_channel().

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar bac41a2f68 staging: unisys: visorinput: removed enum in ultrainputreport.h to match driver namespace
Removed enum ultra_inputaction in ultrainputreport.h and changed
elements to #defnes.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar c2093c804c staging: unisys: visorinput: renamed structures in ultrainputreport.h to match driver namespace
Renamed structures
* ultra_inputactivity to visor_inputactivity
* ultra_inputreport to visor_inputreport

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar 785542c660 staging: unisys: visorinput: renamed #defines in visorinput.c to match driver namespace
Renamed #defines
* SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID to
		VISOR_KEYBOARD_CHANNEL_UUID
* SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR to
		VISOR_KEYBOARD_CHANNEL_UUID_STR
* SPAR_MOUSE_CHANNEL_PROTOCOL_UUID to
		VISOR_MOUSE_CHANNEL_UUID
* SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR to
		VISOR_MOUSE_CHANNEL_UUID_STR

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar d3ad6e69ca staging: unisys: visorbus: renamed enum in controlvmchannel.h to match driver namespace
Renamed enum and its members
* ultra_chipset_feature to visor_chipset_feature
* ULTRA_CHIPSET_FEATURE_REPLY to VISOR_CHIPSET_FEATURE_REPLY
* ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG to
		VISOR_CHIPSET_FEATURE_PARA_HOTPLUG

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar 545f091389 staging: unisys: visorbus: renamed structures in controlvmchannel.h to match driver namespace
Renamed structures
* spar_segment_state to visor_segment_state
* efi_spar_indication to efi_visor_indication
* spar_controlvm_channel_protocol to visor_controlvm_channel
* spar_controlvm_parameters_header to
		visor_controlvm_parameters_header

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar c5a28902b4 staging: unisys: visorbus: renamed #defines in controlvmchannel.h to match driver namespace
Renamed #defines
* SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID to
		VISOR_CONTROLVM_CHANNEL_UUID
* ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE to
		VISOR_CONTROLVM_CHANNEL_SIGNATURE
* ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID to
		VISOR_CONTROLVM_CHANNEL_VERSIONID
* SPAR_CONTROLVM_CHANNEL_OK_CLIENT to
		VISOR_CONTROLVM_CHANNEL_OK_CLIENT

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar a27ded9272 staging: unisys: visorbus: renamed #defines in visorchipset.c to match driver namespace
Renamed #defines
* UNISYS_SPAR_LEAF_ID to UNISYS_VISOR_LEAF_ID
* UNISYS_SPAR_ID_EBX to UNISYS_VISOR_ID_EBX
* UNISYS_SPAR_ID_ECX to UNISYS_VISOR_ID_ECX
* UNISYS_SPAR_ID_EDX to UNISYS_VISOR_ID_EDX

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar 2b8ec7da96 staging: unisys: visorbus: renamed #define in visorchannel.c to match driver namespace
Renamed SPAR_CONSOLEVIDEO_CHANNEL_PROTOCOL_GUID to
VISOR_CONSOLEVIDEO_CHANNEL_GUID and renamed const
spar_video_guid to visor_video_guid

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar 55c71ebaf6 staging: unisys: visorbus: renamed structures in vbuschannel.h to match driver namespace
Renamed structures
* ultra_vbus_deviceinfo to visor_vbus_deviceinfo
* spar_vbus_headerinfo to visor_vbus_headerinfo
* spar_vbus_channel_protocol to visor_vbus_channel

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:13 +02:00
Sameer Wadgaonkar 734721746e staging: unisys: visorbus: renamed #defines in vbuschannel.h to match driver namespace
Renamed #defines:
* SPAR_VBUS_CHANNEL_PROTOCOL_UUID to VISOR_VBUS_CHANNEL_UUID
* SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE to
		VISOR_VBUS_CHANNEL_SIGNATURE
* SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID to
		VISOR_VBUS_CHANNEL_VERSIONID

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Sameer Wadgaonkar 8b0a6cfa7f staging: unisys: visorbus: renamed functions like my_device_* to match driver namespace
Renamed functions
* my_device_create() to visorbus_device_create()
* my_device_changestate() to visorbus_device_changestate()
* my_device_destroy() to visorbus_device_destroy()

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Sameer Wadgaonkar 451072e3f0 staging: unisys: visorbus: renamed function initiate_chipset_device_pause_resume to match driver namespace
Renamed function initiate_chipset_device_pause_resume() to
visorchipset_initiate_device_pause_resume().

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Sameer Wadgaonkar c0b44136c8 staging: unisys: visorbus: renamed functions like chipset_device_* to match driver namespace
Renamed functions
* chipset_device_create() to visorchipset_device_create()
* chipset_device_destroy() to visorchipset_device_destroy()
* chipset_device_pause() to visorchipset_device_pause()
* chipset_device_resume() to visorchipset_device_resume()

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Sameer Wadgaonkar 4f96c7308e staging: unisys: visorbus: renamed functions like chipset_bus_* to match driver namespace
Renamed functions
* chipset_bus_create() to visorchipset_bus_create()
* chipset_bus_destroy() to visorchipset_bus_destroy()

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Sameer Wadgaonkar 9e78fd35df staging: unisys: visorbus: renamed functions like *_bus_instance to match driver namespace
Renamed functions
* create_bus_instance() to visorbus_create_instance()
* remove_bus_instance() to visorbus_remove_instance()

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Sameer Wadgaonkar f8b5a21feb staging: unisys: visorbus: renamed functions like device_*_response to match driver namespace
Renamed functions
* device_create_response() to visorbus_device_create_response()
* device_destroy_response() to visorbus_device_destroy_response()
* device_pause_response() to visorbus_device_pause_response()
* device_resume_response() to visorbus_device_resume_response()

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Sameer Wadgaonkar 63847f17f7 staging: unisys: visorbus: renamed functions like bus_*_response to match driver namespace
Renamed functions bus_create_response() to visorbus_create_response()
and bus_destroy_response() to visorbus_destroy_response().

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Sameer Wadgaonkar ec17cb8a6c staging: unisys: visorbus: renamed functions bus_create, bus_destroy and bus_configure to match driver namespace
Renamed the functions bus_create() to visorbus_create(),
bus_destroy() to visorbus_destroy() and bus_configure() to
visorbus_configure

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Jon Frisch 603a1989c6 staging: unisys: visorbus: rename typ to cr_type
This patch renames enum crash_obj_type typ to cr_type.

Signed-off-by: Jon Frisch <jon.frisch@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:53:12 +02:00
Logan Gunthorpe 4f5d986592 staging: ccree: Cleanup: remove references to page_link
This is a layering violation so we replace it with calls to
sg_page. This is a prep patch for replacing page_link and this
is one of the very few uses outside of scatterlist.h.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Stephen Bates <sbates@raithlin.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:49:23 +02:00
Branislav Katreniak c2b21f688a staging: ccree: fix checkpatch no space before tabs
Fixes checkpatch warning:
WARNING: please, no space before tabs

Signed-off-by: Branislav Katreniak <brano@ksp.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:37:52 +02:00
Raphaël Beamonte 6aec6c7a47 drivers: staging: ccree: ISO C forbids casting to and from non-scalar
Fixes the following sparse warnings:
drivers/staging/ccree/ssi_hash.c:2447:24: warning: cast to non-scalar
drivers/staging/ccree/ssi_hash.c:2447:24: warning: cast from non-scalar
drivers/staging/ccree/ssi_hash.c:2448:28: warning: cast to non-scalar
drivers/staging/ccree/ssi_hash.c:2448:28: warning: cast from non-scalar

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:37:52 +02:00
Greg Kroah-Hartman 639e1c739b Merge 4.12-rc2 into staging-next
We want the staging tree fixes in here as well to handle the merge
issues.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-22 08:58:50 +02:00
Linus Torvalds 08332893e3 Linux 4.12-rc2 2017-05-21 19:30:23 -07:00
Linus Torvalds 33c9e97290 x86: fix 32-bit case of __get_user_asm_u64()
The code to fetch a 64-bit value from user space was entirely buggered,
and has been since the code was merged in early 2016 in commit
b2f680380d ("x86/mm/32: Add support for 64-bit __get_user() on 32-bit
kernels").

Happily the buggered routine is almost certainly entirely unused, since
the normal way to access user space memory is just with the non-inlined
"get_user()", and the inlined version didn't even historically exist.

The normal "get_user()" case is handled by external hand-written asm in
arch/x86/lib/getuser.S that doesn't have either of these issues.

There were two independent bugs in __get_user_asm_u64():

 - it still did the STAC/CLAC user space access marking, even though
   that is now done by the wrapper macros, see commit 11f1a4b975
   ("x86: reorganize SMAP handling in user space accesses").

   This didn't result in a semantic error, it just means that the
   inlined optimized version was hugely less efficient than the
   allegedly slower standard version, since the CLAC/STAC overhead is
   quite high on modern Intel CPU's.

 - the double register %eax/%edx was marked as an output, but the %eax
   part of it was touched early in the asm, and could thus clobber other
   inputs to the asm that gcc didn't expect it to touch.

   In particular, that meant that the generated code could look like
   this:

        mov    (%eax),%eax
        mov    0x4(%eax),%edx

   where the load of %edx obviously was _supposed_ to be from the 32-bit
   word that followed the source of %eax, but because %eax was
   overwritten by the first instruction, the source of %edx was
   basically random garbage.

The fixes are trivial: remove the extraneous STAC/CLAC entries, and mark
the 64-bit output as early-clobber to let gcc know that no inputs should
alias with the output register.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: stable@kernel.org   # v4.8+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-05-21 18:26:54 -07:00
Linus Torvalds 334a023ee5 Clean up x86 unsafe_get/put_user() type handling
Al noticed that unsafe_put_user() had type problems, and fixed them in
commit a7cc722fff ("fix unsafe_put_user()"), which made me look more
at those functions.

It turns out that unsafe_get_user() had a type issue too: it limited the
largest size of the type it could handle to "unsigned long".  Which is
fine with the current users, but doesn't match our existing normal
get_user() semantics, which can also handle "u64" even when that does
not fit in a long.

While at it, also clean up the type cast in unsafe_put_user().  We
actually want to just make it an assignment to the expected type of the
pointer, because we actually do want warnings from types that don't
convert silently.  And it makes the code more readable by not having
that one very long and complex line.

[ This patch might become stable material if we ever end up back-porting
  any new users of the unsafe uaccess code, but as things stand now this
  doesn't matter for any current existing uses. ]

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-05-21 15:25:46 -07:00
Linus Torvalds f3926e4c2a Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc uaccess fixes from Al Viro:
 "Fix for unsafe_put_user() (no callers currently in mainline, but
  anyone starting to use it will step into that) + alpha osf_wait4()
  infoleak fix"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  osf_wait4(): fix infoleak
  fix unsafe_put_user()
2017-05-21 12:06:44 -07:00
Linus Torvalds 970c305aa8 Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fix from Thomas Gleixner:
 "A single scheduler fix:

  Prevent idle task from ever being preempted. That makes sure that
  synchronize_rcu_tasks() which is ignoring idle task does not pretend
  that no task is stuck in preempted state. If that happens and idle was
  preempted on a ftrace trampoline the machine crashes due to
  inconsistent state"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/core: Call __schedule() from do_idle() without enabling preemption
2017-05-21 11:52:00 -07:00
Linus Torvalds e7a3d62749 Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fixes from Thomas Gleixner:
 "A set of small fixes for the irq subsystem:

   - Cure a data ordering problem with chained interrupts

   - Three small fixlets for the mbigen irq chip"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq: Fix chained interrupt data ordering
  irqchip/mbigen: Fix the clear register offset calculation
  irqchip/mbigen: Fix potential NULL dereferencing
  irqchip/mbigen: Fix memory mapping code
2017-05-21 11:45:26 -07:00
Al Viro a8c39544a6 osf_wait4(): fix infoleak
failing sys_wait4() won't fill struct rusage...

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-05-21 13:10:07 -04:00
Al Viro a7cc722fff fix unsafe_put_user()
__put_user_size() relies upon its first argument having the same type as what
the second one points to; the only other user makes sure of that and
unsafe_put_user() should do the same.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-05-21 13:09:57 -04:00
Linus Torvalds 56f410cf45 This fixes a bug caused by not cleaning up the new instance unique triggers
when deleting an instance. It also creates a selftest that triggers that bug.
 
 Fix the delayed optimization happening after kprobes boot up self tests
 being removed by freeing of init memory.
 
 Comment kprobes on why the delay optimization is not a problem for removal
 of modules, to keep other developers from searching that riddle.
 
 Fix another rcu isn't watching in stack trace tracing.
 
 Naveen N. Rao (4):
       ftrace: Simplify glob handling in unregister_ftrace_function_probe_func()
       ftrace/instances: Clear function triggers when removing instances
       selftests/ftrace: Fix bashisms
       selftests/ftrace: Add test to remove instance with active event triggers
 
 Steven Rostedt (1):
       tracing: Move postpone selftests to core from early_initcall
 
 Steven Rostedt (VMware) (3):
       ftrace: Remove #ifdef from code and add clear_ftrace_function_probes() stub
       kprobes: Document how optimized kprobes are removed from module unload
       tracing: Make sure RCU is watching before calling a stack trace
 
 Thomas Gleixner (1):
       tracing/kprobes: Enforce kprobes teardown after testing
 -----BEGIN PGP SIGNATURE-----
 
 iQExBAABCAAbBQJZIQapFBxyb3N0ZWR0QGdvb2RtaXMub3JnAAoJEMm5BfJq2Y3L
 A6MIAKFLb6mQ4flRBXpWd2tD2B4DQpQ0H7SovseZnlH6Q7grU6POY/qbNl9xXiBA
 3NavxqbIYokH8cxEqGAusL7ASUFPXJj6erMM1uc1WRuAzMpIjvgNacOtW5R+c5S9
 ofR1xtKlBo/854J/IP6M3J0WqrK+B7TsS1WYKohe/tFMBpolbnFloHVfMMZlaL58
 CQhCoAhkjJRsta6dJhbo+HoQy03VGyWsfFHtutBpIwsf81Naq4Stpxp7jdZLWhB8
 Di5QdOji9lDayK6Uk7DDZqHxbjC9z6cCS9nVWIGHkE4AMpR3peYtsyCaAOBjVMLV
 2OuhuREfZgKaYVMjUfdeYCayDAY=
 =1gek
 -----END PGP SIGNATURE-----

Merge tag 'trace-v4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:

 - Fix a bug caused by not cleaning up the new instance unique triggers
   when deleting an instance. It also creates a selftest that triggers
   that bug.

 - Fix the delayed optimization happening after kprobes boot up self
   tests being removed by freeing of init memory.

 - Comment kprobes on why the delay optimization is not a problem for
   removal of modules, to keep other developers from searching that
   riddle.

 - Fix another case of rcu not watching in stack trace tracing.

* tag 'trace-v4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Make sure RCU is watching before calling a stack trace
  kprobes: Document how optimized kprobes are removed from module unload
  selftests/ftrace: Add test to remove instance with active event triggers
  selftests/ftrace: Fix bashisms
  ftrace: Remove #ifdef from code and add clear_ftrace_function_probes() stub
  ftrace/instances: Clear function triggers when removing instances
  ftrace: Simplify glob handling in unregister_ftrace_function_probe_func()
  tracing/kprobes: Enforce kprobes teardown after testing
  tracing: Move postpone selftests to core from early_initcall
2017-05-20 23:39:03 -07:00
Linus Torvalds 894e21642d Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
 "A small collection of fixes that should go into this cycle.

   - a pull request from Christoph for NVMe, which ended up being
     manually applied to avoid pulling in newer bits in master. Mostly
     fibre channel fixes from James, but also a few fixes from Jon and
     Vijay

   - a pull request from Konrad, with just a single fix for xen-blkback
     from Gustavo.

   - a fuseblk bdi fix from Jan, fixing a regression in this series with
     the dynamic backing devices.

   - a blktrace fix from Shaohua, replacing sscanf() with kstrtoull().

   - a request leak fix for drbd from Lars, fixing a regression in the
     last series with the kref changes. This will go to stable as well"

* 'for-linus' of git://git.kernel.dk/linux-block:
  nvmet: release the sq ref on rdma read errors
  nvmet-fc: remove target cpu scheduling flag
  nvme-fc: stop queues on error detection
  nvme-fc: require target or discovery role for fc-nvme targets
  nvme-fc: correct port role bits
  nvme: unmap CMB and remove sysfs file in reset path
  blktrace: fix integer parse
  fuseblk: Fix warning in super_setup_bdi_name()
  block: xen-blkback: add null check to avoid null pointer dereference
  drbd: fix request leak introduced by locking/atomic, kref: Kill kref_sub()
2017-05-20 16:12:30 -07:00
Vijay Immanuel 549f01ae7b nvmet: release the sq ref on rdma read errors
On rdma read errors, release the sq ref that was taken
when the req was initialized. This avoids a hang in
nvmet_sq_destroy() when the queue is being freed.

Signed-off-by: Vijay Immanuel <vijayi@attalasystems.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-05-20 10:11:34 -06:00
James Smart 4b8ba5fa52 nvmet-fc: remove target cpu scheduling flag
Remove NVMET_FCTGTFEAT_NEEDS_CMD_CPUSCHED. It's unnecessary.

Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-05-20 10:11:34 -06:00
James Smart 2952a879ba nvme-fc: stop queues on error detection
Per the recommendation by Sagi on:
http://lists.infradead.org/pipermail/linux-nvme/2017-April/009261.html

Rather than waiting for reset work thread to stop queues and abort the ios,
immediately stop the queues on error detection. Reset thread will restop
the queues (as it's called on other paths), but it does not appear to have
a side effect.

Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-05-20 10:11:34 -06:00
James Smart 85e6a6adf8 nvme-fc: require target or discovery role for fc-nvme targets
In order to create an association, the remoteport must be
serving either a target role or a discovery role.

Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-05-20 10:11:34 -06:00
James Smart 4123109050 nvme-fc: correct port role bits
FC Port roles is a bit mask, not individual values.
Correct nvme definitions to unique bits.

Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-05-20 10:11:34 -06:00
Jon Derrick f63572dff1 nvme: unmap CMB and remove sysfs file in reset path
CMB doesn't get unmapped until removal while getting remapped on every
reset. Add the unmapping and sysfs file removal to the reset path in
nvme_pci_disable to match the mapping path in nvme_pci_enable.

Fixes: 202021c1a ("nvme : Add sysfs entry for NVMe CMBs when appropriate")

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Reviewed-By: Stephen Bates <sbates@raithlin.com>
Cc: <stable@vger.kernel.org> # 4.9+
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-05-20 10:11:34 -06:00
Linus Torvalds ef82f1ad2e Staging driver fixes for 4.12-rc2
Here are a number of staging driver fixes for 4.12-rc2
 
 Most of them are typec driver fixes found by reviewers and users of the
 code.  There are also some removals of files no longer needed in the
 tree due to the ion driver rewrite in 4.12-rc1, as well as some wifi
 driver fixes.  And to round it out, a MAINTAINERS file update.
 
 All have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWSBHOg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ylDFACdGF2LnZiSfD4H708tz+o2557r0aUAoNAG4q/c
 8syw0G7T1oMIr/gPss1k
 =M0sb
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are a number of staging driver fixes for 4.12-rc2

  Most of them are typec driver fixes found by reviewers and users of
  the code. There are also some removals of files no longer needed in
  the tree due to the ion driver rewrite in 4.12-rc1, as well as some
  wifi driver fixes. And to round it out, a MAINTAINERS file update.

  All have been in linux-next with no reported issues"

* tag 'staging-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (22 commits)
  MAINTAINERS: greybus-dev list is members-only
  staging: fsl-dpaa2/eth: add ETHERNET dependency
  staging: typec: fusb302: refactor resume retry mechanism
  staging: typec: fusb302: reset i2c_busy state in error
  staging: rtl8723bs: remove re-positioned call to kfree in os_dep/ioctl_cfg80211.c
  staging: rtl8192e: GetTs Fix invalid TID 7 warning.
  staging: rtl8192e: rtl92e_get_eeprom_size Fix read size of EPROM_CMD.
  staging: rtl8192e: fix 2 byte alignment of register BSSIDR.
  staging: rtl8192e: rtl92e_fill_tx_desc fix write to mapped out memory.
  staging: vc04_services: Fix bulk cache maintenance
  staging: ccree: remove extraneous spin_unlock_bh() in error handler
  staging: typec: Fix sparse warnings about incorrect types
  staging: typec: fusb302: do not free gpio from managed resource
  staging: typec: tcpm: Fix Port Power Role field in PS_RDY messages
  staging: typec: tcpm: Respond to Discover Identity commands
  staging: typec: tcpm: Set correct flags in PD request messages
  staging: typec: tcpm: Drop duplicate PD messages
  staging: typec: fusb302: Fix chip->vbus_present init value
  staging: typec: fusb302: Fix module autoload
  staging: typec: tcpci: declare private structure as static
  ...
2017-05-20 09:02:27 -07:00
Linus Torvalds 3202629345 USB fixes for 4.12-rc2
Here are a number of small USB fixes for 4.12-rc2
 
 Most of them come from Johan, in his valiant quest to fix up all drivers
 that could be affected by "malicious" USB devices.  There's also some
 fixes for more "obscure" drivers to handle some of the vmalloc stack
 fallout (which for USB drivers, was always the case, but very few people
 actually ran those systems...)
 
 Other than that, the normal set of xhci and gadget and musb driver fixes
 as well.
 
 All have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWSBFyw8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynwXQCfUS3wnmibc98aJK/lr1Cc6a1eyWwAoIOhXmCh
 kJXFARSJOiHl5SdtNrdm
 =/5EP
 -----END PGP SIGNATURE-----

Merge tag 'usb-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are a number of small USB fixes for 4.12-rc2

  Most of them come from Johan, in his valiant quest to fix up all
  drivers that could be affected by "malicious" USB devices. There's
  also some fixes for more "obscure" drivers to handle some of the
  vmalloc stack fallout (which for USB drivers, was always the case, but
  very few people actually ran those systems...)

  Other than that, the normal set of xhci and gadget and musb driver
  fixes as well.

  All have been in linux-next with no reported issues"

* tag 'usb-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (42 commits)
  usb: musb: tusb6010_omap: Do not reset the other direction's packet size
  usb: musb: Fix trying to suspend while active for OTG configurations
  usb: host: xhci-plat: propagate return value of platform_get_irq()
  xhci: Fix command ring stop regression in 4.11
  xhci: remove GFP_DMA flag from allocation
  USB: xhci: fix lock-inversion problem
  usb: host: xhci-ring: don't need to clear interrupt pending for MSI enabled hcd
  usb: host: xhci-mem: allocate zeroed Scratchpad Buffer
  xhci: apply PME_STUCK_QUIRK and MISSING_CAS quirk for Denverton
  usb: xhci: trace URB before giving it back instead of after
  USB: serial: qcserial: add more Lenovo EM74xx device IDs
  USB: host: xhci: use max-port define
  USB: hub: fix SS max number of ports
  USB: hub: fix non-SS hub-descriptor handling
  USB: hub: fix SS hub-descriptor handling
  USB: usbip: fix nonconforming hub descriptor
  USB: gadget: dummy_hcd: fix hub-descriptor removable fields
  doc-rst: fixed kernel-doc directives in usb/typec.rst
  USB: core: of: document reference taken by companion helper
  USB: ehci-platform: fix companion-device leak
  ...
2017-05-20 08:52:34 -07:00
Linus Torvalds 331da109ec Char/Misc driver fixes for 4.12-rc2
Here are 5 small bugfixes for reported issues with 4.12-rc1 and earlier
 kernels.  Nothing huge here, just a lp, mem, vpd, and uio driver fix,
 along with a Kconfig fixup for one of the misc drivers.
 
 All of these have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWSBGrQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymMiACfQHMYFPwiqIBoSQ7kiKIQH4H4XDEAoNFaIf3k
 71unU902U/jRm5AcMmNr
 =zbuX
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
 "Here are five small bugfixes for reported issues with 4.12-rc1 and
  earlier kernels. Nothing huge here, just a lp, mem, vpd, and uio
  driver fix, along with a Kconfig fixup for one of the misc drivers.

  All of these have been in linux-next with no reported issues"

* tag 'char-misc-4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  firmware: Google VPD: Fix memory allocation error handling
  drivers: char: mem: Check for address space wraparound with mmap()
  uio: fix incorrect memory leak cleanup
  misc: pci_endpoint_test: select CRC32
  char: lp: fix possible integer overflow in lp_setup()
2017-05-20 08:44:22 -07:00