Re: [PATCH v4 5/8] bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2

2016-12-15 Thread kbuild test robot
Hi Roy,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on next-20161215]
[cannot apply to v4.9]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Stuart-Yoder/staging-fsl-mc-add-dpio-driver/20161216-114620
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64 

All errors (new ones prefixed by >>):

>> drivers/staging/fsl-mc/bus/dpio/qbman-portal.c:996:10: error: expected 
>> declaration specifiers or '...' before numeric constant
 64 ctx)
 ^~

vim +996 drivers/staging/fsl-mc/bus/dpio/qbman-portal.c

   990  u16 ch;
   991  u8 reserved[60];
   992  };
   993  
   994  int qbman_swp_CDAN_set(struct qbman_swp *s, u16 channelid,
   995 u8 we_mask, u8 cdan_en,
 > 996 64 ctx)
   997  {
   998  struct qbman_cdan_ctrl_desc *p = NULL;
   999  struct qbman_cdan_ctrl_rslt *r = NULL;

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 3/3] hv_netvsc: Implement VF matching based on serial numbers

2016-12-15 Thread KY Srinivasan


> -Original Message-
> From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On
> Behalf Of Stephen Hemminger
> Sent: Wednesday, December 14, 2016 3:52 PM
> To: Greg KH 
> Cc: o...@aepfle.de; jasow...@redhat.com; linux-ker...@vger.kernel.org;
> bjorn.helg...@gmail.com; a...@canonical.com;
> de...@linuxdriverproject.org; leann.ogasaw...@canonical.com; Haiyang
> Zhang 
> Subject: Re: [PATCH 3/3] hv_netvsc: Implement VF matching based on serial
> numbers
> 
> On Wed, 14 Dec 2016 15:27:58 -0800
> Greg KH  wrote:
> 
> > On Wed, Dec 14, 2016 at 11:18:59PM +, Haiyang Zhang wrote:
> > >
> > >
> > > > -Original Message-
> > > > From: Greg KH [mailto:gre...@linuxfoundation.org]
> > > > Sent: Saturday, December 10, 2016 7:21 AM
> > > > To: Stephen Hemminger 
> > > > Cc: Haiyang Zhang ; o...@aepfle.de;
> > > > jasow...@redhat.com; linux-ker...@vger.kernel.org;
> > > > bjorn.helg...@gmail.com; a...@canonical.com;
> de...@linuxdriverproject.org;
> > > > leann.ogasaw...@canonical.com
> > > > Subject: Re: [PATCH 3/3] hv_netvsc: Implement VF matching based on
> > > > serial numbers
> > > >
> > > > On Fri, Dec 09, 2016 at 04:21:48PM -0800, Stephen Hemminger wrote:
> > > > > On Fri, 9 Dec 2016 22:35:05 +
> > > > > Haiyang Zhang  wrote:
> > > > >
> > > > > > > > >
> > > > > > > > > Emulated NIC is already excluded in start of netvc notifier
> > > > handler.
> > > > > > > > >
> > > > > > > > > static int netvsc_netdev_event(struct notifier_block *this,
> > > > > > > > >  unsigned long event, void *ptr)
> > > > > > > > > {
> > > > > > > > >   struct net_device *event_dev =
> > > > netdev_notifier_info_to_dev(ptr);
> > > > > > > > >
> > > > > > > > >   /* Skip our own events */
> > > > > > > > >   if (event_dev->netdev_ops == _ops)
> > > > > > > > >   return NOTIFY_DONE;
> > > > > > > > >
> > > > > > > >
> > > > > > > > Emulated device is not based on netvsc. It's the native Linux
> > > > > > > (dec100M?)
> > > > > > > > Driver. So this line doesn't exclude it. And how about other NIC
> > > > type
> > > > > > > > may be added in the future?
> > > > > > >
> > > > > > > Sorry, forgot about that haven't used emulated device in years.
> > > > > > > The emulated device should appear to be on a PCI bus, but the
> > > > serial
> > > > > > > would not match??
> > > > > >
> > > > > > It's not a vmbus device, not a hv_pci device either. Hv_PCI is a
> > > > subset
> > > > > > of vmbus devices. So emulated NIC won't have hv_pci serial
> number.
> > > > > >
> > > > > > In my patch, the following code ensure, we only try to get serial
> > > > number
> > > > > > after confirming it's vmbus and hv_pci device:
> > > > > >
> > > > > > +   if (!dev_is_vmbus(dev))
> > > > > > +   continue;
> > > > > > +
> > > > > > +   hdev = device_to_hv_device(dev);
> > > > > > +   if (hdev->device_id != HV_PCIE)
> > > > > > +   continue;
> > > > >
> > > > > Ok, the walk back up the device tree is logically ok, but I don't
> > > > > know enough about PCI device tree to be assured that it is safe.
> > > > > Also, you could short circuit away most of the unwanted devices
> > > > > by making sure the vf_netdev->dev.parent is a PCI device.
> > > >
> > > > Ugh, this seems really really messy.  Can't we just have the
> > > > netdev_event interface pass back a pointer to something that we
> "know"
> > > > what it is?  This walking the device tree is a mess, and not good.
> > > >
> > > > I'd even argue that dev_is_pci() needs to be removed from the tree
> too,
> > > > as it shouldn't be needed either.  We did a lot of work on the driver
> > > > model to prevent the need for having to declare the "type" of 'struct
> > > > device' at all, and by doing this type of thing it goes against the
> > > > basic design of the model.
> > > >
> > > > Yes, it makes things a bit "tougher" in places, but you don't do crazy
> > > > things like walk device trees to try to find random devices and then
> > > > think it's safe to actually use them :(
> > > >
> > >
> > > We register a notifier_block with:
> > >   register_netdevice_notifier(struct notifier_block *nb)
> > >
> > > The "struct notifier_block" basically contains a callback function:
> > > struct notifier_block {
> > > notifier_fn_t notifier_call;
> > > struct notifier_block __rcu *next;
> > > int priority;
> > > };
> > >
> > > It doesn't specify which device we want, so all net devices can trigger
> > > this event. Seems we can't have this notifier return VF device only.
> >
> > Ok, I dug in the kernel and it looks like people check the netdev_ops
> > structure to see if it matches up with their function pointers to "know"
> > if this is their device or not.  Why not do that here?  Or 

RE: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread KY Srinivasan


> -Original Message-
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Thursday, December 15, 2016 6:32 AM
> To: Olaf Hering 
> Cc: KY Srinivasan ; gre...@linuxfoundation.org; linux-
> ker...@vger.kernel.org; de...@linuxdriverproject.org
> Subject: Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to
> kdump kernel
> 
> Olaf Hering  writes:
> 
> > On Thu, Dec 15, Vitaly Kuznetsov wrote:
> >
> >> vmbus_wait_for_unload() may be receiving a message (not necessarily
> the
> >> CHANNELMSG_UNLOAD_RESPONSE, we may see some other message)
> on the same
> >> CPU it runs and in this case wrmsrl() makes sense. In other cases it
> >> does nothing (neither good nor bad).
> >
> > If that other cpu has interrupts disabled it may not process a pending
> > msg (the response may be stuck in the host queue?), and the loop can not
> > kick the other cpus queue if a wrmsrl is just valid for the current cpu.
> > If thats true, the response will not arrive in the loop.
> >
> 
> In case interrupts get permanently disabled on the CPU which is supposed
> to receive the CHANNELMSG_UNLOAD_RESPONSE message *and* there is
> some
> other message pedning in the slot for that CPU we'll hang. We may try to
> overcome this by sending NMIs but this is getting more and more
> complicated...
> 
> I'd like to see a simple fix from Hyper-V host team: always deliver
> CHANNELMSG_UNLOAD_RESPONSE reply to the cpu which sent
> CHANNELMSG_UNLOAD
> request. This would allow us to remove all the craziness.

Agreed; I will give this feedback to the Hyper-V guys.

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


[PATCH v4 4/8] bus: fsl-mc: dpio: add global dpaa2 definitions

2016-12-15 Thread Stuart Yoder
From: Roy Pledge 

Create header for global dpaa2 definitions.  Add definitions
for dequeue results.

Signed-off-by: Roy Pledge 
Signed-off-by: Stuart Yoder 
---

Notes:
-v4
   -adjust file location to be in drivers/staging
   -whitespace/alignment cleanup, make dpaa2_dq_is_pull_complete()
return bool, fix spelling typo
   -updated copyright

 drivers/staging/fsl-mc/include/dpaa2-global.h | 202 ++
 1 file changed, 202 insertions(+)
 create mode 100644 drivers/staging/fsl-mc/include/dpaa2-global.h

diff --git a/drivers/staging/fsl-mc/include/dpaa2-global.h 
b/drivers/staging/fsl-mc/include/dpaa2-global.h
new file mode 100644
index 000..0326447
--- /dev/null
+++ b/drivers/staging/fsl-mc/include/dpaa2-global.h
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2014-2016 Freescale Semiconductor Inc.
+ * Copyright 2016 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *   names of its contributors may be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef __FSL_DPAA2_GLOBAL_H
+#define __FSL_DPAA2_GLOBAL_H
+
+#include 
+#include 
+#include "dpaa2-fd.h"
+
+struct dpaa2_dq {
+   union {
+   struct common {
+   u8 verb;
+   u8 reserved[63];
+   } common;
+   struct dq {
+   u8 verb;
+   u8 stat;
+   __le16 seqnum;
+   __le16 oprid;
+   u8 reserved;
+   u8 tok;
+   __le32 fqid;
+   u32 reserved2;
+   __le32 fq_byte_cnt;
+   __le32 fq_frm_cnt;
+   __le64 fqd_ctx;
+   u8 fd[32];
+   } dq;
+   struct scn {
+   u8 verb;
+   u8 stat;
+   u8 state;
+   u8 reserved;
+   __le32 rid_tok;
+   __le64 ctx;
+   } scn;
+   };
+};
+
+/* Parsing frame dequeue results */
+/* FQ empty */
+#define DPAA2_DQ_STAT_FQEMPTY   0x80
+/* FQ held active */
+#define DPAA2_DQ_STAT_HELDACTIVE0x40
+/* FQ force eligible */
+#define DPAA2_DQ_STAT_FORCEELIGIBLE 0x20
+/* valid frame */
+#define DPAA2_DQ_STAT_VALIDFRAME0x10
+/* FQ ODP enable */
+#define DPAA2_DQ_STAT_ODPVALID  0x04
+/* volatile dequeue */
+#define DPAA2_DQ_STAT_VOLATILE  0x02
+/* volatile dequeue command is expired */
+#define DPAA2_DQ_STAT_EXPIRED   0x01
+
+#define DQ_FQID_MASK   0x00FF
+#define DQ_FRAME_COUNT_MASK0x00FF
+
+/**
+ * dpaa2_dq_flags() - Get the stat field of dequeue response
+ * @dq: the dequeue result.
+ */
+static inline u32 dpaa2_dq_flags(const struct dpaa2_dq *dq)
+{
+   return dq->dq.stat;
+}
+
+/**
+ * dpaa2_dq_is_pull() - Check whether the dq response is from a pull
+ *  command.
+ * @dq: the dequeue result
+ *
+ * Return 1 for volatile(pull) dequeue, 0 for static dequeue.
+ */
+static inline int dpaa2_dq_is_pull(const struct dpaa2_dq *dq)
+{
+   return (int)(dpaa2_dq_flags(dq) & DPAA2_DQ_STAT_VOLATILE);
+}
+
+/**
+ * dpaa2_dq_is_pull_complete() - Check whether the pull command is completed.
+ * @dq: the 

[PATCH v4 5/8] bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2

2016-12-15 Thread Stuart Yoder
From: Roy Pledge 

Add QBman APIs for frame queue and buffer pool operations.

Signed-off-by: Roy Pledge 
Signed-off-by: Haiying Wang 
Signed-off-by: Stuart Yoder 
---

Notes:
-v4
   -adjust file location to be in drivers/staging
   -updated copyright
   -added definition for static dequeue token value
   -fixed bug in SDQCR #define
   -added missing #include guard in qbman-portal.h
   -added #define for QMAN_REV_MASK
   -whitespace, alignment cleanup
-v3
   -replace hardcoded dequeue token with a #define and check that
token when checking for a new result (bug fix suggested by
Ioana Radulescu)
-v2
   -fix bug in buffer release command, by setting bpid field
   -handle error (NULL) return value from qbman_swp_mc_complete()
   -error message cleanup
   -fix bug in sending management commands where the verb was
properly initialized

 drivers/staging/fsl-mc/bus/dpio/Makefile   |2 +-
 drivers/staging/fsl-mc/bus/dpio/qbman-portal.c | 1033 
 drivers/staging/fsl-mc/bus/dpio/qbman-portal.h |  469 +++
 3 files changed, 1503 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/qbman-portal.h

diff --git a/drivers/staging/fsl-mc/bus/dpio/Makefile 
b/drivers/staging/fsl-mc/bus/dpio/Makefile
index 128befc..6588498 100644
--- a/drivers/staging/fsl-mc/bus/dpio/Makefile
+++ b/drivers/staging/fsl-mc/bus/dpio/Makefile
@@ -6,4 +6,4 @@ subdir-ccflags-y := -Werror
 
 obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o
 
-fsl-mc-dpio-objs := dpio.o
+fsl-mc-dpio-objs := dpio.o qbman-portal.o
diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c 
b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
new file mode 100644
index 000..a5b5d2b
--- /dev/null
+++ b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
@@ -0,0 +1,1033 @@
+/*
+ * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
+ * Copyright 2016 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *   names of its contributors may be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+#include 
+#include 
+#include "../../include/dpaa2-global.h"
+
+#include "qbman-portal.h"
+
+#define QMAN_REV_4000   0x0400
+#define QMAN_REV_4100   0x0401
+#define QMAN_REV_4101   0x04010001
+#define QMAN_REV_MASK   0x
+
+/* All QBMan command and result structures use this "valid bit" encoding */
+#define QB_VALID_BIT ((u32)0x80)
+
+/* QBMan portal management command codes */
+#define QBMAN_MC_ACQUIRE   0x30
+#define QBMAN_WQCHAN_CONFIGURE 0x46
+
+/* CINH register offsets */
+#define QBMAN_CINH_SWP_EQAR0x8c0
+#define QBMAN_CINH_SWP_DQPI0xa00
+#define QBMAN_CINH_SWP_DCAP0xac0
+#define QBMAN_CINH_SWP_SDQCR   0xb00
+#define QBMAN_CINH_SWP_RAR 0xcc0
+#define QBMAN_CINH_SWP_ISR 0xe00
+#define QBMAN_CINH_SWP_IER 0xe40
+#define QBMAN_CINH_SWP_ISDR0xe80
+#define QBMAN_CINH_SWP_IIR 0xec0
+
+/* CENA register offsets */
+#define QBMAN_CENA_SWP_EQCR(n) (0x000 + ((u32)(n) << 6))
+#define QBMAN_CENA_SWP_DQRR(n) (0x200 + ((u32)(n) << 6))
+#define QBMAN_CENA_SWP_RCR(n)  (0x400 + ((u32)(n) << 6))
+#define QBMAN_CENA_SWP_CR  0x600

[PATCH v4 6/8] bus: fsl-mc: dpio: add the DPAA2 DPIO service interface

2016-12-15 Thread Stuart Yoder
From: Roy Pledge 

The DPIO service interface handles initialization of DPIO objects
and exports APIs to be used by other DPAA2 object drivers to perform
queuing and buffer management related operations.  The service allows
registration of callbacks when frames or notifications are received.

Signed-off-by: Roy Pledge 
Signed-off-by: Haiying Wang 
Signed-off-by: Stuart Yoder 
---

Notes:
-v4
   -updated copyright
   -adjust file location to be in drivers/staging
   -updated copyright
   -added missing free on error path
   -fixed typo in comment
   -whitespace and alignment cleanup
-v3
   -zero memory allocated for a dpio store (bug fix suggested
by Ioana Radulescu)
-v2
   -use service_select_by_cpu() for re-arming DPIO interrupts
   -replace use of NR_CPUS with num_possible_cpus()

 drivers/staging/fsl-mc/bus/dpio/Makefile   |   2 +-
 drivers/staging/fsl-mc/bus/dpio/dpio-service.c | 616 +
 drivers/staging/fsl-mc/include/dpaa2-io.h  | 139 ++
 3 files changed, 756 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio-service.c
 create mode 100644 drivers/staging/fsl-mc/include/dpaa2-io.h

diff --git a/drivers/staging/fsl-mc/bus/dpio/Makefile 
b/drivers/staging/fsl-mc/bus/dpio/Makefile
index 6588498..0778da7 100644
--- a/drivers/staging/fsl-mc/bus/dpio/Makefile
+++ b/drivers/staging/fsl-mc/bus/dpio/Makefile
@@ -6,4 +6,4 @@ subdir-ccflags-y := -Werror
 
 obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o
 
-fsl-mc-dpio-objs := dpio.o qbman-portal.o
+fsl-mc-dpio-objs := dpio.o qbman-portal.o dpio-service.o
diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-service.c 
b/drivers/staging/fsl-mc/bus/dpio/dpio-service.c
new file mode 100644
index 000..394727b
--- /dev/null
+++ b/drivers/staging/fsl-mc/bus/dpio/dpio-service.c
@@ -0,0 +1,616 @@
+/*
+ * Copyright 2014-2016 Freescale Semiconductor Inc.
+ * Copyright 2016 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *  names of its contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include 
+#include "../../include/mc.h"
+#include "../../include/dpaa2-io.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "dpio.h"
+#include "qbman-portal.h"
+
+struct dpaa2_io {
+   atomic_t refs;
+   struct dpaa2_io_desc dpio_desc;
+   struct qbman_swp_desc swp_desc;
+   struct qbman_swp *swp;
+   struct list_head node;
+   spinlock_t lock_mgmt_cmd;
+   spinlock_t lock_notifications;
+   struct list_head notifications;
+};
+
+struct dpaa2_io_store {
+   unsigned int max;
+   dma_addr_t paddr;
+   struct dpaa2_dq *vaddr;
+   void *alloced_addr;/* unaligned value from kmalloc() */
+   unsigned int idx;  /* position of the next-to-be-returned entry */
+   struct qbman_swp *swp; /* portal used to issue VDQCR */
+   struct device *dev;/* device used for DMA mapping */
+};
+
+/* keep a per cpu array of DPIOs for fast access */
+static struct dpaa2_io *dpio_by_cpu[NR_CPUS];
+static struct list_head dpio_list = LIST_HEAD_INIT(dpio_list);
+static DEFINE_SPINLOCK(dpio_list_lock);
+
+static inline struct dpaa2_io *service_select_by_cpu(struct dpaa2_io *d,
+

[PATCH v4 3/8] bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs

2016-12-15 Thread Stuart Yoder
From: Roy Pledge 

Add global definitions for DPAA2 frame descriptors and scatter
gather entries.

Signed-off-by: Roy Pledge 
Signed-off-by: Stuart Yoder 
---

Notes:
-v4
   -updated copyright
   -adjust file location to be in drivers/staging
   -address cleanup comments-- whitespace cleanup, use !! consistently
to convert expression to bool, remove unneeded parenthesis
-v3
   -no changes
-v2
   -added setter/getter for the FD ctrl field
   -corrected comment for SG format_offset field description
   -added support for short length field in FD

 drivers/staging/fsl-mc/include/dpaa2-fd.h | 448 ++
 1 file changed, 448 insertions(+)
 create mode 100644 drivers/staging/fsl-mc/include/dpaa2-fd.h

diff --git a/drivers/staging/fsl-mc/include/dpaa2-fd.h 
b/drivers/staging/fsl-mc/include/dpaa2-fd.h
new file mode 100644
index 000..21102e6
--- /dev/null
+++ b/drivers/staging/fsl-mc/include/dpaa2-fd.h
@@ -0,0 +1,448 @@
+/*
+ * Copyright 2014-2016 Freescale Semiconductor Inc.
+ * Copyright 2016 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *   names of its contributors may be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef __FSL_DPAA2_FD_H
+#define __FSL_DPAA2_FD_H
+
+#include 
+
+/**
+ * DOC: DPAA2 FD - Frame Descriptor APIs for DPAA2
+ *
+ * Frame Descriptors (FDs) are used to describe frame data in the DPAA2.
+ * Frames can be enqueued and dequeued to Frame Queues (FQs) which are consumed
+ * by the various DPAA accelerators (WRIOP, SEC, PME, DCE)
+ *
+ * There are three types of frames: single, scatter gather, and frame lists.
+ *
+ * The set of APIs in this file must be used to create, manipulate and
+ * query Frame Descriptors.
+ */
+
+/**
+ * struct dpaa2_fd - Struct describing FDs
+ * @words: for easier/faster copying the whole FD structure
+ * @addr:  address in the FD
+ * @len:   length in the FD
+ * @bpid:  buffer pool ID
+ * @format_offset: format, offset, and short-length fields
+ * @frc:   frame context
+ * @ctrl:  control bits...including dd, sc, va, err, etc
+ * @flc:   flow context address
+ *
+ * This structure represents the basic Frame Descriptor used in the system.
+ */
+struct dpaa2_fd {
+   union {
+   u32 words[8];
+   struct dpaa2_fd_simple {
+   __le64 addr;
+   __le32 len;
+   __le16 bpid;
+   __le16 format_offset;
+   __le32 frc;
+   __le32 ctrl;
+   __le64 flc;
+   } simple;
+   };
+};
+
+#define FD_SHORT_LEN_FLAG_MASK 0x1
+#define FD_SHORT_LEN_FLAG_SHIFT14
+#define FD_SHORT_LEN_MASK  0x1
+#define FD_OFFSET_MASK 0x0FFF
+#define FD_FORMAT_MASK 0x3
+#define FD_FORMAT_SHIFT12
+#define SG_SHORT_LEN_FLAG_MASK 0x1
+#define SG_SHORT_LEN_FLAG_SHIFT14
+#define SG_SHORT_LEN_MASK  0x1
+#define SG_OFFSET_MASK 0x0FFF
+#define SG_FORMAT_MASK 0x3
+#define SG_FORMAT_SHIFT12
+#define SG_BPID_MASK   0x3FFF
+#define SG_FINAL_FLAG_MASK 0x1
+#define SG_FINAL_FLAG_SHIFT15
+
+enum dpaa2_fd_format {
+ 

[PATCH v4 8/8] bus: fsl-mc: dpio: add maintainer for DPIO

2016-12-15 Thread Stuart Yoder
From: Roy Pledge 

add Roy Pledge as maintainer of DPIO

Signed-off-by: Roy Pledge 
Signed-off-by: Stuart Yoder 
---

Notes:
-v4
   -adjust file location to be in drivers/staging
-v3
   -no changes
-v2
   -corrected location of maintainer entry

 MAINTAINERS | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 8695516..add3de4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3980,6 +3980,12 @@ S:   Maintained
 F: drivers/char/dtlk.c
 F: include/linux/dtlk.h
 
+DPAA2 DATAPATH I/O (DPIO) DRIVER
+M: Roy Pledge 
+L: linux-ker...@vger.kernel.org
+S: Maintained
+F: drivers/staging/fsl-mc/bus/dpio
+
 DPT_I2O SCSI RAID DRIVER
 M: Adaptec OEM Raid Solutions 
 L: linux-s...@vger.kernel.org
-- 
1.9.0

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


[PATCH v4 2/8] bus: fsl-mc: dpio: add APIs for DPIO objects

2016-12-15 Thread Stuart Yoder
From: Ioana Radulescu 

Add the command build/parse APIs for operating on DPIO objects through
the DPAA2 Management Complex.

Signed-off-by: Ioana Radulescu 
Signed-off-by: Roy Pledge 
Signed-off-by: Stuart Yoder 
---

Notes:
-v4
  -adjust file location to be in drivers/staging
  -remove unneeded comments
  -updated copyright
-v3
  -no changes
-v2
  -removed unused structs and defines

 drivers/staging/fsl-mc/bus/Kconfig |  10 ++
 drivers/staging/fsl-mc/bus/Makefile|   3 +
 drivers/staging/fsl-mc/bus/dpio/Makefile   |   9 ++
 drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h |  76 ++
 drivers/staging/fsl-mc/bus/dpio/dpio.c | 224 +
 drivers/staging/fsl-mc/bus/dpio/dpio.h | 109 ++
 6 files changed, 431 insertions(+)
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/Makefile
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio.c
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio.h

diff --git a/drivers/staging/fsl-mc/bus/Kconfig 
b/drivers/staging/fsl-mc/bus/Kconfig
index 5c009ab..a10aaf0 100644
--- a/drivers/staging/fsl-mc/bus/Kconfig
+++ b/drivers/staging/fsl-mc/bus/Kconfig
@@ -15,3 +15,13 @@ config FSL_MC_BUS
  architecture.  The fsl-mc bus driver handles discovery of
  DPAA2 objects (which are represented as Linux devices) and
  binding objects to drivers.
+
+config FSL_MC_DPIO
+tristate "QorIQ DPAA2 DPIO driver"
+depends on FSL_MC_BUS
+help
+ Driver for the DPAA2 DPIO object.  A DPIO provides queue and
+ buffer management facilities for software to interact with
+ other DPAA2 objects. This driver does not expose the DPIO
+ objects individually, but groups them under a service layer
+ API.
diff --git a/drivers/staging/fsl-mc/bus/Makefile 
b/drivers/staging/fsl-mc/bus/Makefile
index 38716fd..577e9fa 100644
--- a/drivers/staging/fsl-mc/bus/Makefile
+++ b/drivers/staging/fsl-mc/bus/Makefile
@@ -18,3 +18,6 @@ mc-bus-driver-objs := fsl-mc-bus.o \
  irq-gic-v3-its-fsl-mc-msi.o \
  dpmcp.o \
  dpbp.o
+
+# MC DPIO driver
+obj-$(CONFIG_FSL_MC_DPIO) += dpio/
diff --git a/drivers/staging/fsl-mc/bus/dpio/Makefile 
b/drivers/staging/fsl-mc/bus/dpio/Makefile
new file mode 100644
index 000..128befc
--- /dev/null
+++ b/drivers/staging/fsl-mc/bus/dpio/Makefile
@@ -0,0 +1,9 @@
+#
+# QorIQ DPAA2 DPIO driver
+#
+
+subdir-ccflags-y := -Werror
+
+obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o
+
+fsl-mc-dpio-objs := dpio.o
diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h 
b/drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h
new file mode 100644
index 000..c237d5f
--- /dev/null
+++ b/drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
+ * Copyright 2016 NXP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the above-listed copyright holders nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _FSL_DPIO_CMD_H
+#define _FSL_DPIO_CMD_H
+
+/* DPIO Version */
+#define DPIO_VER_MAJOR 4
+#define DPIO_VER_MINOR 

[PATCH v4 0/8] staging: fsl-mc: add dpio driver

2016-12-15 Thread Stuart Yoder
This patch series adds the driver for the DPIO object which is a 
step to addressing the final item in the staging TODO list-- adding
a functional driver on top of the bus driver.  The DPIO driver is a
dependency for other functional drivers such as Ethernet.

An overview of the DPIO object and driver components are in patch 1.
Patches 2-6 are internal components of the DPIO driver-- bit twiddling
of hardware registers, DPAA2 data structures, and the queuing APIs exposed
to other drivers.

Patch 7 adds the fsl-mc driver for the DPIO object.  It provides
the probe/remove functions, demonstrating a working example of
how fsl-mc drivers initialize, interact with the management
complex hardware, map their mappable MMIO regions, initialize
interrupts, register an ISR, etc.  All other DPAA2 drivers will
follow a similar initialization pattern.

version 4 changes
   -removed the patch moving the bus driver out of staging, updated
all paths referenced in dpio (e.g. includes) to be drivers/staging
   -defined macros for constants where needed
   -copyright updates
   -cleanup: fixed whitespace, alignment issues, typos, removed unneeded
comments
   -fixed bug in SDQCR #define
   -adding missing free in an error path

version 3 changes
   -zero memory allocated for a dpio store
   -replace hardcoded dequeue token with a #define and look for
that token when checking for a new result

version 2 changes (mostly feedback from Ioana Radulescu)
   -removed unused structs and defines in dpio command definitions
   -added setter/getter for the FD ctrl field
   -corrected comment for SG format_offset field description
   -added support for short length field in FD
   -fix bug in buffer release command, by setting bpid field
   -handle error (NULL) return value from qbman_swp_mc_complete()
   -fix bug in sending management commands where the verb was
properly initialized
   -use service_select_by_cpu() for re-arming DPIO interrupts
   -replace use of NR_CPUS with num_possible_cpus()
   -handle error case where number of DPIOs exceeds number of possible
CPUs
   -error message cleanup
   -updated MAINTAINERS file with proper location for both fsl-mc bus
driver and dpio driver


Ioana Radulescu (1):
  bus: fsl-mc: dpio: add APIs for DPIO objects

Roy Pledge (6):
  bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs
  bus: fsl-mc: dpio: add global dpaa2 definitions
  bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2
  bus: fsl-mc: dpio: add the DPAA2 DPIO service interface
  bus: fsl-mc: dpio: add the DPAA2 DPIO object driver
  bus: fsl-mc: dpio: add maintainer for DPIO

Stuart Yoder (1):
  bus: fsl-mc: dpio: add DPIO driver overview document

 MAINTAINERS |6 +
 drivers/staging/fsl-mc/bus/Kconfig  |   10 +
 drivers/staging/fsl-mc/bus/Makefile |3 +
 drivers/staging/fsl-mc/bus/dpio/Makefile|9 +
 drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h  |   76 ++
 drivers/staging/fsl-mc/bus/dpio/dpio-driver.c   |  296 +++
 drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt |  135 +++
 drivers/staging/fsl-mc/bus/dpio/dpio-service.c  |  616 ++
 drivers/staging/fsl-mc/bus/dpio/dpio.c  |  224 +
 drivers/staging/fsl-mc/bus/dpio/dpio.h  |  109 +++
 drivers/staging/fsl-mc/bus/dpio/qbman-portal.c  | 1033 +++
 drivers/staging/fsl-mc/bus/dpio/qbman-portal.h  |  469 ++
 drivers/staging/fsl-mc/include/dpaa2-fd.h   |  448 ++
 drivers/staging/fsl-mc/include/dpaa2-global.h   |  202 +
 drivers/staging/fsl-mc/include/dpaa2-io.h   |  139 +++
 15 files changed, 3775 insertions(+)
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/Makefile
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio-driver.c
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio-service.c
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio.c
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio.h
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/qbman-portal.h
 create mode 100644 drivers/staging/fsl-mc/include/dpaa2-fd.h
 create mode 100644 drivers/staging/fsl-mc/include/dpaa2-global.h
 create mode 100644 drivers/staging/fsl-mc/include/dpaa2-io.h

-- 
1.9.0

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


[PATCH v4 7/8] bus: fsl-mc: dpio: add the DPAA2 DPIO object driver

2016-12-15 Thread Stuart Yoder
From: Roy Pledge 

The DPIO driver registers with the fsl-mc bus to handle bus-related
events for DPIO objects.  Key responsibility is mapping I/O
regions, setting up interrupt handlers, and calling the DPIO
service initialization during probe.

Signed-off-by: Roy Pledge 
Signed-off-by: Haiying Wang 
Signed-off-by: Stuart Yoder 
---

Notes:
-v4
   -updated copyright
   -adjust file location to be in drivers/staging
   -whitespace alignment cleanup
-v3
   -no changes
-v2
   -handle error case where number of DPIOs > NR_CPUs

 drivers/staging/fsl-mc/bus/dpio/Makefile  |   2 +-
 drivers/staging/fsl-mc/bus/dpio/dpio-driver.c | 296 ++
 2 files changed, 297 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/fsl-mc/bus/dpio/dpio-driver.c

diff --git a/drivers/staging/fsl-mc/bus/dpio/Makefile 
b/drivers/staging/fsl-mc/bus/dpio/Makefile
index 0778da7..837d330 100644
--- a/drivers/staging/fsl-mc/bus/dpio/Makefile
+++ b/drivers/staging/fsl-mc/bus/dpio/Makefile
@@ -6,4 +6,4 @@ subdir-ccflags-y := -Werror
 
 obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o
 
-fsl-mc-dpio-objs := dpio.o qbman-portal.o dpio-service.o
+fsl-mc-dpio-objs := dpio.o qbman-portal.o dpio-service.o dpio-driver.o
diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-driver.c 
b/drivers/staging/fsl-mc/bus/dpio/dpio-driver.c
new file mode 100644
index 000..e36da20
--- /dev/null
+++ b/drivers/staging/fsl-mc/bus/dpio/dpio-driver.c
@@ -0,0 +1,296 @@
+/*
+ * Copyright 2014-2016 Freescale Semiconductor Inc.
+ * Copyright NXP 2016
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ *  names of its contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "../../include/mc.h"
+#include "../../include/dpaa2-io.h"
+
+#include "qbman-portal.h"
+#include "dpio.h"
+#include "dpio-cmd.h"
+
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_AUTHOR("Freescale Semiconductor, Inc");
+MODULE_DESCRIPTION("DPIO Driver");
+
+struct dpio_priv {
+   struct dpaa2_io *io;
+};
+
+static irqreturn_t dpio_irq_handler(int irq_num, void *arg)
+{
+   struct device *dev = (struct device *)arg;
+   struct dpio_priv *priv = dev_get_drvdata(dev);
+
+   return dpaa2_io_irq(priv->io);
+}
+
+static void unregister_dpio_irq_handlers(struct fsl_mc_device *dpio_dev)
+{
+   struct fsl_mc_device_irq *irq;
+
+   irq = dpio_dev->irqs[0];
+
+   /* clear the affinity hint */
+   irq_set_affinity_hint(irq->msi_desc->irq, NULL);
+}
+
+static int register_dpio_irq_handlers(struct fsl_mc_device *dpio_dev, int cpu)
+{
+   struct dpio_priv *priv;
+   int error;
+   struct fsl_mc_device_irq *irq;
+   cpumask_t mask;
+
+   priv = dev_get_drvdata(_dev->dev);
+
+   irq = dpio_dev->irqs[0];
+   error = devm_request_irq(_dev->dev,
+irq->msi_desc->irq,
+dpio_irq_handler,
+0,
+dev_name(_dev->dev),
+_dev->dev);
+   if (error < 0) {
+   dev_err(_dev->dev,
+   "devm_request_irq() failed: %d\n",
+  

RE: [PATCH v3 7/9] bus: fsl-mc: dpio: add the DPAA2 DPIO service interface

2016-12-15 Thread Stuart Yoder
> > +struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc)
> > +{
> > +   struct dpaa2_io *obj = kmalloc(sizeof(*obj), GFP_KERNEL);
> > +
> > +   if (!obj)
> > +   return NULL;
> > +
> > +   /* check if CPU is out of range (-1 means any cpu) */
> > +   if (desc->cpu >= num_possible_cpus())
> 
> We leak 'obj' on this error path.

Will fix.

> > +
> > +/**
> > + * dpaa2_io_service_rearm() - Rearm the notification for the given DPIO 
> > service.
> > + * @service: the given DPIO service.
> 
> s/@service/@d/

Will fix.

> > +/**
> > + * dpaa2_io_store_next() - Determine when the next dequeue result is 
> > available.
> > + * @s: the dpaa2_io_store object.
> > + * @is_last: indicate whether this is the last frame in the pull command.
> > + *
> > + * When an object driver performs dequeues to a dpaa2_io_store, this 
> > function
> > + * can be used to determine when the next frame result is available. Once
> > + * this function returns non-NULL, a subsequent call to it will try to find
> > + * the next dequeue result.
> > + *
> > + * Note that if a pull-dequeue has a NULL result because the target 
> > FQ/channel
> > + * was empty, then this function will also return NULL (rather than 
> > expecting
> > + * the caller to always check for this. As such, "is_last" can be used to
> > + * differentiate between "end-of-empty-dequeue" and "still-waiting".
> > + *
> > + * Return dequeue result for a valid dequeue result, or NULL for empty 
> > dequeue.
> > + */
> > +struct dpaa2_dq *dpaa2_io_store_next(struct dpaa2_io_store *s, int 
> > *is_last)
> 
> "bool *is_last"?

Same comment here as on the other patch...let's get Roy's input on this
and make it a TODO if deemed a good idea.

Thanks,
Stuartt

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


Re: [PATCH 8/8] Makefile: drop -D__CHECK_ENDIAN__ from cflags

2016-12-15 Thread Arend Van Spriel
On 15-12-2016 6:15, Michael S. Tsirkin wrote:
> That's the default now, no need for makefiles to set it.
> 
> Signed-off-by: Michael S. Tsirkin 
> ---
>  drivers/bluetooth/Makefile| 2 --
>  drivers/net/can/Makefile  | 1 -
>  drivers/net/ethernet/altera/Makefile  | 1 -
>  drivers/net/ethernet/atheros/alx/Makefile | 1 -
>  drivers/net/ethernet/freescale/Makefile   | 2 --
>  drivers/net/wireless/ath/Makefile | 2 --
>  drivers/net/wireless/ath/wil6210/Makefile | 2 --
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile | 2 --
>  drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile | 1 -

For brcm80211 drivers:

Acked-by: Arend van Spriel 

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


[PATCH 10/14 V2] rtlwifi: rtl8192cu: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent.
---
 .../net/wireless/realtek/rtlwifi/rtl8192cu/hw.c| 33 --
 .../net/wireless/realtek/rtlwifi/rtl8192cu/led.c   |  6 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c   | 12 +++-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   | 12 +++-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/sw.c|  5 ++--
 6 files changed, 24 insertions(+), 47 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
index aa3d559..dce13d6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
@@ -452,8 +452,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
break;
}
if (pollingCount++ > 100) {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Failed to polling REG_APS_FSMCO[PFM_ALDN] 
done!\n");
+   pr_err("Failed to polling REG_APS_FSMCO[PFM_ALDN] 
done!\n");
return -ENODEV;
}
} while (true);
@@ -486,8 +485,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
break;
}
if (pollingCount++ > 1000) {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Failed to polling REG_APS_FSMCO[APFM_ONMAC] 
done!\n");
+   pr_err("Failed to polling REG_APS_FSMCO[APFM_ONMAC] 
done!\n");
return -ENODEV;
}
} while (true);
@@ -687,7 +685,6 @@ static void 
_rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw,
  u8 queue_sel)
 {
u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
-   struct rtl_priv *rtlpriv = rtl_priv(hw);
 
if (!wmm_enable) { /* typical setting */
beQ = QUEUE_LOW;
@@ -705,8 +702,7 @@ static void 
_rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw,
hiQ = QUEUE_HIGH;
}
_rtl92c_init_chipN_reg_priority(hw, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
-queue_sel);
+   pr_info("Tx queue select :0x%02x..\n", queue_sel);
 }
 
 static void _rtl92cu_init_chipN_queue_priority(struct ieee80211_hw *hw,
@@ -765,8 +761,7 @@ static void _rtl92cu_init_chipT_queue_priority(struct 
ieee80211_hw *hw,
break;
}
rtl_write_byte(rtlpriv, (REG_TRXDMA_CTRL+1), hq_sele);
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
-hq_sele);
+   pr_info("Tx queue select :0x%02x..\n", hq_sele);
 }
 
 static void _rtl92cu_init_queue_priority(struct ieee80211_hw *hw,
@@ -848,8 +843,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
err = _rtl92cu_init_power_on(hw);
 
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to init power on!\n");
+   pr_err("Failed to init power on!\n");
return err;
}
if (!wmm_enable) {
@@ -860,8 +854,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
: WMM_CHIP_A_TX_PAGE_BOUNDARY;
}
if (false == rtl92c_init_llt_table(hw, boundary)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to init LLT Table!\n");
+   pr_err("Failed to init LLT Table!\n");
return -EINVAL;
}
_rtl92cu_init_queue_reserved_page(hw, wmm_enable, out_ep_nums,
@@ -986,7 +979,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
rtlhal->hw_type = HARDWARE_TYPE_RTL8192CU;
err = _rtl92cu_init_mac(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "init mac failed!\n");
+   pr_err("init mac failed!\n");
goto exit;
}
err = rtl92c_download_fw(hw);
@@ -1099,8 +1092,7 @@ static void  _ResetDigitalProcedure1(struct ieee80211_hw 
*hw, bool bWithoutHWSM)
udelay(50);
}
if (retry_cnts >= 100) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"#=> 8051 reset 
failed!.\n");
+   pr_err("8051 reset 

[PATCH 12/14 V2] rtlwifi: rtl8192c-common: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent.
---
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c  | 33 ++
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 13 -
 2 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
index 4a49e66..e739e56 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -145,10 +145,8 @@ static void _rtl92c_write_fw(struct ieee80211_hw *hw,
pageNums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;
 
-   if (pageNums > 4) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 4\n");
-   }
+   if (pageNums > 4)
+   pr_err("Page numbers should not greater then 4\n");
 
for (page = 0; page < pageNums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -180,15 +178,10 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
 (!(value32 & FWDL_ChkSum_rpt)));
 
if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+   pr_err("chksum report fail! REG_MCUFWDL:0x%08x .\n",
+  value32);
goto exit;
}
-
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -198,20 +191,15 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
 
do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
-   if (value32 & WINTINI_RDY) {
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Polling FW ready success!! REG_MCUFWDL:0x%08x 
.\n",
-   value32);
-   err = 0;
-   goto exit;
-   }
+   if (value32 & WINTINI_RDY)
+   return 0;
 
mdelay(FW_8192C_POLLING_DELAY);
 
} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
+   pr_err("Polling FW ready fail! REG_MCUFWDL:0x%08x.\n",
+  value32);
 
 exit:
return err;
@@ -251,8 +238,7 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
 
err = _rtl92c_fw_free_to_go(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
 "Firmware is ready to run!\n");
@@ -327,8 +313,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw 
*hw,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
index 30c2d12..5f8fa4a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
@@ -104,7 +104,7 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0x3f;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+   pr_err("return all one\n");
return 0x;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -152,7 +152,7 @@ void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = >phyreg_def[rfpath];
 
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+   

[PATCH 08/14] rtlwifi: rtl8192se: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent, and remove the
 module name from the format. It is already specified by a pr_fmt().
---
 .../net/wireless/realtek/rtlwifi/rtl8192se/fw.c| 46 --
 .../net/wireless/realtek/rtlwifi/rtl8192se/hw.c| 40 +++
 .../net/wireless/realtek/rtlwifi/rtl8192se/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c   | 36 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192se/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192se/sw.c|  8 ++--
 6 files changed, 51 insertions(+), 88 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
index 32f9207..1922e78 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
@@ -113,8 +113,7 @@ static u8 _rtl92s_firmware_header_map_rftype(struct 
ieee80211_hw *hw)
case RF_2T2R:
return 0x22;
default:
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Unknown RF type(%x)\n",
-rtlphy->rf_type);
+   pr_err("Unknown RF type(%x)\n", rtlphy->rf_type);
break;
}
return 0x22;
@@ -168,9 +167,7 @@ static bool _rtl92s_firmware_downloadcode(struct 
ieee80211_hw *hw,
_rtl92s_fw_set_rqpn(hw);
 
if (buffer_len >= MAX_FIRMWARE_CODE_SIZE) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Size over FIRMWARE_CODE_SIZE!\n");
-
+   pr_err("Size over FIRMWARE_CODE_SIZE!\n");
return false;
}
 
@@ -239,9 +236,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
} while (pollingcnt--);
 
if (!(cpustatus & IMEM_CHK_RPT) || (pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"FW_STATUS_LOAD_IMEM FAIL CPU, Status=%x\n",
-cpustatus);
+   pr_err("FW_STATUS_LOAD_IMEM FAIL CPU, Status=%x\n",
+  cpustatus);
goto status_check_fail;
}
break;
@@ -257,17 +253,15 @@ static bool _rtl92s_firmware_checkready(struct 
ieee80211_hw *hw,
} while (pollingcnt--);
 
if (!(cpustatus & EMEM_CHK_RPT) || (pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"FW_STATUS_LOAD_EMEM FAIL CPU, Status=%x\n",
-cpustatus);
+   pr_err("FW_STATUS_LOAD_EMEM FAIL CPU, Status=%x\n",
+  cpustatus);
goto status_check_fail;
}
 
/* Turn On CPU */
rtstatus = _rtl92s_firmware_enable_cpu(hw);
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Enable CPU fail!\n");
+   pr_err("Enable CPU fail!\n");
goto status_check_fail;
}
break;
@@ -282,9 +276,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
} while (pollingcnt--);
 
if (!(cpustatus & DMEM_CODE_DONE) || (pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling DMEM code done fail ! 
cpustatus(%#x)\n",
-cpustatus);
+   pr_err("Polling DMEM code done fail ! cpustatus(%#x)\n",
+  cpustatus);
goto status_check_fail;
}
 
@@ -308,9 +301,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
 
if (((cpustatus & LOAD_FW_READY) != LOAD_FW_READY) ||
(pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling Load Firmware ready fail ! 
cpustatus(%x)\n",
-cpustatus);
+   pr_err("Polling Load Firmware ready fail ! 
cpustatus(%x)\n",
+  cpustatus);
goto status_check_fail;
}
 
@@ -331,8 +323,7 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
break;
 
default:
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Unknown status check!\n");
+   pr_err("Unknown status check!\n");
 

[PATCH 01/14 V2] rtlwifi: Replace local debug macro RT_ASSERT

2016-12-15 Thread Larry Finger
This macro can be replaced with WARN_ONCE. In addition to using a
standard debugging macro for these critical errors, we also get
a stack dump.

In rtl8821ae/hw.c, a senseless comment was removed, and an incorrect
indentation was fixed.

This patch also fixes two places in each of rtl8192ee, rtl8723be,
and rtl8821ae where the logical condition was incorrect.

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent.
---
 drivers/net/wireless/realtek/rtlwifi/core.c  |  8 
 drivers/net/wireless/realtek/rtlwifi/debug.h | 14 --
 drivers/net/wireless/realtek/rtlwifi/pci.c   | 12 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c | 10 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c |  8 
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c|  6 +++---
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c   | 14 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 10 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 14 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c | 15 +--
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c |  6 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 10 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 12 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c | 14 +++---
 .../wireless/realtek/rtlwifi/rtl8723com/phy_common.c |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c  | 16 
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c | 20 
 drivers/net/wireless/realtek/rtlwifi/usb.c   |  2 +-
 38 files changed, 133 insertions(+), 140 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c 
b/drivers/net/wireless/realtek/rtlwifi/core.c
index 2caa4ad..7ae774d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -1613,8 +1613,8 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum 
set_key_cmd cmd,
RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
 "set pairwise key\n");
if (!sta) {
-   RT_ASSERT(false,
- "pairwise key without mac_addr\n");
+   WARN_ONCE(true,
+ "rtlwifi: pairwise key without 
mac_addr\n");
 
err = -EOPNOTSUPP;
goto out_unlock;
@@ -1804,8 +1804,8 @@ bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, 
u8 cut_version,
 "rtl_hal_pwrseqcmdparsing(): 
PWR_CMD_END\n");
return true;
default:
-   RT_ASSERT(false,
- "rtl_hal_pwrseqcmdparsing(): Unknown 
CMD!!\n");
+   WARN_ONCE(true,
+ "rtlwifi: rtl_hal_pwrseqcmdparsing(): 
Unknown CMD!!\n");
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.h 
b/drivers/net/wireless/realtek/rtlwifi/debug.h
index 6156a79..6f2e2b9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.h
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.h
@@ -166,15 +166,6 @@ enum dbgp_flag_e {
 
 #ifdef CONFIG_RTLWIFI_DEBUG
 
-#define RT_ASSERT(_exp, fmt, ...)  \

[PATCH 13/14 V2] rtlwifi: rtl8188ee: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent, and remove the
 module name from the format. It is already specified by a pr_fmt().
---
 .../net/wireless/realtek/rtlwifi/rtl8188ee/fw.c| 33 ++
 .../net/wireless/realtek/rtlwifi/rtl8188ee/hw.c| 30 
 .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   | 22 ++-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/sw.c|  8 ++
 5 files changed, 33 insertions(+), 63 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
index c34cde2..009fd3b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
@@ -125,10 +125,8 @@ static void _rtl88e_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;
 
-   if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
-   }
+   if (pagenums > 8)
+   pr_err("Page numbers should not greater then 8\n");
 
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -157,15 +155,10 @@ static int _rtl88e_fw_free_to_go(struct ieee80211_hw *hw)
 (!(value32 & FWDL_CHKSUM_RPT)));
 
if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+   pr_err("chksum report fail! REG_MCUFWDL:0x%08x .\n",
+  value32);
goto exit;
}
-
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -176,20 +169,15 @@ static int _rtl88e_fw_free_to_go(struct ieee80211_hw *hw)
 
do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
-   if (value32 & WINTINI_RDY) {
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Polling FW ready success!! 
REG_MCUFWDL:0x%08x.\n",
- value32);
-   err = 0;
-   goto exit;
-   }
+   if (value32 & WINTINI_RDY)
+   return 0;
 
udelay(FW_8192C_POLLING_DELAY);
 
} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
+   pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+  value32);
 
 exit:
return err;
@@ -235,8 +222,7 @@ int rtl88e_download_fw(struct ieee80211_hw *hw,
 
err = _rtl88e_fw_free_to_go(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
 "Firmware is ready to run!\n");
@@ -309,8 +295,7 @@ static void _rtl88e_fill_h2c_command(struct ieee80211_hw 
*hw,
while (!write_sucess) {
wait_writeh2c_limit--;
if (wait_writeh2c_limit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index d85fa67..6aa593d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -358,8 +358,7 @@ void rtl88ee_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", variable);
+   pr_err("switch case %#x not processed\n", variable);
break;
}
 }
@@ -572,9 +571,8 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
   

[PATCH 11/14 V2] rtlwifi: rtl8192ce: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent, and remove the
 module name from the format. It is already specified by a pr_fmt().
---
 .../net/wireless/realtek/rtlwifi/rtl8192ce/hw.c| 36 --
 .../net/wireless/realtek/rtlwifi/rtl8192ce/led.c   |  6 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   | 13 +++-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/sw.c|  8 ++---
 5 files changed, 24 insertions(+), 42 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
index ce07e5c..410d48bf 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
@@ -140,8 +140,7 @@ void rtl92ce_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", variable);
+   pr_err("switch case %#x not processed\n", variable);
break;
}
 }
@@ -364,9 +363,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~AcmHw_VoqEn);
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not 
processed\n",
-e_aci);
+   pr_err("switch case %#x not 
processed\n",
+  e_aci);
break;
}
}
@@ -551,8 +549,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
rtl92c_fill_h2c_cmd(hw, H2C_92C_KEEP_ALIVE_CTRL, 2, array);
break; }
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %d not processed\n", variable);
+   pr_err("switch case %d not processed\n", variable);
break;
}
 }
@@ -573,9 +570,8 @@ static bool _rtl92ce_llt_write(struct ieee80211_hw *hw, u32 
address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("Failed to polling write LLT done at address 
%d!\n",
+  address);
status = false;
break;
}
@@ -963,7 +959,7 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)
rtlpriv->intf_ops->disable_aspm(hw);
rtstatus = _rtl92ce_init_mac(hw);
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1128,8 +1124,7 @@ static enum version_8192c 
_rtl92ce_read_chip_version(struct ieee80211_hw *hw)
break;
}
 
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Chip Version ID: %s\n", versionid);
+   pr_info("Chip Version ID: %s\n", versionid);
 
switch (version & 0x3) {
case CHIP_88C:
@@ -1143,8 +1138,7 @@ static enum version_8192c 
_rtl92ce_read_chip_version(struct ieee80211_hw *hw)
break;
default:
rtlphy->rf_type = RF_1T1R;
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"ERROR RF_Type is set!!\n");
+   pr_err("ERROR RF_Type is set!!\n");
break;
}
 
@@ -1193,8 +1187,7 @@ static int _rtl92ce_set_media_status(struct ieee80211_hw 
*hw,
 "Set Network type to Mesh Point!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not supported!\n", type);
+   pr_err("Network type %d not supported!\n", type);
return 1;
 
}
@@ -1780,7 +1773,7 @@ void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl92ce_read_adapter_info(hw);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload 

[PATCH 09/14 V2] rtlwifi: rtl8192de: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent, and remove the
 module name from the format. It is already specified by a pr_fmt().
---
 .../net/wireless/realtek/rtlwifi/rtl8192de/fw.c| 19 
 .../net/wireless/realtek/rtlwifi/rtl8192de/hw.c| 34 --
 .../net/wireless/realtek/rtlwifi/rtl8192de/led.c   |  6 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   | 31 
 .../net/wireless/realtek/rtlwifi/rtl8192de/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/sw.c|  8 ++---
 6 files changed, 36 insertions(+), 65 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
index ddbb7e8..ed6aba0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
@@ -126,8 +126,7 @@ static void _rtl92d_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192D_PAGE_SIZE;
remainSize = size % FW_8192D_PAGE_SIZE;
if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
+   pr_err("Page numbers should not greater then 8\n");
}
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192D_PAGE_SIZE;
@@ -153,9 +152,8 @@ static int _rtl92d_fw_free_to_go(struct ieee80211_hw *hw)
} while ((counter++ < FW_8192D_POLLING_TIMEOUT_COUNT) &&
 (!(value32 & FWDL_ChkSum_rpt)));
if (counter >= FW_8192D_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x\n",
-value32);
+   pr_err("chksum report fail! REG_MCUFWDL:0x%08x\n",
+  value32);
return -EIO;
}
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
@@ -327,8 +324,7 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, 0x1f, value);
spin_unlock_irqrestore(_for_fwdownload, flags);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"fw is not ready to run!\n");
+   pr_err("fw is not ready to run!\n");
goto exit;
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "fw is ready to run!\n");
@@ -407,8 +403,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw 
*hw,
while (!bwrite_success) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
boxnum = rtlhal->last_hmeboxnum;
@@ -430,8 +425,8 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw 
*hw,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", boxnum);
+   pr_err("switch case %#x not processed\n",
+  boxnum);
break;
}
isfw_read = _rtl92d_check_fw_read_last_h2c(hw, boxnum);
@@ -507,8 +501,8 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw 
*hw,
   boxcontent[idx]);
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", cmd_len);
+   pr_err("switch case %#x not processed\n",
+  cmd_len);
break;
}
bwrite_success = true;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
index fcb14c5..2c92c33 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
@@ -163,8 +163,7 @@ void rtl92de_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", variable);
+   pr_err("switch case %#x not processed\n", 

[PATCH 07/14 V2] rtlwifi: rtl8723-common: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent, and remove the
 module name from the format. It is already specified by a pr_fmt().
---
 .../net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c  | 16 ++--
 .../net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c |  4 ++--
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
index 108475e..a9cc67e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
@@ -129,8 +129,8 @@ void rtl8723_write_fw(struct ieee80211_hw *hw,
remain_size = size % FW_8192C_PAGE_SIZE;
 
if (page_nums > max_page) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater than %d\n", max_page);
+   pr_err("Page numbers should not greater than %d\n",
+  max_page);
}
for (page = 0; page < page_nums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -209,9 +208,8 @@ int rtl8723_fw_free_to_go(struct ieee80211_hw *hw, bool 
is_8723be,
 (!(value32 & FWDL_CHKSUM_RPT)));
 
if (counter >= max_count) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report fail ! REG_MCUFWDL:0x%08x .\n",
-value32);
+   pr_err("chksum report fail ! REG_MCUFWDL:0x%08x .\n",
+  value32);
goto exit;
}
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
@@ -239,9 +237,8 @@ int rtl8723_fw_free_to_go(struct ieee80211_hw *hw, bool 
is_8723be,
 
} while (counter++ < max_count);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
-value32);
+   pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+  value32);
 
 exit:
return err;
@@ -294,8 +291,7 @@ int rtl8723_download_fw(struct ieee80211_hw *hw,
 
err = rtl8723_fw_free_to_go(hw, is_8723be, max_count);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
 "Firmware is ready to run!\n");
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
index 0adae58..91a1ef0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
@@ -99,7 +99,7 @@ u32 rtl8723_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0xff;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+   pr_err("return all one\n");
return 0x;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -147,7 +147,7 @@ void rtl8723_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = >phyreg_def[rfpath];
 
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+   pr_err("stop\n");
return;
}
offset &= 0xff;
-- 
2.10.2

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


[PATCH 04/14 V2] rtlwifi: rtl8723be: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent, and remove the
 module name from the format. It is already specified by a pr_fmt().
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c  |  9 +++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c  | 16 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c |  6 ++
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 18 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c  |  3 +--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c  |  8 +++-
 6 files changed, 22 insertions(+), 38 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
index f9a2c8b..89bba11 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
@@ -97,8 +97,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
 
@@ -121,8 +120,8 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", boxnum);
+   pr_err("switch case %#x not processed\n",
+  boxnum);
break;
}
 
@@ -194,8 +192,8 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
}
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", cmd_len);
+   pr_err("switch case %#x not processed\n",
+  cmd_len);
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
index 0ae5562..2fb39f6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
@@ -747,9 +747,8 @@ static bool _rtl8723be_llt_write(struct ieee80211_hw *hw, 
u32 address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("Failed to polling write LLT done at address 
%d!\n",
+  address);
status = false;
break;
}
@@ -1383,7 +1382,7 @@ int rtl8723be_hw_init(struct ieee80211_hw *hw)
}
rtstatus = _rtl8723be_init_mac(hw);
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1532,8 +1531,7 @@ static int _rtl8723be_set_media_status(struct 
ieee80211_hw *hw,
 "Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not support!\n", type);
+   pr_err("Network type %d not support!\n", type);
return 1;
}
 
@@ -2247,7 +2245,7 @@ void rtl8723be_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl8723be_read_adapter_info(hw, false);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("Autoload ERR!!\n");
}
_rtl8723be_hal_customized_behavior(hw);
 }
@@ -2584,9 +2582,7 @@ void rtl8723be_set_key(struct ieee80211_hw *hw, u32 
key_index,
entry_id = rtl_cam_get_free_entry(hw,
p_macaddr);
if (entry_id >=  TOTAL_CAM_ENTRY) {
-  

[PATCH 05/14 V2] rtlwifi: rtl8723ae: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent.
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c  |  9 +++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c  | 19 +++
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c |  6 ++
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 18 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c  |  3 +--
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c  |  8 +++-
 6 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
index 2f398da..9136fb3 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
@@ -99,8 +99,7 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
 
@@ -123,8 +122,8 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", boxnum);
+   pr_err("switch case %#x not processed\n",
+  boxnum);
break;
}
 
@@ -229,8 +227,8 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
}
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", cmd_len);
+   pr_err("switch case %#x not processed\n",
+  cmd_len);
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index 6c51483..dff9ebb 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -570,9 +570,8 @@ static bool _rtl8723e_llt_write(struct ieee80211_hw *hw, 
u32 address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("Failed to polling write LLT done at address 
%d!\n",
+  address);
status = false;
break;
}
@@ -961,7 +960,7 @@ int rtl8723e_hw_init(struct ieee80211_hw *hw)
rtlpriv->intf_ops->disable_aspm(hw);
rtstatus = _rtl8712e_init_mac(hw);
if (rtstatus != true) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1107,8 +1106,7 @@ static enum version_8723e 
_rtl8723e_read_chip_version(struct ieee80211_hw *hw)
 "Chip Version ID: 
VERSION_NORMAL_UMC_CHIP_8723_1T1R_B_CUT.\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Chip Version ID: Unknown. Bug?\n");
+   pr_err("Chip Version ID: Unknown. Bug?\n");
break;
}
 
@@ -1157,8 +1155,7 @@ static int _rtl8723e_set_media_status(struct ieee80211_hw 
*hw,
"Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-   "Network type %d not support!\n", type);
+   pr_err("Network type %d not support!\n", type);
return 1;
break;
}
@@ -1852,7 +1849,7 @@ void rtl8723e_read_eeprom_info(struct ieee80211_hw *hw)
} else {
rtlefuse->autoload_failflag = true;
_rtl8723e_read_adapter_info(hw, false);
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   

[PATCH 03/14 V2] rtlwifi: rtl8821ae: Remove all instances of DBG_EMERG

2016-12-15 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent, and remove the
 module name from the format. It is already specified by a pr_fmt().
---
 .../net/wireless/realtek/rtlwifi/rtl8821ae/dm.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/fw.c| 11 ++
 .../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c| 15 +++-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   | 43 --
 .../net/wireless/realtek/rtlwifi/rtl8821ae/rf.c|  5 +--
 .../net/wireless/realtek/rtlwifi/rtl8821ae/sw.c| 14 +++
 6 files changed, 33 insertions(+), 58 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
index bdfd444..32900c5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
@@ -604,8 +604,7 @@ static void rtl8821ae_dm_find_minimum_rssi(struct 
ieee80211_hw *hw)
if ((mac->link_state < MAC80211_LINKED) &&
(rtlpriv->dm.entry_min_undec_sm_pwdb == 0)) {
rtl_dm_dig->min_undec_pwdb_for_dm = 0;
-   RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
-"Not connected to any\n");
+   pr_debug("rtl8821ae: Not connected to any AP\n");
}
if (mac->link_state >= MAC80211_LINKED) {
if (mac->opmode == NL80211_IFTYPE_AP ||
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
index c70face..602ac86 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -125,8 +125,7 @@ static void _rtl8821ae_write_fw(struct ieee80211_hw *hw,
remainsize = size % FW_8821AE_PAGE_SIZE;
 
if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
+   pr_err("Page numbers should not greater then 8\n");
}
 
for (page = 0; page < pagenums; page++) {
@@ -162,8 +161,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
goto exit;
}
 
-   RT_TRACE(rtlpriv, COMP_FW, DBG_EMERG,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
+   pr_err("Checksum report OK! REG_MCUFWDL:0x%08x\n",
+  value32);
 
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
@@ -186,9 +184,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
udelay(FW_8821AE_POLLING_DELAY);
} while (counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
-value32);
+   pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+  value32);
 
 exit:
return err;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index b6dc2f3..3932a5d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -822,9 +822,8 @@ static bool _rtl8821ae_llt_write(struct ieee80211_hw *hw, 
u32 address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("Failed to polling write LLT done at address 
%d!\n",
+  address);
status = false;
break;
}
@@ -1927,7 +1926,7 @@ int rtl8821ae_hw_init(struct ieee80211_hw *hw)
 
rtstatus = _rtl8821ae_init_mac(hw);
if (rtstatus != true) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("Init MAC failed\n");
err = 1;
return err;
}
@@ -2174,8 +2173,7 @@ static int _rtl8821ae_set_media_status(struct 
ieee80211_hw *hw,
 "Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not support!\n", type);
+   pr_err("Network type %d not support!\n", type);
return 1;
}
 
@@ -3274,7 +3272,7 @@ void rtl8821ae_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;

[PATCH 02/14 V2] rtlwifi: Remove RT_TRACE messages that use DBG_EMERG

2016-12-15 Thread Larry Finger
These messages are always logged and represent error conditions, thus
we can use pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
V2 - eliminate some files that should not have been sent, and remove the
 module name from the format. It is already specified by a pr_fmt().
---
 drivers/net/wireless/realtek/rtlwifi/base.c  | 14 +++--
 drivers/net/wireless/realtek/rtlwifi/cam.c   | 14 +++--
 drivers/net/wireless/realtek/rtlwifi/core.c  | 20 +---
 drivers/net/wireless/realtek/rtlwifi/efuse.c |  3 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c   | 36 --
 drivers/net/wireless/realtek/rtlwifi/ps.c|  3 +-
 drivers/net/wireless/realtek/rtlwifi/rc.c|  3 +-
 drivers/net/wireless/realtek/rtlwifi/usb.c   | 46 +---
 8 files changed, 47 insertions(+), 92 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c 
b/drivers/net/wireless/realtek/rtlwifi/base.c
index 4ac928b..0a8553e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -207,8 +207,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
 *highest supported RX rate
 */
if (rtlpriv->dm.supp_phymode_switch) {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Support phy mode switch\n");
+   pr_info("Support phy mode switch\n");
 
ht_cap->mcs.rx_mask[0] = 0xFF;
ht_cap->mcs.rx_mask[1] = 0xFF;
@@ -389,8 +388,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
/* <4> set mac->sband to wiphy->sband */
hw->wiphy->bands[NL80211_BAND_5GHZ] = sband;
} else {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Err BAND %d\n",
-rtlhal->current_bandtype);
+   pr_err("Err BAND %d\n",
+  rtlhal->current_bandtype);
}
}
/* <5> set hw caps */
@@ -544,7 +542,7 @@ int rtl_init_core(struct ieee80211_hw *hw)
 * mac80211 hw  in _rtl_init_mac80211.
 */
if (rtl_regd_init(hw, rtl_reg_notifier)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "REGD init failed\n");
+   pr_err("REGD init failed\n");
return 1;
}
 
@@ -1694,8 +1692,7 @@ void rtl_watchdog_wq_callback(void *data)
 * we should reconnect this AP
 */
if (rtlpriv->link_info.roam_times >= 5) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"AP off, try to reconnect now\n");
+   pr_err("AP off, try to reconnect now\n");
rtlpriv->link_info.roam_times = 0;
ieee80211_connection_loss(
rtlpriv->mac80211.vif);
@@ -1886,8 +1883,7 @@ void rtl_phy_scan_operation_backup(struct ieee80211_hw 
*hw, u8 operation)
  (u8 *));
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Unknown Scan Backup operation.\n");
+   pr_err("Unknown Scan Backup operation.\n");
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/cam.c 
b/drivers/net/wireless/realtek/rtlwifi/cam.c
index 8fe8b4c..a0605d8 100644
--- a/drivers/net/wireless/realtek/rtlwifi/cam.c
+++ b/drivers/net/wireless/realtek/rtlwifi/cam.c
@@ -285,8 +285,7 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 
*sta_addr)
u8 i, *addr;
 
if (NULL == sta_addr) {
-   RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-"sta_addr is NULL.\n");
+   pr_err("sta_addr is NULL.\n");
return TOTAL_CAM_ENTRY;
}
/* Does STA already exist? */
@@ -298,9 +297,8 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 
*sta_addr)
/* Get a free CAM entry. */
for (entry_idx = 4; entry_idx < TOTAL_CAM_ENTRY; entry_idx++) {
if ((bitmap & BIT(0)) == 0) {
-   RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-"-hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
-rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
+   pr_err("-hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
+  rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
rtlpriv->sec.hwsec_cam_bitmap |= BIT(0) << entry_idx;
memcpy(rtlpriv->sec.hwsec_cam_sta_addr[entry_idx],
   sta_addr, ETH_ALEN);
@@ -319,14 +317,12 @@ void 

[PATCH 00/14 V2] rtlwifi: Start reworking of debug system

2016-12-15 Thread Larry Finger
Following the discussion regarding the patch entitled "rtlwifi: Add
BTC_TRACE_STRING to new btcoex", we are reworking the entire debug
system. This set of patches does the following:

1. Replaces every invocation of RT_ASSERT with WARN_ON. With this
   change, triggering these conditions with now give a stack dump.
   Note that the logical condition between RT_ASSERT and WARN_ON
   is inverted. In making these changes, 6 logic errors were found.
2. Replaces every call of RT_TRACE with the level set to DBG_EMERG
   with the equivalent pr_err() call. Future plans call for using
   the COMP_xxx portion of the macro as a debug mask. If these changes
   are not made, these error conditions might not be logged.
3. Removes some redundant logged conditions. For example, when the
   failure of firmware to start is logged, it is not necessary to
   log that the firmware did start.

The previous two patch sequences "[PATCH 00/14] rtlwifi: Various updates"
and "[PATCH 0/7] rtlwifi: btcoexist: Rewrite BT coexistence routines"
should be discarded. That material will be resubmitted later.

V2 removes those files that had rtlwifi_new in the subject. They should
not have been sent. It also removes the module name from the format as
it is specified by the pr_fmt macro in wifi.h as noted by Joe Perches.

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 

Larry Finger (14):
  rtlwifi: Replace local debug macro RT_ASSERT
  rtlwifi_new: Remove RT_TRACE messages that use DBG_EMERG
  rtlwifi_new: rtl8821ae: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8723be: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8723ae: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192ee: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8723-common: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192se: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192de: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192cu: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192ce: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192c-common: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8188ee: Remove all instances of DBG_EMERG
  rtlwifi: Remove some redundant code

 drivers/net/wireless/realtek/rtlwifi/base.c| 15 +++
 drivers/net/wireless/realtek/rtlwifi/cam.c | 14 +++---
 drivers/net/wireless/realtek/rtlwifi/core.c| 29 +---
 drivers/net/wireless/realtek/rtlwifi/debug.c   |  9 ++--
 drivers/net/wireless/realtek/rtlwifi/debug.h   | 18 +---
 drivers/net/wireless/realtek/rtlwifi/efuse.c   |  3 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c | 48 
 drivers/net/wireless/realtek/rtlwifi/ps.c  |  3 +-
 drivers/net/wireless/realtek/rtlwifi/rc.c  |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/fw.c| 43 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/hw.c| 32 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   | 32 ++
 .../net/wireless/realtek/rtlwifi/rtl8188ee/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/sw.c|  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8188ee/trx.c   |  8 ++--
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c  | 45 ++-
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 27 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/hw.c| 38 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   | 13 +++---
 .../net/wireless/realtek/rtlwifi/rtl8192ce/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/sw.c|  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/trx.c   |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/hw.c| 35 +--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c   | 12 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   | 12 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192cu/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/sw.c|  5 +--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.c   |  2 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/fw.c| 31 -
 .../net/wireless/realtek/rtlwifi/rtl8192de/hw.c| 34 +--
 .../net/wireless/realtek/rtlwifi/rtl8192de/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   | 41 -
 .../net/wireless/realtek/rtlwifi/rtl8192de/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/sw.c| 10 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192de/trx.c   |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ee/fw.c| 40 +
 .../net/wireless/realtek/rtlwifi/rtl8192ee/hw.c| 13 +++---
 .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c   | 36 +++
 .../net/wireless/realtek/rtlwifi/rtl8192ee/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ee/sw.c|  8 ++--
 

RE: [PATCH 00/12] staging: comedi: add identifiers to function parameters

2016-12-15 Thread Hartley Sweeten
On Thursday, December 15, 2016 6:20 AM, Ian Abbott wrote:
> Fix checkpatch.pl warnings of the form "function definition argument
> 'foo' should also have an identifier name" in various comedi header
> files.
>
> I omitted comedi_pci.h because Piotr Gregor already submitted a patch
> for that one.
>
> 01) staging: comedi: addi_watchdog.h: add identifiers to function
> parameters
> 02) staging: comedi: comedi_8254.h: add identifiers to function
> parameters
> 03) staging: comedi: comedi_isadma.h: add identifiers to function
> parameters
> 04) staging: comedi: mite.h: add identifiers to function parameters
> 05) staging: comedi: ni_labpc.h: add identifiers to function parameters
> 06) staging: comedi: ni_tio.h: add identifiers to function parameters
> 07) staging: comedi: ni_tio_internal.h: add identifiers to function
> parameters
> 08) staging: comedi: comedi_compat32.h: add identifiers to function
> parameters
> 09) staging: comedi: comedi_internal.h: add identifiers to function
> parameters
> 10) staging: comedi: comedi_pcmcia.[ch]: add identifiers to function
> parameters
> 11) staging: comedi: comedi_usb.h: add identifiers to function
> parameters
> 12) staging: comedi: comedidev.h: add identifiers to function
> parameters

Reviewed-by: H Hartley Sweeten 

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


RE: [PATCH] drivers: staging: comedi: fix function prototypes

2016-12-15 Thread Hartley Sweeten
On Thursday, December 15, 2016 4:45 AM, Ian Abbott wrote:
> On 14/12/16 13:42, Piotr Gregor wrote:
>> Add names of parameters to function prototypes in comedi PCI.
>> Checkpatch reports now no errors.
>>
>> Signed-off-by: Piotr Gregor 
>
> Looks good, thanks!
>
> Reviewed-by: Ian Abbott 

Reviewed-by: H Hartley Sweeten 

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


RE: [PATCH v3 5/9] bus: fsl-mc: dpio: add global dpaa2 definitions

2016-12-15 Thread Stuart Yoder


> -Original Message-
> From: Laurentiu Tudor
> Sent: Friday, December 02, 2016 6:19 AM
> To: Stuart Yoder ; gre...@linuxfoundation.org
> Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; ag...@suse.de; 
> a...@arndb.de; Leo Li
> ; Ioana Ciornei ; Catalin Horghidan
> ; Ruxandra Ioana Radulescu 
> ; Roy Pledge
> 
> Subject: Re: [PATCH v3 5/9] bus: fsl-mc: dpio: add global dpaa2 definitions
> 
> On 12/02/2016 12:41 AM, Stuart Yoder wrote:
> > From: Roy Pledge 
> >
> > Create header for global dpaa2 definitions.  Add definitions
> > for dequeue results.
> >
> > Signed-off-by: Roy Pledge 
> > Signed-off-by: Stuart Yoder 
> > ---
> >  include/linux/fsl/dpaa2-global.h | 203 
> > +++
> >  1 file changed, 203 insertions(+)
> >  create mode 100644 include/linux/fsl/dpaa2-global.h
> >
> > diff --git a/include/linux/fsl/dpaa2-global.h 
> > b/include/linux/fsl/dpaa2-global.h
> > new file mode 100644
> > index 000..3ee3f29
> > --- /dev/null
> > +++ b/include/linux/fsl/dpaa2-global.h
> > @@ -0,0 +1,203 @@
> > +/*
> > + * Copyright 2014-2016 Freescale Semiconductor Inc.
> > + *
> > + * Redistribution and use in source and binary forms, with or without
> > + * modification, are permitted provided that the following conditions are 
> > met:
> > + * * Redistributions of source code must retain the above copyright
> > + *   notice, this list of conditions and the following disclaimer.
> > + * * Redistributions in binary form must reproduce the above copyright
> > + *   notice, this list of conditions and the following disclaimer in 
> > the
> > + *   documentation and/or other materials provided with the 
> > distribution.
> > + * * Neither the name of Freescale Semiconductor nor the
> > + *   names of its contributors may be used to endorse or promote 
> > products
> > + *   derived from this software without specific prior written 
> > permission.
> > + *
> > + * ALTERNATIVELY, this software may be distributed under the terms of the
> > + * GNU General Public License ("GPL") as published by the Free Software
> > + * Foundation, either version 2 of that License or (at your option) any
> > + * later version.
> > + *
> > + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
> > + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
> > IMPLIED
> > + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> > + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
> > + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
> > DAMAGES
> > + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
> > SERVICES;
> > + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
> > AND
> > + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
> > TORT
> > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
> > OF THIS
> > + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > + */
> > +#ifndef __FSL_DPAA2_GLOBAL_H
> > +#define __FSL_DPAA2_GLOBAL_H
> > +
> > +#include 
> > +#include 
> > +#include 
> > +
> > +struct dpaa2_dq {
> > +   union {
> > +   struct common {
> > +   u8 verb;
> > +   u8 reserved[63];
> > +   } common;
> > +   struct dq {
> > +   u8 verb;
> > +   u8 stat;
> > +   __le16 seqnum;
> > +   __le16 oprid;
> > +   u8 reserved;
> > +   u8 tok;
> > +   __le32 fqid;
> > +   u32 reserved2;
> > +   __le32 fq_byte_cnt;
> > +   __le32 fq_frm_cnt;
> > +   __le64 fqd_ctx;
> > +   u8 fd[32];
> > +   } dq;
> > +   struct scn {
> > +   u8 verb;
> > +   u8 stat;
> > +   u8 state;
> > +   u8 reserved;
> > +   __le32 rid_tok;
> > +   __le64 ctx;
> > +   } scn;
> > +   };
> > +};
> > +
> > +
> 
> Extra blank line.
> 
> > +/* Parsing frame dequeue results */
> > +/* FQ empty */
> > +#define DPAA2_DQ_STAT_FQEMPTY   0x80
> > +/* FQ held active */
> > +#define DPAA2_DQ_STAT_HELDACTIVE0x40
> > +/* FQ force eligible */
> > +#define DPAA2_DQ_STAT_FORCEELIGIBLE 0x20
> > +/* valid frame */
> > +#define DPAA2_DQ_STAT_VALIDFRAME0x10
> > +/* FQ ODP enable */
> > +#define DPAA2_DQ_STAT_ODPVALID  0x04
> > +/* volatile dequeue */
> > +#define DPAA2_DQ_STAT_VOLATILE  0x02
> > +/* volatile dequeue command is expired */
> > +#define DPAA2_DQ_STAT_EXPIRED   0x01
> > +
> > +#define DQ_FQID_MASK 

RE: [PATCH v3 4/9] bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs

2016-12-15 Thread Stuart Yoder


> -Original Message-
> From: Laurentiu Tudor
> Sent: Friday, December 02, 2016 6:12 AM
> To: Stuart Yoder ; gre...@linuxfoundation.org
> Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; ag...@suse.de; 
> a...@arndb.de; Leo Li
> ; Ioana Ciornei ; Catalin Horghidan
> ; Ruxandra Ioana Radulescu 
> ; Roy Pledge
> 
> Subject: Re: [PATCH v3 4/9] bus: fsl-mc: dpio: add frame descriptor and 
> scatter/gather APIs
> 
> 
> Some more bits and pieces inside.
> 
> ---
> Best Regards, Laurentiu
> 
> On 12/02/2016 12:41 AM, Stuart Yoder wrote:
> > From: Roy Pledge 
> >
> > Add global definitions for DPAA2 frame descriptors and scatter
> > gather entries.
> >
> > Signed-off-by: Roy Pledge 
> > Signed-off-by: Stuart Yoder 
> > ---
> >
> > Notes:
> > -v3
> >-no changes
> > -v2
> >-added setter/getter for the FD ctrl field
> >-corrected comment for SG format_offset field description
> >-added support for short length field in FD
> >
> >  include/linux/fsl/dpaa2-fd.h | 448 
> > +++
> >  1 file changed, 448 insertions(+)
> >  create mode 100644 include/linux/fsl/dpaa2-fd.h
> >
> > diff --git a/include/linux/fsl/dpaa2-fd.h b/include/linux/fsl/dpaa2-fd.h
> > new file mode 100644
> > index 000..182c8f4
> > --- /dev/null
> > +++ b/include/linux/fsl/dpaa2-fd.h
> > @@ -0,0 +1,448 @@
> > +/*
> > + * Copyright 2014-2016 Freescale Semiconductor Inc.
> > + *
> > + * Redistribution and use in source and binary forms, with or without
> > + * modification, are permitted provided that the following conditions are 
> > met:
> > + * * Redistributions of source code must retain the above copyright
> > + *   notice, this list of conditions and the following disclaimer.
> > + * * Redistributions in binary form must reproduce the above copyright
> > + *   notice, this list of conditions and the following disclaimer in 
> > the
> > + *   documentation and/or other materials provided with the 
> > distribution.
> > + * * Neither the name of Freescale Semiconductor nor the
> > + *   names of its contributors may be used to endorse or promote 
> > products
> > + *   derived from this software without specific prior written 
> > permission.
> > + *
> > + * ALTERNATIVELY, this software may be distributed under the terms of the
> > + * GNU General Public License ("GPL") as published by the Free Software
> > + * Foundation, either version 2 of that License or (at your option) any
> > + * later version.
> > + *
> > + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
> > + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
> > IMPLIED
> > + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> > + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
> > + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
> > DAMAGES
> > + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
> > SERVICES;
> > + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
> > AND
> > + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
> > TORT
> > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
> > OF THIS
> > + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > + */
> > +#ifndef __FSL_DPAA2_FD_H
> > +#define __FSL_DPAA2_FD_H
> > +
> > +#include 
> > +
> > +/**
> > + * DOC: DPAA2 FD - Frame Descriptor APIs for DPAA2
> > + *
> > + * Frame Descriptors (FDs) are used to describe frame data in the DPAA2.
> > + * Frames can be enqueued and dequeued to Frame Queues (FQs) which are 
> > consumed
> > + * by the various DPAA accelerators (WRIOP, SEC, PME, DCE)
> > + *
> > + * There are three types of frames: single, scatter gather, and frame 
> > lists.
> > + *
> > + * The set of APIs in this file must be used to create, manipulate and
> > + * query Frame Descriptors.
> > + */
> > +
> > +/**
> > + * struct dpaa2_fd - Struct describing FDs
> > + * @words: for easier/faster copying the whole FD structure
> > + * @addr:  address in the FD
> > + * @len:   length in the FD
> > + * @bpid:  buffer pool ID
> > + * @format_offset: format, offset, and short-length fields
> > + * @frc:   frame context
> > + * @ctrl:  control bits...including dd, sc, va, err, etc
> > + * @flc:   flow context address
> > + *
> > + * This structure represents the basic Frame Descriptor used in the system.
> > + */
> > +struct dpaa2_fd {
> > +   union {
> > +   u32 words[8];
> > +   struct dpaa2_fd_simple {
> > +   __le64 addr;
> > +   __le32 len;
> > +   __le16 

RE: [PATCH v3 3/9] bus: fsl-mc: dpio: add APIs for DPIO objects

2016-12-15 Thread Stuart Yoder
> > +#define DPIO_CMD(id)   ((id << DPIO_CMD_ID_OFFSET) | 
> > DPIO_CMD_BASE_VERSION)
> 
> Paranthesis around 'id'?

In all cases these are opcode values and will never be an expression.  If
we really need to future proof these definitions, we should do it for all
objects not just DPIO.  I'd like to see consistency across objects and don't
want to see DPIO gratuitously diverge.  So, my suggestion is to have an
offline discussion and if we think the change is needed, submit a patch for
all objects currently supported.

> > +   /* prepare command */
> > +   cmd.header = mc_encode_cmd_header(DPIO_CMDID_OPEN,
> > + cmd_flags,
> > + 0);
> > +   dpio_cmd = (struct dpio_cmd_open *)cmd.params;
> > +   dpio_cmd->dpio_id = cpu_to_le32(dpio_id);
> > +
> > +   /* send command to mc*/
> > +   err = mc_send_command(mc_io, );
> > +   if (err)
> > +   return err;
> > +
> > +   /* retrieve response parameters */
> > +   *token = mc_cmd_hdr_read_token();
> 
> Nit: maybe we should drop these repetitive "prepare / send / retrieve" 
> comments
> as the code is pretty self explanatory.

The 'send' comment certainly isn't needed given that the function
is 'mc_send_command()'.  For the others, I think having some comment
is helpful, even though a bit repetitive.

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


RE: [PATCH] drivers: staging: comedi: fix function prototypes

2016-12-15 Thread Hartley Sweeten
On Thursday, December 15, 2016 4:47 AM, Ian Abbott wrote:
> On 14/12/16 16:14, Hartley Sweeten wrote:
>> On December 14, 2016 6:42 AM, Piotr Gregor wrote:
>>> -struct pci_dev *comedi_to_pci_dev(struct comedi_device *);
>>> +struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev);
>>
>> For the function prototypes I prefer no names for the "pointer" parameters.
>>
>> The "struct foo *" declaration is just as clear as "struct foo *bar".
>
> Maybe, but checkpatch.pl doesn't agree (not since commit 
> ca0d8929e75ab1f860f61208d46955f280a1b05e anyway)!

Hmm.. Missed seeing that one go in.

I still think it's silly to name struct pointers in function arguments.
Especially since that normally leads to stuff like 'struct foo *foo' where
the parameter name is the same as the struct name.

Void pointers and generic types are a different matter. Naming those
makes sense for clarity.

Oh well... Just my 2 cents...

Hartley

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


Re: [PATCH] staging : osc : Remove braces from single-line body

2016-12-15 Thread Greg KH
On Thu, Dec 15, 2016 at 08:09:16PM +0530, Tabrez Khan wrote:
> On Thu, Dec 15, 2016 at 7:08 AM, Greg KH  wrote:
> > On Thu, Dec 15, 2016 at 07:03:52AM +0530, Tabrez khan wrote:
> >> Remove unnecessary braces {} for single if statement block.
> >> This warning is found using checkpatch.pl.
> >>
> >> Signed-off-by: Tabrez khan 
> >> ---
> >>  drivers/staging/lustre/lustre/osc/osc_cache.c | 4 +---
> >>  1 file changed, 1 insertion(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
> >> b/drivers/staging/lustre/lustre/osc/osc_cache.c
> >> index 4bbe219..5ded31a 100644
> >> --- a/drivers/staging/lustre/lustre/osc/osc_cache.c
> >> +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
> >> @@ -1420,10 +1420,8 @@ static void osc_release_write_grant(struct 
> >> client_obd *cli,
> >>   struct brw_page *pga)
> >>  {
> >>   assert_spin_locked(>cl_loi_list_lock);
> >> - if (!(pga->flag & OBD_BRW_FROM_GRANT)) {
> >> + if (!(pga->flag & OBD_BRW_FROM_GRANT))
> >>   return;
> >> - }
> >> -
> >
> > Why did you also delete the blank line?
> 
> Because to keep the kernel coding style as close as possible and after
> deleting brace it leads to extra empty line so i delete it.
> Please guide if done something wrong.

The extra blank line is fine, please leave it, it makes the code more
readable, don't you think?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Olaf Hering
On Thu, Dec 15, Vitaly Kuznetsov wrote:
> -> K. Y., but these words were written before I implemented
> vmbus_wait_for_unload(), to me they just explain how we read messages.

Another question for KY:
In my testing, while busy-looping in vmbus_wait_for_unload, I see a few
"message_type==1, hdr->msgtype==2" in the hv_context.synic_message_page
of the cpu which will deliver CHANNELMSG_UNLOAD_RESPONSE.
These values are not listed in their enum lists. Any idea what these
values mean?

Olaf


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


Re: [PATCH] staging : osc : Remove braces from single-line body

2016-12-15 Thread Tabrez Khan
On Thu, Dec 15, 2016 at 7:08 AM, Greg KH  wrote:
> On Thu, Dec 15, 2016 at 07:03:52AM +0530, Tabrez khan wrote:
>> Remove unnecessary braces {} for single if statement block.
>> This warning is found using checkpatch.pl.
>>
>> Signed-off-by: Tabrez khan 
>> ---
>>  drivers/staging/lustre/lustre/osc/osc_cache.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
>> b/drivers/staging/lustre/lustre/osc/osc_cache.c
>> index 4bbe219..5ded31a 100644
>> --- a/drivers/staging/lustre/lustre/osc/osc_cache.c
>> +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
>> @@ -1420,10 +1420,8 @@ static void osc_release_write_grant(struct client_obd 
>> *cli,
>>   struct brw_page *pga)
>>  {
>>   assert_spin_locked(>cl_loi_list_lock);
>> - if (!(pga->flag & OBD_BRW_FROM_GRANT)) {
>> + if (!(pga->flag & OBD_BRW_FROM_GRANT))
>>   return;
>> - }
>> -
>
> Why did you also delete the blank line?

Because to keep the kernel coding style as close as possible and after
deleting brace it leads to extra empty line so i delete it.
Please guide if done something wrong.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Vitaly Kuznetsov
Olaf Hering  writes:

> On Thu, Dec 15, Vitaly Kuznetsov wrote:
>
>> vmbus_wait_for_unload() may be receiving a message (not necessarily the
>> CHANNELMSG_UNLOAD_RESPONSE, we may see some other message) on the same
>> CPU it runs and in this case wrmsrl() makes sense. In other cases it
>> does nothing (neither good nor bad).
>
> If that other cpu has interrupts disabled it may not process a pending
> msg (the response may be stuck in the host queue?), and the loop can not
> kick the other cpus queue if a wrmsrl is just valid for the current cpu.
> If thats true, the response will not arrive in the loop.
>

In case interrupts get permanently disabled on the CPU which is supposed
to receive the CHANNELMSG_UNLOAD_RESPONSE message *and* there is some
other message pedning in the slot for that CPU we'll hang. We may try to
overcome this by sending NMIs but this is getting more and more
complicated...

I'd like to see a simple fix from Hyper-V host team: always deliver
CHANNELMSG_UNLOAD_RESPONSE reply to the cpu which sent CHANNELMSG_UNLOAD
request. This would allow us to remove all the craziness.

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


[PATCH 1/2] media: s5p-cec: Remove unneeded linux/miscdevice.h include

2016-12-15 Thread Corentin Labbe
s5p-cec: does not use any miscdevice so this patch remove this
unnecessary inclusion.

Signed-off-by: Corentin Labbe 
---
 drivers/staging/media/s5p-cec/exynos_hdmi_cec.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/s5p-cec/exynos_hdmi_cec.h 
b/drivers/staging/media/s5p-cec/exynos_hdmi_cec.h
index 3e4fc7b..7d94535 100644
--- a/drivers/staging/media/s5p-cec/exynos_hdmi_cec.h
+++ b/drivers/staging/media/s5p-cec/exynos_hdmi_cec.h
@@ -14,7 +14,6 @@
 #define _EXYNOS_HDMI_CEC_H_ __FILE__
 
 #include 
-#include 
 #include "s5p_cec.h"
 
 void s5p_cec_set_divider(struct s5p_cec_dev *cec);
-- 
2.10.2

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


[PATCH 2/2] media: s5p-cec: Remove references to non-existent PLAT_S5P symbol

2016-12-15 Thread Corentin Labbe
Commit d78c16ccde96 ("ARM: SAMSUNG: Remove remaining legacy code")
removed the Kconfig symbol PLAT_S5P.
This patch remove the last occurrence of this symbol.

Signed-off-by: Corentin Labbe 
---
 drivers/staging/media/s5p-cec/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/s5p-cec/Kconfig 
b/drivers/staging/media/s5p-cec/Kconfig
index 0315fd7..cba4f8a 100644
--- a/drivers/staging/media/s5p-cec/Kconfig
+++ b/drivers/staging/media/s5p-cec/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_SAMSUNG_S5P_CEC
tristate "Samsung S5P CEC driver"
-   depends on VIDEO_DEV && MEDIA_CEC && (PLAT_S5P || ARCH_EXYNOS || 
COMPILE_TEST)
+   depends on VIDEO_DEV && MEDIA_CEC && (ARCH_EXYNOS || COMPILE_TEST)
---help---
  This is a driver for Samsung S5P HDMI CEC interface. It uses the
  generic CEC framework interface.
-- 
2.10.2

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


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Olaf Hering
On Thu, Dec 15, Vitaly Kuznetsov wrote:

> vmbus_wait_for_unload() may be receiving a message (not necessarily the
> CHANNELMSG_UNLOAD_RESPONSE, we may see some other message) on the same
> CPU it runs and in this case wrmsrl() makes sense. In other cases it
> does nothing (neither good nor bad).

If that other cpu has interrupts disabled it may not process a pending
msg (the response may be stuck in the host queue?), and the loop can not
kick the other cpus queue if a wrmsrl is just valid for the current cpu.
If thats true, the response will not arrive in the loop.

Olaf


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


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Vitaly Kuznetsov
Olaf Hering  writes:

> On Thu, Dec 15, Vitaly Kuznetsov wrote:
>
>> We actually need to read the reply and empty the message slot to make
>> unload happen. And reading on a different CPU may not work, see:
>> 
>> http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2016-December/097330.html
>
> Does the following sentences mean the vmbus_signal_eom in
> vmbus_wait_for_unload is a noop because the wrmsrl() is expected to
> happen on the other cpu instead of the current cpu?
>
> ...
> - When we read the message we need to clear the slot and signal the fact
>   to the hypervisor. In case there are more messages to this CPU pending
>   the hypervisor will deliver the next message. The signaling is done by
>   writing to an MSR so this can only be done on the appropriate CPU.
> ...
>

-> K. Y., but these words were written before I implemented
vmbus_wait_for_unload(), to me they just explain how we read messages.

vmbus_wait_for_unload() may be receiving a message (not necessarily the
CHANNELMSG_UNLOAD_RESPONSE, we may see some other message) on the same
CPU it runs and in this case wrmsrl() makes sense. In other cases it
does nothing (neither good nor bad).

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


[PATCH 10/12] staging: comedi: comedi_pcmcia.[ch]: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedi_pcmcia.c |  3 ++-
 drivers/staging/comedi/comedi_pcmcia.h | 22 --
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/comedi/comedi_pcmcia.c 
b/drivers/staging/comedi/comedi_pcmcia.c
index d7072a5..cd47428 100644
--- a/drivers/staging/comedi/comedi_pcmcia.c
+++ b/drivers/staging/comedi/comedi_pcmcia.c
@@ -78,7 +78,8 @@ static int comedi_pcmcia_conf_check(struct pcmcia_device 
*link,
  * or a negative error number from pcmcia_enable_device() if it fails.
  */
 int comedi_pcmcia_enable(struct comedi_device *dev,
-int (*conf_check)(struct pcmcia_device *, void *))
+int (*conf_check)(struct pcmcia_device *p_dev,
+  void *priv_data))
 {
struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
int ret;
diff --git a/drivers/staging/comedi/comedi_pcmcia.h 
b/drivers/staging/comedi/comedi_pcmcia.h
index 5a572c2..9e45c7c 100644
--- a/drivers/staging/comedi/comedi_pcmcia.h
+++ b/drivers/staging/comedi/comedi_pcmcia.h
@@ -24,19 +24,21 @@
 
 #include "comedidev.h"
 
-struct pcmcia_device *comedi_to_pcmcia_dev(struct comedi_device *);
+struct pcmcia_device *comedi_to_pcmcia_dev(struct comedi_device *dev);
 
-int comedi_pcmcia_enable(struct comedi_device *,
-int (*conf_check)(struct pcmcia_device *, void *));
-void comedi_pcmcia_disable(struct comedi_device *);
+int comedi_pcmcia_enable(struct comedi_device *dev,
+int (*conf_check)(struct pcmcia_device *p_dev,
+  void *priv_data));
+void comedi_pcmcia_disable(struct comedi_device *dev);
 
-int comedi_pcmcia_auto_config(struct pcmcia_device *, struct comedi_driver *);
-void comedi_pcmcia_auto_unconfig(struct pcmcia_device *);
+int comedi_pcmcia_auto_config(struct pcmcia_device *link,
+ struct comedi_driver *driver);
+void comedi_pcmcia_auto_unconfig(struct pcmcia_device *link);
 
-int comedi_pcmcia_driver_register(struct comedi_driver *,
- struct pcmcia_driver *);
-void comedi_pcmcia_driver_unregister(struct comedi_driver *,
-struct pcmcia_driver *);
+int comedi_pcmcia_driver_register(struct comedi_driver *comedi_driver,
+ struct pcmcia_driver *pcmcia_driver);
+void comedi_pcmcia_driver_unregister(struct comedi_driver *comedi_driver,
+struct pcmcia_driver *pcmcia_driver);
 
 /**
  * module_comedi_pcmcia_driver() - Helper macro for registering a comedi
-- 
2.10.2

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


[PATCH 09/12] staging: comedi: comedi_internal.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedi_internal.h | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/comedi_internal.h 
b/drivers/staging/comedi/comedi_internal.h
index 3f2c88a..534415e 100644
--- a/drivers/staging/comedi/comedi_internal.h
+++ b/drivers/staging/comedi/comedi_internal.h
@@ -44,11 +44,12 @@ extern unsigned int comedi_default_buf_maxsize_kb;
 extern struct comedi_driver *comedi_drivers;
 extern struct mutex comedi_drivers_list_lock;
 
-int insn_inval(struct comedi_device *, struct comedi_subdevice *,
-  struct comedi_insn *, unsigned int *);
+int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
+  struct comedi_insn *insn, unsigned int *data);
 
-void comedi_device_detach(struct comedi_device *);
-int comedi_device_attach(struct comedi_device *, struct comedi_devconfig *);
+void comedi_device_detach(struct comedi_device *dev);
+int comedi_device_attach(struct comedi_device *dev,
+struct comedi_devconfig *it);
 
 #ifdef CONFIG_PROC_FS
 
-- 
2.10.2

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


[PATCH 08/12] staging: comedi: comedi_compat32.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedi_compat32.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_compat32.h 
b/drivers/staging/comedi/comedi_compat32.h
index 5ce77f3..0127c1f 100644
--- a/drivers/staging/comedi/comedi_compat32.h
+++ b/drivers/staging/comedi/comedi_compat32.h
@@ -25,7 +25,8 @@
 #ifdef CONFIG_COMPAT
 
 struct file;
-long comedi_compat_ioctl(struct file *, unsigned int cmd, unsigned long arg);
+long comedi_compat_ioctl(struct file *file, unsigned int cmd,
+unsigned long arg);
 
 #else /* CONFIG_COMPAT */
 
-- 
2.10.2

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


[PATCH 11/12] staging: comedi: comedi_usb.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedi_usb.h | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/comedi_usb.h 
b/drivers/staging/comedi/comedi_usb.h
index 721128b..132154e 100644
--- a/drivers/staging/comedi/comedi_usb.h
+++ b/drivers/staging/comedi/comedi_usb.h
@@ -23,15 +23,17 @@
 
 #include "comedidev.h"
 
-struct usb_interface *comedi_to_usb_interface(struct comedi_device *);
-struct usb_device *comedi_to_usb_dev(struct comedi_device *);
+struct usb_interface *comedi_to_usb_interface(struct comedi_device *dev);
+struct usb_device *comedi_to_usb_dev(struct comedi_device *dev);
 
-int comedi_usb_auto_config(struct usb_interface *, struct comedi_driver *,
-  unsigned long context);
-void comedi_usb_auto_unconfig(struct usb_interface *);
+int comedi_usb_auto_config(struct usb_interface *intf,
+  struct comedi_driver *driver, unsigned long context);
+void comedi_usb_auto_unconfig(struct usb_interface *intf);
 
-int comedi_usb_driver_register(struct comedi_driver *, struct usb_driver *);
-void comedi_usb_driver_unregister(struct comedi_driver *, struct usb_driver *);
+int comedi_usb_driver_register(struct comedi_driver *comedi_driver,
+  struct usb_driver *usb_driver);
+void comedi_usb_driver_unregister(struct comedi_driver *comedi_driver,
+ struct usb_driver *usb_driver);
 
 /**
  * module_comedi_usb_driver() - Helper macro for registering a comedi USB 
driver
-- 
2.10.2

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


[PATCH 07/12] staging: comedi: ni_tio_internal.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/ni_tio_internal.h | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio_internal.h 
b/drivers/staging/comedi/drivers/ni_tio_internal.h
index b15b108..4e024eb 100644
--- a/drivers/staging/comedi/drivers/ni_tio_internal.h
+++ b/drivers/staging/comedi/drivers/ni_tio_internal.h
@@ -160,8 +160,9 @@
 #define GI_TC_INTERRUPT_ENABLE(x)  (((x) % 2) ? BIT(9) : BIT(6))
 #define GI_GATE_INTERRUPT_ENABLE(x)(((x) % 2) ? BIT(10) : BIT(8))
 
-void ni_tio_write(struct ni_gpct *, unsigned int value, enum ni_gpct_register);
-unsigned int ni_tio_read(struct ni_gpct *, enum ni_gpct_register);
+void ni_tio_write(struct ni_gpct *counter, unsigned int value,
+ enum ni_gpct_register);
+unsigned int ni_tio_read(struct ni_gpct *counter, enum ni_gpct_register);
 
 static inline bool
 ni_tio_counting_mode_registers_present(const struct ni_gpct_device 
*counter_dev)
@@ -170,12 +171,13 @@ ni_tio_counting_mode_registers_present(const struct 
ni_gpct_device *counter_dev)
return counter_dev->variant != ni_gpct_variant_e_series;
 }
 
-void ni_tio_set_bits(struct ni_gpct *, enum ni_gpct_register reg,
+void ni_tio_set_bits(struct ni_gpct *counter, enum ni_gpct_register reg,
 unsigned int mask, unsigned int value);
-unsigned int ni_tio_get_soft_copy(const struct ni_gpct *,
+unsigned int ni_tio_get_soft_copy(const struct ni_gpct *counter,
  enum ni_gpct_register reg);
 
-int ni_tio_arm(struct ni_gpct *, bool arm, unsigned int start_trigger);
-int ni_tio_set_gate_src(struct ni_gpct *, unsigned int gate, unsigned int src);
+int ni_tio_arm(struct ni_gpct *counter, bool arm, unsigned int start_trigger);
+int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned int gate,
+   unsigned int src);
 
 #endif /* _COMEDI_NI_TIO_INTERNAL_H */
-- 
2.10.2

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


[PATCH 12/12] staging: comedi: comedidev.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedidev.h | 47 --
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h 
b/drivers/staging/comedi/comedidev.h
index 0c7c37a..5d887d5 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -982,19 +982,21 @@ unsigned int comedi_buf_read_samples(struct 
comedi_subdevice *s,
 
 #define COMEDI_TIMEOUT_MS  1000
 
-int comedi_timeout(struct comedi_device *, struct comedi_subdevice *,
-  struct comedi_insn *,
-  int (*cb)(struct comedi_device *, struct comedi_subdevice *,
-struct comedi_insn *, unsigned long context),
+int comedi_timeout(struct comedi_device *dev, struct comedi_subdevice *s,
+  struct comedi_insn *insn,
+  int (*cb)(struct comedi_device *dev,
+struct comedi_subdevice *s,
+struct comedi_insn *insn, unsigned long context),
   unsigned long context);
 
 unsigned int comedi_handle_events(struct comedi_device *dev,
  struct comedi_subdevice *s);
 
-int comedi_dio_insn_config(struct comedi_device *, struct comedi_subdevice *,
-  struct comedi_insn *, unsigned int *data,
+int comedi_dio_insn_config(struct comedi_device *dev,
+  struct comedi_subdevice *s,
+  struct comedi_insn *insn, unsigned int *data,
   unsigned int mask);
-unsigned int comedi_dio_update_state(struct comedi_subdevice *,
+unsigned int comedi_dio_update_state(struct comedi_subdevice *s,
 unsigned int *data);
 unsigned int comedi_bytes_per_scan(struct comedi_subdevice *s);
 unsigned int comedi_nscans_left(struct comedi_subdevice *s,
@@ -1004,32 +1006,33 @@ unsigned int comedi_nsamples_left(struct 
comedi_subdevice *s,
 void comedi_inc_scan_progress(struct comedi_subdevice *s,
  unsigned int num_bytes);
 
-void *comedi_alloc_devpriv(struct comedi_device *, size_t);
-int comedi_alloc_subdevices(struct comedi_device *, int);
-int comedi_alloc_subdev_readback(struct comedi_subdevice *);
+void *comedi_alloc_devpriv(struct comedi_device *dev, size_t size);
+int comedi_alloc_subdevices(struct comedi_device *dev, int num_subdevices);
+int comedi_alloc_subdev_readback(struct comedi_subdevice *s);
 
-int comedi_readback_insn_read(struct comedi_device *, struct comedi_subdevice 
*,
- struct comedi_insn *, unsigned int *data);
+int comedi_readback_insn_read(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn, unsigned int *data);
 
-int comedi_load_firmware(struct comedi_device *, struct device *,
+int comedi_load_firmware(struct comedi_device *dev, struct device *hw_dev,
 const char *name,
-int (*cb)(struct comedi_device *,
+int (*cb)(struct comedi_device *dev,
   const u8 *data, size_t size,
   unsigned long context),
 unsigned long context);
 
-int __comedi_request_region(struct comedi_device *,
+int __comedi_request_region(struct comedi_device *dev,
unsigned long start, unsigned long len);
-int comedi_request_region(struct comedi_device *,
+int comedi_request_region(struct comedi_device *dev,
  unsigned long start, unsigned long len);
-void comedi_legacy_detach(struct comedi_device *);
+void comedi_legacy_detach(struct comedi_device *dev);
 
-int comedi_auto_config(struct device *, struct comedi_driver *,
-  unsigned long context);
-void comedi_auto_unconfig(struct device *);
+int comedi_auto_config(struct device *hardware_device,
+  struct comedi_driver *driver, unsigned long context);
+void comedi_auto_unconfig(struct device *hardware_device);
 
-int comedi_driver_register(struct comedi_driver *);
-void comedi_driver_unregister(struct comedi_driver *);
+int comedi_driver_register(struct comedi_driver *driver);
+void comedi_driver_unregister(struct comedi_driver *driver);
 
 /**
  * module_comedi_driver() - Helper macro for registering a comedi driver
-- 
2.10.2

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


[PATCH 01/12] staging: comedi: addi_watchdog.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/addi_watchdog.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/addi_watchdog.h 
b/drivers/staging/comedi/drivers/addi_watchdog.h
index 3f8e738..b049cfb 100644
--- a/drivers/staging/comedi/drivers/addi_watchdog.h
+++ b/drivers/staging/comedi/drivers/addi_watchdog.h
@@ -4,6 +4,6 @@
 struct comedi_subdevice;
 
 void addi_watchdog_reset(unsigned long iobase);
-int addi_watchdog_init(struct comedi_subdevice *, unsigned long iobase);
+int addi_watchdog_init(struct comedi_subdevice *s, unsigned long iobase);
 
 #endif
-- 
2.10.2

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


[PATCH 03/12] staging: comedi: comedi_isadma.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/comedi_isadma.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_isadma.h 
b/drivers/staging/comedi/drivers/comedi_isadma.h
index 2fb6573b..a193d3e 100644
--- a/drivers/staging/comedi/drivers/comedi_isadma.h
+++ b/drivers/staging/comedi/drivers/comedi_isadma.h
@@ -63,18 +63,18 @@ struct comedi_isadma {
 
 #if IS_ENABLED(CONFIG_ISA_DMA_API)
 
-void comedi_isadma_program(struct comedi_isadma_desc *);
+void comedi_isadma_program(struct comedi_isadma_desc *desc);
 unsigned int comedi_isadma_disable(unsigned int dma_chan);
 unsigned int comedi_isadma_disable_on_sample(unsigned int dma_chan,
 unsigned int size);
-unsigned int comedi_isadma_poll(struct comedi_isadma *);
-void comedi_isadma_set_mode(struct comedi_isadma_desc *, char dma_dir);
+unsigned int comedi_isadma_poll(struct comedi_isadma *dma);
+void comedi_isadma_set_mode(struct comedi_isadma_desc *desc, char dma_dir);
 
-struct comedi_isadma *comedi_isadma_alloc(struct comedi_device *,
+struct comedi_isadma *comedi_isadma_alloc(struct comedi_device *dev,
  int n_desc, unsigned int dma_chan1,
  unsigned int dma_chan2,
  unsigned int maxsize, char dma_dir);
-void comedi_isadma_free(struct comedi_isadma *);
+void comedi_isadma_free(struct comedi_isadma *dma);
 
 #else  /* !IS_ENABLED(CONFIG_ISA_DMA_API) */
 
-- 
2.10.2

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


[PATCH 00/12] staging: comedi: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name" in various comedi header
files.

I omitted comedi_pci.h because Piotr Gregor already submitted a patch
for that one.

01) staging: comedi: addi_watchdog.h: add identifiers to function
parameters
02) staging: comedi: comedi_8254.h: add identifiers to function
parameters
03) staging: comedi: comedi_isadma.h: add identifiers to function
parameters
04) staging: comedi: mite.h: add identifiers to function parameters
05) staging: comedi: ni_labpc.h: add identifiers to function parameters
06) staging: comedi: ni_tio.h: add identifiers to function parameters
07) staging: comedi: ni_tio_internal.h: add identifiers to function
parameters
08) staging: comedi: comedi_compat32.h: add identifiers to function
parameters
09) staging: comedi: comedi_internal.h: add identifiers to function
parameters
10) staging: comedi: comedi_pcmcia.[ch]: add identifiers to function
parameters
11) staging: comedi: comedi_usb.h: add identifiers to function
parameters
12) staging: comedi: comedidev.h: add identifiers to function
parameters

 drivers/staging/comedi/comedi_compat32.h |  3 +-
 drivers/staging/comedi/comedi_internal.h |  9 +++--
 drivers/staging/comedi/comedi_pcmcia.c   |  3 +-
 drivers/staging/comedi/comedi_pcmcia.h   | 22 ++-
 drivers/staging/comedi/comedi_usb.h  | 16 
 drivers/staging/comedi/comedidev.h   | 47 +---
 drivers/staging/comedi/drivers/addi_watchdog.h   |  2 +-
 drivers/staging/comedi/drivers/comedi_8254.h | 30 ---
 drivers/staging/comedi/drivers/comedi_isadma.h   | 10 ++---
 drivers/staging/comedi/drivers/mite.h| 37 ++-
 drivers/staging/comedi/drivers/ni_labpc.h|  4 +-
 drivers/staging/comedi/drivers/ni_tio.h  | 42 +++--
 drivers/staging/comedi/drivers/ni_tio_internal.h | 14 ---
 13 files changed, 128 insertions(+), 111 deletions(-)

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


[PATCH 06/12] staging: comedi: ni_tio.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/ni_tio.h | 42 +
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio.h 
b/drivers/staging/comedi/drivers/ni_tio.h
index 4978358..2012033 100644
--- a/drivers/staging/comedi/drivers/ni_tio.h
+++ b/drivers/staging/comedi/drivers/ni_tio.h
@@ -110,9 +110,9 @@ struct ni_gpct {
 
 struct ni_gpct_device {
struct comedi_device *dev;
-   void (*write)(struct ni_gpct *, unsigned int value,
+   void (*write)(struct ni_gpct *counter, unsigned int value,
  enum ni_gpct_register);
-   unsigned int (*read)(struct ni_gpct *, enum ni_gpct_register);
+   unsigned int (*read)(struct ni_gpct *counter, enum ni_gpct_register);
enum ni_gpct_variant variant;
struct ni_gpct *counters;
unsigned int num_counters;
@@ -121,28 +121,30 @@ struct ni_gpct_device {
 };
 
 struct ni_gpct_device *
-ni_gpct_device_construct(struct comedi_device *,
-void (*write)(struct ni_gpct *,
+ni_gpct_device_construct(struct comedi_device *dev,
+void (*write)(struct ni_gpct *counter,
   unsigned int value,
   enum ni_gpct_register),
-unsigned int (*read)(struct ni_gpct *,
+unsigned int (*read)(struct ni_gpct *counter,
  enum ni_gpct_register),
 enum ni_gpct_variant,
 unsigned int num_counters);
-void ni_gpct_device_destroy(struct ni_gpct_device *);
-void ni_tio_init_counter(struct ni_gpct *);
-int ni_tio_insn_read(struct comedi_device *, struct comedi_subdevice *,
-struct comedi_insn *, unsigned int *data);
-int ni_tio_insn_config(struct comedi_device *, struct comedi_subdevice *,
-  struct comedi_insn *, unsigned int *data);
-int ni_tio_insn_write(struct comedi_device *, struct comedi_subdevice *,
- struct comedi_insn *, unsigned int *data);
-int ni_tio_cmd(struct comedi_device *, struct comedi_subdevice *);
-int ni_tio_cmdtest(struct comedi_device *, struct comedi_subdevice *,
-  struct comedi_cmd *);
-int ni_tio_cancel(struct ni_gpct *);
-void ni_tio_handle_interrupt(struct ni_gpct *, struct comedi_subdevice *);
-void ni_tio_set_mite_channel(struct ni_gpct *, struct mite_channel *);
-void ni_tio_acknowledge(struct ni_gpct *);
+void ni_gpct_device_destroy(struct ni_gpct_device *counter_dev);
+void ni_tio_init_counter(struct ni_gpct *counter);
+int ni_tio_insn_read(struct comedi_device *dev, struct comedi_subdevice *s,
+struct comedi_insn *insn, unsigned int *data);
+int ni_tio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s,
+  struct comedi_insn *insn, unsigned int *data);
+int ni_tio_insn_write(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_insn *insn, unsigned int *data);
+int ni_tio_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
+int ni_tio_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
+  struct comedi_cmd *cmd);
+int ni_tio_cancel(struct ni_gpct *counter);
+void ni_tio_handle_interrupt(struct ni_gpct *counter,
+struct comedi_subdevice *s);
+void ni_tio_set_mite_channel(struct ni_gpct *counter,
+struct mite_channel *mite_chan);
+void ni_tio_acknowledge(struct ni_gpct *counter);
 
 #endif /* _COMEDI_NI_TIO_H */
-- 
2.10.2

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


[PATCH 02/12] staging: comedi: comedi_8254.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/comedi_8254.h | 30 +++-
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_8254.h 
b/drivers/staging/comedi/drivers/comedi_8254.h
index a12c294..326bd44 100644
--- a/drivers/staging/comedi/drivers/comedi_8254.h
+++ b/drivers/staging/comedi/drivers/comedi_8254.h
@@ -100,34 +100,36 @@ struct comedi_8254 {
unsigned int gate_src[3];
bool busy[3];
 
-   int (*insn_config)(struct comedi_device *, struct comedi_subdevice *s,
-  struct comedi_insn *, unsigned int *data);
+   int (*insn_config)(struct comedi_device *dev,
+  struct comedi_subdevice *s,
+  struct comedi_insn *insn, unsigned int *data);
 };
 
-unsigned int comedi_8254_status(struct comedi_8254 *, unsigned int counter);
-unsigned int comedi_8254_read(struct comedi_8254 *, unsigned int counter);
-void comedi_8254_write(struct comedi_8254 *,
+unsigned int comedi_8254_status(struct comedi_8254 *i8254,
+   unsigned int counter);
+unsigned int comedi_8254_read(struct comedi_8254 *i8254, unsigned int counter);
+void comedi_8254_write(struct comedi_8254 *i8254,
   unsigned int counter, unsigned int val);
 
-int comedi_8254_set_mode(struct comedi_8254 *,
+int comedi_8254_set_mode(struct comedi_8254 *i8254,
 unsigned int counter, unsigned int mode);
-int comedi_8254_load(struct comedi_8254 *,
+int comedi_8254_load(struct comedi_8254 *i8254,
 unsigned int counter, unsigned int val, unsigned int mode);
 
-void comedi_8254_pacer_enable(struct comedi_8254 *,
+void comedi_8254_pacer_enable(struct comedi_8254 *i8254,
  unsigned int counter1, unsigned int counter2,
  bool enable);
-void comedi_8254_update_divisors(struct comedi_8254 *);
-void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *,
+void comedi_8254_update_divisors(struct comedi_8254 *i8254);
+void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
 unsigned int *nanosec, unsigned int flags);
-void comedi_8254_ns_to_timer(struct comedi_8254 *,
+void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
 unsigned int *nanosec, unsigned int flags);
 
-void comedi_8254_set_busy(struct comedi_8254 *,
+void comedi_8254_set_busy(struct comedi_8254 *i8254,
  unsigned int counter, bool busy);
 
-void comedi_8254_subdevice_init(struct comedi_subdevice *,
-   struct comedi_8254 *);
+void comedi_8254_subdevice_init(struct comedi_subdevice *s,
+   struct comedi_8254 *i8254);
 
 struct comedi_8254 *comedi_8254_init(unsigned long iobase,
 unsigned int osc_base,
-- 
2.10.2

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


[PATCH 05/12] staging: comedi: ni_labpc.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/ni_labpc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_labpc.h 
b/drivers/staging/comedi/drivers/ni_labpc.h
index be8d5cd..c2edadc 100644
--- a/drivers/staging/comedi/drivers/ni_labpc.h
+++ b/drivers/staging/comedi/drivers/ni_labpc.h
@@ -52,8 +52,8 @@ struct labpc_private {
 * function pointers so we can use inb/outb or readb/writeb as
 * appropriate
 */
-   unsigned int (*read_byte)(struct comedi_device *, unsigned long reg);
-   void (*write_byte)(struct comedi_device *,
+   unsigned int (*read_byte)(struct comedi_device *dev, unsigned long reg);
+   void (*write_byte)(struct comedi_device *dev,
   unsigned int byte, unsigned long reg);
 };
 
-- 
2.10.2

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


[PATCH 04/12] staging: comedi: mite.h: add identifiers to function parameters

2016-12-15 Thread Ian Abbott
Fix checkpatch.pl warnings of the form "function definition argument
'foo' should also have an identifier name".

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/drivers/mite.h | 37 ++-
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/drivers/mite.h 
b/drivers/staging/comedi/drivers/mite.h
index b6349ae..02a627d 100644
--- a/drivers/staging/comedi/drivers/mite.h
+++ b/drivers/staging/comedi/drivers/mite.h
@@ -60,35 +60,36 @@ struct mite {
spinlock_t lock;
 };
 
-u32 mite_bytes_in_transit(struct mite_channel *);
+u32 mite_bytes_in_transit(struct mite_channel *mite_chan);
 
-void mite_sync_dma(struct mite_channel *, struct comedi_subdevice *);
-void mite_ack_linkc(struct mite_channel *, struct comedi_subdevice *s,
+void mite_sync_dma(struct mite_channel *mite_chan, struct comedi_subdevice *s);
+void mite_ack_linkc(struct mite_channel *mite_chan, struct comedi_subdevice *s,
bool sync);
-int mite_done(struct mite_channel *);
+int mite_done(struct mite_channel *mite_chan);
 
-void mite_dma_arm(struct mite_channel *);
-void mite_dma_disarm(struct mite_channel *);
+void mite_dma_arm(struct mite_channel *mite_chan);
+void mite_dma_disarm(struct mite_channel *mite_chan);
 
-void mite_prep_dma(struct mite_channel *,
+void mite_prep_dma(struct mite_channel *mite_chan,
   unsigned int num_device_bits, unsigned int num_memory_bits);
 
-struct mite_channel *mite_request_channel_in_range(struct mite *,
-  struct mite_ring *,
+struct mite_channel *mite_request_channel_in_range(struct mite *mite,
+  struct mite_ring *ring,
   unsigned int min_channel,
   unsigned int max_channel);
-struct mite_channel *mite_request_channel(struct mite *, struct mite_ring *);
-void mite_release_channel(struct mite_channel *);
+struct mite_channel *mite_request_channel(struct mite *mite,
+ struct mite_ring *ring);
+void mite_release_channel(struct mite_channel *mite_chan);
 
-int mite_init_ring_descriptors(struct mite_ring *, struct comedi_subdevice *,
-  unsigned int nbytes);
-int mite_buf_change(struct mite_ring *, struct comedi_subdevice *);
+int mite_init_ring_descriptors(struct mite_ring *ring,
+  struct comedi_subdevice *s, unsigned int nbytes);
+int mite_buf_change(struct mite_ring *ring, struct comedi_subdevice *s);
 
-struct mite_ring *mite_alloc_ring(struct mite *);
-void mite_free_ring(struct mite_ring *);
+struct mite_ring *mite_alloc_ring(struct mite *mite);
+void mite_free_ring(struct mite_ring *ring);
 
-struct mite *mite_attach(struct comedi_device *, bool use_win1);
-void mite_detach(struct mite *);
+struct mite *mite_attach(struct comedi_device *dev, bool use_win1);
+void mite_detach(struct mite *mite);
 
 /*
  * Mite registers (used outside of the mite driver)
-- 
2.10.2

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


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Olaf Hering
On Thu, Dec 15, Vitaly Kuznetsov wrote:

> We actually need to read the reply and empty the message slot to make
> unload happen. And reading on a different CPU may not work, see:
> 
> http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2016-December/097330.html

Does the following sentences mean the vmbus_signal_eom in
vmbus_wait_for_unload is a noop because the wrmsrl() is expected to
happen on the other cpu instead of the current cpu?

...
- When we read the message we need to clear the slot and signal the fact
  to the hypervisor. In case there are more messages to this CPU pending
  the hypervisor will deliver the next message. The signaling is done by
  writing to an MSR so this can only be done on the appropriate CPU.
...

Olaf


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


Re: [PATCH 8/8] Makefile: drop -D__CHECK_ENDIAN__ from cflags

2016-12-15 Thread Greg Kroah-Hartman
On Thu, Dec 15, 2016 at 07:15:30AM +0200, Michael S. Tsirkin wrote:
> That's the default now, no need for makefiles to set it.
> 
> Signed-off-by: Michael S. Tsirkin 
> ---
>  drivers/bluetooth/Makefile| 2 --
>  drivers/net/can/Makefile  | 1 -
>  drivers/net/ethernet/altera/Makefile  | 1 -
>  drivers/net/ethernet/atheros/alx/Makefile | 1 -
>  drivers/net/ethernet/freescale/Makefile   | 2 --
>  drivers/net/wireless/ath/Makefile | 2 --
>  drivers/net/wireless/ath/wil6210/Makefile | 2 --
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile | 2 --
>  drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile | 1 -
>  drivers/net/wireless/intel/iwlegacy/Makefile  | 2 --
>  drivers/net/wireless/intel/iwlwifi/Makefile   | 2 +-
>  drivers/net/wireless/intel/iwlwifi/dvm/Makefile   | 2 +-
>  drivers/net/wireless/intel/iwlwifi/mvm/Makefile   | 2 +-
>  drivers/net/wireless/intersil/orinoco/Makefile| 3 ---
>  drivers/net/wireless/mediatek/mt7601u/Makefile| 2 --
>  drivers/net/wireless/realtek/rtlwifi/Makefile | 2 --
>  drivers/net/wireless/realtek/rtlwifi/btcoexist/Makefile   | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8188ee/Makefile   | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8192c/Makefile| 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8192ce/Makefile   | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8192cu/Makefile   | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8192de/Makefile   | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8192ee/Makefile   | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8192se/Makefile   | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8723ae/Makefile   | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8723be/Makefile   | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8723com/Makefile  | 2 --
>  drivers/net/wireless/realtek/rtlwifi/rtl8821ae/Makefile   | 2 --
>  drivers/net/wireless/ti/wl1251/Makefile   | 2 --
>  drivers/net/wireless/ti/wlcore/Makefile   | 2 --
>  drivers/staging/rtl8188eu/Makefile| 2 +-
>  drivers/staging/rtl8192e/Makefile | 2 --
>  drivers/staging/rtl8192e/rtl8192e/Makefile| 2 --
>  net/bluetooth/Makefile| 2 --
>  net/ieee802154/Makefile   | 2 --
>  net/mac80211/Makefile | 2 +-
>  net/mac802154/Makefile| 2 --
>  net/wireless/Makefile | 2 --
>  38 files changed, 5 insertions(+), 68 deletions(-)

For drivers/staging:

Acked-by: Greg Kroah-Hartman 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: staging: comedi: fix function prototypes

2016-12-15 Thread Ian Abbott

On 14/12/16 16:14, Hartley Sweeten wrote:

On December 14, 2016 6:42 AM, Piotr Gregor wrote:

Add names of parameters to function prototypes in comedi PCI.
Checkpatch reports now no errors.

Signed-off-by: Piotr Gregor 
---
 drivers/staging/comedi/comedi_pci.h | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/comedi_pci.h 
b/drivers/staging/comedi/comedi_pci.h
index 4005cc9..7dfd892 100644
--- a/drivers/staging/comedi/comedi_pci.h
+++ b/drivers/staging/comedi/comedi_pci.h
@@ -34,18 +34,20 @@
 #define PCI_VENDOR_ID_RTD  0x1435
 #define PCI_VENDOR_ID_HUMUSOFT 0x186c

-struct pci_dev *comedi_to_pci_dev(struct comedi_device *);
+struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev);


For the function prototypes I prefer no names for the "pointer" parameters.

The "struct foo *" declaration is just as clear as "struct foo *bar".


Maybe, but checkpatch.pl doesn't agree (not since commit 
ca0d8929e75ab1f860f61208d46955f280a1b05e anyway)!


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: staging: comedi: fix function prototypes

2016-12-15 Thread Ian Abbott

On 14/12/16 13:42, Piotr Gregor wrote:

Add names of parameters to function prototypes in comedi PCI.
Checkpatch reports now no errors.

Signed-off-by: Piotr Gregor 
---
 drivers/staging/comedi/comedi_pci.h | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/comedi_pci.h 
b/drivers/staging/comedi/comedi_pci.h
index 4005cc9..7dfd892 100644
--- a/drivers/staging/comedi/comedi_pci.h
+++ b/drivers/staging/comedi/comedi_pci.h
@@ -34,18 +34,20 @@
 #define PCI_VENDOR_ID_RTD  0x1435
 #define PCI_VENDOR_ID_HUMUSOFT 0x186c

-struct pci_dev *comedi_to_pci_dev(struct comedi_device *);
+struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev);

-int comedi_pci_enable(struct comedi_device *);
-void comedi_pci_disable(struct comedi_device *);
-void comedi_pci_detach(struct comedi_device *);
+int comedi_pci_enable(struct comedi_device *dev);
+void comedi_pci_disable(struct comedi_device *dev);
+void comedi_pci_detach(struct comedi_device *dev);

-int comedi_pci_auto_config(struct pci_dev *, struct comedi_driver *,
+int comedi_pci_auto_config(struct pci_dev *pcidev, struct comedi_driver 
*driver,
   unsigned long context);
-void comedi_pci_auto_unconfig(struct pci_dev *);
+void comedi_pci_auto_unconfig(struct pci_dev *pcidev);

-int comedi_pci_driver_register(struct comedi_driver *, struct pci_driver *);
-void comedi_pci_driver_unregister(struct comedi_driver *, struct pci_driver *);
+int comedi_pci_driver_register(struct comedi_driver *comedi_driver,
+  struct pci_driver *pci_driver);
+void comedi_pci_driver_unregister(struct comedi_driver *comedi_driver,
+ struct pci_driver *pci_driver);

 /**
  * module_comedi_pci_driver() - Helper macro for registering a comedi PCI 
driver



Looks good, thanks!

Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Vitaly Kuznetsov
Olaf Hering  writes:

> On Thu, Dec 15, Olaf Hering wrote:
>
>> On Thu, Dec 15, Vitaly Kuznetsov wrote:
>> 
>> > I see a number of minor but at least one major issue against such move:
>> > At least for some Hyper-V versions (2012R2 for example)
>> > CHANNELMSG_UNLOAD_RESPONSE is delivered to the CPU which initially sent 
>> > CHANNELMSG_REQUESTOFFERS and on kdump we may not have this CPU up as
>> > we usually do kdump with nr_cpus=1 (and on the CPU which crashed). 
>> 
>> Since the kdump or kexec kernel will send the unload during boot I would
>> expect the response to arrive where it was sent, independent from the
>> number of cpus.
>
> Wait, I just noticed that "REQUESTOFFERS" now. That might be a reason
> why my suggestion will not work.
>

Yep, that's what I meant to say.

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


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Vitaly Kuznetsov
Olaf Hering  writes:

> On Thu, Dec 15, Vitaly Kuznetsov wrote:
>
>> I see a number of minor but at least one major issue against such move:
>> At least for some Hyper-V versions (2012R2 for example)
>> CHANNELMSG_UNLOAD_RESPONSE is delivered to the CPU which initially sent 
>> CHANNELMSG_REQUESTOFFERS and on kdump we may not have this CPU up as
>> we usually do kdump with nr_cpus=1 (and on the CPU which crashed). 
>
> Since the kdump or kexec kernel will send the unload during boot I would
> expect the response to arrive where it was sent, independent from the
> number of cpus.
>

We actually need to read the reply and empty the message slot to make
unload happen. And reading on a different CPU may not work, see:

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2016-December/097330.html

>> Minor issue is the necessity preserve the information about
>> message/events pages across kexec.
>
> I guess this info is stored somewhere, and the relevant gfns can be
> preserved across kernels, if we try really hard.
>
> But after looking further at the involved code paths it seems that the
> implemnted polling might be good enough to snatch the response. Was the
> mdelay(10) just an arbitrary decision?

I observed delays up to several seconds (!) before
CHANNELMSG_UNLOAD_RESPONSE is delivered.

> I interpret the comments in  vmbus_signal_eom such that the host may
> overwrite the response. Perhaps such thing may happen during the mdelay?

No, (at least in theory) the host is never supposed to overwrite
messages, it waits for the guest to clean the slot and do wrmsr.

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


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Olaf Hering
On Thu, Dec 15, Olaf Hering wrote:

> On Thu, Dec 15, Vitaly Kuznetsov wrote:
> 
> > I see a number of minor but at least one major issue against such move:
> > At least for some Hyper-V versions (2012R2 for example)
> > CHANNELMSG_UNLOAD_RESPONSE is delivered to the CPU which initially sent 
> > CHANNELMSG_REQUESTOFFERS and on kdump we may not have this CPU up as
> > we usually do kdump with nr_cpus=1 (and on the CPU which crashed). 
> 
> Since the kdump or kexec kernel will send the unload during boot I would
> expect the response to arrive where it was sent, independent from the
> number of cpus.

Wait, I just noticed that "REQUESTOFFERS" now. That might be a reason
why my suggestion will not work.

Olaf


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


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Olaf Hering
On Thu, Dec 15, Vitaly Kuznetsov wrote:

> I see a number of minor but at least one major issue against such move:
> At least for some Hyper-V versions (2012R2 for example)
> CHANNELMSG_UNLOAD_RESPONSE is delivered to the CPU which initially sent 
> CHANNELMSG_REQUESTOFFERS and on kdump we may not have this CPU up as
> we usually do kdump with nr_cpus=1 (and on the CPU which crashed). 

Since the kdump or kexec kernel will send the unload during boot I would
expect the response to arrive where it was sent, independent from the
number of cpus.

> Minor issue is the necessity preserve the information about
> message/events pages across kexec.

I guess this info is stored somewhere, and the relevant gfns can be
preserved across kernels, if we try really hard.


But after looking further at the involved code paths it seems that the
implemnted polling might be good enough to snatch the response. Was the
mdelay(10) just an arbitrary decision? I interpret the comments in
vmbus_signal_eom such that the host may overwrite the response. Perhaps
such thing may happen during the mdelay?


Olaf


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


Re: move hyperv CHANNELMSG_UNLOAD from crashed kernel to kdump kernel

2016-12-15 Thread Vitaly Kuznetsov
Olaf Hering  writes:

> KY,
>
> if a hyperv VM crashes alot of work must be done to prepare the
> environment for the kdump kernel. This approach is different compared to
> all the other VM types, or baremetal. Since the just crashed kernel is
> per definition unreliable all that work should be done within the kdump
> kernel because I think a reliable environment exists only there.
>
> Was it ever considered to do the CHANNELMSG_UNLOAD /
> CHANNELMSG_UNLOAD_RESPONSE work during boot, instead of doing it before
> starting the kexec/kdump kernel?

Sorry guys I missed the discussion, I was on vacation.

I see a number of minor but at least one major issue against such move:
At least for some Hyper-V versions (2012R2 for example)
CHANNELMSG_UNLOAD_RESPONSE is delivered to the CPU which initially sent 
CHANNELMSG_REQUESTOFFERS and on kdump we may not have this CPU up as
we usually do kdump with nr_cpus=1 (and on the CPU which crashed). 

Minor issue is the necessity preserve the information about
message/events pages across kexec.

>
> What would it take to prepare the runtime environment during boot?
> Does the newly booted kernel need any info from the previous kernel,
> something that cant be determined during boot? If yes, how can such info
> be passed from the old kernel to the new kernel?
>
> Olaf
>

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


Re: [PATCH 8/8] Makefile: drop -D__CHECK_ENDIAN__ from cflags

2016-12-15 Thread Marc Kleine-Budde
On 12/15/2016 06:15 AM, Michael S. Tsirkin wrote:
> That's the default now, no need for makefiles to set it.
> 
> Signed-off-by: Michael S. Tsirkin 
> ---
[...]
>  drivers/net/can/Makefile  | 1 -

For drivers/net/can/Makefile:

Acked-by: Marc Kleine-Budde 

regards,
Marc

-- 
Pengutronix e.K.  | Marc Kleine-Budde   |
Industrial Linux Solutions| Phone: +49-231-2826-924 |
Vertretung West/Dortmund  | Fax:   +49-5121-206917- |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



signature.asc
Description: OpenPGP digital signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel