These should be using the _safe version of list_for_each() because we
free the current element and it leads to a use after free bug.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
We dereference "bus" when we report the error so we have to move the
kfree() down a couple lines.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Turns out these drivers like to mess around with the system even if the
hardware they control isn't present. That's not good, and people are
starting to report lots of issues with this in their build/boot testing.
So for now, let's just mark them as BROKEN, until the code gets
converted to use the proper driver model interaction (i.e. don't do
anything until the hardware is actually found in the system.)
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Benjamin Romer <benjamin.romer@unisys.com>
Cc: David Kershner <david.kershner@unisys.com>
Cc: someone <sparmaintainer@unisys.com>
Cc: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
It doesn't need to trace status of buffer when buffers are
allocated/deallocated. So stuff of tracing memory status
are removed. And also UISMALLOC/UISFREE macro are removed
completetly. just use kzalloc/kfree.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The RETINT macro included a goto statement which is not allowed in the
kernel.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The FAIL macro ultimately includes a goto statement which is not allowed
in the kernel.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The RETVOID macro contained a goto statement which is not allowed in
the kernel.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The RETPTR macro contained a goto statement which is not allowed in
the kernel.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The RETBOOL macro contained a goto statement which is not allowed in
the kernel.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Part of a series to get rid of goto statements embedded in macros. I'm
breaking this up into a series of smaller patches for easier review. The
later patches in the series will actually remove the goto statements.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the following macros:
TRY
CHKFD
CHKDD
CHKFDX
CHKDDX
ADDPROCLINE
TRY_WPOSTCODE_1
TRY_WPOSTCODE_2
FAIL_WPOSTCODE_2
FAIL_WPOSTCODE_3
Part of a series to get rid of goto statements embedded in macros. I'm
breaking this up into a series of smaller patches for easier review. The later
patches in the series will actually remove the goto statements.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The following macros were never referenced and have been removed:
DEVFROMID
DEVFROMFILE
DEVFROMINODE
DEVFROMIDX
TRY_WPOSTCODE_3
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch solves the Coccinelle warning: "kzalloc should be used
instead of kmalloc/memset"
This patch is a fixup for
linux-next: 97a84f1203
"Staging: unisys: Replace kmalloc/memset with kzalloc"
The ALLOC_CMDRSP #define is after transformation to kzalloc only a
rename for kzalloc and was completly removed.
Signed-off-by: Silvio F <silvio.fricke@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clean up code to get rid of sparse warnings.
Also fixed variable length arrays declared on the stack by removing
visor_hexDumpToBuffer() and using hex_dump_to_buffer() instead.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clean up code to get rid of sparse warnings due to accessing I/O space. Also
declared functions and variables as static if they are only used locally.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clean up code to get rid of sparse warnings, mostly due to accessing I/O space.
Remove visorchannel_get_safe_queue(), visorchannel_safesignalremove(),
and visorchannel_safesignalinsert() since they were not called from anywhere.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clean up code to get rid of sparse warnings, mostly related to accessing I/O
space.
Remove uislibcmpxchg64() and use cmpxchg() instead.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cleaned up multiple sparse warnings, mostly due to improper access of I/O
space. Also declared functions and variables that were only used locally
as static.
Removed ULTRA_disp_channel_header(), ULTRA_disp_channel(),
ULTRA_disp_vnic_channel() because they were never called.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clean up multiple sparse warnings mostly due to different address spaces
when accessing I/O memory.
Also, remove SignalRemoveAll(), SignalQueueHasOneElement(),
SignalQueueIsFull(), because they were never called.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The queue_delayed_work() return false if the work is
already on the queue, true otherwise.
So return value cannot be less than zero.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch solves the Coccinelle warning: "kzalloc should be used instead of
kmalloc/memset".
Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Fix coccinelle warnings of better allocation by using kzalloc.
In these cases, kzalloc is preferred, as kmalloc may fail if it does not find
contiguous memory.
Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
There were multiple variable length arrays declared on the stack in proc
handlers:
char buf[count];
I changed these to be fixed length arrays.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch adds the Unisys s-Par driver maintainers to the MAINTAINERS
file, changes the state to "Supported", modifies TODO to address patches
to the Unisys mailing list, and adds Greg Kroah-Hartman to the patch
recipients list.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Make sure BusListLock is unlocked before returning. If an error is encountered
early on in info_proc_read_helper() the function can return without unlocking.
Also changed the PROCLINE macro so that it doesn't include a goto statement.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
A character array was declared on the stack with variable length. This has
been corrected to use a fixed length.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kthread_create() returns an ERR_PTR on error, it never returns NULL.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
If CONFIG_SCSI is not enabled, compiling virthba.c goes horribly wrong with
undefined symbols.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Many exported symbols had very generic names. This commit changes the names
so that they will be unique.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
A number of functions were used for debug at one time but that code has been
removed.
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation for the set of s-Par drivers
Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The virthba module provides access to a shared SCSI host bus adapter
and one or more disk devices, by proxying SCSI commands between the
guest and the service partition that owns the shared SCSI adapter,
using a channel between the guest and the service partition. The disks
that appear on the shared bus are defined by the s-Par configuration
and enforced by the service partition, while the guest driver handles
sending commands and handling responses. Each disk is shared as a
whole to a guest. Sharing the bus adapter in this way provides
resiliency; should the device encounter an error, only the service
partition is rebooted, and the device is reinitialized. This allows
guests to continue running and to recover from the error.
Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The virtpci module handles the bus functions for virthba, and virtnic.
Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The visoruislib module is a support library, used to handle requests
from virtpci.
Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The visorchannelstub module provides support routines for storing and
retrieving data from a channel.
Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The visorchipset module receives device creation and destruction
events from the Command service partition of s-Par, as well as
controlling registration of shared device drivers with the s-Par
driver core. The events received are used to populate other s-Par
modules with their assigned shared devices. Visorchipset is required
for shared device drivers to function properly. Visorchipset also
stores information for handling dump disk device creation during
kdump.
In operation, the visorchipset module processes device creation and
destruction messages sent by s-Par's Command service partition through
a channel. These messages result in creation (or destruction) of each
virtual bus and virtual device. Each bus and device is also associated
with a communication channel, which is used to communicate with one or
more IO service partitions to perform device IO on behalf of the
guest.
Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The visorchannel module is a support library that abstracts reading
and writing a channel in memory.
Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The visorutil module is a support library required by all other s-Par
driver modules. Among its features it abstracts reading, writing, and
manipulating a block of memory.
Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>