[PATCH] net: sch: api: fix tcf_block_get

2017-12-22 Thread Sudip Mukherjee
The build of mips bcm47xx_defconfig is failing with the error:
net/sched/sch_fq_codel.c: In function 'fq_codel_init':
net/sched/sch_fq_codel.c:487:8: error:
too many arguments to function 'tcf_block_get'

While adding the extack support, the commit missed adding it in the
headers when CONFIG_NET_CLS is not defined.

Fixes: 8d1a77f974ca ("net: sch: api: add extack support in tcf_block_get")
Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---

The build log of next-20171222 is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/320089922

 include/net/pkt_cls.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 31574c9..5cd3cf5 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -79,7 +79,8 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto 
*tp,
 #else
 static inline
 int tcf_block_get(struct tcf_block **p_block,
- struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q)
+ struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q,
+ struct netlink_ext_ack *extack)
 {
return 0;
 }
-- 
2.1.4



[PATCH] hamradio: baycom_par: use new parport device model

2017-10-15 Thread Sudip Mukherjee
Modify baycom driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---

Not tested on real hardware, only tested on kvm with 32 bit guest and
verified that the device is binding to the driver properly in par96_open
but then unbinding as the device was not found.

 drivers/net/hamradio/baycom_par.c | 48 +++
 1 file changed, 44 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hamradio/baycom_par.c 
b/drivers/net/hamradio/baycom_par.c
index e178383..1f7ceaf 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -311,7 +311,9 @@ static void par96_wakeup(void *handle)
 static int par96_open(struct net_device *dev)
 {
struct baycom_state *bc = netdev_priv(dev);
+   struct pardev_cb par_cb;
struct parport *pp;
+   int i;
 
if (!dev || !bc)
return -ENXIO;
@@ -332,8 +334,21 @@ static int par96_open(struct net_device *dev)
}
memset(>modem, 0, sizeof(bc->modem));
bc->hdrv.par.bitrate = 9600;
-   bc->pdev = parport_register_device(pp, dev->name, NULL, par96_wakeup, 
-par96_interrupt, PARPORT_DEV_EXCL, dev);
+   memset(_cb, 0, sizeof(par_cb));
+   par_cb.wakeup = par96_wakeup;
+   par_cb.irq_func = par96_interrupt;
+   par_cb.private = (void *)dev;
+   par_cb.flags = PARPORT_DEV_EXCL;
+   for (i = 0; i < NR_PORTS; i++)
+   if (baycom_device[i] == dev)
+   break;
+
+   if (i == NR_PORTS) {
+   pr_err("%s: no device found\n", bc_drvname);
+   parport_put_port(pp);
+   return -ENODEV;
+   }
+   bc->pdev = parport_register_dev_model(pp, dev->name, _cb, i);
parport_put_port(pp);
if (!bc->pdev) {
printk(KERN_ERR "baycom_par: cannot register parport at 
0x%lx\n", dev->base_addr);
@@ -490,12 +505,34 @@ static int baycom_ioctl(struct net_device *dev, struct 
ifreq *ifr,
 
 /* - */
 
+static int baycom_par_probe(struct pardevice *par_dev)
+{
+   struct device_driver *drv = par_dev->dev.driver;
+   int len = strlen(drv->name);
+
+   if (strncmp(par_dev->name, drv->name, len))
+   return -ENODEV;
+
+   return 0;
+}
+
+static struct parport_driver baycom_par_driver = {
+   .name = "bcp",
+   .probe = baycom_par_probe,
+   .devmodel = true,
+};
+
 static int __init init_baycompar(void)
 {
-   int i, found = 0;
+   int i, found = 0, ret;
char set_hw = 1;
 
printk(bc_drvinfo);
+
+   ret = parport_register_driver(_par_driver);
+   if (ret)
+   return ret;
+
/*
 * register net devices
 */
@@ -524,8 +561,10 @@ static int __init init_baycompar(void)
baycom_device[i] = dev;
}
 
-   if (!found)
+   if (!found) {
+   parport_unregister_driver(_par_driver);
return -ENXIO;
+   }
return 0;
 }
 
@@ -539,6 +578,7 @@ static void __exit cleanup_baycompar(void)
if (dev)
hdlcdrv_unregister(dev);
}
+   parport_unregister_driver(_par_driver);
 }
 
 module_init(init_baycompar);
-- 
1.9.1



[PATCH] hamradio: baycom: use new parport device model

2017-09-17 Thread Sudip Mukherjee
Modify baycom driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---

Not tested on real hardware, only tested on qemu and verified that the
device is binding to the driver properly in epp_open but then unbinding
as the device was not found.

 drivers/net/hamradio/baycom_epp.c | 50 +++
 1 file changed, 46 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hamradio/baycom_epp.c 
b/drivers/net/hamradio/baycom_epp.c
index 1503f10..1e62d00 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -840,6 +840,7 @@ static int epp_open(struct net_device *dev)
unsigned char tmp[128];
unsigned char stat;
unsigned long tstart;
+   struct pardev_cb par_cb;

 if (!pp) {
 printk(KERN_ERR "%s: parport at 0x%lx unknown\n", bc_drvname, 
dev->base_addr);
@@ -859,8 +860,21 @@ static int epp_open(struct net_device *dev)
 return -EIO;
}
memset(>modem, 0, sizeof(bc->modem));
-bc->pdev = parport_register_device(pp, dev->name, NULL, epp_wakeup, 
-  NULL, PARPORT_DEV_EXCL, dev);
+   memset(_cb, 0, sizeof(par_cb));
+   par_cb.wakeup = epp_wakeup;
+   par_cb.private = (void *)dev;
+   par_cb.flags = PARPORT_DEV_EXCL;
+   for (i = 0; i < NR_PORTS; i++)
+   if (baycom_device[i] == dev)
+   break;
+
+   if (i == NR_PORTS) {
+   pr_err("%s: no device found\n", bc_drvname);
+   parport_put_port(pp);
+   return -ENODEV;
+   }
+
+   bc->pdev = parport_register_dev_model(pp, dev->name, _cb, i);
parport_put_port(pp);
 if (!bc->pdev) {
 printk(KERN_ERR "%s: cannot register parport at 0x%lx\n", 
bc_drvname, pp->base);
@@ -1185,6 +1199,23 @@ MODULE_LICENSE("GPL");
 
 /* - */
 
+static int baycom_epp_par_probe(struct pardevice *par_dev)
+{
+   struct device_driver *drv = par_dev->dev.driver;
+   int len = strlen(drv->name);
+
+   if (strncmp(par_dev->name, drv->name, len))
+   return -ENODEV;
+
+   return 0;
+}
+
+static struct parport_driver baycom_epp_par_driver = {
+   .name = "bce",
+   .probe = baycom_epp_par_probe,
+   .devmodel = true,
+};
+
 static void __init baycom_epp_dev_setup(struct net_device *dev)
 {
struct baycom_state *bc = netdev_priv(dev);
@@ -1204,10 +1235,15 @@ static void __init baycom_epp_dev_setup(struct 
net_device *dev)
 
 static int __init init_baycomepp(void)
 {
-   int i, found = 0;
+   int i, found = 0, ret;
char set_hw = 1;
 
printk(bc_drvinfo);
+
+   ret = parport_register_driver(_epp_par_driver);
+   if (ret)
+   return ret;
+
/*
 * register net devices
 */
@@ -1241,7 +1277,12 @@ static int __init init_baycomepp(void)
found++;
}
 
-   return found ? 0 : -ENXIO;
+   if (found == 0) {
+   parport_unregister_driver(_epp_par_driver);
+   return -ENXIO;
+   }
+
+   return 0;
 }
 
 static void __exit cleanup_baycomepp(void)
@@ -1260,6 +1301,7 @@ static void __exit cleanup_baycomepp(void)
printk(paranoia_str, "cleanup_module");
}
}
+   parport_unregister_driver(_epp_par_driver);
 }
 
 module_init(init_baycomepp);
-- 
2.7.4



[PATCH] net: sched: fix mips build failure

2017-06-04 Thread Sudip Mukherjee
The build of mips ar7_defconfig was failing with the error:
../net/sched/act_api.c: In function 'tcf_action_goto_chain_init':
../net/sched/act_api.c:37:18: error:
implicit declaration of function 'tcf_chain_get'
[-Werror=implicit-function-declaration]

../net/sched/act_api.c: In function 'tcf_action_goto_chain_fini':
../net/sched/act_api.c:45:2: error:
implicit declaration of function 'tcf_chain_put'
[-Werror=implicit-function-declaration]

Add two inline helpers for the case where CONFIG_NET_CLS is not enabled.

Signed-off-by: Sudip Mukherjee <sudipm.mukher...@gmail.com>
---

The build log of the latest linux-next is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/238623031/

 include/net/pkt_cls.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 537d0a0..c34ade5 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -29,6 +29,17 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto 
*tp,
 
 #else
 static inline
+struct tcf_chain *tcf_chain_get(struct tcf_block *block,
+   u32 chain_index, bool create)
+{
+   return NULL;
+}
+
+static inline void tcf_chain_put(struct tcf_chain *chain)
+{
+}
+
+static inline
 int tcf_block_get(struct tcf_block **p_block,
  struct tcf_proto __rcu **p_filter_chain)
 {
-- 
2.7.4



[PATCH] net: mv643xx_eth: fix build failure

2016-12-16 Thread Sudip Mukherjee
The build of sparc allmodconfig fails with the error:
"of_irq_to_resource" [drivers/net/ethernet/marvell/mv643xx_eth.ko]
undefined!

of_irq_to_resource() is defined when CONFIG_OF_IRQ is defined. And also
CONFIG_OF_IRQ can only be defined if CONFIG_IRQ is defined. So we can
safely use #if defined(CONFIG_OF_IRQ) in the code.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

build log of next-20161216 is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/184652820

 drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c 
b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 5f62c3d..1fa7c03 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2713,7 +2713,7 @@ static void infer_hw_params(struct 
mv643xx_eth_shared_private *msp)
 MODULE_DEVICE_TABLE(of, mv643xx_eth_shared_ids);
 #endif
 
-#if defined(CONFIG_OF) && !defined(CONFIG_MV64X60)
+#if defined(CONFIG_OF_IRQ) && !defined(CONFIG_MV64X60)
 #define mv643xx_eth_property(_np, _name, _v)   \
do {\
u32 tmp;\
-- 
1.9.1



[PATCH] net: bcm63xx_enet: fix build failure

2016-11-16 Thread Sudip Mukherjee
The build of mips bcm63xx_defconfig was failing with the error:
drivers/net/ethernet/broadcom/bcm63xx_enet.c:1440:2:
error: expected expression before 'return'

The return statement should be termibated with ';' and not ','.

Fixes: 42469bf5d9bb ("net: bcm63xx_enet: Utilize phy_ethtool_nway_reset")
Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

build log is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/176269457

 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c 
b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index a43ab90..3b14d51 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1435,7 +1435,7 @@ static int bcm_enet_nway_reset(struct net_device *dev)
 
priv = netdev_priv(dev);
if (priv->has_phy)
-   return phy_ethtool_nway_reset(dev),
+   return phy_ethtool_nway_reset(dev);
 
return -EOPNOTSUPP;
 }
-- 
1.9.1



[PATCH v2] net: smsc: remove build warning of duplicate definition

2016-09-04 Thread Sudip Mukherjee
The build of m32r was giving warning:

In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:448:0: warning: "SMC_inb" redefined
 #define SMC_inb(ioaddr, reg)  ({ BUG(); 0; })
 
drivers/net/ethernet/smsc/smc91x.h:106:0:
note: this is the location of the previous definition
 #define SMC_inb(a, r)  inb(((u32)a) + (r))
 
drivers/net/ethernet/smsc/smc91x.h:449:0: warning: "SMC_outb" redefined
 #define SMC_outb(x, ioaddr, reg) BUG()
 
drivers/net/ethernet/smsc/smc91x.h:108:0:
note: this is the location of the previous definition
 #define SMC_outb(v, a, r) outb(v, ((u32)a) + (r))

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

v2: +#ifdef of v1 is removed.

 drivers/net/ethernet/smsc/smc91x.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/smsc/smc91x.h 
b/drivers/net/ethernet/smsc/smc91x.h
index 1a55c79..06d7dca 100644
--- a/drivers/net/ethernet/smsc/smc91x.h
+++ b/drivers/net/ethernet/smsc/smc91x.h
@@ -445,7 +445,9 @@ smc_pxa_dma_insw(void __iomem *ioaddr, struct smc_local 
*lp, int reg, int dma,
 #endif
 
 #if ! SMC_CAN_USE_8BIT
+#undef SMC_inb
 #define SMC_inb(ioaddr, reg)   ({ BUG(); 0; })
+#undef SMC_outb
 #define SMC_outb(x, ioaddr, reg)   BUG()
 #define SMC_insb(a, r, p, l)   BUG()
 #define SMC_outsb(a, r, p, l)  BUG()
-- 
1.9.1



[PATCH] net: smsc: remove build warning of duplicate definition

2016-08-31 Thread Sudip Mukherjee
The build of m32r was giving warning:

In file included from drivers/net/ethernet/smsc/smc91x.c:92:0:
drivers/net/ethernet/smsc/smc91x.h:448:0: warning: "SMC_inb" redefined
 #define SMC_inb(ioaddr, reg)  ({ BUG(); 0; })
 
drivers/net/ethernet/smsc/smc91x.h:106:0:
note: this is the location of the previous definition
 #define SMC_inb(a, r)  inb(((u32)a) + (r))
 
drivers/net/ethernet/smsc/smc91x.h:449:0: warning: "SMC_outb" redefined
 #define SMC_outb(x, ioaddr, reg) BUG()
 
drivers/net/ethernet/smsc/smc91x.h:108:0:
note: this is the location of the previous definition
 #define SMC_outb(v, a, r) outb(v, ((u32)a) + (r))

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

m32r allmodconfig build of next-20160825 is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/154943795

 drivers/net/ethernet/smsc/smc91x.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/smsc/smc91x.h 
b/drivers/net/ethernet/smsc/smc91x.h
index 1a55c79..0b0bb74 100644
--- a/drivers/net/ethernet/smsc/smc91x.h
+++ b/drivers/net/ethernet/smsc/smc91x.h
@@ -445,7 +445,14 @@ smc_pxa_dma_insw(void __iomem *ioaddr, struct smc_local 
*lp, int reg, int dma,
 #endif
 
 #if ! SMC_CAN_USE_8BIT
+#ifdef SMC_inb
+#undef SMC_inb
+#endif
 #define SMC_inb(ioaddr, reg)   ({ BUG(); 0; })
+
+#ifdef SMC_outb
+#undef SMC_outb
+#endif
 #define SMC_outb(x, ioaddr, reg)   BUG()
 #define SMC_insb(a, r, p, l)   BUG()
 #define SMC_outsb(a, r, p, l)  BUG()
-- 
1.9.1



[PATCH] net: lantiq_etop: remove unused variable

2016-06-16 Thread Sudip Mukherjee
The variable i was declared but was never used and we were getting a
build warning for that.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/net/ethernet/lantiq_etop.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/lantiq_etop.c 
b/drivers/net/ethernet/lantiq_etop.c
index dc82b1b..0d2f8e9 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -411,7 +411,6 @@ static int
 ltq_etop_mdio_init(struct net_device *dev)
 {
struct ltq_etop_priv *priv = netdev_priv(dev);
-   int i;
int err;
 
priv->mii_bus = mdiobus_alloc();
-- 
1.9.1



Re: ath9k gpio request

2016-06-05 Thread Sudip Mukherjee

On Saturday 04 June 2016 08:07 PM, Kalle Valo wrote:

(Fixing top posting)

"Pan, Miaoqing" <miaoq...@qti.qualcomm.com> writes:


--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -1122,8 +1122,8 @@ enum {
   #define AR9300_NUM_GPIO  16
   #define AR9330_NUM_GPIO 16
   #define AR9340_NUM_GPIO 23
-#define AR9462_NUM_GPIO 10
-#define AR9485_NUM_GPIO 12
+#define AR9462_NUM_GPIO 14
+#define AR9485_NUM_GPIO 11
   #define AR9531_NUM_GPIO 18
   #define AR9550_NUM_GPIO 24
   #define AR9561_NUM_GPIO 23
@@ -1139,8 +1139,8 @@ enum {
   #define AR9300_GPIO_MASK0xF4FF
   #define AR9330_GPIO_MASK0xF4FF
   #define AR9340_GPIO_MASK0x000F
-#define AR9462_GPIO_MASK0x03FF
-#define AR9485_GPIO_MASK0x0FFF
+#define AR9462_GPIO_MASK0x3FFF
+#define AR9485_GPIO_MASK0x07FF
   #define AR9531_GPIO_MASK0x000F
   #define AR9550_GPIO_MASK0x000F
   #define AR9561_GPIO_MASK0x000F


solves the problem.

Tested-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>


Done, https://patchwork.kernel.org/patch/9151847/


But the patch 9151847 is different from what Sudip tested above? Why?

And if you modify something _after_ the reporter has tested the patch
clearly document what you changed and why. I do not want find hidden
changes like this, even more so when the patch is going to a 4.7-rc
release.

Sudip, could you also test patch 9151847, please? You can download the
patch from the patchwork link above.


This is also ok. Please add my
Tested-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>

and maybe a Reported-by tag is also appropriate in this case.


Regards
Sudip


Re: ath9k gpio request

2016-06-02 Thread Sudip Mukherjee

On Thursday 02 June 2016 01:32 PM, Pan, Miaoqing wrote:

Seems there are something wrong in the datasheet,  try

--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -1122,8 +1122,8 @@ enum {
  #define AR9300_NUM_GPIO  16
  #define AR9330_NUM_GPIO 16
  #define AR9340_NUM_GPIO 23
-#define AR9462_NUM_GPIO 10
-#define AR9485_NUM_GPIO 12
+#define AR9462_NUM_GPIO 14
+#define AR9485_NUM_GPIO 11
  #define AR9531_NUM_GPIO 18
  #define AR9550_NUM_GPIO 24
  #define AR9561_NUM_GPIO 23
@@ -1139,8 +1139,8 @@ enum {
  #define AR9300_GPIO_MASK0xF4FF
  #define AR9330_GPIO_MASK0xF4FF
  #define AR9340_GPIO_MASK0x000F
-#define AR9462_GPIO_MASK0x03FF
-#define AR9485_GPIO_MASK0x0FFF
+#define AR9462_GPIO_MASK0x3FFF
+#define AR9485_GPIO_MASK0x07FF
  #define AR9531_GPIO_MASK0x000F
  #define AR9550_GPIO_MASK0x000F
  #define AR9561_GPIO_MASK0x000F


solves the problem.

Tested-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>

Regards
Sudip


Re: ath9k gpio request

2016-06-01 Thread Sudip Mukherjee

On Wednesday 01 June 2016 12:24 PM, Pan, Miaoqing wrote:

which chip ?  And what's the GPIO number ?


lspci -v reports:
09:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network 
Adapter (rev 01)

Subsystem: Foxconn International, Inc. Device e052
Flags: bus master, fast devsel, latency 0, IRQ 19
Memory at c050 (64-bit, non-prefetchable) [size=512K]
Expansion ROM at c058 [disabled] [size=64K]
Capabilities: [40] Power Management version 2
Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
Kernel driver in use: ath9k

Any easy way to find out the gpio number or i can modify the module to 
find that out.


Regards
Sudip


Re: linux-next: Tree for May 30

2016-05-30 Thread Sudip Mukherjee

On Monday 30 May 2016 08:52 AM, Stephen Rothwell wrote:

Hi all,

Changes since 20160527:


Hi All,
I have just built and booted with next-20160530 and my dmesg is full of 
warnings from ath9k. Last kernel tested was v4.6 and there was no 
problem with that.


The traces are like:
Call Trace:
 [] dump_stack+0x63/0x87
 [] __warn+0xd1/0xf0
 [] warn_slowpath_null+0x1d/0x20
 [] ath9k_hw_gpio_request+0x6f/0x320 [ath9k_hw]
 [] ath9k_hw_reset+0xfe4/0x12e0 [ath9k_hw]
 [] ath_reset_internal+0x104/0x1f0 [ath9k]
 [] ath_reset+0x3d/0x60 [ath9k]
 [] ath_chanctx_set_channel+0x1b6/0x300 [ath9k]
 [] ath9k_config+0xc6/0x1f0 [ath9k]
 [] ? mutex_lock+0x12/0x2f
 [] ieee80211_hw_config+0x63/0x350 [mac80211]
 [] ieee80211_scan_work+0x161/0x480 [mac80211]
 [] process_one_work+0x153/0x3f0
 [] worker_thread+0x12b/0x4b0
 [] ? rescuer_thread+0x340/0x340
 [] kthread+0xc9/0xe0
 [] ret_from_fork+0x1f/0x40
 [] ? kthread_park+0x60/0x60
---[ end trace 27eb5094a52869ea ]---

Call Trace:
 [] dump_stack+0x63/0x87
 [] __warn+0xd1/0xf0
 [] warn_slowpath_null+0x1d/0x20
 [] ath9k_hw_gpio_get+0x1a9/0x1b0 [ath9k_hw]
 [] ath9k_rfkill_poll_state+0x34/0x60 [ath9k]
 [] ieee80211_rfkill_poll+0x33/0x40 [mac80211]
 [] cfg80211_rfkill_poll+0x2a/0xc0 [cfg80211]
 [] rfkill_poll+0x24/0x50
 [] process_one_work+0x153/0x3f0
 [] worker_thread+0x12b/0x4b0
 [] ? rescuer_thread+0x340/0x340
 [] kthread+0xc9/0xe0
 [] ret_from_fork+0x1f/0x40
 [] ? kthread_park+0x60/0x60
---[ end trace 27eb5094a5286a3d ]---


If it is a known problem then great.. else i can debug and see what the 
problem is. There are only few patches added for GPIO, so should not be 
a problem to find out what is causing the error.


Regards
Sudip



Re: [PATCH v2] mwifiex: fix possible NULL dereference

2016-04-12 Thread Sudip Mukherjee

On Tuesday 12 April 2016 05:20 PM, Arend van Spriel wrote:



On 12-04-16 13:46, Sudip Mukherjee wrote:

From: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>

We have a check for card just after dereferencing it. So if it is NULL
we have already dereferenced it before its check. Lets dereference it
after checking card for NULL.


And you are changing the scope of the pdev variable.


yes, and since all usage of pdev is inside the "if" block so it should 
not matter.


regards
sudip



Regards,
Arend


Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
  drivers/net/wireless/marvell/mwifiex/pcie.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c 
b/drivers/net/wireless/marvell/mwifiex/pcie.c
index edf8b07..d4db9db 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2884,10 +2884,11 @@ static void mwifiex_unregister_dev(struct 
mwifiex_adapter *adapter)
  {
struct pcie_service_card *card = adapter->card;
const struct mwifiex_pcie_card_reg *reg;
-   struct pci_dev *pdev = card->dev;
int i;

if (card) {
+   struct pci_dev *pdev = card->dev;
+
if (card->msix_enable) {
for (i = 0; i < MWIFIEX_NUM_MSIX_VECTORS; i++)
synchronize_irq(card->msix_entries[i].vector);





[PATCH v2] mwifiex: fix possible NULL dereference

2016-04-12 Thread Sudip Mukherjee
From: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>

We have a check for card just after dereferencing it. So if it is NULL
we have already dereferenced it before its check. Lets dereference it
after checking card for NULL.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c 
b/drivers/net/wireless/marvell/mwifiex/pcie.c
index edf8b07..d4db9db 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2884,10 +2884,11 @@ static void mwifiex_unregister_dev(struct 
mwifiex_adapter *adapter)
 {
struct pcie_service_card *card = adapter->card;
const struct mwifiex_pcie_card_reg *reg;
-   struct pci_dev *pdev = card->dev;
int i;
 
if (card) {
+   struct pci_dev *pdev = card->dev;
+
if (card->msix_enable) {
for (i = 0; i < MWIFIEX_NUM_MSIX_VECTORS; i++)
synchronize_irq(card->msix_entries[i].vector);
-- 
1.9.1



[PATCH] mwifiex: fix possible NULL dereference

2016-04-11 Thread Sudip Mukherjee
From: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>

We have a check for card just after dereferencing it. So if it is NULL
we have already dereferenced it before its check. Lets dereference it
after checking card for NULL.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c 
b/drivers/net/wireless/marvell/mwifiex/pcie.c
index edf8b07..84562d0 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2884,10 +2884,11 @@ static void mwifiex_unregister_dev(struct 
mwifiex_adapter *adapter)
 {
struct pcie_service_card *card = adapter->card;
const struct mwifiex_pcie_card_reg *reg;
-   struct pci_dev *pdev = card->dev;
+   struct pci_dev *pdev;
int i;
 
if (card) {
+   pdev = card->dev;
if (card->msix_enable) {
for (i = 0; i < MWIFIEX_NUM_MSIX_VECTORS; i++)
synchronize_irq(card->msix_entries[i].vector);
-- 
1.9.1



[PATCH] ieee802154/adf7242: fix memory leak of firmware

2016-04-07 Thread Sudip Mukherjee
If the firmware upload or the firmware verification fails then we
printed the error message and exited but we missed releasing the
firmware.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/net/ieee802154/adf7242.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
index 89154c0..91d4531 100644
--- a/drivers/net/ieee802154/adf7242.c
+++ b/drivers/net/ieee802154/adf7242.c
@@ -1030,6 +1030,7 @@ static int adf7242_hw_init(struct adf7242_local *lp)
if (ret) {
dev_err(>spi->dev,
"upload firmware failed with %d\n", ret);
+   release_firmware(fw);
return ret;
}
 
@@ -1037,6 +1038,7 @@ static int adf7242_hw_init(struct adf7242_local *lp)
if (ret) {
dev_err(>spi->dev,
"verify firmware failed with %d\n", ret);
+   release_firmware(fw);
return ret;
}
 
-- 
1.9.1



[PATCH] b43: Fix memory leaks in b43_bus_dev_ssb_init and b43_bus_dev_bcma_init

2016-03-11 Thread Sudip Mukherjee
From: Jia-Ju Bai <baijiaju1...@163.com>

The memory allocated by kzalloc in b43_bus_dev_ssb_init and
b43_bus_dev_bcma_init is not freed.
This patch fixes the bug by adding kfree in b43_ssb_remove,
b43_bcma_remove and error handling code of b43_bcma_probe.

Thanks Michael for his suggestion.

Signed-off-by: Jia-Ju Bai <baijiaju1...@163.com>
Acked-by: Michael Büsch <m...@bues.ch>
Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 drivers/net/wireless/broadcom/b43/main.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43/main.c 
b/drivers/net/wireless/broadcom/b43/main.c
index 72380af..b0603e7 100644
--- a/drivers/net/wireless/broadcom/b43/main.c
+++ b/drivers/net/wireless/broadcom/b43/main.c
@@ -5680,11 +5680,12 @@ static int b43_bcma_probe(struct bcma_device *core)
INIT_WORK(>firmware_load, b43_request_firmware);
schedule_work(>firmware_load);
 
-bcma_out:
return err;
 
 bcma_err_wireless_exit:
ieee80211_free_hw(wl->hw);
+bcma_out:
+   kfree(dev);
return err;
 }
 
@@ -5712,8 +5713,8 @@ static void b43_bcma_remove(struct bcma_device *core)
b43_rng_exit(wl);
 
b43_leds_unregister(wl);
-
ieee80211_free_hw(wl->hw);
+   kfree(wldev->dev);
 }
 
 static struct bcma_driver b43_bcma_driver = {
@@ -5796,6 +5797,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
 
b43_leds_unregister(wl);
b43_wireless_exit(dev, wl);
+   kfree(dev);
 }
 
 static struct ssb_driver b43_ssb_driver = {
-- 
1.9.1



Re: [v2, resend] b43: Fix memory leaks in b43_bus_dev_ssb_init and b43_bus_dev_bcma_init

2016-03-11 Thread Sudip Mukherjee
On Sat, Jan 16, 2016 at 09:08:10PM +0800, Jia-Ju Bai wrote:
> The memory allocated by kzalloc in b43_bus_dev_ssb_init and
> b43_bus_dev_bcma_init is not freed.
> This patch fixes the bug by adding kfree in b43_ssb_remove,
> b43_bcma_remove and error handling code of b43_bcma_probe.
> 
> Thanks Michael for his suggestion.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1...@163.com>

The patch did not apply cleanly. I had to edit the patch to point to
drivers/net/wireless/broadcom/b43/main.c

For CONFIG_B43_SSB part-
Tested-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>

regards
sudip


Re: [PATCH] b43: fix memory leak

2016-03-10 Thread Sudip Mukherjee

On Thursday 10 March 2016 11:13 PM, Michael Büsch wrote:

On Fri, 19 Feb 2016 20:37:18 +0530
Sudip Mukherjee <sudipm.mukher...@gmail.com> wrote:


https://patchwork.kernel.org/patch/8049041/


I have an old laptop running on 800Mhz CPU. It has "Broadcom BCM4311
[14e4:4311] (rev 01)".
I will try to test it on this weekend.


Any news on this one?


No. Sorry. I was trying to install ubuntu 14.04 in it, but for some 
reason the usb stick is not moving past the boot screen. Give me two 
more days and I will let you all know by this Saturday.


regards
sudip


[PATCH] netfilter: xt_osf: remove unused variable

2016-02-23 Thread Sudip Mukherjee
While building with W=1 we got the warning:
net/netfilter/xt_osf.c:265:9: warning: variable 'loop_cont' set but not used

The local variable loop_cont was only initialized and then assigned a
value but was never used or checked after that.
While removing the variable, the case of OSFOPT_TS was not removed so
that it will serve as a reminder to us that we can do something in that
particular case.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---
 net/netfilter/xt_osf.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c
index 4e3c3af..2455b69 100644
--- a/net/netfilter/xt_osf.c
+++ b/net/netfilter/xt_osf.c
@@ -262,7 +262,6 @@ xt_osf_match_packet(const struct sk_buff *skb, struct 
xt_action_param *p)
if (f->opt[optnum].kind == (*optp)) {
__u32 len = f->opt[optnum].length;
const __u8 *optend = optp + len;
-   int loop_cont = 0;
 
fmatch = FMATCH_OK;
 
@@ -275,7 +274,6 @@ xt_osf_match_packet(const struct sk_buff *skb, struct 
xt_action_param *p)
mss = ntohs((__force __be16)mss);
break;
case OSFOPT_TS:
-   loop_cont = 1;
break;
}
 
-- 
1.9.1



[PATCH] netcp: use pointer to fix build fail

2016-02-22 Thread Sudip Mukherjee
While building keystone_defconfig of arm we are getting build failure
with the error:

drivers/net/ethernet/ti/netcp_core.c:1846:31: error: invalid type argument of 
'->' (have 'struct tc_to_netdev')
  if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
   ^
drivers/net/ethernet/ti/netcp_core.c:1851:35: error: invalid type argument of 
'->' (have 'struct tc_to_netdev')
  (dev->real_num_tx_queues < tc->tc))
   ^
drivers/net/ethernet/ti/netcp_core.c:1855:8: error: invalid type argument of 
'->' (have 'struct tc_to_netdev')
  if (tc->tc) {
^
drivers/net/ethernet/ti/netcp_core.c:1856:28: error: invalid type argument of 
'->' (have 'struct tc_to_netdev')
   netdev_set_num_tc(dev, tc->tc);
^
drivers/net/ethernet/ti/netcp_core.c:1857:21: error: invalid type argument of 
'->' (have 'struct tc_to_netdev')
   for (i = 0; i < tc->tc; i++)
 ^
drivers/net/ethernet/ti/netcp_core.c: At top level:
drivers/net/ethernet/ti/netcp_core.c:1879:2: warning: initialization from 
incompatible pointer type
  .ndo_setup_tc  = netcp_setup_tc,
  ^

The callback of ndo_setup_tc should be:
int (*ndo_setup_tc)(struct net_device *dev, u32 handle, __be16 protocol,
struct tc_to_netdev *tc);

But we missed marking the last argument as a pointer.

Fixes: 16e5cc647173 ("net: rework setup_tc ndo op to consume general tc 
operand")
CC: John Fastabend <john.r.fastab...@intel.com>
Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

build log at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/110890068

 drivers/net/ethernet/ti/netcp_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/netcp_core.c 
b/drivers/net/ethernet/ti/netcp_core.c
index 8586a20..06a0a73 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -1836,7 +1836,7 @@ static u16 netcp_select_queue(struct net_device *dev, 
struct sk_buff *skb,
 }
 
 static int netcp_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
- struct tc_to_netdev tc)
+ struct tc_to_netdev *tc)
 {
int i;
 
-- 
1.9.1



Re: [PATCH v2] net: phy: spi_ks8995: add dependency on GPIO

2016-02-19 Thread Sudip Mukherjee

On Friday 19 February 2016 09:43 PM, David Miller wrote:

From: Sudip Mukherjee <sudipm.mukher...@gmail.com>
Date: Fri, 19 Feb 2016 13:59:09 +0530


On Tue, Feb 16, 2016 at 08:36:06PM -0500, David Miller wrote:

From: Sudip Mukherjee <sudipm.mukher...@gmail.com>
Date: Sat, 13 Feb 2016 19:33:15 +0530


The builds of allmodconfig of s390, m68k, tilegx, tilepro is failing
with the error:
  drivers/net/phy/spi_ks8995.c:477:3: error: implicit declaration of function 
'gpiod_set_value'
  drivers/net/phy/spi_ks8995.c:477:19: error: implicit declaration of function 
'gpio_to_desc'

  ...

I think Arnd's patch is still not applied as we are still having build
failures for the implicit declarations. Or you want me to send v3 after
removing unnecessary linux/gpio.h include?


It's definitely there in net-next, commit 
27090cbdc345cd5fd6f6e57a8986c504c27e4d23



Ohhh.. ok.. linux-next is still using net-next from next-20160217, I 
hope Monday it will be fine.


regards
sudip


Re: [PATCH] b43: fix memory leak

2016-02-19 Thread Sudip Mukherjee

On Friday 19 February 2016 01:14 PM, Kalle Valo wrote:

Michael Büsch <m...@bues.ch> writes:


On Thu, 18 Feb 2016 18:04:36 +0530
Sudip Mukherjee <sudipm.mukher...@gmail.com> wrote:


From: Sudip Mukherjee <su...@vectorindia.org>

On error we jumped to the label bcma_out and returned the error code but
we missed freeing dev.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
  drivers/net/wireless/broadcom/b43/main.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/broadcom/b43/main.c 
b/drivers/net/wireless/broadcom/b43/main.c
index c279211..78f670a 100644
--- a/drivers/net/wireless/broadcom/b43/main.c
+++ b/drivers/net/wireless/broadcom/b43/main.c
@@ -5671,6 +5671,7 @@ static int b43_bcma_probe(struct bcma_device *core)
wl = b43_wireless_init(dev);
if (IS_ERR(wl)) {
err = PTR_ERR(wl);
+   kfree(dev);
goto bcma_out;
}



We recently had a patch that fixes this, among more leaks. Subject:
[PATCH v2 resend] b43: Fix memory leaks in b43_bus_dev_ssb_init and
b43_bus_dev_bcma_init

Please test that patch instead, so we can finally apply it.

It needs to be tested on both ssb and bcma. Come on. This isn't too
hard. :) Please somebody with any hardware test it. (I currently don't
have any b43 hardware)


And the patch can be downloaded from patchwork:

https://patchwork.kernel.org/patch/8049041/


I have an old laptop running on 800Mhz CPU. It has "Broadcom BCM4311 
[14e4:4311] (rev 01)".

I will try to test it on this weekend.

regards
sudip





Re: [PATCH v2] net: phy: spi_ks8995: add dependency on GPIO

2016-02-19 Thread Sudip Mukherjee
On Tue, Feb 16, 2016 at 08:36:06PM -0500, David Miller wrote:
> From: Sudip Mukherjee <sudipm.mukher...@gmail.com>
> Date: Sat, 13 Feb 2016 19:33:15 +0530
> 
> > The builds of allmodconfig of s390, m68k, tilegx, tilepro is failing
> > with the error:
> >  drivers/net/phy/spi_ks8995.c:477:3: error: implicit declaration of 
> > function 'gpiod_set_value'
> >  drivers/net/phy/spi_ks8995.c:477:19: error: implicit declaration of 
> > function 'gpio_to_desc'
> > 
> > GPIO is now used to reset the switch so we should have a dependency on
> > GPIOLIB. While adding the dependency also add COMPILE_TEST so that we
> > can build test it.
> > 
> > Fixes: cd6f288cbaab ("net: phy: spi_ks8995: add support for resetting 
> > switch using GPIO")
> > Cc: Helmut Buchsbaum <helmut.buchsb...@gmail.com>
> > Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
> > ---
> > 
> > v2: added COMPILE_TEST and gpio/consumer.h
> 
> I'm going to apply Arnd's patch because it properly removes the
> unnecessary linux/gpio.h include.

I think Arnd's patch is still not applied as we are still having build
failures for the implicit declarations. Or you want me to send v3 after
removing unnecessary linux/gpio.h include?

regards
suduo


[PATCH] b43: fix memory leak

2016-02-18 Thread Sudip Mukherjee
From: Sudip Mukherjee <su...@vectorindia.org>

On error we jumped to the label bcma_out and returned the error code but
we missed freeing dev.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/wireless/broadcom/b43/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/broadcom/b43/main.c 
b/drivers/net/wireless/broadcom/b43/main.c
index c279211..78f670a 100644
--- a/drivers/net/wireless/broadcom/b43/main.c
+++ b/drivers/net/wireless/broadcom/b43/main.c
@@ -5671,6 +5671,7 @@ static int b43_bcma_probe(struct bcma_device *core)
wl = b43_wireless_init(dev);
if (IS_ERR(wl)) {
err = PTR_ERR(wl);
+   kfree(dev);
goto bcma_out;
}
 
-- 
1.9.1



[PATCH] igmp: fix build warning

2016-02-16 Thread Sudip Mukherjee
We were getting build warnings about:
net/ipv4/igmp.c: In function ‘igmp_group_added’:
net/ipv4/igmp.c:1227:14: warning: unused variable ‘net’ [-Wunused-variable]

net/ipv4/igmp.c: In function ‘ip_mc_inc_group’:
net/ipv4/igmp.c:1319:14: warning: unused variable ‘net’ [-Wunused-variable]

net/ipv4/igmp.c: In function ‘ip_mc_init_dev’:
net/ipv4/igmp.c:1646:14: warning: unused variable ‘net’ [-Wunused-variable]

net/ipv4/igmp.c: In function ‘ip_mc_up’:
net/ipv4/igmp.c:1665:14: warning: unused variable ‘net’ [-Wunused-variable]

These variables are only used when CONFIG_IP_MULTICAST is defined. Mark
them as '__maybe_unused'.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 net/ipv4/igmp.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 7c95335..0ba241b 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1224,7 +1224,7 @@ static void igmp_group_dropped(struct ip_mc_list *im)
 static void igmp_group_added(struct ip_mc_list *im)
 {
struct in_device *in_dev = im->interface;
-   struct net *net = dev_net(in_dev->dev);
+   struct net __maybe_unused *net = dev_net(in_dev->dev);
 
if (im->loaded == 0) {
im->loaded = 1;
@@ -1316,7 +1316,7 @@ static void ip_mc_hash_remove(struct in_device *in_dev,
 void ip_mc_inc_group(struct in_device *in_dev, __be32 addr)
 {
struct ip_mc_list *im;
-   struct net *net = dev_net(in_dev->dev);
+   struct net __maybe_unused *net = dev_net(in_dev->dev);
 
ASSERT_RTNL();
 
@@ -1643,7 +1643,7 @@ void ip_mc_down(struct in_device *in_dev)
 
 void ip_mc_init_dev(struct in_device *in_dev)
 {
-   struct net *net = dev_net(in_dev->dev);
+   struct net __maybe_unused *net = dev_net(in_dev->dev);
ASSERT_RTNL();
 
 #ifdef CONFIG_IP_MULTICAST
@@ -1662,7 +1662,7 @@ void ip_mc_init_dev(struct in_device *in_dev)
 void ip_mc_up(struct in_device *in_dev)
 {
struct ip_mc_list *pmc;
-   struct net *net = dev_net(in_dev->dev);
+   struct net __maybe_unused *net = dev_net(in_dev->dev);
 
ASSERT_RTNL();
 
-- 
1.9.1



[PATCH v2] net: phy: spi_ks8995: add dependency on GPIO

2016-02-13 Thread Sudip Mukherjee
The builds of allmodconfig of s390, m68k, tilegx, tilepro is failing
with the error:
 drivers/net/phy/spi_ks8995.c:477:3: error: implicit declaration of function 
'gpiod_set_value'
 drivers/net/phy/spi_ks8995.c:477:19: error: implicit declaration of function 
'gpio_to_desc'

GPIO is now used to reset the switch so we should have a dependency on
GPIOLIB. While adding the dependency also add COMPILE_TEST so that we
can build test it.

Fixes: cd6f288cbaab ("net: phy: spi_ks8995: add support for resetting switch 
using GPIO")
Cc: Helmut Buchsbaum <helmut.buchsb...@gmail.com>
Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---

v2: added COMPILE_TEST and gpio/consumer.h

 drivers/net/phy/Kconfig  | 1 +
 drivers/net/phy/spi_ks8995.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index f0a7702..186f202 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -262,3 +262,4 @@ endif # PHYLIB
 config MICREL_KS8995MA
tristate "Micrel KS8995MA 5-ports 10/100 managed Ethernet switch"
depends on SPI
+   depends on GPIOLIB || COMPILE_TEST
diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c
index 5e7340f..55000f6 100644
--- a/drivers/net/phy/spi_ks8995.c
+++ b/drivers/net/phy/spi_ks8995.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
-- 
1.9.1



Re: [PATCH] net: phy: spi_ks8995: add dependency on GPIO

2016-02-13 Thread Sudip Mukherjee

On Saturday 13 February 2016 03:42 PM, Geert Uytterhoeven wrote:

On Fri, Feb 12, 2016 at 11:18 AM, Sudip Mukherjee
<sudipm.mukher...@gmail.com> wrote:

The builds of allmodconfig of s390, m68k, tilegx, tilepro is failing
with the error:
  drivers/net/phy/spi_ks8995.c:477:3: error: implicit declaration of function 
'gpiod_set_value'
  drivers/net/phy/spi_ks8995.c:477:19: error: implicit declaration of function 
'gpio_to_desc'


Does that file include include/linux/gpio/consumer.h?
The GPIO subsystem provides dummies of these functions when CONFIG_GPIOLIB=n.


GPIO is now used to reset the switch so we should have a dependency on
GPIOLIB.

Fixes: cd6f288cbaab ("net: phy: spi_ks8995: add support for resetting switch using 
GPIO")
Cc: Helmut Buchsbaum <helmut.buchsb...@gmail.com>
Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
  drivers/net/phy/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index f0a7702..c6a4fe1 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -261,4 +261,4 @@ endif # PHYLIB

  config MICREL_KS8995MA
 tristate "Micrel KS8995MA 5-ports 10/100 managed Ethernet switch"
-   depends on SPI
+   depends on SPI && GPIOLIB


I think that can become

 depends on SPI
 depends on GPIOLIB || COMPILE_TEST

after you've added the missing include.


yes, ofcourse. Better change that what I have done. Just sent v2 after 
compile testing this change.


regards
sudip


[PATCH] net: phy: spi_ks8995: add dependency on GPIO

2016-02-12 Thread Sudip Mukherjee
The builds of allmodconfig of s390, m68k, tilegx, tilepro is failing
with the error:
 drivers/net/phy/spi_ks8995.c:477:3: error: implicit declaration of function 
'gpiod_set_value'
 drivers/net/phy/spi_ks8995.c:477:19: error: implicit declaration of function 
'gpio_to_desc'

GPIO is now used to reset the switch so we should have a dependency on
GPIOLIB. 

Fixes: cd6f288cbaab ("net: phy: spi_ks8995: add support for resetting switch 
using GPIO")
Cc: Helmut Buchsbaum <helmut.buchsb...@gmail.com>
Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/phy/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index f0a7702..c6a4fe1 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -261,4 +261,4 @@ endif # PHYLIB
 
 config MICREL_KS8995MA
tristate "Micrel KS8995MA 5-ports 10/100 managed Ethernet switch"
-   depends on SPI
+   depends on SPI && GPIOLIB
-- 
1.9.1



Re: [PATCH v3] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c

2016-02-03 Thread Sudip Mukherjee
On Wed, Feb 03, 2016 at 02:21:46PM +0900, Byeoungwook Kim wrote:
> Conditional codes in rtl_addr_delay() were improved in readability and
> performance by using switch codes.
> 
> Reviewed-by: Julian Calaby 
> Signed-off-by: Byeoungwook Kim 
> Signed-off-by: Fengguang Wu 

How you are using Signed-off-by: of Fengguang Wu?

did i missed seeing any mail from Fengguang in your previous versions?

regards
sudip


Re: [v2,2/3] net: wireless: b43: Coding Style

2016-02-02 Thread Sudip Mukherjee
On Mon, Oct 19, 2015 at 05:02:22PM +0100, Paul Mcquade wrote:
> Fixed Pointer Coding Style
> 
> Signed-off-by: Paul McQuade 
> Acked-by: Michael Buesch 

Please fix the From: name like i just replied in another of your patch
and this patch will not apply anymore as the driver has moved to a new
location drivers/net/wireless/broadcom/b43/

can you please rebase it against the current tree and send.

regards
sudip


Re: [RESEND,01/10] net: wireless: ath: Remove unnecessary semicolon

2016-02-02 Thread Sudip Mukherjee
On Wed, Oct 28, 2015 at 12:32:36AM +0530, punit vara wrote:
> This patch is to the htt_rx.c that removes unneeded semicolon which is
> reported by coccicheck.
> 
> Here semicolon just create empty statement so please remote it.

s/remote/remove

Instead of "net: wireless: ath: Remove unnecessary semicolon" the subject
should be "ath10k: Remove unnecessary semicolon"

and please combine this patch and the next patch as they are similar
change to the same driver.

regards
sudip


Re: [1/3] net: wireless: rsi: Coding Spaces

2016-02-02 Thread Sudip Mukherjee
On Sun, Oct 18, 2015 at 12:01:36AM +0100, Paul Mcquade wrote:
> Removed space before that ','
> 
> Signed-off-by: Paul McQuade 

The From: name and Signed-off-by: name should be same else some of the
stats generating tools will break. It should be Paul McQuade, not
Paul Mcquade. Maybe you have modified your .gitconfig recently.

And in the subject net: wireless: is not required.
Can you please send v2..

regards
sudip


Re: net: wireless: rt2x00: Fixed Spacing issues

2016-02-02 Thread Sudip Mukherjee
On Sat, Oct 17, 2015 at 09:04:39PM +0100, Paul Mcquade wrote:
> Removed empty spaces before/after parenthesis
> 
> Signed-off-by: Paul McQuade 
> Acked-by: Helmut Schaa 
> 
> ---
> drivers/net/wireless/rt2x00/rt61pci.h | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)

This patch and your other patches related to rt2x00 will not apply
anymore as the driver has moved to drivers/net/wireless/ralink/rt2x00

can you please send them again after rebasing against current tree..

regards
sudip


Re: [PATCH] mac80211: fix memory leak

2016-02-01 Thread Sudip Mukherjee
On Mon, Feb 01, 2016 at 11:28:37AM +0200, Kalle Valo wrote:
> Sudip Mukherjee <sudipm.mukher...@gmail.com> writes:
> 
> > On Mon, Feb 01, 2016 at 11:03:35AM +1100, Julian Calaby wrote:
> >> Hi Sudip,
> >> 
> >> On Fri, Jan 29, 2016 at 8:49 PM, Sudip Mukherjee
> >> <sudipm.mukher...@gmail.com> wrote:
> >> > On error we jumped to the error label and returned the error code but we
> >> > missed releasing sinfo.
> >> >
> >> > Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
> >> 
> >> Should the From: and Signed-off-by: email addresses be the same?
> >
> > I think 2 years back I had a long discussion with Greg about this and
> > since then I al submitting patches like this. A small summayg of the
> > problem from that discussion:
> >
> > "we have strict DMARC check for the corporate mail server. DMARC =
> > domain based message authentication.
> > So the mail i sent reached all the list subscriber from a different
> > server than our designated server, and as a result it is marked as spam
> > in many places and I have already received a few complaints regarding
> > that."
> 
> You can add a separate "From:" line to the beginning of the commit log
> and git will use it then commiting the patch. I didn't find any
> documention but it's easy to do and should solve this.

Documentation is not needed. :)
I have done that couple of time.
I will resend this patch with the extra From: line.

regards
sudip


[PATCH] ath10k: remove impossible code

2016-02-01 Thread Sudip Mukherjee
From: Sudip Mukherjee <su...@vectorindia.org>

len has been initialized with a value of 0 and buf_len with 4096. There
is no way that this condition (len > buf_len) can be true now.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/wireless/ath/ath10k/debug.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c 
b/drivers/net/wireless/ath/ath10k/debug.c
index 2bdf540..8b187e0 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -2176,9 +2176,6 @@ static ssize_t ath10k_debug_fw_checksums_read(struct file 
*file,
 
mutex_lock(>conf_mutex);
 
-   if (len > buf_len)
-   len = buf_len;
-
len += scnprintf(buf + len, buf_len - len,
 "firmware-N.bin\t\t%08x\n",
 crc32_le(0, ar->firmware->data, ar->firmware->size));
-- 
1.9.1



Re: [PATCH] mac80211: fix memory leak

2016-01-31 Thread Sudip Mukherjee
On Mon, Feb 01, 2016 at 11:03:35AM +1100, Julian Calaby wrote:
> Hi Sudip,
> 
> On Fri, Jan 29, 2016 at 8:49 PM, Sudip Mukherjee
> <sudipm.mukher...@gmail.com> wrote:
> > On error we jumped to the error label and returned the error code but we
> > missed releasing sinfo.
> >
> > Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
> 
> Should the From: and Signed-off-by: email addresses be the same?

I think 2 years back I had a long discussion with Greg about this and
since then I al submitting patches like this. A small summayg of the
problem from that discussion:

"we have strict DMARC check for the corporate mail server. DMARC =
domain based message authentication.
So the mail i sent reached all the list subscriber from a different
server than our designated server, and as a result it is marked as spam
in many places and I have already received a few complaints regarding
that."

> 
> > ---
> >  net/mac80211/sta_info.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> > index 6c198e6..36e75c4 100644
> > --- a/net/mac80211/sta_info.c
> > +++ b/net/mac80211/sta_info.c
> > @@ -561,6 +561,7 @@ static int sta_info_insert_finish(struct sta_info *sta) 
> > __acquires(RCU)
> > __cleanup_single_sta(sta);
> >   out_err:
> > mutex_unlock(>sta_mtx);
> > +   kfree(sinfo);
> > rcu_read_lock();
> > return err;
> >  }
> 
> Looks sane to me. I must note that the bug this is fixing is only in
> the mac80211-next tree.
> 
> Fixes: 5fe74014172d ("mac80211: avoid excessive stack usage in sta_info")
> Reviewed-by: Julian Calaby <julian.cal...@gmail.com>

thanks

regards
sudip


[PATCH] mac80211: fix memory leak

2016-01-29 Thread Sudip Mukherjee
On error we jumped to the error label and returned the error code but we
missed releasing sinfo.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 net/mac80211/sta_info.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 6c198e6..36e75c4 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -561,6 +561,7 @@ static int sta_info_insert_finish(struct sta_info *sta) 
__acquires(RCU)
__cleanup_single_sta(sta);
  out_err:
mutex_unlock(>sta_mtx);
+   kfree(sinfo);
rcu_read_lock();
return err;
 }
-- 
1.9.1



[PATCH 1/3] i40e: fix build warning

2016-01-24 Thread Sudip Mukherjee
While building we are getting warning about:
i40e_main.c:8604:13: warning: 'i40e_add_geneve_port' defined but not used
and
i40e_main.c:8651:13: warning: 'i40e_del_geneve_port' defined but not used

The contents of these functions are defined under CONFIG_GENEVE, so if
CONFIG_GENEVE is not defined then we are having unused empty functions.
Lets have these functions under CONFIG_GENEVE as the callback is already
defined under CONFIG_GENEVE there is no chance of any failure.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c 
b/drivers/net/ethernet/intel/i40e/i40e_main.c
index bb4612c..c258697 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8595,6 +8595,7 @@ static void i40e_del_vxlan_port(struct net_device *netdev,
 #endif
 }
 
+#if IS_ENABLED(CONFIG_GENEVE)
 /**
  * i40e_add_geneve_port - Get notifications about GENEVE ports that come up
  * @netdev: This physical port's netdev
@@ -8604,7 +8605,6 @@ static void i40e_del_vxlan_port(struct net_device *netdev,
 static void i40e_add_geneve_port(struct net_device *netdev,
 sa_family_t sa_family, __be16 port)
 {
-#if IS_ENABLED(CONFIG_GENEVE)
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back;
@@ -8639,7 +8639,6 @@ static void i40e_add_geneve_port(struct net_device 
*netdev,
pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
 
dev_info(>pdev->dev, "adding geneve port %d\n", ntohs(port));
-#endif
 }
 
 /**
@@ -8651,7 +8650,6 @@ static void i40e_add_geneve_port(struct net_device 
*netdev,
 static void i40e_del_geneve_port(struct net_device *netdev,
 sa_family_t sa_family, __be16 port)
 {
-#if IS_ENABLED(CONFIG_GENEVE)
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back;
@@ -8677,8 +8675,8 @@ static void i40e_del_geneve_port(struct net_device 
*netdev,
netdev_warn(netdev, "geneve port %d was not found, not 
deleting\n",
ntohs(port));
}
-#endif
 }
+#endif
 
 static int i40e_get_phys_port_id(struct net_device *netdev,
 struct netdev_phys_item_id *ppid)
-- 
1.9.1



[PATCH 3/3] defxx: fix build warning

2016-01-24 Thread Sudip Mukherjee
We are getting many build warning about:
'bar_start' may be used uninitialized
and
'bar_len' may be used uninitialized

They are not actually uninitialized as dfx_get_bars() will initialize
them properly. But still lets have them initialized just to satisfy the
compiler.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/fddi/defxx.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index 7f975a2..4113535 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -533,8 +533,8 @@ static int dfx_register(struct device *bdev)
const char *print_name = dev_name(bdev);
struct net_device *dev;
DFX_board_t   *bp;  /* board pointer */
-   resource_size_t bar_start[3];   /* pointers to ports */
-   resource_size_t bar_len[3]; /* resource length */
+   resource_size_t bar_start[3] = {0, 0, 0};   /* pointers to ports */
+   resource_size_t bar_len[3] = {0, 0, 0}; /* resource length */
int alloc_size; /* total buffer size used */
struct resource *region;
int err = 0;
@@ -3697,8 +3697,8 @@ static void dfx_unregister(struct device *bdev)
int dfx_bus_pci = dev_is_pci(bdev);
int dfx_bus_tc = DFX_BUS_TC(bdev);
int dfx_use_mmio = DFX_MMIO || dfx_bus_tc;
-   resource_size_t bar_start[3];   /* pointers to ports */
-   resource_size_t bar_len[3]; /* resource lengths */
+   resource_size_t bar_start[3] = {0, 0, 0};   /* pointers to ports */
+   resource_size_t bar_len[3] = {0, 0, 0}; /* resource lengths */
int alloc_size; /* total buffer size used */
 
unregister_netdev(dev);
-- 
1.9.1



[PATCH v2] defxx: fix build warning

2016-01-24 Thread Sudip Mukherjee
We are getting many build warnings about:
'bar_start' may be used uninitialized
and
'bar_len' may be used uninitialized

They are not actually uninitialized as dfx_get_bars() will initialize
them properly. But still lets have them initialized just to satisfy the
compiler (gcc 4.8.2).

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---

v2: only the first element is zeroed.

 drivers/net/fddi/defxx.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index 7f975a2..de5eaa6 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -533,8 +533,8 @@ static int dfx_register(struct device *bdev)
const char *print_name = dev_name(bdev);
struct net_device *dev;
DFX_board_t   *bp;  /* board pointer */
-   resource_size_t bar_start[3];   /* pointers to ports */
-   resource_size_t bar_len[3]; /* resource length */
+   resource_size_t bar_start[3] = {0}; /* pointers to ports */
+   resource_size_t bar_len[3] = {0};   /* resource length */
int alloc_size; /* total buffer size used */
struct resource *region;
int err = 0;
@@ -3697,8 +3697,8 @@ static void dfx_unregister(struct device *bdev)
int dfx_bus_pci = dev_is_pci(bdev);
int dfx_bus_tc = DFX_BUS_TC(bdev);
int dfx_use_mmio = DFX_MMIO || dfx_bus_tc;
-   resource_size_t bar_start[3];   /* pointers to ports */
-   resource_size_t bar_len[3]; /* resource lengths */
+   resource_size_t bar_start[3] = {0}; /* pointers to ports */
+   resource_size_t bar_len[3] = {0};   /* resource lengths */
int alloc_size; /* total buffer size used */
 
unregister_netdev(dev);
-- 
1.9.1



[PATCH 2/3] net: macb: fix build warning

2016-01-24 Thread Sudip Mukherjee
We are getting build warning about:
macb.c:2889:13: warning: 'tx_clk' may be used uninitialized in this function
macb.c:2888:11: warning: 'hclk' may be used uninitialized in this function

In reality they are not used uninitialized as clk_init() will initialize
them, this patch will just silence the warning.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/ethernet/cadence/macb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cadence/macb.c 
b/drivers/net/ethernet/cadence/macb.c
index 9d9984a..50c9410 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -2823,7 +2823,7 @@ static int macb_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
struct device_node *phy_node;
const struct macb_config *macb_config = NULL;
-   struct clk *pclk, *hclk, *tx_clk;
+   struct clk *pclk, *hclk = NULL, *tx_clk = NULL;
unsigned int queue_mask, num_queues;
struct macb_platform_data *pdata;
bool native_io;
-- 
1.9.1



[PATCH] net/irda: bfin_sir: remove duplicate defines

2016-01-20 Thread Sudip Mukherjee
The defconfig build of blackfin is failing with the error:

arch/blackfin/include/asm/bfin_serial.h:269:0: warning: "port_membase" redefined
drivers/net/irda/bfin_sir.h:85:0: note: this is the location of the previous 
definition
arch/blackfin/include/asm/bfin_serial.h:382:0: warning: "get_lsr_cache" 
redefined
drivers/net/irda/bfin_sir.h:86:0: note: this is the location of the previous 
definition
arch/blackfin/include/asm/bfin_serial.h:383:0: warning: "put_lsr_cache" 
redefined
drivers/net/irda/bfin_sir.h:87:0: note: this is the location of the previous 
definition

port_membase, get_lsr_cache, put_lsr_cache are already defined in the
architecture files, no need to define them again in the driver.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/irda/bfin_sir.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/irda/bfin_sir.h b/drivers/net/irda/bfin_sir.h
index 29cbde8..d47cf14 100644
--- a/drivers/net/irda/bfin_sir.h
+++ b/drivers/net/irda/bfin_sir.h
@@ -82,9 +82,6 @@ struct bfin_sir_self {
 
 #define DRIVER_NAME "bfin_sir"
 
-#define port_membase(port) (((struct bfin_sir_port *)(port))->membase)
-#define get_lsr_cache(port)(((struct bfin_sir_port *)(port))->lsr)
-#define put_lsr_cache(port, v) (((struct bfin_sir_port *)(port))->lsr = (v))
 #include 
 
 static const unsigned short per[][4] = {
-- 
1.9.1



[PATCH] net: plip: use new parport device model

2016-01-07 Thread Sudip Mukherjee
Modify plip driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/plip/plip.c | 36 
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index 040b897..9c4b41a 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -1249,6 +1249,7 @@ static void plip_attach (struct parport *port)
struct net_device *dev;
struct net_local *nl;
char name[IFNAMSIZ];
+   struct pardev_cb plip_cb;
 
if ((parport[0] == -1 && (!timid || !port->devices)) ||
plip_searchfor(parport, port->number)) {
@@ -1273,9 +1274,15 @@ static void plip_attach (struct parport *port)
 
nl = netdev_priv(dev);
nl->dev = dev;
-   nl->pardev = parport_register_device(port, dev->name, 
plip_preempt,
-plip_wakeup, plip_interrupt,
-0, dev);
+
+   memset(_cb, 0, sizeof(plip_cb));
+   plip_cb.private = dev;
+   plip_cb.preempt = plip_preempt;
+   plip_cb.wakeup = plip_wakeup;
+   plip_cb.irq_func = plip_interrupt;
+
+   nl->pardev = parport_register_dev_model(port, dev->name,
+   _cb, unit);
 
if (!nl->pardev) {
printk(KERN_ERR "%s: parport_register failed\n", name);
@@ -1315,10 +1322,23 @@ static void plip_detach (struct parport *port)
/* Nothing to do */
 }
 
+static int plip_probe(struct pardevice *par_dev)
+{
+   struct device_driver *drv = par_dev->dev.driver;
+   int len = strlen(drv->name);
+
+   if (strncmp(par_dev->name, drv->name, len))
+   return -ENODEV;
+
+   return 0;
+}
+
 static struct parport_driver plip_driver = {
-   .name   = "plip",
-   .attach = plip_attach,
-   .detach = plip_detach
+   .name   = "plip",
+   .probe  = plip_probe,
+   .match_port = plip_attach,
+   .detach = plip_detach,
+   .devmodel   = true,
 };
 
 static void __exit plip_cleanup_module (void)
@@ -1326,8 +1346,6 @@ static void __exit plip_cleanup_module (void)
struct net_device *dev;
int i;
 
-   parport_unregister_driver (_driver);
-
for (i=0; i < PLIP_MAX; i++) {
if ((dev = dev_plip[i])) {
struct net_local *nl = netdev_priv(dev);
@@ -1339,6 +1357,8 @@ static void __exit plip_cleanup_module (void)
dev_plip[i] = NULL;
}
}
+
+   parport_unregister_driver(_driver);
 }
 
 #ifndef MODULE
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] net/macb: add proper header file

2015-12-17 Thread Sudip Mukherjee
On Thu, Dec 17, 2015 at 01:41:59PM +0100, Gregory CLEMENT wrote:
> Hi Sudip,
>  
>  On jeu., déc. 17 2015, Sudip Mukherjee <sudipm.mukher...@gmail.com> wrote:
> 
> > mips allmodconfig build fails with the error:
> >
> > drivers/net/ethernet/cadence/macb.c: In function 'macb_probe':
> > drivers/net/ethernet/cadence/macb.c:2908:2: error: implicit declaration of 
> > function 'devm_gpiod_get_optional' [-Werror=implicit-function-declaration]
> >   bp->reset_gpio = devm_gpiod_get_optional(>pdev->dev, "phy-reset",
> >   ^
> > drivers/net/ethernet/cadence/macb.c:2909:8: error: 'GPIOD_OUT_HIGH' 
> > undeclared (first use in this function)
> > GPIOD_OUT_HIGH);
> > ^
> > drivers/net/ethernet/cadence/macb.c:2909:8: note: each undeclared 
> > identifier is reported only once for each function it appears in
> > drivers/net/ethernet/cadence/macb.c: In function 'macb_remove':
> > drivers/net/ethernet/cadence/macb.c:2979:3: error: implicit declaration of 
> > function 'gpiod_set_value' [-Werror=implicit-function-declaration]
> >gpiod_set_value(bp->reset_gpio, 0);
> >^
> >
> > Add the proper header file to resolve it.  
> 
> 
> A proper fix already has been posted along with the proper device tree
> bindinsg too:
> http://marc.info/?l=linux-netdev=145034590619620=2

Thanks, just compiled with it and the build error for which I posted this patch
is now gone.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] net/macb: add proper header file

2015-12-17 Thread Sudip Mukherjee
mips allmodconfig build fails with the error:

drivers/net/ethernet/cadence/macb.c: In function 'macb_probe':
drivers/net/ethernet/cadence/macb.c:2908:2: error: implicit declaration of 
function 'devm_gpiod_get_optional' [-Werror=implicit-function-declaration]
  bp->reset_gpio = devm_gpiod_get_optional(>pdev->dev, "phy-reset",
  ^
drivers/net/ethernet/cadence/macb.c:2909:8: error: 'GPIOD_OUT_HIGH' undeclared 
(first use in this function)
GPIOD_OUT_HIGH);
^
drivers/net/ethernet/cadence/macb.c:2909:8: note: each undeclared identifier is 
reported only once for each function it appears in
drivers/net/ethernet/cadence/macb.c: In function 'macb_remove':
drivers/net/ethernet/cadence/macb.c:2979:3: error: implicit declaration of 
function 'gpiod_set_value' [-Werror=implicit-function-declaration]
   gpiod_set_value(bp->reset_gpio, 0);
   ^

Add the proper header file to resolve it.  

Fixes: 5833e0526820 ("net/macb: add support for resetting PHY using GPIO")
Cc: Gregory CLEMENT <gregory.clem...@free-electrons.com>
Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---

build log with next-20151217 is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/97388463

 drivers/net/ethernet/cadence/macb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/cadence/macb.c 
b/drivers/net/ethernet/cadence/macb.c
index 0123646..988ee14 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] NFC: nci: fix memory leak

2015-12-09 Thread Sudip Mukherjee
On Mon, Nov 16, 2015 at 06:27:15PM +0530, Sudip Mukherjee wrote:
> In case of invalid number_destination_params we were returning error but
> we missed releasing cmd. Lets check for the number of parameter before
> allocating memory so that we don't have a memory leak.
> 
> Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
> ---

A gentle ping.

regards
sudip


>  net/nfc/nci/core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
> index 10c99a5..fbb7a2b 100644
> --- a/net/nfc/nci/core.c
> +++ b/net/nfc/nci/core.c
> @@ -610,14 +610,14 @@ int nci_core_conn_create(struct nci_dev *ndev, u8 
> destination_type,
>   struct nci_core_conn_create_cmd *cmd;
>   struct core_conn_create_data data;
>  
> + if (!number_destination_params)
> + return -EINVAL;
> +
>   data.length = params_len + sizeof(struct nci_core_conn_create_cmd);
>   cmd = kzalloc(data.length, GFP_KERNEL);
>   if (!cmd)
>   return -ENOMEM;
>  
> - if (!number_destination_params)
> - return -EINVAL;
> -
>   cmd->destination_type = destination_type;
>   cmd->number_destination_params = number_destination_params;
>   memcpy(cmd->params, params, params_len);
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Fixing full name in patchwork

2015-12-08 Thread Sudip Mukherjee
On Tue, Dec 08, 2015 at 09:54:41AM +0200, Kalle Valo wrote:
> Sudip Mukherjee <sudipm.mukher...@gmail.com> writes:
> 
> > On Mon, Dec 07, 2015 at 08:03:54PM +0200, Kalle Valo wrote:
> >> Hi Sudip,
> >> 
> >> Sudip Mukherjee <sudipm.mukher...@gmail.com> writes:
> >> 

> >
> > I have also noticed the patch. Anyway, I have created a profile in
> > patchwork and given full name. Hopefully that should solve the problem.
> 
> At least now your name in the patchwork link above looks correct:

Yes, but I am still surprised why this happened for only this patch.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Fixing full name in patchwork

2015-12-07 Thread Sudip Mukherjee
On Mon, Dec 07, 2015 at 08:03:54PM +0200, Kalle Valo wrote:
> Hi Sudip,
> 
> Sudip Mukherjee <sudipm.mukher...@gmail.com> writes:
> 
> > We were dereferencing cmd first and checking for NULL later. Lets first
> > check for NULL.
> >
> > Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
> 
> I noticed that your name in git log is not your full name:
> 
> commit 0a38c8e1b592c16d959da456f425053e323a5153
> Author: sudip <sudipm.mukher...@gmail.com>
> Date:   Tue Nov 24 13:51:38 2015 +0530
> 
> This is because for some reason in patchwork your fullname is just
> "sudip":
> 
> https://patchwork.kernel.org/patch/7688171/
> 
> Could you please fix your name in patchwork so that in the future we can
> use your correct full name? The problem is that I don't know exactly how
> to do this but it should be possible because I remember someone else
> having a similar problem and he was able to fix it.

Hi Kalle,
I have also noticed the patch. Anyway, I have created a profile in
patchwork and given full name. Hopefully that should solve the problem.


regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] staging: rtl8712: Make error handling check for failure

2015-11-25 Thread Sudip Mukherjee
On Tue, Nov 24, 2015 at 10:19:41AM -0200, Mauro Dreissig wrote:
> Some error handling paths are checking for success
> instead of error on rtl871x_ioctl_rtl.c.
> 
> Signed-off-by: Mauro Dreissig 
> ---
>  drivers/staging/rtl8712/rtl871x_ioctl_rtl.c | 239 
> ++--
>  1 file changed, 121 insertions(+), 118 deletions(-)
> 
  
> @@ -147,13 +147,13 @@ uint oid_rt_get_rx_icv_err_hdl(struct oid_par_priv 
> *poid_par_priv)
>  
>   if (poid_par_priv->type_of_oid != QUERY_OID)
>   return RNDIS_STATUS_NOT_ACCEPTED;
> - if (poid_par_priv->information_buf_len >= sizeof(u32)) {
> - *(uint *)poid_par_priv->information_buf =
> -  adapter->recvpriv.rx_icv_err;
> - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
> - } else {
> +
> + if (poid_par_priv->information_buf_len < sizeof(u32)) 

trailing whitespace here.
Please always test your patch with checkpatch.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] libertas: check for NULL before use

2015-11-24 Thread Sudip Mukherjee
If kzalloc fails it will return NULL. Lets check for NULL first before
using the pointer.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---

v2: commit message changed

 drivers/net/wireless/marvell/libertas/cfg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas/cfg.c 
b/drivers/net/wireless/marvell/libertas/cfg.c
index 8317afd..e38ad1d 100644
--- a/drivers/net/wireless/marvell/libertas/cfg.c
+++ b/drivers/net/wireless/marvell/libertas/cfg.c
@@ -1108,7 +1108,7 @@ static int lbs_associate(struct lbs_private *priv,
size_t len, resp_ie_len;
int status;
int ret;
-   u8 *pos = &(cmd->iebuf[0]);
+   u8 *pos;
u8 *tmp;
 
lbs_deb_enter(LBS_DEB_CFG80211);
@@ -1117,6 +1117,7 @@ static int lbs_associate(struct lbs_private *priv,
ret = -ENOMEM;
goto done;
}
+   pos = >iebuf[0];
 
/*
 * cmd  50 00
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] net: dsa: fix build failure

2015-11-24 Thread Sudip Mukherjee
We were getting build failure with allmodconfig of tile, tilegx, m32r and m68k
with the error:
implicit declaration of function 'gpio_to_desc'
implicit declaration of function 'gpiod_direction_output'

Fixes: cc30c16344fc ("net: dsa: Add support for a switch reset gpio")
Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---

build log of next-20151124 at:
https://travis-ci.org/sudipm-mukherjee/parport/builds/92864660

 net/dsa/dsa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 0b5565f..b7448c8 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "dsa_priv.h"
 
 char dsa_driver_version[] = "0.1";
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] libertas: fix possible NULL dereference

2015-11-23 Thread Sudip Mukherjee
We were dereferencing cmd first and checking for NULL later. Lets first
check for NULL.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/wireless/marvell/libertas/cfg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas/cfg.c 
b/drivers/net/wireless/marvell/libertas/cfg.c
index 8317afd..e38ad1d 100644
--- a/drivers/net/wireless/marvell/libertas/cfg.c
+++ b/drivers/net/wireless/marvell/libertas/cfg.c
@@ -1108,7 +1108,7 @@ static int lbs_associate(struct lbs_private *priv,
size_t len, resp_ie_len;
int status;
int ret;
-   u8 *pos = &(cmd->iebuf[0]);
+   u8 *pos;
u8 *tmp;
 
lbs_deb_enter(LBS_DEB_CFG80211);
@@ -1117,6 +1117,7 @@ static int lbs_associate(struct lbs_private *priv,
ret = -ENOMEM;
goto done;
}
+   pos = >iebuf[0];
 
/*
 * cmd  50 00
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] libertas: fix possible NULL dereference

2015-11-23 Thread Sudip Mukherjee
On Tue, Nov 24, 2015 at 01:43:38AM +0200, Andy Shevchenko wrote:
> On Mon, Nov 23, 2015 at 2:32 PM, Sudip Mukherjee
> <sudipm.mukher...@gmail.com> wrote:
> > We were dereferencing cmd first and checking for NULL later. Lets first
> > check for NULL.
> 
> However the patch is valid due to reducing error prone part, the
> commit message seems wrong.

I will send v2 with modified commit message.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] NFC: nci: fix memory leak

2015-11-16 Thread Sudip Mukherjee
In case of invalid number_destination_params we were returning error but
we missed releasing cmd. Lets check for the number of parameter before
allocating memory so that we don't have a memory leak.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 net/nfc/nci/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 10c99a5..fbb7a2b 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -610,14 +610,14 @@ int nci_core_conn_create(struct nci_dev *ndev, u8 
destination_type,
struct nci_core_conn_create_cmd *cmd;
struct core_conn_create_data data;
 
+   if (!number_destination_params)
+   return -EINVAL;
+
data.length = params_len + sizeof(struct nci_core_conn_create_cmd);
cmd = kzalloc(data.length, GFP_KERNEL);
if (!cmd)
return -ENOMEM;
 
-   if (!number_destination_params)
-   return -EINVAL;
-
cmd->destination_type = destination_type;
cmd->number_destination_params = number_destination_params;
memcpy(cmd->params, params, params_len);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: linux-next: Tree for Oct 6

2015-10-07 Thread Sudip Mukherjee
On Tue, Oct 06, 2015 at 04:46:53PM +0200, Hans-Peter Nilsson wrote:
> > From: Sudip Mukherjee <sudipm.mukher...@gmail.com>
> > Date: Tue, 6 Oct 2015 14:33:46 +0200
> 
> > On Tue, Oct 06, 2015 at 06:25:22PM +1100, Stephen Rothwell wrote:
> > > Hi all,
> > > 
> > > Changes since 20151002:
> > 
> > The build for cris allmodconfig is failing with the error:
> > 
> > net/sched/sch_dsmark.c: In function 'dsmark_dequeue':
> > net/sched/sch_dsmark.c:316:1: error: unrecognizable insn:
> > (insn 245 244 119 15 (set (reg:QI 11 r11 [179])
> > (and:QI (mem/s/j:QI (reg/f:SI 2 r2 [orig:48 D.44939 ] [48]) [0 
> > D.44939_34->mask+0 S1 A8])
> > (reg:QI 11 r11 [179]))) include/net/dsfield.h:33 -1
> >  (nil))
> > net/sched/sch_dsmark.c:316:1: internal compiler error: in extract_insn, at 
> > recog.c:2109
> > Please submit a full bug report,
> > with preprocessed source if appropriate.
> > See <http://gcc.gnu.org/bugs.html> for instructions.
> > make[2]: *** [net/sched/sch_dsmark.o] Error 1
> > make[1]: *** [net/sched] Error 2
> > make[1]: *** Waiting for unfinished jobs
> > 
> > It says compiler error, but with 4.3-rc4 it compiled properly.
> > Build log of v4.3-rc4 is at
> > https://travis-ci.org/sudipm-mukherjee/parport/jobs/83633972
> > 
> > Build log of linux-next is at:
> > https://travis-ci.org/sudipm-mukherjee/parport/jobs/83839470
> 
> Thanks for the heads-up, but any chance of a bug report as per
> the instructions in the message?  It'll only speed up matters.
I can try, but since I am using 4.6.3 version I doubt if I will get the
required response (Happened with another arch). And this is the latest
cris cross-compiler available in
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/

BTW, I did a bisect and if I revert 4730b433 ("sch_dsmark: improve memory 
locality")
it again builds without any error.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: linux-next: Tree for Oct 6

2015-10-06 Thread Sudip Mukherjee
On Tue, Oct 06, 2015 at 06:25:22PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Changes since 20151002:

The build for cris allmodconfig is failing with the error:

net/sched/sch_dsmark.c: In function 'dsmark_dequeue':
net/sched/sch_dsmark.c:316:1: error: unrecognizable insn:
(insn 245 244 119 15 (set (reg:QI 11 r11 [179])
(and:QI (mem/s/j:QI (reg/f:SI 2 r2 [orig:48 D.44939 ] [48]) [0 
D.44939_34->mask+0 S1 A8])
(reg:QI 11 r11 [179]))) include/net/dsfield.h:33 -1
 (nil))
net/sched/sch_dsmark.c:316:1: internal compiler error: in extract_insn, at 
recog.c:2109
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
make[2]: *** [net/sched/sch_dsmark.o] Error 1
make[1]: *** [net/sched] Error 2
make[1]: *** Waiting for unfinished jobs

It says compiler error, but with 4.3-rc4 it compiled properly.
Build log of v4.3-rc4 is at
https://travis-ci.org/sudipm-mukherjee/parport/jobs/83633972

Build log of linux-next is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/83839470

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] net: via/Kconfig: GENERIC_PCI_IOMAP required if PCI not selected

2015-09-24 Thread Sudip Mukherjee
The builds of allmodconfig of avr32 is failing with:

drivers/net/ethernet/via/via-rhine.c:1098:2: error: implicit declaration
of function 'pci_iomap' [-Werror=implicit-function-declaration]
drivers/net/ethernet/via/via-rhine.c:1119:2: error: implicit declaration
of function 'pci_iounmap' [-Werror=implicit-function-declaration]

The generic empty pci_iomap and pci_iounmap is used only if CONFIG_PCI
is not defined and CONFIG_GENERIC_PCI_IOMAP is defined.

Add GENERIC_PCI_IOMAP in the dependency list for VIA_RHINE as we are
getting build failure when CONFIG_PCI and CONFIG_GENERIC_PCI_IOMAP both
are not defined.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---

Failed build log is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/81127188

An exactly similar patch has been posted earlier and relevant discussion
is at:
https://patchwork.ozlabs.org/patch/498722/

I posted a patch to include empty pci_iomap, pci_iounmap in avr32. That
discussion is at:
https://lkml.org/lkml/2015/9/19/100

 drivers/net/ethernet/via/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/via/Kconfig b/drivers/net/ethernet/via/Kconfig
index 2f1264b..17831e5 100644
--- a/drivers/net/ethernet/via/Kconfig
+++ b/drivers/net/ethernet/via/Kconfig
@@ -17,7 +17,7 @@ if NET_VENDOR_VIA
 
 config VIA_RHINE
tristate "VIA Rhine support"
-   depends on (PCI || OF_IRQ)
+   depends on (PCI || (OF_IRQ && GENERIC_PCI_IOMAP))
depends on HAS_DMA
select CRC32
select MII
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


vhost: build failure

2015-09-16 Thread Sudip Mukherjee
Hi,
While crosscompiling the kernel for openrisc with allmodconfig the build
failed with the error:
drivers/vhost/vhost.c: In function 'vhost_vring_ioctl':
drivers/vhost/vhost.c:818:3: error: call to '__compiletime_assert_818' declared 
with attribute error: BUILD_BUG_ON failed: __alignof__
*vq->avail > VRING_AVAIL_ALIGN_SIZE

Can you please give me any idea about what the problem might be and how
it can be solved.

You can see the build log at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/80365425

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: vhost: build failure

2015-09-16 Thread Sudip Mukherjee
On Wed, Sep 16, 2015 at 11:36:45AM +0300, Michael S. Tsirkin wrote:
> On Wed, Sep 16, 2015 at 01:50:08PM +0530, Sudip Mukherjee wrote:
> > Hi,
> > While crosscompiling the kernel for openrisc with allmodconfig the build
> > failed with the error:
> > drivers/vhost/vhost.c: In function 'vhost_vring_ioctl':
> > drivers/vhost/vhost.c:818:3: error: call to '__compiletime_assert_818' 
> > declared with attribute error: BUILD_BUG_ON failed: __alignof__
> > *vq->avail > VRING_AVAIL_ALIGN_SIZE
> > 
> > Can you please give me any idea about what the problem might be and how
> > it can be solved.
> > 
> > You can see the build log at:
> > https://travis-ci.org/sudipm-mukherjee/parport/jobs/80365425
> > 
> > regards
> > sudip
> 
> Yes - I think I saw this already.
> I think the openrisc cross-compiler is broken.
I thought so. Thanks for the quick reply. I will open a bug in gcc and
lets see what they say.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] at86rf230: fix build warning

2015-09-15 Thread Sudip Mukherjee
On Fri, Sep 11, 2015 at 03:16:04PM +0530, Sudip Mukherjee wrote:
> e616a00ce786 ("drivers/net/ieee802154/at86rf230.c: seq_printf() now returns 
> NULL")
> has removed the usage of the integer "ret" but missed removing the
> variable. And we were getting a build warning about "unused variable".
> 
> Fixes: e616a00ce786 ("drivers/net/ieee802154/at86rf230.c: seq_printf() now 
> returns NULL")
> Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
> ---
Please drop this patch. This was against a temporary fix by Stephen on
linux-next. The commit is not availble now.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] at86rf230: fix build warning

2015-09-11 Thread Sudip Mukherjee
e616a00ce786 ("drivers/net/ieee802154/at86rf230.c: seq_printf() now returns 
NULL")
has removed the usage of the integer "ret" but missed removing the
variable. And we were getting a build warning about "unused variable".

Fixes: e616a00ce786 ("drivers/net/ieee802154/at86rf230.c: seq_printf() now 
returns NULL")
Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/ieee802154/at86rf230.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ieee802154/at86rf230.c 
b/drivers/net/ieee802154/at86rf230.c
index a9f3af6..9ae98fd 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1645,7 +1645,6 @@ static struct dentry *at86rf230_debugfs_root;
 static int at86rf230_stats_show(struct seq_file *file, void *offset)
 {
struct at86rf230_local *lp = file->private;
-   int ret;
 
seq_printf(file, "SUCCESS:\t\t%8llu\n", lp->trac.success);
seq_printf(file, "SUCCESS_DATA_PENDING:\t%8llu\n",
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] net: wan: sbni: fix device usage count

2015-09-03 Thread Sudip Mukherjee
dev_get_by_name() will increment the usage count if the matching device
is found. But we were not decrementing the count if we have got the
device and the device is non-active.

Signed-off-by: Sudip Mukherjee <su...@vectorindia.org>
---
 drivers/net/wan/sbni.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 758c4ba..8fef8d8 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -1358,6 +1358,8 @@ sbni_ioctl( struct net_device  *dev,  struct ifreq  *ifr, 
 int  cmd )
if( !slave_dev  ||  !(slave_dev->flags & IFF_UP) ) {
netdev_err(dev, "trying to enslave non-active device 
%s\n",
   slave_name);
+   if (slave_dev)
+   dev_put(slave_dev);
return  -EPERM;
}
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability

2015-07-24 Thread Sudip Mukherjee
On Thu, Jul 23, 2015 at 01:24:50PM +0300, Dan Carpenter wrote:
 On Thu, Jul 23, 2015 at 01:10:57PM +0300, Dan Carpenter wrote:
  In this specific case, writing it as if (ret != 0) caused the bug.  If
  we had written it as if (ret) return ret; then there are no zeroes so
  wouldn't have been any temptation to return the zero instead of the ret.
 
 I did a search to see if returning the zero instead of the ret was a
 common mistake and it seems like it might be.  I did:
 
 grep 'if (ret != 0)' drivers/   -r -A1 -n | grep return 0; | perl -ne 
 's/.c-(\d+)-/.c:$1/; print'
 
 drivers/gpu/drm/nouveau/nouveau_display.c:111   return 0;
This is also ok, the function is supposed to return ret or-ed with the
relevant flags based on the scan position. It is considered error if 0
is returned (without any flag).

regards
sudip
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging: r8712u: Fix kernel warning for improper call of del_timer_sync()

2015-05-25 Thread Sudip Mukherjee
On Mon, May 25, 2015 at 10:07:59PM -0700, Joe Perches wrote:
 On Tue, 2015-05-26 at 10:32 +0530, Sudip Mukherjee wrote:
  On Mon, May 25, 2015 at 09:55:08PM -0700, Joe Perches wrote:
   On Tue, 2015-05-26 at 10:16 +0530, Sudip Mukherjee wrote:
On Mon, May 25, 2015 at 10:37:28AM -0700, Joe Perches wrote:

  But for eudyptula, patches have to properly submitted to lkml and
  maintainers. And today I am here just because of eudyptula. My patches
  and contributions here, everything started with it. :)
 
 As far as I understand, the Eudyptula Challenge list has
 internal mechanisms to nominally review patches before some
 patch is submitted to lkml.
well, yes, sort of. Submitting patch is task 10, and all the previous
tasks will train people on creating patch, sending etc.
 
 The main point is that patches shouldn't be applied without
 being submitted to a more widely read list.
yes, and Eudyptula requires the participant to send patch to maintainer,
lkml and relevant mailing list where outreachy specifies not to send to
lkml. Next outreachy will start from September.

regards
sudip
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging: r8712u: Fix kernel warning for improper call of del_timer_sync()

2015-05-25 Thread Sudip Mukherjee
On Mon, May 25, 2015 at 10:37:28AM -0700, Joe Perches wrote:
 It'd be better if the approved patches from the intern list
 (no idea what that is) were sent to lkml/devel@driverdev lists
 for review before actually being applied.
Its the outreachy program. And http://kernelnewbies.org/OutreachyApply
mentions specifically: email your first patch to the outreachy-kernel
mailing list. Do not send patches to the main Linux mailing lists

regards
sudip
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging: r8712u: Fix kernel warning for improper call of del_timer_sync()

2015-05-25 Thread Sudip Mukherjee
On Mon, May 25, 2015 at 09:55:08PM -0700, Joe Perches wrote:
 On Tue, 2015-05-26 at 10:16 +0530, Sudip Mukherjee wrote:
  On Mon, May 25, 2015 at 10:37:28AM -0700, Joe Perches wrote:
   It'd be better if the approved patches from the intern list
   (no idea what that is) were sent to lkml/devel@driverdev lists
   for review before actually being applied.
  Its the outreachy program. And http://kernelnewbies.org/OutreachyApply
  mentions specifically: email your first patch to the outreachy-kernel
  mailing list. Do not send patches to the tmain Linux mailing lists
 
 The same thing happens with the eudyptula patches.
But for eudyptula, patches have to properly submitted to lkml and
maintainers. And today I am here just because of eudyptula. My patches
and contributions here, everything started with it. :)

regards
sudip
 
 
 
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging: r8712u: Fix kernel warning for improper call of del_timer_sync()

2015-05-24 Thread Sudip Mukherjee
I haven't been using kernel v4.1 so I haven't seen this warning, but looking
at the code it seems to originate from the two recent patches to remove
_cancel_timer and _cancel_timer_ex. I see that there's another patch in lkml 
[1]
that changes del_timer_sync back to del_timer in more places. Perhaps it
could prevent other warnings like this in the future.

_cancel_timer and _cancel_timer_ex both were internally using del_timer,
and the issue was reported in bugzilla. I have given the reference of the
bugzilla in my patch in lkml.
I have changed the reference of del_timer_sync to del_timer in all places
which were in interrupt context, in some places it was not removed as
those were not in interrupt context.

regards
sudip
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html