[PATCH] staging: unisys: add visorclientbus driver

2014-11-06 Thread Ken Cox
From: Benjamin Romer benjamin.ro...@unisys.com

This patch adds the visorclientbus driver to the Unisys s-Par driver set. This
driver is responsible for helping manage virtual devices like keyboards, mice,
serial ports, displays, and any customized drivers for special-purpose guests.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/Kconfig |   1 +
 drivers/staging/unisys/Makefile|   1 +
 drivers/staging/unisys/visorclientbus/Kconfig  |   9 +
 drivers/staging/unisys/visorclientbus/Makefile |  13 +
 .../unisys/visorclientbus/visorclientbus_main.c| 378 +
 5 files changed, 402 insertions(+)
 create mode 100644 drivers/staging/unisys/visorclientbus/Kconfig
 create mode 100644 drivers/staging/unisys/visorclientbus/Makefile
 create mode 100644 drivers/staging/unisys/visorclientbus/visorclientbus_main.c

diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
index ac080c9..d63b035 100644
--- a/drivers/staging/unisys/Kconfig
+++ b/drivers/staging/unisys/Kconfig
@@ -16,5 +16,6 @@ source drivers/staging/unisys/channels/Kconfig
 source drivers/staging/unisys/uislib/Kconfig
 source drivers/staging/unisys/virtpci/Kconfig
 source drivers/staging/unisys/virthba/Kconfig
+source drivers/staging/unisys/visorclientbus/Kconfig
 
 endif # UNISYSSPAR
diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile
index b988d69..794177b 100644
--- a/drivers/staging/unisys/Makefile
+++ b/drivers/staging/unisys/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_UNISYS_CHANNELSTUB)+= channels/
 obj-$(CONFIG_UNISYS_UISLIB)+= uislib/
 obj-$(CONFIG_UNISYS_VIRTPCI)   += virtpci/
 obj-$(CONFIG_UNISYS_VIRTHBA)   += virthba/
+obj-$(CONFIG_UNISYS_VISORCLIENTBUS)+= visorclientbus/
diff --git a/drivers/staging/unisys/visorclientbus/Kconfig 
b/drivers/staging/unisys/visorclientbus/Kconfig
new file mode 100644
index 000..62bdbb9
--- /dev/null
+++ b/drivers/staging/unisys/visorclientbus/Kconfig
@@ -0,0 +1,9 @@
+#
+# Unisys visorclientbus configuration
+#
+
+config UNISYS_VISORCLIENTBUS
+   tristate Unisys visorclientbus driver
+   depends on UNISYSSPAR  UNISYS_VISORCHIPSET  UNISYS_UISLIB
+   ---help---
+   If you say Y here, you will enable the Unisys visorclientbus driver.
diff --git a/drivers/staging/unisys/visorclientbus/Makefile 
b/drivers/staging/unisys/visorclientbus/Makefile
new file mode 100644
index 000..bfacc0d
--- /dev/null
+++ b/drivers/staging/unisys/visorclientbus/Makefile
@@ -0,0 +1,13 @@
+#
+# Makefile for Unisys visorclientbus
+#
+
+obj-$(CONFIG_UNISYS_VISORCLIENTBUS)+= visorclientbus.o
+
+visorclientbus-y := visorclientbus_main.o
+
+ccflags-y += -Idrivers/staging/unisys/include
+ccflags-y += -Idrivers/staging/unisys/uislib
+ccflags-y += -Idrivers/staging/unisys/visorchipset
+ccflags-y += -Idrivers/staging/unisys/common-spar/include
+ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels
diff --git a/drivers/staging/unisys/visorclientbus/visorclientbus_main.c 
b/drivers/staging/unisys/visorclientbus/visorclientbus_main.c
new file mode 100644
index 000..0c560a1
--- /dev/null
+++ b/drivers/staging/unisys/visorclientbus/visorclientbus_main.c
@@ -0,0 +1,378 @@
+/* visorclientbus_main.c
+ *
+ * Copyright (C) 2010 - 2013 UNISYS CORPORATION
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ */
+
+/*
+ *  This module processes bus+device messages received for devices which we are
+ *  to act as a client for.  Currently the only device for which we can act
+ *  as a client is VNIC.
+ */
+
+#include timskmod.h
+#include visorchipset.h
+#include uisutils.h
+#include iochannel.h
+#include version.h
+#include guestlinuxdebug.h
+#include linux/mm.h
+
+#define CURRENT_FILE_PC VISOR_CLIENT_BUS_PC_visorclientbus_main_c
+#define MYDRVNAME visorclientbus
+
+static int dump_vhba_bus = -1;
+
+static void chipset_bus_create(ulong bus_no);
+static void chipset_bus_destroy(ulong bus_no);
+
+static void chipset_device_create(ulong bus_no, ulong dev_no);
+static void chipset_device_destroy(ulong bus_no, ulong dev_no);
+static void chipset_device_pause(ulong bus_no, ulong dev_no);
+static void chipset_device_resume(ulong bus_no, ulong dev_no);
+
+/* These functions are implemented herein, and are called by the chipset
+ * driver to notify us about specific events.
+ */
+static struct

Re: [PATCH] staging: unisys: add visorclientbus driver

2014-11-06 Thread Ken Cox


On 11/06/2014 01:05 PM, Greg KH wrote:

On Thu, Nov 06, 2014 at 12:53:32PM -0600, Ken Cox wrote:

From: Benjamin Romer benjamin.ro...@unisys.com

This patch adds the visorclientbus driver to the Unisys s-Par driver set. This
driver is responsible for helping manage virtual devices like keyboards, mice,
serial ports, displays, and any customized drivers for special-purpose guests.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
Signed-off-by: Ken Cox j...@redhat.com
---
  drivers/staging/unisys/Kconfig |   1 +
  drivers/staging/unisys/Makefile|   1 +
  drivers/staging/unisys/visorclientbus/Kconfig  |   9 +
  drivers/staging/unisys/visorclientbus/Makefile |  13 +
  .../unisys/visorclientbus/visorclientbus_main.c| 378 +

I really don't want to accept any new features for this codebase,
until you have cleaned up the existing mess.
OK, we will continue getting the code cleaned up before submitting 
anything new.

  5 files changed, 402 insertions(+)
  create mode 100644 drivers/staging/unisys/visorclientbus/Kconfig
  create mode 100644 drivers/staging/unisys/visorclientbus/Makefile
  create mode 100644 drivers/staging/unisys/visorclientbus/visorclientbus_main.c

diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
index ac080c9..d63b035 100644
--- a/drivers/staging/unisys/Kconfig
+++ b/drivers/staging/unisys/Kconfig
@@ -16,5 +16,6 @@ source drivers/staging/unisys/channels/Kconfig
  source drivers/staging/unisys/uislib/Kconfig
  source drivers/staging/unisys/virtpci/Kconfig
  source drivers/staging/unisys/virthba/Kconfig
+source drivers/staging/unisys/visorclientbus/Kconfig
  
  endif # UNISYSSPAR

diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile
index b988d69..794177b 100644
--- a/drivers/staging/unisys/Makefile
+++ b/drivers/staging/unisys/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_UNISYS_CHANNELSTUB)+= channels/
  obj-$(CONFIG_UNISYS_UISLIB)   += uislib/
  obj-$(CONFIG_UNISYS_VIRTPCI)  += virtpci/
  obj-$(CONFIG_UNISYS_VIRTHBA)  += virthba/
+obj-$(CONFIG_UNISYS_VISORCLIENTBUS)+= visorclientbus/
diff --git a/drivers/staging/unisys/visorclientbus/Kconfig 
b/drivers/staging/unisys/visorclientbus/Kconfig
new file mode 100644
index 000..62bdbb9
--- /dev/null
+++ b/drivers/staging/unisys/visorclientbus/Kconfig
@@ -0,0 +1,9 @@
+#
+# Unisys visorclientbus configuration
+#
+
+config UNISYS_VISORCLIENTBUS
+   tristate Unisys visorclientbus driver
+   depends on UNISYSSPAR  UNISYS_VISORCHIPSET  UNISYS_UISLIB
+   ---help---
+   If you say Y here, you will enable the Unisys visorclientbus driver.

What about if you say 'M'?  :)

A whole subdirectory for a single .c file?  That's not needed, or
acceptable.


diff --git a/drivers/staging/unisys/visorclientbus/Makefile 
b/drivers/staging/unisys/visorclientbus/Makefile
new file mode 100644
index 000..bfacc0d
--- /dev/null
+++ b/drivers/staging/unisys/visorclientbus/Makefile
@@ -0,0 +1,13 @@
+#
+# Makefile for Unisys visorclientbus
+#
+
+obj-$(CONFIG_UNISYS_VISORCLIENTBUS)+= visorclientbus.o
+
+visorclientbus-y := visorclientbus_main.o

As this is a single-file module, why not just have the .c file be called
visorclientbus.c?


+ccflags-y += -Idrivers/staging/unisys/include
+ccflags-y += -Idrivers/staging/unisys/uislib
+ccflags-y += -Idrivers/staging/unisys/visorchipset
+ccflags-y += -Idrivers/staging/unisys/common-spar/include
+ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels

Here's one example of things that need to be fixed up, you should never
need -I lines in a kernel Makefile, otherwise some testing tools are
broken.

Thanks for the feedback.  I'll get these corrected.


There are also other checkpatch errors in this patch, which makes me not
want to take it at all, as you would now just be required to send more
fixes for the file.  So why not fix things up right the first time?

The only checkpatch warnings I get are:
-a warning about the MAINTAINERS file not being updated when adding a 
new file.  MAINTAINERS already has an entry that covers this file


-warnings about lines over 80 characters.  These are strings for error 
messages that make the line exceed 80 characters.  I thought this was OK.



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Staging: unisys: base drivers complete

2014-09-15 Thread Ken Cox

Greg and other reviewers,

Ben Romer and I believe that the Unisys drivers in staging-next are now 
complete.  Are there any other changes that you are aware of that we 
need to make to these drivers?


We have additional drivers to submit that are supported by this base set 
of drivers but want to make sure the base set is in good shape before 
continuing.  As changes requested by the community have been made in the 
staging-next drivers, we have made corresponding changes in the 
additional drivers to try and have a minimal amount of additional work 
when these drivers are submitted.


Thanks in advance for your comments,

--
Ken Cox
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Staging: unisys: base drivers complete

2014-09-15 Thread Ken Cox


On 09/15/2014 11:04 AM, Greg KH wrote:

On Mon, Sep 15, 2014 at 10:56:07AM -0500, Ken Cox wrote:

Greg and other reviewers,

Ben Romer and I believe that the Unisys drivers in staging-next are now
complete.  Are there any other changes that you are aware of that we need to
make to these drivers?

Have you actually ran the checkpatch.pl tool on this code?  You still
have a lot of cleanup to do (hint, typedefs for drivers are not
allowed...)
I had not re-run checkpatch.pl and should have.  I could have answered 
my own question.



We have additional drivers to submit that are supported by this base set of
drivers but want to make sure the base set is in good shape before
continuing.  As changes requested by the community have been made in the
staging-next drivers, we have made corresponding changes in the additional
drivers to try and have a minimal amount of additional work when these
drivers are submitted.

See above, get the basics down first, you still have a ways to go to get
there...

And what bout the TODO file?  The first 3 items are not completed.  Why
even have a TODO file if you aren't going to look at it?  :(

We will continue to work and get these items addressed.

Thanks for your feedback

--
Ken
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Staging: unisys: base drivers complete

2014-09-15 Thread Ken Cox

On 09/15/2014 11:03 AM, Dan Carpenter wrote:

Which ones are the base drivers?
I was referring to all the Unisys drivers currently in staging-next.  
The drivers that have not been submitted have dependencies on 
functionality that is provided by the current drivers in staging-next.


There are still lots of checkpatch.pl warnings in drivers/unisys.
Checkpatch.pl is a minimum requirement.  It doesn't make sense to look
at this this any harder when there are still obvious things to fix.

Really it's better if you run checkpatch.pl with the --strict option.

Thanks,  we will get those taken care of.

--
Ken Cox

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/4] Staging: unisys: use Linux coding convention for function names

2014-07-03 Thread Ken Cox
Change function names to conform to Linux kernel coding convention.
ULTRA_VBUS_init_channel() -- ultra_vbus_init_channel()
VBUSCHANNEL_devInfoToStringBuffer() -- vbuschannel_devinfo_to_string()
VBUSCHANNEL_sanitize_buffer() -- vbuschannel_sanitize_buffer()
VBUSCHANNEL_itoa() -- vbuschannel_itoa()

Signed-off-by: Ken Cox j...@redhat.com
---
 .../common-spar/include/channels/vbuschannel.h |  4 ++--
 .../unisys/common-spar/include/vbusdeviceinfo.h| 28 +++---
 drivers/staging/unisys/uislib/uislib.c |  2 +-
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 0dd3e2d..000182c 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -94,8 +94,8 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
sizeof(ULTRA_VBUS_DEVICEINFO)))
 #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
 
-static INLINE void
-ULTRA_VBUS_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
+static inline void
+ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
int bytesAllocated)
 {
/* Please note that the memory at x does NOT necessarily have space
diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index 8c0259a..7164868 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -50,7 +50,7 @@ typedef struct _ULTRA_VBUS_DEVICEINFO {
  * to a buffer at p, had it been infinitely big.
  */
 static inline int
-VBUSCHANNEL_sanitize_buffer(char *p, int remain, char __iomem *src, int srcmax)
+vbuschannel_sanitize_buffer(char *p, int remain, char __iomem *src, int srcmax)
 {
int chars = 0;
int nonprintable_streak = 0;
@@ -99,7 +99,7 @@ VBUSCHANNEL_sanitize_buffer(char *p, int remain, char __iomem 
*src, int srcmax)
  * an environment-independent way (since we are in a common header file).
  */
 static inline int
-VBUSCHANNEL_itoa(char *p, int remain, int num)
+vbuschannel_itoa(char *p, int remain, int num)
 {
int digits = 0;
char s[32];
@@ -146,22 +146,22 @@ VBUSCHANNEL_itoa(char *p, int remain, int num)
  * Returns the number of bytes written to p.
  */
 static inline int
-VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
+vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem *devinfo,
  char *p, int remain, int devix)
 {
char __iomem *psrc;
int nsrc, x, i, pad;
int chars = 0;
 
-   psrc = (devInfo-devType[0]);
-   nsrc = sizeof(devInfo-devType);
-   if (VBUSCHANNEL_sanitize_buffer(NULL, 0, psrc, nsrc) = 0)
+   psrc = (devinfo-devType[0]);
+   nsrc = sizeof(devinfo-devType);
+   if (vbuschannel_sanitize_buffer(NULL, 0, psrc, nsrc) = 0)
return 0;
 
/* emit device index */
if (devix = 0) {
VBUSCHANNEL_ADDACHAR('[', p, remain, chars);
-   x = VBUSCHANNEL_itoa(p, remain, devix);
+   x = vbuschannel_itoa(p, remain, devix);
p += x;
remain -= x;
chars += x;
@@ -173,7 +173,7 @@ VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO 
__iomem *devInfo,
}
 
/* emit device type */
-   x = VBUSCHANNEL_sanitize_buffer(p, remain, psrc, nsrc);
+   x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc);
p += x;
remain -= x;
chars += x;
@@ -183,9 +183,9 @@ VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO 
__iomem *devInfo,
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
 
/* emit driver name */
-   psrc = (devInfo-drvName[0]);
-   nsrc = sizeof(devInfo-drvName);
-   x = VBUSCHANNEL_sanitize_buffer(p, remain, psrc, nsrc);
+   psrc = (devinfo-drvName[0]);
+   nsrc = sizeof(devinfo-drvName);
+   x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc);
p += x;
remain -= x;
chars += x;
@@ -195,9 +195,9 @@ VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO 
__iomem *devInfo,
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
 
/* emit strings */
-   psrc = (devInfo-infoStrings[0]);
-   nsrc = sizeof(devInfo-infoStrings);
-   x = VBUSCHANNEL_sanitize_buffer(p, remain, psrc, nsrc);
+   psrc = (devinfo-infoStrings[0]);
+   nsrc = sizeof(devinfo-infoStrings);
+   x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc);
p += x;
remain -= x;
chars += x;
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index d4a7ef8

[PATCH 0/4] Staging: unisys: Code cleanup

2014-07-03 Thread Ken Cox
This series implements various cleanups for the Unisys drivers, including:

  -Renaming functions using Linux kernel conventions
  -Removing dead code
  -fixing noderef sparse warnings

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] Staging: unisys: Remove isServer arg from init_vbus_channel()

2014-07-03 Thread Ken Cox
The init_vbus_channel() function is never called with the isServer
argument equal to TRUE, so just get rid of the argument altogether.
This also means that the code in the function that would be executed
in the server case can be removed since it is never executed.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/uislib/uislib.c | 26 +++---
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 70cc00f..5c7bffc 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -129,7 +129,7 @@ init_msg_header(CONTROLVM_MESSAGE *msg, U32 id, uint rsp, 
uint svr)
 }
 
 static __iomem void *
-init_vbus_channel(U64 channelAddr, U32 channelBytes, int isServer)
+init_vbus_channel(U64 channelAddr, U32 channelBytes)
 {
void __iomem *rc = NULL;
void __iomem *pChan = uislib_ioremap_cache(channelAddr, channelBytes);
@@ -140,22 +140,11 @@ init_vbus_channel(U64 channelAddr, U32 channelBytes, int 
isServer)
rc = NULL;
goto Away;
}
-   if (isServer) {
-   memset_io(pChan, 0, channelBytes);
-   if (!ULTRA_VBUS_CHANNEL_OK_SERVER(channelBytes, NULL)) {
-   ERRDRV(%s channel cannot be used, __func__);
-   uislib_iounmap(pChan);
-   rc = NULL;
-   goto Away;
-   }
-   ultra_vbus_init_channel(pChan, channelBytes);
-   } else {
-   if (!ULTRA_VBUS_CHANNEL_OK_CLIENT(pChan, NULL)) {
-   ERRDRV(%s channel cannot be used, __func__);
-   uislib_iounmap(pChan);
-   rc = NULL;
-   goto Away;
-   }
+   if (!ULTRA_VBUS_CHANNEL_OK_CLIENT(pChan, NULL)) {
+   ERRDRV(%s channel cannot be used, __func__);
+   uislib_iounmap(pChan);
+   rc = NULL;
+   goto Away;
}
rc = pChan;
 Away:
@@ -235,8 +224,7 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
bus-busChannelBytes = msg-cmd.createBus.channelBytes;
bus-pBusChannel =
init_vbus_channel(msg-cmd.createBus.channelAddr,
- msg-cmd.createBus.channelBytes,
- msg-hdr.Flags.server);
+ msg-cmd.createBus.channelBytes);
}
/* the msg is bound for virtpci; send guest_msgs struct to callback */
if (!msg-hdr.Flags.server) {
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] Staging: unisys: Fix noderef sparse warnings in vbusdeviceinfo.h

2014-07-03 Thread Ken Cox
vbuschannel_devinfo_to_string() was declared with the devinfo argument
as a pointer to __iomem space.  No callers of this function need the
__iomem space, so I removed that constraint.

Same thing goes for vbuschannel_sanitize_buffer().  It doesn't need to
operate on I/O space.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index 7164868..45e311c 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -50,12 +50,12 @@ typedef struct _ULTRA_VBUS_DEVICEINFO {
  * to a buffer at p, had it been infinitely big.
  */
 static inline int
-vbuschannel_sanitize_buffer(char *p, int remain, char __iomem *src, int srcmax)
+vbuschannel_sanitize_buffer(char *p, int remain, char *src, int srcmax)
 {
int chars = 0;
int nonprintable_streak = 0;
while (srcmax  0) {
-   if ((readb(src) = ' ')  (readb(src)  0x7f)) {
+   if ((*src = ' ')  (*src  0x7f)) {
if (nonprintable_streak) {
if (remain  0) {
*p = ' ';
@@ -67,7 +67,7 @@ vbuschannel_sanitize_buffer(char *p, int remain, char __iomem 
*src, int srcmax)
nonprintable_streak = 0;
}
if (remain  0) {
-   *p = readb(src);
+   *p = *src;
p++;
remain--;
chars++;
@@ -146,10 +146,10 @@ vbuschannel_itoa(char *p, int remain, int num)
  * Returns the number of bytes written to p.
  */
 static inline int
-vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem *devinfo,
+vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO *devinfo,
  char *p, int remain, int devix)
 {
-   char __iomem *psrc;
+   char *psrc;
int nsrc, x, i, pad;
int chars = 0;
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] Staging: unisys: Remove ultra_vbus_init_channel function

2014-07-03 Thread Ken Cox
The function ultra_vbus_init_channel() is never called since
previous server code was removed.  Remove the dead code.

Signed-off-by: Ken Cox j...@redhat.com
---
 .../common-spar/include/channels/vbuschannel.h | 36 --
 1 file changed, 36 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 000182c..69de9d9 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -94,42 +94,6 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
sizeof(ULTRA_VBUS_DEVICEINFO)))
 #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
 
-static inline void
-ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
-   int bytesAllocated)
-{
-   /* Please note that the memory at x does NOT necessarily have space
-   * for DevInfo structs allocated at the end, which is why we do NOT use
-   * bytesAllocated to clear. */
-   memset_io(x, 0, sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL));
-   if (bytesAllocated  (int) sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL))
-   return;
-   writel(ULTRA_VBUS_CHANNEL_PROTOCOL_VERSIONID,
-  x-ChannelHeader.VersionId);
-   writeq(ULTRA_VBUS_CHANNEL_PROTOCOL_SIGNATURE,
-  x-ChannelHeader.Signature);
-   writel(CHANNELSRV_READY, x-ChannelHeader.SrvState);
-   writel(sizeof(x-ChannelHeader), x-ChannelHeader.HeaderSize);
-   writeq(bytesAllocated, x-ChannelHeader.Size);
-   memcpy_toio(x-ChannelHeader.Type, UltraVbusChannelProtocolGuid,
-   sizeof(x-ChannelHeader.Type));
-   memcpy_toio(x-ChannelHeader.ZoneGuid, NULL_UUID_LE, sizeof(uuid_le));
-   writel(sizeof(ULTRA_VBUS_HEADERINFO), x-HdrInfo.structBytes);
-   writel(sizeof(ULTRA_VBUS_HEADERINFO), x-HdrInfo.chpInfoByteOffset);
-   writel(readl(x-HdrInfo.chpInfoByteOffset) +
-  sizeof(ULTRA_VBUS_DEVICEINFO),
-  x-HdrInfo.busInfoByteOffset);
-   writel(readl(x-HdrInfo.busInfoByteOffset)
-  + sizeof(ULTRA_VBUS_DEVICEINFO),
-  x-HdrInfo.devInfoByteOffset);
-   writel(sizeof(ULTRA_VBUS_DEVICEINFO),
-  x-HdrInfo.deviceInfoStructBytes);
-   bytesAllocated -= (sizeof(ULTRA_CHANNEL_PROTOCOL)
-  + readl(x-HdrInfo.devInfoByteOffset));
-   writel(bytesAllocated / readl(x-HdrInfo.deviceInfoStructBytes),
-  x-HdrInfo.devInfoCount);
-}
-
 #pragma pack(pop)
 
 #endif
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: linux-next: Tree for Jul 3 (staging/unisys)

2014-07-03 Thread Ken Cox

On 07/03/2014 10:32 AM, Randy Dunlap wrote:

On 07/02/14 22:53, Stephen Rothwell wrote:

Hi all,

Changes since 20140702:


on x86_64:

CONFIG_UNISYSSPAR=y
CONFIG_UNISYS_VISORUTIL=m
# CONFIG_UNISYS_VISORCHANNEL is not set
CONFIG_UNISYS_CHANNELSTUB=y

drivers/built-in.o: In function `channel_mod_init':
chanstub.c:(.init.text+0x10a8f): undefined reference to `unisys_spar_platform'


because CHANNELSTUB=y and VISORUTIL=m.

Hi Randy,

I have submitted a patch to fix this.

Thanks for the reply.

--
Ken
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging:unisys: Add Kconfig dependency on UNISYS_VISORUTIL to UNISYS_CHANNELSTUB

2014-06-30 Thread Ken Cox
The visorchannelstub module references the variable unisys_spar_platform
which is declared in the visorutil module.  Add the proper dependency to
Kconfig to ensure that visorutil is enabled when building visorchannelstub.

This address the build error:
   drivers/built-in.o: In function `channel_mod_init':
   chanstub.c:(.init.text+0xbe24): undefined reference to `unisys_spar_platform'

Reported by: kbuild test robot fengguang...@intel.com
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/channels/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/channels/Kconfig 
b/drivers/staging/unisys/channels/Kconfig
index 47a2353..179c6ce 100644
--- a/drivers/staging/unisys/channels/Kconfig
+++ b/drivers/staging/unisys/channels/Kconfig
@@ -4,7 +4,7 @@
 
 config UNISYS_CHANNELSTUB
tristate Unisys channelstub driver
-   depends on UNISYSSPAR
+   depends on UNISYSSPAR  UNISYS_VISORUTIL
---help---
If you say Y here, you will enable the Unisys channels driver.
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: randconfig build error with next-20140630, in drivers/staging/unisys/channels/chanstub.c

2014-06-30 Thread Ken Cox


On 06/30/2014 11:13 AM, Jim Davis wrote:

Building with the attached random configuration file,

drivers/built-in.o: In function `channel_mod_init':
chanstub.c:(.init.text+0xcbcf): undefined reference to `unisys_spar_platform'
make: *** [vmlinux] Error 1

Hi Jim,

I have already submitted a patch to correct this. The kbuild test robot 
uncovered it also.


Thanks for the report,
Ken
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/4] Staging: unisys: remove references to __DATE__ and __TIME__

2014-06-26 Thread Ken Cox


On 06/25/2014 10:57 PM, Greg KH wrote:

On Wed, Jun 25, 2014 at 11:48:23AM -0500, Ken Cox wrote:

--snip--

.id_table = virthba_id_table,
.probe = virthba_probe,
.remove = virthba_remove,
@@ -1413,9 +1413,6 @@ info_proc_read(struct file *file, char __user *buf, 
size_t len, loff_t *offset)
length += sprintf(vbuf + length, \nvirthba result queue poll 
wait:%d usecs.\n,
  rsltq_wait_usecs);
  
-		length += sprintf(vbuf + length,

- \nModule build: Date:%s Time:%s\n,
- __DATE__, __TIME__);
length += sprintf(vbuf + length, \ninterrupts_rcvd = %llu, 
interrupts_disabled = %llu\n,
  virthbainfo-interrupts_rcvd,
  virthbainfo-interrupts_disabled);

Why not just delete this proc file entirely?  You'll have to do that
eventually anyway :)
Ben Romer is working on a patch set to remove all the proc files for the 
Unisys drivers.  He is travelling right now but I think he will be 
submitting it in the next few days.  Is it ok to leave this for now and 
let his patches remove all proc entries at the same time?


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/2] Staging: unisys: Remove references to __DATE__ and __TIME__

2014-06-26 Thread Ken Cox
This series removes all references to __DATE__ and __TIME__ from the
unisys drivers and also removes BROKEN from the Kconfig so the drivers
can be built.


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/2] Staging: unisys: remove references to __DATE__ and __TIME__

2014-06-26 Thread Ken Cox
The use of __DATE__ and __TIME__ is no longer allowed in the kernel so this
commit removes those.  They were once useful when the drivers were being
built externally, but now that the drivers are in the kernel the use of the
macros is redundant since the kernel already has the same information
elsewhere.

In addition, using these macros breaks the build if using gcc 4.9.0

Reported-by: Greg Kroah-Hartman gre...@linuxfoundation.org
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/include/vbushelper.h |  8 +++-
 drivers/staging/unisys/uislib/uisutils.c| 11 ---
 drivers/staging/unisys/virthba/virthba.c|  5 -
 drivers/staging/unisys/virtpci/virtpci.c| 14 +++---
 drivers/staging/unisys/virtpci/virtpci.h|  2 --
 drivers/staging/unisys/visorchipset/visorchipset_main.c |  4 ++--
 6 files changed, 12 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/unisys/include/vbushelper.h 
b/drivers/staging/unisys/include/vbushelper.h
index 93e35f0..ed94375 100644
--- a/drivers/staging/unisys/include/vbushelper.h
+++ b/drivers/staging/unisys/include/vbushelper.h
@@ -28,8 +28,7 @@
 static inline void
 BusDeviceInfo_Init(ULTRA_VBUS_DEVICEINFO *pBusDeviceInfo,
   const char *deviceType, const char *driverName,
-  const char *ver, const char *verTag,
-  const char *buildDate, const char *buildTime)
+  const char *ver, const char *verTag)
 {
memset(pBusDeviceInfo, 0, sizeof(ULTRA_VBUS_DEVICEINFO));
snprintf(pBusDeviceInfo-devType, sizeof(pBusDeviceInfo-devType),
@@ -37,11 +36,10 @@ BusDeviceInfo_Init(ULTRA_VBUS_DEVICEINFO *pBusDeviceInfo,
snprintf(pBusDeviceInfo-drvName, sizeof(pBusDeviceInfo-drvName),
 %s, (driverName) ? driverName : unknownDriver);
snprintf(pBusDeviceInfo-infoStrings,
-sizeof(pBusDeviceInfo-infoStrings), %s\t%s\t%s %s\t%s,
+sizeof(pBusDeviceInfo-infoStrings), %s\t%s\t%s,
 (ver) ? ver : unknownVer,
 (verTag) ? verTag : unknownVerTag,
-(buildDate) ? buildDate : noBuildDate,
-(buildTime) ? buildTime : nobuildTime, TARGET_HOSTNAME);
+TARGET_HOSTNAME);
 }
 
 #endif
diff --git a/drivers/staging/unisys/uislib/uisutils.c 
b/drivers/staging/unisys/uislib/uisutils.c
index 0f1bb73..07e5535 100644
--- a/drivers/staging/unisys/uislib/uisutils.c
+++ b/drivers/staging/unisys/uislib/uisutils.c
@@ -96,9 +96,8 @@ uisctrl_register_req_handler(int type, void *fptr,
return 0;
}
if (chipset_DriverInfo)
-   BusDeviceInfo_Init(chipset_DriverInfo,
-  chipset, uislib,
-  VERSION, NULL, __DATE__, __TIME__);
+   BusDeviceInfo_Init(chipset_DriverInfo, chipset, uislib,
+  VERSION, NULL);
 
return 1;
 }
@@ -149,10 +148,8 @@ uisctrl_register_req_handler_ex(uuid_le switchTypeGuid,
 Away:
if (rc) {
if (chipset_DriverInfo)
-   BusDeviceInfo_Init(chipset_DriverInfo,
-  chipset, uislib,
-  VERSION, NULL,
-  __DATE__, __TIME__);
+   BusDeviceInfo_Init(chipset_DriverInfo, chipset,
+  uislib, VERSION, NULL);
} else
LOGERR(failed to register type %pUL.\n, switchTypeGuid);
 
diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index 5c5aa70..4d1347a 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -139,8 +139,6 @@ static struct virtpci_driver virthba_driver = {
.name = uisvirthba,
.version = VERSION,
.vertag = NULL,
-   .build_date = __DATE__,
-   .build_time = __TIME__,
.id_table = virthba_id_table,
.probe = virthba_probe,
.remove = virthba_remove,
@@ -1413,9 +1411,6 @@ info_proc_read(struct file *file, char __user *buf, 
size_t len, loff_t *offset)
length += sprintf(vbuf + length, \nvirthba result queue poll 
wait:%d usecs.\n,
  rsltq_wait_usecs);
 
-   length += sprintf(vbuf + length,
- \nModule build: Date:%s Time:%s\n,
- __DATE__, __TIME__);
length += sprintf(vbuf + length, \ninterrupts_rcvd = %llu, 
interrupts_disabled = %llu\n,
  virthbainfo-interrupts_rcvd,
  virthbainfo-interrupts_disabled);
diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 71246fe..5ab17e7 100644
--- a/drivers/staging/unisys

[PATCH v2 2/2] Staging: unisys Remove BROKEN from Kconfig to allow compilation

2014-06-26 Thread Ken Cox
The unisys drivers now properly check to make sure they are running
on the s-Par platform before they will initialize.  This was fixed in
commit fcd0157ece so it is safe to allow the unisys drivers to be built.

This has been tested in the same qemu environment that originally
produced the panic and the kernel now runs as expected.

Reported-by: Fengguang Wu fengguang...@intel.com
Reported-by: Sasha Levin sasha.le...@oracle.com
Tested-by: Ken Cox j...@redhat.com
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
index 6bae2af..ac080c9 100644
--- a/drivers/staging/unisys/Kconfig
+++ b/drivers/staging/unisys/Kconfig
@@ -3,7 +3,7 @@
 #
 menuconfig UNISYSSPAR
bool Unisys SPAR driver support
-   depends on X86_64  BROKEN
+   depends on X86_64
---help---
Support for the Unisys SPAR drivers
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/4] Staging: unisys: Remove references to __DATE__ and __TIME__

2014-06-25 Thread Ken Cox
This series removes all references to __DATE__ and __TIME__ from the
unisys drivers and also removes BROKEN from the Kconfig so the drivers
can be built.

PATCH 1: Gets rid of references to __DATE__ and __TIME__
PATCH 2: Removes buildDate and buildTime arguments from BusDeviceInfo_Init()
PATCH 3: Removes build_date and build_time from virtpci_driver structure
PATCH 4: Removes BROKEN from the Kconfig

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] Staging: unisys: remove buildDate and buildTime arguments from BusDeviceInfo_Init

2014-06-25 Thread Ken Cox
The unisys drivers no longer need to record the build date and time since the
same info is already in the kernel elsewhere.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/include/vbushelper.h | 8 +++-
 drivers/staging/unisys/uislib/uisutils.c| 7 +++
 drivers/staging/unisys/virtpci/virtpci.c| 5 ++---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/unisys/include/vbushelper.h 
b/drivers/staging/unisys/include/vbushelper.h
index 93e35f0..ed94375 100644
--- a/drivers/staging/unisys/include/vbushelper.h
+++ b/drivers/staging/unisys/include/vbushelper.h
@@ -28,8 +28,7 @@
 static inline void
 BusDeviceInfo_Init(ULTRA_VBUS_DEVICEINFO *pBusDeviceInfo,
   const char *deviceType, const char *driverName,
-  const char *ver, const char *verTag,
-  const char *buildDate, const char *buildTime)
+  const char *ver, const char *verTag)
 {
memset(pBusDeviceInfo, 0, sizeof(ULTRA_VBUS_DEVICEINFO));
snprintf(pBusDeviceInfo-devType, sizeof(pBusDeviceInfo-devType),
@@ -37,11 +36,10 @@ BusDeviceInfo_Init(ULTRA_VBUS_DEVICEINFO *pBusDeviceInfo,
snprintf(pBusDeviceInfo-drvName, sizeof(pBusDeviceInfo-drvName),
 %s, (driverName) ? driverName : unknownDriver);
snprintf(pBusDeviceInfo-infoStrings,
-sizeof(pBusDeviceInfo-infoStrings), %s\t%s\t%s %s\t%s,
+sizeof(pBusDeviceInfo-infoStrings), %s\t%s\t%s,
 (ver) ? ver : unknownVer,
 (verTag) ? verTag : unknownVerTag,
-(buildDate) ? buildDate : noBuildDate,
-(buildTime) ? buildTime : nobuildTime, TARGET_HOSTNAME);
+TARGET_HOSTNAME);
 }
 
 #endif
diff --git a/drivers/staging/unisys/uislib/uisutils.c 
b/drivers/staging/unisys/uislib/uisutils.c
index 6c58637..07e5535 100644
--- a/drivers/staging/unisys/uislib/uisutils.c
+++ b/drivers/staging/unisys/uislib/uisutils.c
@@ -97,7 +97,7 @@ uisctrl_register_req_handler(int type, void *fptr,
}
if (chipset_DriverInfo)
BusDeviceInfo_Init(chipset_DriverInfo, chipset, uislib,
-  VERSION, NULL, NULL, NULL);
+  VERSION, NULL);
 
return 1;
 }
@@ -148,9 +148,8 @@ uisctrl_register_req_handler_ex(uuid_le switchTypeGuid,
 Away:
if (rc) {
if (chipset_DriverInfo)
-   BusDeviceInfo_Init(chipset_DriverInfo,
-  chipset, uislib,
-  VERSION, NULL, NULL, NULL);
+   BusDeviceInfo_Init(chipset_DriverInfo, chipset,
+  uislib, VERSION, NULL);
} else
LOGERR(failed to register type %pUL.\n, switchTypeGuid);
 
diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 35df6cd..5ab17e7 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -794,8 +794,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, 
int devType,
BusDeviceInfo_Init(devInfo, stype,
   virtpcidrv-name,
   virtpcidrv-version,
-  virtpcidrv-vertag,
-  virtpcidrv-build_date, virtpcidrv-build_time);
+  virtpcidrv-vertag);
write_vbus_devInfo(pChan, devInfo, devNo);
 
/* Re-write bus+chipset info, because it is possible that this
@@ -1696,7 +1695,7 @@ static int __init virtpci_mod_init(void)
}
DBGINF(bus_register successful\n);
BusDeviceInfo_Init(Bus_DriverInfo, clientbus, virtpci,
-  VERSION, NULL, NULL, NULL);
+  VERSION, NULL);
 
/* create a root bus used to parent all the virtpci buses. */
ret = device_register(virtpci_rootbus_device);
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 689e7d1..f897128 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -569,7 +569,7 @@ 
visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
*responders = BusDev_Responders;
if (driverInfo)
BusDeviceInfo_Init(driverInfo, chipset, visorchipset,
-  VERSION, NULL, NULL, NULL);
+  VERSION, NULL);
 
UNLOCKSEM(NotifierLock);
 }
@@ -593,7 +593,7 @@ 
visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
*responders = BusDev_Responders;
if (driverInfo

[PATCH 3/4] Staging: unisys: Remove build_date and build_time from virtpci_driver structure

2014-06-25 Thread Ken Cox
The drivers do not need to keep track of these fields since the same
information is present elsewhere in the kernel.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/virthba/virthba.c | 2 --
 drivers/staging/unisys/virtpci/virtpci.h | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index e58f3b8..4d1347a 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -139,8 +139,6 @@ static struct virtpci_driver virthba_driver = {
.name = uisvirthba,
.version = VERSION,
.vertag = NULL,
-   .build_date = NULL,
-   .build_time = NULL,
.id_table = virthba_id_table,
.probe = virthba_probe,
.remove = virthba_remove,
diff --git a/drivers/staging/unisys/virtpci/virtpci.h 
b/drivers/staging/unisys/virtpci/virtpci.h
index f7be17b..7539fcb 100644
--- a/drivers/staging/unisys/virtpci/virtpci.h
+++ b/drivers/staging/unisys/virtpci/virtpci.h
@@ -77,8 +77,6 @@ struct virtpci_driver {
const char *name;   /* the name of the driver in sysfs */
const char *version;
const char *vertag;
-   const char *build_date;
-   const char *build_time;
const struct pci_device_id *id_table;   /* must be non-NULL for probe
 * to be called */
int (*probe)(struct virtpci_dev *dev,
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] Staging: unisys Remove BROKEN from Kconfig to allow compilation

2014-06-25 Thread Ken Cox
The unisys drivers now properly check to make sure they are running
on the s-Par platform before they will initialize.  This was fixed in
commit fcd0157ece so it is safe to allow the unisys drivers to be built.

This has been tested in the same qemu environment that originally
produced the panic and the kernel now runs as expected.

Reported-by: Fengguang Wu fengguang...@intel.com
Reported-by: Sasha Levin sasha.le...@oracle.com
Tested-by: Benjamin Romer benjamin.ro...@unisys.com
Tested-by: Ken Cox j...@redhat.com
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
index 6bae2af..ac080c9 100644
--- a/drivers/staging/unisys/Kconfig
+++ b/drivers/staging/unisys/Kconfig
@@ -3,7 +3,7 @@
 #
 menuconfig UNISYSSPAR
bool Unisys SPAR driver support
-   depends on X86_64  BROKEN
+   depends on X86_64
---help---
Support for the Unisys SPAR drivers
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Patch v3 2/4] Staging: unisys: Fix sparse warnings in uislib

2014-06-25 Thread Ken Cox


On 06/17/2014 06:01 PM, Greg KH wrote:

On Thu, Jun 05, 2014 at 01:56:16PM -0500, Ken Cox wrote:

Added I/O version for the function ultra_vbus_init_channel() to get rid
of noderef sparse warnings when accessing I/O space.

Signed-off-by: Ken Cox j...@redhat.com
---
  .../common-spar/include/channels/vbuschannel.h | 40 --
  drivers/staging/unisys/uislib/uislib.c |  2 +-
  2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 000182c..af5a1ff 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -95,12 +95,46 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
  #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
  
  static inline void

-ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
-   int bytesAllocated)
+ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL *x,
+   int bytes)
  {
/* Please note that the memory at x does NOT necessarily have space
* for DevInfo structs allocated at the end, which is why we do NOT use
-   * bytesAllocated to clear. */
+   * bytes to clear. */
+   memset(x, 0, sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL));
+   if (bytes  (int) sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL))
+   return;
+
+   x-ChannelHeader.VersionId = ULTRA_VBUS_CHANNEL_PROTOCOL_VERSIONID;
+   x-ChannelHeader.Signature = ULTRA_VBUS_CHANNEL_PROTOCOL_SIGNATURE;
+   x-ChannelHeader.SrvState = CHANNELSRV_READY;
+   x-ChannelHeader.HeaderSize = sizeof(x-ChannelHeader);
+   x-ChannelHeader.Size = bytes;
+   memcpy(x-ChannelHeader.Type, UltraVbusChannelProtocolGuid,
+   sizeof(x-ChannelHeader.Type));
+   memcpy(x-ChannelHeader.ZoneGuid, NULL_UUID_LE, sizeof(uuid_le));
+   x-HdrInfo.structBytes = sizeof(ULTRA_VBUS_HEADERINFO);
+   x-HdrInfo.chpInfoByteOffset = sizeof(ULTRA_VBUS_HEADERINFO);
+   x-HdrInfo.busInfoByteOffset += sizeof(ULTRA_VBUS_DEVICEINFO);
+   x-HdrInfo.devInfoByteOffset += sizeof(ULTRA_VBUS_DEVICEINFO);
+   x-HdrInfo.deviceInfoStructBytes = sizeof(ULTRA_VBUS_DEVICEINFO);
+   bytes -= (sizeof(ULTRA_CHANNEL_PROTOCOL) +
+ x-HdrInfo.devInfoByteOffset);
+   x-HdrInfo.devInfoCount = bytes / x-HdrInfo.deviceInfoStructBytes;
+}

That's a _huge_ inline function, why is it inline?  Shouldn't it just be
a real function instead?

And given that you are duplicating most of the logic in
ULTRA_VBUS_init_channel(), isn't there some other way to share the logic
here?  Hm, no, I see why you did this, that's crazy.  The same logic to
write to a structure or a iomemory-based structure?  Something feels
really wrong here with what you are doing.  It's as if you init the
channel, then write it all out to memory, right?

No, wait, no one calls this function ever now.  Why is it even needed?
Originally, this function was here in preparation for an additional 
driver that has not been submitted.  After thinking about your comments 
and reviewing the code, I can make some changes to the calling functions 
and remove both versions of the function completely.


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/2] Staging: unisys: use Linux coding convention for function names

2014-06-05 Thread Ken Cox
Changed function declarations for VBUSCHANNEL_devInfoToStringBuffer()
and ULTRA_VBUS_init_channel() to conform to Linux kernel coding convention.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/common-spar/include/channels/vbuschannel.h | 4 ++--
 drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h   | 2 +-
 drivers/staging/unisys/uislib/uislib.c| 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 0dd3e2d..000182c 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -94,8 +94,8 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
sizeof(ULTRA_VBUS_DEVICEINFO)))
 #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
 
-static INLINE void
-ULTRA_VBUS_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
+static inline void
+ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
int bytesAllocated)
 {
/* Please note that the memory at x does NOT necessarily have space
diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index 8c0259a..abf01f6 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -146,7 +146,7 @@ VBUSCHANNEL_itoa(char *p, int remain, int num)
  * Returns the number of bytes written to p.
  */
 static inline int
-VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
+vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
  char *p, int remain, int devix)
 {
char __iomem *psrc;
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index d4a7ef8..70cc00f 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -148,7 +148,7 @@ init_vbus_channel(U64 channelAddr, U32 channelBytes, int 
isServer)
rc = NULL;
goto Away;
}
-   ULTRA_VBUS_init_channel(pChan, channelBytes);
+   ultra_vbus_init_channel(pChan, channelBytes);
} else {
if (!ULTRA_VBUS_CHANNEL_OK_CLIENT(pChan, NULL)) {
ERRDRV(%s channel cannot be used, __func__);
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/2] Staging: unisys: Fix sparse warnings in uislib

2014-06-05 Thread Ken Cox
Added I/O versions for the functions vbuschannel_devinfo_to_string()
and ultra_vbus_init_channel() to get rid of noderef sparse warnings when
accessing I/O space.

Signed-off-by: Ken Cox j...@redhat.com
---
 .../staging/unisys/common-spar/include/channels/vbuschannel.h | 11 ++-
 drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h   | 11 ++-
 drivers/staging/unisys/uislib/uislib.c|  2 +-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 000182c..fc997bc 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -95,7 +95,7 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
 #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
 
 static inline void
-ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
+ultra_vbus_init_channel_io(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
int bytesAllocated)
 {
/* Please note that the memory at x does NOT necessarily have space
@@ -130,6 +130,15 @@ ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL 
__iomem *x,
   x-HdrInfo.devInfoCount);
 }
 
+static inline void
+ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL *x,
+   int bytes_allocated)
+{
+   ultra_vbus_init_channel_io(
+   (__force ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *)x,
+   bytes_allocated);
+}
+
 #pragma pack(pop)
 
 #endif
diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index abf01f6..c18efe5 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -146,7 +146,7 @@ VBUSCHANNEL_itoa(char *p, int remain, int num)
  * Returns the number of bytes written to p.
  */
 static inline int
-vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
+vbuschannel_devinfo_to_string_io(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
  char *p, int remain, int devix)
 {
char __iomem *psrc;
@@ -206,4 +206,13 @@ vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO 
__iomem *devInfo,
return chars;
 }
 
+static inline int
+vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO *devinfo,
+ char *p, int remain, int devix)
+{
+   return vbuschannel_devinfo_to_string_io(
+   (ULTRA_VBUS_DEVICEINFO __force __iomem *)devinfo,
+   p, remain, devix);
+}
+
 #endif
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 70cc00f..4d7c7f8 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -148,7 +148,7 @@ init_vbus_channel(U64 channelAddr, U32 channelBytes, int 
isServer)
rc = NULL;
goto Away;
}
-   ultra_vbus_init_channel(pChan, channelBytes);
+   ultra_vbus_init_channel_io(pChan, channelBytes);
} else {
if (!ULTRA_VBUS_CHANNEL_OK_CLIENT(pChan, NULL)) {
ERRDRV(%s channel cannot be used, __func__);
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/2] Staging: unisys: uislib: address sparse noderef warnings

2014-06-05 Thread Ken Cox

This series gets rid of some sparse noderef warnings by adding I/O versions
of the functions that are producing the warnings.  

In the first patch, we clean up the function names so they are acceptable 
then we add the new functions in the second patch.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 2/2] Staging: unisys: Fix sparse warnings in uislib

2014-06-05 Thread Ken Cox


On 06/05/2014 11:22 AM, Greg KH wrote:

On Thu, Jun 05, 2014 at 11:04:32AM -0500, Ken Cox wrote:

Added I/O versions for the functions vbuschannel_devinfo_to_string()
and ultra_vbus_init_channel() to get rid of noderef sparse warnings when
accessing I/O space.

Signed-off-by: Ken Cox j...@redhat.com
---
  .../staging/unisys/common-spar/include/channels/vbuschannel.h | 11 ++-
  drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h   | 11 ++-
  drivers/staging/unisys/uislib/uislib.c|  2 +-
  3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 000182c..fc997bc 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -95,7 +95,7 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
  #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
  
  static inline void

-ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
+ultra_vbus_init_channel_io(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
int bytesAllocated)
  {
/* Please note that the memory at x does NOT necessarily have space
@@ -130,6 +130,15 @@ ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL 
__iomem *x,
   x-HdrInfo.devInfoCount);
  }
  
+static inline void

+ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL *x,
+   int bytes_allocated)
+{
+   ultra_vbus_init_channel_io(
+   (__force ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *)x,

Why do you need to __force anything here?  Why not fix it up in the
callers by marking those variables properly?
I was using memcpy_toio(), etc. as an example, but can see that it would 
be more portable to take care of it in the calling function, even though 
this is x86_64 only.  I will rework the patch.


Thanks,
Ken
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Patch v3 3/4] Staging: unisys: make function names Linux compliant

2014-06-05 Thread Ken Cox
Changed function declarations in 
drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h so that the 
function names follow Linux coding standards.

Signed-off-by: Ken Cox j...@redhat.com
---
 .../unisys/common-spar/include/vbusdeviceinfo.h| 28 +++---
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index abf01f6..7164868 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -50,7 +50,7 @@ typedef struct _ULTRA_VBUS_DEVICEINFO {
  * to a buffer at p, had it been infinitely big.
  */
 static inline int
-VBUSCHANNEL_sanitize_buffer(char *p, int remain, char __iomem *src, int srcmax)
+vbuschannel_sanitize_buffer(char *p, int remain, char __iomem *src, int srcmax)
 {
int chars = 0;
int nonprintable_streak = 0;
@@ -99,7 +99,7 @@ VBUSCHANNEL_sanitize_buffer(char *p, int remain, char __iomem 
*src, int srcmax)
  * an environment-independent way (since we are in a common header file).
  */
 static inline int
-VBUSCHANNEL_itoa(char *p, int remain, int num)
+vbuschannel_itoa(char *p, int remain, int num)
 {
int digits = 0;
char s[32];
@@ -146,22 +146,22 @@ VBUSCHANNEL_itoa(char *p, int remain, int num)
  * Returns the number of bytes written to p.
  */
 static inline int
-vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
+vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem *devinfo,
  char *p, int remain, int devix)
 {
char __iomem *psrc;
int nsrc, x, i, pad;
int chars = 0;
 
-   psrc = (devInfo-devType[0]);
-   nsrc = sizeof(devInfo-devType);
-   if (VBUSCHANNEL_sanitize_buffer(NULL, 0, psrc, nsrc) = 0)
+   psrc = (devinfo-devType[0]);
+   nsrc = sizeof(devinfo-devType);
+   if (vbuschannel_sanitize_buffer(NULL, 0, psrc, nsrc) = 0)
return 0;
 
/* emit device index */
if (devix = 0) {
VBUSCHANNEL_ADDACHAR('[', p, remain, chars);
-   x = VBUSCHANNEL_itoa(p, remain, devix);
+   x = vbuschannel_itoa(p, remain, devix);
p += x;
remain -= x;
chars += x;
@@ -173,7 +173,7 @@ vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem 
*devInfo,
}
 
/* emit device type */
-   x = VBUSCHANNEL_sanitize_buffer(p, remain, psrc, nsrc);
+   x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc);
p += x;
remain -= x;
chars += x;
@@ -183,9 +183,9 @@ vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem 
*devInfo,
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
 
/* emit driver name */
-   psrc = (devInfo-drvName[0]);
-   nsrc = sizeof(devInfo-drvName);
-   x = VBUSCHANNEL_sanitize_buffer(p, remain, psrc, nsrc);
+   psrc = (devinfo-drvName[0]);
+   nsrc = sizeof(devinfo-drvName);
+   x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc);
p += x;
remain -= x;
chars += x;
@@ -195,9 +195,9 @@ vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem 
*devInfo,
VBUSCHANNEL_ADDACHAR(' ', p, remain, chars);
 
/* emit strings */
-   psrc = (devInfo-infoStrings[0]);
-   nsrc = sizeof(devInfo-infoStrings);
-   x = VBUSCHANNEL_sanitize_buffer(p, remain, psrc, nsrc);
+   psrc = (devinfo-infoStrings[0]);
+   nsrc = sizeof(devinfo-infoStrings);
+   x = vbuschannel_sanitize_buffer(p, remain, psrc, nsrc);
p += x;
remain -= x;
chars += x;
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Patch v3 2/4] Staging: unisys: Fix sparse warnings in uislib

2014-06-05 Thread Ken Cox
Added I/O version for the function ultra_vbus_init_channel() to get rid
of noderef sparse warnings when accessing I/O space.

Signed-off-by: Ken Cox j...@redhat.com
---
 .../common-spar/include/channels/vbuschannel.h | 40 --
 drivers/staging/unisys/uislib/uislib.c |  2 +-
 2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 000182c..af5a1ff 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -95,12 +95,46 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
 #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
 
 static inline void
-ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
-   int bytesAllocated)
+ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL *x,
+   int bytes)
 {
/* Please note that the memory at x does NOT necessarily have space
* for DevInfo structs allocated at the end, which is why we do NOT use
-   * bytesAllocated to clear. */
+   * bytes to clear. */
+   memset(x, 0, sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL));
+   if (bytes  (int) sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL))
+   return;
+
+   x-ChannelHeader.VersionId = ULTRA_VBUS_CHANNEL_PROTOCOL_VERSIONID;
+   x-ChannelHeader.Signature = ULTRA_VBUS_CHANNEL_PROTOCOL_SIGNATURE;
+   x-ChannelHeader.SrvState = CHANNELSRV_READY;
+   x-ChannelHeader.HeaderSize = sizeof(x-ChannelHeader);
+   x-ChannelHeader.Size = bytes;
+   memcpy(x-ChannelHeader.Type, UltraVbusChannelProtocolGuid,
+   sizeof(x-ChannelHeader.Type));
+   memcpy(x-ChannelHeader.ZoneGuid, NULL_UUID_LE, sizeof(uuid_le));
+   x-HdrInfo.structBytes = sizeof(ULTRA_VBUS_HEADERINFO);
+   x-HdrInfo.chpInfoByteOffset = sizeof(ULTRA_VBUS_HEADERINFO);
+   x-HdrInfo.busInfoByteOffset += sizeof(ULTRA_VBUS_DEVICEINFO);
+   x-HdrInfo.devInfoByteOffset += sizeof(ULTRA_VBUS_DEVICEINFO);
+   x-HdrInfo.deviceInfoStructBytes = sizeof(ULTRA_VBUS_DEVICEINFO);
+   bytes -= (sizeof(ULTRA_CHANNEL_PROTOCOL) +
+ x-HdrInfo.devInfoByteOffset);
+   x-HdrInfo.devInfoCount = bytes / x-HdrInfo.deviceInfoStructBytes;
+}
+
+static inline void
+ultra_vbus_init_channel_io(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
+   int bytesAllocated)
+{
+   /*
+* This is the same as ultra_vbus_init_channel() above, except
+* that it operates on I/O space.
+*
+* Please note that the memory at x does NOT necessarily have space
+* for DevInfo structs allocated at the end, which is why we do NOT use
+* bytesAllocated to clear.
+*/
memset_io(x, 0, sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL));
if (bytesAllocated  (int) sizeof(ULTRA_VBUS_CHANNEL_PROTOCOL))
return;
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 70cc00f..4d7c7f8 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -148,7 +148,7 @@ init_vbus_channel(U64 channelAddr, U32 channelBytes, int 
isServer)
rc = NULL;
goto Away;
}
-   ultra_vbus_init_channel(pChan, channelBytes);
+   ultra_vbus_init_channel_io(pChan, channelBytes);
} else {
if (!ULTRA_VBUS_CHANNEL_OK_CLIENT(pChan, NULL)) {
ERRDRV(%s channel cannot be used, __func__);
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Patch v3 1/4] Staging: unisys: use Linux coding convention for function names

2014-06-05 Thread Ken Cox
Changed function declarations for VBUSCHANNEL_devInfoToStringBuffer()
and ULTRA_VBUS_init_channel() to conform to Linux kernel coding convention.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/common-spar/include/channels/vbuschannel.h | 4 ++--
 drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h   | 2 +-
 drivers/staging/unisys/uislib/uislib.c| 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 0dd3e2d..000182c 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -94,8 +94,8 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
sizeof(ULTRA_VBUS_DEVICEINFO)))
 #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
 
-static INLINE void
-ULTRA_VBUS_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
+static inline void
+ultra_vbus_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
int bytesAllocated)
 {
/* Please note that the memory at x does NOT necessarily have space
diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index 8c0259a..abf01f6 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -146,7 +146,7 @@ VBUSCHANNEL_itoa(char *p, int remain, int num)
  * Returns the number of bytes written to p.
  */
 static inline int
-VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
+vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
  char *p, int remain, int devix)
 {
char __iomem *psrc;
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index d4a7ef8..70cc00f 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -148,7 +148,7 @@ init_vbus_channel(U64 channelAddr, U32 channelBytes, int 
isServer)
rc = NULL;
goto Away;
}
-   ULTRA_VBUS_init_channel(pChan, channelBytes);
+   ultra_vbus_init_channel(pChan, channelBytes);
} else {
if (!ULTRA_VBUS_CHANNEL_OK_CLIENT(pChan, NULL)) {
ERRDRV(%s channel cannot be used, __func__);
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 0/2] Staging: unisys: uislib: address sparse noderef warnings

2014-06-05 Thread Ken Cox

This series gets rid of some sparse noderef warnings by adding I/O versions
of the functions that are producing the warnings and also removing __iomem
declarations where they are not needed.  

While we are at it, we fix up the function names of the functions that we are
modifying so that they comply with Linux coding standards.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Patch v3 4/4] Staging: unisys: Fix noderef sparse warnings in vbusdeviceinfo.h

2014-06-05 Thread Ken Cox
vbuschannel_devinfo_to_string() was declared with the devinfo argument
as a pointer to __iomem space.  No callers of this function need the
__iomem space, so I removed that constraint.

Same thing goes for vbuschannel_sanitize_buffer().  It doesn't need to
operate on I/O space.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index 7164868..45e311c 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -50,12 +50,12 @@ typedef struct _ULTRA_VBUS_DEVICEINFO {
  * to a buffer at p, had it been infinitely big.
  */
 static inline int
-vbuschannel_sanitize_buffer(char *p, int remain, char __iomem *src, int srcmax)
+vbuschannel_sanitize_buffer(char *p, int remain, char *src, int srcmax)
 {
int chars = 0;
int nonprintable_streak = 0;
while (srcmax  0) {
-   if ((readb(src) = ' ')  (readb(src)  0x7f)) {
+   if ((*src = ' ')  (*src  0x7f)) {
if (nonprintable_streak) {
if (remain  0) {
*p = ' ';
@@ -67,7 +67,7 @@ vbuschannel_sanitize_buffer(char *p, int remain, char __iomem 
*src, int srcmax)
nonprintable_streak = 0;
}
if (remain  0) {
-   *p = readb(src);
+   *p = *src;
p++;
remain--;
chars++;
@@ -146,10 +146,10 @@ vbuschannel_itoa(char *p, int remain, int num)
  * Returns the number of bytes written to p.
  */
 static inline int
-vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO __iomem *devinfo,
+vbuschannel_devinfo_to_string(ULTRA_VBUS_DEVICEINFO *devinfo,
  char *p, int remain, int devix)
 {
-   char __iomem *psrc;
+   char *psrc;
int nsrc, x, i, pad;
int chars = 0;
 
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: unisys Remove BROKEN from Kconfig to allow compilation

2014-06-03 Thread Ken Cox
The unisys drivers now properly check to make sure they are running
on the s-Par platform before they will initialize.  This was fixed in
commit fcd0157ece so it is safe to allow the unisys drivers to be built.

This has been tested in the same qemu environment that originally
produced the panic and the kernel now runs as expected.

Reported-by: Fengguang Wu fengguang...@intel.com
Reported-by: Sasha Levin sasha.le...@oracle.com
Tested-by: Benjamin Romer benjamin.ro...@unisys.com
Tested-by: Ken Cox j...@redhat.com
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
index 6bae2af..ac080c9 100644
--- a/drivers/staging/unisys/Kconfig
+++ b/drivers/staging/unisys/Kconfig
@@ -3,7 +3,7 @@
 #
 menuconfig UNISYSSPAR
bool Unisys SPAR driver support
-   depends on X86_64  BROKEN
+   depends on X86_64
---help---
Support for the Unisys SPAR drivers
 
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/6] Staging: unisys: code cleanup patches

2014-05-28 Thread Ken Cox


On 05/28/2014 09:17 AM, Greg KH wrote:

On Wed, May 28, 2014 at 06:01:17AM -0500, Ken Cox wrote:

On 05/23/2014 06:18 AM, Greg KH wrote:

On Thu, May 22, 2014 at 12:31:08PM -0500, Ken Cox wrote:

This series of patches cleans up the unisys driver code in various ways:
  -fix sparse warnings related to accessing I/O space
  -fix sparse warnings related to dereferencing noderef types
  -add static to function declration
  -remove unused functions and macros

How are you testing any of these given that the driver is still marked
BROKEN?

I'll send a patch to remove BROKEN from the Kconfig

Are you sure that it is ok now?  Are the issues that required that to be
added now resolved?  And why did I have to ask for this?  You didn't
answer my original question here...
I tested these with a patch that has not been submitted which removes 
BROKEN from the Kconfig.


The original problem reported by Fengguang Wu was that the kernel 
panicked when running on a virtual machine because the platform 
detection logic was not sufficient to determine that the proper hardware 
was not present.  That was fixed in commit fcd0157 Staging: unisys: 
detect s-Par firmware.  I was not able to reproduce the panic after 
this commit.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] Staging: unisys: Fix sparse warnings

2014-05-22 Thread Ken Cox
Fix sparse warnings caused by incorrect references to IO space.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/uislib/uislib.c   | 2 +-
 drivers/staging/unisys/visorchannel/visorchannel.h   | 6 +++---
 drivers/staging/unisys/visorchannel/visorchannel_funcs.c | 4 ++--
 drivers/staging/unisys/visorutil/memregion.h | 2 +-
 drivers/staging/unisys/visorutil/memregion_direct.c  | 6 +++---
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 166a518..e3903ee 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -131,7 +131,7 @@ init_msg_header(CONTROLVM_MESSAGE *msg, U32 id, uint rsp, 
uint svr)
 static __iomem void *
 init_vbus_channel(U64 channelAddr, U32 channelBytes, int isServer)
 {
-   void *rc = NULL;
+   void __iomem *rc = NULL;
void __iomem *pChan = uislib_ioremap_cache(channelAddr, channelBytes);
if (!pChan) {
LOGERR(CONTROLVM_BUS_CREATE error: ioremap_cache of 
channelAddr:%Lx for channelBytes:%llu failed,
diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h 
b/drivers/staging/unisys/visorchannel/visorchannel.h
index a00dfb5..784f03a 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel.h
+++ b/drivers/staging/unisys/visorchannel/visorchannel.h
@@ -73,11 +73,11 @@ void visorchannel_debug(VISORCHANNEL *channel, int nQueues,
struct seq_file *seq, U32 off);
 void visorchannel_dump_section(VISORCHANNEL *chan, char *s,
   int off, int len, struct seq_file *seq);
-void *visorchannel_get_header(VISORCHANNEL *channel);
+void __iomem *visorchannel_get_header(VISORCHANNEL *channel);
 
 #defineVISORCHANNEL_CHANGE_SERVER_STATE(chan, chanId, newstate)
\
do {\
-   U8 *p = (U8 *)visorchannel_get_header(chan);\
+   U8 *p = (U8 __iomem *)visorchannel_get_header(chan);\
if (p) {\
ULTRA_CHANNEL_SERVER_TRANSITION(p, chanId, SrvState, \
newstate, logCtx); \
@@ -92,7 +92,7 @@ void *visorchannel_get_header(VISORCHANNEL *channel);
 
 #defineVISORCHANNEL_CHANGE_CLIENT_STATE(chan, chanId, newstate)
\
do {\
-   U8 *p = (U8 *)visorchannel_get_header(chan);\
+   U8 *p = (U8 __iomem *)visorchannel_get_header(chan);\
if (p) {\
ULTRA_CHANNEL_CLIENT_TRANSITION(p, chanId,  \
newstate, logCtx); \
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c 
b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index bc4fc67..a44da7c 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -279,10 +279,10 @@ Away:
 }
 EXPORT_SYMBOL_GPL(visorchannel_clear);
 
-void *
+void __iomem  *
 visorchannel_get_header(VISORCHANNEL *channel)
 {
-   return (void *) (channel-chan_hdr);
+   return (void __iomem *) (channel-chan_hdr);
 }
 EXPORT_SYMBOL_GPL(visorchannel_get_header);
 
diff --git a/drivers/staging/unisys/visorutil/memregion.h 
b/drivers/staging/unisys/visorutil/memregion.h
index 7966316..f4a65d2 100644
--- a/drivers/staging/unisys/visorutil/memregion.h
+++ b/drivers/staging/unisys/visorutil/memregion.h
@@ -38,6 +38,6 @@ HOSTADDRESS visor_memregion_get_physaddr(MEMREGION 
*memregion);
 ulong visor_memregion_get_nbytes(MEMREGION *memregion);
 void memregion_dump(MEMREGION *memregion, char *s,
ulong off, ulong len, struct seq_file *seq);
-void *visor_memregion_get_pointer(MEMREGION *memregion);
+void __iomem *visor_memregion_get_pointer(MEMREGION *memregion);
 
 #endif
diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c 
b/drivers/staging/unisys/visorutil/memregion_direct.c
index d39fde9..28dfba0 100644
--- a/drivers/staging/unisys/visorutil/memregion_direct.c
+++ b/drivers/staging/unisys/visorutil/memregion_direct.c
@@ -29,7 +29,7 @@
 struct MEMREGION_Tag {
HOSTADDRESS physaddr;
ulong nbytes;
-   void *mapped;
+   void __iomem *mapped;
BOOL requested;
BOOL overlapped;
 };
@@ -93,7 +93,7 @@ visor_memregion_create_overlapped(MEMREGION *parent, ulong 
offset, ulong nbytes)
 
memregion-physaddr = parent-physaddr + offset;
memregion-nbytes = nbytes;
-   memregion-mapped = ((u8 *) (parent-mapped)) + offset;
+   memregion-mapped = ((u8 __iomem *) (parent-mapped)) + offset;
memregion-requested = FALSE

[PATCH 0/6] Staging: unisys: code cleanup patches

2014-05-22 Thread Ken Cox
This series of patches cleans up the unisys driver code in various ways:
-fix sparse warnings related to accessing I/O space
-fix sparse warnings related to dereferencing noderef types
-add static to function declration 
-remove unused functions and macros

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/6] Staging: unisys: virthba: declare virthba_queue_command as static

2014-05-22 Thread Ken Cox
virthba_queue_command() is only used inside virthba.c so declare it static.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/virthba/virthba.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index d528388..5c5aa70 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -91,7 +91,7 @@ static const struct x86_cpu_id unisys_spar_ids[] = {
 MODULE_DEVICE_TABLE(x86cpu, unisys_spar_ids);
 
 #ifdef DEF_SCSI_QCMD
-DEF_SCSI_QCMD(virthba_queue_command)
+static DEF_SCSI_QCMD(virthba_queue_command)
 #else
 #define virthba_queue_command virthba_queue_command_lck
 #endif
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/6] Staging: unisys: Fix sparse warnings in uislib

2014-05-22 Thread Ken Cox
Added ULTRA_VBUS_IOinit_channel() and modified ULTRA_VBUS_init_channel()
function so that it can operate on both memory space and IO space
without getting sparse warnings.

Signed-off-by: Ken Cox j...@redhat.com
---
 .../unisys/common-spar/include/channels/vbuschannel.h| 12 ++--
 drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h  | 11 ++-
 drivers/staging/unisys/uislib/uislib.c   |  2 +-
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 0dd3e2d..a624e9e 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -94,8 +94,8 @@ typedef struct _ULTRA_VBUS_CHANNEL_PROTOCOL {
sizeof(ULTRA_VBUS_DEVICEINFO)))
 #define VBUS_CH_SIZE(MAXDEVICES) COVER(VBUS_CH_SIZE_EXACT(MAXDEVICES), 4096)
 
-static INLINE void
-ULTRA_VBUS_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
+static inline void
+ULTRA_VBUS_IOinit_channel(ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *x,
int bytesAllocated)
 {
/* Please note that the memory at x does NOT necessarily have space
@@ -130,6 +130,14 @@ ULTRA_VBUS_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL 
__iomem *x,
   x-HdrInfo.devInfoCount);
 }
 
+static inline void
+ULTRA_VBUS_init_channel(ULTRA_VBUS_CHANNEL_PROTOCOL *x, int bytesAllocated)
+{
+   ULTRA_VBUS_IOinit_channel(
+   (__force ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *)x,
+   bytesAllocated);
+}
+
 #pragma pack(pop)
 
 #endif
diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index 8c0259a..4ae6960 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -146,7 +146,7 @@ VBUSCHANNEL_itoa(char *p, int remain, int num)
  * Returns the number of bytes written to p.
  */
 static inline int
-VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
+VBUSCHANNEL_IOdevInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO __iomem *devInfo,
  char *p, int remain, int devix)
 {
char __iomem *psrc;
@@ -206,4 +206,13 @@ VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO 
__iomem *devInfo,
return chars;
 }
 
+static inline int
+VBUSCHANNEL_devInfoToStringBuffer(ULTRA_VBUS_DEVICEINFO *devInfo,
+ char *p, int remain, int devix)
+{
+   return VBUSCHANNEL_IOdevInfoToStringBuffer(
+   (ULTRA_VBUS_DEVICEINFO __force __iomem *)devInfo,
+   p, remain, devix);
+}
+
 #endif
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index e3903ee..4ad0880 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -148,7 +148,7 @@ init_vbus_channel(U64 channelAddr, U32 channelBytes, int 
isServer)
rc = NULL;
goto Away;
}
-   ULTRA_VBUS_init_channel(pChan, channelBytes);
+   ULTRA_VBUS_IOinit_channel(pChan, channelBytes);
} else {
if (!ULTRA_VBUS_CHANNEL_OK_CLIENT(pChan, NULL)) {
ERRDRV(%s channel cannot be used, __func__);
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/6] Staging: unisys: Fixup sparse warnings for dereferencing noderef types.

2014-05-22 Thread Ken Cox
Fixed the usage of the following so they don't try to dereference
pointers to iomem.
CHANNEL_U64_MISMATCH
CHANNEL_U32_MISMATCH
wait_for_valid_guid

Signed-off-by: Ken Cox j...@redhat.com
---
 .../unisys/common-spar/include/channels/channel.h  | 16 ---
 drivers/staging/unisys/include/uisutils.h  | 23 ++
 drivers/staging/unisys/uislib/uislib.c |  4 ++--
 3 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index 237a852..d19711d 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -333,8 +333,9 @@ ULTRA_check_channel_client(void __iomem *pChannel,
   (pChannel))-Size)  expectedMinBytes) {
CHANNEL_U64_MISMATCH(expectedTypeGuid, channelName,
 size, expectedMinBytes,
-((CHANNEL_HEADER __iomem *)
- (pChannel))-Size, fileName,
+readq(((CHANNEL_HEADER __iomem *)
+(pChannel))-Size),
+fileName,
 lineNumber, logCtx);
return 0;
}
@@ -344,9 +345,9 @@ ULTRA_check_channel_client(void __iomem *pChannel,
!= expectedVersionId) {
CHANNEL_U32_MISMATCH(expectedTypeGuid, channelName,
 version, expectedVersionId,
-((CHANNEL_HEADER __iomem *)
- (pChannel))-VersionId, fileName,
-lineNumber, logCtx);
+readl(((CHANNEL_HEADER __iomem *)
+(pChannel))-VersionId),
+fileName, lineNumber, logCtx);
return 0;
}
if (expectedSignature  0)  /* caller wants us to verify
@@ -355,8 +356,9 @@ ULTRA_check_channel_client(void __iomem *pChannel,
!= expectedSignature) {
CHANNEL_U64_MISMATCH(expectedTypeGuid, channelName,
 signature, expectedSignature,
-((CHANNEL_HEADER __iomem *)
- (pChannel))-Signature, fileName,
+readq(((CHANNEL_HEADER __iomem *)
+(pChannel))-Signature),
+fileName,
 lineNumber, logCtx);
return 0;
}
diff --git a/drivers/staging/unisys/include/uisutils.h 
b/drivers/staging/unisys/include/uisutils.h
index f4845f2..70776c9 100644
--- a/drivers/staging/unisys/include/uisutils.h
+++ b/drivers/staging/unisys/include/uisutils.h
@@ -194,14 +194,21 @@ struct chaninfo {
  * correctly at DEVICE_CREATE time, INSTEAD OF waiting until
  * DEVICE_CONFIGURE time.
  */
-#define WAIT_FOR_VALID_GUID(guid) \
-   do {   \
-   while (uuid_le_cmp(guid, NULL_UUID_LE) == 0) {  \
-   LOGERR(Waiting for non-0 GUID (why???)...\n); \
-   UIS_THREAD_WAIT_SEC(5); \
-   }   \
-   LOGERR(OK... GUID is non-0 now\n);\
-   } while (0)
+static inline void
+wait_for_valid_guid(uuid_le __iomem *guid)
+{
+   uuid_le tmpguid;
+
+   while (1) {
+   memcpy_fromio((void *)tmpguid,
+ (void __iomem *)guid, sizeof(uuid_le));
+   if (uuid_le_cmp(tmpguid, NULL_UUID_LE) != 0)
+   break;
+   LOGERR(Waiting for non-0 GUID (why???)...\n);
+   UIS_THREAD_WAIT_SEC(5);
+   }
+   LOGERR(OK... GUID is non-0 now\n);
+}
 
 /* CopyFragsInfoFromSkb returns the number of entries added to frags array
  * Returns -1 on failure.
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 4ad0880..2afe441 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -447,7 +447,7 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
struct guest_msgs cmd;
if (!uuid_le_cmp(dev-channelTypeGuid

[PATCH 6/6] Staging: unisys: visorchipset: Remove filexfer.c

2014-05-22 Thread Ken Cox
There is not any code using the functionality in filexfer.c so I removed it
and filexfer.h.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/visorchipset/Makefile   |   2 +-
 drivers/staging/unisys/visorchipset/filexfer.c | 506 -
 drivers/staging/unisys/visorchipset/filexfer.h | 147 --
 .../unisys/visorchipset/visorchipset_main.c|   8 -
 4 files changed, 1 insertion(+), 662 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorchipset/filexfer.c
 delete mode 100644 drivers/staging/unisys/visorchipset/filexfer.h

diff --git a/drivers/staging/unisys/visorchipset/Makefile 
b/drivers/staging/unisys/visorchipset/Makefile
index f5e8650..ead4b9c 100644
--- a/drivers/staging/unisys/visorchipset/Makefile
+++ b/drivers/staging/unisys/visorchipset/Makefile
@@ -4,7 +4,7 @@
 
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset.o
 
-visorchipset-y := visorchipset_main.o controlvm_direct.o file.o filexfer.o \
+visorchipset-y := visorchipset_main.o controlvm_direct.o file.o \
parser.o
 
 ccflags-y += -Idrivers/staging/unisys/include
diff --git a/drivers/staging/unisys/visorchipset/filexfer.c 
b/drivers/staging/unisys/visorchipset/filexfer.c
deleted file mode 100644
index f950d6e..000
--- a/drivers/staging/unisys/visorchipset/filexfer.c
+++ /dev/null
@@ -1,506 +0,0 @@
-/* filexfer.c
- *
- * Copyright � 2013 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/* Code here-in is the glue that connects controlvm messages with the
- * sparfilexfer driver, which is used to transfer file contents as payload
- * across the controlvm channel.
- */
-
-#include globals.h
-#include controlvm.h
-#include visorchipset.h
-#include filexfer.h
-
-#ifdef ENABLE_SPARFILEXFER /* sparfilexfer kernel module enabled in build */
-#include sparfilexfer.h
-
-/* Driver-global memory */
-static LIST_HEAD(Request_list);/* list of struct any_request *, via
-* req_list memb */
-
-/* lock for above pool for allocation of any_request structs, and pool
-* name; note that kmem_cache_create requires that we keep the storage
-* for the pool name for the life of the pool
- */
-static DEFINE_SPINLOCK(Request_list_lock);
-
-static struct kmem_cache *Request_memory_pool;
-static const char Request_memory_pool_name[] = filexfer_request_pool;
-size_t Caller_req_context_bytes = 0;   /* passed to filexfer_constructor() */
-
-/* This structure defines a single controlvm GETFILE conversation, which
- * consists of a single controlvm request message and 1 or more controlvm
- * response messages.
- */
-struct getfile_request {
-   CONTROLVM_MESSAGE_HEADER controlvm_header;
-   atomic_t buffers_in_use;
-   GET_CONTIGUOUS_CONTROLVM_PAYLOAD_FUNC get_contiguous_controlvm_payload;
-   CONTROLVM_RESPOND_WITH_PAYLOAD_FUNC controlvm_respond_with_payload;
-};
-
-/* This structure defines a single controlvm PUTFILE conversation, which
- * consists of a single controlvm request with a filename, and additional
- * controlvm messages with file data.
- */
-struct putfile_request {
-   GET_CONTROLVM_FILEDATA_FUNC get_controlvm_filedata;
-   CONTROLVM_RESPOND_FUNC controlvm_end_putFile;
-};
-
-/* This structure defines a single file transfer operation, which can either
- * be a GETFILE or PUTFILE.
- */
-struct any_request {
-   struct list_head req_list;
-   ulong2 file_request_number;
-   ulong2 data_sequence_number;
-   TRANSMITFILE_DUMP_FUNC dump_func;
-   BOOL is_get;
-   union {
-   struct getfile_request get;
-   struct putfile_request put;
-   };
-   /* Size of caller_context_data will be
-* Caller_req_context_bytes bytes.  I aligned this because I
-* am paranoid about what happens when an arbitrary data
-* structure with unknown alignment requirements gets copied
-* here.  I want caller_context_data to be aligned to the
-* coarsest possible alignment boundary that could be required
-* for any user data structure.
-*/
-   u8 caller_context_data[1] __aligned(sizeof(ulong2));
-};
-
-/*
- * Links the any_request into the global list of allocated requests
- * (Request_list).
- */
-static void
-unit_tracking_create(struct list_head *dev_list_link)
-{
-   unsigned long flags;
-   spin_lock_irqsave(Request_list_lock, flags);
-   list_add

[PATCH 4/6] Staging: unisys: Remove unused macros from visorchannel/visorchannel.h

2014-05-22 Thread Ken Cox
VISORCHANNEL_CHANGE_SERVER_STATE and VISORCHANNEL_CHANGE_CLIENT_STATE
are never used in any of the source so they have been removed.

VISORCHANNEL_CHANGE_CLIENT_STATE would have caused a broken kernel build
after commit  a8d7f21d, but since it was never used the kernel continued
to build.

Reported-by: Dan Carpenter dan.carpen...@oracle.com
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/visorchannel/visorchannel.h | 30 --
 1 file changed, 30 deletions(-)

diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h 
b/drivers/staging/unisys/visorchannel/visorchannel.h
index 784f03a..ecf0d11 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel.h
+++ b/drivers/staging/unisys/visorchannel/visorchannel.h
@@ -75,34 +75,4 @@ void visorchannel_dump_section(VISORCHANNEL *chan, char *s,
   int off, int len, struct seq_file *seq);
 void __iomem *visorchannel_get_header(VISORCHANNEL *channel);
 
-#defineVISORCHANNEL_CHANGE_SERVER_STATE(chan, chanId, newstate)
\
-   do {\
-   U8 *p = (U8 __iomem *)visorchannel_get_header(chan);\
-   if (p) {\
-   ULTRA_CHANNEL_SERVER_TRANSITION(p, chanId, SrvState, \
-   newstate, logCtx); \
-   visorchannel_write  \
-   (chan,  \
-offsetof(ULTRA_CHANNEL_PROTOCOL, SrvState), \
-p +\
-offsetof(ULTRA_CHANNEL_PROTOCOL, SrvState), \
-sizeof(U32));  \
-   }   \
-   } while (0)
-
-#defineVISORCHANNEL_CHANGE_CLIENT_STATE(chan, chanId, newstate)
\
-   do {\
-   U8 *p = (U8 __iomem *)visorchannel_get_header(chan);\
-   if (p) {\
-   ULTRA_CHANNEL_CLIENT_TRANSITION(p, chanId,  \
-   newstate, logCtx); \
-   visorchannel_write  \
-   (chan,  \
-offsetof(ULTRA_CHANNEL_PROTOCOL, CliStateOS), \
-p +\
-offsetof(ULTRA_CHANNEL_PROTOCOL, CliStateOS), \
-sizeof(U32));  \
-   }   \
-   } while (0)
-
 #endif
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Patch V2 0/2] staging: unisys: Fix module loading on non s-Par platform

2014-05-12 Thread Ken Cox

On 04/28/2014 12:23 PM, Ken Cox wrote:

Each module now has a check in the init function to ensure that it is being
loaded on an s-Par platform and returns an error if it isn't.

Also, MODULE_LICENSE(GPL) has been added to visorkmodutils.c.

Greg,
Have you had a chance to look at these patches yet?  I hadn't seen any 
comment so was just checking to see if they made it to your queue.


Thanks,
Ken Cox
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/4] Staging: unisys: visorutil: Add MODULE_LICENSE(GPL)

2014-04-28 Thread Ken Cox


On 04/25/2014 05:32 PM, Greg KH wrote:

On Thu, Apr 24, 2014 at 01:57:12PM -0500, Ken Cox wrote:

The visorutil module was lacking license info.

Signed-off-by: Ken Cox j...@redhat.com
---
  drivers/staging/unisys/visorutil/visorkmodutils.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/staging/unisys/visorutil/visorkmodutils.c 
b/drivers/staging/unisys/visorutil/visorkmodutils.c
index 87ed5bf..1cf11fc 100644
--- a/drivers/staging/unisys/visorutil/visorkmodutils.c
+++ b/drivers/staging/unisys/visorutil/visorkmodutils.c
@@ -88,3 +88,5 @@ visorutil_mod_exit(void)
  
  module_init(visorutil_mod_init);

  module_exit(visorutil_mod_exit);
+
+MODULE_LICENSE(GPL);
--
1.8.5.3


This patch doesn't apply at all, what tree are you making it against?

This patch won't apply without patch 2.  I'll rewrite and resubmit.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V2 2/2] Staging: unisys: visorutil: Add MODULE_LICENSE(GPL)

2014-04-28 Thread Ken Cox
The visorutil module was lacking license info.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/visorutil/visorkmodutils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/unisys/visorutil/visorkmodutils.c 
b/drivers/staging/unisys/visorutil/visorkmodutils.c
index 7521027..10d77cb 100644
--- a/drivers/staging/unisys/visorutil/visorkmodutils.c
+++ b/drivers/staging/unisys/visorutil/visorkmodutils.c
@@ -123,3 +123,4 @@ visorutil_mod_exit(void)
 module_init(visorutil_mod_init);
 module_exit(visorutil_mod_exit);
 
+MODULE_LICENSE(GPL);
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V2 1/2] Staging: unisys: detect s-Par firmware

2014-04-28 Thread Ken Cox
This patch adds support for detection of s-Par firmware by checking for
the hypervisor bit in the CPU capabilities, and then querying the hypervisor
ID cpuid leaf.

This functionality will be used by the unisys drivers to determine if
they are being loaded on an s-Par platform and refuse to load if no
s-Par firmware is present.

This fixes a problem reported from upstream where a panic occurs if the
unisys drivers are loaded on a non s-Par system.

Reported-by: Fengguang Wu fengguang...@intel.com
Signed-off-by: Ken Cox j...@redhat.com
Tested by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/channels/chanstub.c |  3 ++
 drivers/staging/unisys/include/timskmodutils.h |  2 +
 drivers/staging/unisys/uislib/uislib.c |  3 ++
 drivers/staging/unisys/virthba/virthba.c   |  3 ++
 drivers/staging/unisys/virtpci/virtpci.c   |  4 ++
 .../unisys/visorchannel/visorchannel_main.c|  3 ++
 .../unisys/visorchipset/visorchipset_main.c|  3 ++
 drivers/staging/unisys/visorutil/visorkmodutils.c  | 54 ++
 8 files changed, 75 insertions(+)

diff --git a/drivers/staging/unisys/channels/chanstub.c 
b/drivers/staging/unisys/channels/chanstub.c
index 45ac55d..1e7d6a7 100644
--- a/drivers/staging/unisys/channels/chanstub.c
+++ b/drivers/staging/unisys/channels/chanstub.c
@@ -25,11 +25,14 @@
 
 #include channel.h
 #include chanstub.h
+#include timskmodutils.h
 #include version.h
 
 static __init int
 channel_mod_init(void)
 {
+   if (!unisys_spar_platform)
+   return -ENODEV;
return 0;
 }
 
diff --git a/drivers/staging/unisys/include/timskmodutils.h 
b/drivers/staging/unisys/include/timskmodutils.h
index 0045d55..c316c94 100644
--- a/drivers/staging/unisys/include/timskmodutils.h
+++ b/drivers/staging/unisys/include/timskmodutils.h
@@ -72,4 +72,6 @@ char *cyclesToSomethingsPerSecond(u64 cycles, u64 
cyclesPerSecond,
 struct seq_file *visor_seq_file_new_buffer(void *buf, size_t buf_size);
 void visor_seq_file_done_buffer(struct seq_file *m);
 
+extern int unisys_spar_platform;
+
 #endif
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 0e1a58a..fbdb19f 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -2277,6 +2277,9 @@ static int __init
 uislib_mod_init(void)
 {
 
+   if (!unisys_spar_platform)
+   return -ENODEV;
+
LOGINF(MONITORAPIS);
 
LOGINF(sizeof(struct uiscmdrsp):%lu bytes\n,
diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index a13e79e..d528388 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -1699,6 +1699,9 @@ virthba_mod_init(void)
int error;
int i;
 
+   if (!unisys_spar_platform)
+   return -ENODEV;
+
LOGINF(Entering virthba_mod_init...\n);
 
POSTCODE_LINUX_2(VHBA_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 21f8bd5..9a35dd2 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -39,6 +39,7 @@
 #include linux/version.h
 #include version.h
 #include guestlinuxdebug.h
+#include timskmodutils.h
 
 struct driver_private {
struct kobject kobj;
@@ -1687,6 +1688,9 @@ static int __init virtpci_mod_init(void)
int ret;
 
 
+   if (!unisys_spar_platform)
+   return -ENODEV;
+
LOGINF(Module build: Date:%s Time:%s...\n, __DATE__, __TIME__);
 
POSTCODE_LINUX_2(VPCI_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_main.c 
b/drivers/staging/unisys/visorchannel/visorchannel_main.c
index 1a09257..c8f89bd 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_main.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_main.c
@@ -29,6 +29,9 @@
 static int __init
 visorchannel_init(void)
 {
+   if (!unisys_spar_platform)
+   return -ENODEV;
+
INFODRV(driver version %s loaded, VERSION);
return 0;
 }
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 1895dc4..5b95592 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -2699,6 +2699,9 @@ visorchipset_init(void)
struct proc_dir_entry *toolaction_file;
struct proc_dir_entry *bootToTool_file;
 
+   if (!unisys_spar_platform)
+   return -ENODEV;
+
LOGINF(chipset driver version %s loaded, VERSION);
/* process module options */
POSTCODE_LINUX_2(DRIVER_ENTRY_PC, POSTCODE_SEVERITY_INFO);
diff --git a/drivers/staging/unisys/visorutil/visorkmodutils.c 
b/drivers/staging/unisys/visorutil/visorkmodutils.c
index e802e75

[PATCH 1/4] staging: unisys: detect s-Par firmware

2014-04-24 Thread Ken Cox
From: Benjamin Romer benjamin.ro...@unisys.com

This patch adds support for detection of s-Par firmware by checking for the 
hypervisor bit in the CPU capabilities, and then querying the hypervisor ID 
cpuid leaf.

This functionality will be used by the unisys drivers to determine if
they are being loaded on an s-Par platform and refuse to load if no
s-Par firmware is present.

This fixes a problem reported from upstream where a panic occurs if the
unisys drivers are loaded on a non s-Par system.

Reported-by: Fengguang Wu fengguang...@intel.com
Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
Tested-by: Benjamin Romer benjamin.ro...@unisys.com
Signed-off-by: Ken Cox j...@redhat.com
Tested-by: Ken Cox j...@redhat.com
---
 arch/x86/include/asm/hypervisor.h |  1 +
 arch/x86/kernel/cpu/Makefile  |  2 +-
 arch/x86/kernel/cpu/hypervisor.c  |  3 +++
 arch/x86/kernel/cpu/unisys_spar.c | 51 +++
 4 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/kernel/cpu/unisys_spar.c

diff --git a/arch/x86/include/asm/hypervisor.h 
b/arch/x86/include/asm/hypervisor.h
index e42f758..3a86e0e 100644
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
@@ -52,6 +52,7 @@ extern const struct hypervisor_x86 x86_hyper_vmware;
 extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
 extern const struct hypervisor_x86 x86_hyper_xen_hvm;
 extern const struct hypervisor_x86 x86_hyper_kvm;
+extern const struct hypervisor_x86 x86_hyper_unisys_spar;
 
 extern void init_hypervisor(struct cpuinfo_x86 *c);
 extern void init_hypervisor_platform(void);
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 7fd54f0..a64ee5a 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -46,7 +46,7 @@ obj-$(CONFIG_MICROCODE)   += microcode/
 
 obj-$(CONFIG_X86_LOCAL_APIC)   += perfctr-watchdog.o 
perf_event_amd_ibs.o
 
-obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
+obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o 
unisys_spar.o
 
 quiet_cmd_mkcapflags = MKCAP   $@
   cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/mkcapflags.sh $ $@
diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c
index 36ce402..ba92d14 100644
--- a/arch/x86/kernel/cpu/hypervisor.c
+++ b/arch/x86/kernel/cpu/hypervisor.c
@@ -35,6 +35,9 @@ static const __initconst struct hypervisor_x86 * const 
hypervisors[] =
 #ifdef CONFIG_KVM_GUEST
x86_hyper_kvm,
 #endif
+#ifdef CONFIG_UNISYSSPAR
+   x86_hyper_unisys_spar,
+#endif
 };
 
 const struct hypervisor_x86 *x86_hyper;
diff --git a/arch/x86/kernel/cpu/unisys_spar.c 
b/arch/x86/kernel/cpu/unisys_spar.c
new file mode 100644
index 000..264f309
--- /dev/null
+++ b/arch/x86/kernel/cpu/unisys_spar.c
@@ -0,0 +1,51 @@
+/* unisys_spar.c
+ *
+ * Copyright (C) 2014 - 2014 UNISYS CORPORATION
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ */
+
+#include asm/hypervisor.h
+
+/* s-Par uses the Intel processor's VT-X features to separate groups of
+ * processors into partitions. The firmware sets the hypervisor bit and
+ * reports an ID in the HV capabilities leaf so that the partition's OS
+ * knows s-Par is present and managing the processors.
+ */
+
+#define UNISYS_SPAR_LEAF_ID 0x4000
+
+/* The s-Par leaf ID returns UnisysSpar64 encoded across ebx, ecx, edx */
+#define UNISYS_SPAR_ID_EBX 0x73696e55
+#define UNISYS_SPAR_ID_ECX 0x70537379
+#define UNISYS_SPAR_ID_EDX 0x34367261
+
+static uint32_t unisys_spar_detect(void)
+{
+   if (cpu_has_hypervisor) {
+   unsigned int eax, ebx, ecx, edx;
+
+   /* check the ID */
+   cpuid(UNISYS_SPAR_LEAF_ID, eax, ebx, ecx, edx);
+   return  (ebx == UNISYS_SPAR_ID_EBX) 
+   (ecx == UNISYS_SPAR_ID_ECX) 
+   (edx == UNISYS_SPAR_ID_EDX);
+   } else
+   return 0;
+}
+
+const __refconst struct hypervisor_x86 x86_hyper_unisys_spar = {
+   .name   = Unisys s-Par(R),
+   .detect = unisys_spar_detect,
+};
+EXPORT_SYMBOL(x86_hyper_unisys_spar);
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] Staging: unisys: Added check for s-Par platform in each init function.

2014-04-24 Thread Ken Cox
This fixes a problem reported from upstream where a panic occurs if the
unisys drivers are loaded on a non s-Par system.

Reported-by: Fengguang Wu fengguang...@intel.com
Signed-off-by: Ken Cox j...@redhat.com
Tested by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/channels/chanstub.c|  5 +
 drivers/staging/unisys/uislib/uislib.c|  5 +
 drivers/staging/unisys/virthba/virthba.c  |  4 
 drivers/staging/unisys/virtpci/virtpci.c  |  4 
 .../staging/unisys/visorchannel/visorchannel_main.c   |  4 
 .../staging/unisys/visorchipset/visorchipset_main.c   |  4 
 drivers/staging/unisys/visorutil/visorkmodutils.c | 19 +++
 7 files changed, 45 insertions(+)

diff --git a/drivers/staging/unisys/channels/chanstub.c 
b/drivers/staging/unisys/channels/chanstub.c
index f504f49..cf8242b 100644
--- a/drivers/staging/unisys/channels/chanstub.c
+++ b/drivers/staging/unisys/channels/chanstub.c
@@ -23,6 +23,8 @@
 #include linux/slab.h/* for memcpy */
 #include linux/types.h
 
+#include asm/hypervisor.h
+
 #include channel.h
 #include chanstub.h
 #include version.h
@@ -30,6 +32,9 @@
 static __init int
 channel_mod_init(void)
 {
+   if (x86_hyper != x86_hyper_unisys_spar)
+   return -ENODEV;
+
return 0;
 }
 
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 3152a21..ea69803 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -24,6 +24,8 @@
 #endif
 #include linux/module.h
 
+#include asm/hypervisor.h
+
 #include commontypes.h
 
 #include linux/version.h
@@ -2277,6 +2279,9 @@ static int __init
 uislib_mod_init(void)
 {
 
+   if (x86_hyper != x86_hyper_unisys_spar)
+   return -ENODEV;
+
LOGINF(MONITORAPIS);
 
LOGINF(sizeof(struct uiscmdrsp):%lu bytes\n,
diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index 817b11d..528af0f 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -50,6 +50,7 @@
 #include scsi/scsi_cmnd.h
 #include scsi/scsi_device.h
 #include asm/param.h
+#include asm/hypervisor.h
 #include linux/proc_fs.h
 #include linux/types.h
 
@@ -1691,6 +1692,9 @@ virthba_mod_init(void)
int error;
int i;
 
+   if (x86_hyper != x86_hyper_unisys_spar)
+   return -ENODEV;
+
LOGINF(Entering virthba_mod_init...\n);
 
POSTCODE_LINUX_2(VHBA_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 8e34650..c6db25b 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -37,6 +37,7 @@
 #include linux/proc_fs.h
 #include linux/if_ether.h
 #include linux/version.h
+#include asm/hypervisor.h
 #include version.h
 #include guestlinuxdebug.h
 
@@ -1687,6 +1688,9 @@ static int __init virtpci_mod_init(void)
int ret;
 
 
+   if (x86_hyper != x86_hyper_unisys_spar)
+   return -ENODEV;
+
LOGINF(Module build: Date:%s Time:%s...\n, __DATE__, __TIME__);
 
POSTCODE_LINUX_2(VPCI_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_main.c 
b/drivers/staging/unisys/visorchannel/visorchannel_main.c
index 482ee0a..bd7331b 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_main.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_main.c
@@ -23,12 +23,16 @@
 #include channel.h
 #include visorchannel.h
 #include guidutils.h
+#include asm/hypervisor.h
 
 #define MYDRVNAME visorchannel
 
 static int __init
 visorchannel_init(void)
 {
+   if (x86_hyper != x86_hyper_unisys_spar)
+   return -ENODEV;
+
INFODRV(driver version %s loaded, VERSION);
return 0;
 }
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c475e25..a64efa7 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -34,6 +34,7 @@
 #include linux/nls.h
 #include linux/netdevice.h
 #include linux/platform_device.h
+#include asm/hypervisor.h
 
 #define CURRENT_FILE_PC VISOR_CHIPSET_PC_visorchipset_main_c
 #define TEST_VNIC_PHYSITF eth0   /* physical network itf for
@@ -2699,6 +2700,9 @@ visorchipset_init(void)
struct proc_dir_entry *toolaction_file;
struct proc_dir_entry *bootToTool_file;
 
+   if (x86_hyper != x86_hyper_unisys_spar)
+   return -ENODEV;
+
LOGINF(chipset driver version %s loaded, VERSION);
/* process module options */
POSTCODE_LINUX_2(DRIVER_ENTRY_PC, POSTCODE_SEVERITY_INFO);
diff --git a/drivers/staging/unisys/visorutil/visorkmodutils.c 
b/drivers/staging/unisys/visorutil/visorkmodutils.c

[Patch 0/4] staging: unisys: Fix module loading on non s-Par platform

2014-04-24 Thread Ken Cox
This series fixes the problem reported by Fengguang Wu fengguang...@intel.com
where the unisys modules will cause a panic if loaded on a non s-Par 
platform.

Each module now has a check in the init function to ensure that it is being
loaded on an s-Par platform and returns an error if it isn't.

In addition, a MODULE_DEVICE_TABLE entry is now created by virthba so that 
the modules will now autoload when the kernel boots.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] Staging: unisys: visorutil: Add MODULE_LICENSE(GPL)

2014-04-24 Thread Ken Cox
The visorutil module was lacking license info.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/visorutil/visorkmodutils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/unisys/visorutil/visorkmodutils.c 
b/drivers/staging/unisys/visorutil/visorkmodutils.c
index 87ed5bf..1cf11fc 100644
--- a/drivers/staging/unisys/visorutil/visorkmodutils.c
+++ b/drivers/staging/unisys/visorutil/visorkmodutils.c
@@ -88,3 +88,5 @@ visorutil_mod_exit(void)
 
 module_init(visorutil_mod_init);
 module_exit(visorutil_mod_exit);
+
+MODULE_LICENSE(GPL);
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] Staging: unisys: virthba: add MODULE_DEVICE_TABLE

2014-04-24 Thread Ken Cox
Add x86_cpu_id struct and call to MODULE_DEVICE_TABLE so this module
will be auto loaded on boot.

Signed-off-by: Ken Cox j...@redhat.com
Tested-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/virthba/virthba.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index 528af0f..00ec3ff 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -83,6 +83,14 @@ static int virthba_ioctl(struct scsi_device *dev, int cmd, 
void __user *arg);
 static int virthba_queue_command_lck(struct scsi_cmnd *scsicmd,
 void (*virthba_cmnd_done)(struct scsi_cmnd 
*));
 
+static const struct x86_cpu_id unisys_spar_ids[] = {
+   { X86_VENDOR_INTEL, 6, 62, X86_FEATURE_ANY },
+   {}
+};
+
+/* Autoload */
+MODULE_DEVICE_TABLE(x86cpu, unisys_spar_ids);
+
 #ifdef DEF_SCSI_QCMD
 DEF_SCSI_QCMD(virthba_queue_command)
 #else
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Patch 0/8] Staging: unisys: Get rid of goto statements in macros

2014-03-19 Thread Ken Cox
This series gets rid of a number of macros that ultimately include a goto
statement.  The first patches clean up unused macros and macros that reference
other macros which eventually contain a goto statement.  

The latter patches actually remove the goto statements.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/8] Staging: unisys: Remove RETBOOL macro

2014-03-19 Thread Ken Cox
The RETBOOL macro contained a goto statement which is not allowed in
the kernel.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/include/timskmod.h  |  4 ---
 drivers/staging/unisys/uislib/uisqueue.c   |  1 -
 .../unisys/visorchannel/visorchannel_funcs.c   | 37 +++---
 drivers/staging/unisys/visorutil/periodic_work.c   | 22 -
 4 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h 
b/drivers/staging/unisys/include/timskmod.h
index 6abb32e..0623f55 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -132,10 +132,6 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data */
  *  @param x the value to return
  */
 #define RETPTR(x)  do { rc = (x); RETTRACE(x); goto Away; } while (0)
-/** return from a BOOL function, using a common exit point Away
- *  @param x the value to return
- */
-#define RETBOOL(x) do { rc = (x); RETTRACE(x); goto Away; } while (0)
 /** Given a typedef/struct/union and a member field name,
  *  return the number of bytes occupied by that field.
  *  @param TYPE the typedef name, or struct xx or union xx
diff --git a/drivers/staging/unisys/uislib/uisqueue.c 
b/drivers/staging/unisys/uislib/uisqueue.c
index a7a8b2e..7ea306e 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -31,7 +31,6 @@
 #define RETVOIDdo { goto Away; } while (0)
 #define RETINT(x)  do { rc = (x); goto Away; } while (0)
 #define RETPTR(x)  do { rc = (x); goto Away; } while (0)
-#define RETBOOL(x) do { rc = (x); goto Away; } while (0)
 
 #define CHECK_CACHE_ALIGN 0
 
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c 
b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index f397d83..ff4556b 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -313,7 +313,7 @@ sig_read_header(VISORCHANNEL *channel, U32 queue,
   queue, (int)SIG_QUEUE_OFFSET(channel-chan_hdr, queue));
FAIL(visor_memregion_read of signal queue failed, FALSE);
}
-   RETBOOL(TRUE);
+   rc = TRUE;
 Away:
return rc;
 }
@@ -337,7 +337,7 @@ sig_do_data(VISORCHANNEL *channel, U32 queue,
FAIL(visor_memregion_read of signal data failed,
 FALSE);
}
-   RETBOOL(TRUE);
+   rc = TRUE;
 Away:
return rc;
 }
@@ -387,10 +387,14 @@ visorchannel_signalremove(VISORCHANNEL *channel, U32 
queue, void *msg)
if (channel-needs_lock)
spin_lock(channel-remove_lock);
 
-   if (!sig_read_header(channel, queue, sig_hdr))
-   RETBOOL(FALSE);
-   if (sig_hdr.Head == sig_hdr.Tail)
-   RETBOOL(FALSE); /* no signals to remove */
+   if (!sig_read_header(channel, queue, sig_hdr)) {
+   rc = FALSE;
+   goto Away;
+   }
+   if (sig_hdr.Head == sig_hdr.Tail) {
+   rc = FALSE; /* no signals to remove */
+   goto Away;
+   }
sig_hdr.Tail = (sig_hdr.Tail + 1) % sig_hdr.MaxSignalSlots;
if (!sig_read_data(channel, queue, sig_hdr, sig_hdr.Tail, msg))
FAIL(sig_read_data failed, FALSE);
@@ -405,9 +409,7 @@ visorchannel_signalremove(VISORCHANNEL *channel, U32 queue, 
void *msg)
if (!SIG_WRITE_FIELD(channel, queue, sig_hdr, NumSignalsReceived))
FAIL(visor_memregion_write of NumSignalsReceived failed,
 FALSE);
-
-   RETBOOL(TRUE);
-
+   rc = TRUE;
 Away:
if (channel-needs_lock)
spin_unlock(channel-remove_lock);
@@ -425,20 +427,19 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 
queue, void *msg)
if (channel-needs_lock)
spin_lock(channel-insert_lock);
 
-   if (!sig_read_header(channel, queue, sig_hdr))
-   RETBOOL(FALSE);
+   if (!sig_read_header(channel, queue, sig_hdr)) {
+   rc = FALSE;
+   goto Away;
+   }
 
sig_hdr.Head = ((sig_hdr.Head + 1) % sig_hdr.MaxSignalSlots);
if (sig_hdr.Head == sig_hdr.Tail) {
-#if 0
-   ERRDRV(visorchannel queue #%d overflow (max slots=%d),
-  queue, sig_hdr.MaxSignalSlots);
-#endif
sig_hdr.NumOverflows++;
if (!SIG_WRITE_FIELD(channel, queue, sig_hdr, NumOverflows))
FAIL(visor_memregion_write of NumOverflows failed,
 FALSE);
-   RETBOOL(FALSE);
+   rc = FALSE;
+   goto Away;
}
 
if (!sig_write_data(channel, queue, sig_hdr, sig_hdr.Head, msg))
@@ -453,9 +454,7 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, 
void *msg)
FAIL(visor_memregion_write of Head failed, FALSE

[PATCH 1/8] Staging: unisys: include: Remove unused macros from timskmod.h

2014-03-19 Thread Ken Cox
The following macros were never referenced and have been removed:
DEVFROMID
DEVFROMFILE
DEVFROMINODE
DEVFROMIDX
TRY_WPOSTCODE_3

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/include/timskmod.h | 118 --
 1 file changed, 118 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h 
b/drivers/staging/unisys/include/timskmod.h
index 0d0b29c..c4262ab 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -193,13 +193,6 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data */
 pcval32bit);   \
} while (0)
 
-#define TRY_WPOSTCODE_3(x, EVENT_PC, pcval16bit1, pcval16bit2) do { \
-   int status = (x);   \
-   if (status  0) \
-   FAIL_WPOSTCODE_3(__stringify(x), status, EVENT_PC, \
-pcval16bit1, pcval16bit2); \
-   } while (0)
-
 #define ASSERT(cond)   \
do { if (!(cond))  \
HUHDRV(ASSERT failed - %s,   \
@@ -315,117 +308,6 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data 
*/
RETVOID;  \
})
 
-/** Converts a device index #devix into #devData, after checking for validity.
- *  Can only be called from functions returning void.
- *  @param devix your device index within the #DevData array.
- *  @param devData the #PRIVATEDEVICEDATA pointer that will be set on return.
- *  @param where string identifying the calling function, to be printed in
- * debug message
- *  @param dbg 1 iff debug messages are enabled
- */
-#define DEVFROMID(devix, devData, where, dbg)  \
-   {   \
-   if (devix = MAXDEVICES) {  \
-   PRINTKDRV(bad devix passed to %s(), where);   \
-   RETVOID;\
-   }   \
-   if (dbg)\
-   DEBUGDEV(devix, %s, where);   \
-   if (devix = MAXDEVICES) {  \
-   DEBUGDEV(devix, %s - bad devix %d,\
-where, devix); \
-   RETVOID;\
-   }   \
-   devData = DevData[devix];   \
-   CHKDD(devData); \
-   }
-
-/** Converts a device index #devix into #devData, after checking for validity.
- *  Can only be called from functions returning int.
- *  @param devix your device index within the #DevData array.
- *  @param devData the #PRIVATEDEVICEDATA pointer that will be set on return.
- *  @param errcode error code that your function will return on error.
- *  @param where string identifying the calling function, to be printed in
- * debug message
- *  @param dbg 1 iff debug messages are enabled
- */
-#define DEVFROMIDX(devix, devData, errcode, where, dbg)
\
-   {   \
-   if (devix = MAXDEVICES) {  \
-   PRINTKDRV(bad devix passed to %s(), where);   \
-   RETINT(errcode);\
-   }   \
-   if (dbg)\
-   DEBUGDEV(devix, %s, where);   \
-   if (devix = MAXDEVICES) {  \
-   DEBUGDEV(devix, %s - bad devix %d,\
-where, devix); \
-   RETINT(-ENODEV);\
-   }   \
-   devData = DevData[devix];   \
-   CHKDDX(devData, -EIO);  \
-   }
-
-/** Converts an inode pointer #inode into a #devix and #devData, after
- *  checking for validity.
- *  Can only be called from functions returning int.
- *  @param devix your device index within the #DevData array.
- *  @param devData the #PRIVATEDEVICEDATA pointer that will be set on return.
- *  @param inode input inode pointer
- *  @param

[PATCH 6/8] Staging: unisys: Remove RETVOID macro

2014-03-19 Thread Ken Cox
The RETVOID macro contained a goto statement which is not allowed in
the kernel.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/include/timskmod.h   |  2 --
 drivers/staging/unisys/uislib/uisqueue.c|  1 -
 drivers/staging/unisys/visorchipset/parser.c|  4 +---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 +---
 4 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h 
b/drivers/staging/unisys/include/timskmod.h
index 41cbcde..1101ecd 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -122,8 +122,6 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data */
 #define RETTRACE(x)
 #endif
 
-/** return from a void function, using a common exit point Away */
-#define RETVOIDdo { RETTRACE(0); goto Away; } while (0)
 /** return from an int function, using a common exit point Away
  *  @param x the value to return
  */
diff --git a/drivers/staging/unisys/uislib/uisqueue.c 
b/drivers/staging/unisys/uislib/uisqueue.c
index 7bd05f7..91b03ed 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -28,7 +28,6 @@
 #define CURRENT_FILE_PC UISLIB_PC_uisqueue_c
 #define __MYFILE__ uisqueue.c
 
-#define RETVOIDdo { goto Away; } while (0)
 #define RETINT(x)  do { rc = (x); goto Away; } while (0)
 
 #define CHECK_CACHE_ALIGN 0
diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index 6904dcc..b408d41 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -213,7 +213,7 @@ parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING 
which_string)
if (ctx == NULL) {
ERRDRV(%s (%s:%d) - no context,
   __func__, __FILE__, __LINE__);
-   RETVOID;
+   goto Away;
}
phdr = (ULTRA_CONTROLVM_PARAMETERS_HEADER *) (ctx-data);
switch (which_string) {
@@ -235,10 +235,8 @@ parser_param_start(PARSER_CONTEXT *ctx, 
PARSER_WHICH_STRING which_string)
break;
default:
ERRDRV(%s - bad which_string %d, __func__, which_string);
-   RETVOID;
break;
}
-   RETVOID;
 
 Away:
return;
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index b769257..b2355d9 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1927,12 +1927,12 @@ controlvm_periodic_work(struct work_struct *work)
 
/* make sure visorbus server is registered for controlvm callbacks */
if (visorchipset_serverregwait  !serverregistered)
-   RETVOID;
+   goto Away;
/* make sure visorclientbus server is regsitered for controlvm
 * callbacks
 */
if (visorchipset_clientregwait  !clientregistered)
-   RETVOID;
+   goto Away;
 
memset(chanInfo, 0, sizeof(VISORCHIPSET_CHANNEL_INFO));
if (!ControlVm_channel) {
@@ -1963,7 +1963,7 @@ controlvm_periodic_work(struct work_struct *work)
if ((ControlVm_channel != NULL) || (Poll_Count = 250))
;   /* keep going */
else
-   RETVOID;
+   goto Away;
 
/* Check events to determine if response to CHIPSET_READY
 * should be sent
@@ -2033,8 +2033,6 @@ controlvm_periodic_work(struct work_struct *work)
/* parahotplug_worker */
parahotplug_process_list();
 
-   RETVOID;
-
 Away:
 
if (time_after(jiffies,
@@ -2071,13 +2069,13 @@ setup_crash_devices_work_queue(struct work_struct *work)
 
/* make sure visorbus server is registered for controlvm callbacks */
if (visorchipset_serverregwait  !serverregistered)
-   RETVOID;
+   goto Away;
 
/* make sure visorclientbus server is regsitered for controlvm
 * callbacks
 */
if (visorchipset_clientregwait  !clientregistered)
-   RETVOID;
+   goto Away;
 
POSTCODE_LINUX_2(CRASH_DEV_ENTRY_PC, POSTCODE_SEVERITY_INFO);
 
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 8/8] Staging: unisys: Remove RETINT macro

2014-03-19 Thread Ken Cox
The RETINT macro included a goto statement which is not allowed in the
kernel.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/include/timskmod.h  |  4 --
 drivers/staging/unisys/uislib/uisqueue.c   |  9 ++--
 .../unisys/visorchannel/visorchannel_funcs.c   | 10 ++--
 drivers/staging/unisys/visorchipset/file.c | 33 ++--
 .../unisys/visorchipset/visorchipset_main.c| 62 ++
 drivers/staging/unisys/visorutil/charqueue.c   | 11 ++--
 6 files changed, 68 insertions(+), 61 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h 
b/drivers/staging/unisys/include/timskmod.h
index 3f8e6a2..5fd5ad5 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -122,10 +122,6 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data */
 #define RETTRACE(x)
 #endif
 
-/** return from an int function, using a common exit point Away
- *  @param x the value to return
- */
-#define RETINT(x)  do { rc = (x); RETTRACE(x); goto Away; } while (0)
 /** Try to evaulate the provided expression, and do a RETINT(x) iff
  *  the expression evaluates to  0.
  *  @param x the expression to try
diff --git a/drivers/staging/unisys/uislib/uisqueue.c 
b/drivers/staging/unisys/uislib/uisqueue.c
index 91b03ed..40598ff 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -28,8 +28,6 @@
 #define CURRENT_FILE_PC UISLIB_PC_uisqueue_c
 #define __MYFILE__ uisqueue.c
 
-#define RETINT(x)  do { rc = (x); goto Away; } while (0)
-
 #define CHECK_CACHE_ALIGN 0
 
 /*/
@@ -91,13 +89,13 @@ do_locked_client_insert(struct uisqueue_info *queueinfo,
locked = 1;
 
if (!ULTRA_CHANNEL_CLIENT_ACQUIRE_OS(queueinfo-chan, channelId, NULL))
-   RETINT(0);
+   goto Away;
 
acquired = 1;
 
queueWasEmpty = visor_signalqueue_empty(queueinfo-chan, whichqueue);
if (!visor_signal_insert(queueinfo-chan, whichqueue, pSignal))
-   RETINT(0);
+   goto Away;
ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo-chan, channelId, NULL);
acquired = 0;
spin_unlock_irqrestore(lock, flags);
@@ -105,8 +103,7 @@ do_locked_client_insert(struct uisqueue_info *queueinfo,
 
queueinfo-packets_sent++;
 
-   RETINT(1);
-
+   rc = 1;
 Away:
if (acquired) {
ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo-chan, channelId,
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c 
b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index 8a200af..0536816 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -250,7 +250,7 @@ visorchannel_clear(VISORCHANNEL *channel, ulong offset, U8 
ch, ulong nbytes)
 
if (buf == NULL) {
ERRDRV(%s failed memory allocation, __func__);
-   RETINT(-1);
+   goto Away;
}
memset(buf, ch, bufsize);
while (nbytes  0) {
@@ -260,12 +260,14 @@ visorchannel_clear(VISORCHANNEL *channel, ulong offset, 
U8 ch, ulong nbytes)
thisbytes = nbytes;
x = visor_memregion_write(channel-memregion, offset + written,
  buf, thisbytes);
-   if (x  0)
-   RETINT(x);
+   if (x  0) {
+   rc = x;
+   goto Away;
+   }
written += thisbytes;
nbytes -= thisbytes;
}
-   RETINT(0);
+   rc = 0;
 
 Away:
if (buf != NULL) {
diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index 839a943..e214a11 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -71,7 +71,7 @@ visorchipset_file_init(dev_t majorDev, VISORCHANNEL 
**pControlVm_channel)
if (alloc_chrdev_region(MajorDev, 0, 1, MYDRVNAME)  0) {
ERRDRV(Unable to allocate+register char device %s,
   MYDRVNAME);
-   RETINT(-1);
+   goto Away;
}
Registered = TRUE;
INFODRV(New major number %d registered\n, MAJOR(MajorDev));
@@ -79,19 +79,18 @@ visorchipset_file_init(dev_t majorDev, VISORCHANNEL 
**pControlVm_channel)
/* static major device number registration required */
if (register_chrdev_region(MajorDev, 1, MYDRVNAME)  0) {
ERRDRV(Unable to register char device %s, MYDRVNAME);
-   RETINT(-1);
+   goto Away;
}
Registered = TRUE;
INFODRV(Static major number %d registered\n, MAJOR(MajorDev

[PATCH 2/8] Staging: unisys: Cleanup macros to get rid of goto statements

2014-03-19 Thread Ken Cox
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 j...@redhat.com
---
 drivers/staging/unisys/include/timskmod.h  | 83 --
 .../unisys/visorchipset/visorchipset_main.c| 27 ---
 2 files changed, 18 insertions(+), 92 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h 
b/drivers/staging/unisys/include/timskmod.h
index c4262ab..413a367 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -155,44 +155,10 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data 
*/
POSTCODE_LINUX_2(EVENT_PC, DIAG_SEVERITY_ERR);  \
RETINT(status); \
} while (0)
-#define FAIL_WPOSTCODE_2(msg, status, EVENT_PC, pcval32bit) do {  \
-   ERRDRV('%s'   \
-  : error (status=%d)\n, \
-  msg, status);\
-   POSTCODE_LINUX_3(EVENT_PC, pcval32bit, DIAG_SEVERITY_ERR); \
-   RETINT(status); \
-   } while (0)
-#define FAIL_WPOSTCODE_3(msg, status, EVENT_PC, pcval16bit1, pcval16bit2) \
-   do {\
-   ERRDRV('%s'   \
-  : error (status=%d)\n, \
-  msg, status);\
-   POSTCODE_LINUX_4(EVENT_PC, pcval16bit1, pcval16bit2,\
-DIAG_SEVERITY_ERR);\
-   RETINT(status); \
-   } while (0)
 /** Try to evaulate the provided expression, and do a RETINT(x) iff
  *  the expression evaluates to  0.
  *  @param x the expression to try
  */
-#define TRY(x) do { int status = (x);  \
-   if (status  0)\
-   FAIL(__stringify(x), status);  \
-   } while (0)
-
-#define TRY_WPOSTCODE_1(x, EVENT_PC) do { \
-   int status = (x); \
-   if (status  0) \
-   FAIL_WPOSTCODE_1(__stringify(x), status, EVENT_PC); \
-   } while (0)
-
-#define TRY_WPOSTCODE_2(x, EVENT_PC, pcval32bit) do { \
-   int status = (x); \
-   if (status  0) \
-   FAIL_WPOSTCODE_2(__stringify(x), status, EVENT_PC, \
-pcval32bit);   \
-   } while (0)
-
 #define ASSERT(cond)   \
do { if (!(cond))  \
HUHDRV(ASSERT failed - %s,   \
@@ -237,19 +203,6 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data */
 
 /* @} */
 
-/** Used to add a single line to the /proc filesystem buffer */
-#define ADDPROCLINE(buf, bufsize, line, linelen, totallen) \
-   {  \
-   if ((totallen) + (linelen) = bufsize) \
-   RETINT(totallen);  \
-   if (linelen  0) { \
-   strcat(buf, line); \
-   totallen += linelen;   \
-   }  \
-   }
-
-
-
 /** Verifies the consistency of your PRIVATEDEVICEDATA structure using
  *  conventional signature fields:
  *  p
@@ -272,42 +225,6 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data */
 ((fd)-sig1 == sizeof(PRIVATEFILEDATA)) \
 ((fd)-sig2 == fd))
 
-/** Verifies the consistency of a PRIVATEDEVICEDATA structure and reacts
- *  if necessary
- */
-#define CHKDDX(dd, x) (   \
-   if (!DDLOOKSVALID((dd))) { \
-   PRINTKDRV(bad device structure);  \
-   RETINT(x);  \
-   })
-
-/** Verifies the consistency of a PRIVATEDEVICEDATA structure and reacts
- *  if necessary
- */
-#define CHKDD(dd) (\
-   if (!DDLOOKSVALID(dd

[PATCH 5/8] Staging: unisys: Remove RETPTR macro

2014-03-19 Thread Ken Cox
The RETPTR macro contained a goto statement which is not allowed in
the kernel.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/include/timskmod.h  |  4 ---
 drivers/staging/unisys/uislib/uislib.c | 11 ---
 drivers/staging/unisys/uislib/uisqueue.c   |  1 -
 .../unisys/visorchannel/visorchannel_funcs.c   |  3 +-
 drivers/staging/unisys/visorchipset/parser.c   | 36 ++
 .../staging/unisys/visorutil/memregion_direct.c|  9 +++---
 drivers/staging/unisys/visorutil/procobjecttree.c  | 22 -
 drivers/staging/unisys/visorutil/visorkmodutils.c  |  8 +++--
 8 files changed, 55 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h 
b/drivers/staging/unisys/include/timskmod.h
index 0623f55..41cbcde 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -128,10 +128,6 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data */
  *  @param x the value to return
  */
 #define RETINT(x)  do { rc = (x); RETTRACE(x); goto Away; } while (0)
-/** return from a void* function, using a common exit point Away
- *  @param x the value to return
- */
-#define RETPTR(x)  do { rc = (x); RETTRACE(x); goto Away; } while (0)
 /** Given a typedef/struct/union and a member field name,
  *  return the number of bytes occupied by that field.
  *  @param TYPE the typedef name, or struct xx or union xx
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 1737f3a..4f8a808 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -270,24 +270,27 @@ init_vbus_channel(U64 channelAddr, U32 channelBytes, int 
isServer)
LOGERR(CONTROLVM_BUS_CREATE error: ioremap_cache of 
channelAddr:%Lx for channelBytes:%llu failed,
 (unsigned long long) channelAddr,
 (unsigned long long) channelBytes);
-   RETPTR(NULL);
+   rc = NULL;
+   goto Away;
}
if (isServer) {
memset_io(pChan, 0, channelBytes);
if (!ULTRA_VBUS_CHANNEL_OK_SERVER(channelBytes, NULL)) {
ERRDRV(%s channel cannot be used, __func__);
uislib_iounmap(pChan);
-   RETPTR(NULL);
+   rc = NULL;
+   goto Away;
}
ULTRA_VBUS_init_channel(pChan, channelBytes);
} else {
if (!ULTRA_VBUS_CHANNEL_OK_CLIENT(pChan, NULL)) {
ERRDRV(%s channel cannot be used, __func__);
uislib_iounmap(pChan);
-   RETPTR(NULL);
+   rc = NULL;
+   goto Away;
}
}
-   RETPTR(pChan);
+   rc = pChan;
 Away:
return rc;
 }
diff --git a/drivers/staging/unisys/uislib/uisqueue.c 
b/drivers/staging/unisys/uislib/uisqueue.c
index 7ea306e..7bd05f7 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -30,7 +30,6 @@
 
 #define RETVOIDdo { goto Away; } while (0)
 #define RETINT(x)  do { rc = (x); goto Away; } while (0)
-#define RETPTR(x)  do { rc = (x); goto Away; } while (0)
 
 #define CHECK_CACHE_ALIGN 0
 
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c 
b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index ff4556b..99889fd 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -89,8 +89,7 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong 
channelBytes,
p-size = channelBytes;
p-guid = guid;
 
-   RETPTR(p);
-
+   rc = p;
 Away:
 
if (rc == NULL) {
diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index de0a4c2..6904dcc 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -63,7 +63,8 @@ parser_init_guts(U64 addr, U32 bytes, BOOL isLocal,
   MAX_CONTROLVM_PAYLOAD_BYTES);
if (tryAgain)
*tryAgain = TRUE;
-   RETPTR(NULL);
+   rc = NULL;
+   goto Away;
}
ctx = kzalloc(allocbytes, GFP_KERNEL|__GFP_NORETRY);
if (ctx == NULL) {
@@ -71,7 +72,8 @@ parser_init_guts(U64 addr, U32 bytes, BOOL isLocal,
   __func__, __FILE__, __LINE__, allocbytes);
if (tryAgain)
*tryAgain = TRUE;
-   RETPTR(NULL);
+   rc = NULL;
+   goto Away;
}
 
ctx-allocbytes = allocbytes;
@@ -85,45 +87,53 @@ parser_init_guts(U64 addr, U32 bytes, BOOL isLocal,
ERRDRV(%s - bad local address (0x%-16.16Lx for %lu

[PATCH 3/8] Staging: unisys: Remove FAIL_WPOSTCODE_1 macro

2014-03-19 Thread Ken Cox
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 j...@redhat.com
---
 drivers/staging/unisys/include/timskmod.h  |  7 ---
 .../unisys/visorchipset/visorchipset_main.c| 50 ++
 2 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h 
b/drivers/staging/unisys/include/timskmod.h
index 413a367..6abb32e 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -148,13 +148,6 @@ typedef long VMMIO32;/** #VMMIO pointing to 32-bit data */
   msg, status);  \
RETINT(status);   \
} while (0)
-#define FAIL_WPOSTCODE_1(msg, status, EVENT_PC) do {  \
-   ERRDRV('%s' \
-  : error (status=%d)\n,   \
-  msg, status);\
-   POSTCODE_LINUX_2(EVENT_PC, DIAG_SEVERITY_ERR);  \
-   RETINT(status); \
-   } while (0)
 /** Try to evaulate the provided expression, and do a RETINT(x) iff
  *  the expression evaluates to  0.
  *  @param x the expression to try
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index b0f97db..b769257 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -2695,9 +2695,11 @@ visorchipset_init(void)
controlvm_init();
MajorDev = MKDEV(visorchipset_major, 0);
rc = visorchipset_file_init(MajorDev, ControlVm_channel);
-   if (rc  0)
-   FAIL_WPOSTCODE_1(visorchipset_file_init(MajorDev, 
ControlVm_channel),
-rc, CHIPSET_INIT_FAILURE_PC);
+   if (rc  0) {
+   ERRDRV(visorchipset_file_init(MajorDev, ControlVm_channel): 
error (status=%d)\n, rc);
+   POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
+   goto Away;
+   }
 
proc_Init();
memset(PartitionPropertyNames, 0, sizeof(PartitionPropertyNames));
@@ -2738,16 +2740,20 @@ visorchipset_init(void)
memset(g_DelDumpMsgHdr, 0, sizeof(CONTROLVM_MESSAGE_HEADER));
 
if (filexfer_constructor(sizeof(struct putfile_request))  0) {
-   FAIL_WPOSTCODE_1(filexfer_constructor failed, -1,
-CHIPSET_INIT_FAILURE_PC);
+   ERRDRV(filexfer_constructor failed: (status=-1)\n);
+   POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
+   rc = -1;
+   goto Away;
}
Putfile_buffer_list_pool =
kmem_cache_create(Putfile_buffer_list_pool_name,
  sizeof(struct putfile_buffer_entry),
  0, SLAB_HWCACHE_ALIGN, NULL);
if (!Putfile_buffer_list_pool) {
-   FAIL_WPOSTCODE_1(failed to alloc Putfile_buffer_list_pool, -1,
-CHIPSET_INIT_FAILURE_PC);
+   ERRDRV(failed to alloc Putfile_buffer_list_pool: 
(status=-1)\n);
+   POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
+   rc = -1;
+   goto Away;
}
if (visorchipset_disable_controlvm) {
LOGINF(visorchipset_init:controlvm disabled);
@@ -2762,24 +2768,34 @@ visorchipset_init(void)
Periodic_controlvm_workqueue =
create_singlethread_workqueue(visorchipset_controlvm);
 
-   if (Periodic_controlvm_workqueue == NULL)
-   FAIL_WPOSTCODE_1(cannot create controlvm workqueue,
--ENOMEM, CREATE_WORKQUEUE_FAILED_PC);
+   if (Periodic_controlvm_workqueue == NULL) {
+   ERRDRV(cannot create controlvm workqueue: 
(status=%d)\n,
+  -ENOMEM);
+   POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
+DIAG_SEVERITY_ERR);
+   rc = -ENOMEM;
+   goto Away;
+   }
Most_recent_message_jiffies = jiffies;
Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
rc = queue_delayed_work(Periodic_controlvm_workqueue,
Periodic_controlvm_work, Poll_jiffies);
-   if (rc  0)
-   
FAIL_WPOSTCODE_1(queue_delayed_work(Periodic_controlvm_workqueue, 
Periodic_controlvm_work, Poll_jiffies

Re: [PATCH] staging: unisys: use kzalloc instead of kmalloc/memset 0

2014-03-18 Thread Ken Cox


On 03/17/2014 07:26 PM, DaeSeok Youn wrote:

I think vmalloc/kmalloc in uislib_malloc() can be removed and just use
vmalloc/kmalloc directly.
(UISMALLOC() macro is also removed.)
And uislib_malloc() is renamed to uislib_trace_buffer_status() which
is just tracing buffer status(Malloc_FailuresAlloc, Malloc_BytesInUse
...) for info_proc_read_helper().

If this change is accepted, it also need to change uislib_free().

Is it fine to change like this?

This change is fine with me.  It makes the logic easier to follow.


Thanks.
Daeseok Youn.

2014-03-18 6:41 GMT+09:00 Greg KH gre...@linuxfoundation.org:

On Wed, Mar 12, 2014 at 07:37:50PM +0900, Daeseok Youn wrote:

Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
---
  drivers/staging/unisys/uislib/uislib.c   |5 +
  drivers/staging/unisys/uislib/uisutils.c |2 +-
  2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index d77df9a..9748fcb 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -339,8 +339,6 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
   return CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
   }

- memset(bus, 0, size);
-
   /* Currently by default, the bus Number is the GuestHandle.
* Configure Bus message can override this.
*/
@@ -530,7 +528,6 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
   return CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
   }

- memset(dev, 0, sizeof(struct device_info));
   dev-channelTypeGuid = msg-cmd.createDevice.dataTypeGuid;
   dev-intr = msg-cmd.createDevice.intr;
   dev-channelAddr = msg-cmd.createDevice.channelAddr;
@@ -1437,7 +1434,7 @@ uislib_malloc(size_t siz, gfp_t gfp, U8 contiguous, char 
*fn, int ln)
   * get memory for you (like, invoke oom killer), which
   * will probably cripple the system.
   */
- p = kmalloc(siz, gfp | __GFP_NORETRY);
+ p = kzalloc(siz, gfp | __GFP_NORETRY);
   }
   if (p == NULL) {
   LOGERR(uislib_malloc failed to alloc %d bytes @%s:%d,
diff --git a/drivers/staging/unisys/uislib/uisutils.c 
b/drivers/staging/unisys/uislib/uisutils.c
index 208b7ea..2f05be1 100644
--- a/drivers/staging/unisys/uislib/uisutils.c
+++ b/drivers/staging/unisys/uislib/uisutils.c
@@ -294,7 +294,7 @@ ReqHandlerAdd(GUID switchTypeGuid,
   rc = UISMALLOC(sizeof(*rc), GFP_ATOMIC);
   if (!rc)
   return NULL;
- memset(rc, 0, sizeof(*rc));
+
   rc-switchTypeGuid = switchTypeGuid;
   rc-controlfunc = controlfunc;
   rc-min_channel_bytes = min_channel_bytes;

Can you just remove the UISMALLOC() macro completly, so that it's easier
to verify that changes like this are actually correct?

thanks,

greg k-h


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/6] Staging: unisys: channels: Cleanup sparse warnings

2014-03-18 Thread Ken Cox


On 03/17/2014 04:43 PM, Mark Einon wrote:

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 at redhat.com


snip

diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h

index ae46bed..ef12af4 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -23,6 +23,7 @@
 #ifdef __KERNEL__
 #include linux/types.h
 #include linux/version.h
+#include linux/io.h
 #else
 #include stdint.h
 #include syslog.h
@@ -72,6 +73,7 @@ typedef U64 GUEST_PHYSICAL_ADDRESS;

 #define MEMSET(ptr, val, len) memset(ptr, val, len)
 #define MEMCMP(m1, m2, len) memcmp(m1, m2, len)
+#define MEMCMP_IO(m1, m2, len) memcmp((void __force *)m1, m2, len)
 #define STRLEN(s) ((UINTN)strlen((const char *)s))
 #define STRCPY(d, s) (strcpy((char *)d, (const char *)s))

@@ -81,6 +83,8 @@ typedef U64 GUEST_PHYSICAL_ADDRESS;
 #ifdef __KERNEL__
 #define MEMORYBARRIER mb()
 #define MEMCPY(dest, src, len) memcpy(dest, src, len)
+#define MEMCPY_TOIO(dest, src, len) memcpy_toio(dest, src, len)
+#define MEMCPY_FROMIO(dest, src, len) memcpy_fromio(dest, src, len)


We know we're in the kernel, so there's no need for this #ifdef - also 
why not get rid of the define altogether, and use the memcpy_toio() 
function call direct? ...similarly for the other defines here.

Agreed.  I'll make that change in an upcoming patch.


Cheers,

Mark



 #define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, 
actual, fil, \

   lin, logCtx)\
--




___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 6/6] Staging: unisys: visorutil: Clean up sparse warnings in visorutil code

2014-03-17 Thread Ken Cox


On 03/16/2014 05:13 PM, Mark Einon wrote:

On 13/03/14 20:39, Ken Cox wrote:

Clean up code to get rid of sparse warnings.

Also fixed variable length arrays declared on the stack.

Signed-off-by: Ken Cox j...@redhat.com
---
  drivers/staging/unisys/visorutil/procobjecttree.c | 2 +-
  drivers/staging/unisys/visorutil/visorkmodutils.c | 6 ++
  2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorutil/procobjecttree.c 
b/drivers/staging/unisys/visorutil/procobjecttree.c

index e4d734e..7c7f001 100644
--- a/drivers/staging/unisys/visorutil/procobjecttree.c
+++ b/drivers/staging/unisys/visorutil/procobjecttree.c
@@ -150,7 +150,7 @@ MYPROCTYPE *visor_proc_CreateType(struct 
proc_dir_entry *procDirRoot,

  type-nNames = 0;
  type-show_property = show_property;
  type-procDirRoot = procDirRoot;
-if (type-propertyNames != 0)
+if (type-propertyNames != NULL)
  while (type-propertyNames[type-nProperties] != NULL)
  type-nProperties++;
  while (type-name[type-nNames] != NULL)
diff --git a/drivers/staging/unisys/visorutil/visorkmodutils.c 
b/drivers/staging/unisys/visorutil/visorkmodutils.c

index ed46208..f66acd9 100644
--- a/drivers/staging/unisys/visorutil/visorkmodutils.c
+++ b/drivers/staging/unisys/visorutil/visorkmodutils.c
@@ -20,8 +20,6 @@

  #define MYDRVNAME timskmodutils

-BOOL Debug_Malloc_Enabled = FALSE;
-
  /** Print the hexadecimal contents of a data buffer to a supplied 
print buffer.
   *  @param dest   the print buffer where text 
characters will

   *  be written
@@ -42,8 +40,8 @@ int visor_hexDumpToBuffer(char *dest, int destSize, 
char *prefix, char *src,

  {
  int i = 0;
  int pos = 0;
-char printable[bytesToDumpPerLine + 1];
-char hex[(bytesToDumpPerLine * 3) + 1];
+char printable[24];
+char hex[64];


Hi,

This isn't a good fix - this introduces a bug as later in this function,
'printable' and 'hex' are memset and assigned using the 
bytesToDumpPerLine parameter.
I'll get rid of this function altogether and just use 
hex_dump_to_buffer().  Revised patch coming soon.


Cheers,

Mark




  char *line = NULL;
  int linesize = 1000;
  int linelen = 0;





___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Patch V2 6/6] Staging: unisys: visorutil: Clean up sparse warnings in visorutil code

2014-03-17 Thread Ken Cox
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 j...@redhat.com
---
 drivers/staging/unisys/include/timskmodutils.h | 22 --
 .../unisys/visorchannel/visorchannel_funcs.c   | 15 ++--
 drivers/staging/unisys/visorutil/procobjecttree.c  |  2 +-
 drivers/staging/unisys/visorutil/visorkmodutils.c  | 87 --
 4 files changed, 11 insertions(+), 115 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmodutils.h 
b/drivers/staging/unisys/include/timskmodutils.h
index ea0ec49..2d81d46 100644
--- a/drivers/staging/unisys/include/timskmodutils.h
+++ b/drivers/staging/unisys/include/timskmodutils.h
@@ -24,28 +24,6 @@ void *kmalloc_kernel(size_t siz);
 void  myprintk(const char *myDrvName, const char *devname,
const char *template, ...);
 
-/** Print the hexadecimal contents of a data buffer to a supplied print buffer.
- *  @param dest   the print buffer where text characters will be
- *written
- *  @param destSize   the maximum number of bytes that can be written
- *to #dest
- *  @param srcthe buffer that contains the data that is to be
- *hex-dumped
- *  @param srcLen the number of bytes at #src to be hex-dumped
- *  @param bytesToDumpPerLine output will be formatted such that at most this
- *many of the input data bytes will be represented
- *on each line of output
- *  @return   the number of text characters written to #dest
- *(not including the trailing '\0' byte)
- *  @ingroup internal
- */
-int   visor_hexDumpToBuffer(char *dest,
-   int destSize,
-   char *prefix,
-   char *src,
-   int srcLen,
-   int bytesToDumpPerLine);
-
 /**
  *---  GENERAL MESSAGEQ STUFF  ---*
  **/
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c 
b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index 611be77..f397d83 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -603,9 +603,9 @@ void
 visorchannel_dump_section(VISORCHANNEL *chan, char *s,
  int off, int len, struct seq_file *seq)
 {
-   char *buf = NULL, *fmtbuf = NULL;
+   char *buf, *tbuf, *fmtbuf;
int fmtbufsize = 0;
-   int i = 0;
+   int i;
int errcode = 0;
 
fmtbufsize = 100 * COVQ(len, 16);
@@ -621,9 +621,14 @@ visorchannel_dump_section(VISORCHANNEL *chan, char *s,
goto Away;
}
seq_printf(seq, channel %s:\n, s);
-   visor_hexDumpToBuffer(fmtbuf, fmtbufsize,   , buf, len, 16);
-   for (i = 0; fmtbuf[i] != '\0'; i++)
-   seq_printf(seq, %c, fmtbuf[i]);
+   tbuf = buf;
+   while (len  0) {
+   i = (len  16) ? len : 16;
+   hex_dump_to_buffer(tbuf, i, 16, 1, fmtbuf, fmtbufsize, TRUE);
+   seq_printf(seq, %s\n, fmtbuf);
+   tbuf += 16;
+   len -= 16;
+   }
 
 Away:
if (buf != NULL) {
diff --git a/drivers/staging/unisys/visorutil/procobjecttree.c 
b/drivers/staging/unisys/visorutil/procobjecttree.c
index e4d734e..7c7f001 100644
--- a/drivers/staging/unisys/visorutil/procobjecttree.c
+++ b/drivers/staging/unisys/visorutil/procobjecttree.c
@@ -150,7 +150,7 @@ MYPROCTYPE *visor_proc_CreateType(struct proc_dir_entry 
*procDirRoot,
type-nNames = 0;
type-show_property = show_property;
type-procDirRoot = procDirRoot;
-   if (type-propertyNames != 0)
+   if (type-propertyNames != NULL)
while (type-propertyNames[type-nProperties] != NULL)
type-nProperties++;
while (type-name[type-nNames] != NULL)
diff --git a/drivers/staging/unisys/visorutil/visorkmodutils.c 
b/drivers/staging/unisys/visorutil/visorkmodutils.c
index ed46208..ef06469 100644
--- a/drivers/staging/unisys/visorutil/visorkmodutils.c
+++ b/drivers/staging/unisys/visorutil/visorkmodutils.c
@@ -20,93 +20,6 @@
 
 #define MYDRVNAME timskmodutils
 
-BOOL Debug_Malloc_Enabled = FALSE;
-
-/** Print the hexadecimal contents of a data buffer to a supplied print buffer.
- *  @param dest   the print buffer where text characters will
- *   be written
- *  @param destSize   the maximum number of bytes that can be written
- *   to #dest
- *  @param srcthe buffer that contains the data that is to be
- *   hex-dumped
- *  @param srcLen

[PATCH 3/6] Staging: unisys: uislib: Cleanup sparse warnings in uislib

2014-03-13 Thread Ken Cox
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 j...@redhat.com
---
 drivers/staging/unisys/include/uisqueue.h | 56 +++
 drivers/staging/unisys/include/uisutils.h |  8 ++---
 drivers/staging/unisys/uislib/uisqueue.c  | 12 +++
 3 files changed, 22 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/unisys/include/uisqueue.h 
b/drivers/staging/unisys/include/uisqueue.h
index a9d95d3..6dab390 100644
--- a/drivers/staging/unisys/include/uisqueue.h
+++ b/drivers/staging/unisys/include/uisqueue.h
@@ -34,7 +34,7 @@
 
 struct uisqueue_info {
 
-   pCHANNEL_HEADER chan;
+   CHANNEL_HEADER __iomem *chan;
/* channel containing queues in which scsi commands 
 * responses are queued
 */
@@ -75,9 +75,9 @@ struct uisqueue_info {
.previous\n   \
661:\n\tlock; 
 
-unsigned long long uisqueue_InterlockedOr(volatile unsigned long long *Target,
+unsigned long long uisqueue_InterlockedOr(unsigned long long __iomem *Target,
  unsigned long long Set);
-unsigned long long uisqueue_InterlockedAnd(volatile unsigned long long *Target,
+unsigned long long uisqueue_InterlockedAnd(unsigned long long __iomem *Target,
   unsigned long long Set);
 
 unsigned int uisqueue_send_int_if_needed(struct uisqueue_info *pqueueinfo,
@@ -133,7 +133,7 @@ struct extport_info {
 };
 
 struct device_info {
-   void *chanptr;
+   void __iomem *chanptr;
U64 channelAddr;
U64 channelBytes;
GUID channelTypeGuid;
@@ -164,7 +164,7 @@ struct bus_info {
struct device_info **device;
U64 guestHandle, recvBusInterruptHandle;
GUID busInstGuid;
-   ULTRA_VBUS_CHANNEL_PROTOCOL *pBusChannel;
+   ULTRA_VBUS_CHANNEL_PROTOCOL __iomem *pBusChannel;
int busChannelBytes;
struct proc_dir_entry *proc_dir;/* proc/uislib/vbus/x */
struct proc_dir_entry *proc_info;   /* proc/uislib/vbus/x/info */
@@ -352,8 +352,8 @@ typedef enum {
 } GUESTPART_MSG_TYPE;
 
 struct add_vbus_guestpart {
-   void *chanptr;  /* pointer to data channel for bus -
-* NOT YET USED */
+   void __iomem *chanptr;  /* pointer to data channel for bus -
+* NOT YET USED */
U32 busNo;  /* bus number to be created/deleted */
U32 deviceCount;/* max num of devices on bus */
GUID busTypeGuid;   /* indicates type of bus */
@@ -368,7 +368,7 @@ struct del_vbus_guestpart {
 };
 
 struct add_virt_guestpart {
-   void *chanptr;  /* pointer to data channel */
+   void __iomem *chanptr;  /* pointer to data channel */
U32 busNo;  /* bus number for the operation */
U32 deviceNo;   /* number of device on the bus */
GUID devInstGuid;   /* instance guid for device */
@@ -382,15 +382,15 @@ struct add_virt_guestpart {
 };
 
 struct pause_virt_guestpart {
-   void *chanptr;  /* pointer to data channel */
+   void __iomem *chanptr;  /* pointer to data channel */
 };
 
 struct resume_virt_guestpart {
-   void *chanptr;  /* pointer to data channel */
+   void __iomem *chanptr;  /* pointer to data channel */
 };
 
 struct del_virt_guestpart {
-   void *chanptr;  /* pointer to data channel */
+   void __iomem *chanptr;  /* pointer to data channel */
 };
 
 struct init_chipset_guestpart {
@@ -435,38 +435,6 @@ struct guest_msgs {
 *  guests.
 */
 
-static inline unsigned long
-uislibcmpxchg64(volatile void *ptr, unsigned long old, unsigned long new,
-   int size)
-{
-   unsigned long prev;
-   switch (size) {
-   case 1:
- __asm__ __volatile__(UISLIB_LOCK_PREFIX cmpxchgb 
%b1,%2:=a(prev)
- :  q(new), m(*__xg(ptr)),
-0(old)
- :  memory);
-   return prev;
-   case 2:
- __asm__ __volatile__(UISLIB_LOCK_PREFIX cmpxchgw 
%w1,%2:=a(prev)
- :  r(new), m(*__xg(ptr)),
-0(old)
- :  memory);
-   return prev;
-   case 4:
- __asm__ __volatile__(UISLIB_LOCK_PREFIX cmpxchgl 
%k1,%2:=a(prev)
- :  r(new), m(*__xg(ptr)),
-0(old)
- :  memory);
-   return prev;
-   case 8:
- __asm__ __volatile__(UISLIB_LOCK_PREFIX cmpxchgq 
%1,%2:=a(prev)
- :  r(new), m(*__xg(ptr)),
-0(old)
- :  memory);
-   return prev

[patch 0/6] Staging: unisys: Clean sparse warnings in unisys driver code

2014-03-13 Thread Ken Cox
This series cleans up many sparse warnings in the unisys driver code.  There are
still some sparse warnings that will be cleaned up in a future patch, but
the majority of the warnings are addressed by these patches.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/6] Staging: unisys: visorchannel: Clean up sparse warnings in visorchannel code

2014-03-13 Thread Ken Cox
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 j...@redhat.com
---
 drivers/staging/unisys/visorchannel/visorchannel.h |   2 +-
 .../unisys/visorchannel/visorchannel_funcs.c   | 136 -
 2 files changed, 1 insertion(+), 137 deletions(-)

diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h 
b/drivers/staging/unisys/visorchannel/visorchannel.h
index 4546686..62d29a2 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel.h
+++ b/drivers/staging/unisys/visorchannel/visorchannel.h
@@ -92,7 +92,7 @@ void *visorchannel_get_header(VISORCHANNEL *channel);
do {\
U8 *p = (U8 *)visorchannel_get_header(chan);\
if (p) {\
-   ULTRA_CHANNEL_CLIENT_TRANSITION(p, chanId, CliStateOS, \
+   ULTRA_CHANNEL_CLIENT_TRANSITION(p, chanId,  \
newstate, logCtx); \
visorchannel_write  \
(chan,  \
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c 
b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index 2695649..611be77 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -207,24 +207,6 @@ visorchannel_get_memregion(VISORCHANNEL *channel)
 }
 EXPORT_SYMBOL_GPL(visorchannel_get_memregion);
 
-pSIGNAL_QUEUE_HEADER
-visorchannel_get_safe_queue(VISORCHANNEL *pchannel, U32 queue)
-{
-   switch (queue) {
-   case 0:
-   return pchannel-safe_uis_queue.req_queue;
-   case 1:
-   return pchannel-safe_uis_queue.rsp_queue;
-   case 2:
-   return pchannel-safe_uis_queue.event_queue;
-   case 3:
-   return pchannel-safe_uis_queue.ack_queue;
-   default:
-   ERRDRV(Invalid queue value %d\n, queue);
-   return NULL;
-   }
-}  /* end visorchannel_get_safe_queue */
-
 int
 visorchannel_read(VISORCHANNEL *channel, ulong offset,
  void *local, ulong nbytes)
@@ -435,60 +417,6 @@ Away:
 EXPORT_SYMBOL_GPL(visorchannel_signalremove);
 
 BOOL
-visorchannel_safesignalremove(VISORCHANNEL *channel, U32 queue, void *msg)
-{
-   BOOL rc = FALSE;
-   SIGNAL_QUEUE_HEADER *psafe_sqh, unsafe_sqh;
-   int stat;
-
-   if (channel-needs_lock)
-   spin_lock(channel-remove_lock);
-
-   if (!sig_read_header(channel, queue, unsafe_sqh))
-   RETBOOL(FALSE);
-
-   psafe_sqh = visorchannel_get_safe_queue(channel, queue);
-   if (psafe_sqh == NULL) {
-   ERRDRV(safesignalremove: get_safe_queue failed\n);
-   RETBOOL(FALSE);
-   }
-
-   stat =
-   safe_sig_queue_validate(psafe_sqh, unsafe_sqh, unsafe_sqh.Head,
-   unsafe_sqh.Tail);
-   if (stat == 0) {
-   ERRDRV(safe_signal_remove: safe_sig_queue_validate failed, 
queue = %d,
-queue);
-   RETBOOL(FALSE);
-   }
-
-   if (unsafe_sqh.Head == unsafe_sqh.Tail)
-   RETBOOL(FALSE); /* no signals to remove */
-   unsafe_sqh.Tail = (unsafe_sqh.Tail + 1) % psafe_sqh-MaxSignalSlots;
-   if (!sig_read_data(channel, queue, psafe_sqh, unsafe_sqh.Tail, msg))
-   FAIL(sig_read_data failed, FALSE);
-   unsafe_sqh.NumSignalsReceived++;
-
-   /* For each data field in SIGNAL_QUEUE_HEADER that was modified,
-* update host memory.
-*/
-   MEMORYBARRIER;
-   if (!SIG_WRITE_FIELD(channel, queue, unsafe_sqh, Tail))
-   FAIL(visor_memregion_write of Tail failed, FALSE);
-   if (!SIG_WRITE_FIELD(channel, queue, unsafe_sqh, NumSignalsReceived))
-   FAIL(visor_memregion_write of NumSignalsReceived failed,
-FALSE);
-
-   RETBOOL(TRUE);
-
-Away:
-   if (channel-needs_lock)
-   spin_unlock(channel-remove_lock);
-
-   return rc;
-}  /* end visorchannel_safesignalremove */
-
-BOOL
 visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
 {
BOOL rc = FALSE;
@@ -566,70 +494,6 @@ visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, 
U32 queue)
 }
 EXPORT_SYMBOL_GPL(visorchannel_signalqueue_max_slots);
 
-BOOL
-visorchannel_safesignalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
-{
-   BOOL rc = FALSE;
-   SIGNAL_QUEUE_HEADER *psafe_sqh, unsafe_sqh;
-   int stat;
-
-   if (channel-needs_lock

[PATCH 1/6] Staging: unisys: channels: Cleanup sparse warnings

2014-03-13 Thread Ken Cox
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 j...@redhat.com
---
 drivers/staging/unisys/channels/channel.c| 166 +++
 drivers/staging/unisys/channels/chanstub.c   |   8 +-
 drivers/staging/unisys/channels/chanstub.h   |   4 +-
 drivers/staging/unisys/include/commontypes.h |   4 +
 4 files changed, 49 insertions(+), 133 deletions(-)

diff --git a/drivers/staging/unisys/channels/channel.c 
b/drivers/staging/unisys/channels/channel.c
index 39ffe52..f645259 100644
--- a/drivers/staging/unisys/channels/channel.c
+++ b/drivers/staging/unisys/channels/channel.c
@@ -44,38 +44,41 @@
  * 1 if the insertion succeeds, 0 if the queue was full.
  */
 unsigned char
-visor_signal_insert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
+visor_signal_insert(CHANNEL_HEADER __iomem *pChannel, U32 Queue, void *pSignal)
 {
-   void *psignal;
-   unsigned int head, tail;
-   pSIGNAL_QUEUE_HEADER pqhdr =
-   (pSIGNAL_QUEUE_HEADER) ((char *) pChannel +
-   pChannel-oChannelSpace) + Queue;
+   void __iomem *psignal;
+   unsigned int head, tail, nof;
+
+   SIGNAL_QUEUE_HEADER __iomem *pqhdr =
+   (SIGNAL_QUEUE_HEADER __iomem *)
+   ((char __iomem *) pChannel + readq(pChannel-oChannelSpace))
+   + Queue;
 
/* capture current head and tail */
-   head = pqhdr-Head;
-   tail = pqhdr-Tail;
+   head = readl(pqhdr-Head);
+   tail = readl(pqhdr-Tail);
 
/* queue is full if (head + 1) % n equals tail */
-   if (((head + 1) % pqhdr-MaxSignalSlots) == tail) {
-   pqhdr-NumOverflows++;
+   if (((head + 1) % readl(pqhdr-MaxSignalSlots)) == tail) {
+   nof = readq(pqhdr-NumOverflows) + 1;
+   writeq(nof, pqhdr-NumOverflows);
return 0;
}
 
/* increment the head index */
-   head = (head + 1) % pqhdr-MaxSignalSlots;
+   head = (head + 1) % readl(pqhdr-MaxSignalSlots);
 
/* copy signal to the head location from the area pointed to
 * by pSignal
 */
-   psignal =
-   (char *) pqhdr + pqhdr-oSignalBase + (head * pqhdr-SignalSize);
-   MEMCPY(psignal, pSignal, pqhdr-SignalSize);
+   psignal = (char __iomem *)pqhdr + readq(pqhdr-oSignalBase) +
+   (head * readl(pqhdr-SignalSize));
+   MEMCPY_TOIO(psignal, pSignal, readl(pqhdr-SignalSize));
 
VolatileBarrier();
-   pqhdr-Head = head;
+   writel(head, pqhdr-Head);
 
-   pqhdr-NumSignalsSent++;
+   writeq(readq(pqhdr-NumSignalsSent) + 1, pqhdr-NumSignalsSent);
return 1;
 }
 EXPORT_SYMBOL_GPL(visor_signal_insert);
@@ -99,36 +102,37 @@ EXPORT_SYMBOL_GPL(visor_signal_insert);
  * 1 if the removal succeeds, 0 if the queue was empty.
  */
 unsigned char
-visor_signal_remove(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
+visor_signal_remove(CHANNEL_HEADER __iomem *pChannel, U32 Queue, void *pSignal)
 {
-   void *psource;
+   void __iomem *psource;
unsigned int head, tail;
-   pSIGNAL_QUEUE_HEADER pqhdr =
-   (pSIGNAL_QUEUE_HEADER) ((char *) pChannel +
-   pChannel-oChannelSpace) + Queue;
+   SIGNAL_QUEUE_HEADER __iomem *pqhdr =
+   (SIGNAL_QUEUE_HEADER __iomem *) ((char __iomem *) pChannel +
+   readq(pChannel-oChannelSpace)) + Queue;
 
/* capture current head and tail */
-   head = pqhdr-Head;
-   tail = pqhdr-Tail;
+   head = readl(pqhdr-Head);
+   tail = readl(pqhdr-Tail);
 
/* queue is empty if the head index equals the tail index */
if (head == tail) {
-   pqhdr-NumEmptyCnt++;
+   writeq(readq(pqhdr-NumEmptyCnt) + 1, pqhdr-NumEmptyCnt);
return 0;
}
 
/* advance past the 'empty' front slot */
-   tail = (tail + 1) % pqhdr-MaxSignalSlots;
+   tail = (tail + 1) % readl(pqhdr-MaxSignalSlots);
 
/* copy signal from tail location to the area pointed to by pSignal */
-   psource =
-   (char *) pqhdr + pqhdr-oSignalBase + (tail * pqhdr-SignalSize);
-   MEMCPY(pSignal, psource, pqhdr-SignalSize);
+   psource = (char __iomem *) pqhdr + readq(pqhdr-oSignalBase) +
+   (tail * readl(pqhdr-SignalSize));
+   MEMCPY_FROMIO(pSignal, psource, readl(pqhdr-SignalSize));
 
VolatileBarrier();
-   pqhdr-Tail = tail;
+   writel(tail, pqhdr-Tail);
 
-   pqhdr-NumSignalsReceived++;
+   writeq(readq(pqhdr-NumSignalsReceived) + 1,
+  pqhdr-NumSignalsReceived);
return 1;
 }
 EXPORT_SYMBOL_GPL(visor_signal_remove);
@@ -194,59 +198,6 @@ SignalRemoveAll(pCHANNEL_HEADER pChannel, U32 Queue, void 
*pSignal)
 
 /*
  * Routine

[PATCH 2/6] Staging: unisys: Clean multiple sparse warnings

2014-03-13 Thread Ken Cox
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 j...@redhat.com
---
 .../unisys/common-spar/include/channels/channel.h  | 142 +++--
 .../common-spar/include/channels/iochannel.h   |   9 +-
 .../common-spar/include/channels/vbuschannel.h |  46 ---
 .../unisys/common-spar/include/vbusdeviceinfo.h|  22 ++--
 .../unisys/common-spar/include/vmcallinterface.h   |   2 +-
 drivers/staging/unisys/uislib/uislib.c | 115 -
 drivers/staging/unisys/virthba/virthba.c   |  62 -
 drivers/staging/unisys/virtpci/virtpci.c   |  54 +---
 8 files changed, 209 insertions(+), 243 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index 284ac68..aee2041 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -105,7 +105,7 @@ ULTRA_CHANNELCLI_STRING(U32 v)
 
 #define ULTRA_CHANNELSRV_IS_READY(x) ((x) == CHANNELSRV_READY)
 #define ULTRA_CHANNEL_SERVER_READY(pChannel) \
-   (ULTRA_CHANNELSRV_IS_READY((pChannel)-SrvState))
+   (ULTRA_CHANNELSRV_IS_READY(readl((pChannel)-SrvState)))
 
 #define ULTRA_VALID_CHANNELCLI_TRANSITION(o, n)
\
(o) == CHANNELCLI_DETACHED)  ((n) == CHANNELCLI_DISABLED)) || \
@@ -144,25 +144,30 @@ ULTRA_CHANNELCLI_STRING(U32 v)
  line);\
} while (0)
 
-#define ULTRA_CHANNEL_CLIENT_TRANSITION(pChan, chanId, field, \
+#define ULTRA_CHANNEL_CLIENT_TRANSITION(pChan, chanId, \
newstate, logCtx)   \
do {\
ULTRA_CHANNEL_CLIENT_CHK_TRANSITION(\
-   (((CHANNEL_HEADER *)(pChan))-field), newstate, \
+   readlCHANNEL_HEADER __iomem *) \
+(pChan))-CliStateOS)),\
+   newstate,   \
chanId, logCtx, __FILE__, __LINE__);\
UltraLogEvent(logCtx, CHANNELSTATE_DIAG_EVENTID_TRANSITOK, \
CHANNELSTATE_DIAG_SEVERITY, \
  CHANNELSTATE_DIAG_SUBSYS, \
  __func__, __LINE__,   \
  %s Channel StateTransition (%s) %s(%d)--%s(%d) 
@%s:%d\n, \
- chanId, #field,   \
- ULTRA_CHANNELCLI_STRING(((CHANNEL_HEADER *) \
-  (pChan))-field), \
- ((CHANNEL_HEADER *)(pChan))-field,   \
+ chanId, CliStateOS, \
+ ULTRA_CHANNELCLI_STRING( \
+ readl(((CHANNEL_HEADER __iomem *) \
+ (pChan))-CliStateOS)),   \
+ readl(((CHANNEL_HEADER __iomem *) \
+ (pChan))-CliStateOS),\
  ULTRA_CHANNELCLI_STRING(newstate),\
  newstate, \
  PathName_Last_N_Nodes(__FILE__, 4), __LINE__); \
-   ((CHANNEL_HEADER *)(pChan))-field = newstate;  \
+   writel(newstate, ((CHANNEL_HEADER __iomem *) \
+  (pChan))-CliStateOS);   \
MEMORYBARRIER;  \
} while (0)
 
@@ -314,7 +319,7 @@ typedef struct _SIGNAL_QUEUE_HEADER {
  * is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages.
  */
 static inline int
-ULTRA_check_channel_client(void *pChannel,
+ULTRA_check_channel_client(void __iomem *pChannel,
   GUID expectedTypeGuid,
   char *channelName,
   U64 expectedMinBytes,
@@ -324,43 +329,44 @@ ULTRA_check_channel_client(void *pChannel,
 {
if (MEMCMP(expectedTypeGuid, Guid0, sizeof(GUID)) != 0)
/* caller wants us to verify type GUID */
-   if (MEMCMPCHANNEL_HEADER *) (pChannel))-Type),
+   if (MEMCMP_IOCHANNEL_HEADER __iomem *) (pChannel))-Type),
   expectedTypeGuid, sizeof(GUID)) != 0) {
CHANNEL_GUID_MISMATCH

[PATCH 5/6] Staging: unisys: visorchipset: Clean up sparse warnings in visorchipset code.

2014-03-13 Thread Ken Cox
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 j...@redhat.com
---
 drivers/staging/unisys/visorchipset/controlvm_direct.c  |  1 +
 drivers/staging/unisys/visorchipset/file.c  |  1 +
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 16 
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/controlvm_direct.c 
b/drivers/staging/unisys/visorchipset/controlvm_direct.c
index 7fbc589..b911ea8 100644
--- a/drivers/staging/unisys/visorchipset/controlvm_direct.c
+++ b/drivers/staging/unisys/visorchipset/controlvm_direct.c
@@ -21,6 +21,7 @@
 
 #include globals.h
 #include uisutils.h
+#include controlvm.h
 #define CURRENT_FILE_PC VISOR_CHIPSET_PC_controlvm_direct_c
 
 
diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index b0d28a2..7e8bc98 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -24,6 +24,7 @@
 #include linux/mm.h
 #include linux/fs.h
 #include uisutils.h
+#include file.h
 
 #define CURRENT_FILE_PC VISOR_CHIPSET_PC_file_c
 
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 400cb03..b9c9dea 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -52,9 +52,9 @@
 * message, we switch back to fast polling mode.
 */
 #define MIN_IDLE_SECONDS 10
-ulong Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
-ulong Most_recent_message_jiffies; /* when we got our last
-* controlvm message */
+static ulong Poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
+static ulong Most_recent_message_jiffies;  /* when we got our last
+* controlvm message */
 static inline char *
 NONULLSTR(char *s)
 {
@@ -72,7 +72,7 @@ static U8 chipset_events[MAX_CHIPSET_EVENTS] = { 0, 0 };
 
 static struct delayed_work Periodic_controlvm_work;
 static struct workqueue_struct *Periodic_controlvm_workqueue;
-DEFINE_SEMAPHORE(NotifierLock);
+static DEFINE_SEMAPHORE(NotifierLock);
 
 typedef struct {
CONTROLVM_MESSAGE message;
@@ -215,7 +215,7 @@ static const struct file_operations proc_bootToTool_fops = {
 };
 
 typedef struct {
-   U8 *ptr;/* pointer to base address of payload pool */
+   U8 __iomem *ptr;/* pointer to base address of payload pool */
U64 offset; /* offset from beginning of controlvm
 * channel to beginning of payload * pool */
U32 bytes;  /* number of bytes in payload pool */
@@ -324,7 +324,7 @@ struct putfile_request {
int completion_status;
 };
 
-atomic_t Visorchipset_cache_buffers_in_use = ATOMIC_INIT(0);
+static atomic_t Visorchipset_cache_buffers_in_use = ATOMIC_INIT(0);
 
 struct parahotplug_request {
struct list_head list;
@@ -1344,7 +1344,7 @@ static int
 initialize_controlvm_payload_info(HOSTADDRESS phys_addr, U64 offset, U32 bytes,
  CONTROLVM_PAYLOAD_INFO *info)
 {
-   U8 *payload = NULL;
+   U8 __iomem *payload = NULL;
int rc = CONTROLVM_RESP_SUCCESS;
 
if (info == NULL) {
@@ -1678,7 +1678,7 @@ parahotplug_request_complete(int id, U16 active)
 /*
  * Enables or disables a PCI device by kicking off a udev script
  */
-void
+static void
 parahotplug_process_message(CONTROLVM_MESSAGE *inmsg)
 {
struct parahotplug_request *req;
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] Staging: unisys: visorutil: Clean up sparse warnings in visorutil code

2014-03-13 Thread Ken Cox
Clean up code to get rid of sparse warnings.

Also fixed variable length arrays declared on the stack.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/visorutil/procobjecttree.c | 2 +-
 drivers/staging/unisys/visorutil/visorkmodutils.c | 6 ++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorutil/procobjecttree.c 
b/drivers/staging/unisys/visorutil/procobjecttree.c
index e4d734e..7c7f001 100644
--- a/drivers/staging/unisys/visorutil/procobjecttree.c
+++ b/drivers/staging/unisys/visorutil/procobjecttree.c
@@ -150,7 +150,7 @@ MYPROCTYPE *visor_proc_CreateType(struct proc_dir_entry 
*procDirRoot,
type-nNames = 0;
type-show_property = show_property;
type-procDirRoot = procDirRoot;
-   if (type-propertyNames != 0)
+   if (type-propertyNames != NULL)
while (type-propertyNames[type-nProperties] != NULL)
type-nProperties++;
while (type-name[type-nNames] != NULL)
diff --git a/drivers/staging/unisys/visorutil/visorkmodutils.c 
b/drivers/staging/unisys/visorutil/visorkmodutils.c
index ed46208..f66acd9 100644
--- a/drivers/staging/unisys/visorutil/visorkmodutils.c
+++ b/drivers/staging/unisys/visorutil/visorkmodutils.c
@@ -20,8 +20,6 @@
 
 #define MYDRVNAME timskmodutils
 
-BOOL Debug_Malloc_Enabled = FALSE;
-
 /** Print the hexadecimal contents of a data buffer to a supplied print buffer.
  *  @param dest   the print buffer where text characters will
  *   be written
@@ -42,8 +40,8 @@ int visor_hexDumpToBuffer(char *dest, int destSize, char 
*prefix, char *src,
 {
int i = 0;
int pos = 0;
-   char printable[bytesToDumpPerLine + 1];
-   char hex[(bytesToDumpPerLine * 3) + 1];
+   char printable[24];
+   char hex[64];
char *line = NULL;
int linesize = 1000;
int linelen = 0;
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: unisys: virthba: Fix variable length array

2014-03-07 Thread Ken Cox


On 03/07/2014 10:02 AM, Greg KH wrote:

On Fri, Mar 07, 2014 at 07:10:57AM -0600, Ken Cox wrote:

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.carpen...@oracle.com
Signed-off-by: Ken Cox j...@redhat.com
---
  drivers/staging/unisys/virthba/virthba.c | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index c292293..3820c57 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -1439,12 +1439,17 @@ static ssize_t
  enable_ints_write(struct file *file, const char __user *buffer,
  size_t count, loff_t *ppos)
  {
-   char buf[count + 1];
+   char buf[4];
int i, new_value;
struct virthba_info *virthbainfo;
U64 *Features_addr;
U64 mask;
  
+	if (count  2) {

+   LOGERR(invalid  count%lu\n, count);

Nice, a simple way to DoS the syslog from any user :)

Don't even log this, you are going to be ripping all of those macros out
eventually, so don't add new ones...

Good point.  Revised patch coming.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Patch V3] Staging: unisys: virthba: Fix variable length array

2014-03-07 Thread Ken Cox
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.carpen...@oracle.com
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/virthba/virthba.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index c292293..277851f 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -1439,12 +1439,15 @@ static ssize_t
 enable_ints_write(struct file *file, const char __user *buffer,
  size_t count, loff_t *ppos)
 {
-   char buf[count + 1];
+   char buf[4];
int i, new_value;
struct virthba_info *virthbainfo;
U64 *Features_addr;
U64 mask;
 
+   if (count = ARRAY_SIZE(buf))
+   return -EINVAL;
+
buf[count] = '\0';
if (copy_from_user(buf, buffer, count)) {
LOGERR(copy_from_user failed. buf%.*s count%lu\n,
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: unisys: uislib: Fix locking in info_proc_read_helper()

2014-03-07 Thread Ken Cox
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.carpen...@oracle.com
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/uislib/uislib.c | 95 --
 1 file changed, 55 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index d77df9a..b9bf7b4 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -1622,13 +1622,8 @@ chipset_proc_write(struct file *file, const char __user 
*buffer,
return -EFAULT;
 }
 
-#define PROCLINE(...)  \
-   do {\
-   if (uisutil_add_proc_line_ex(tot, buff,\
-buff_len, __VA_ARGS__)  0) { \
-   goto err_done;  \
-   }   \
-   } while (0)
+#define PLINE(...) uisutil_add_proc_line_ex(tot, buff, \
+  buff_len, __VA_ARGS__)
 
 static int
 info_proc_read_helper(char **buff, int *buff_len)
@@ -1636,55 +1631,75 @@ info_proc_read_helper(char **buff, int *buff_len)
int i, tot = 0;
struct bus_info *bus;
 
-   PROCLINE(\nBuses:\n);
+   if (PLINE(\nBuses:\n)  0)
+   goto err_done;
 
read_lock(BusListLock);
for (bus = BusListHead; bus; bus = bus-next) {
 
-   PROCLINE(bus=0x%p, busNo=%d, deviceCount=%d\n,
-bus, bus-busNo, bus-deviceCount);
+   if (PLINE(bus=0x%p, busNo=%d, deviceCount=%d\n,
+ bus, bus-busNo, bus-deviceCount)  0)
+   goto err_done_unlock;
 
-   PROCLINE(Devices:\n);
+
+   if (PLINE(Devices:\n)  0)
+   goto err_done_unlock;
 
for (i = 0; i  bus-deviceCount; i++) {
if (bus-device[i]) {
-   PROCLINE(busNo %d, device[%i]: 
0x%p, chanptr=0x%p, swtch=0x%p\n,
-bus-busNo, i, bus-device[i],
-bus-device[i]-chanptr,
-bus-device[i]-swtch);
-   PROCLINE(first_busy_cnt=%llu, 
moved_to_tail_cnt=%llu, last_on_list_cnt=%llu\n,
-bus-device[i]-first_busy_cnt,
-bus-device[i]-moved_to_tail_cnt,
-bus-device[i]-last_on_list_cnt);
+   if (PLINE(busNo %d, device[%i]: 
0x%p, chanptr=0x%p, swtch=0x%p\n,
+ bus-busNo, i, bus-device[i],
+ bus-device[i]-chanptr,
+ bus-device[i]-swtch)  0)
+   goto err_done_unlock;
+
+   if (PLINE(first_busy_cnt=%llu, 
moved_to_tail_cnt=%llu, last_on_list_cnt=%llu\n,
+ bus-device[i]-first_busy_cnt,
+ bus-device[i]-moved_to_tail_cnt,
+ bus-device[i]-last_on_list_cnt)  0)
+   goto err_done_unlock;
}
}
}
read_unlock(BusListLock);
 
-   PROCLINE(Malloc bytes in use: %d\n, atomic_read(Malloc_BytesInUse));
-   PROCLINE(Malloc buffers in use: %d\n,
-atomic_read(Malloc_BuffersInUse));
-   PROCLINE(Malloc allocation failures: %d\n,
-atomic_read(Malloc_FailuresAlloc));
-   PROCLINE(Malloc free failures: %d\n,
-atomic_read(Malloc_FailuresFree));
-   PROCLINE(Malloc total mallocs: %u (may overflow)\n,
-(unsigned) atomic_read(Malloc_TotalMallocs));
-   PROCLINE(Malloc total frees: %u (may overflow)\n,
-(unsigned) atomic_read(Malloc_TotalFrees));
-   PROCLINE(UisUtils_Registered_Services: %d\n,
-atomic_read(UisUtils_Registered_Services));
-
-   PROCLINE(cycles_before_wait %llu wait_cycles:%llu\n,
-cycles_before_wait, wait_cycles);
-   PROCLINE(tot_wakeup_cnt %llu:tot_wait_cnt %llu:tot_schedule_cnt 
%llu\n,
-tot_wakeup_cnt, tot_wait_cnt, tot_schedule_cnt);
-   PROCLINE(en_smart_wakeup %d\n, en_smart_wakeup);
-   PROCLINE(tot_moved_to_tail_cnt %llu\n, tot_moved_to_tail_cnt);
+   if (PLINE(Malloc bytes in use: %d\n

[PATCH] Staging: unisys: Fix multiple variable length array declarations

2014-03-07 Thread Ken Cox
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 j...@redhat.com
---
 drivers/staging/unisys/uislib/uislib.c   | 39 +---
 drivers/staging/unisys/virthba/virthba.c |  5 +++-
 drivers/staging/unisys/virtpci/virtpci.c |  5 +++-
 3 files changed, 39 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index b9bf7b4..8d7ff94 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -1509,9 +1509,12 @@ vnic_proc_write(struct file *file, const char __user 
*buffer,
size_t count, loff_t *ppos)
 {
int action = 0x, busNo = 0, i, result = 0;
-   char buf[count];
+   char buf[4];
char direction;
 /* GUID guid; */
+   if (count = ARRAY_SIZE(buf))
+   return -EINVAL;
+
if (copy_from_user(buf, buffer, count)) {
LOGERR(echo  /proc/uislib/vnic copy_from_user FAILED.\n);
return -EFAULT;
@@ -1566,9 +1569,12 @@ chipset_proc_write(struct file *file, const char __user 
*buffer,
   size_t count, loff_t *ppos)
 {
int i, action = 0x;
-   char buf[count];
+   char buf[4];
CONTROLVM_MESSAGE msg;
 
+   if (count = ARRAY_SIZE(buf))
+   return -EINVAL;
+
memset(msg, 0, sizeof(CONTROLVM_MESSAGE));
 
if (copy_from_user(buf, buffer, count)) {
@@ -1811,10 +1817,13 @@ bus_proc_write(struct file *file, const char __user 
*buffer,
 {
int server_flag = 0;
int i, action = 0x, result;
-   char buf[count];
+   char buf[16];
CONTROLVM_MESSAGE msg;
U32 busNo, deviceCount;
 
+   if (count = ARRAY_SIZE(buf))
+   return -EINVAL;
+
memset(msg, 0, sizeof(CONTROLVM_MESSAGE));
 
if (copy_from_user(buf, buffer, count)) {
@@ -1892,10 +1901,13 @@ dev_proc_write(struct file *file, const char __user 
*buffer,
int server_flag = 0;
CONTROLVM_MESSAGE msg;
U32 busNo, devNo;
-   char buf[count];
+   char buf[32];
unsigned int chanptr;
int type, i, action = 0x, result;
 
+   if (count = ARRAY_SIZE(buf))
+   return -EINVAL;
+
if (copy_from_user(buf, buffer, count)) {
LOGERR(echo  /proc/uislib/device: copy_from_user 
FAILED.);
return -EFAULT;
@@ -1985,7 +1997,7 @@ static ssize_t
 cycles_before_wait_proc_write(struct file *file, const char __user *buffer,
  size_t count, loff_t *ppos)
 {
-   char buf[count];
+   char buf[16];
 
 #define CYCLES_BEFORE_WAIT_USE_ERROR  { \
LOGERR(Incorrect Call Home Input.\n); \
@@ -1993,6 +2005,8 @@ cycles_before_wait_proc_write(struct file *file, const 
char __user *buffer,
pr_info(EventID Category 
Type[parameter1][parameter2][parameter3][parameter4][parameter5][parameter6]\n);
 \
return -EFAULT; \
 }
+   if (count = ARRAY_SIZE(buf))
+   return -EINVAL;
 
if (count == 0)
CYCLES_BEFORE_WAIT_USE_ERROR;
@@ -2014,7 +2028,7 @@ static ssize_t
 reset_counts_proc_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
 {
-   char buf[count];
+   char buf[16];
unsigned long long new_value;
struct bus_info *bus;
int i;
@@ -2026,6 +2040,9 @@ reset_counts_proc_write(struct file *file, const char 
__user *buffer,
return -EFAULT; \
}
 
+   if (count = ARRAY_SIZE(buf))
+   return -EINVAL;
+
if (count == 0)
RESET_COUNTS_USE_ERROR;
 
@@ -2061,7 +2078,7 @@ static ssize_t
 smart_wakeup_proc_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
 {
-   char buf[count];
+   char buf[16];
int new_value;
 
 #define SMART_WAKEUP_USE_ERROR  { \
@@ -2071,6 +2088,9 @@ smart_wakeup_proc_write(struct file *file, const char 
__user *buffer,
return -EFAULT; \
}
 
+   if (count = ARRAY_SIZE(buf))
+   return -EINVAL;
+
if (count == 0)
SMART_WAKEUP_USE_ERROR;
 
@@ -2092,10 +2112,13 @@ test_proc_write(struct file *file, const char __user 
*buffer,
size_t count, loff_t *ppos)
 {
int i, action = 0x;
-   char buf[count];
+   char buf[16];
CONTROLVM_MESSAGE msg;
S64 vrtc_offset;
 
+   if (count = ARRAY_SIZE(buf))
+   return -EINVAL;
+
memset(msg, 0, sizeof(CONTROLVM_MESSAGE));
 
if (copy_from_user(buf, buffer, count)) {
diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index 277851f..cac2532 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging

Re: [PATCH 3/3] staging: unisys: Fix MAINTAINERS and TODO

2014-03-06 Thread Ken Cox


On 03/05/2014 10:40 PM, Greg KH wrote:

On Wed, Mar 05, 2014 at 02:52:26PM -0600, Ken Cox wrote:

Add the Unisys s-Par maintainer entry to the MAINTAINERS file.
Add Greg Kroah-Hartman to the list of patch recipients in the TODO file

Signed-off-by: Ken Cox j...@redhat.com
---
  MAINTAINERS| 5 +
  drivers/staging/unisys/MAINTAINERS | 6 --
  drivers/staging/unisys/TODO| 1 +
  3 files changed, 6 insertions(+), 6 deletions(-)
  delete mode 100644 drivers/staging/unisys/MAINTAINERS

diff --git a/MAINTAINERS b/MAINTAINERS
index c3ff623..06dc169 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9031,6 +9031,11 @@ F:   drivers/cdrom/cdrom.c
  F:include/linux/cdrom.h
  F:include/uapi/linux/cdrom.h
  
+UNISYS S-PAR DRIVERS

+M: Ben Romer sparmaintai...@unisys.com
+S: Maintained
+F: drivers/staging/unisys/

Why can't Ben submit this?  I'd prefer that there is at least some proof
that he can submit valid patches that can be accepted :)

I'll talk to Ben and get him to submit.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: unisys: virthba: Add dependency on SCSI

2014-03-06 Thread Ken Cox
If CONFIG_SCSI is not enabled, compiling virthba.c goes horribly wrong with
undefined symbols.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/virthba/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/virthba/Kconfig 
b/drivers/staging/unisys/virthba/Kconfig
index d2ef0fc..c0d7986 100644
--- a/drivers/staging/unisys/virthba/Kconfig
+++ b/drivers/staging/unisys/virthba/Kconfig
@@ -4,7 +4,7 @@
 
 config UNISYS_VIRTHBA
tristate Unisys virthba driver
-   depends on UNISYSSPAR  UNISYS_VISORCHIPSET  UNISYS_CHANNELSTUB  
UNISYS_UISLIB  UNISYS_VIRTPCI
+   depends on UNISYSSPAR  UNISYS_VISORCHIPSET  UNISYS_CHANNELSTUB  
UNISYS_UISLIB  UNISYS_VIRTPCI  SCSI
---help---
If you say Y here, you will enable the Unisys virthba driver.
 
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Patch V2] Staging: unisys: virthba: Add dependency on SCSI

2014-03-06 Thread Ken Cox
If CONFIG_SCSI is not enabled, compiling virthba.c goes horribly wrong with
undefined symbols.

Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/virthba/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/virthba/Kconfig 
b/drivers/staging/unisys/virthba/Kconfig
index d2ef0fc..c0d7986 100644
--- a/drivers/staging/unisys/virthba/Kconfig
+++ b/drivers/staging/unisys/virthba/Kconfig
@@ -4,7 +4,7 @@
 
 config UNISYS_VIRTHBA
tristate Unisys virthba driver
-   depends on UNISYSSPAR  UNISYS_VISORCHIPSET  UNISYS_CHANNELSTUB  
UNISYS_UISLIB  UNISYS_VIRTPCI
+   depends on UNISYSSPAR  UNISYS_VISORCHIPSET  UNISYS_CHANNELSTUB  
UNISYS_UISLIB  UNISYS_VIRTPCI  SCSI
---help---
If you say Y here, you will enable the Unisys virthba driver.
 
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch V2 1/8] staging: visorutil driver to provide common functionality to other s-Par drivers

2014-03-05 Thread Ken Cox


On 03/04/2014 06:54 PM, Greg KH wrote:

On Tue, Mar 04, 2014 at 07:58:05AM -0600, Ken Cox wrote:

+EXPORT_SYMBOL_GPL(proc_CreateType);

You have some _very_ generic symbols that you are now exporting.

Here's another funny one:


+int hexDumpWordsToBuffer(char *dest,
+int destSize,
+char *prefix,
+uint32_t *src,
+int srcWords,
+int wordsToDumpPerLine)

Be prepared to be forced to make these drivers a module after the 0-day
build system throws up on this stuff...

I will go through and rename these exported symbols to something unique.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch V2 8/8] staging: s-Par driver documentation

2014-03-05 Thread Ken Cox


On 03/04/2014 06:57 PM, Greg KH wrote:

On Tue, Mar 04, 2014 at 07:58:12AM -0600, Ken Cox wrote:

Index: upstream-staging/drivers/staging/unisys/MAINTAINERS
===

Are you using cvs?  Please start using git...
I'm using quilt to generate the patches, but can switch to git-generated 
patches if you prefer.



--- /dev/null
+++ upstream-staging/drivers/staging/unisys/MAINTAINERS
@@ -0,0 +1,6 @@
+Unisys s-Par drivers
+M: Ben Romer sparmaintai...@unisys.com
+S: Maintained
+F: Documentation/s-Par/overview.txt
+F: Documentation/s-Par/proc-entries.txt
+F: drivers/staging/unisys/

No, please modify the MAINTAINERS file in the root of the kernel, does
this even work with our tools?

I'll leave this for now, please send a follow-on patch to fix it up.

follow-on patch coming soon.



Index: upstream-staging/drivers/staging/unisys/TODO
===
--- /dev/null
+++ upstream-staging/drivers/staging/unisys/TODO
@@ -0,0 +1,20 @@
+TODO:
+   -checkpatch warnings
+   -move /proc entries to /sys
+   -proper major number(s)
+   -add other drivers needed for full functionality:
+   -visorclientbus
+   -visorbus
+   -visordiag
+   -virtnic
+   -visornoop
+   -visorserial
+   -visorvideoclient
+   -visorconinclient
+   -sparstop
+   -move individual drivers into proper driver subsystems
+   
+
+Patches to:
+   Ken Cox j...@redhat.com
+   Ben Romer sparmaintai...@unisys.com

Sweet, you don't want me to handle them!  :)

Follow-on patch to fix that also :)

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/11] staging: unisys: Fix MAINTAINERS and TODO

2014-03-05 Thread Ken Cox
From: Ken Cox j...@dhcp-10-15-1-72.hsv.redhat.com

Add the Unisys s-Par maintainer entry to the MAINTAINERS file.
Add Greg Kroah-Hartman to the list of patch recipients in the TODO file

Signed-off-by: Ken Cox j...@redhat.com
---
 MAINTAINERS| 7 +++
 drivers/staging/unisys/MAINTAINERS | 6 --
 drivers/staging/unisys/TODO| 1 +
 3 files changed, 8 insertions(+), 6 deletions(-)
 delete mode 100644 drivers/staging/unisys/MAINTAINERS

diff --git a/MAINTAINERS b/MAINTAINERS
index c3ff623..32bf902 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9857,3 +9857,10 @@ T:   git 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 S: Buried alive in reporters
 F: *
 F: */
+
+Unisys s-Par drivers
+M: Ben Romer sparmaintai...@unisys.com
+S: Maintained
+F: Documentation/s-Par/overview.txt
+F: Documentation/s-Par/proc-entries.txt
+F: drivers/staging/unisys/
diff --git a/drivers/staging/unisys/MAINTAINERS 
b/drivers/staging/unisys/MAINTAINERS
deleted file mode 100644
index c9cef0b..000
--- a/drivers/staging/unisys/MAINTAINERS
+++ /dev/null
@@ -1,6 +0,0 @@
-Unisys s-Par drivers
-M: Ben Romer sparmaintai...@unisys.com
-S: Maintained
-F: Documentation/s-Par/overview.txt
-F: Documentation/s-Par/proc-entries.txt
-F: drivers/staging/unisys/
diff --git a/drivers/staging/unisys/TODO b/drivers/staging/unisys/TODO
index c4265a2..40b29d4 100644
--- a/drivers/staging/unisys/TODO
+++ b/drivers/staging/unisys/TODO
@@ -16,5 +16,6 @@ TODO:

 
 Patches to:
+   Greg Kroah-Hartman gre...@linuxfoundation.org 
Ken Cox j...@redhat.com
Ben Romer sparmaintai...@unisys.com
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 09/11] staging: unisys: remove unreferenced utility functions.

2014-03-05 Thread Ken Cox
Please disregard patches 9-11 sent previously.  Corrected patches follow.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: unisys: remove unreferenced utility functions.

2014-03-05 Thread Ken Cox
A number of functions were used for debug at one time but that code has been
removed.

Signed-off-by: Ken Cox j...@redhat.com
---
 drivers/staging/unisys/include/timskmodutils.h|  99 +---
 drivers/staging/unisys/visorutil/visorkmodutils.c | 565 --
 2 files changed, 1 insertion(+), 663 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmodutils.h 
b/drivers/staging/unisys/include/timskmodutils.h
index ad4175e..ba5f5c0 100644
--- a/drivers/staging/unisys/include/timskmodutils.h
+++ b/drivers/staging/unisys/include/timskmodutils.h
@@ -21,15 +21,8 @@
 #include timskmod.h
 
 void *kmalloc_kernel(size_t siz);
-void *kmalloc_kernel_dma(size_t siz);
-void  kfree_kernel(const void *p, size_t siz);
-void *vmalloc_kernel(size_t siz);
-void  vfree_kernel(const void *p, size_t siz);
-void *pgalloc_kernel(size_t siz);
-void  pgfree_kernel(const void *p, size_t siz);
 void  myprintk(const char *myDrvName, const char *devname,
const char *template, ...);
-void  myprintkx(const char *myDrvName, int devno, const char *template, ...);
 
 /** Print the hexadecimal contents of a data buffer to a supplied print buffer.
  *  @param dest   the print buffer where text characters will be
@@ -53,71 +46,6 @@ int   hexDumpToBuffer(char *dest,
  int srcLen,
  int bytesToDumpPerLine);
 
-/** Print the hexadecimal contents of a data buffer to a supplied print buffer.
- *  Assume the data buffer contains 32-bit words in little-endian format,
- *  and dump the words with MSB first and LSB last.
- *  @param dest   the print buffer where text characters will be
- *written
- *  @param destSize   the maximum number of bytes that can be written
- *to #dest
- *  @param srcthe buffer that contains the data that is to be
- *hex-dumped
- *  @param srcWords   the number of 32-bit words at #src to be
- hex-dumped
- *  @param wordsToDumpPerLine output will be formatted such that at most this
- *many of the input data words will be represented
- *on each line of output
- *  @return   the number of text characters written to #dest
- *(not including the trailing '\0' byte)
- *  @ingroup internal
- */
-int   hexDumpWordsToBuffer(char *dest,
-  int destSize,
-  char *prefix,
-  uint32_t *src,
-  int srcWords,
-  int wordsToDumpPerLine);
-
-
-/** Use printk to print the hexadecimal contents of a data buffer.
- *  See #INFOHEXDRV and #INFOHEXDEV for info.
- *  @ingroup internal
- */
-int myPrintkHexDump(char *myDrvName,
-   char *devname,
-   char *prefix,
-   char *src,
-   int srcLen,
-   int bytesToDumpPerLine);
-
-/** Given as input a number of seconds in #seconds, creates text describing
- *  the time within #s.  Also breaks down the number of seconds into component
- *  days, hours, minutes, and seconds, and stores to *#days, *#hours,
- *  *#minutes, and *#secondsx.
- *  @param seconds input number of seconds
- *  @param dayspoints to a long value where the days component for the
- * days+hours+minutes+seconds representation of #seconds will
- * be stored
- *  @param hours   points to a long value where the hours component for the
- * days+hours+minutes+seconds representation of #seconds will
- * be stored
- *  @param minutes points to a long value where the minutes component for the
- * days+hours+minutes+seconds representation of #seconds will
- * be stored
- *  @param secondsx points to a long value where the seconds component for the
- * days+hours+minutes+seconds representation of #seconds will
- * be stored
- *  @param s   points to a character buffer where a text representation of
- * the #seconds value will be stored.  This buffer MUST be
- * large enough to hold the resulting string; to be safe it
- * should be at least 100 bytes long.
- */
-void  expandSeconds(time_t seconds,
-   long *days, long *hours,
-   long *minutes,
-   long *secondsx,
-   char *s);
-
 /**
  *---  GENERAL MESSAGEQ STUFF  ---*
  **/
@@ -126,19 +54,10 @@ struct MessageQEntry;
 
 /** the data structure used to hold an arbitrary data item that you want
  *  to place on a #MESSAGEQ.  Declare and initialize as follows:
- *  @code
- *  MESSAGEQENTRY myEntry;
- *  initMessageQEntry (myEntry, pointerToMyDataItem

[PATCH 3/3] staging: unisys: Fix MAINTAINERS and TODO

2014-03-05 Thread Ken Cox
Add the Unisys s-Par maintainer entry to the MAINTAINERS file.
Add Greg Kroah-Hartman to the list of patch recipients in the TODO file

Signed-off-by: Ken Cox j...@redhat.com
---
 MAINTAINERS| 5 +
 drivers/staging/unisys/MAINTAINERS | 6 --
 drivers/staging/unisys/TODO| 1 +
 3 files changed, 6 insertions(+), 6 deletions(-)
 delete mode 100644 drivers/staging/unisys/MAINTAINERS

diff --git a/MAINTAINERS b/MAINTAINERS
index c3ff623..06dc169 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9031,6 +9031,11 @@ F:   drivers/cdrom/cdrom.c
 F: include/linux/cdrom.h
 F: include/uapi/linux/cdrom.h
 
+UNISYS S-PAR DRIVERS
+M: Ben Romer sparmaintai...@unisys.com
+S: Maintained
+F: drivers/staging/unisys/
+
 UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER
 M: Vinayak Holikatti vinholika...@gmail.com
 M: Santosh Y santos...@gmail.com
diff --git a/drivers/staging/unisys/MAINTAINERS 
b/drivers/staging/unisys/MAINTAINERS
deleted file mode 100644
index c9cef0b..000
--- a/drivers/staging/unisys/MAINTAINERS
+++ /dev/null
@@ -1,6 +0,0 @@
-Unisys s-Par drivers
-M: Ben Romer sparmaintai...@unisys.com
-S: Maintained
-F: Documentation/s-Par/overview.txt
-F: Documentation/s-Par/proc-entries.txt
-F: drivers/staging/unisys/
diff --git a/drivers/staging/unisys/TODO b/drivers/staging/unisys/TODO
index c4265a2..1ed4e64 100644
--- a/drivers/staging/unisys/TODO
+++ b/drivers/staging/unisys/TODO
@@ -16,5 +16,6 @@ TODO:

 
 Patches to:
+   Greg Kroah-Hartman gre...@linuxfoundation.org
Ken Cox j...@redhat.com
Ben Romer sparmaintai...@unisys.com
-- 
1.8.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch 1/8] staging: visorutil driver to provide common functionality to other s-Par drivers

2014-03-04 Thread Ken Cox


On 03/03/2014 04:20 PM, Greg KH wrote:

On Mon, Mar 03, 2014 at 02:05:07PM -0600, Romer, Benjamin M wrote:

Hi Greg,

The copyright text is old boilerplate that we'd been carrying.

Be careful about old boilerplate, that can get you in trouble :)


We'll
change it so that it's correctly GPL 2 only, and we'll fix all of the
EXPORT_SYMBOL()s also.

Great, do you want to just send a follow-on patch, or redo this whole
series?  Either is fine for me.

I will resend the series shortly



The majority of our proc entries are switches for debugging or purely
informational, so these could be moved to /sys with little trouble.

Debugging stuff goes to debugfs, and sysfs would be good for the other
things, as long as it's properly documented :)


The only user space program that would care about them is our guest
installation software, and we at Unisys can easily update that when
the API changes.

That's great to hear, thanks.

What about the TODO and MAINTAINERS file updates?

These will be included in the new series

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch V2 0/8] staging: Drivers to support Unisys Secure Partitioning

2014-03-04 Thread Ken Cox
This series includes a base set of drivers for the Unisys s-Par system.
This set of drivers is enough to get a virtual guest up and running on s-Par
hardware.  The remaining drivers needed to have a fully functional system 
will be submitted after review of this initial set.

s-Par is firmware that provides hardware partitioning capabilities for
splitting large-scale Intel x86 servers into multiple isolated
partitions. s-Par provides a set of para-virtualized device drivers to
allow guest partitions on the same server to share devices that  would
normally be unsharable; specifically, PCI network interfaces and host
bus adapters that do not support shared access via SR-IOV. The shared
device is owned and managed by a small, single-purpose service
partition, which communicates with each guest partition sharing that
device through an area of shared memory called a channel. Additional
drivers provide support interfaces for communicating with s-Par
services, logging and diagnostics, and accessing the Linux console
from the s-Par user interface.

The driver stack consists of a set of support modules, a set of bus
modules, and a set of device driver modules. The support modules
handle a number of common functions across each of the other
drivers. The bus modules provide organization for the device driver
modules, which provide the shared device functionality.

These drivers are for the Unisys virtual PCI hardware model where the
hypervisor need not intervene (other than normal interrupt handling)
in the interactions between the client drivers and the virtual adapter
firmware in the adapter service partition.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch V2 4/8] staging: visorchannelstub driver to provide channel support routines

2014-03-04 Thread Ken Cox
The visorchannelstub module provides support routines for storing and
retrieving data from a channel.

Signed-off-by: Ken Cox j...@redhat.com
Cc: Ben Romer sparmaintai...@unisys.com

Index: upstream-staging/drivers/staging/unisys/Kconfig
===
--- upstream-staging.orig/drivers/staging/unisys/Kconfig
+++ upstream-staging/drivers/staging/unisys/Kconfig
@@ -12,5 +12,6 @@ if UNISYSSPAR
 source drivers/staging/unisys/visorutil/Kconfig
 source drivers/staging/unisys/visorchannel/Kconfig
 source drivers/staging/unisys/visorchipset/Kconfig
+source drivers/staging/unisys/channels/Kconfig
 
 endif # UNISYSSPAR
Index: upstream-staging/drivers/staging/unisys/Makefile
===
--- upstream-staging.orig/drivers/staging/unisys/Makefile
+++ upstream-staging/drivers/staging/unisys/Makefile
@@ -4,4 +4,5 @@
 obj-$(CONFIG_UNISYS_VISORUTIL) += visorutil/
 obj-$(CONFIG_UNISYS_VISORCHANNEL)  += visorchannel/
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset/
+obj-$(CONFIG_UNISYS_CHANNELSTUB)   += channels/
 
Index: upstream-staging/drivers/staging/unisys/channels/Kconfig
===
--- /dev/null
+++ upstream-staging/drivers/staging/unisys/channels/Kconfig
@@ -0,0 +1,10 @@
+#
+# Unisys channels configuration
+#
+
+config UNISYS_CHANNELSTUB
+   tristate Unisys channelstub driver
+   depends on UNISYSSPAR
+   ---help---
+   If you say Y here, you will enable the Unisys channels driver.
+
Index: upstream-staging/drivers/staging/unisys/channels/Makefile
===
--- /dev/null
+++ upstream-staging/drivers/staging/unisys/channels/Makefile
@@ -0,0 +1,13 @@
+#
+# Makefile for Unisys channelstub
+#
+
+obj-$(CONFIG_UNISYS_CHANNELSTUB)   += visorchannelstub.o
+
+visorchannelstub-y := channel.o chanstub.o
+
+ccflags-y += -Idrivers/staging/unisys/include
+ccflags-y += -Idrivers/staging/unisys/common-spar/include
+ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels
+ccflags-y += -DCONFIG_SPAR_GUEST -DGUESTDRIVERBUILD -DNOAUTOVERSION
+
Index: upstream-staging/drivers/staging/unisys/channels/channel.c
===
--- /dev/null
+++ upstream-staging/drivers/staging/unisys/channels/channel.c
@@ -0,0 +1,307 @@
+/* Copyright © 2010 - 2013 UNISYS CORPORATION
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ */
+
+#include linux/kernel.h
+#ifdef CONFIG_MODVERSIONS
+#include config/modversions.h
+#endif
+#include linux/module.h
+#include linux/init.h/* for module_init and module_exit */
+#include linux/slab.h/* for memcpy */
+#include linux/types.h
+
+/* Implementation of exported functions for Supervisor channels */
+#include channel.h
+
+/*
+ * Routine Description:
+ * Tries to insert the prebuilt signal pointed to by pSignal into the nth
+ * Queue of the Channel pointed to by pChannel
+ *
+ * Parameters:
+ * pChannel: (IN) points to the IO Channel
+ * Queue: (IN) nth Queue of the IO Channel
+ * pSignal: (IN) pointer to the signal
+ *
+ * Assumptions:
+ * - pChannel, Queue and pSignal are valid.
+ * - If insertion fails due to a full queue, the caller will determine the
+ * retry policy (e.g. wait  try again, report an error, etc.).
+ *
+ * Return value:
+ * 1 if the insertion succeeds, 0 if the queue was full.
+ */
+unsigned char
+SignalInsert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
+{
+   void *psignal;
+   unsigned int head, tail;
+   pSIGNAL_QUEUE_HEADER pqhdr =
+   (pSIGNAL_QUEUE_HEADER) ((char *) pChannel +
+   pChannel-oChannelSpace) + Queue;
+
+   /* capture current head and tail */
+   head = pqhdr-Head;
+   tail = pqhdr-Tail;
+
+   /* queue is full if (head + 1) % n equals tail */
+   if (((head + 1) % pqhdr-MaxSignalSlots) == tail) {
+   pqhdr-NumOverflows++;
+   return 0;
+   }
+
+   /* increment the head index */
+   head = (head + 1) % pqhdr-MaxSignalSlots;
+
+   /* copy signal to the head location from the area pointed to
+* by pSignal
+*/
+   psignal =
+   (char *) pqhdr + pqhdr-oSignalBase + (head * pqhdr-SignalSize);
+   MEMCPY(psignal, pSignal, pqhdr-SignalSize

[patch V2 8/8] staging: s-Par driver documentation

2014-03-04 Thread Ken Cox
Documentation for the set of s-Par drivers

Signed-off-by: Ken Cox j...@redhat.com
Cc: Ben Romer sparmaintai...@unisys.com

Index: upstream-staging/drivers/staging/unisys/Documentation/proc-entries.txt
===
--- /dev/null
+++ upstream-staging/drivers/staging/unisys/Documentation/proc-entries.txt
@@ -0,0 +1,93 @@
+ s-Par Proc Entries
+This document describes the proc entries created by the Unisys s-Par modules.
+
+Support Module Entries
+These entries are provided primarily for debugging.
+
+/proc/uislib/info: This entry contains debugging information for the
+uislib module, including bus information and memory usage.
+
+/proc/visorchipset/controlvm: This directory contains debugging
+entries for the controlvm channel used by visorchipset.
+
+/proc/uislib/platform: This entry is used to display the platform
+number this node is in the system. For some guests, this may be
+invalid.
+
+/proc/visorchipset/chipsetready: This entry is written to by scripts
+to signify that any user level activity has been completed before the
+guest can be considered running and is shown as running in the s-Par
+UI.
+
+Device Entries
+These entries provide status of the devices shared by a service partition.
+
+/proc/uislib/vbus: this is a directory containing entries for each
+virtual bus. Each numbered sub-directory contains an info entry, which
+describes the devices that appear on that bus.
+
+/proc/uislib/cycles_before_wait: This entry is used to tune
+performance, by setting the number of cycles we wait before going idle
+when in polling mode. A longer time will reduce message latency but
+spend more processing time polling.
+
+/proc/uislib/smart_wakeup: This entry is used to tune performance, by
+enabling or disabling smart wakeup.
+
+/proc/virthba/info: This entry contains debugging information for the
+virthba module, including interrupt information and memory usage.
+
+/proc/virthba/enable_ints: This entry controls interrupt use by the
+virthba module. Writing a 0 to this entry will disable interrupts.
+
+/proc/virtnic/info: This entry contains debugging information for the
+virtnic module, including interrupt information, send and receive
+counts, and other device information.
+
+/proc/virtnic/ethX: This is a directory containing entries for each
+virtual NIC. Each named subdirectory contains two entries,
+clientstring and zone.
+
+/proc/virtpci/info: This entry contains debugging information for the
+virtpci module, including virtual PCI bus information and device
+locations.
+
+/proc/virtnic/enable_ints: This entry controls interrupt use by the
+virtnic module. Writing a 0 to this entry will disable interrupts.
+
+Visorconinclient, visordiag, visornoop, visorserialclient, and
+visorvideoclient Entries
+
+The entries in proc for these modules all follow the same
+pattern. Each module has its own proc directory with the same name,
+e.g. visordiag presents a /proc/visordiag directory. Inside of the
+module's directory are a device directory, which contains one numbered
+directory for each device provided by that module. Each device has a
+diag entry that presents the device number and visorbus name for that
+device. The module directory also has a driver/diag entry, which
+reports the corresponding s-Par version number of the driver.
+
+Automated Installation Entries
+
+These entries are used to pass information between the s-Par platform
+and the Linux-based installation and recovery tool. These values are
+read/write, however, the guest can only reset them to 0, or report an
+error status through the installer entry. The values are only set via
+s-Par's firmware interface, to help prevent accidentally booting into
+the tool.
+
+/proc/visorchipset/boottotool: This entry instructs s-Par that the
+next reboot will launch the installation and recovery tool. If set to
+0, the next boot will happen according to the UEFI boot manager
+settings.
+
+/proc/visorchipset/toolaction: This entry indicates the installation
+and recovery tool mode requested for the next boot.
+
+/proc/visorchipset/installer: this entry is used by the installation
+and recovery tool to pass status and result information back to the
+s-Par firmware.
+
+/proc/visorchipset/partition: This directory contains the guest
+partition configuration data for each virtual bus, for use during
+installation and at runtime for s-Par service partitions.
Index: upstream-staging/drivers/staging/unisys/Documentation/overview.txt
===
--- /dev/null
+++ upstream-staging/drivers/staging/unisys/Documentation/overview.txt
@@ -0,0 +1,174 @@
+
+Overview
+
+This document describes the driver set for Unisys Secure Partitioning 
(s-Par®).
+
+s-Par is firmware that provides hardware partitioning capabilities for
+splitting large-scale Intel x86 servers into multiple isolated
+partitions. s-Par provides a set of para-virtualized device drivers to
+allow

[patch 0/8] staging: Drivers to support Unisys Secure Partitioning

2014-03-03 Thread Ken Cox
This series includes a base set of drivers for the Unisys s-Par system.
This set of drivers is enough to get a virtual guest up and running on s-Par
hardware.  The remaining drivers needed to have a fully functional system 
will be submitted after review of this initial set.

s-Par is firmware that provides hardware partitioning capabilities for
splitting large-scale Intel x86 servers into multiple isolated
partitions. s-Par provides a set of para-virtualized device drivers to
allow guest partitions on the same server to share devices that  would
normally be unsharable; specifically, PCI network interfaces and host
bus adapters that do not support shared access via SR-IOV. The shared
device is owned and managed by a small, single-purpose service
partition, which communicates with each guest partition sharing that
device through an area of shared memory called a channel. Additional
drivers provide support interfaces for communicating with s-Par
services, logging and diagnostics, and accessing the Linux console
from the s-Par user interface.

The driver stack consists of a set of support modules, a set of bus
modules, and a set of device driver modules. The support modules
handle a number of common functions across each of the other
drivers. The bus modules provide organization for the device driver
modules, which provide the shared device functionality.

These drivers are for the Unisys virtual PCI hardware model where the
hypervisor need not intervene (other than normal interrupt handling)
in the interactions between the client drivers and the virtual adapter
firmware in the adapter service partition.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch 4/8] staging: visorchannelstub driver to provide channel support routines

2014-03-03 Thread Ken Cox
The visorchannelstub module provides support routines for storing and
retrieving data from a channel.

Signed-off-by: Ken Cox j...@redhat.com
Cc: Ben Romer sparmaintai...@unisys.com

Index: upstream-staging/drivers/staging/unisys/Kconfig
===
--- upstream-staging.orig/drivers/staging/unisys/Kconfig
+++ upstream-staging/drivers/staging/unisys/Kconfig
@@ -12,5 +12,6 @@ if UNISYSSPAR
 source drivers/staging/unisys/visorutil/Kconfig
 source drivers/staging/unisys/visorchannel/Kconfig
 source drivers/staging/unisys/visorchipset/Kconfig
+source drivers/staging/unisys/channels/Kconfig
 
 endif # UNISYSSPAR
Index: upstream-staging/drivers/staging/unisys/Makefile
===
--- upstream-staging.orig/drivers/staging/unisys/Makefile
+++ upstream-staging/drivers/staging/unisys/Makefile
@@ -4,4 +4,5 @@
 obj-$(CONFIG_UNISYS_VISORUTIL) += visorutil/
 obj-$(CONFIG_UNISYS_VISORCHANNEL)  += visorchannel/
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset/
+obj-$(CONFIG_UNISYS_CHANNELSTUB)   += channels/
 
Index: upstream-staging/drivers/staging/unisys/channels/Kconfig
===
--- /dev/null
+++ upstream-staging/drivers/staging/unisys/channels/Kconfig
@@ -0,0 +1,10 @@
+#
+# Unisys channels configuration
+#
+
+config UNISYS_CHANNELSTUB
+   tristate Unisys channelstub driver
+   depends on UNISYSSPAR
+   ---help---
+   If you say Y here, you will enable the Unisys channels driver.
+
Index: upstream-staging/drivers/staging/unisys/channels/Makefile
===
--- /dev/null
+++ upstream-staging/drivers/staging/unisys/channels/Makefile
@@ -0,0 +1,13 @@
+#
+# Makefile for Unisys channelstub
+#
+
+obj-$(CONFIG_UNISYS_CHANNELSTUB)   += visorchannelstub.o
+
+visorchannelstub-y := channel.o chanstub.o
+
+ccflags-y += -Idrivers/staging/unisys/include
+ccflags-y += -Idrivers/staging/unisys/common-spar/include
+ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels
+ccflags-y += -DCONFIG_SPAR_GUEST -DGUESTDRIVERBUILD -DNOAUTOVERSION
+
Index: upstream-staging/drivers/staging/unisys/channels/channel.c
===
--- /dev/null
+++ upstream-staging/drivers/staging/unisys/channels/channel.c
@@ -0,0 +1,307 @@
+/* Copyright © 2010 - 2013 UNISYS CORPORATION
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ */
+
+#include linux/kernel.h
+#ifdef CONFIG_MODVERSIONS
+#include config/modversions.h
+#endif
+#include linux/module.h
+#include linux/init.h/* for module_init and module_exit */
+#include linux/slab.h/* for memcpy */
+#include linux/types.h
+
+/* Implementation of exported functions for Supervisor channels */
+#include channel.h
+
+/*
+ * Routine Description:
+ * Tries to insert the prebuilt signal pointed to by pSignal into the nth
+ * Queue of the Channel pointed to by pChannel
+ *
+ * Parameters:
+ * pChannel: (IN) points to the IO Channel
+ * Queue: (IN) nth Queue of the IO Channel
+ * pSignal: (IN) pointer to the signal
+ *
+ * Assumptions:
+ * - pChannel, Queue and pSignal are valid.
+ * - If insertion fails due to a full queue, the caller will determine the
+ * retry policy (e.g. wait  try again, report an error, etc.).
+ *
+ * Return value:
+ * 1 if the insertion succeeds, 0 if the queue was full.
+ */
+unsigned char
+SignalInsert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
+{
+   void *psignal;
+   unsigned int head, tail;
+   pSIGNAL_QUEUE_HEADER pqhdr =
+   (pSIGNAL_QUEUE_HEADER) ((char *) pChannel +
+   pChannel-oChannelSpace) + Queue;
+
+   /* capture current head and tail */
+   head = pqhdr-Head;
+   tail = pqhdr-Tail;
+
+   /* queue is full if (head + 1) % n equals tail */
+   if (((head + 1) % pqhdr-MaxSignalSlots) == tail) {
+   pqhdr-NumOverflows++;
+   return 0;
+   }
+
+   /* increment the head index */
+   head = (head + 1) % pqhdr-MaxSignalSlots;
+
+   /* copy signal to the head location from the area pointed to
+* by pSignal
+*/
+   psignal =
+   (char *) pqhdr + pqhdr-oSignalBase + (head * pqhdr-SignalSize);
+   MEMCPY(psignal, pSignal, pqhdr-SignalSize

[patch 8/8] staging: s-Par driver documentation

2014-03-03 Thread Ken Cox
Documentation for the set of s-Par drivers

Signed-off-by: Ken Cox j...@redhat.com
Cc: Ben Romer sparmaintai...@unisys.com

Index: linux-2.6.staging/drivers/staging/unisys/Documentation/proc-entries.txt
===
--- /dev/null
+++ linux-2.6.staging/drivers/staging/unisys/Documentation/proc-entries.txt
@@ -0,0 +1,93 @@
+ s-Par Proc Entries
+This document describes the proc entries created by the Unisys s-Par modules.
+
+Support Module Entries
+These entries are provided primarily for debugging.
+
+/proc/uislib/info: This entry contains debugging information for the
+uislib module, including bus information and memory usage.
+
+/proc/visorchipset/controlvm: This directory contains debugging
+entries for the controlvm channel used by visorchipset.
+
+/proc/uislib/platform: This entry is used to display the platform
+number this node is in the system. For some guests, this may be
+invalid.
+
+/proc/visorchipset/chipsetready: This entry is written to by scripts
+to signify that any user level activity has been completed before the
+guest can be considered running and is shown as running in the s-Par
+UI.
+
+Device Entries
+These entries provide status of the devices shared by a service partition.
+
+/proc/uislib/vbus: this is a directory containing entries for each
+virtual bus. Each numbered sub-directory contains an info entry, which
+describes the devices that appear on that bus.
+
+/proc/uislib/cycles_before_wait: This entry is used to tune
+performance, by setting the number of cycles we wait before going idle
+when in polling mode. A longer time will reduce message latency but
+spend more processing time polling.
+
+/proc/uislib/smart_wakeup: This entry is used to tune performance, by
+enabling or disabling smart wakeup.
+
+/proc/virthba/info: This entry contains debugging information for the
+virthba module, including interrupt information and memory usage.
+
+/proc/virthba/enable_ints: This entry controls interrupt use by the
+virthba module. Writing a 0 to this entry will disable interrupts.
+
+/proc/virtnic/info: This entry contains debugging information for the
+virtnic module, including interrupt information, send and receive
+counts, and other device information.
+
+/proc/virtnic/ethX: This is a directory containing entries for each
+virtual NIC. Each named subdirectory contains two entries,
+clientstring and zone.
+
+/proc/virtpci/info: This entry contains debugging information for the
+virtpci module, including virtual PCI bus information and device
+locations.
+
+/proc/virtnic/enable_ints: This entry controls interrupt use by the
+virtnic module. Writing a 0 to this entry will disable interrupts.
+
+Visorconinclient, visordiag, visornoop, visorserialclient, and
+visorvideoclient Entries
+
+The entries in proc for these modules all follow the same
+pattern. Each module has its own proc directory with the same name,
+e.g. visordiag presents a /proc/visordiag directory. Inside of the
+module's directory are a device directory, which contains one numbered
+directory for each device provided by that module. Each device has a
+diag entry that presents the device number and visorbus name for that
+device. The module directory also has a driver/diag entry, which
+reports the corresponding s-Par version number of the driver.
+
+Automated Installation Entries
+
+These entries are used to pass information between the s-Par platform
+and the Linux-based installation and recovery tool. These values are
+read/write, however, the guest can only reset them to 0, or report an
+error status through the installer entry. The values are only set via
+s-Par's firmware interface, to help prevent accidentally booting into
+the tool.
+
+/proc/visorchipset/boottotool: This entry instructs s-Par that the
+next reboot will launch the installation and recovery tool. If set to
+0, the next boot will happen according to the UEFI boot manager
+settings.
+
+/proc/visorchipset/toolaction: This entry indicates the installation
+and recovery tool mode requested for the next boot.
+
+/proc/visorchipset/installer: this entry is used by the installation
+and recovery tool to pass status and result information back to the
+s-Par firmware.
+
+/proc/visorchipset/partition: This directory contains the guest
+partition configuration data for each virtual bus, for use during
+installation and at runtime for s-Par service partitions.
Index: linux-2.6.staging/drivers/staging/unisys/Documentation/overview.txt
===
--- /dev/null
+++ linux-2.6.staging/drivers/staging/unisys/Documentation/overview.txt
@@ -0,0 +1,174 @@
+
+Overview
+
+This document describes the driver set for Unisys Secure Partitioning 
(s-Par®).
+
+s-Par is firmware that provides hardware partitioning capabilities for
+splitting large-scale Intel x86 servers into multiple isolated
+partitions. s-Par provides a set of para-virtualized device drivers

Re: [patch 0/8] staging: Drivers to support Unisys Secure Partitioning

2014-03-03 Thread Ken Cox


On 03/03/2014 01:12 PM, Greg KH wrote:

On Mon, Mar 03, 2014 at 11:01:14AM -0600, Ken Cox wrote:

This series includes a base set of drivers for the Unisys s-Par system.
This set of drivers is enough to get a virtual guest up and running on s-Par
hardware.  The remaining drivers needed to have a fully functional system
will be submitted after review of this initial set.

s-Par is firmware that provides hardware partitioning capabilities for
splitting large-scale Intel x86 servers into multiple isolated
partitions. s-Par provides a set of para-virtualized device drivers to
allow guest partitions on the same server to share devices that  would
normally be unsharable; specifically, PCI network interfaces and host
bus adapters that do not support shared access via SR-IOV. The shared
device is owned and managed by a small, single-purpose service
partition, which communicates with each guest partition sharing that
device through an area of shared memory called a channel. Additional
drivers provide support interfaces for communicating with s-Par
services, logging and diagnostics, and accessing the Linux console
from the s-Par user interface.

The driver stack consists of a set of support modules, a set of bus
modules, and a set of device driver modules. The support modules
handle a number of common functions across each of the other
drivers. The bus modules provide organization for the device driver
modules, which provide the shared device functionality.

These drivers are for the Unisys virtual PCI hardware model where the
hypervisor need not intervene (other than normal interrupt handling)
in the interactions between the client drivers and the virtual adapter
firmware in the adapter service partition.

Why do you want these in the drivers/staging/ part of the kernel?  I
have my guesses, but you need to tell me why :)
Frankly, I wasn't sure of the most appropriate place since this is a 
conglomeration of drivers for hba, serial, video, etc. but they don't 
stand alone outside of the s-PAR environment.  If you can recommend a 
better place for them I'll be happy to move them over.


Also, I need a TODO file, like the rest of the staging drivers have,
listing what needs to be done to get the code out of staging, and who is
responsible for the code.  Ideally, a MAINTAINERS entry as well, so that
the same people get copied when people use scripts/get_maintainer.pl on
patches.

sorry about that.  I'll add them.


thanks,

greg k-h


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch 0/8] staging: Drivers to support Unisys Secure Partitioning

2014-03-03 Thread Ken Cox


On 03/03/2014 01:22 PM, Dan Carpenter wrote:

What software do we need to test this?  Is there a quick start guide?

Unisys hardware/firmware is required.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel