Re: [Outreachy kernel] [PATCH] staging: rtl8712: Fixed 'tabstop' coding style warning

2018-03-01 Thread Julia Lawall


On Fri, 2 Mar 2018, Arushi Singhal wrote:

> Replace a mix of tabs and spaces indentation by tabs only.
>
> Fixed checkpatch warning "Statements should start on a tabstop" in
> rtl8712 module.

There is no need to say "in rtl8712 module".  That is apparent from the
subject line and the diffstat just below.

>
> Signed-off-by: Arushi Singhal 

Acked-by: Julia Lawall 


> ---
>  drivers/staging/rtl8712/drv_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8712/drv_types.h 
> b/drivers/staging/rtl8712/drv_types.h
> index ae79047..ede99e9 100644
> --- a/drivers/staging/rtl8712/drv_types.h
> +++ b/drivers/staging/rtl8712/drv_types.h
> @@ -161,7 +161,7 @@ struct _adapter {
>   u8  EepromAddressSize;
>   u8  hw_init_completed;
>   struct task_struct *cmdThread;
> -  pid_t evtThread;
> + pid_t evtThread;
>   struct task_struct *xmitThread;
>   pid_t recvThread;
>   uint (*dvobj_init)(struct _adapter *adapter);
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/20180302024749.GA16440%40seema-Inspiron-15-3567.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8712: Fixed 'tabstop' coding style warning

2018-03-01 Thread Arushi Singhal
Replace a mix of tabs and spaces indentation by tabs only.

Fixed checkpatch warning "Statements should start on a tabstop" in
rtl8712 module.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/rtl8712/drv_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index ae79047..ede99e9 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -161,7 +161,7 @@ struct _adapter {
u8  EepromAddressSize;
u8  hw_init_completed;
struct task_struct *cmdThread;
-pid_t evtThread;
+   pid_t evtThread;
struct task_struct *xmitThread;
pid_t recvThread;
uint (*dvobj_init)(struct _adapter *adapter);
-- 
2.7.4

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


Re: [PATCH 3/5] staging: ks7010: Factor out repeated code into function 'ks_wlan_cap()'.

2018-03-01 Thread Tobin C. Harding
On Thu, Mar 01, 2018 at 05:28:26PM -0800, Quytelda Kahja wrote:
> Tobin,
> I understand your point, and I've read submitting-patches.rst.  I made
> that wording choice because I was looking at some older commits that
> were worded like that.  I'm fairly new to the kernel workflow, so I
> was just trying to emulate something established, and it sounded less
> stilted than my imperative attempts.  However, I will word my change
> logs in the imperative as best I can in the future.

If you master the art of writing commit logs let me know - I'm chasing
that elusive goal myself.

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


[PATCH 2/2] staging: most: Fix a coding style problem

2018-03-01 Thread Quytelda Kahja
Indent the parameters for a function call that extends past 80 characters.

Signed-off-by: Quytelda Kahja 
---
 drivers/staging/most/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index 67e2d7f29967..8d311970225e 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -1473,7 +1473,8 @@ void most_deregister_interface(struct most_interface 
*iface)
int i;
struct most_channel *c;
 
-   pr_info("deregistering device %s (%s)\n", dev_name(>dev), 
iface->description);
+   pr_info("deregistering device %s (%s)\n", dev_name(>dev),
+   iface->description);
for (i = 0; i < iface->num_channels; i++) {
c = iface->p->channel[i];
if (c->pipe0.comp)
-- 
2.16.2

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


[PATCH 1/2] staging: most: Fix a coding style problem.

2018-03-01 Thread Quytelda Kahja
Use a blank line after components_show() function declaration.

Signed-off-by: Quytelda Kahja 
---
 drivers/staging/most/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index 0ab2de5ecf18..67e2d7f29967 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -583,6 +583,7 @@ static ssize_t components_show(struct device_driver *drv, 
char *buf)
}
return offs;
 }
+
 /**
  * split_string - parses buf and extracts ':' separated substrings.
  *
-- 
2.16.2

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


Re: [PATCH 3/5] staging: ks7010: Factor out repeated code into function 'ks_wlan_cap()'.

2018-03-01 Thread Quytelda Kahja
Tobin,
I understand your point, and I've read submitting-patches.rst.  I made
that wording choice because I was looking at some older commits that
were worded like that.  I'm fairly new to the kernel workflow, so I
was just trying to emulate something established, and it sounded less
stilted than my imperative attempts.  However, I will word my change
logs in the imperative as best I can in the future.

Thank you,
Quytelda Kahja

On Thu, Mar 1, 2018 at 12:54 PM, Tobin C. Harding  wrote:
> On Thu, Mar 01, 2018 at 02:15:00PM +0300, Dan Carpenter wrote:
>> On Thu, Mar 01, 2018 at 05:37:21PM +1100, Tobin C. Harding wrote:
>> > On Wed, Feb 28, 2018 at 09:19:09PM -0800, Quytelda Kahja wrote:
>> > > The code that generates a WLAN capability mask is repeated in five
>> > > functions.  This change refactors that code into a new function, which is
>> > > called now in each of those functions.
>> >
>> > Perhaps in future something like:
>> >
>> > Code to generate the WLAN capability mask is duplicated five times
>> >
>> > Add helper function to generate WLAN capability mask, refactor code to
>> > use newly defined function.
>> >
>>
>> I honestly don't see the difference between that and what Quytelda
>> wrote?  I understood the original changelog just fine.
>>
>> regards,
>> dan carpenter
>
> I had a feeling that the sentiment of the suggestion I was trying to get
> at didn't come across, thanks for pointing it out.  I was intending to
> suggest not using sentences like this
>
> > This change refactors that code into a new function, which is
> > called now in each of those functions.
>
> And instead use, as suggested in submitting-patches.rst, imperative mood
>
> Refactor code into new function ...
>
> FTR I find the English bits of kernel dev (and programming in general)
> the most difficult even though English is my first language.  I would
> like to write it better.
>
>
> Hope this helps,
> Tobin.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH net 8/9] hv_netvsc: propagate rx filters to VF

2018-03-01 Thread Stephen Hemminger
On Thu,  1 Mar 2018 10:27:55 -0800
Stephen Hemminger  wrote:

> + if (change & IFF_PROMISC)
> + dev_set_promiscuity(net,
> + (net->flags & IFF_PROMISC) ? 1 : -1);

This should be vf_netdev here.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH net 8/9] hv_netvsc: propagate rx filters to VF

2018-03-01 Thread Jakub Kicinski
On Thu,  1 Mar 2018 10:27:55 -0800, Stephen Hemminger wrote:
> The netvsc device should propagate filters to the SR-IOV VF
> device (if present). The flags also need to be propagated to the
> VF device as well. This only really matters on local Hyper-V
> since Azure does not support multiple addresses.
> 
> The rx filter management in netvsc device does not need to be done
> in a work queue since it is called with RTNL held.
> 
> Signed-off-by: Stephen Hemminger 

Do you also propagate them when VF gets unplugged and plugged back in?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[staging:staging-testing 217/217] drivers/staging/nvec/nvec_power.c:361:10: warning: 'return' with a value, in function returning void

2018-03-01 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-testing
head:   501b9cb070bc35073f4195b58e74098a9d31375c
commit: 501b9cb070bc35073f4195b58e74098a9d31375c [217/217] staging: nvec: add 
error checking to nvec_event
config: arm-multi_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 501b9cb070bc35073f4195b58e74098a9d31375c
# save the attached .config to linux build tree
make.cross ARCH=arm 

All warnings (new ones prefixed by >>):

   drivers/staging/nvec/nvec_power.c: In function 'nvec_power_poll':
>> drivers/staging/nvec/nvec_power.c:361:10: warning: 'return' with a value, in 
>> function returning void
  return err;
 ^~~
   drivers/staging/nvec/nvec_power.c:348:13: note: declared here
static void nvec_power_poll(struct work_struct *work)
^~~

vim +/return +361 drivers/staging/nvec/nvec_power.c

   347  
   348  static void nvec_power_poll(struct work_struct *work)
   349  {
   350  int err;
   351  char buf[] = { NVEC_SYS, GET_SYSTEM_STATUS };
   352  struct nvec_power *power = container_of(work, struct nvec_power,
   353  poller.work);
   354  
   355  if (counter >= ARRAY_SIZE(bat_iter))
   356  counter = 0;
   357  
   358  /* AC status via sys req */
   359  err = nvec_write_async(power->nvec, buf, 2);
   360  if (err != 0)
 > 361  return err;
   362  
   363  msleep(100);
   364  
   365  /*
   366   * Select a battery request function via round robin doing it 
all at
   367   * once seems to overload the power supply.
   368   */
   369  buf[0] = NVEC_BAT;
   370  buf[1] = bat_iter[counter++];
   371  nvec_write_async(power->nvec, buf, 2);
   372  
   373  schedule_delayed_work(to_delayed_work(work), 
msecs_to_jiffies(5000));
   374  };
   375  

---
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/5] staging: ks7010: Factor out repeated code into function 'ks_wlan_cap()'.

2018-03-01 Thread Tobin C. Harding
On Thu, Mar 01, 2018 at 02:15:00PM +0300, Dan Carpenter wrote:
> On Thu, Mar 01, 2018 at 05:37:21PM +1100, Tobin C. Harding wrote:
> > On Wed, Feb 28, 2018 at 09:19:09PM -0800, Quytelda Kahja wrote:
> > > The code that generates a WLAN capability mask is repeated in five
> > > functions.  This change refactors that code into a new function, which is
> > > called now in each of those functions.
> > 
> > Perhaps in future something like:
> > 
> > Code to generate the WLAN capability mask is duplicated five times
> > 
> > Add helper function to generate WLAN capability mask, refactor code to
> > use newly defined function.
> > 
> 
> I honestly don't see the difference between that and what Quytelda
> wrote?  I understood the original changelog just fine.
> 
> regards,
> dan carpenter

I had a feeling that the sentiment of the suggestion I was trying to get
at didn't come across, thanks for pointing it out.  I was intending to
suggest not using sentences like this

> This change refactors that code into a new function, which is
> called now in each of those functions.

And instead use, as suggested in submitting-patches.rst, imperative mood

Refactor code into new function ...

FTR I find the English bits of kernel dev (and programming in general)
the most difficult even though English is my first language.  I would
like to write it better.


Hope this helps,
Tobin.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH net 0/9] hv_netvsc: minor bug fixes

2018-03-01 Thread Stephen Hemminger
These are improvements to netvsc driver. They aren't functionality
changes so not targeting net-next; and they are not show stopper
bugs that need to go to stable either.

Stephen Hemminger (9):
  hv_netvsc: avoid retry on send during shutdown
  hv_netvsc: only wake transmit queue if link is up
  hv_netvsc: fix error unwind handling if vmbus_open fails
  hv_netvsc: cancel subchannel setup before halting device
  hv_netvsc: fix race in napi poll when rescheduling
  hv_netvsc: use napi_schedule_irqoff
  hv_netvsc: don't need full irqsave for request_lock
  hv_netvsc: propagate rx filters to VF
  hv_netvsc: defer queue selection to VF

 drivers/net/hyperv/hyperv_net.h   |  4 +--
 drivers/net/hyperv/netvsc.c   | 33 +--
 drivers/net/hyperv/netvsc_drv.c   | 57 +++
 drivers/net/hyperv/rndis_filter.c | 54 +++--
 4 files changed, 80 insertions(+), 68 deletions(-)

-- 
2.16.1

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


[PATCH net 2/9] hv_netvsc: only wake transmit queue if link is up

2018-03-01 Thread Stephen Hemminger
Don't wake transmit queues if link is not up yet.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc_drv.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index c5584c2d440e..fa6cf18e7719 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -91,12 +91,11 @@ static int netvsc_open(struct net_device *net)
return ret;
}
 
-   netif_tx_wake_all_queues(net);
-
rdev = nvdev->extension;
-
-   if (!rdev->link_state)
+   if (!rdev->link_state) {
netif_carrier_on(net);
+   netif_tx_wake_all_queues(net);
+   }
 
if (vf_netdev) {
/* Setting synthetic device up transparently sets
-- 
2.16.1

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


[PATCH net 1/9] hv_netvsc: avoid retry on send during shutdown

2018-03-01 Thread Stephen Hemminger
Change the initialization order so that the device is ready to transmit
(ie connect vsp is completed) before setting the internal reference
to the device with RCU.

This avoids any races on initialization and prevents retry issues
on shutdown.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 24 +++-
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 17e529af79dc..686900d61374 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -852,13 +852,6 @@ int netvsc_send(struct net_device *ndev,
if (unlikely(!net_device || net_device->destroy))
return -ENODEV;
 
-   /* We may race with netvsc_connect_vsp()/netvsc_init_buf() and get
-* here before the negotiation with the host is finished and
-* send_section_map may not be allocated yet.
-*/
-   if (unlikely(!net_device->send_section_map))
-   return -EAGAIN;
-
nvchan = _device->chan_table[packet->q_idx];
packet->send_buf_index = NETVSC_INVALID_INDEX;
packet->cp_partial = false;
@@ -866,10 +859,8 @@ int netvsc_send(struct net_device *ndev,
/* Send control message directly without accessing msd (Multi-Send
 * Data) field which may be changed during data packet processing.
 */
-   if (!skb) {
-   cur_send = packet;
-   goto send_now;
-   }
+   if (!skb)
+   return netvsc_send_pkt(device, packet, net_device, pb, skb);
 
/* batch packets in send buffer if possible */
msdp = >msd;
@@ -953,7 +944,6 @@ int netvsc_send(struct net_device *ndev,
}
}
 
-send_now:
if (cur_send)
ret = netvsc_send_pkt(device, cur_send, net_device, pb, skb);
 
@@ -1306,11 +1296,6 @@ struct netvsc_device *netvsc_device_add(struct hv_device 
*device,
 
napi_enable(_device->chan_table[0].napi);
 
-   /* Writing nvdev pointer unlocks netvsc_send(), make sure chn_table is
-* populated.
-*/
-   rcu_assign_pointer(net_device_ctx->nvdev, net_device);
-
/* Connect with the NetVsp */
ret = netvsc_connect_vsp(device, net_device, device_info);
if (ret != 0) {
@@ -1319,6 +1304,11 @@ struct netvsc_device *netvsc_device_add(struct hv_device 
*device,
goto close;
}
 
+   /* Writing nvdev pointer unlocks netvsc_send(), make sure chn_table is
+* populated.
+*/
+   rcu_assign_pointer(net_device_ctx->nvdev, net_device);
+
return net_device;
 
 close:
-- 
2.16.1

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


[PATCH net 5/9] hv_netvsc: fix race in napi poll when rescheduling

2018-03-01 Thread Stephen Hemminger
There is a race between napi_reschedule and re-enabling interrupts
which could lead to missed host interrrupts.  This occurs when
interrupts are re-enabled (hv_end_read) and vmbus irq callback
(netvsc_channel_cb) has already scheduled NAPI.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index ff97a85b2e9d..4237cedc4f08 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1207,9 +1207,10 @@ int netvsc_poll(struct napi_struct *napi, int budget)
if (send_recv_completions(ndev, net_device, nvchan) == 0 &&
work_done < budget &&
napi_complete_done(napi, work_done) &&
-   hv_end_read(>inbound)) {
+   hv_end_read(>inbound) &&
+   napi_schedule_prep(napi)) {
hv_begin_read(>inbound);
-   napi_reschedule(napi);
+   __napi_schedule(napi);
}
 
/* Driver may overshoot since multiple packets per descriptor */
-- 
2.16.1

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


[PATCH net 9/9] hv_netvsc: defer queue selection to VF

2018-03-01 Thread Stephen Hemminger
When VF is used for accelerated networking it will likely have
more queues (and different policy) than the synthetic NIC.
This patch defers the queue policy to the VF so that all the
queues can be used. This impacts workloads like local generate UDP.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc_drv.c | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 1909c58e0a7e..e36f3ae6893b 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -322,8 +322,19 @@ static u16 netvsc_select_queue(struct net_device *ndev, 
struct sk_buff *skb,
rcu_read_lock();
vf_netdev = rcu_dereference(ndc->vf_netdev);
if (vf_netdev) {
-   txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0;
-   qdisc_skb_cb(skb)->slave_dev_queue_mapping = skb->queue_mapping;
+   const struct net_device_ops *vf_ops = vf_netdev->netdev_ops;
+
+   if (vf_ops->ndo_select_queue)
+   txq = vf_ops->ndo_select_queue(vf_netdev, skb,
+  accel_priv, fallback);
+   else
+   txq = fallback(vf_netdev, skb);
+
+   /* Record the queue selected by VF so that it can be
+* used for common case where VF has more queues than
+* the synthetic device.
+*/
+   qdisc_skb_cb(skb)->slave_dev_queue_mapping = txq;
} else {
txq = netvsc_pick_tx(ndev, skb);
}
-- 
2.16.1

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


[PATCH net 4/9] hv_netvsc: cancel subchannel setup before halting device

2018-03-01 Thread Stephen Hemminger
Block setup of multiple channels earlier in the teardown
process. This avoids possible races between halt and subchannel
initialization.

Suggested-by: Haiyang Zhang 
Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/rndis_filter.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/hyperv/rndis_filter.c 
b/drivers/net/hyperv/rndis_filter.c
index c3ca191fea7f..1cba767c6453 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -1340,6 +1340,9 @@ void rndis_filter_device_remove(struct hv_device *dev,
 {
struct rndis_device *rndis_dev = net_dev->extension;
 
+   /* Don't try and setup sub channels if about to halt */
+   cancel_work_sync(_dev->subchan_work);
+
/* Halt and release the rndis device */
rndis_filter_halt_device(rndis_dev);
 
-- 
2.16.1

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


[PATCH net 7/9] hv_netvsc: don't need full irqsave for request_lock

2018-03-01 Thread Stephen Hemminger
Since the driver incoming handling is done with NAPI.
This path is run in softirq (not hardirq) therefore don't
need to do full local irq save/restore.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/rndis_filter.c | 16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/net/hyperv/rndis_filter.c 
b/drivers/net/hyperv/rndis_filter.c
index 1cba767c6453..3ce11361634f 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -92,7 +92,6 @@ static struct rndis_request *get_rndis_request(struct 
rndis_device *dev,
struct rndis_request *request;
struct rndis_message *rndis_msg;
struct rndis_set_request *set;
-   unsigned long flags;
 
request = kzalloc(sizeof(struct rndis_request), GFP_KERNEL);
if (!request)
@@ -115,9 +114,9 @@ static struct rndis_request *get_rndis_request(struct 
rndis_device *dev,
set->req_id = atomic_inc_return(>new_req_id);
 
/* Add to the request list */
-   spin_lock_irqsave(>request_lock, flags);
+   spin_lock_bh(>request_lock);
list_add_tail(>list_ent, >req_list);
-   spin_unlock_irqrestore(>request_lock, flags);
+   spin_unlock_bh(>request_lock);
 
return request;
 }
@@ -125,11 +124,9 @@ static struct rndis_request *get_rndis_request(struct 
rndis_device *dev,
 static void put_rndis_request(struct rndis_device *dev,
struct rndis_request *req)
 {
-   unsigned long flags;
-
-   spin_lock_irqsave(>request_lock, flags);
+   spin_lock_bh(>request_lock);
list_del(>list_ent);
-   spin_unlock_irqrestore(>request_lock, flags);
+   spin_unlock_bh(>request_lock);
 
kfree(req);
 }
@@ -269,10 +266,9 @@ static void rndis_filter_receive_response(struct 
rndis_device *dev,
 {
struct rndis_request *request = NULL;
bool found = false;
-   unsigned long flags;
struct net_device *ndev = dev->ndev;
 
-   spin_lock_irqsave(>request_lock, flags);
+   spin_lock_bh(>request_lock);
list_for_each_entry(request, >req_list, list_ent) {
/*
 * All request/response message contains RequestId as the 1st
@@ -284,7 +280,7 @@ static void rndis_filter_receive_response(struct 
rndis_device *dev,
break;
}
}
-   spin_unlock_irqrestore(>request_lock, flags);
+   spin_unlock_bh(>request_lock);
 
if (found) {
if (resp->msg_len <=
-- 
2.16.1

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


[PATCH net 8/9] hv_netvsc: propagate rx filters to VF

2018-03-01 Thread Stephen Hemminger
The netvsc device should propagate filters to the SR-IOV VF
device (if present). The flags also need to be propagated to the
VF device as well. This only really matters on local Hyper-V
since Azure does not support multiple addresses.

The rx filter management in netvsc device does not need to be done
in a work queue since it is called with RTNL held.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/hyperv_net.h   |  4 +---
 drivers/net/hyperv/netvsc_drv.c   | 35 ++-
 drivers/net/hyperv/rndis_filter.c | 35 ---
 3 files changed, 43 insertions(+), 31 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 0db3bd1ea06f..a4e1ebba84cf 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -172,8 +172,6 @@ struct rndis_device {
spinlock_t request_lock;
struct list_head req_list;
 
-   struct work_struct mcast_work;
-
bool link_state;/* 0 - link up, 1 - link down */
 
u8 hw_mac_adr[ETH_ALEN];
@@ -216,7 +214,7 @@ int rndis_filter_open(struct netvsc_device *nvdev);
 int rndis_filter_close(struct netvsc_device *nvdev);
 struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
  struct netvsc_device_info *info);
-void rndis_filter_update(struct netvsc_device *nvdev);
+void rndis_filter_update(struct netvsc_device *nvdev, unsigned int flags);
 void rndis_filter_device_remove(struct hv_device *dev,
struct netvsc_device *nvdev);
 int rndis_filter_set_rss_param(struct rndis_device *rdev,
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index fa6cf18e7719..1909c58e0a7e 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -66,12 +66,36 @@ static int debug = -1;
 module_param(debug, int, S_IRUGO);
 MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
 
-static void netvsc_set_multicast_list(struct net_device *net)
+static void netvsc_change_rx_flags(struct net_device *net, int change)
 {
-   struct net_device_context *net_device_ctx = netdev_priv(net);
-   struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);
+   struct net_device_context *ndev_ctx = netdev_priv(net);
+   struct net_device *vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);
+   struct netvsc_device *nvdev = rtnl_dereference(ndev_ctx->nvdev);
+
+   if (vf_netdev) {
+   if (change & IFF_PROMISC)
+   dev_set_promiscuity(net,
+   (net->flags & IFF_PROMISC) ? 1 : -1);
+
+   if (change & IFF_ALLMULTI)
+   dev_set_allmulti(net,
+(net->flags & IFF_ALLMULTI) ? 1 : -1);
+   }
 
-   rndis_filter_update(nvdev);
+   if (change & (IFF_PROMISC | IFF_ALLMULTI))
+   rndis_filter_update(nvdev, net->flags);
+}
+
+/* Hyper-V vswitch does not support filtering but VF does */
+static void netvsc_set_rx_mode(struct net_device *net)
+{
+   struct net_device_context *ndev_ctx = netdev_priv(net);
+   struct net_device *vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev);
+
+   if (vf_netdev) {
+   dev_uc_sync(vf_netdev, net);
+   dev_mc_sync(vf_netdev, net);
+   }
 }
 
 static int netvsc_open(struct net_device *net)
@@ -1575,7 +1599,8 @@ static const struct net_device_ops device_ops = {
.ndo_open = netvsc_open,
.ndo_stop = netvsc_close,
.ndo_start_xmit =   netvsc_start_xmit,
-   .ndo_set_rx_mode =  netvsc_set_multicast_list,
+   .ndo_change_rx_flags =  netvsc_change_rx_flags,
+   .ndo_set_rx_mode =  netvsc_set_rx_mode,
.ndo_change_mtu =   netvsc_change_mtu,
.ndo_validate_addr =eth_validate_addr,
.ndo_set_mac_address =  netvsc_set_mac_addr,
diff --git a/drivers/net/hyperv/rndis_filter.c 
b/drivers/net/hyperv/rndis_filter.c
index 3ce11361634f..199ec6da6bde 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -32,8 +32,6 @@
 
 #include "hyperv_net.h"
 
-static void rndis_set_multicast(struct work_struct *w);
-
 #define RNDIS_EXT_LEN PAGE_SIZE
 struct rndis_request {
struct list_head list_ent;
@@ -78,7 +76,6 @@ static struct rndis_device *get_rndis_device(void)
spin_lock_init(>request_lock);
 
INIT_LIST_HEAD(>req_list);
-   INIT_WORK(>mcast_work, rndis_set_multicast);
 
device->state = RNDIS_DEV_UNINITIALIZED;
 
@@ -846,26 +843,21 @@ static int rndis_filter_set_packet_filter(struct 
rndis_device *dev,
return ret;
 }
 
-static void rndis_set_multicast(struct work_struct *w)
+void rndis_filter_update(struct netvsc_device *nvdev,
+ 

[PATCH net 3/9] hv_netvsc: fix error unwind handling if vmbus_open fails

2018-03-01 Thread Stephen Hemminger
Need to delete NAPI association if vmbus_open fails.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 686900d61374..ff97a85b2e9d 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1286,7 +1286,6 @@ struct netvsc_device *netvsc_device_add(struct hv_device 
*device,
 netvsc_channel_cb, net_device->chan_table);
 
if (ret != 0) {
-   netif_napi_del(_device->chan_table[0].napi);
netdev_err(ndev, "unable to open channel: %d\n", ret);
goto cleanup;
}
@@ -1319,6 +1318,7 @@ struct netvsc_device *netvsc_device_add(struct hv_device 
*device,
vmbus_close(device->channel);
 
 cleanup:
+   netif_napi_del(_device->chan_table[0].napi);
free_netvsc_device(_device->rcu);
 
return ERR_PTR(ret);
-- 
2.16.1

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


[PATCH net 6/9] hv_netvsc: use napi_schedule_irqoff

2018-03-01 Thread Stephen Hemminger
Since the netvsc_channel_cb is already called in interrupt
context from vmbus, there is no need to do irqsave/restore.

Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 4237cedc4f08..0265d703eb03 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1233,7 +1233,7 @@ void netvsc_channel_cb(void *context)
/* disable interupts from host */
hv_begin_read(rbi);
 
-   __napi_schedule(>napi);
+   __napi_schedule_irqoff(>napi);
}
 }
 
-- 
2.16.1

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


[PATCH 2/3] staging: fsl-mc: Move DPBP out of staging

2018-03-01 Thread Bogdan Purcareata
Move the source files out of staging into their final locations:
- dpbp.c goes to drivers/bus/fsl-mc/, next to the core infrastructure
- dpbp-cmd.h gets merged into drivers/bus/fsl-mc/fsl-mc-private.h, next
  to the other internally used APIs
- dpbp.h gets merged into include/linux/fsl/mc.h, exposing the public
  API

Update references in the dpaa2-eth staging driver.

DPBP stands for Data Path Buffer Pool - you can read more about the
object in Documentation/networking/dpaa2/overview.rst

Signed-off-by: Bogdan Purcareata 
---
 drivers/bus/fsl-mc/Makefile   |  1 +
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c |  4 +-
 drivers/bus/fsl-mc/fsl-mc-private.h   | 39 +
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h|  2 +-
 drivers/staging/fsl-mc/bus/Makefile   |  3 +-
 drivers/staging/fsl-mc/bus/dpbp-cmd.h | 44 ---
 drivers/staging/fsl-mc/include/dpbp.h | 53 ---
 include/linux/fsl/mc.h| 42 ++
 8 files changed, 86 insertions(+), 102 deletions(-)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c (98%)
 delete mode 100644 drivers/staging/fsl-mc/bus/dpbp-cmd.h
 delete mode 100644 drivers/staging/fsl-mc/include/dpbp.h

diff --git a/drivers/bus/fsl-mc/Makefile b/drivers/bus/fsl-mc/Makefile
index 6a97f2c..da26e52 100644
--- a/drivers/bus/fsl-mc/Makefile
+++ b/drivers/bus/fsl-mc/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_FSL_MC_BUS) += mc-bus-driver.o
 mc-bus-driver-objs := fsl-mc-bus.o \
  mc-sys.o \
  mc-io.o \
+ dpbp.o \
  dprc.o \
  dprc-driver.o \
  fsl-mc-allocator.o \
diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/bus/fsl-mc/dpbp.c
similarity index 98%
rename from drivers/staging/fsl-mc/bus/dpbp.c
rename to drivers/bus/fsl-mc/dpbp.c
index 85735bb..31a360b 100644
--- a/drivers/staging/fsl-mc/bus/dpbp.c
+++ b/drivers/bus/fsl-mc/dpbp.c
@@ -5,9 +5,9 @@
  */
 #include 
 #include 
-#include "../include/dpbp.h"
+#include "linux/fsl/mc.h"
 
-#include "dpbp-cmd.h"
+#include "fsl-mc-private.h"
 
 /**
  * dpbp_open() - Open a control session for the specified object.
diff --git a/drivers/bus/fsl-mc/fsl-mc-private.h 
b/drivers/bus/fsl-mc/fsl-mc-private.h
index bed990c..4ef8d7e 100644
--- a/drivers/bus/fsl-mc/fsl-mc-private.h
+++ b/drivers/bus/fsl-mc/fsl-mc-private.h
@@ -379,6 +379,45 @@ int dprc_get_container_id(struct fsl_mc_io *mc_io,
  u32 cmd_flags,
  int *container_id);
 
+/*
+ * Data Path Buffer Pool (DPBP) API
+ */
+
+/* DPBP Version */
+#define DPBP_VER_MAJOR 3
+#define DPBP_VER_MINOR 2
+
+/* Command versioning */
+#define DPBP_CMD_BASE_VERSION  1
+#define DPBP_CMD_ID_OFFSET 4
+
+#define DPBP_CMD(id)   (((id) << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
+
+/* Command IDs */
+#define DPBP_CMDID_CLOSE   DPBP_CMD(0x800)
+#define DPBP_CMDID_OPENDPBP_CMD(0x804)
+
+#define DPBP_CMDID_ENABLE  DPBP_CMD(0x002)
+#define DPBP_CMDID_DISABLE DPBP_CMD(0x003)
+#define DPBP_CMDID_GET_ATTRDPBP_CMD(0x004)
+#define DPBP_CMDID_RESET   DPBP_CMD(0x005)
+
+struct dpbp_cmd_open {
+   __le32 dpbp_id;
+};
+
+#define DPBP_ENABLE0x1
+
+struct dpbp_rsp_get_attributes {
+   /* response word 0 */
+   __le16 pad;
+   __le16 bpid;
+   __le32 id;
+   /* response word 1 */
+   __le16 version_major;
+   __le16 version_minor;
+};
+
 /**
  * Maximum number of total IRQs that can be pre-allocated for an MC bus'
  * IRQ pool
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index e577410..ce864ee 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -35,10 +35,10 @@
 
 #include 
 #include 
+#include 
 
 #include "../../fsl-mc/include/dpaa2-io.h"
 #include "../../fsl-mc/include/dpaa2-fd.h"
-#include "../../fsl-mc/include/dpbp.h"
 #include "../../fsl-mc/include/dpcon.h"
 #include "dpni.h"
 #include "dpni-cmd.h"
diff --git a/drivers/staging/fsl-mc/bus/Makefile 
b/drivers/staging/fsl-mc/bus/Makefile
index b67889e..ea6479f 100644
--- a/drivers/staging/fsl-mc/bus/Makefile
+++ b/drivers/staging/fsl-mc/bus/Makefile
@@ -4,8 +4,7 @@
 #
 # Copyright (C) 2014 Freescale Semiconductor, Inc.
 #
-obj-$(CONFIG_FSL_MC_BUS) += dpbp.o \
-   dpcon.o
+obj-$(CONFIG_FSL_MC_BUS) += dpcon.o
 
 # MC DPIO driver
 obj-$(CONFIG_FSL_MC_DPIO) += dpio/
diff --git a/drivers/staging/fsl-mc/bus/dpbp-cmd.h 
b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
deleted file mode 100644
index 3340021..000
--- a/drivers/staging/fsl-mc/bus/dpbp-cmd.h
+++ /dev/null
@@ 

[PATCH 3/3] staging: fsl-mc: Move DPCON out of staging

2018-03-01 Thread Bogdan Purcareata
Move the source files out of staging into their final locations:
- dpcon.c goes to drivers/bus/fsl-mc/, next to the core infrastructure
- dpcon-cmd.h gets merged into drivers/bus/fsl-mc/fsl-mc-private.h, next
  to the other internally used APIs
- dpcon.h gets merged into include/linux/fsl/mc.h, exposing the public
  API

Update references in the dpaa2-eth staging driver.

DPCON stands for Data Path Concentrator - an interface between DPIO
(Data Path IO) and its users (e.g. dpaa2-eth). You can read more about
DPIO in Documentation/networking/dpaa2/overview.rst

Signed-off-by: Bogdan Purcareata 
---
 drivers/bus/fsl-mc/Makefile|  1 +
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpcon.c |  4 +-
 drivers/bus/fsl-mc/fsl-mc-private.h| 48 +
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |  1 -
 drivers/staging/fsl-mc/bus/Makefile|  1 -
 drivers/staging/fsl-mc/bus/dpcon-cmd.h | 53 ---
 drivers/staging/fsl-mc/include/dpcon.h | 79 --
 include/linux/fsl/mc.h | 66 ++
 8 files changed, 117 insertions(+), 136 deletions(-)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpcon.c (99%)
 delete mode 100644 drivers/staging/fsl-mc/bus/dpcon-cmd.h
 delete mode 100644 drivers/staging/fsl-mc/include/dpcon.h

diff --git a/drivers/bus/fsl-mc/Makefile b/drivers/bus/fsl-mc/Makefile
index da26e52..3c518c7 100644
--- a/drivers/bus/fsl-mc/Makefile
+++ b/drivers/bus/fsl-mc/Makefile
@@ -10,6 +10,7 @@ mc-bus-driver-objs := fsl-mc-bus.o \
  mc-sys.o \
  mc-io.o \
  dpbp.o \
+ dpcon.o \
  dprc.o \
  dprc-driver.o \
  fsl-mc-allocator.o \
diff --git a/drivers/staging/fsl-mc/bus/dpcon.c b/drivers/bus/fsl-mc/dpcon.c
similarity index 99%
rename from drivers/staging/fsl-mc/bus/dpcon.c
rename to drivers/bus/fsl-mc/dpcon.c
index 021b425..5d220c9 100644
--- a/drivers/staging/fsl-mc/bus/dpcon.c
+++ b/drivers/bus/fsl-mc/dpcon.c
@@ -5,9 +5,9 @@
  */
 #include 
 #include 
-#include "../include/dpcon.h"
+#include "linux/fsl/mc.h"
 
-#include "dpcon-cmd.h"
+#include "fsl-mc-private.h"
 
 /**
  * dpcon_open() - Open a control session for the specified object
diff --git a/drivers/bus/fsl-mc/fsl-mc-private.h 
b/drivers/bus/fsl-mc/fsl-mc-private.h
index 4ef8d7e..52c069d 100644
--- a/drivers/bus/fsl-mc/fsl-mc-private.h
+++ b/drivers/bus/fsl-mc/fsl-mc-private.h
@@ -418,6 +418,54 @@ struct dpbp_rsp_get_attributes {
__le16 version_minor;
 };
 
+/*
+ * Data Path Concentrator (DPCON) API
+ */
+
+/* DPCON Version */
+#define DPCON_VER_MAJOR3
+#define DPCON_VER_MINOR2
+
+/* Command versioning */
+#define DPCON_CMD_BASE_VERSION 1
+#define DPCON_CMD_ID_OFFSET4
+
+#define DPCON_CMD(id)  (((id) << DPCON_CMD_ID_OFFSET) | DPCON_CMD_BASE_VERSION)
+
+/* Command IDs */
+#define DPCON_CMDID_CLOSE  DPCON_CMD(0x800)
+#define DPCON_CMDID_OPEN   DPCON_CMD(0x808)
+
+#define DPCON_CMDID_ENABLE DPCON_CMD(0x002)
+#define DPCON_CMDID_DISABLEDPCON_CMD(0x003)
+#define DPCON_CMDID_GET_ATTR   DPCON_CMD(0x004)
+#define DPCON_CMDID_RESET  DPCON_CMD(0x005)
+
+#define DPCON_CMDID_SET_NOTIFICATION   DPCON_CMD(0x100)
+
+struct dpcon_cmd_open {
+   __le32 dpcon_id;
+};
+
+#define DPCON_ENABLE   1
+
+struct dpcon_rsp_get_attr {
+   /* response word 0 */
+   __le32 id;
+   __le16 qbman_ch_id;
+   u8 num_priorities;
+   u8 pad;
+};
+
+struct dpcon_cmd_set_notification {
+   /* cmd word 0 */
+   __le32 dpio_id;
+   u8 priority;
+   u8 pad[3];
+   /* cmd word 1 */
+   __le64 user_ctx;
+};
+
 /**
  * Maximum number of total IRQs that can be pre-allocated for an MC bus'
  * IRQ pool
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
index ce864ee..b8990cf 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h
@@ -39,7 +39,6 @@
 
 #include "../../fsl-mc/include/dpaa2-io.h"
 #include "../../fsl-mc/include/dpaa2-fd.h"
-#include "../../fsl-mc/include/dpcon.h"
 #include "dpni.h"
 #include "dpni-cmd.h"
 
diff --git a/drivers/staging/fsl-mc/bus/Makefile 
b/drivers/staging/fsl-mc/bus/Makefile
index ea6479f..21d8ebc 100644
--- a/drivers/staging/fsl-mc/bus/Makefile
+++ b/drivers/staging/fsl-mc/bus/Makefile
@@ -4,7 +4,6 @@
 #
 # Copyright (C) 2014 Freescale Semiconductor, Inc.
 #
-obj-$(CONFIG_FSL_MC_BUS) += dpcon.o
 
 # MC DPIO driver
 obj-$(CONFIG_FSL_MC_DPIO) += dpio/
diff --git a/drivers/staging/fsl-mc/bus/dpcon-cmd.h 
b/drivers/staging/fsl-mc/bus/dpcon-cmd.h
deleted 

[PATCH 1/3] staging: fsl-mc: Cleanup dpbp and dpcon API

2018-03-01 Thread Bogdan Purcareata
Some functions and associated structures are not used by current code,
so remove them.

Signed-off-by: Bogdan Purcareata 
---
 drivers/staging/fsl-mc/bus/dpbp-cmd.h | 10 --
 drivers/staging/fsl-mc/bus/dpbp.c | 67 ---
 drivers/staging/fsl-mc/include/dpbp.h | 10 --
 3 files changed, 87 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/dpbp-cmd.h 
b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
index 0b7f5c0..3340021 100644
--- a/drivers/staging/fsl-mc/bus/dpbp-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
@@ -19,28 +19,18 @@
 /* Command IDs */
 #define DPBP_CMDID_CLOSE   DPBP_CMD(0x800)
 #define DPBP_CMDID_OPENDPBP_CMD(0x804)
-#define DPBP_CMDID_GET_API_VERSION DPBP_CMD(0xa04)
 
 #define DPBP_CMDID_ENABLE  DPBP_CMD(0x002)
 #define DPBP_CMDID_DISABLE DPBP_CMD(0x003)
 #define DPBP_CMDID_GET_ATTRDPBP_CMD(0x004)
 #define DPBP_CMDID_RESET   DPBP_CMD(0x005)
-#define DPBP_CMDID_IS_ENABLED  DPBP_CMD(0x006)
 
 struct dpbp_cmd_open {
__le32 dpbp_id;
 };
 
-struct dpbp_cmd_destroy {
-   __le32 object_id;
-};
-
 #define DPBP_ENABLE0x1
 
-struct dpbp_rsp_is_enabled {
-   u8 enabled;
-};
-
 struct dpbp_rsp_get_attributes {
/* response word 0 */
__le16 pad;
diff --git a/drivers/staging/fsl-mc/bus/dpbp.c 
b/drivers/staging/fsl-mc/bus/dpbp.c
index c0addaa..85735bb 100644
--- a/drivers/staging/fsl-mc/bus/dpbp.c
+++ b/drivers/staging/fsl-mc/bus/dpbp.c
@@ -126,40 +126,6 @@ int dpbp_disable(struct fsl_mc_io *mc_io,
 EXPORT_SYMBOL_GPL(dpbp_disable);
 
 /**
- * dpbp_is_enabled() - Check if the DPBP is enabled.
- * @mc_io: Pointer to MC portal's I/O object
- * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
- * @token: Token of DPBP object
- * @en:Returns '1' if object is enabled; '0' otherwise
- *
- * Return: '0' on Success; Error code otherwise.
- */
-int dpbp_is_enabled(struct fsl_mc_io *mc_io,
-   u32 cmd_flags,
-   u16 token,
-   int *en)
-{
-   struct mc_command cmd = { 0 };
-   struct dpbp_rsp_is_enabled *rsp_params;
-   int err;
-   /* prepare command */
-   cmd.header = mc_encode_cmd_header(DPBP_CMDID_IS_ENABLED, cmd_flags,
- token);
-
-   /* send command to mc*/
-   err = mc_send_command(mc_io, );
-   if (err)
-   return err;
-
-   /* retrieve response parameters */
-   rsp_params = (struct dpbp_rsp_is_enabled *)cmd.params;
-   *en = rsp_params->enabled & DPBP_ENABLE;
-
-   return 0;
-}
-EXPORT_SYMBOL_GPL(dpbp_is_enabled);
-
-/**
  * dpbp_reset() - Reset the DPBP, returns the object to initial state.
  * @mc_io: Pointer to MC portal's I/O object
  * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
@@ -218,36 +184,3 @@ int dpbp_get_attributes(struct fsl_mc_io *mc_io,
return 0;
 }
 EXPORT_SYMBOL_GPL(dpbp_get_attributes);
-
-/**
- * dpbp_get_api_version - Get Data Path Buffer Pool API version
- * @mc_io: Pointer to Mc portal's I/O object
- * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
- * @major_ver: Major version of Buffer Pool API
- * @minor_ver: Minor version of Buffer Pool API
- *
- * Return: '0' on Success; Error code otherwise.
- */
-int dpbp_get_api_version(struct fsl_mc_io *mc_io,
-u32 cmd_flags,
-u16 *major_ver,
-u16 *minor_ver)
-{
-   struct mc_command cmd = { 0 };
-   int err;
-
-   /* prepare command */
-   cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_API_VERSION,
- cmd_flags, 0);
-
-   /* send command to mc */
-   err = mc_send_command(mc_io, );
-   if (err)
-   return err;
-
-   /* retrieve response parameters */
-   mc_cmd_read_api_version(, major_ver, minor_ver);
-
-   return 0;
-}
-EXPORT_SYMBOL_GPL(dpbp_get_api_version);
diff --git a/drivers/staging/fsl-mc/include/dpbp.h 
b/drivers/staging/fsl-mc/include/dpbp.h
index 4a18096..7b9f7ad 100644
--- a/drivers/staging/fsl-mc/include/dpbp.h
+++ b/drivers/staging/fsl-mc/include/dpbp.h
@@ -30,11 +30,6 @@ int dpbp_disable(struct fsl_mc_io *mc_io,
 u32 cmd_flags,
 u16 token);
 
-int dpbp_is_enabled(struct fsl_mc_io *mc_io,
-   u32 cmd_flags,
-   u16 token,
-   int *en);
-
 int dpbp_reset(struct fsl_mc_io *mc_io,
   u32 cmd_flags,
   u16 token);
@@ -55,9 +50,4 @@ int dpbp_get_attributes(struct fsl_mc_io *mc_io,
u16 token,
struct dpbp_attr *attr);
 
-int dpbp_get_api_version(struct fsl_mc_io *mc_io,
-u32 cmd_flags,
-u16 *major_ver,
-u16 

[PATCH 0/3] staging: fsl-mc: Move DPBP and DPCON out of staging

2018-03-01 Thread Bogdan Purcareata
Commit 6bd067c48ef ("staging: fsl-mc: Move core bus out of staging")
moves the fsl-mc bus driver infrastructure out of staging to
drivers/bus/fsl-mc. The next step is moving a couple of tightly
connected DPAA2 objects - DPBP (Data Path Buffer Pool) and DPCON
(Data Path Concentrator).

Patch 1 removes dead code from the involved source files.

Patches 2-3 handle moving out the mentioned objects, one at a time.

Bogdan Purcareata (3):
  staging: fsl-mc: Cleanup dpbp and dpcon API
  staging: fsl-mc: Move DPBP out of staging
  staging: fsl-mc: Move DPCON out of staging

 drivers/bus/fsl-mc/Makefile|   2 +
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c  |  71 +-
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpcon.c |   4 +-
 drivers/bus/fsl-mc/fsl-mc-private.h|  87 +
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h |   3 +-
 drivers/staging/fsl-mc/bus/Makefile|   2 -
 drivers/staging/fsl-mc/bus/dpbp-cmd.h  |  54 ---
 drivers/staging/fsl-mc/bus/dpcon-cmd.h |  53 --
 drivers/staging/fsl-mc/include/dpbp.h  |  63 
 drivers/staging/fsl-mc/include/dpcon.h |  79 ---
 include/linux/fsl/mc.h | 108 +
 11 files changed, 202 insertions(+), 324 deletions(-)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c (73%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpcon.c (99%)
 delete mode 100644 drivers/staging/fsl-mc/bus/dpbp-cmd.h
 delete mode 100644 drivers/staging/fsl-mc/bus/dpcon-cmd.h
 delete mode 100644 drivers/staging/fsl-mc/include/dpbp.h
 delete mode 100644 drivers/staging/fsl-mc/include/dpcon.h

-- 
2.7.4

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


Re: [PATCH] staging/imx: Fix inconsistent IS_ERR and PTR_ERR

2018-03-01 Thread Fabio Estevam
On Thu, Mar 1, 2018 at 1:27 PM, Philipp Zabel  wrote:

> Oh, this only works for csi ports that have pinctrl in their csi port
> node, like:
>
> _csi0 {
> pinctrl-names = "default";
> pinctrl-0 = <_ipu1_csi0>;
> };

This is the case for imx6qdl-sabresd.dtsi and even in this case
devm_pinctrl_get_select_default() fails

> pinctrl would have to be moved out of the csi port nodes, for example
> into their parent ipu nodes, or maybe more correctly, into the video mux
> nodes in each device tree.

Tried it like this:

--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -154,12 +154,9 @@
 };

 _csi0_mux_from_parallel_sensor {
-   remote-endpoint = <_to_ipu1_csi0_mux>;
-};
-
-_csi0 {
pinctrl-names = "default";
pinctrl-0 = <_ipu1_csi0>;
+   remote-endpoint = <_to_ipu1_csi0_mux>;
 };

 _csi {


but still get the devm_pinctrl_get_select_default() failure.

I was not able to change the dts so that
devm_pinctrl_get_select_default() succeeds.

If you agree I can send the following change:

diff --git a/drivers/staging/media/imx/imx-media-csi.c
b/drivers/staging/media/imx/imx-media-csi.c
index 5a195f8..c40f786 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -1797,11 +1797,8 @@ static int imx_csi_probe(struct platform_device *pdev)
 */
priv->dev->of_node = pdata->of_node;
pinctrl = devm_pinctrl_get_select_default(priv->dev);
-   if (IS_ERR(pinctrl)) {
-   ret = PTR_ERR(priv->vdev);
-   goto free;
-   }
-
+   if (IS_ERR(pinctrl))
+   dev_dbg(priv->dev, "pintrl_get_select_default() failed\n");
ret = v4l2_async_register_subdev(>sd);
if (ret)
goto free;

So that the error is ignored and we still can change the pinctrl values via dts.

What do you think?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/4] staging: fsl-dpaa2/eth: allow the driver to compile multi-arch

2018-03-01 Thread Greg KH
On Mon, Feb 26, 2018 at 10:28:07AM -0600, Ioana Radulescu wrote:
> Drop dependency on ARCH_LAYERSCAPE (which in turn depends on ARM64),
> thus allowing this driver to compile on all architectures supported
> by the fsl-mc bus driver.
> 
> This was compile tested on:
>  - powerpc (corenet_basic_defconfig, ppc64_defconfig)
>  - x86 (i386_defconfig, x86_64_defconfig, needs CONFIG_OF)
>  - arm64 (defconfig)

Seems you need to compile it on more things, based on the kbuild
warnings :(

Please fix up and resend.

thanks,

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


Re: [PATCH] staging/imx: Fix inconsistent IS_ERR and PTR_ERR

2018-03-01 Thread Philipp Zabel
On Thu, 2018-03-01 at 13:02 -0300, Fabio Estevam wrote:
> On Thu, Mar 1, 2018 at 1:09 AM, Gustavo A. R. Silva
>  wrote:
> > Fix inconsistent IS_ERR and PTR_ERR in imx_csi_probe.
> > The proper pointer to be passed as argument is pinctrl
> > instead of priv->vdev.
> > 
> > This issue was detected with the help of Coccinelle.
> > 
> > Fixes: 52e17089d185 ("media: imx: Don't initialize vars that won't be used")
> > Signed-off-by: Gustavo A. R. Silva 
> > ---
> >  drivers/staging/media/imx/imx-media-csi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/media/imx/imx-media-csi.c 
> > b/drivers/staging/media/imx/imx-media-csi.c
> > index 5a195f8..4f290a0 100644
> > --- a/drivers/staging/media/imx/imx-media-csi.c
> > +++ b/drivers/staging/media/imx/imx-media-csi.c
> > @@ -1798,7 +1798,7 @@ static int imx_csi_probe(struct platform_device *pdev)
> > priv->dev->of_node = pdata->of_node;
> > pinctrl = devm_pinctrl_get_select_default(priv->dev);
> > if (IS_ERR(pinctrl)) {
> > -   ret = PTR_ERR(priv->vdev);
> > +   ret = PTR_ERR(pinctrl);
> > goto free;
> 
> This patch is correct, but now I am seeing that
> devm_pinctrl_get_select_default() always fails.
> 
> I added this debug line:
> 
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -1799,6 +1799,7 @@ static int imx_csi_probe(struct platform_device *pdev)
> pinctrl = devm_pinctrl_get_select_default(priv->dev);
> if (IS_ERR(pinctrl)) {
> ret = PTR_ERR(pinctrl);
> +   pr_err(" pinctrl failed\n");
> goto free;
> }
> 
> and this is what I get in imx6q-sabresd:
> 
> [3.453905] imx-media: subdev ipu1_vdic bound
> [3.458601] imx-media: subdev ipu2_vdic bound
> [3.463341] imx-media: subdev ipu1_ic_prp bound
> [3.468924] ipu1_ic_prpenc: Registered ipu1_ic_prpenc capture as 
> /dev/video0
> [3.476237] imx-media: subdev ipu1_ic_prpenc bound
> [3.481621] ipu1_ic_prpvf: Registered ipu1_ic_prpvf capture as /dev/video1
> [3.488805] imx-media: subdev ipu1_ic_prpvf bound
> [3.493659] imx-media: subdev ipu2_ic_prp bound
> [3.498839] ipu2_ic_prpenc: Registered ipu2_ic_prpenc capture as 
> /dev/video2
> [3.505958] imx-media: subdev ipu2_ic_prpenc bound
> [3.511318] ipu2_ic_prpvf: Registered ipu2_ic_prpvf capture as /dev/video3
> [3.518335] imx-media: subdev ipu2_ic_prpvf bound
> [3.524622] ipu1_csi0: Registered ipu1_csi0 capture as /dev/video4
> [3.530902] imx-media: subdev ipu1_csi0 bound
> [3.535453]  pinctrl failed
> [3.539684]  pinctrl failed
> [3.543677]  pinctrl failed
> [3.548278] imx-media: subdev imx6-mipi-csi2 bound
> 
> So imx_csi_probe() does not succeed anymore since
> devm_pinctrl_get_select_default() always fails.
> 
> Not sure I understand the comments that explain the need for pinctrl
> handling inside the driver.

Oh, this only works for csi ports that have pinctrl in their csi port
node, like:

_csi0 {
pinctrl-names = "default";
pinctrl-0 = <_ipu1_csi0>;
};

For all other ports it fails. So we indeed have to silently continue if
there is no pinctrl in the port node.

> Can't we just get rid of it like this?

pinctrl would have to be moved out of the csi port nodes, for example
into their parent ipu nodes, or maybe more correctly, into the video mux
nodes in each device tree.

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


Re: [PATCH] staging/imx: Fix inconsistent IS_ERR and PTR_ERR

2018-03-01 Thread Fabio Estevam
Steve, Phiipp,

On Thu, Mar 1, 2018 at 1:02 PM, Fabio Estevam  wrote:

> So imx_csi_probe() does not succeed anymore since
> devm_pinctrl_get_select_default() always fails.
>
> Not sure I understand the comments that explain the need for pinctrl
> handling inside the driver.
>
> Can't we just get rid of it like this?

Just tested and if devm_pinctrl_get_select_default() is removed, I am
not able to change the ipu csi pinctrl settings anymore.

I had to ignore devm_pinctrl_get_select_default() error value so that
the driver can probe again:

diff --git a/drivers/staging/media/imx/imx-media-csi.c
b/drivers/staging/media/imx/imx-media-csi.c
index 5a195f8..c40f786 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -1797,11 +1797,8 @@ static int imx_csi_probe(struct platform_device *pdev)
 */
priv->dev->of_node = pdata->of_node;
pinctrl = devm_pinctrl_get_select_default(priv->dev);
-   if (IS_ERR(pinctrl)) {
-   ret = PTR_ERR(priv->vdev);
-   goto free;
-   }
-
+   if (IS_ERR(pinctrl))
+   dev_dbg(priv->dev, "pintrl_get_select_default() failed\n");
ret = v4l2_async_register_subdev(>sd);
if (ret)
goto free;

Is there a better solution for this issue?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers:staging: Fix alignment warnings reported by tool

2018-03-01 Thread Greg Kroah-Hartman
On Sat, Feb 24, 2018 at 11:22:40PM +0530, umesh.freela...@gmail.com wrote:
> From: Umesh3034 
> 
> Fix alignment warnings reported by checkpatch.pl
> 
> Signed-off-by: Umesh3034 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You did not use your real name.  Signed-off-by: and From: has to have
  a real name associated with it.  Use whatever you sign legal documents
  with, no anonymous patches are allowed.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/4] staging: most: Replace calls to BUG_ON() with WARN_ONCE() and return.

2018-03-01 Thread Greg KH
On Fri, Feb 23, 2018 at 11:58:33PM -0800, Quytelda Kahja wrote:
> Replace calls to BUG_ON() used to check for NULL pointers with WARN_ONCE()
> followed by a return.

Are you sure this will work?

> 
> Signed-off-by: Quytelda Kahja 
> ---
>  drivers/staging/most/core.c | 13 ++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
> index 18157dd80324..3f65390a6e17 100644
> --- a/drivers/staging/most/core.c
> +++ b/drivers/staging/most/core.c
> @@ -916,7 +916,11 @@ static void arm_mbo(struct mbo *mbo)
>   unsigned long flags;
>   struct most_channel *c;
>  
> - BUG_ON((!mbo) || (!mbo->context));
> + if (WARN_ONCE(!mbo || !mbo->context,
> +   "Bad mbo or missing channel reference.\n")) {
> + return;

How is the code supposed to recover from this major problem?

> + }
> +
>   c = mbo->context;
>  
>   if (c->is_poisoned) {
> @@ -1001,7 +1005,7 @@ static int arm_mbo_chain(struct most_channel *c, int 
> dir,
>  void most_submit_mbo(struct mbo *mbo)
>  {
>   if (WARN_ONCE(!mbo || !mbo->context,
> -   "bad mbo or missing channel reference\n"))
> +   "Bad mbo or missing channel reference.\n"))

You did something different here that you did not describe in your
changelog :(

thanks,

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


Re: [PATCH 1/4] staging: most: Fix coding style problems.

2018-03-01 Thread Greg KH
On Fri, Feb 23, 2018 at 11:58:32PM -0800, Quytelda Kahja wrote:
> Makes two very minor changes indicated by checkpatch:
> 1) Add a newline after components_show() definition.
> 2) Fix a line over the 80 character limit.

Do not do multiple things in the same patch, whenever possible.  Please
break this up into 2 patches.

thanks,

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


Re: [PATCH] staging/imx: Fix inconsistent IS_ERR and PTR_ERR

2018-03-01 Thread Fabio Estevam
On Thu, Mar 1, 2018 at 1:09 AM, Gustavo A. R. Silva
 wrote:
> Fix inconsistent IS_ERR and PTR_ERR in imx_csi_probe.
> The proper pointer to be passed as argument is pinctrl
> instead of priv->vdev.
>
> This issue was detected with the help of Coccinelle.
>
> Fixes: 52e17089d185 ("media: imx: Don't initialize vars that won't be used")
> Signed-off-by: Gustavo A. R. Silva 
> ---
>  drivers/staging/media/imx/imx-media-csi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-csi.c 
> b/drivers/staging/media/imx/imx-media-csi.c
> index 5a195f8..4f290a0 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -1798,7 +1798,7 @@ static int imx_csi_probe(struct platform_device *pdev)
> priv->dev->of_node = pdata->of_node;
> pinctrl = devm_pinctrl_get_select_default(priv->dev);
> if (IS_ERR(pinctrl)) {
> -   ret = PTR_ERR(priv->vdev);
> +   ret = PTR_ERR(pinctrl);
> goto free;

This patch is correct, but now I am seeing that
devm_pinctrl_get_select_default() always fails.

I added this debug line:

--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -1799,6 +1799,7 @@ static int imx_csi_probe(struct platform_device *pdev)
pinctrl = devm_pinctrl_get_select_default(priv->dev);
if (IS_ERR(pinctrl)) {
ret = PTR_ERR(pinctrl);
+   pr_err(" pinctrl failed\n");
goto free;
}

and this is what I get in imx6q-sabresd:

[3.453905] imx-media: subdev ipu1_vdic bound
[3.458601] imx-media: subdev ipu2_vdic bound
[3.463341] imx-media: subdev ipu1_ic_prp bound
[3.468924] ipu1_ic_prpenc: Registered ipu1_ic_prpenc capture as /dev/video0
[3.476237] imx-media: subdev ipu1_ic_prpenc bound
[3.481621] ipu1_ic_prpvf: Registered ipu1_ic_prpvf capture as /dev/video1
[3.488805] imx-media: subdev ipu1_ic_prpvf bound
[3.493659] imx-media: subdev ipu2_ic_prp bound
[3.498839] ipu2_ic_prpenc: Registered ipu2_ic_prpenc capture as /dev/video2
[3.505958] imx-media: subdev ipu2_ic_prpenc bound
[3.511318] ipu2_ic_prpvf: Registered ipu2_ic_prpvf capture as /dev/video3
[3.518335] imx-media: subdev ipu2_ic_prpvf bound
[3.524622] ipu1_csi0: Registered ipu1_csi0 capture as /dev/video4
[3.530902] imx-media: subdev ipu1_csi0 bound
[3.535453]  pinctrl failed
[3.539684]  pinctrl failed
[3.543677]  pinctrl failed
[3.548278] imx-media: subdev imx6-mipi-csi2 bound

So imx_csi_probe() does not succeed anymore since
devm_pinctrl_get_select_default() always fails.

Not sure I understand the comments that explain the need for pinctrl
handling inside the driver.

Can't we just get rid of it like this?

--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -14,7 +14,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1739,7 +1738,6 @@ static const struct v4l2_subdev_internal_ops
csi_internal_ops = {
 static int imx_csi_probe(struct platform_device *pdev)
 {
struct ipu_client_platformdata *pdata;
-   struct pinctrl *pinctrl;
struct csi_priv *priv;
int ret;

@@ -1789,19 +1787,7 @@ static int imx_csi_probe(struct platform_device *pdev)
v4l2_ctrl_handler_init(>ctrl_hdlr, 0);
priv->sd.ctrl_handler = >ctrl_hdlr;

-   /*
-* The IPUv3 driver did not assign an of_node to this
-* device. As a result, pinctrl does not automatically
-* configure our pin groups, so we need to do that manually
-* here, after setting this device's of_node.
-*/
priv->dev->of_node = pdata->of_node;
-   pinctrl = devm_pinctrl_get_select_default(priv->dev);
-   if (IS_ERR(pinctrl)) {
-   ret = PTR_ERR(pinctrl);
-   goto free;
-   }
-
ret = v4l2_async_register_subdev(>sd);
if (ret)
goto free;
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] staging: rts5208: rename SG_END macro

2018-03-01 Thread Andy Shevchenko
On Thu, Mar 1, 2018 at 12:31 PM, Arnd Bergmann  wrote:
> A change to the generic scatterlist code caused a conflict with
> the rtsx card reader driver:
>
> In file included from drivers/staging/rts5208/rtsx.h:180,
>  from drivers/staging/rts5208/rtsx.c:28:
> drivers/staging/rts5208/rtsx_chip.h:343: error: "SG_END" redefined [-Werror]
>
> This changes one instance of the driver to prefix SG_END and
> related constants.
>

Thanks, Arnd. This is right thing to do by my opinion.

Reviewed-by: Andy Shevchenko 

> Fixes: 723fbf563a6a ("lib/scatterlist: Add SG_CHAIN and SG_END macros for LSB 
> encodings")
> Cc: Anshuman Khandual 
> Cc: Jens Axboe 
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/staging/rts5208/rtsx_chip.h  | 12 ++--
>  drivers/staging/rts5208/rtsx_transport.c | 10 +-
>  2 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/rts5208/rtsx_chip.h 
> b/drivers/staging/rts5208/rtsx_chip.h
> index 4f6e3c1c4621..8a8cd5d3cf7e 100644
> --- a/drivers/staging/rts5208/rtsx_chip.h
> +++ b/drivers/staging/rts5208/rtsx_chip.h
> @@ -339,13 +339,13 @@ struct sense_data_t {
>  #define CHK_BIT(data, idx) ((data) & (1 << (idx)))
>
>  /* SG descriptor */
> -#define SG_INT 0x04
> -#define SG_END 0x02
> -#define SG_VALID   0x01
> +#define RTSX_SG_INT0x04
> +#define RTSX_SG_END0x02
> +#define RTSX_SG_VALID  0x01
>
> -#define SG_NO_OP   0x00
> -#define SG_TRANS_DATA  (0x02 << 4)
> -#define SG_LINK_DESC   (0x03 << 4)
> +#define RTSX_SG_NO_OP  0x00
> +#define RTSX_SG_TRANS_DATA (0x02 << 4)
> +#define RTSX_SG_LINK_DESC  (0x03 << 4)
>
>  struct rtsx_chip;
>
> diff --git a/drivers/staging/rts5208/rtsx_transport.c 
> b/drivers/staging/rts5208/rtsx_transport.c
> index 8b57e17ee6d3..716cce2bd7f0 100644
> --- a/drivers/staging/rts5208/rtsx_transport.c
> +++ b/drivers/staging/rts5208/rtsx_transport.c
> @@ -308,7 +308,7 @@ static inline void rtsx_add_sg_tbl(
> do {
> if (len > 0x8) {
> temp_len = 0x8;
> -   temp_opt = option & (~SG_END);
> +   temp_opt = option & (~RTSX_SG_END);
> } else {
> temp_len = len;
> temp_opt = option;
> @@ -407,9 +407,9 @@ static int rtsx_transfer_sglist_adma_partial(struct 
> rtsx_chip *chip, u8 card,
> *index = *index + 1;
> }
> if ((i == (sg_cnt - 1)) || !resid)
> -   option = SG_VALID | SG_END | SG_TRANS_DATA;
> +   option = RTSX_SG_VALID | RTSX_SG_END | 
> RTSX_SG_TRANS_DATA;
> else
> -   option = SG_VALID | SG_TRANS_DATA;
> +   option = RTSX_SG_VALID | RTSX_SG_TRANS_DATA;
>
> rtsx_add_sg_tbl(chip, (u32)addr, (u32)len, option);
>
> @@ -555,9 +555,9 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip 
> *chip, u8 card,
> (unsigned int)addr, len);
>
> if (j == (sg_cnt - 1))
> -   option = SG_VALID | SG_END | SG_TRANS_DATA;
> +   option = RTSX_SG_VALID | RTSX_SG_END | 
> RTSX_SG_TRANS_DATA;
> else
> -   option = SG_VALID | SG_TRANS_DATA;
> +   option = RTSX_SG_VALID | RTSX_SG_TRANS_DATA;
>
> rtsx_add_sg_tbl(chip, (u32)addr, (u32)len, option);
>
> --
> 2.9.0
>



-- 
With Best Regards,
Andy Shevchenko
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/5] staging: ks7010: Factor out repeated code into function 'ks_wlan_cap()'.

2018-03-01 Thread Dan Carpenter
On Thu, Mar 01, 2018 at 05:37:21PM +1100, Tobin C. Harding wrote:
> On Wed, Feb 28, 2018 at 09:19:09PM -0800, Quytelda Kahja wrote:
> > The code that generates a WLAN capability mask is repeated in five
> > functions.  This change refactors that code into a new function, which is
> > called now in each of those functions.
> 
> Perhaps in future something like:
> 
> Code to generate the WLAN capability mask is duplicated five times
> 
> Add helper function to generate WLAN capability mask, refactor code to
> use newly defined function.
> 

I honestly don't see the difference between that and what Quytelda
wrote?  I understood the original changelog just fine.

regards,
dan carpenter

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


[PATCH 2/2] staging: rts5208: rename SG_END macro

2018-03-01 Thread Arnd Bergmann
A change to the generic scatterlist code caused a conflict with
the rtsx card reader driver:

In file included from drivers/staging/rts5208/rtsx.h:180,
 from drivers/staging/rts5208/rtsx.c:28:
drivers/staging/rts5208/rtsx_chip.h:343: error: "SG_END" redefined [-Werror]

This changes one instance of the driver to prefix SG_END and
related constants.

Fixes: 723fbf563a6a ("lib/scatterlist: Add SG_CHAIN and SG_END macros for LSB 
encodings")
Cc: Anshuman Khandual 
Cc: Jens Axboe 
Signed-off-by: Arnd Bergmann 
---
 drivers/staging/rts5208/rtsx_chip.h  | 12 ++--
 drivers/staging/rts5208/rtsx_transport.c | 10 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_chip.h 
b/drivers/staging/rts5208/rtsx_chip.h
index 4f6e3c1c4621..8a8cd5d3cf7e 100644
--- a/drivers/staging/rts5208/rtsx_chip.h
+++ b/drivers/staging/rts5208/rtsx_chip.h
@@ -339,13 +339,13 @@ struct sense_data_t {
 #define CHK_BIT(data, idx) ((data) & (1 << (idx)))
 
 /* SG descriptor */
-#define SG_INT 0x04
-#define SG_END 0x02
-#define SG_VALID   0x01
+#define RTSX_SG_INT0x04
+#define RTSX_SG_END0x02
+#define RTSX_SG_VALID  0x01
 
-#define SG_NO_OP   0x00
-#define SG_TRANS_DATA  (0x02 << 4)
-#define SG_LINK_DESC   (0x03 << 4)
+#define RTSX_SG_NO_OP  0x00
+#define RTSX_SG_TRANS_DATA (0x02 << 4)
+#define RTSX_SG_LINK_DESC  (0x03 << 4)
 
 struct rtsx_chip;
 
diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index 8b57e17ee6d3..716cce2bd7f0 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -308,7 +308,7 @@ static inline void rtsx_add_sg_tbl(
do {
if (len > 0x8) {
temp_len = 0x8;
-   temp_opt = option & (~SG_END);
+   temp_opt = option & (~RTSX_SG_END);
} else {
temp_len = len;
temp_opt = option;
@@ -407,9 +407,9 @@ static int rtsx_transfer_sglist_adma_partial(struct 
rtsx_chip *chip, u8 card,
*index = *index + 1;
}
if ((i == (sg_cnt - 1)) || !resid)
-   option = SG_VALID | SG_END | SG_TRANS_DATA;
+   option = RTSX_SG_VALID | RTSX_SG_END | 
RTSX_SG_TRANS_DATA;
else
-   option = SG_VALID | SG_TRANS_DATA;
+   option = RTSX_SG_VALID | RTSX_SG_TRANS_DATA;
 
rtsx_add_sg_tbl(chip, (u32)addr, (u32)len, option);
 
@@ -555,9 +555,9 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip 
*chip, u8 card,
(unsigned int)addr, len);
 
if (j == (sg_cnt - 1))
-   option = SG_VALID | SG_END | SG_TRANS_DATA;
+   option = RTSX_SG_VALID | RTSX_SG_END | 
RTSX_SG_TRANS_DATA;
else
-   option = SG_VALID | SG_TRANS_DATA;
+   option = RTSX_SG_VALID | RTSX_SG_TRANS_DATA;
 
rtsx_add_sg_tbl(chip, (u32)addr, (u32)len, option);
 
-- 
2.9.0

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


Re: [PATCH] staging/imx: Fix inconsistent IS_ERR and PTR_ERR

2018-03-01 Thread Philipp Zabel
On Wed, 2018-02-28 at 22:09 -0600, Gustavo A. R. Silva wrote:
> Fix inconsistent IS_ERR and PTR_ERR in imx_csi_probe.
> The proper pointer to be passed as argument is pinctrl
> instead of priv->vdev.
> 
> This issue was detected with the help of Coccinelle.
> 
> Fixes: 52e17089d185 ("media: imx: Don't initialize vars that won't be used")
> Signed-off-by: Gustavo A. R. Silva 
> ---
>  drivers/staging/media/imx/imx-media-csi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/imx/imx-media-csi.c 
> b/drivers/staging/media/imx/imx-media-csi.c
> index 5a195f8..4f290a0 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -1798,7 +1798,7 @@ static int imx_csi_probe(struct platform_device *pdev)
>   priv->dev->of_node = pdata->of_node;
>   pinctrl = devm_pinctrl_get_select_default(priv->dev);
>   if (IS_ERR(pinctrl)) {
> - ret = PTR_ERR(priv->vdev);
> + ret = PTR_ERR(pinctrl);
>   goto free;
>   }

Thanks,
Acked-by: Philipp Zabel 

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