summaryrefslogtreecommitdiff
path: root/drivers/staging/unisys
AgeCommit message (Collapse)Author
2017-04-28staging: unisys: visorhba: fix s-Par to boot with option CONFIG_VMAP_STACK ↵Sameer Wadgaonkar
set to y The root issue is that we are not allowed to have items on the stack being passed to "DMA" like operations. In this case we have a vmcall and an inline completion of scsi command. This patch fixes the issue by moving the variables on stack in do_scsi_nolinuxstat() to heap memory. 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-04-28staging: unisys: visorbus: fix s-Par to boot with option CONFIG_VMAP_STACK ↵Sameer Wadgaonkar
set to y The root issue is that we are not allowed to have items on the stack being passed to "DMA" like operations. In this case we have vmcall operation that was using parameters from the stack. This patch fixes the issue by moving the variables on stack in issue_vmcall_io_controlvm_addr() to vmcall_controlvm_addr struct. 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-04-28staging: unisys: visorbus: remove POSTCODE from visorchipset_initDavid Kershner
Remove POSTCODEs from visorchipset_init and replace them with dev_err when needed. Since there are no more POSTCODEs in the code, we can get rid of the data in the header file as well. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove postcodes in setup_crash_devices_work_queueDavid Kershner
Replace postcodes with dev_err in the function setup_crash_device_work_queue. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: refactor setup_crash_devices_work_queueDavid Kershner
The if statement was sending us down the happy path with the error path in the else. This can be simplified by having the if be the error and just falling through with the good path. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: get rid of POSTCODES in my_device_changestateDavid Kershner
Replace POSTCODEs with dev_err in the function my_device_changestate. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove POSTCODE from my_device_createDavid Kershner
Replace the POSTCODEs with dev_err in my_device_create. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove POSTCODE from bus_configureDavid Kershner
Remove the POSTCODE logging from bus_configure, replace it with an error message if we fail dumping the errno. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove POSTCODEs from bus_createDavid Kershner
Removed the POSTCODEs from the function bus_create. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: get rid of POSTCODEs in save_crash_msgDavid Kershner
Replace POSTCODES in save_crash_msg with dev_err handling. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove postcodes in visorbus_initDavid Kershner
Remove the POSTCODES in visorbus_init. Since there are no more POSTCODES in visorbus_main.c we can remove the reference to the vmcallinterface header file. No need for vmcallinterface in visorbus_main.c Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove noisy postcode from visorchipset_exitDavid Kershner
The postcodes in visorchipset_exit were not displaying errors, they can just be removed. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove noisy postcode in bus_destroyDavid Kershner
Since kzalloc will display error the postcode becomes redundant, it can be removed. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove noisy postcodesDavid Kershner
Get rid of postcodes from visorbus_main.c that are just informational. They were not logging errors, we don't need to replace them with anything. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove POSTCODE in create_bus_instanceDavid Kershner
Remove postcodes from create_bus_instance. If there is an error log it with dev_err. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove POSTCODE from chispet_initDavid Kershner
Get rid of the postcodes from the function chipset_init. They were being noisy, so don't replace them with errors. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove POSTCODE from create_visor_deviceDavid Kershner
Remove POSTCODES from create_visor_device, when we fail log an error with dev_err. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: remove NORETRYDavid Kershner
Allow retry when allocating memory. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: handle visorchannel_write errors in codeDavid Kershner
Catch and report back errors when visorchannel_write fails. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: add timeout to controlvm_periodic_workDavid Kershner
Limit the amount that gets pulled from the queue on each try so we don't get stuck in an infinite loop if something has gone wrong with the s-Par firmware. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: update commentDavid Kershner
Comment was outdated and did not reflect what was actually happening. Update the comment to reflect reality. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: fixed indentationDavid Kershner
Moved the brace to the left to fix the indentation issue. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging; unisys: visorbus: replace uint32 with intDavid Kershner
Shouldn't use uint32 in the kernel, it can be replaced with int here. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visornic: remove keyword inline from functionDavid Kershner
Functions in c files don't need to be inlined, get rid of the keyword. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: unisys: visorbus: combine response functions into a single oneDavid Kershner
There are several different controlvm response functions, consolidate them to one so we can simplify error handling. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: unisys: visorbus: fix kernel BUG discovered by day0 testingDavid Kershner
Kernel day0 testing robot reported a kernel BUG at drivers/base/driver.c! with the following call stack: [ 14.963563] ------------[ cut here ]------------ [ 14.967298] kernel BUG at drivers/base/driver.c:153! [ 14.970948] invalid opcode: 0000 [#1] SMP [ 14.974013] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.11.0-rc4-00790-g0789e2c #1 [ 14.978221] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-20161025_171302-gandalf 04/01/2014 [ 14.983417] task: ffff88001ea46040 task.stack: ffffc90000008000 [ 14.987315] RIP: 0010:driver_register+0xa1/0xd0 [ 14.990044] RSP: 0000:ffffc9000000be60 EFLAGS: 00010246 [ 14.993039] RAX: 0000000000000000 RBX: ffffffff831d4c20 RCX: 0000000000000000 [ 14.997040] RDX: 000000000000004d RSI: ffffffff831d47c0 RDI: ffffffff831d4c20 [ 15.001511] RBP: ffffc9000000be78 R08: ffffc9000000be78 R09: ffffc9000000be7c [ 15.006163] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 [ 15.010068] R13: 00000000ffffffff R14: ffffffff832f3923 R15: 0000000000000000 [ 15.013715] FS: 0000000000000000(0000) GS:ffff88001fa00000(0000) knlGS:0000000000000000 [ 15.017460] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 15.021268] CR2: 0000000000000000 CR3: 0000000003009000 CR4: 00000000000006b0 [ 15.025633] Call Trace: [ 15.028069] ? visorbus_register_visor_driver+0x3f/0x60 [ 15.031065] ? init_unisys+0x3a/0x90 [ 15.033562] ? device_resume_response+0x50/0x50 [ 15.036083] visorinput_init+0x10/0x20 [ 15.038937] do_one_initcall+0x9a/0x164 [ 15.041838] ? set_debug_rodata+0x12/0x12 [ 15.045333] kernel_init_freeable+0x11e/0x1a1 [ 15.048369] ? rest_init+0x80/0x80 [ 15.050813] kernel_init+0x9/0x100 [ 15.053353] ret_from_fork+0x2c/0x40 [ 15.056009] Code: ff 85 c0 41 89 c4 75 13 48 8b 7b 70 31 f6 e8 97 16 be ff 44 89 e0 5b 41 5c 5d c3 48 89 df e8 57 e1 ff ff 44 89 e0 5b 41 5c 5d c3 <0f> 0b 48 8b 33 48 c7 c7 a0 dd d5 82 e8 ec f0 6f ff 48 8b 73 08 [ 15.065144] RIP: driver_register+0xa1/0xd0 RSP: ffffc9000000be60 [ 15.068360] ---[ end trace 7d13369c38d80a8f ]--- This bug will occur if the visorbus driver is built-in to the kernel, and the resulting kernel is run in an environment where visorbus devices are NOT supported, and an attempt is made to load any of the drivers: visorhba, visornic, or visorinput. Checked to see if we have called bus_register, if not do not call driver_register. Signed-off-by: David Kershner <david.kershner@unisys.com> Fixes: 5b6f9b95f7ae ("staging: unisys: visorbus: get rid of create_bus_type.") Reviewed-by: Tim Sell <timothy.sell@unisys.com> Reviewed-by: David Binder <david.binder@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: unisys: visornic: Replace symbolic perms with octalThomas Jespersen
Replace symbolic permissions S_IRUSR and S_IWUSR for their octal counterparts Signed-off-by: Thomas Jespersen <laumann.thomas@gmail.com> Acked-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: Have unisys_vmcall return Linux error instead of ↵David Kershner
VMCALL error The function unisys_vmcall was returning VMCALL specific errors and the calling code was ignoring which error was actually returned. Instead we should be mapping the VMCALL error into a proper Linux error and then returning that, since we now have an error we know what to do with, we don't have to drop it but we can send it up the stack. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: move unisys_vmcall into visorchipsetDavid Kershner
The only one using unisys_vmcall was visorchipset.c, it can be moved into the visorchipset file directly instead of being in a header file. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: Update vmcallinterface commentDavid Kershner
The comment at the beginning of the vmcallinterface.h file references IO Virtualization. It should be more specific that it is referencing s-Par Virtualization. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: get rid of ISSUE_IO_VMCALLDavid Kershner
The macro ISSUE_IO_VMCALL was a wrapper around the function unisys_vmcall. It doesn't need to exist and was just being noisy, so get rid of it. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: remove useless ifdefDavid Kershner
We shouldn't be checking if VMCALL_CONTROLVM_ADDR is defined, remove it. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: consolidate if statementsDavid Kershner
We had several if statements inside of if statements that should be consolidated into an if statement with an && to clean up the code some more. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: get rid of braces around single statementsDavid Kershner
Remove braces around single line if statements, they are not needed. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: add error handling to chipset_device_pause/resumeDavid Kershner
If there is an error in chipset_device_pause/resume don't try to respond, error out and let the calling functions respond to this error just like any other error they encounter. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: add error handling to ↵David Kershner
initiate_chipset_device_pause_resume Clean up the function to remove some if statments that should be done in the calling function. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: don't unregister if we failed to registerDavid Kershner
If we fail to register the visordriver, don't call unregister, just return with the error. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: don't ignore visorchannel_read errorDavid Kershner
Don't override the visorchannel_read_error, just return the error that it generates. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: check for err from dev_set_nameDavid Kershner
The function dev_set_name can return an error, don't just ignore it. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: cleanup error handling in visorbus_ueventDavid Kershner
The add_uevent_var returns an error. Don't overwrite the error with -ENOMEM, just pass the error code back up. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: get rid of unused parameter forcenomatchDavid Kershner
The forcenomatch parameter was not being used, so get rid of it. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: get rid of unused parameter forcematchDavid Kershner
The forcematch parameter was not being used, so get rid of it. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: get rid of create_bus_type.David Kershner
Create bus_type was just calling register_bustype. Since we control how many times we call create_bus_type it was extraneous keeping a counter if the bus was already registered, so the functions were no longer needed. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: fix error handling in create_bus_instanceDavid Kershner
The function get_vbus_header_info returns errors that were being handled incorrectly. Fix the error handling in create_bus_instance. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: add error handling visorbus_enable_channel_interruptDavid Kershner
Add error handling to visorbus_enable_channel_interrupt. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: add error handling for dev_start_periodic_workDavid Kershner
Report errors if we have a problem in dev_start_periodic_work. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: remove client from spar_check_channelDavid Kershner
We only have one version of spar_check_channel, get rid of the client at the end and help save space. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: get rid of shouting SPAR_VBUS_CHANNEL_CLIENT_OK macroDavid Kershner
The macro SPAR_VBUS_CHANNEL_CLIENT_OK was noisy and only used in one place so get rid of it. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: move vbuschannel_print_devinfo from .h to .c fileDavid Kershner
Move vbuschannel_print_devinfo from vbuchannel.h to visorbus_main.c since it is only referenced in visorbus_main.c. Since it is in a .c file, get rid of the inline for it. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-29staging: unisys: visorbus: consolidate bus_responder and device_responderDavid Kershner
With all the code churn, bus_responder and device_responder have become identical, consolidate them to the same function. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>