[GIT PULL] Staging driver patches for 3.20-rc1

2015-02-15 Thread Greg KH
The following changes since commit e36f014edff70fc02b3d3d79cead1d58f289332e:

  Linux 3.19-rc7 (2015-02-01 20:07:21 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/ 
tags/staging-3.20-rc1

for you to fetch changes up to 533e80b1ea709577ec5cf73b8b566569bc711259:

  staging: lustre: lustre: libcfs: define symbols as static (2015-02-07 
17:41:12 +0800)


Staging drivers patches for 3.20-rc1

Here's the big staging driver tree update for 3.20-rc1.  Lots of little
things in here, adding up to lots of overall cleanups.  The IIO driver
updates are also in here as they cross the staging tree boundry a lot.
I2O has moved into staging as well, as a plan to drop it from the tree
eventually as that's a dead subsystem.

All of this has been in linux-next with no reported issues for a while.

Signed-off-by: Greg Kroah-Hartman 


Aaro Koskinen (1):
  staging: xgifb: fix colours on big-endian machines other than powerpc

Abel Moyo (1):
  Staging: rtl8188eu: {core, hal, include}: Removed inline function

Adam Thomson (1):
  iio: Add ABI documentation for input current readings

Ahmad Hassan (1):
  staging: vt6655: fix space prohibted before that ','

Al Viro (1):
  lustre: don't use iovec instead of kvec

Alan Cox (2):
  i2o: move to staging
  staging: cptm1217: blow it all away

Alexander Boyko (1):
  staging/lustre/osc: split different type of IO

Alexander Kuleshov (1):
  staging: rtl8192e: Fix duplicated conditional branch

Alexey Khoroshilov (1):
  staging: dgnc: implement proper error handling in dgnc_start()

Alexey Tulia (1):
  staging: rtl8723au: fix sparse warning

Andreas Ruprecht (2):
  staging: lustre: fid: Remove space before braces for defined() check
  staging: lustre: osc: Make osc_init() static

Andrew Milkovich (1):
  Staging: dgnc: fixed some coding style errors

Anjana Sasindran (4):
  staging: rtl8723au: hal: Removed spaces before semicolon
  staging: rtl8723au: hal: Added blank line after declaration
  staging: rtl8723au: hal: Removed space before semicolon
  staging: rtl8723au: hal: Removed a space before semicolon

Arno Tiemersma (1):
  staging: lustre: Add blank lines after declarations

Asaf Vertz (7):
  staging: rtl8723au: core: fixing "foo * bar" should be "foo *bar"
  staging: wlan-ng: hfa384x_usb: fix sparse endianness warnings
  staging: iio: tsl2583: fix format string warnings
  staging: iio: ad5933: fix format string warnings
  staging: iio: tsl2x7x_core: fix format string warnings
  staging: lustre: osc: fix space prohibited after that '!'
  staging: lustre: lnet: fix space prohibited before that '++'

Athira Lekshmi (1):
  Clocking-wizard: Fixed missing blank line warning

Austin Kerbow (1):
  Staging: ft1000-pcmcia: fix else close brace style

Aya Mahfouz (1):
  staging: davinci_vpfe: fix space prohibited before semicolon warning

Balavasu (2):
  staging: lustre: lnet: lnet: do not initialise statics to 0 or NULL
  staging: lustre: lnet: lnet: trailing statements should be on next line

Bastian Plettner (1):
  staging: speakup: Remove unnecessary space

Bastien Nocera (2):
  iio:kxcjk-1013: Add support for SMO8500 device
  staging: unisys: Fix typo in comment

Benjamin Romer (49):
  staging: unisys: fix line spacing in visorchipset_umode.h
  staging: unisys: fix line spacing in globals.h
  staging: unisys: remove testing.h
  staging: unisys: get rid of channel stub
  staging: unisys: remove unused types from visorchipset.h
  staging: unisys: add comment to spinlock in struct charqueue
  staging: unisys: clean up typecasts in uislib.c
  staging: unisys: fix alignment in uislib.c
  staging: unisys: refactor create_bus()
  staging: unisys: fix strict checks in create_device()
  staging: unisys: remove extraneous blank lines in uislib.c
  staging: unisys: add missing brackets in info_debugfs_read()
  staging: unisys: add missing brackets in Process_Incoming()
  staging: unisys: remove extra parens from 
uislib_enable_channel_interrupts()
  staging: unisys: get rid of doubled assignment in uislib_mod_init()
  staging: unisys: fix CamelCase global variable names in uislib.c
  staging: unisys: refactor init_vbus_channel()
  staging: unisys: fix CamelCase in create_bus()
  staging: unisys: fix CamelCase in destroy_bus()
  staging: unisys: refactor create_device()
  staging: unisys: refactor pause_device()
  staging: unisys: refactor resume_device()
  staging: unisys: refactor destroy_device()
  staging: unisys: refactor delete_bus_glue()
  staging: unisys: refactor delete_device_glue()
  staging: unisys: refactor info_debugfs_read()
  staging: unisys: refactor fi

[PATCH] clocking-wizard: fix one coding style problem.

2015-02-15 Thread Tan Nguyen
Added one line after variable declaration.

Signed-off-by: Tan Nguyen 
---
 drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c 
b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
index 471d087..9a7b369 100644
--- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
+++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
@@ -239,6 +239,7 @@ static int clk_wzrd_probe(struct platform_device *pdev)
/* register div per output */
for (i = WZRD_NUM_OUTPUTS - 1; i >= 0 ; i--) {
const char *clkout_name;
+
if (of_property_read_string_index(np, "clock-output-names", i,
  &clkout_name)) {
dev_err(&pdev->dev,
-- 
1.9.1

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


[PATCH 2/6] Drivers: hv: vmbus: Introduce a function to remove a rescinded offer

2015-02-15 Thread K. Y. Srinivasan
In response to a rescind message, we need to remove the channel and the
corresponding device. Cleanup this code path by factoring out the code
to remove a channel.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/channel.c  |9 
 drivers/hv/channel_mgmt.c |   49 +++-
 drivers/hv/vmbus_drv.c|   11 +-
 include/linux/hyperv.h|1 +
 4 files changed, 50 insertions(+), 20 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index bf0cf8f..9b79aca 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -501,6 +501,15 @@ static int vmbus_close_internal(struct vmbus_channel 
*channel)
put_cpu();
}
 
+   /*
+* If the channel has been rescinded; process device removal.
+*/
+   if (channel->rescind) {
+   hv_process_channel_removal(channel,
+  channel->offermsg.child_relid);
+   return 0;
+   }
+
/* Send a closing message */
 
msg = &channel->close_msg.msg;
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 0ba6b5c..b933891 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -207,33 +207,21 @@ static void percpu_channel_deq(void *arg)
list_del(&channel->percpu_list);
 }
 
-/*
- * vmbus_process_rescind_offer -
- * Rescind the offer by initiating a device removal
- */
-static void vmbus_process_rescind_offer(struct work_struct *work)
+
+void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
 {
-   struct vmbus_channel *channel = container_of(work,
-struct vmbus_channel,
-work);
+   struct vmbus_channel_relid_released msg;
unsigned long flags;
struct vmbus_channel *primary_channel;
-   struct vmbus_channel_relid_released msg;
-   struct device *dev;
-
-   if (channel->device_obj) {
-   dev = get_device(&channel->device_obj->device);
-   if (dev) {
-   vmbus_device_unregister(channel->device_obj);
-   put_device(dev);
-   }
-   }
 
memset(&msg, 0, sizeof(struct vmbus_channel_relid_released));
-   msg.child_relid = channel->offermsg.child_relid;
+   msg.child_relid = relid;
msg.header.msgtype = CHANNELMSG_RELID_RELEASED;
vmbus_post_msg(&msg, sizeof(struct vmbus_channel_relid_released));
 
+   if (channel == NULL)
+   return;
+
if (channel->target_cpu != get_cpu()) {
put_cpu();
smp_call_function_single(channel->target_cpu,
@@ -256,6 +244,29 @@ static void vmbus_process_rescind_offer(struct work_struct 
*work)
free_channel(channel);
 }
 
+/*
+ * vmbus_process_rescind_offer -
+ * Rescind the offer by initiating a device removal
+ */
+static void vmbus_process_rescind_offer(struct work_struct *work)
+{
+   struct vmbus_channel *channel = container_of(work,
+struct vmbus_channel,
+work);
+   struct device *dev;
+
+   if (channel->device_obj) {
+   dev = get_device(&channel->device_obj->device);
+   if (dev) {
+   vmbus_device_unregister(channel->device_obj);
+   put_device(dev);
+   }
+   } else {
+   hv_process_channel_removal(channel,
+  channel->offermsg.child_relid);
+   }
+}
+
 void vmbus_free_channels(void)
 {
struct vmbus_channel *channel;
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 04bdc0f..f84ce5e 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -510,14 +510,23 @@ static int vmbus_remove(struct device *child_device)
 {
struct hv_driver *drv;
struct hv_device *dev = device_to_hv_device(child_device);
+   u32 relid = dev->channel->offermsg.child_relid;
 
if (child_device->driver) {
drv = drv_to_hv_drv(child_device->driver);
if (drv->remove)
drv->remove(dev);
-   else
+   else {
+   hv_process_channel_removal(dev->channel, relid);
pr_err("remove not set for driver %s\n",
dev_name(child_device));
+   }
+   } else {
+   /*
+* We don't have a driver for this device; deal with the
+* rescind message by removing the channel.
+*/
+   hv_process_channel_removal(dev->channel, relid);
}
 
return 0;
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 7d976ac..dd92a85 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h

[PATCH 5/6] Drivers: hv: util: On device remove, close the channel after de-initializing the service

2015-02-15 Thread K. Y. Srinivasan
When the offer is rescinded, vmbus_close() can free up the channel;
deinitialize the service before closing the channel.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/hv_util.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index c5be773..7994ec2 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -380,9 +380,9 @@ static int util_remove(struct hv_device *dev)
 {
struct hv_util_service *srv = hv_get_drvdata(dev);
 
-   vmbus_close(dev->channel);
if (srv->util_deinit)
srv->util_deinit();
+   vmbus_close(dev->channel);
kfree(srv->recv_buffer);
 
return 0;
-- 
1.7.4.1

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


[PATCH 4/6] Drivers: hv: vmbus: Remove the channel from the channel list(s) on failure

2015-02-15 Thread K. Y. Srinivasan
Properly rollback state in vmbus_pocess_offer() in the failure paths.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/channel_mgmt.c |   21 -
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index af53168..bf9b80c 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -348,7 +348,7 @@ static void vmbus_process_offer(struct vmbus_channel 
*newchannel)
&newchannel->offermsg.offer.if_instance,
newchannel);
if (!newchannel->device_obj)
-   goto err_free_chan;
+   goto err_deq_chan;
 
/*
 * Add the new device to the bus. This will kick off device-driver
@@ -360,15 +360,26 @@ static void vmbus_process_offer(struct vmbus_channel 
*newchannel)
pr_err("unable to add child device object (relid %d)\n",
   newchannel->offermsg.child_relid);
 
-   spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
-   list_del(&newchannel->listentry);
-   spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
kfree(newchannel->device_obj);
-   goto err_free_chan;
+   goto err_deq_chan;
}
 
return;
 
+err_deq_chan:
+   spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
+   list_del(&newchannel->listentry);
+   spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
+
+   if (newchannel->target_cpu != get_cpu()) {
+   put_cpu();
+   smp_call_function_single(newchannel->target_cpu,
+percpu_channel_deq, newchannel, true);
+   } else {
+   percpu_channel_deq(newchannel);
+   put_cpu();
+   }
+
 err_free_chan:
free_channel(newchannel);
 }
-- 
1.7.4.1

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


[PATCH 3/6] Drivers: hv: vmbus: Handle both rescind and offer messages in the same context

2015-02-15 Thread K. Y. Srinivasan
Execute both ressind and offer messages in the same work context. This 
serializes these
operations and naturally addresses the various corner cases.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/channel_mgmt.c |   71 
 1 files changed, 20 insertions(+), 51 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index b933891..af53168 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -244,29 +244,6 @@ void hv_process_channel_removal(struct vmbus_channel 
*channel, u32 relid)
free_channel(channel);
 }
 
-/*
- * vmbus_process_rescind_offer -
- * Rescind the offer by initiating a device removal
- */
-static void vmbus_process_rescind_offer(struct work_struct *work)
-{
-   struct vmbus_channel *channel = container_of(work,
-struct vmbus_channel,
-work);
-   struct device *dev;
-
-   if (channel->device_obj) {
-   dev = get_device(&channel->device_obj->device);
-   if (dev) {
-   vmbus_device_unregister(channel->device_obj);
-   put_device(dev);
-   }
-   } else {
-   hv_process_channel_removal(channel,
-  channel->offermsg.child_relid);
-   }
-}
-
 void vmbus_free_channels(void)
 {
struct vmbus_channel *channel;
@@ -281,11 +258,8 @@ void vmbus_free_channels(void)
  * vmbus_process_offer - Process the offer by creating a channel/device
  * associated with this offer
  */
-static void vmbus_process_offer(struct work_struct *work)
+static void vmbus_process_offer(struct vmbus_channel *newchannel)
 {
-   struct vmbus_channel *newchannel = container_of(work,
-   struct vmbus_channel,
-   work);
struct vmbus_channel *channel;
bool fnew = true;
bool enq = false;
@@ -351,7 +325,7 @@ static void vmbus_process_offer(struct work_struct *work)
if (channel->sc_creation_callback != NULL)
channel->sc_creation_callback(newchannel);
 
-   goto done_init_rescind;
+   return;
}
 
goto err_free_chan;
@@ -392,15 +366,9 @@ static void vmbus_process_offer(struct work_struct *work)
kfree(newchannel->device_obj);
goto err_free_chan;
}
-done_init_rescind:
-   spin_lock_irqsave(&newchannel->lock, flags);
-   /* The next possible work is rescind handling */
-   INIT_WORK(&newchannel->work, vmbus_process_rescind_offer);
-   /* Check if rescind offer was already received */
-   if (newchannel->rescind)
-   queue_work(newchannel->controlwq, &newchannel->work);
-   spin_unlock_irqrestore(&newchannel->lock, flags);
+
return;
+
 err_free_chan:
free_channel(newchannel);
 }
@@ -526,8 +494,7 @@ static void vmbus_onoffer(struct 
vmbus_channel_message_header *hdr)
newchannel->monitor_grp = (u8)offer->monitorid / 32;
newchannel->monitor_bit = (u8)offer->monitorid % 32;
 
-   INIT_WORK(&newchannel->work, vmbus_process_offer);
-   queue_work(newchannel->controlwq, &newchannel->work);
+   vmbus_process_offer(newchannel);
 }
 
 /*
@@ -540,28 +507,30 @@ static void vmbus_onoffer_rescind(struct 
vmbus_channel_message_header *hdr)
struct vmbus_channel_rescind_offer *rescind;
struct vmbus_channel *channel;
unsigned long flags;
+   struct device *dev;
 
rescind = (struct vmbus_channel_rescind_offer *)hdr;
channel = relid2channel(rescind->child_relid);
 
-   if (channel == NULL)
-   /* Just return here, no channel found */
+   if (channel == NULL) {
+   hv_process_channel_removal(NULL, rescind->child_relid);
return;
+   }
 
spin_lock_irqsave(&channel->lock, flags);
channel->rescind = true;
-   /*
-* channel->work.func != vmbus_process_rescind_offer means we are still
-* processing offer request and the rescind offer processing should be
-* postponed. It will be done at the very end of vmbus_process_offer()
-* as rescind flag is being checked there.
-*/
-   if (channel->work.func == vmbus_process_rescind_offer)
-   /* work is initialized for vmbus_process_rescind_offer() from
-* vmbus_process_offer() where the channel got created */
-   queue_work(channel->controlwq, &channel->work);
-
spin_unlock_irqrestore(&channel->lock, flags);
+
+   if (channel->device_obj) {
+   dev = get_device(&channel->device_obj->device);
+   if (dev) {
+   vmbus_device_unregister(channel->device_obj);

[PATCH 0/6] Drivers: hv: vmbus

2015-02-15 Thread K. Y. Srinivasan
The host can rescind an offer any time after the offer has been made
to the guest. This patch-set cleans up how we handle rescind messages
from the host.


K. Y. Srinivasan (6):
  Drivers: hv: vmbus: Properly handle child device remove
  Drivers: hv: vmbus: Introduce a function to remove a rescinded offer
  Drivers: hv: vmbus: Handle both rescind and offer messages in the
same context
  Drivers: hv: vmbus: Remove the channel from the channel list(s) on
failure
  Drivers: hv: util: On device remove, close the channel after
de-initializing the service
  Drivers: hv: vmbus: Get rid of some unnecessary messages

 drivers/hv/channel.c  |9 
 drivers/hv/channel_mgmt.c |   95 
 drivers/hv/connection.c   |7 +---
 drivers/hv/hv_util.c  |2 +-
 drivers/hv/vmbus_drv.c|   26 +---
 include/linux/hyperv.h|1 +
 6 files changed, 74 insertions(+), 66 deletions(-)

-- 
1.7.4.1

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


[PATCH 1/6] Drivers: hv: vmbus: Properly handle child device remove

2015-02-15 Thread K. Y. Srinivasan
Handle the case when the device may be removed when the device has no driver
attached to it.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/vmbus_drv.c |   15 +--
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index da4333b..04bdc0f 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -508,14 +508,17 @@ static int vmbus_probe(struct device *child_device)
  */
 static int vmbus_remove(struct device *child_device)
 {
-   struct hv_driver *drv = drv_to_hv_drv(child_device->driver);
+   struct hv_driver *drv;
struct hv_device *dev = device_to_hv_device(child_device);
 
-   if (drv->remove)
-   drv->remove(dev);
-   else
-   pr_err("remove not set for driver %s\n",
-   dev_name(child_device));
+   if (child_device->driver) {
+   drv = drv_to_hv_drv(child_device->driver);
+   if (drv->remove)
+   drv->remove(dev);
+   else
+   pr_err("remove not set for driver %s\n",
+   dev_name(child_device));
+   }
 
return 0;
 }
-- 
1.7.4.1

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


[PATCH 6/6] Drivers: hv: vmbus: Get rid of some unnecessary messages

2015-02-15 Thread K. Y. Srinivasan
Currently we log messages when either we are not able to map an ID to a
channel or when the channel does not have a callback associated
(in the channel interrupt handling path). These messages don't add
any value, get rid of them.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/connection.c |7 +--
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index af2388f..583d7d4 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -318,10 +318,8 @@ static void process_chn_event(u32 relid)
 */
channel = pcpu_relid2channel(relid);
 
-   if (!channel) {
-   pr_err("channel not found for relid - %u\n", relid);
+   if (!channel)
return;
-   }
 
/*
 * A channel once created is persistent even when there
@@ -356,10 +354,7 @@ static void process_chn_event(u32 relid)
else
bytes_to_read = 0;
} while (read_state && (bytes_to_read != 0));
-   } else {
-   pr_err("no channel callback for relid - %u\n", relid);
}
-
 }
 
 /*
-- 
1.7.4.1

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


Re: [PATCH v8 2/4] fpga manager: add sysfs interface document

2015-02-15 Thread Pavel Machek
On Wed 2015-01-21 13:27:00, Jason Gunthorpe wrote:
> On Wed, Jan 21, 2015 at 06:33:12PM +0200, Pantelis Antoniou wrote:
> > Hi Alan,
> > 
> > > On Jan 21, 2015, at 18:01 , One Thousand Gnomes 
> > >  wrote:
> > > 
> > > On Thu, 15 Jan 2015 22:54:46 +0200
> > > Pantelis Antoniou  wrote:
> > > 
> > >> Hi Alan,
> > >> 
> > >>> On Jan 15, 2015, at 22:45 , One Thousand Gnomes 
> > >>>  wrote:
> > >>> 
> > >>> On Thu, 15 Jan 2015 11:47:26 -0700
> > >>> Jason Gunthorpe  wrote:
> >  It is a novel idea, my concern would be that embedding the FPGA in the
> >  DT makes it permanent unswappable kernel memory.
> >  Not having the kernel hold the FPGA is best for many uses.
> > >>> 
> > >>> If you have a filesysytem before the FPGA is set up then it belongs in
> > >>> the file system. As you presumably loaded the kernel from somewhere 
> > >>> there
> > >>> ought to be a file system (even an initrd).
> > >>> 
> > >> 
> > >> Request firmware does not imply keeping it around. You can always 
> > >> re-request
> > >> when reloading (although there’s a nasty big of caching that needs to be
> > >> resolved with the firmware loader).
> > > 
> > > Which comes down to the same thing. Unless you can prove that there is a
> > > path to recover the firmware file that does not have any dependancies
> > > upon the firmware executing (and those can be subtle and horrid at times)
> > > you need to keep it around for suspend/resume at least and potentially
> > > any unexpected error/reset.
> > > 
> > 
> > In that case the only safe place to put it is in the kernel image itself, 
> > which
> > is something the firmware loader already supports.
> 
> My point is that the current firmware layer is overly cautious and
> FPGAs are very big. My current project on small Xilinx device has a
> 10MB programming file. The biggest Xilinx device today has a max
> bitfile size around 122MB.
> 
> So keeping that much memory pinned in the kernel when I can prove it
> is uncessary for my system (either because there is no suspend/resume
> possibility, or because I know the CPU can always access the
> filesytem) is very undesirable.

Well, your current device aalso has 1GB RAM, no?

> Other systems might have to take the ram hit.

I'd say the general case is "store bitstream in RAM" we can add
optimalizations later.

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 1/2] dgnc: Remove superfluous EXTRA_CFLAGS variable

2015-02-15 Thread Cass May
Clean up Makefile by removing unnecessary definition of DG_NAME.

Signed-off-by: Cass May 
---
Having done some build tests, it seems that DG_NAME is not needed, 
but DG_PART is referenced in dgnc_mgmt.c. I have removed the former, 
and moved the latter into the appropriate header. 

 drivers/staging/dgnc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile
index b69f7b6..84cc98d 100644
--- a/drivers/staging/dgnc/Makefile
+++ b/drivers/staging/dgnc/Makefile
@@ -1,4 +1,4 @@
-EXTRA_CFLAGS += -DDG_NAME=\"dgnc-1.3-16\" -DDG_PART=\"40002369_F\"
+EXTRA_CFLAGS += -DDG_PART=\"40002369_F\"
 
 obj-$(CONFIG_DGNC) += dgnc.o
 
-- 
2.1.4

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


[PATCH 2/2] dgnc: Move DG_PART definition from Makefile to dgnc_driver.h

2015-02-15 Thread Cass May
Avoid deprecated usage of EXTRA_CFLAGS by moving definition of DG_PART into 
dgnc_driver.h

Signed-off-by: Cass May 
---
 drivers/staging/dgnc/Makefile  | 2 --
 drivers/staging/dgnc/dgnc_driver.h | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile
index 84cc98d..995c874 100644
--- a/drivers/staging/dgnc/Makefile
+++ b/drivers/staging/dgnc/Makefile
@@ -1,5 +1,3 @@
-EXTRA_CFLAGS += -DDG_PART=\"40002369_F\"
-
 obj-$(CONFIG_DGNC) += dgnc.o
 
 dgnc-objs :=   dgnc_cls.o dgnc_driver.o\
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index a8157eb..dd715eb 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -46,6 +46,7 @@
 #definePROCSTR "dgnc"  /* /proc entries
 */
 #defineDEVSTR  "/dev/dg/dgnc"  /* /dev entries 
 */
 #defineDRVSTR  "dgnc"  /* Driver name string   
 */
+#defineDG_PART "40002369_F"/* RPM part number  
 */
 
 #define TRC_TO_CONSOLE 1
 
-- 
2.1.4

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


[PATCH 0/4 linux-next] staging: unisys: a few checkpatch fixes

2015-02-15 Thread Frederico Cadete
Here are a few fixes of style warnings detected by checkpatch.pl in
drivers/staging/unisys.

Patches were generated on top of linux-next 20150213; let me know if a rebase
on top of another tag is preferred.

Frederico Cadete (4):
  staging: unisys: declare visorchipset_ioctl static
  staging: unisys: remove unused MESSAGE_ENVELOPE typedef
  staging: unisys: style: Replace typedefs with structs in
visorchipset_main.c
  staging: unisys: style: remove unnecessary braces

 .../unisys/visorchannel/visorchannel_funcs.c   |  6 ++
 drivers/staging/unisys/visorchipset/file.c |  6 --
 .../unisys/visorchipset/visorchipset_main.c| 25 +-
 3 files changed, 16 insertions(+), 21 deletions(-)

-- 
2.1.4

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


[PATCH 2/4] staging: unisys: remove unused MESSAGE_ENVELOPE typedef

2015-02-15 Thread Frederico Cadete
Signed-off-by: Frederico Cadete 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f606ee9..848afaa 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -70,11 +70,6 @@ static struct delayed_work Periodic_controlvm_work;
 static struct workqueue_struct *Periodic_controlvm_workqueue;
 static DEFINE_SEMAPHORE(NotifierLock);
 
-typedef struct {
-   struct controlvm_message message;
-   unsigned int crc;
-} MESSAGE_ENVELOPE;
-
 static struct controlvm_message_header g_DiagMsgHdr;
 static struct controlvm_message_header g_ChipSetMsgHdr;
 static struct controlvm_message_header g_DelDumpMsgHdr;
-- 
2.1.4

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


[PATCH 3/4] staging: unisys: style: Replace typedefs with structs in visorchipset_main.c

2015-02-15 Thread Frederico Cadete
Signed-off-by: Frederico Cadete 
---
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 848afaa..9c5b190 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -98,19 +98,19 @@ static LIST_HEAD(DevInfoList);
 
 static struct visorchannel *ControlVm_channel;
 
-typedef struct {
+struct CONTROLVM_PAYLOAD_INFO {
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 */
-} CONTROLVM_PAYLOAD_INFO;
+};
 
 /* Manages the request payload in the controlvm channel */
-static CONTROLVM_PAYLOAD_INFO ControlVm_payload_info;
+static struct CONTROLVM_PAYLOAD_INFO ControlVm_payload_info;
 
 static struct channel_header *Test_Vnic_channel;
 
-typedef struct {
+struct LIVEDUMP_INFO {
struct controlvm_message_header Dumpcapture_header;
struct controlvm_message_header Gettextdump_header;
struct controlvm_message_header Dumpcomplete_header;
@@ -119,11 +119,11 @@ typedef struct {
ulong length;
atomic_t buffers_in_use;
ulong destination;
-} LIVEDUMP_INFO;
+};
 /* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
  * CONTROLVM_DUMP_GETTEXTDUMP / CONTROLVM_DUMP_COMPLETE conversation.
  */
-static LIVEDUMP_INFO LiveDump_info;
+static struct LIVEDUMP_INFO LiveDump_info;
 
 /* The following globals are used to handle the scenario where we are unable to
  * offload the payload from a controlvm message due to memory requirements.  In
@@ -1379,7 +1379,7 @@ Away:
  */
 static int
 initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes,
- CONTROLVM_PAYLOAD_INFO *info)
+ struct CONTROLVM_PAYLOAD_INFO *info)
 {
u8 __iomem *payload = NULL;
int rc = CONTROLVM_RESP_SUCCESS;
@@ -1390,7 +1390,7 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, 
u64 offset, u32 bytes,
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
goto Away;
}
-   memset(info, 0, sizeof(CONTROLVM_PAYLOAD_INFO));
+   memset(info, 0, sizeof(struct CONTROLVM_PAYLOAD_INFO));
if ((offset == 0) || (bytes == 0)) {
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: 
request_payload_offset=%llu request_payload_bytes=%llu!",
 (u64) offset, (u64) bytes);
@@ -1422,13 +1422,13 @@ Away:
 }
 
 static void
-destroy_controlvm_payload_info(CONTROLVM_PAYLOAD_INFO *info)
+destroy_controlvm_payload_info(struct CONTROLVM_PAYLOAD_INFO *info)
 {
if (info->ptr != NULL) {
iounmap(info->ptr);
info->ptr = NULL;
}
-   memset(info, 0, sizeof(CONTROLVM_PAYLOAD_INFO));
+   memset(info, 0, sizeof(struct CONTROLVM_PAYLOAD_INFO));
 }
 
 static void
-- 
2.1.4

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


[PATCH 4/4] staging: unisys: style: remove unnecessary braces

2015-02-15 Thread Frederico Cadete
Signed-off-by: Frederico Cadete 
---
 drivers/staging/unisys/visorchannel/visorchannel_funcs.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c 
b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
index 0188ef8..4d11b51 100644
--- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
+++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
@@ -416,9 +416,8 @@ signalremove_inner(struct visorchannel *channel, u32 queue, 
void *msg)
 {
struct signal_queue_header sig_hdr;
 
-   if (!sig_read_header(channel, queue, &sig_hdr)) {
+   if (!sig_read_header(channel, queue, &sig_hdr))
return FALSE;
-   }
if (sig_hdr.head == sig_hdr.tail)
return FALSE;   /* no signals to remove */
 
@@ -466,9 +465,8 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, 
void *msg)
 {
struct signal_queue_header sig_hdr;
 
-   if (!sig_read_header(channel, queue, &sig_hdr)) {
+   if (!sig_read_header(channel, queue, &sig_hdr))
return FALSE;
-   }
 
sig_hdr.head = ((sig_hdr.head + 1) % sig_hdr.max_slots);
if (sig_hdr.head == sig_hdr.tail) {
-- 
2.1.4

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


[PATCH 1/4] staging: unisys: declare visorchipset_ioctl static

2015-02-15 Thread Frederico Cadete
This symbol is not exported nor referenced anywhere else in the kernel.

Signed-off-by: Frederico Cadete 
---
 drivers/staging/unisys/visorchipset/file.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index e51fd4e..b2b1b61 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -36,7 +36,8 @@ static BOOL registered = FALSE;
 static int visorchipset_open(struct inode *inode, struct file *file);
 static int visorchipset_release(struct inode *inode, struct file *file);
 static int visorchipset_mmap(struct file *file, struct vm_area_struct *vma);
-long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long 
arg);
+static long visorchipset_ioctl(struct file *file, unsigned int cmd,
+   unsigned long arg);
 
 static const struct file_operations visorchipset_fops = {
.owner = THIS_MODULE,
@@ -165,7 +166,8 @@ visorchipset_mmap(struct file *file, struct vm_area_struct 
*vma)
return 0;
 }
 
-long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+static long visorchipset_ioctl(struct file *file, unsigned int cmd,
+   unsigned long arg)
 {
s64 adjustment;
s64 vrtc_offset;
-- 
2.1.4

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


RE: [PATCH 0/6] Drivers: hv: vmbus

2015-02-15 Thread Dexuan Cui
> -Original Message-
> From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On Behalf
> Of K. Y. Srinivasan
> Sent: Monday, February 16, 2015 4:11 AM
> To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> vkuzn...@redhat.com
> Subject: [PATCH 0/6] Drivers: hv: vmbus
> 
> The host can rescind an offer any time after the offer has been made
> to the guest. This patch-set cleans up how we handle rescind messages
> from the host.
> 
> 
> K. Y. Srinivasan (6):
>   Drivers: hv: vmbus: Properly handle child device remove
>   Drivers: hv: vmbus: Introduce a function to remove a rescinded offer
>   Drivers: hv: vmbus: Handle both rescind and offer messages in the
> same context
>   Drivers: hv: vmbus: Remove the channel from the channel list(s) on
> failure
>   Drivers: hv: util: On device remove, close the channel after
> de-initializing the service
>   Drivers: hv: vmbus: Get rid of some unnecessary messages
> 
>  drivers/hv/channel.c  |9 
>  drivers/hv/channel_mgmt.c |   95 
>  drivers/hv/connection.c   |7 +---
>  drivers/hv/hv_util.c  |2 +-
>  drivers/hv/vmbus_drv.c|   26 +---
>  include/linux/hyperv.h|1 +
>  6 files changed, 74 insertions(+), 66 deletions(-)
> 
> --

The patchset seems good to me.
Reviewed-by: Dexuan Cui 

BTW, IMO we need one more patch to remove the queue_work() in
free_channel() -- just make it an ordinary synchronous function call:

vmbus_process_offer() can invoke free_channel() on error path,
and vmbus_process_rescind() can invoke free_channel() too.
We should exclude the possible race.

And now the controlwq and work fields of struct vmbus_channel
are useless now.

Thanks,
-- Dexuan

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


RE: [PATCH 0/6] Drivers: hv: vmbus

2015-02-15 Thread KY Srinivasan


> -Original Message-
> From: Dexuan Cui
> Sent: Sunday, February 15, 2015 7:19 PM
> To: KY Srinivasan; gre...@linuxfoundation.org; linux-
> ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de;
> a...@canonical.com; vkuzn...@redhat.com
> Subject: RE: [PATCH 0/6] Drivers: hv: vmbus
> 
> > -Original Message-
> > From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On
> > Behalf Of K. Y. Srinivasan
> > Sent: Monday, February 16, 2015 4:11 AM
> > To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org;
> > de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> > vkuzn...@redhat.com
> > Subject: [PATCH 0/6] Drivers: hv: vmbus
> >
> > The host can rescind an offer any time after the offer has been made
> > to the guest. This patch-set cleans up how we handle rescind messages
> > from the host.
> >
> >
> > K. Y. Srinivasan (6):
> >   Drivers: hv: vmbus: Properly handle child device remove
> >   Drivers: hv: vmbus: Introduce a function to remove a rescinded offer
> >   Drivers: hv: vmbus: Handle both rescind and offer messages in the
> > same context
> >   Drivers: hv: vmbus: Remove the channel from the channel list(s) on
> > failure
> >   Drivers: hv: util: On device remove, close the channel after
> > de-initializing the service
> >   Drivers: hv: vmbus: Get rid of some unnecessary messages
> >
> >  drivers/hv/channel.c  |9 
> >  drivers/hv/channel_mgmt.c |   95 -
> ---
> >  drivers/hv/connection.c   |7 +---
> >  drivers/hv/hv_util.c  |2 +-
> >  drivers/hv/vmbus_drv.c|   26 +---
> >  include/linux/hyperv.h|1 +
> >  6 files changed, 74 insertions(+), 66 deletions(-)
> >
> > --
> 
> The patchset seems good to me.
> Reviewed-by: Dexuan Cui 

Dexuan,

Thank you for the review.
> 
> BTW, IMO we need one more patch to remove the queue_work() in
> free_channel() -- just make it an ordinary synchronous function call:
> 
> vmbus_process_offer() can invoke free_channel() on error path, and
> vmbus_process_rescind() can invoke free_channel() too.
> We should exclude the possible race.


I don't see the race; free_channel is only called after ensuring the channel 
cannot be discovered
by any other context. Note that we are now executing both rescind and the offer 
message in the 
same work context. With this patch-set, there are only 3 call sites for 
free_channel:
1.  hv_process_channel_removal()
2. vmbus_free_channels()
3. vmbus_process_offer()

If vmbus_process_offer() calls free_channel, the channel cannot be discovered 
via its ID as we remove
The chanel from the global as well as the per-cpu lists. In this case, the 
channel is destroyed and nobody
can get a reference to it.
> 
> And now the controlwq and work fields of struct vmbus_channel are useless
> now.

Yes; we can get rid of this now. I will have that in a separate patch.

Regards,

K. Y


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