Commit graph

966 commits

Author SHA1 Message Date
Alexander Curtin
b9edaf7ceb staging: unisys: include: Added kernel-doc for struct visor_driver
This adds kerneldoc style comments to the visor_driver struct since
it's shared between multiple modules.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
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>
2016-04-28 22:09:37 -07:00
Tim Sell
6d24b4b10e staging: unisys: include: remove unused fields from struct visor_driver
The build_date and build_time fields are not used, and have been removed.

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>
2016-04-28 22:09:37 -07:00
David Binder
538b387234 staging: unisys: Documentation: Remove proc-entries.txt
Unisys drivers no longer utilize procfs. Therefore, the documentation
for our procfs entries is no longer needed.

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>
2016-04-28 22:09:37 -07:00
Erik Arfvidson
38d56c2fad staging: unisys: added display string size define
Display string size that is guaranteed to be no longer the 99 characters.

Don't use a magic number throughout the code, define it once and use it
throughout.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:09:37 -07:00
Tim Sell
6a957193ba staging: unisys: visornic: convert BUG_ON to dev_err() message
The caller of visor_copy_fragsinfo_from_skb() is prepared to log a
dev_err() message if it fails (by returning a negative value), so we now
just fail in the one occasion where visor_copy_fragsinfo_from_skb() was
doing a BUG_ON.

There was also a problem before where visor_copy_fragsinfo_from_skb() was
returning a negative to indicate error, yet it was declared to return an
unsigned value!  So obviously that needed correcting too.

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>
2016-04-28 22:09:37 -07:00
Tim Sell
4145ba76b1 staging: unisys: visornic: prevent double-unlock of priv_lock
Previously, devdata->priv_lock was being unlocked in visornic_serverdown()
both before calling visornic_serverdown_complete(), then again at the end
of the function.  This bug was corrected.

The structure of visornic_serverdown() was also improved to make it easier
to follow and to decrease the chance that such bugs will be introduced
again.  The main-path logic now falls thru down the left-side of the page,
with a common error-exit point to handle error conditions.

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>
2016-04-11 21:15:51 -07:00
Tim Sell
6fac083b8d staging: unisys: visorinput: remove erroneous 'FIXME' comments
These comments were mistakenly carried forward by a previous copy/paste.

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>
2016-04-11 21:15:51 -07:00
Alexander Curtin
d2de2ffff5 staging: unisys: removed unused 'visor_device.respond_to_device_create'
The respond_to_device_create flag was used previously when we used to
delay responses to create requests until the drivers were finished
loading. This behaviour was removed some time ago, yet the field still
existed, while never being referenced or even initialized.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-11 21:15:51 -07:00
David Kershner
4a185e54e1 staging: unisys: visorbus: make bus_epilog match device_epilog
The paths in bus_epilog should match device_epilog.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-11 21:13:51 -07:00
David Kershner
3cb3fa3b79 staging: unisys: visorbus: device_epilog: clean up gotos
The away flag is ambiguous, rename it to out and appropriately
call the correct goto.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-11 21:13:51 -07:00
David Kershner
1366a3db3d staging: unisys: visorbus: visorchipset_init clean up gotos
Several error paths were not logging a message to s-Par during failure.
Error paths in visorchipset_init() were corrected so that they now all
do proper clean-ups. This made it necessary to move the function
visorchipset_file_cleanup() above visorchipset_init so it can be
referenced.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-11 21:13:51 -07:00
David Binder
2b9bcf81d3 staging: unisys: visorchannel: remove redundant member size
Removes size member from the visorchannel struct, since it was
a duplicate of the nbytes member.

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>
2016-04-11 21:13:51 -07:00
Tim Sell
dc38082f0f staging: unisys: visornic: CHECK: Alignment should match open parenthesis
Fix 'CHECK: Alignment should match open parenthesis' as recommended by
checkpatch.

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>
2016-04-11 21:11:09 -07:00
Tim Sell
a07d7c3858 staging: unisys: visorbus: CHECK: Alignment should match open parenthesis
Fix 'CHECK: Alignment should match open parenthesis' as recommended by
checkpatch.

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>
2016-04-11 21:11:09 -07:00
Tim Sell
e4feb2f257 staging: unisys: visorbus: 'unsigned' --> 'unsigned int'
Fix as recommended by checkpatch.

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>
2016-04-11 21:11:09 -07:00
Tim Sell
1f2f03c201 staging: unisys: visorbus: remove unnecessary poll_count logic
The use of poll_count is a vestige from long-ago testing, which is no
longer needed.  It is removed by this patch.

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>
2016-03-31 13:11:27 -07:00
David Kershner
64938182e7 staging: unisys: remove wmb() in visordriver_remove_device
Don't need to have a wmb() in visordriver_remove_device. Also removed
an unnecessary check for drv being null.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 18:28:32 -07:00
Alexander Curtin
527486ee8f staging: unisys: removed unused channel_bytes attribute
The channel_bytes attribute in the visor_device struct was meant to keep
track of the number of bytes in the associated channel of the device.
Not only is the variable never set nor used, but the information can
already be accessed by referencing visor_device->visorchannel->nbytes.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 18:28:32 -07:00
Alexander Curtin
03d0d045c8 staging: unisys: removed 'visor_device.devnodes' field
The 'visor_device.devnodes' field was used for displaying driver version
information through the devmajorminor sysfs attribute, which has recently
been removed, rendering the field unnecessary.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 18:28:32 -07:00
Alexander Curtin
240f7ec1f4 staging: unisys: removed unused visor_device.type field
The visor_device.type field was included when preparing to remove
the device_info struct. However, it's not used at all, and was already
redundant by the existence of the 'visor_device.channel_type_guid'
field.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 18:28:32 -07:00
Alexander Curtin
378d638a89 staging: unisys: include: removed unused 'visor_device.description'
The 'description' variable in visor_device was added in preparation for
removing the 'device_info' struct when the uislib files were removed.

That attribute is never accessed nor set, and the 'name' attribute
provides enough information to correctly identify the driver, it is not
needed.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 18:28:32 -07:00
Alexander Curtin
a0fcb63586 staging: unisys: removed unused switch/port info from visorbus.h
The fields 'switch_no' and 'internal_port_no' were originally added to the
visor_device struct in preparation of removing the 'device_info' struct
in the now removed 'uislib' library. After the refactoring was complete,
these attributes are not referenced anywhere, and there are no plans to
use them.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-30 18:28:32 -07:00
Alexander Curtin
85d83cd8c6 staging: unisys: include: changed 'v' variable to 'state'
The argument for ULTRA_CHANNELCLI_STRING is supposed to be
an integer representing the channel state. 'state' is a more
descriptive variable name for this.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alexander Curtin
a22f57c650 staging: unisys: visorbus: replaced use of vague 'x' variable
In client_bus_info_show, the variable 'x' is used to create keep track
of the offset that the current 'pos' in the output buffer needs to be
incremented by. Since 'off' is already taken 'shift' was used since it's
used to shift the pointer.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alexander Curtin
8d7da1d8c2 staging: unisys: visorbus: replaced vague 'p' variable with 'pos'
In the case of client_bus_info_show, the variable 'p' was used to
indicate the position in the output buffer. This was changed to 'pos' to
indicate that it kept track of the current position in the output
buffer.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alexander Curtin
62f3dc8567 staging: unisys: visorbus: replaced vague variable name in zoneguid_show
The variable name "s" doesn't indicate the purpose of the string, which
is to store the id collected from the visorchannel_zoneid function. This
just replaces the name with "zoneid".

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alexander Curtin
48f571489c staging: unisys: visorbus: replaced vague variable name in typeguid_show
The variable name "s" doesn't indicate the purpose of the string, which
is to store the id collected from the visorchannel_id function. This
just replaces the name with "typeid".

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Erik Arfvidson
4d12b5ee26 staging: unisys: remove visorinput.c double negative comparison
This patch simply removes the double negative comparison for
test_bit since test_bit already preforms this check.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Erik Arfvidson
800aecc30b staging: unisys: remove channel.h double negative comparison
This patch removes the double negative comparisons for function
readb.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
0b2acf34f3 staging: unisys: visorbus: rename create_visor_device gotos
Away is ambiguous when specifying error vs success. Make return labels
more meaningful by marking them as error paths.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
8e33f48c95 staging: unisys: visorbus: Remove gotos in visorbus_match
Gotos in visorbus_match are not needed.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
78af1aef66 staging: unisys: visorbus: fix up gotos in visorbus_init
This patch fixes the gotos in visorbus_init

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Tim Sell
b750b05939 staging: unisys: visorbus: remove unused sysfs attribute devmajorminor/*
The sysfs attribute directory at:

    /sys/bus/visorbus/devices/vbus<x>:dev<y>/devmajorminor/*

or

    /sys/devices/visorbus<x>/vbus<x>:dev<y>/devmajorminor/*

previously provided a location where a visorbus function driver could
publish information (for usermode use) about possibly-multiple major and
minor device numbers for character devices created for a each visorbus
device, using visorbus_registerdevnode().  This functionality is not
currently used, so it has been removed by this cset.

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>
2016-03-28 07:30:36 -07:00
David Kershner
4000622ec2 staging: unisys: visorbus: Fix up visordriver_probe
Fixup the visordriver_probe function. Rearrange the function to avoid
needing gotos and removed unnecessary wmb().

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
c6af7a9cbc staging: unisys: visorbus: fix my_create_device goto statements
Don't use the abmiguous cleanup, make it more meaningful.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
368acb3f51 staging: unisys: visorbus: Cleanup bus_epilog goto statements
Cleaned up bus_epilogs vague gotos and in the process discovered
some error paths that could unlock a non locked semaphore.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
9fd04060ab staging: unisys: visorbus: Cleanup goto in bus_create
Rename it to what it does instead of the default ambiguous
cleanup.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
5233d1ebb6 staging: unisys: visorbus: chipset_init rename goto
Change the goto label "cleanup" to something more useful like
out_respond.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
d79f56b599 staging: unisys: visorbus: cleanup gotos in parser_init_byte_stream
Clean up the goto in parser_init_byte_stream and make the goto section
the error case.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
dde29996cd staging: unisys: visorbus: get rid of gotos in intialize_controlvm_payload_info
Get rid of the gotos in initialize_controlvm_payload_info. The check in
the error path if payload was valid was never called so get rid of that
as well.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
David Kershner
b899963f15 staging: unisys: visorbus: cleanup goto in setup_crash_devices_work_queue
If visorbus has registered yet just reschedule and exit. The rest of
the function doesn't need to reschedule so just move it up to the
initial check.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar
6e1edc0f8b staging: unisys: visornic: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally
useful after a break or return.

This was done using Coccinelle:
@@
expression e2;
statement s1;
@@
if(e2) { ... return ...; }
-else
         s

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-10 19:29:45 -08:00
David Kershner
d342c06043 staging: unisys: visorbus: clean up visorchannel_clear
Goto label was ambiguous change to out_free_page to signify that
we will always go through the path even on success.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-10 19:27:39 -08:00
David Kershner
5bf49a6c74 staging: unisys: visorbus: cleanup gotos in visorchannel_create_guts
Away label is ambiguous change to it err_destroy_channel to make it
clear this is an error path.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-10 19:27:39 -08:00
Eva Rachel Retuya
7b50908a5e staging: unisys: visorinput: convert pr_err() to dev_err()
Replace pr_err() calls with respective dev_err() counterpart.
Semantic patch used to detect and apply the transformation:

@r exists@
identifier f,s,i;
position p;
@@

f(...,struct s *i,...) {
  <+...
  pr_err@p(...)
  ...+>
}

@s@
identifier r.s, dev;
@@

struct s {
	...
	struct device dev;
	...
};

@t@
identifier r.i, s.dev;
expression fmt;
position r.p;
@@

- pr_err@p(
+ dev_err(&i->dev,
			fmt, ...);

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-10 19:26:05 -08:00
David Kershner
2500276efe staging: unisys: visorbus: variable adjustment should be a u64
This patch fixes the smatch error:

drivers/staging/unisys/visorbus/visorchipset.c:2217 visorchipset_ioctl()
warn: user controlled 'adjustment' cast to postive rl = 's64min-s64max'

This is because we read a s64 and pass it to a function as u64.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-10 19:26:05 -08:00
Randy Dunlap
82ddecfe8d staging: unisys: visorinput depends on INPUT
Fix build errors by limiting UNISYS_VISORINPUT to the INPUT kconfig
setting.

drivers/built-in.o: In function `visorinput_remove':
visorinput.c:(.text+0x20802e): undefined reference to `input_unregister_device'
drivers/built-in.o: In function `visorinput_probe':
visorinput.c:(.text+0x208177): undefined reference to `input_allocate_device'
visorinput.c:(.text+0x208241): undefined reference to `input_register_device'
visorinput.c:(.text+0x20824d): undefined reference to `input_free_device'
visorinput.c:(.text+0x208286): undefined reference to `input_allocate_device'
visorinput.c:(.text+0x208302): undefined reference to `input_set_abs_params'
visorinput.c:(.text+0x20831a): undefined reference to `input_set_abs_params'
visorinput.c:(.text+0x20833f): undefined reference to `input_register_device'
visorinput.c:(.text+0x20834b): undefined reference to `input_free_device'
visorinput.c:(.text+0x20835f): undefined reference to `input_set_capability'
drivers/built-in.o: In function `visorinput_channel_interrupt':
visorinput.c:(.text+0x20851e): undefined reference to `input_event'
visorinput.c:(.text+0x20862c): undefined reference to `input_event'
drivers/built-in.o: In function `input_report_key':
visorinput.c:(.text+0x207fd1): undefined reference to `input_event'
drivers/built-in.o: In function `input_sync':
visorinput.c:(.text+0x207fdc): undefined reference to `input_event'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:14:19 -08:00
Tim Sell
12c957dc94 staging: unisys: visorbus: allow visorhba device to be used for kdump
This patch saves off the create_bus and create_device controlvm messages
for the visorhba device, so that they can be resurrected and used in the
kdump kernel.

After this patch, a crash dump can be generated using:

    # service kdump start
    # echo 1 > /proc/sys/kernel/sysrq
    # echo c > /proc/sysrq-trigger

Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:14:07 -08:00
Tim Sell
c732623b0b staging: unisys: visorbus: tolerate larger-than-expected controlvm channel
Use the dynamic size of the controlvm channel (struct channel_header.size)
instead of the statically computed sizeof(struct controlvm_channel) when
determining the valid bounds for visorchannel_read() and
visorchannel_write().

This prevents an observed problem where kdump was failing because
controlvm_channel.local_crash_msg_offset was pointing beyond the statically
computed size of the channel, even though the channel was physically large
enough.  This was causing visorchannel_read() to unecessarily fail, because
we thought we were attempting to access memory outside of the channel.

Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:14:07 -08:00
Tim Sell
a8deaef370 staging: unisys: visorbus: fix payload memory usage in controlvm channel
Previously if controlvm message payloads (indicated in controlvm message
via struct controlvm_message.hdr.payload_vm_offset) were contained within
the bounds of the channel memory, we would fail to process any controlvm
message that contained payload data.  Reason is, the request_mem_region()
would fail, because it overlapped the channel memory.  Since
request_mem_region() doesn't actually serve a functional purpose anyway,
this was simply removed.

Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-01 19:14:07 -08:00