Re: linux-next: Tree for Jun 20

2016-06-20 Thread Sudip Mukherjee

On Monday 20 June 2016 07:05 AM, Stephen Rothwell wrote:

Hi all,

Changes since 20160617:


I just started trying gcc 6.1.0 for mips and mips allmodconfig is 
failing with the error:


{standard input}: Assembler messages:
{standard input}:147: Error: number (0x90008000) larger than 32 bits

{standard input}:176: Error: number (0x90008000) larger than 32 bits

{standard input}:198: Error: number (0x90008000) larger than 32 bits

make[3]: *** [arch/mips/mm/sc-ip22.o] Error 1
make[3]: *** Waiting for unfinished jobs
make[2]: *** [arch/mips/mm] Error 2
make[2]: *** Waiting for unfinished jobs
make[1]: *** [arch/mips] Error 2
make[1]: *** Waiting for unfinished jobs

build log can be seen at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/138824794

regards
sudip


Re: linux-next: Tree for Jun 21

2016-06-21 Thread Sudip Mukherjee

On Tuesday 21 June 2016 06:46 AM, Stephen Rothwell wrote:

Hi all,

Changes since 20160620:


tilepro defconfig is failing while doing "make prepare" and bisect shows 
the first bad commit as:


1af5de9af138 ("locking/atomic, arch/tile: Implement 
atomic{,64}_fetch_{add,sub,and,or,xor}()")


You can find today's build log at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/139112570

Please do let me know if i can help in any way to debug/solve this.

regards
sudip


Re: ERROR: "bad_dma_ops" [sound/core/snd-pcm.ko] undefined!

2016-06-21 Thread Sudip Mukherjee

On Sunday 19 June 2016 05:15 AM, kbuild test robot wrote:

Hi,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   c141afd1a28793c08c88325aa64b773be6f79ccf
commit: 420520766a796d3607639ba1e4fb1aadeadd [media] media: Kconfig: add 
dependency of HAS_DMA
date:   5 months ago
config: m32r-allmodconfig (attached as .config)
compiler: m32r-linux-gcc (GCC) 4.9.0


You are using 4.9.0 ? If you want you can get 5.3.0 from: 
http://chat.vectorindia.net/crosstool/x86_64/5.3.0/m32r-linux.tar.xz




reproduce:
 wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
 chmod +x ~/bin/make.cross
 git checkout 420520766a796d3607639ba1e4fb1aadeadd
 # save the attached .config to linux build tree
 make.cross ARCH=m32r

All errors (new ones prefixed by >>):


These are not new errors, old errors which now appears because the 
previous error was solved.




ERROR: "bad_dma_ops" [sound/soc/qcom/snd-soc-lpass-platform.ko] undefined!
ERROR: "dma_common_mmap" [sound/soc/qcom/snd-soc-lpass-platform.ko] 
undefined!
ERROR: "bad_dma_ops" [sound/soc/kirkwood/snd-soc-kirkwood.ko] undefined!
ERROR: "bad_dma_ops" [sound/soc/fsl/snd-soc-fsl-asrc.ko] undefined!
ERROR: "bad_dma_ops" [sound/soc/atmel/snd-soc-atmel-pcm-pdc.ko] undefined!

ERROR: "bad_dma_ops" [sound/core/snd-pcm.ko] undefined!
ERROR: "dma_common_mmap" [sound/core/snd-pcm.ko] undefined!


These are still there and I need to do something about them.


ERROR: "__ucmpdi2" [lib/842/842_decompress.ko] undefined!
ERROR: "__ucmpdi2" [fs/btrfs/btrfs.ko] undefined!


Patch for these is submitted and should be in Andrew's tree now. But i 
dont see them in linux-next. I think I will ping Andrew asking him.



ERROR: "bad_dma_ops" [drivers/usb/host/xhci-plat-hcd.ko] undefined!



ERROR: "dma_pool_create" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined!
ERROR: "smp_flush_cache_all" [drivers/misc/lkdtm.ko] undefined!

ERROR: "__ucmpdi2" [drivers/media/i2c/adv7842.ko] undefined!
ERROR: "__ucmpdi2" [drivers/md/bcache/bcache.ko] undefined!
ERROR: "__ucmpdi2" [drivers/iio/imu/inv_mpu6050/inv-mpu6050.ko] undefined!


same reply as above.


ERROR: "bad_dma_ops" [drivers/hwtracing/intel_th/intel_th_msu.ko] undefined!
ERROR: "bad_dma_ops" [drivers/hwtracing/intel_th/intel_th.ko] undefined!

ERROR: "bad_dma_ops" [drivers/fpga/zynq-fpga.ko] undefined!


iirc, it is fixed now.

regards
sudip


Re: linux-next: Tree for Jun 21

2016-06-21 Thread Sudip Mukherjee
On Tue, Jun 21, 2016 at 09:58:28AM +0200, Peter Zijlstra wrote:
> On Tue, Jun 21, 2016 at 08:01:36AM +0100, Sudip Mukherjee wrote:
> 
> > tilepro defconfig is failing while doing "make prepare" and bisect shows the
> > first bad commit as:
> > 
> > 1af5de9af138 ("locking/atomic, arch/tile: Implement
> > atomic{,64}_fetch_{add,sub,and,or,xor}()")
> > 
> > You can find today's build log at:
> > https://travis-ci.org/sudipm-mukherjee/parport/jobs/139112570
> > 
> > Please do let me know if i can help in any way to debug/solve this.
> 
> I cannot reproduce, I tried both tip/master (which carries the patch you
> fingered) and next/master.

Thats strange.
The log I gave is for next-20160621.
BTW, I am using gcc-5.3.0

regards
sudip


Re: linux-next: Tree for Jun 21

2016-06-21 Thread Sudip Mukherjee
On Tue, Jun 21, 2016 at 04:14:35PM +0200, Peter Zijlstra wrote:
> On Tue, Jun 21, 2016 at 04:04:08PM +0200, Peter Zijlstra wrote:
> > > I'm not sure who builds the toolchains, but tilepro is in upstream 
> > > gcc/binutils/etc
> > > so should be easy enough to include.  There's also a cross-toolchain for 
> > > x64 I put
> > > up a while ago [1] that you could grab if you wanted to try it.
> > 
> > I usually build my own set -- and just did. But tilepro was not
> > included. Lemme go do so.
> 
> binutils-2_26-branch builds for tilepro-linux
> gcc-6-branch does _not_ build for tilepro-linux

I have not tried with binutils-2_26. But if you want my compiler, its at
http://chat.vectorindia.net/crosstool/x86_64/5.3.0/tilepro-linux-gnu.tar.xz

regards
sudip


[PATCH] Input: joystick - enable interrupts

2016-08-31 Thread Sudip Mukherjee
The irq was disabled before reading from the gameport. After reading
we should enable it. Instead we were restoring it back to the previous
state before starting the do-while loop.

Signed-off-by: Sudip Mukherjee 
---
 drivers/input/joystick/analog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 3d8ff09..faa90bc 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -275,7 +275,7 @@ static int analog_cooked_read(struct analog_port *port)
local_irq_disable();
this = gameport_read(gameport) & port->mask;
now = get_time();
-   local_irq_restore(flags);
+   local_irq_enable();
 
if ((last ^ this) && (delta(loop, now) < loopout)) {
data[i] = last ^ this;
-- 
1.9.1



[PATCH] video: fbdev: intelfb: remove impossible condition

2016-08-31 Thread Sudip Mukherjee
xoffset and yoffset of struct fb_var_screeninfo are unsigned and so
they can never be less than 0.

Signed-off-by: Sudip Mukherjee 
---
 drivers/video/fbdev/intelfb/intelfbdrv.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/video/fbdev/intelfb/intelfbdrv.c 
b/drivers/video/fbdev/intelfb/intelfbdrv.c
index bf20744..ff2a5d2 100644
--- a/drivers/video/fbdev/intelfb/intelfbdrv.c
+++ b/drivers/video/fbdev/intelfb/intelfbdrv.c
@@ -1301,11 +1301,6 @@ static int intelfb_check_var(struct fb_var_screeninfo 
*var,
break;
}
 
-   if (v.xoffset < 0)
-   v.xoffset = 0;
-   if (v.yoffset < 0)
-   v.yoffset = 0;
-
if (v.xoffset > v.xres_virtual - v.xres)
v.xoffset = v.xres_virtual - v.xres;
if (v.yoffset > v.yres_virtual - v.yres)
-- 
1.9.1



[PATCH] HID: usbkbd: return proper error code

2016-08-31 Thread Sudip Mukherjee
Use proper error code instead of using -1 on failure to allocate
memory. We may use the error code later in the caller.

Signed-off-by: Sudip Mukherjee 
---
 drivers/hid/usbhid/usbkbd.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index 9a332e6..ee53359 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -249,15 +249,15 @@ static void usb_kbd_close(struct input_dev *dev)
 static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
 {
if (!(kbd->irq = usb_alloc_urb(0, GFP_KERNEL)))
-   return -1;
+   return -ENOMEM;
if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL)))
-   return -1;
+   return -ENOMEM;
if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
-   return -1;
+   return -ENOMEM;
if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL)))
-   return -1;
+   return -ENOMEM;
if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, 
&kbd->leds_dma)))
-   return -1;
+   return -ENOMEM;
 
return 0;
 }
-- 
1.9.1



[PATCH] MAINTAINERS: modify status of intelfb as orphan

2016-08-31 Thread Sudip Mukherjee
The email of Maik Broemme is not working. gmail replied:

Delivery to the following recipient failed permanently:
mbroe...@plusserver.de

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server
for the recipient domain plusserver.de by mx1.plusserver.com.
[62.138.233.182].

The error that the other server returned was:
550 5.1.1 : Recipient address rejected:
User unknown in relay recipient table

I have tried to find other commits by Maik Broemme to find his latest
email but the last patch from him was in 2010.
55a23c4af83d ("intelfb: new maintainer")

Signed-off-by: Sudip Mukherjee 
---

I think I have the hardware. Will test tomorrow.

 MAINTAINERS | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index d8e81b1..72280d5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6148,9 +6148,8 @@ S:Supported
 F: drivers/cpufreq/intel_pstate.c
 
 INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
-M: Maik Broemme 
 L: linux-fb...@vger.kernel.org
-S: Maintained
+S: Orphan
 F: Documentation/fb/intelfb.txt
 F: drivers/video/fbdev/intelfb/
 
-- 
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 
---

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



Re: [PATCH] HID: usbkbd: return proper error code

2016-08-31 Thread Sudip Mukherjee

On Wednesday 31 August 2016 10:03 PM, Fabio Estevam wrote:

On Wed, Aug 31, 2016 at 1:28 PM, Sudip Mukherjee
 wrote:

Use proper error code instead of using -1 on failure to allocate
memory. We may use the error code later in the caller.

Signed-off-by: Sudip Mukherjee 
---
  drivers/hid/usbhid/usbkbd.c | 10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index 9a332e6..ee53359 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -249,15 +249,15 @@ static void usb_kbd_close(struct input_dev *dev)
  static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
  {
 if (!(kbd->irq = usb_alloc_urb(0, GFP_KERNEL)))
-   return -1;
+   return -ENOMEM;


While you are it, the code would look better like this:

kbd->irq = usb_alloc_urb(0, GFP_KERNEL)
if (!kbd->irq)
 return -ENOMEM;



Yes, it will. But that will become two changes in one patch. I will send 
a series with this sent patch and another patch to reorder the assignment.


regards
sudip


Re: [ppdev] 8b7d3a9d90: WARNING: CPU: 0 PID: 153 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x62/0x80

2016-09-01 Thread Sudip Mukherjee

On Thursday 01 September 2016 02:35 AM, kernel test robot wrote:


FYI, we noticed the following commit:

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 
char-misc-testing
commit 8b7d3a9d903ee1d1f5febc8e74223e4e72720e35 ("ppdev: use new parport device 
model")

in testcase: boot

on test machine: qemu-system-x86_64 -enable-kvm -cpu host -smp 2 -m 4G

caused below changes:


Hi,
I am not able to reproduce it on my qemu using the config you sent. I 
have also attached my dmesg. Can you please let me know the exact steps 
to reproduce the error..


regards
sudip


dmesg.xz
Description: application/xz


Re: [PATCH] HID: usbkbd: return proper error code

2016-09-01 Thread Sudip Mukherjee

On Thursday 01 September 2016 04:51 PM, Jiri Kosina wrote:

On Wed, 31 Aug 2016, Sudip Mukherjee wrote:


Use proper error code instead of using -1 on failure to allocate
memory. We may use the error code later in the caller.


But we don't. usb_kbd_probe() returns -ENOMEM in case usb_kbd_alloc_mem()
fails anyway, so I fail to see the point of the change really.



Well, yes, we don't as of now.
When I was reading the code for something related to my day job I was a 
bit confused with -1 instead of a proper error code. I am sure there 
will be many others like me.

Its fine if you think the change is not needed.

regards
sudip


[PATCH 1/2] staging: ks7010: return on failure

2016-08-23 Thread Sudip Mukherjee
On failure we were jumping to error_out0 where we were trying
sdio_release_host() but at this point of execution we still have not
done sdio_claim_host() and as a result host->claimed can still be 0.
And if host->claimed is 0 then WARN_ON(!host->claimed) will give
a warning.
Moreover, if it is still not claimed then mmc_host->claim_cnt will be 0
and mmc_release_host() will do "if (--host->claim_cnt)" and thus the
condition will become true.
Lets just return the value on allocation failure instead of trying to
release the host before claiming it.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/ks7010/ks7010_sdio.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 47b69cb..7bcf1ea 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -776,10 +776,8 @@ static int ks7010_upload_firmware(struct ks_wlan_private 
*priv,
 
/* buffer allocate */
rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
-   if (!rom_buf) {
-   rc = 3;
-   goto error_out0;
-   }
+   if (!rom_buf)
+   return 3;
 
sdio_claim_host(card->func);
 
-- 
1.9.1



[PATCH 2/2] staging: ks7010: fix memory leak

2016-08-23 Thread Sudip Mukherjee
If the firmware request failed we were just returning but we missed
freeing the memory and releasing the MMC Host.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/ks7010/ks7010_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 7bcf1ea..86cdebe 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -791,7 +791,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private 
*priv,
 
retval = request_firmware(&fw_entry, ROM_FILE, 
&priv->ks_wlan_hw.sdio_card->func->dev);
if (retval)
-   return retval;
+   goto error_out0;
 
length = fw_entry->size;
 
-- 
1.9.1



Re: [PATCH] staging: android: ion: ion.c fix parenthesis alignment

2016-08-24 Thread Sudip Mukherjee
On Wed, Aug 24, 2016 at 03:56:32AM +0700, Didik Setiawan wrote:
> Fix checkpatch.pl warning about "Alignment should match open parenthesis".
> ---

you missed the Signed-off-by: line.

regards
sudip


Re: next-20160804: Build error when building xtensa images

2016-08-24 Thread Sudip Mukherjee

On Thursday 04 August 2016 06:55 PM, Max Filippov wrote:

Hi Guenter,

On Thu, Aug 4, 2016 at 9:30 AM, Guenter Roeck  wrote:

Hi Max,

I see the following build errors when building xtensa images in
next-20160804.

Error log:
arch/xtensa/kernel/built-in.o: In function `fast_alloca':
(.text+0x99a): dangerous relocation: j: cannot encode: _WindowUnderflow12
arch/xtensa/kernel/built-in.o: In function `fast_alloca':
(.text+0x99d): dangerous relocation: j: cannot encode: _WindowUnderflow8
arch/xtensa/kernel/built-in.o: In function `fast_alloca':
(.text+0x9a0): dangerous relocation: j: cannot encode: _WindowUnderflow4
arch/xtensa/kernel/built-in.o: In function
`window_overflow_restore_a0_fixup':
(.text+0x23a3): dangerous relocation: j: cannot encode:
(.DoubleExceptionVector.text+0x104)
arch/xtensa/kernel/built-in.o: In function
`window_overflow_restore_a0_fixup':
(.text+0x23c1): dangerous relocation: j: cannot encode:
(.DoubleExceptionVector.text+0x104)
arch/xtensa/kernel/built-in.o: In function
`window_overflow_restore_a0_fixup':
(.text+0x23dd): dangerous relocation: j: cannot encode:
(.DoubleExceptionVector.text+0x104)

This affects all images I am testing.

Bisect points to 'xtensa: cleanup MMU setup and kernel layout macros'.


Thanks for the report. The default kernel load address in this patch
was wrong. Fix posted.


xtensa builds still fails with that same error.
Did the fix make its way to linux-next?

xtensa defconfig for next-20160824 is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/154646688

regards
sudip



Re: [PATCH] staging: rts5208: rtsx.c: Fix checkpatch warnings.

2016-08-25 Thread Sudip Mukherjee
On Thu, Aug 25, 2016 at 09:59:46PM +0800, Ming-Chia Chung wrote:
> On Tue, Aug 23, 2016 at 12:01:36PM +0530, Sudip Mukherjee wrote:
> > On Tue, Aug 23, 2016 at 08:19:46AM +0800, Ming-Chia Chung wrote:
> > > On Mon, Aug 22, 2016 at 10:51:27PM +0530, Sudip Mukherjee wrote:
> > > > On Tue, Aug 23, 2016 at 12:54:17AM +0800, MingChia Chung wrote:
> > > > >   This patch fixes a minor checkpatch warnings:
> > > > > 
> > > > >   "WARNING: Block comments use a trailing */ on a separate line"
> > > > > 
> > > > >   Signed-off-by: Ming-Chia Chung 
> > > > > ---
> > > > >  drivers/staging/rts5208/rtsx.c | 42 
> > > > > --
> > > > >  1 file changed, 28 insertions(+), 14 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/staging/rts5208/rtsx.c 
> > > > > b/drivers/staging/rts5208/rtsx.c
> > > > > index e992e03..a880411 100644
> > > > > --- a/drivers/staging/rts5208/rtsx.c
> > > > > +++ b/drivers/staging/rts5208/rtsx.c
> > > > > @@ -81,14 +81,16 @@ static int slave_alloc(struct scsi_device *sdev)
> > > > >  
> > > > >  static int slave_configure(struct scsi_device *sdev)
> > > > >  {
> > > > > - /* Scatter-gather buffers (all but the last) must have a length
> > > > > + /*
> > > > > +   * Scatter-gather buffers (all but the last) must have a length
> > > > 
> > > > The alignment doesnot look correct here. Also in some more places later
> > > > in this patch.
> > > > 
> > > > regards
> > > > Sudip
> > > 
> > > I sent this patch by following docs ([1] and [2]). The style for long
> > > comments needs the begining and ending almost-blank lines. There is no
> > > the begining almost-blank line only for the files in net/ and
> > > drivers/net/.
> > > Please let me know what I misunderstood.
> > 
> > After applying the patch the file was like:
> > /*
> >* Scatter-gather buffers (all but the last) must have a length
> >  * divisible by the bulk maxpacket size.  Otherwise a data packet
> >  * would end up being short, causing a premature end to the data
> >  * transfer.  Since high-speed bulk pipes have a maxpacket size
> > 
> > See the alignment of the second line. Please use tab instead of space. And 
> > also
> > checkpatch should have warned you not to use space before the Signed-off-by.
> > 
> 
> Thank you for detailed explanation. I enabled "expandtab" in vim so that
> I didn't realize the alignment is wrong. Now, I install 'linuxsty.vim'
> to view the code. But checkpatch.pl didn't show the warning of space.
> Here is my command:
> `kernels/staging$ perl scripts/checkpatch.pl -f 
> drivers/staging/rts5208/rtsx.c`

Please run checkpatch on your patch and it will show you the warning
about space before Signed-off-by. But it missed the place where space
was used inplace of tab. Maybe you can send a patch to fix checkpatch.

Added Cc: to Joe and Andy.

regards
sudip


[PATCH] matroxfb: fix size of memcpy

2016-08-25 Thread Sudip Mukherjee
hw->DACreg has a size of 80 bytes and MGADACbpp32 has 21. So when
memcpy copies MGADACbpp32 to hw->DACreg it copies 80 bytes but
only 21 bytes are valid.

Signed-off-by: Sudip Mukherjee 
---
 drivers/video/fbdev/matrox/matroxfb_Ti3026.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c 
b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
index 195ad7c..68fa037 100644
--- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
+++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c
@@ -372,7 +372,7 @@ static int Ti3026_init(struct matrox_fb_info *minfo, struct 
my_timming *m)
 
DBG(__func__)
 
-   memcpy(hw->DACreg, MGADACbpp32, sizeof(hw->DACreg));
+   memcpy(hw->DACreg, MGADACbpp32, sizeof(MGADACbpp32));
switch (minfo->fbcon.var.bits_per_pixel) {
case 4: hw->DACreg[POS3026_XLATCHCTRL] = 
TVP3026_XLATCHCTRL_16_1;   /* or _8_1, they are same */
hw->DACreg[POS3026_XTRUECOLORCTRL] = 
TVP3026_XTRUECOLORCTRL_PSEUDOCOLOR;
-- 
1.9.1



Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-20 Thread Sudip Mukherjee
On Mon, Jun 19, 2017 at 11:47:20PM +0300, Andy Shevchenko wrote:
> On Mon, Jun 19, 2017 at 11:32 PM, Sudip Mukherjee
>  wrote:
> 
> 
> > +#ifdef CONFIG_X86
> > +   primary = pdev->resource[PCI_ROM_RESOURCE].flags &
> > +   IORESOURCE_ROM_SHADOW;
> > +#endif
> 
> Why do we need #ifdef?

It has been done in exactly the same way it is done in drm drivers.
All the drm drivers I have checked uses #ifdef.

See for example:
http://elixir.free-electrons.com/linux/v4.12-rc6/source/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c#L470

If you think #ifdef is not required, please send patch for the drm
drivers, and we follow that change here also.

> 
> In any case you may introduce a temporary variable to have pointer to resource
> 
> struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];

No, we will not want to do it in a different way than the way it is done
by drm drivers.

--
Regards
Sudip


Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-20 Thread Sudip Mukherjee
Hi Dan,

On Tue, Jun 20, 2017 at 11:20:55PM +0300, Dan Carpenter wrote:
> That's totally bogus.  Just say you don't know.  It's never a
> reguirement that people fix AMD drivers before they can review code...

Yes, I don't know how drm drivers work, so I blindly follow what has
been done there. And since sm750 ultimately has to be converted to a drm
driver to be taken out of staging, so I will prefer to have similar
changes here.

--
Regards
Sudip


Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-20 Thread Sudip Mukherjee
On Tue, Jun 20, 2017 at 11:40:59PM +0300, Andy Shevchenko wrote:
> On Tue, Jun 20, 2017 at 11:20 PM, Dan Carpenter
>  wrote:
> > That's totally bogus.  Just say you don't know.  It's never a
> > reguirement that people fix AMD drivers before they can review code...
> 
> Agree. It's not a cargo cult.
> If there any real thing behind that #ifdef  I would like to hear.

I dont know the real thing behind that. You can hear the real thing if
you send that patch to drm. And that is the only reason I mentioned that.

--
Regards
Sudip


Re: [PATCH] sm501fb: Silence a coccinelle script warning.

2017-06-20 Thread Sudip Mukherjee
Hi Bartlomiej,

On Wed, Jun 14, 2017 at 12:54:58PM +0200, Bartlomiej Zolnierkiewicz wrote:
> 
> Hi,
> 
> On Monday, May 08, 2017 08:11:16 AM Christophe JAILLET wrote:
> > According to surrounding goto, it is likely that 'goto err_probed_panel' is
> > expected here.
> > This change is just done in order to silence some coccinelle scripts
> > which try to detect wrongly ordered goto.
> > 
> > If 'info->fb[HEAD_PANEL]' and' 'info->fb[HEAD_CRT]' are both NULL, this
> > means that no 'framebuffer_alloc' has been performed, so 'goto err_alloc'
> > looks fine.
> > Anyway, it is also harmless in this case to call 'framebuffer_release'.
> > The code looks more straight forward.
> > 
> > Signed-off-by: Christophe JAILLET 
> 
> It seems that the code for supporting only selected framebuffers
> (only HEAD_PANEL fb or only HEAD_CRT fb) is broken anyway as at least
> the suspend/resume support assumes that both framebuffers are always
> present. Also all sm501fb driver users always try try to initialize
> both framebuffers. Therefore I would prefer the removal of non-working
> individual framebuffers support (the code that your patch modifies
> would be removed as well). Could you please look into it?

Looks like it will be easier to fix the suspend/resume functions and
the part of probe which creates the device files for both.
Let me have a look and I will try to send you a patch over the weekend.


--
Regards
Sudip


Re: [PATCH] parisc: parport_gsc: constify parisc_device_id

2017-10-14 Thread Sudip Mukherjee
On Sat, Aug 19, 2017 at 10:38:41PM +0530, Arvind Yadav wrote:
> parisc_device_id are not supposed to change at runtime. All functions
> working with parisc_device_id provided by  work
> with
> const parisc_device_id. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav 
> ---
>  drivers/parport/parport_gsc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This has already been done by f0973443bef7 ("parisc/parport_gsc: Fix section 
mismatches")

--
Regards
Sudip


[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 
---

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(&bc->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(&par_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, &par_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(&baycom_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(&baycom_par_driver);
return -ENXIO;
+   }
return 0;
 }
 
@@ -539,6 +578,7 @@ static void __exit cleanup_baycompar(void)
if (dev)
hdlcdrv_unregister(dev);
}
+   parport_unregister_driver(&baycom_par_driver);
 }
 
 module_init(init_baycompar);
-- 
1.9.1



[PATCH] parport: make parport_ip32_ops const and __initconst

2017-10-15 Thread Sudip Mukherjee
From: Bhumika Goyal 

Make this const as it is only used during a copy operation. This usage
is inside init function and the structure is not referenced after
initialisation, so make it __initconst too.

Signed-off-by: Bhumika Goyal 
Signed-off-by: Sudip Mukherjee 
---
 drivers/parport/parport_ip32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c
index 0186db7..6287307 100644
--- a/drivers/parport/parport_ip32.c
+++ b/drivers/parport/parport_ip32.c
@@ -1769,7 +1769,7 @@ static size_t parport_ip32_ecp_write_data(struct parport 
*p,
 
 /*--- Default parport operations ---*/
 
-static __initdata struct parport_operations parport_ip32_ops = {
+static const struct parport_operations parport_ip32_ops __initconst = {
.write_data = parport_ip32_write_data,
.read_data  = parport_ip32_read_data,
 
-- 
1.9.1



[PATCH] xtensa: fix build failure

2017-11-11 Thread Sudip Mukherjee
The build of xtensa allmodconfig was failing with the error:
arch/xtensa/platforms/iss/simdisk.c:
In function 'simdisk_make_request':
arch/xtensa/platforms/iss/simdisk.c:120:2:
error: expected ';' before '}' token

A terminating ';' was missing.

Fixes: 77f55f3809d4 ("block: remove __bio_kmap_atomic")
Signed-off-by: Sudip Mukherjee 
---

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

 arch/xtensa/platforms/iss/simdisk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/xtensa/platforms/iss/simdisk.c 
b/arch/xtensa/platforms/iss/simdisk.c
index eacf1e4..1b64184 100644
--- a/arch/xtensa/platforms/iss/simdisk.c
+++ b/arch/xtensa/platforms/iss/simdisk.c
@@ -116,7 +116,7 @@ static blk_qc_t simdisk_make_request(struct request_queue 
*q, struct bio *bio)
simdisk_transfer(dev, sector, len, buffer,
bio_data_dir(bio) == WRITE);
sector += len;
-   kunmap_atomic(buffer)
+   kunmap_atomic(buffer);
}
 
bio_endio(bio);
-- 
1.9.1



[PATCH 1/3] sm501fb: deallocate colormap only if allocated

2017-11-04 Thread Sudip Mukherjee
There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device deallocate the colormap only if that particular fb is defined.

Signed-off-by: Sudip Mukherjee 
---
 drivers/video/fbdev/sm501fb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 076dd27..381475f 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1889,6 +1889,9 @@ static void sm501_free_init_fb(struct sm501fb_info *info,
 {
struct fb_info *fbi = info->fb[head];
 
+   if (!fbi)
+   return;
+
fb_dealloc_cmap(&fbi->cmap);
 }
 
-- 
2.1.4



[PATCH 3/3] sm501fb: suspend and resume fb if it exists

2017-11-04 Thread Sudip Mukherjee
There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, suspend or resume it
only if it is defined.

Signed-off-by: Sudip Mukherjee 
---
 drivers/video/fbdev/sm501fb.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 577a483..49233c1 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2101,6 +2101,9 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info,
struct fb_info *fbi = info->fb[head];
struct sm501fb_par *par = fbi->par;
 
+   if (!fbi)
+   return 0;
+
if (par->screen.size == 0)
return 0;
 
@@ -2148,6 +2151,9 @@ static void sm501fb_resume_fb(struct sm501fb_info *info,
struct fb_info *fbi = info->fb[head];
struct sm501fb_par *par = fbi->par;
 
+   if (!fbi)
+   return;
+
if (par->screen.size == 0)
return;
 
-- 
2.1.4



[PATCH 2/3] sm501fb: unregister framebuffer only if registered

2017-11-04 Thread Sudip Mukherjee
There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device, unregister the framebuffer only if it was registered.

Signed-off-by: Sudip Mukherjee 
---
 drivers/video/fbdev/sm501fb.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 381475f..577a483 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2079,8 +2079,10 @@ static int sm501fb_remove(struct platform_device *pdev)
sm501_free_init_fb(info, HEAD_CRT);
sm501_free_init_fb(info, HEAD_PANEL);
 
-   unregister_framebuffer(fbinfo_crt);
-   unregister_framebuffer(fbinfo_pnl);
+   if (fbinfo_crt)
+   unregister_framebuffer(fbinfo_crt);
+   if (fbinfo_pnl)
+   unregister_framebuffer(fbinfo_pnl);
 
sm501fb_stop(info);
kfree(info);
-- 
2.1.4



Re: [PATCH 0/3] drivers/misc/sgi-gru: unapplied patches and a new one

2015-10-05 Thread Sudip Mukherjee
On Thu, Sep 24, 2015 at 12:31:01PM +0530, Sudip Mukherjee wrote:
> On Wed, Sep 23, 2015 at 12:48:25PM -0500, Dimitri Sivanich wrote:
> > Sudip,
> > 
> > I can take a look at the Jack Steiner patches.  Was there anything in the 
> > set
> > of 3 patches that you sent that still needs a review?
> Yes. The 3/3 patch please. That one is new. I found that problem while
> checking another old patch.
> If Jack Steiner patches looks ok then you can send the series to Greg or
> if you want me to send please do let me know.

Hi Dimitri,
Greg has picked up this series. Did you have a chance to look at the
series of Jack Steiner or shall i repost for your review?

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


Re: [PATCH v2 1/3] Input: db9 - store object at correct index

2015-10-05 Thread Sudip Mukherjee
On Mon, Oct 05, 2015 at 05:32:05PM -0700, Dmitry Torokhov wrote:
> On Sat, Oct 03, 2015 at 02:54:56PM +0530, Sudip Mukherjee wrote:
> > The variable i is used to check the port to attach to and we are
> > supposed to save the reference of struct db9 in the location given by
> > db9_base[i]. But after finding out the index, i is getting modified again
> > so we saved in a wrong index.
> > While at it mark db9_base[i] as NULL after it is freed.
> > 
> > Fixes: 2260c419b52b ("Input: db9 - use parallel port device model")
> > Signed-off-by: Sudip Mukherjee 
> 
> Applied the lot, thank you.

Thanks. And the change for serio/parkbd was pending. You said it was
clashing with other changs.  Do i need to rebase and send you?

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


Re: Build regressions/improvements in v4.3-rc4

2015-10-05 Thread Sudip Mukherjee
On Mon, Oct 05, 2015 at 12:38:55PM +0200, Geert Uytterhoeven wrote:
> Below is the list of build error/warning regressions/improvements in
> v4.3-rc4[1] compared to v4.2[2].
> 

> 8 improvements:
>   - /home/kisskb/slave/src/drivers/net/ethernet/via/via-rhine.c: error: 
> implicit declaration of function 'pci_iomap' 
> [-Werror=implicit-function-declaration]: 1098:2 => 
>   - /home/kisskb/slave/src/drivers/net/ethernet/via/via-rhine.c: error: 
> implicit declaration of function 'pci_iounmap' 
> [-Werror=implicit-function-declaration]: 1119:2 => 

I saw this message with avr32 allmodconfig. Fix already in linux-next.

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


[PATCH] pwm: bcm7038: fix build failure

2015-10-06 Thread Sudip Mukherjee
While building arm allmodconfig, the build fails with:
In function 'brcmstb_pwm_suspend': error: 'dev' undeclared (first use in this 
function)
In function 'brcmstb_pwm_resume': error: 'dev' undeclared (first use in this 
function)

The function was using dev but the argument that it received was named
as "d". Declare dev and fix the build fail.

Fixes: 9a47354fe63a ("pwm: Add Broadcom BCM7038 PWM controller support")
Signed-off-by: Sudip Mukherjee 
---
 drivers/pwm/pwm-brcmstb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-brcmstb.c b/drivers/pwm/pwm-brcmstb.c
index 083e3ef..423ce08 100644
--- a/drivers/pwm/pwm-brcmstb.c
+++ b/drivers/pwm/pwm-brcmstb.c
@@ -304,7 +304,7 @@ static int brcmstb_pwm_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM_SLEEP
-static int brcmstb_pwm_suspend(struct device *d)
+static int brcmstb_pwm_suspend(struct device *dev)
 {
struct brcmstb_pwm *p = dev_get_drvdata(dev);
 
@@ -313,7 +313,7 @@ static int brcmstb_pwm_suspend(struct device *d)
return 0;
 }
 
-static int brcmstb_pwm_resume(struct device *d)
+static int brcmstb_pwm_resume(struct device *dev)
 {
struct brcmstb_pwm *p = dev_get_drvdata(dev);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] gpio: make GPIO_OMAP bool instead of tristate

2015-10-06 Thread Sudip Mukherjee
While building arm allmodconfig the build fails with the error:
ERROR: "handle_bad_irq" [drivers/gpio/gpio-omap.ko] undefined!

The build breaks as handle_bad_irq is not exported for module use.

Fixes: 450fa54cfd66 ("gpio: omap: convert to use generic irq handler")
Cc: Tony Lindgren 
Cc: Austin Schuh 
Cc: Grygorii Strashko 
Cc: Santosh Shilimkar 
Signed-off-by: Sudip Mukherjee 
---

Same problem for pinctrl was fixed by
5ba341604a054294aeb812603349bba024d716ee

And for your reference:
https://lkml.org/lkml/2014/2/25/278

 drivers/gpio/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 63000b1..d910fd1 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -330,7 +330,7 @@ config GPIO_OCTEON
  family of SOCs.
 
 config GPIO_OMAP
-   tristate "TI OMAP GPIO support" if ARCH_OMAP2PLUS || COMPILE_TEST
+   bool "TI OMAP GPIO support" if ARCH_OMAP2PLUS || COMPILE_TEST
default y if ARCH_OMAP
depends on ARM
select GENERIC_IRQ_CHIP
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] drm/gma500: fix double freeing

2015-10-06 Thread Sudip Mukherjee
We are allocating backing using psbfb_alloc() and so
backing->stolen is always true. So we were freeing backing two times.
Moreover if we follow the execution path then we should be freeing
backing after we have released the helper. So remove the one which frees
backing before the helper is released.
While at it the error labels are also renamed to give a meaningful
name.

Cc: Patrik Jakobsson 
Signed-off-by: Sudip Mukherjee 
---

Hi Patrik,
If you donot like the labels I will change them according to what you
have suggested.   

 drivers/gpu/drm/gma500/framebuffer.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/gma500/framebuffer.c 
b/drivers/gpu/drm/gma500/framebuffer.c
index 2eaf1b3..52e2bf3 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -411,7 +411,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
info = drm_fb_helper_alloc_fbi(&fbdev->psb_fb_helper);
if (IS_ERR(info)) {
ret = PTR_ERR(info);
-   goto out_err1;
+   goto err_alloc_fbi;
}
info->par = fbdev;
 
@@ -419,7 +419,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
 
ret = psb_framebuffer_init(dev, psbfb, &mode_cmd, backing);
if (ret)
-   goto out_unref;
+   goto err_framebuffer_init;
 
fb = &psbfb->base;
psbfb->fbdev = info;
@@ -465,14 +465,9 @@ static int psbfb_create(struct psb_fbdev *fbdev,
 
mutex_unlock(&dev->struct_mutex);
return 0;
-out_unref:
-   if (backing->stolen)
-   psb_gtt_free_range(dev, backing);
-   else
-   drm_gem_object_unreference(&backing->gem);
-
+err_framebuffer_init:
drm_fb_helper_release_fbi(&fbdev->psb_fb_helper);
-out_err1:
+err_alloc_fbi:
mutex_unlock(&dev->struct_mutex);
psb_gtt_free_range(dev, backing);
return ret;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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 
> > 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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] gpio: make GPIO_OMAP bool instead of tristate

2015-10-07 Thread Sudip Mukherjee
On Tue, Oct 06, 2015 at 03:45:07PM -0500, Grygorii Strashko wrote:
> On 10/06/2015 07:01 AM, Sudip Mukherjee wrote:
> > While building arm allmodconfig the build fails with the error:
> > ERROR: "handle_bad_irq" [drivers/gpio/gpio-omap.ko] undefined!
> > 
> > The build breaks as handle_bad_irq is not exported for module use.
> 
> Not sure if this is right thing to do. We really want it to be a module if 
> needed.
> 
> The handle_bad_irq() was used in this driver to catch the case when Omap
> GPIO IRQ is enabled before calling .irq_set_type()   
> 
> I think there are few option:
> - export handle_bad_irq()
> - pass NULL in gpiochip_irqchip_add() instead of handle_bad_irq()
> - use handle_simple_irq()
> - revert this change
> 
> Thought second one should work. 

I think that should be ok. If you want me to test the patch in my setup
to verify that it fixes the build failure please let me know.

But going through the old thread it looked like plan was on to
export handle_bad_irq() atleast thats what looks like from Linus's
(Linus Walleij) reply in https://lkml.org/lkml/2014/2/25/119

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


[PATCH] PM / OPP: fix build warning

2015-10-07 Thread Sudip Mukherjee
We were getting build warning that:
expected 'bool *' but argument is of type 'u32 *'

debugfs_create_bool() used to take the argument as (u32 *), but commit
621a5f7ad9cd ("debugfs: Pass bool pointer to debugfs_create_bool()")
has modified it and now it accepts bool, so no need to typecast a bool
to (u32 *).

Signed-off-by: Sudip Mukherjee 
---
 drivers/base/power/opp/debugfs.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/base/power/opp/debugfs.c b/drivers/base/power/opp/debugfs.c
index 865cbfa..251966b 100644
--- a/drivers/base/power/opp/debugfs.c
+++ b/drivers/base/power/opp/debugfs.c
@@ -45,14 +45,13 @@ int opp_debug_create_one(struct dev_pm_opp *opp, struct 
device_opp *dev_opp)
if (!d)
return -ENOMEM;
 
-   if (!debugfs_create_bool("available", S_IRUGO, d,
-(u32 *)&opp->available))
+   if (!debugfs_create_bool("available", S_IRUGO, d, &opp->available))
return -ENOMEM;
 
-   if (!debugfs_create_bool("dynamic", S_IRUGO, d, (u32 *)&opp->dynamic))
+   if (!debugfs_create_bool("dynamic", S_IRUGO, d, &opp->dynamic))
return -ENOMEM;
 
-   if (!debugfs_create_bool("turbo", S_IRUGO, d, (u32 *)&opp->turbo))
+   if (!debugfs_create_bool("turbo", S_IRUGO, d, &opp->turbo))
return -ENOMEM;
 
if (!debugfs_create_u32("rate_hz", S_IRUGO, d, (u32 *)&opp->rate))
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] regulator: core: fix build warning

2015-10-07 Thread Sudip Mukherjee
We were getting warning about:
warning: 'regulator_lock_supply' defined but not used
warning: 'regulator_unlock_supply' defined but not used

It appears that there is no user of regulator_lock_supply() and
regulator_unlock_supply().
Commit 9f01cd4a915e ("regulator: core: introduce function to lock
regulators and its supplies") says there will be future users, but as of
now there is no user and is creating build warnings.

Signed-off-by: Sudip Mukherjee 
---
 drivers/regulator/core.c | 39 ---
 1 file changed, 39 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 7896ef5..3ba7131 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -133,45 +133,6 @@ static bool have_full_constraints(void)
 }
 
 /**
- * regulator_lock_supply - lock a regulator and its supplies
- * @rdev: regulator source
- */
-static void regulator_lock_supply(struct regulator_dev *rdev)
-{
-   struct regulator *supply;
-   int i = 0;
-
-   while (1) {
-   mutex_lock_nested(&rdev->mutex, i++);
-   supply = rdev->supply;
-
-   if (!rdev->supply)
-   return;
-
-   rdev = supply->rdev;
-   }
-}
-
-/**
- * regulator_unlock_supply - unlock a regulator and its supplies
- * @rdev: regulator source
- */
-static void regulator_unlock_supply(struct regulator_dev *rdev)
-{
-   struct regulator *supply;
-
-   while (1) {
-   mutex_unlock(&rdev->mutex);
-   supply = rdev->supply;
-
-   if (!rdev->supply)
-   return;
-
-   rdev = supply->rdev;
-   }
-}
-
-/**
  * of_get_regulator - get a regulator device node based on supply name
  * @dev: Device pointer for the consumer (of regulator) device
  * @supply: regulator supply name
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ASoC: rt5645: fix build warning

2015-10-07 Thread Sudip Mukherjee
We were getting build warning about "Section mismatch".
dmi_platform_intel_broadwell is being referenced from the probe function
rt5645_i2c_probe(), but dmi_platform_intel_broadwell was marked with
__initdata.

Signed-off-by: Sudip Mukherjee 
---
 sound/soc/codecs/rt5645.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 4c4fe6b..89ba4ff 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3244,7 +3244,7 @@ static int buddy_quirk_cb(const struct dmi_system_id *id)
return 1;
 }
 
-static struct dmi_system_id dmi_platform_intel_broadwell[] __initdata = {
+static struct dmi_system_id dmi_platform_intel_broadwell[] = {
{
.ident = "Chrome Buddy",
.callback = buddy_quirk_cb,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] mfd: rtsx: fix build warning

2015-10-07 Thread Sudip Mukherjee
We were getting build warning about unused variable 'err'.
The commit a3c29b099829 has removed the use of err but missed removing
the variable which is unused now.

Fixes: a3c29b099829 ("mfd: rtsx: Simplify function return logic")
Signed-off-by: Sudip Mukherjee 
---
 drivers/mfd/rtsx_pcr.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index b98cf1d..d63f3a8 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -561,8 +561,6 @@ EXPORT_SYMBOL_GPL(rtsx_pci_write_ppbuf);
 
 static int rtsx_pci_set_pull_ctl(struct rtsx_pcr *pcr, const u32 *tbl)
 {
-   int err;
-
rtsx_pci_init_cmd(pcr);
 
while (*tbl & 0x) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] mfd: lm3533: fix build warning

2015-10-07 Thread Sudip Mukherjee
We were getting build warning about unused variable 'ret'.
The commit c749db571dcf has removed the use of ret but missed removing
the variable which is unused now.

Fixes: c749db571dcf ("mfd: lm3533: Simplify function return logic")
Signed-off-by: Sudip Mukherjee 
---
 drivers/mfd/lm3533-core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c
index 193ecee1..5abcbb2 100644
--- a/drivers/mfd/lm3533-core.c
+++ b/drivers/mfd/lm3533-core.c
@@ -592,7 +592,6 @@ static int lm3533_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
 {
struct lm3533 *lm3533;
-   int ret;
 
dev_dbg(&i2c->dev, "%s\n", __func__);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] mfd: rtsx: fix build warning

2015-10-07 Thread Sudip Mukherjee
On Wed, Oct 07, 2015 at 08:40:37PM +0800, kbuild test robot wrote:
> Hi Sudip,
> 
> [auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, please 
> ignore]
v4.3-rc4 is not appropriate base. Please use next-20151007 for both.

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


Re: [kbuild-all] [PATCH 2/2] mfd: rtsx: fix build warning

2015-10-07 Thread Sudip Mukherjee
On Wed, Oct 07, 2015 at 09:48:16PM +0800, Fengguang Wu wrote:
> On Wed, Oct 07, 2015 at 06:16:52PM +0530, Sudip Mukherjee wrote:
> > On Wed, Oct 07, 2015 at 08:40:37PM +0800, kbuild test robot wrote:
> > > Hi Sudip,
> > > 
> > > [auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, please 
> > > ignore]
> > v4.3-rc4 is not appropriate base. Please use next-20151007 for both.
> 
> OK. FYI, if you use [PATCH (next|-next|linux-next)] next time,
> the robot will select linux-next/master as the base tree.
Ok. Great. And for staging should it be [PATCH staging-testing] ?

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


Re: [kbuild-all] [PATCH 2/2] mfd: rtsx: fix build warning

2015-10-08 Thread Sudip Mukherjee
On Thu, Oct 08, 2015 at 07:30:22AM +0100, Greg KH wrote:
> On Thu, Oct 08, 2015 at 08:56:38AM +0800, Fengguang Wu wrote:
> > On Wed, Oct 07, 2015 at 09:11:25PM +0530, Sudip Mukherjee wrote:
> > > On Wed, Oct 07, 2015 at 09:48:16PM +0800, Fengguang Wu wrote:
> > > > On Wed, Oct 07, 2015 at 06:16:52PM +0530, Sudip Mukherjee wrote:
> > > > > On Wed, Oct 07, 2015 at 08:40:37PM +0800, kbuild test robot wrote:
> > > > > > Hi Sudip,
> > > > > > 
> > > > > > [auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, 
> > > > > > please ignore]
> > > > > v4.3-rc4 is not appropriate base. Please use next-20151007 for both.
> > > > 
> > > > OK. FYI, if you use [PATCH (next|-next|linux-next)] next time,
> > > > the robot will select linux-next/master as the base tree.
> > > Ok. Great. And for staging should it be [PATCH staging-testing] ?
> > 
> > It looks some patches already use the form [PATCH staging], I wonder
> > which branch Greg typically apply them to, staging-testing or staging-next?
> 
> I start by putting things in staging-testing to "test" them on my
> systems, and yours, and if they survive, I then move them to -next.
> staging-testing can be rebased if there is problems, but -next can not,
> which is why I do this.

HI Fengguang,
I have a question for you. My build system is mostly based on your
make.cross file, which I have modified again to suit my build system in
travis-ci. But for some arch the compilers used by make.cross are really
old and it generated gcc bug while compiling. I faced them for two arch
in recent past. Current one is for cris. I was ablr to find out which
commit was responsible for that build fail but since its old gcc version
no one is interested. How do you handle that? Is there no way to get the
latest compilers to test with?

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


Re: [PATCH] ASoC: rt5645: fix build warning

2015-10-08 Thread Sudip Mukherjee
On Wed, Oct 07, 2015 at 03:05:27PM +0100, Mark Brown wrote:
> On Wed, Oct 07, 2015 at 05:52:12PM +0530, Sudip Mukherjee wrote:
> > We were getting build warning about "Section mismatch".
> > dmi_platform_intel_broadwell is being referenced from the probe function
> > rt5645_i2c_probe(), but dmi_platform_intel_broadwell was marked with
> > __initdata.
> > 
> > Signed-off-by: Sudip Mukherjee 
> 
> > -static struct dmi_system_id dmi_platform_intel_broadwell[] __initdata = {
> > +static struct dmi_system_id dmi_platform_intel_broadwell[] = {
> 
> This doesn't seem like the obvious fix - why are we not annotating the
> probe function suitably (or alternatively if we can't why does
> __initdata still exist)?

probe function should not be __init. probe can be called anytime after
the module has been loaded.
__initdata still exists as that part of the code was added by
e9159e7577cf ("ASoC: rt5645: Add dmi for Broadwell") which is a very
recent modification and I think that has been added by mistake.
One more argument in my favor:
The use in probe function is 
if (dmi_check_system(dmi_platform_intel_braswell) || 
dmi_check_system(dmi_platform_intel_broadwell))

dmi_platform_intel_braswell is not marked as __initdata but
dmi_platform_intel_broadwell is marked but they both have same use at
the same place.

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


Re: [PATCH v2] Input: drivers/joystick: use parallel port device model

2015-08-31 Thread Sudip Mukherjee
On Mon, Aug 17, 2015 at 12:59:34PM +0530, Sudip Mukherjee wrote:
> On Fri, Aug 14, 2015 at 09:05:55AM +0200, Pali Rohár wrote:
> > On Friday 14 August 2015 12:25:42 Sudip Mukherjee wrote:
> > > On Thu, Aug 13, 2015 at 09:26:02AM -0700, Dmitry Torokhov wrote:
> > > > On Thu, Aug 13, 2015 at 07:16:14PM +0530, Sudip Mukherjee wrote:
> > > > > Pali Rohár has the hardware and he is ready to test it.
> > > > 
> > > > Pali, could you give the v2 version of the patch a spin
> > > > (https://patchwork.kernel.org/patch/6940321/)?
> > > Adding Pali to the cc list.
> > > 
> > > Hi Pali,
> > > Are you still away from your desktop with the joystick? or can it be
> > > tested?
> > > 
> > > regards
> > > sudip
> > 
> > Yes, I'm still away from desktop with joystick... First I need to know
> > against which kernel version can be that patch tested? I remember that
> > v1 applied correctly against ubuntu's default 3.13 (which is installed
> > on that desktop) but driver did not compiled.
> 
> Sorry for the delay in replying. The change in parallel port code was
> merged in 4.2, so you can test it againt 4.2-rc*.
Hi Pali,
Now that 4.2 is released you can test on it. And do you also have any
option to test the other joysticks using parallel port? Because, after
you test this patch I will be sending the similar patches for other
joysticks and parkbd.

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


Re: [PATCH v2] Input: drivers/joystick: use parallel port device model

2015-08-31 Thread Sudip Mukherjee
On Mon, Aug 31, 2015 at 03:55:58PM +0200, Pali Rohár wrote:
> > > Sorry for the delay in replying. The change in parallel port code was
> > > merged in 4.2, so you can test it againt 4.2-rc*.
> > Hi Pali,
> > Now that 4.2 is released you can test on it. And do you also have any
> > option to test the other joysticks using parallel port? Because, after
> > you test this patch I will be sending the similar patches for other
> > joysticks and parkbd.
> > 
> > regards
> > sudip
> 
> Hi! First I need to install new 4.2 kernel for testing on that machine.
> It would not be easy...
Will it be easy if I backport the parallel port patch to 3.13? maximum
chance that the parallelport patch will apply on 3.13 but I need to test
first to confirm.

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


[PATCH] ASoC: wm0010: fix memory leak

2015-08-31 Thread Sudip Mukherjee
We were aborting if the kzalloc of img_swap fails but without freeing the
already allocated out. Similarly we were aborting if spi_sync fails
without releasing out and img_swap.

Signed-off-by: Sudip Mukherjee 
---
 sound/soc/codecs/wm0010.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
index f2c6ad4..8434d45 100644
--- a/sound/soc/codecs/wm0010.c
+++ b/sound/soc/codecs/wm0010.c
@@ -672,8 +672,10 @@ static int wm0010_boot(struct snd_soc_codec *codec)
}
 
img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA);
-   if (!img_swap)
+   if (!img_swap) {
+   kfree(out);
goto abort;
+   }
 
/* We need to re-order for 0010 */
byte_swap_64((u64 *)&pll_rec, img_swap, len);
@@ -690,6 +692,8 @@ static int wm0010_boot(struct snd_soc_codec *codec)
ret = spi_sync(spi, &m);
if (ret != 0) {
dev_err(codec->dev, "First PLL write failed: %d\n", 
ret);
+   kfree(img_swap);
+   kfree(out);
goto abort;
}
 
@@ -697,6 +701,8 @@ static int wm0010_boot(struct snd_soc_codec *codec)
ret = spi_sync(spi, &m);
if (ret != 0) {
dev_err(codec->dev, "Second PLL write failed: %d\n", 
ret);
+   kfree(img_swap);
+   kfree(out);
goto abort;
}
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: ipath: fix build failure

2015-09-01 Thread Sudip Mukherjee
building of ipath depends on infiniband. And if ipath is selected and
infiniband is not then build fails with:
ERROR: "ib_alloc_device" [drivers/staging/ipath/ib_ipath.ko] undefined!
ERROR: "ib_dealloc_device" [drivers/staging/ipath/ib_ipath.ko] undefined!
ERROR: "ib_dispatch_event" [drivers/staging/ipath/ib_ipath.ko] undefined!
ERROR: "ib_register_device" [drivers/staging/ipath/ib_ipath.ko] undefined!
ERROR: "ib_unregister_device" [drivers/staging/ipath/ib_ipath.ko] undefined!
ERROR: "ib_modify_qp_is_ok" [drivers/staging/ipath/ib_ipath.ko] undefined!
ERROR: "ib_wq" [drivers/staging/ipath/ib_ipath.ko] undefined!

Config at: https://lkml.org/lkml/2015/8/31/328

Reported-by: Jim Davis 
Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/ipath/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/ipath/Kconfig b/drivers/staging/ipath/Kconfig
index 041ce06..1edc21b 100644
--- a/drivers/staging/ipath/Kconfig
+++ b/drivers/staging/ipath/Kconfig
@@ -1,6 +1,7 @@
 config INFINIBAND_IPATH
tristate "QLogic HTX HCA support"
depends on 64BIT && NET && HT_IRQ
+   depends on INFINIBAND
---help---
This is a driver for the deprecated QLogic Hyper-Transport
IB host channel adapter (model QHT7140),
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/3] staging: sm7xxfb: move sm712fb out of staging

2015-09-01 Thread Sudip Mukherjee
On Tue, Sep 01, 2015 at 04:27:24PM +0300, Tomi Valkeinen wrote:
> 
> 
> On 18/07/15 07:08, Sudip Mukherjee wrote:
> > Now since all cleanups are done and the code is ready to be merged lets
> > move it out of staging into fbdev location.
> 
> Have you considered writing a DRM driver for this? I'm not happy at all
> adding new fbdev drivers, as the DRM framework is much better,
> supported, and continuously improved. With fbdev you end up with things
> like module parameters used to define video modes etc, which is just ugly.
Yes, I am working on a DRM driver, but since these are all voluntary
work it is taking time. And Greg has already merged it.
> 
> Anyway, some comments below.
Some replies inline and remaining I will fix and send patches to you.
> 

> > +
> > +extern void __iomem *smtc_regbaseaddress;
> 
> Uh, what is that?
I guess all of us missed seeing it. :(
As you said in another comments smtc_regbaseaddress will be included in
the per-device data and this will be removed.
> 

> > +static inline unsigned int smtc_seqr(int reg)
> > +{
> > +   smtc_mmiowb(reg, 0x3c4);
> > +   return smtc_mmiorb(0x3c5);
> > +}
> 
> There's quite a lot of magic numbers there, and the same continues
> through the driver. You should use defines to assign symbolic names for
> most of the numbers.
will do.
> 

> > +
> > +void __iomem *smtc_regbaseaddress; /* Memory Map IO starting address */
> 
> You can't have globals like this in the driver, they must be inside the
> per-device data. Just think what happens if someone has two of these
> devices.
will do.
> 

> > +
> > +static struct fb_fix_screeninfo smtcfb_fix = {
> > +   .id = "smXXXfb",
> > +   .type   = FB_TYPE_PACKED_PIXELS,
> > +   .visual = FB_VISUAL_TRUECOLOR,
> > +   .line_length= 800 * 3,
> > +   .accel  = FB_ACCEL_SMI_LYNX,
> > +   .type_aux   = 0,
> > +   .xpanstep   = 0,
> > +   .ypanstep   = 0,
> > +   .ywrapstep  = 0,
> > +};
> 
> These should be const.
ok.
> 

> > +static const struct vesa_mode vesa_mode_table[] = {
> > +   {"0x301", 640,  480,  8},
> > +   {"0x303", 800,  600,  8},
> > +   {"0x305", 1024, 768,  8},
> > +   {"0x307", 1280, 1024, 8},
> > +
> > +   {"0x311", 640,  480,  16},
> > +   {"0x314", 800,  600,  16},
> > +   {"0x317", 1024, 768,  16},
> > +   {"0x31A", 1280, 1024, 16},
> > +
> > +   {"0x312", 640,  480,  24},
> > +   {"0x315", 800,  600,  24},
> > +   {"0x318", 1024, 768,  24},
> > +   {"0x31B", 1280, 1024, 24},
> > +};
> 
> We have "vesa_modes" in include/linux/fb.h. What is the above table for?
The resolutions that are supported along with the kernel boot parameter
to point to the resolution to boot with.
> 
> > +
> > +/**
> > +SM712 Mode table.
> > + **/
> > +static const struct modeinit vgamode[] = {
> > +   {
  
> > +   {   /*  Init_CR90_CRA7 */
> > +   0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
> > +   0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
> > +   0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
> > +   },
> > +   },
> > +};
> 
> What are these tables above for?
Different register settings based on the display resolution. Do you want
me to do anything with these vgamode table and the vesa_mode_table?

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


[PATCH] dm snapshot: fix memory leak

2015-10-13 Thread Sudip Mukherjee
If wrong option is given then we are returning but we missed releasing
the workqueue and pstore.
Add an error path and use it to correctly release resources on failure.

Fixes: b0d3cc011e53 ("dm snapshot: add new persistent store option to support 
overflow")
Signed-off-by: Sudip Mukherjee 
---
 drivers/md/dm-snap-persistent.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
index 229be55..5ff7c23 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -847,6 +847,7 @@ static void persistent_drop_snapshot(struct 
dm_exception_store *store)
 static int persistent_ctr(struct dm_exception_store *store, char *options)
 {
struct pstore *ps;
+   int ret;
 
/* allocate the pstore */
ps = kzalloc(sizeof(*ps), GFP_KERNEL);
@@ -868,9 +869,9 @@ static int persistent_ctr(struct dm_exception_store *store, 
char *options)
 
ps->metadata_wq = alloc_workqueue("ksnaphd", WQ_MEM_RECLAIM, 0);
if (!ps->metadata_wq) {
-   kfree(ps);
DMERR("couldn't start header metadata update thread");
-   return -ENOMEM;
+   ret = -ENOMEM;
+   goto err_free_ps;
}
 
if (options) {
@@ -879,13 +880,20 @@ static int persistent_ctr(struct dm_exception_store 
*store, char *options)
store->userspace_supports_overflow = true;
else {
DMERR("Unsupported persistent store option: %s", 
options);
-   return -EINVAL;
+   ret = -EINVAL;
+   goto err_option;
}
}
 
store->context = ps;
 
return 0;
+
+err_option:
+   destroy_workqueue(ps->metadata_wq);
+err_free_ps:
+   kfree(ps);
+   return ret;
 }
 
 static unsigned persistent_status(struct dm_exception_store *store,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] crypto: ccm - remove goto

2015-10-13 Thread Sudip Mukherjee
Instead of using goto and jumping to a label and then returning from
there, lets return directly. The label out: is not used from anywhere
else in the code.

Signed-off-by: Sudip Mukherjee 
---
 crypto/ccm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/crypto/ccm.c b/crypto/ccm.c
index cc31ea4..daa7e6d 100644
--- a/crypto/ccm.c
+++ b/crypto/ccm.c
@@ -881,14 +881,13 @@ static int crypto_rfc4309_create(struct crypto_template 
*tmpl,
if (err)
goto out_drop_alg;
 
-out:
return err;
 
 out_drop_alg:
crypto_drop_aead(spawn);
 out_free_inst:
kfree(inst);
-   goto out;
+   return err;
 }
 
 static struct crypto_template crypto_rfc4309_tmpl = {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] misc: mic: fix memory leak

2015-10-13 Thread Sudip Mukherjee
In scif_node_connect() we were returning if the initialization of p2p_ji
fails. But at that time p2p_ij has already been initialized and
resources allocated for it. And since p2p_ij is not added to the list
till now so we will have a leak.
Lets deinitialize and release the resources connected to p2p_ij.

Signed-off-by: Sudip Mukherjee 
---

One sudip sending patch to another sudeep... :)

 drivers/misc/mic/scif/scif_nodeqp.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mic/scif/scif_nodeqp.c 
b/drivers/misc/mic/scif/scif_nodeqp.c
index 7180d56..5e94fac 100644
--- a/drivers/misc/mic/scif/scif_nodeqp.c
+++ b/drivers/misc/mic/scif/scif_nodeqp.c
@@ -435,6 +435,18 @@ free_p2p:
return NULL;
 }
 
+/* Uninitialize and release resources from a p2p mapping */
+void scif_deinit_p2p_info(struct scif_dev *scifdev, struct scif_p2p_info *p2p)
+{
+   struct scif_hw_dev *sdev = scifdev->sdev;
+
+   dma_unmap_sg(&sdev->dev, p2p->ppi_sg[SCIF_PPI_MMIO],
+p2p->sg_nentries[SCIF_PPI_MMIO], DMA_BIDIRECTIONAL);
+   scif_p2p_freesg(p2p->ppi_sg[SCIF_PPI_MMIO]);
+   scif_p2p_freesg(p2p->ppi_sg[SCIF_PPI_APER]);
+   kfree(p2p);
+}
+
 /**
  * scif_node_connect: Respond to SCIF_NODE_CONNECT interrupt message
  * @dst: Destination node
@@ -477,8 +489,10 @@ static void scif_node_connect(struct scif_dev *scifdev, 
int dst)
if (!p2p_ij)
return;
p2p_ji = scif_init_p2p_info(dev_j, dev_i);
-   if (!p2p_ji)
+   if (!p2p_ji) {
+   scif_deinit_p2p_info(dev_i, p2p_ij);
return;
+   }
list_add_tail(&p2p_ij->ppi_list, &dev_i->p2p);
list_add_tail(&p2p_ji->ppi_list, &dev_j->p2p);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] MAINTAINERS: fix entry of char/misc

2015-10-13 Thread Sudip Mukherjee
Greg and Arnd are supporter of char and misc drivers. While using
getmaintainer.pl on any patch or any file in these directories their
names were never displayed.
And for this reason quite a few patches for these char and misc have
never been picked up as they never had Greg or Arnd in To or Cc.

Signed-off-by: Sudip Mukherjee 
---

I personally faced this multiple times and faced again just now while
sending another patch for misc. Greg can also confirm about the missing
patches. But this maybe a problem with getmaintainer.pl file also.
So adding Joe Perches to Cc list.

 MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 21348d8..a8a1676 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2698,8 +2698,8 @@ M:Arnd Bergmann 
 M: Greg Kroah-Hartman 
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
 S: Supported
-F: drivers/char/*
-F: drivers/misc/*
+F: drivers/char/
+F: drivers/misc/
 F: include/linux/miscdevice.h
 
 CHECKPATCH
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] misc: mic: fix memory leak

2015-10-13 Thread Sudip Mukherjee
In scif_node_connect() we were returning if the initialization of p2p_ji
fails. But at that time p2p_ij has already been initialized and
resources allocated for it. And since p2p_ij is not added to the list
till now so we will have a leak.
Lets deinitialize and release the resources connected to p2p_ij.

Signed-off-by: Sudip Mukherjee 
---

missed making the function as static in v1. reportd by kbuild test
robot.

 drivers/misc/mic/scif/scif_nodeqp.c | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mic/scif/scif_nodeqp.c 
b/drivers/misc/mic/scif/scif_nodeqp.c
index 7180d56..b230d7c 100644
--- a/drivers/misc/mic/scif/scif_nodeqp.c
+++ b/drivers/misc/mic/scif/scif_nodeqp.c
@@ -435,6 +435,19 @@ free_p2p:
return NULL;
 }
 
+/* Uninitialize and release resources from a p2p mapping */
+static void scif_deinit_p2p_info(struct scif_dev *scifdev,
+struct scif_p2p_info *p2p)
+{
+   struct scif_hw_dev *sdev = scifdev->sdev;
+
+   dma_unmap_sg(&sdev->dev, p2p->ppi_sg[SCIF_PPI_MMIO],
+p2p->sg_nentries[SCIF_PPI_MMIO], DMA_BIDIRECTIONAL);
+   scif_p2p_freesg(p2p->ppi_sg[SCIF_PPI_MMIO]);
+   scif_p2p_freesg(p2p->ppi_sg[SCIF_PPI_APER]);
+   kfree(p2p);
+}
+
 /**
  * scif_node_connect: Respond to SCIF_NODE_CONNECT interrupt message
  * @dst: Destination node
@@ -477,8 +490,10 @@ static void scif_node_connect(struct scif_dev *scifdev, 
int dst)
if (!p2p_ij)
return;
p2p_ji = scif_init_p2p_info(dev_j, dev_i);
-   if (!p2p_ji)
+   if (!p2p_ji) {
+   scif_deinit_p2p_info(dev_i, p2p_ij);
return;
+   }
list_add_tail(&p2p_ij->ppi_list, &dev_i->p2p);
list_add_tail(&p2p_ji->ppi_list, &dev_j->p2p);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] misc: mic: fix memory leak

2015-10-13 Thread Sudip Mukherjee
On Tue, Oct 13, 2015 at 05:50:12PM +0800, kbuild test robot wrote:
> Hi Sudip,
> 
> [auto build test WARNING on char-misc/char-misc-next -- if it's inappropriate 
> base, please suggest rules for selecting the more suitable base]
> 
> url:
> https://github.com/0day-ci/linux/commits/Sudip-Mukherjee/misc-mic-fix-memory-leak/20151013-171026
> reproduce:
> # apt-get install sparse
> make ARCH=x86_64 allmodconfig
> make C=1 CF=-D__CHECK_ENDIAN__
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
> >> drivers/misc/mic/scif/scif_nodeqp.c:439:6: sparse: symbol 
> >> 'scif_deinit_p2p_info' was not declared. Should it be static?
> 
> Please review and possibly fold the followup patch.

Thanks. I have sent a v2.

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


[PATCH char-misc-next v3] misc: mic: fix memory leak

2015-10-13 Thread Sudip Mukherjee
In scif_node_connect() we were returning if the initialization of p2p_ji
fails. But at that time p2p_ij has already been initialized and
resources allocated for it. And since p2p_ij is not added to the list
till now so we will have a leak.
Lets deinitialize and release the resources connected to p2p_ij.

Signed-off-by: Sudip Mukherjee 
---

v3: added unmapping the aperture
v2: missed making the function as static

 drivers/misc/mic/scif/scif_nodeqp.c | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mic/scif/scif_nodeqp.c 
b/drivers/misc/mic/scif/scif_nodeqp.c
index 7180d56..c66ca1a 100644
--- a/drivers/misc/mic/scif/scif_nodeqp.c
+++ b/drivers/misc/mic/scif/scif_nodeqp.c
@@ -435,6 +435,21 @@ free_p2p:
return NULL;
 }
 
+/* Uninitialize and release resources from a p2p mapping */
+static void scif_deinit_p2p_info(struct scif_dev *scifdev,
+struct scif_p2p_info *p2p)
+{
+   struct scif_hw_dev *sdev = scifdev->sdev;
+
+   dma_unmap_sg(&sdev->dev, p2p->ppi_sg[SCIF_PPI_MMIO],
+p2p->sg_nentries[SCIF_PPI_MMIO], DMA_BIDIRECTIONAL);
+   dma_unmap_sg(&sdev->dev, p2p->ppi_sg[SCIF_PPI_APER],
+p2p->sg_nentries[SCIF_PPI_APER], DMA_BIDIRECTIONAL);
+   scif_p2p_freesg(p2p->ppi_sg[SCIF_PPI_MMIO]);
+   scif_p2p_freesg(p2p->ppi_sg[SCIF_PPI_APER]);
+   kfree(p2p);
+}
+
 /**
  * scif_node_connect: Respond to SCIF_NODE_CONNECT interrupt message
  * @dst: Destination node
@@ -477,8 +492,10 @@ static void scif_node_connect(struct scif_dev *scifdev, 
int dst)
if (!p2p_ij)
return;
p2p_ji = scif_init_p2p_info(dev_j, dev_i);
-   if (!p2p_ji)
+   if (!p2p_ji) {
+   scif_deinit_p2p_info(dev_i, p2p_ij);
return;
+   }
list_add_tail(&p2p_ij->ppi_list, &dev_i->p2p);
list_add_tail(&p2p_ji->ppi_list, &dev_j->p2p);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] misc: mic: fix memory leak

2015-10-13 Thread Sudip Mukherjee
On Tue, Oct 13, 2015 at 09:34:21AM -0700, Sudeep Dutt wrote:
> On Tue, 2015-10-13 at 14:38 +0530, Sudip Mukherjee wrote:

> > +   struct scif_hw_dev *sdev = scifdev->sdev;
> > +
> > +   dma_unmap_sg(&sdev->dev, p2p->ppi_sg[SCIF_PPI_MMIO],
> > +p2p->sg_nentries[SCIF_PPI_MMIO], DMA_BIDIRECTIONAL);
> 
> Hi Sudip,
> 
> You missed unmapping the aperture here:
> 
> dma_unmap_sg(&sdev->dev, p2p->ppi_sg[SCIF_PPI_APER],
>p2p->sg_nentries[SCIF_PPI_APER], DMA_BIDIRECTIONAL);
> 
> Can you please resubmit this patch with the change above?

Hi Sudeep,
v3 sent for your review.   
> 
> Also you should mention [PATCH char-misc-next] in the next revision.

Ohhh... yes, I keep forgetting that Fengguang will need this tag for
his build bot.

But I have one more doubt. If scif_nodeqp_send() fails then shouldn't we
remove these two nodes of the p2p connection from the lists and release
the resources?

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


Re: [PATCH] MAINTAINERS: fix entry of char/misc

2015-10-13 Thread Sudip Mukherjee
On Tue, Oct 13, 2015 at 07:48:05AM -0700, Joe Perches wrote:
> On Tue, 2015-10-13 at 15:34 +0530, Sudip Mukherjee wrote:
> > Greg and Arnd are supporter of char and misc drivers. While using
> > getmaintainer.pl on any patch or any file in these directories their
> > names were never displayed.
> []
> > diff --git a/MAINTAINERS b/MAINTAINERS
> []
> >  M: Greg Kroah-Hartman 
> >  T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
> >  S: Supported
> > -F: drivers/char/*
> > -F: drivers/misc/*
> > +F: drivers/char/
> > +F: drivers/misc/
> >  F: include/linux/miscdevice.h
> 
> Do Greg and Arnd really want to be supporting all
> subsystems below drivers/char like agp and xillybus?

I don't know that. Maybe Greg and Arnd can say.
But wasn't that the intention when char/* and misc/* was mentioned here?

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


Re: [PATCH] MAINTAINERS: fix entry of char/misc

2015-10-13 Thread Sudip Mukherjee
On Tue, Oct 13, 2015 at 10:39:47AM -0700, Greg Kroah-Hartman wrote:
> On Tue, Oct 13, 2015 at 10:49:24PM +0530, Sudip Mukherjee wrote:
> > On Tue, Oct 13, 2015 at 07:48:05AM -0700, Joe Perches wrote:
> > > On Tue, 2015-10-13 at 15:34 +0530, Sudip Mukherjee wrote:
> > > > Greg and Arnd are supporter of char and misc drivers. While using
> > > > getmaintainer.pl on any patch or any file in these directories their
> > > > names were never displayed.
> > > []
> > > > diff --git a/MAINTAINERS b/MAINTAINERS
> > > []
> > > >  M: Greg Kroah-Hartman 
> > > >  T: git 
> > > > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
> > > >  S: Supported
> > > > -F: drivers/char/*
> > > > -F: drivers/misc/*
> > > > +F: drivers/char/
> > > > +F: drivers/misc/
> > > >  F: include/linux/miscdevice.h
> > > 
> > > Do Greg and Arnd really want to be supporting all
> > > subsystems below drivers/char like agp and xillybus?
> > 
> > I don't know that. Maybe Greg and Arnd can say.
> > But wasn't that the intention when char/* and misc/* was mentioned here?
> 
> Kind of, I'm here to pick up the portions of this tree that do not have
> a maintainer already (random.c is one example.)

Then what about the ones that has a maintainer? I had specifically
sgi-gru in mind when I made this patch. I hope you remember the issue
that I pointed out when i sent some patches for that.

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


Re: [PATCH 0/3] drivers/misc/sgi-gru: unapplied patches and a new one

2015-10-13 Thread Sudip Mukherjee
On Mon, Oct 05, 2015 at 10:18:32AM -0500, Dimitri Sivanich wrote:
> On Mon, Oct 05, 2015 at 08:43:07PM +0530, Sudip Mukherjee wrote:
> > On Thu, Sep 24, 2015 at 12:31:01PM +0530, Sudip Mukherjee wrote:
> > > On Wed, Sep 23, 2015 at 12:48:25PM -0500, Dimitri Sivanich wrote:
> > > > Sudip,
> > > > 
> > > > I can take a look at the Jack Steiner patches.  Was there anything in 
> > > > the set
> > > > of 3 patches that you sent that still needs a review?
> > > Yes. The 3/3 patch please. That one is new. I found that problem while
> > > checking another old patch.
> > > If Jack Steiner patches looks ok then you can send the series to Greg or
> > > if you want me to send please do let me know.
> > 
> > Hi Dimitri,
> > Greg has picked up this series. Did you have a chance to look at the
> > series of Jack Steiner or shall i repost for your review?
> >
> I haven't had a chance to fully review those yet.

Hi Dimitri,
will it help if I repost them as patch? I understand it will be
difficult to review patches in webpage from where you can not apply and
test. Please do let me know if i can be of any help.

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


Re: [PATCH] drm/nouveau: fix memory leak

2015-10-13 Thread Sudip Mukherjee
On Thu, Oct 08, 2015 at 03:22:20PM +0100, Emil Velikov wrote:
> On 8 October 2015 at 14:00, Sudip Mukherjee  
> wrote:
> > On Thu, Oct 01, 2015 at 04:40:59PM +1000, Ben Skeggs wrote:
> >> On 09/25/2015 01:59 AM, Sudip Mukherjee wrote:
> >> > On Fri, Sep 11, 2015 at 03:00:56PM +0530, Sudip Mukherjee wrote:
> >> >> If pm_runtime_get_sync() we were going to "out" but we missed
> >> >> freeing vma.
> >> >>
> >> >> Signed-off-by: Sudip Mukherjee  ---
> >> > Hi Ben, Another gentle ping for another patch.
> >> Both patches are in my tree.
> >
> > Hi Ben,
> > I am not seeing these in linux-next.
> >
> The nouveau tree does not merge into linux-next I'm afraid. Perhaps we
> should as Ben gets the chance/time.

Can I be of any help in that? Maybe I can learn few things about drm in
the proces.

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


[PATCH 1/3] staging: fbtft: use strncpy instead of strcpy

2015-09-05 Thread Sudip Mukherjee
Using strcpy() is a security risk as the destination buffer size is not
checked and we may over-run the buffer. Use strncpy() instead, while
mentioning the buffer size leaving place for the NULL termination.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/fbtft/fbtft_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c 
b/drivers/staging/fbtft/fbtft_device.c
index 0483d33..3856c88 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1342,7 +1342,8 @@ static int __init fbtft_device_init(void)
p_name, p_num);
return -EINVAL;
}
-   strcpy(fbtft_device_param_gpios[i].name, p_name);
+   strncpy(fbtft_device_param_gpios[i].name, p_name,
+   FBTFT_GPIO_NAME_SIZE - 1);
fbtft_device_param_gpios[i++].gpio = (int) val;
if (i == MAX_GPIOS) {
pr_err(DRVNAME
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] staging: fbtft: do not use magic numbers

2015-09-05 Thread Sudip Mukherjee
Using magic numbers are not good coding practise. Use
FBTFT_GPIO_NAME_SIZE as defined in the header files.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/fbtft/fbtft_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c 
b/drivers/staging/fbtft/fbtft_device.c
index 3856c88..80ab918 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1375,7 +1375,7 @@ static int __init fbtft_device_init(void)
}
 
/* name=list lists all supported displays */
-   if (strncmp(name, "list", 32) == 0) {
+   if (strncmp(name, "list", FBTFT_GPIO_NAME_SIZE) == 0) {
pr_info(DRVNAME":  Supported displays:\n");
 
for (i = 0; i < ARRAY_SIZE(displays); i++)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] staging: fbtft: use pr_fmt

2015-09-05 Thread Sudip Mukherjee
Instead of defining DRVNAME and using it in all calls to pr_* family of
macros lets start using pr_fmt.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/fbtft/fbtft_device.c | 79 
 1 file changed, 35 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c 
b/drivers/staging/fbtft/fbtft_device.c
index 80ab918..029423e 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -13,6 +13,7 @@
  * GNU General Public License for more details.
  */
 
+#define pr_fmt(fmt) "fbtft_device: " fmt
 #include 
 #include 
 #include 
@@ -21,8 +22,6 @@
 
 #include "fbtft.h"
 
-#define DRVNAME "fbtft_device"
-
 #define MAX_GPIOS 32
 
 static struct spi_device *spi_device;
@@ -1215,16 +1214,16 @@ static int spi_device_found(struct device *dev, void 
*data)
 {
struct spi_device *spi = container_of(dev, struct spi_device, dev);
 
-   pr_info(DRVNAME":  %s %s %dkHz %d bits mode=0x%02X\n",
-   spi->modalias, dev_name(dev), spi->max_speed_hz / 1000,
-   spi->bits_per_word, spi->mode);
+   pr_info("%s %s %dkHz %d bits mode=0x%02X\n", spi->modalias,
+   dev_name(dev), spi->max_speed_hz / 1000, spi->bits_per_word,
+   spi->mode);
 
return 0;
 }
 
 static void pr_spi_devices(void)
 {
-   pr_info(DRVNAME":  SPI devices registered:\n");
+   pr_info("SPI devices registered:\n");
bus_for_each_dev(&spi_bus_type, NULL, NULL, spi_device_found);
 }
 
@@ -1234,16 +1233,15 @@ static int p_device_found(struct device *dev, void 
*data)
*pdev = container_of(dev, struct platform_device, dev);
 
if (strstr(pdev->name, "fb"))
-   pr_info(DRVNAME":  %s id=%d pdata? %s\n",
-   pdev->name, pdev->id,
-   pdev->dev.platform_data ? "yes" : "no");
+   pr_info("%s id=%d pdata? %s\n", pdev->name, pdev->id,
+   pdev->dev.platform_data ? "yes" : "no");
 
return 0;
 }
 
 static void pr_p_devices(void)
 {
-   pr_info(DRVNAME":  'fb' Platform devices registered:\n");
+   pr_info("'fb' Platform devices registered:\n");
bus_for_each_dev(&platform_bus_type, NULL, NULL, p_device_found);
 }
 
@@ -1258,7 +1256,7 @@ static void fbtft_device_spi_delete(struct spi_master 
*master, unsigned cs)
dev = bus_find_device_by_name(&spi_bus_type, NULL, str);
if (dev) {
if (verbose)
-   pr_info(DRVNAME": Deleting %s\n", str);
+   pr_info("Deleting %s\n", str);
device_del(dev);
}
 }
@@ -1269,7 +1267,7 @@ static int fbtft_device_spi_device_register(struct 
spi_board_info *spi)
 
master = spi_busnum_to_master(spi->bus_num);
if (!master) {
-   pr_err(DRVNAME ":  spi_busnum_to_master(%d) returned NULL\n",
+   pr_err("spi_busnum_to_master(%d) returned NULL\n",
spi->bus_num);
return -EINVAL;
}
@@ -1278,7 +1276,7 @@ static int fbtft_device_spi_device_register(struct 
spi_board_info *spi)
spi_device = spi_new_device(master, spi);
put_device(&master->dev);
if (!spi_device) {
-   pr_err(DRVNAME ":spi_new_device() returned NULL\n");
+   pr_err("spi_new_device() returned NULL\n");
return -EPERM;
}
return 0;
@@ -1301,11 +1299,11 @@ static int __init fbtft_device_init(void)
long val;
int ret = 0;
 
-   pr_debug("\n\n"DRVNAME": init\n");
+   pr_debug("init\n");
 
if (name == NULL) {
 #ifdef MODULE
-   pr_err(DRVNAME":  missing module parameter: 'name'\n");
+   pr_err("missing module parameter: 'name'\n");
return -EINVAL;
 #else
return 0;
@@ -1313,42 +1311,37 @@ static int __init fbtft_device_init(void)
}
 
if (init_num > FBTFT_MAX_INIT_SEQUENCE) {
-   pr_err(DRVNAME
-   ":  init parameter: exceeded max array size: %d\n",
-   FBTFT_MAX_INIT_SEQUENCE);
+   pr_err("init parameter: exceeded max array size: %d\n",
+  FBTFT_MAX_INIT_SEQUENCE);
return -EINVAL;
}
 
/* parse module parameter: gpios */
while ((p_gpio = strsep(&gpios, ","))) {
if (strchr(p_gpio, ':') == NULL) {
-   pr_err(DR

Re: [PATCH 10/15] Staging: rtl8192u: open braces should appear on the appropriate line in ieee80211_softmac_wx.c

2015-09-06 Thread Sudip Mukherjee
On Sat, Sep 05, 2015 at 07:24:38PM +, Mike Dupuis wrote:
> This is a patch to the ieee80211_softmac_wx.c file that corrects instances 
> where open braces appear on the incorrect line as identified by checkpatch.pl
> 
> Signed-off-by: Mike Dupuis 
> ---
This patch will not apply because of:
1431e81060eb ("Staging: rtl819u: ieee80211: Remove unused variable").

Please refresh your tree.

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


Re: [PATCH 12/15] Staging: rt8192u: add spaces around assignment operators in ieee80211_softmac_wx.c

2015-09-06 Thread Sudip Mukherjee
On Sat, Sep 05, 2015 at 07:29:14PM +, Mike Dupuis wrote:
> This is a patch to add spaces around assignment operators as identifed by 
> checkpatch.pl
> 
> Signed-off-by: Mike Dupuis 
> ---
same problem as in 10/15

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


[PATCH] drm/mgag200: fix memory leak

2015-09-07 Thread Sudip Mukherjee
If drm_fb_helper_alloc_fbi() fails then we were directly returning
without freeing sysram. Also if drm_fb_helper_alloc_fbi() succeeds but
mgag200_framebuffer_init() fails then we were not releasing sysram and
we were not releasing fbi helper also.

Signed-off-by: Sudip Mukherjee 
---
 drivers/gpu/drm/mgag200/mgag200_fb.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c 
b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 87de15e..5fe476a 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -189,14 +189,16 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
return -ENOMEM;
 
info = drm_fb_helper_alloc_fbi(helper);
-   if (IS_ERR(info))
-   return PTR_ERR(info);
+   if (IS_ERR(info)) {
+   ret = PTR_ERR(info);
+   goto err_alloc_fbi;
+   }
 
info->par = mfbdev;
 
ret = mgag200_framebuffer_init(dev, &mfbdev->mfb, &mode_cmd, gobj);
if (ret)
-   return ret;
+   goto err_framebuffer_init;
 
mfbdev->sysram = sysram;
mfbdev->size = size;
@@ -226,6 +228,13 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
DRM_DEBUG_KMS("allocated %dx%d\n",
  fb->width, fb->height);
return 0;
+
+err_framebuffer_init:
+   drm_fb_helper_release_fbi(helper);
+
+err_alloc_fbi:
+   vfree(sysram);
+   return ret;
 }
 
 static int mga_fbdev_destroy(struct drm_device *dev,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] staging: gdm72xx: fix memory leak

2015-09-07 Thread Sudip Mukherjee
We were successfully requesting the firmware but on error it was not
being released.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/gdm72xx/usb_boot.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/gdm72xx/usb_boot.c 
b/drivers/staging/gdm72xx/usb_boot.c
index 3ccc447..50fbec3 100644
--- a/drivers/staging/gdm72xx/usb_boot.c
+++ b/drivers/staging/gdm72xx/usb_boot.c
@@ -159,8 +159,10 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
}
 
tx_buf = kmalloc(DOWNLOAD_SIZE, GFP_KERNEL);
-   if (tx_buf == NULL)
+   if (tx_buf == NULL) {
+   release_firmware(firm);
return -ENOMEM;
+   }
 
if (firm->size < sizeof(hdr)) {
dev_err(&usbdev->dev, "Cannot read the image info.\n");
@@ -285,8 +287,10 @@ static int em_download_image(struct usb_device *usbdev, 
const char *img_name,
}
 
buf = kmalloc(DOWNLOAD_CHUCK + pad_size, GFP_KERNEL);
-   if (buf == NULL)
+   if (buf == NULL) {
+   release_firmware(firm);
return -ENOMEM;
+   }
 
strcpy(buf+pad_size, type_string);
ret = gdm_wibro_send(usbdev, buf, strlen(type_string)+pad_size);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] staging: gdm72xx: NULL comparison style

2015-09-07 Thread Sudip Mukherjee
checkpatch complains if NULL comparison is done as if (var == NULL)

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/gdm72xx/gdm_qos.c   |  2 +-
 drivers/staging/gdm72xx/gdm_sdio.c  | 20 ++--
 drivers/staging/gdm72xx/gdm_usb.c   | 16 
 drivers/staging/gdm72xx/gdm_wimax.c |  4 ++--
 drivers/staging/gdm72xx/sdio_boot.c |  4 ++--
 drivers/staging/gdm72xx/usb_boot.c  |  4 ++--
 6 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/gdm72xx/gdm_qos.c 
b/drivers/staging/gdm72xx/gdm_qos.c
index 96bf2bf..72c0f7ef 100644
--- a/drivers/staging/gdm72xx/gdm_qos.c
+++ b/drivers/staging/gdm72xx/gdm_qos.c
@@ -190,7 +190,7 @@ static int get_qos_index(struct nic *nic, u8 *iph, u8 
*tcpudph)
int ip_ver, i;
struct qos_cb_s *qcb = &nic->qos;
 
-   if (iph == NULL || tcpudph == NULL)
+   if (!iph || !tcpudph)
return -1;
 
ip_ver = (iph[0]>>4)&0xf;
diff --git a/drivers/staging/gdm72xx/gdm_sdio.c 
b/drivers/staging/gdm72xx/gdm_sdio.c
index a5fd079..b0521da 100644
--- a/drivers/staging/gdm72xx/gdm_sdio.c
+++ b/drivers/staging/gdm72xx/gdm_sdio.c
@@ -173,12 +173,12 @@ static int init_sdio(struct sdiowm_dev *sdev)
spin_lock_init(&tx->lock);
 
tx->sdu_buf = kmalloc(SDU_TX_BUF_SIZE, GFP_KERNEL);
-   if (tx->sdu_buf == NULL)
+   if (!tx->sdu_buf)
goto fail;
 
for (i = 0; i < MAX_NR_SDU_BUF; i++) {
t = alloc_tx_struct(tx);
-   if (t == NULL) {
+   if (!t) {
ret = -ENOMEM;
goto fail;
}
@@ -192,7 +192,7 @@ static int init_sdio(struct sdiowm_dev *sdev)
 
for (i = 0; i < MAX_NR_RX_BUF; i++) {
r = alloc_rx_struct(rx);
-   if (r == NULL) {
+   if (!r) {
ret = -ENOMEM;
goto fail;
}
@@ -200,7 +200,7 @@ static int init_sdio(struct sdiowm_dev *sdev)
}
 
rx->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL);
-   if (rx->rx_buf == NULL)
+   if (!rx->rx_buf)
goto fail;
 
return 0;
@@ -359,7 +359,7 @@ static void do_tx(struct work_struct *work)
is_sdu = 1;
}
 
-   if (!is_sdu && t == NULL) {
+   if (!is_sdu && !t) {
spin_unlock_irqrestore(&tx->lock, flags);
return;
}
@@ -393,7 +393,7 @@ static int gdm_sdio_send(void *priv_dev, void *data, int 
len,
cmd_evt = (pkt[0] << 8) | pkt[1];
if (cmd_evt == WIMAX_TX_SDU) {
t = get_tx_struct(tx, &no_spc);
-   if (t == NULL) {
+   if (!t) {
/* This case must not happen. */
spin_unlock_irqrestore(&tx->lock, flags);
return -ENOSPC;
@@ -407,7 +407,7 @@ static int gdm_sdio_send(void *priv_dev, void *data, int 
len,
t->cb_data = cb_data;
} else {
t = alloc_tx_struct(tx);
-   if (t == NULL) {
+   if (!t) {
spin_unlock_irqrestore(&tx->lock, flags);
return -ENOMEM;
}
@@ -581,7 +581,7 @@ static int gdm_sdio_receive(void *priv_dev,
 
spin_lock_irqsave(&rx->lock, flags);
r = get_rx_struct(rx);
-   if (r == NULL) {
+   if (!r) {
spin_unlock_irqrestore(&rx->lock, flags);
return -ENOMEM;
}
@@ -615,12 +615,12 @@ static int sdio_wimax_probe(struct sdio_func *func,
return ret;
 
phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
-   if (phy_dev == NULL) {
+   if (!phy_dev) {
ret = -ENOMEM;
goto out;
}
sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
-   if (sdev == NULL) {
+   if (!sdev) {
ret = -ENOMEM;
goto out;
}
diff --git a/drivers/staging/gdm72xx/gdm_usb.c 
b/drivers/staging/gdm72xx/gdm_usb.c
index eac2f34..16e497d 100644
--- a/drivers/staging/gdm72xx/gdm_usb.c
+++ b/drivers/staging/gdm72xx/gdm_usb.c
@@ -139,7 +139,7 @@ static struct usb_rx *get_rx_struct(struct rx_cxt *rx)
 
if (list_empty(&rx->free_list)) {
r = alloc_rx_struct(rx);
-   if (r == NULL)
+   if (!r)
return NULL;
 
list_add(&r->list, &rx->free_list);
@@ -224,7 +224,7 @@ static int init_usb(struct usbwm_dev *udev)
spin_lock_irqsave(&tx->lock, flags);
for (i = 0; i < MAX_NR_SDU_BUF; i++) {
t = alloc_tx_struct(tx);
-   if (t == NULL) {
+   if (!t) {
spin_unlock_irqrestore(&tx->lock, flags);
ret = -ENOMEM;
  

Re: [PATCH 3/5] staging: most: remove driver owner

2015-09-07 Thread Sudip Mukherjee
On Mon, Sep 07, 2015 at 02:13:38PM +0200, Andrey Shvetsov wrote:
> On Fri, Sep 04, 2015 at 04:22:04PM +0530, Sudip Mukherjee wrote:
> > The platform driver core will set the owner value, we do not need to do
> > it in the module.
> > 
> > Signed-off-by: Sudip Mukherjee 
> > ---
> >  drivers/staging/most/hdm-dim2/dim2_hdm.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c 
> > b/drivers/staging/most/hdm-dim2/dim2_hdm.c
> > index 5b0a588..4481a0b 100644
> > --- a/drivers/staging/most/hdm-dim2/dim2_hdm.c
> > +++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c
> > @@ -923,7 +923,6 @@ static struct platform_driver dim2_driver = {
> > .id_table = dim2_id,
> > .driver = {
> > .name = "hdm_dim2",
> > -   .owner = THIS_MODULE,
> I cannot accept this.
> 
> This change is not significant for current kernel, but we still have customers
> using kernels <= 3.10, where auto assignment of .owner does not exist.
But this patch is for 4.4-rc1, and it is not marked for stable. Then how
is it going to affect your customers who are still using <=3.10?

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


[PATCH] tile: fix build failure

2015-09-07 Thread Sudip Mukherjee
When building with allmodconfig the build was failing with the error:

arch/tile/kernel/usb.c:70:1: warning: data definition has no type or storage 
class [enabled by default]
arch/tile/kernel/usb.c:70:1: error: type defaults to 'int' in declaration of 
'arch_initcall' [-Werror=implicit-int]
arch/tile/kernel/usb.c:70:1: warning: parameter names (without types) in 
function declaration [enabled by default]
arch/tile/kernel/usb.c:63:19: warning: 'tilegx_usb_init' defined but not used 
[-Wunused-function]

Include linux/module.h to resolve the build failure.

Signed-off-by: Sudip Mukherjee 
---
 arch/tile/kernel/usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/tile/kernel/usb.c b/arch/tile/kernel/usb.c
index f0da5a2..9f1e05e 100644
--- a/arch/tile/kernel/usb.c
+++ b/arch/tile/kernel/usb.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 static u64 ehci_dmamask = DMA_BIT_MASK(32);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/4] xtensa: fix build failure

2015-09-08 Thread Sudip Mukherjee
While building with allmodconfig the build failed with different dma
related errors. It turned out that the dma functions were moved to
asm-generic/dma-mapping-common.h() and as a result we were getting the
errors of "redefinition".
This patch series will move the functions as required and at the end of
the series, allmodconfig builds.
Only build tested with allmodconfig, common_defconfig, iss_defconfig on
next-20150908.

Sudip Mukherjee (4):
  xtensa: fix error with dma_{alloc,free}_{attrs,coherent}
  xtensa: fix error with dma_supported
  xtensa: fix errors with dma_supported
  xtensa: fix error with dma_set_mask

 arch/xtensa/include/asm/dma-mapping.h | 57 +++
 1 file changed, 4 insertions(+), 53 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] xtensa: fix error with dma_{alloc,free}_{attrs,coherent}

2015-09-08 Thread Sudip Mukherjee
commit 59b5f4726434 ("dma-mapping: consolidate 
dma_{alloc,free}_{attrs,coherent}")
has removed dma_{alloc,free}_{attrs,coherent} functions from arch
specific files to asm-generic/dma-mapping-common.h. But they were not
removed for xtensa architecture and as a result we are getting errors
like:
error: redefinition of 'dma_alloc_attrs'
error: redefinition of 'dma_free_attrs'
while building with allmodconfig.

Signed-off-by: Sudip Mukherjee 
---
 arch/xtensa/include/asm/dma-mapping.h | 31 ---
 1 file changed, 31 deletions(-)

diff --git a/arch/xtensa/include/asm/dma-mapping.h 
b/arch/xtensa/include/asm/dma-mapping.h
index f01cb30..bf24c90 100644
--- a/arch/xtensa/include/asm/dma-mapping.h
+++ b/arch/xtensa/include/asm/dma-mapping.h
@@ -34,37 +34,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device 
*dev)
 
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
 #define dma_free_noncoherent(d, s, v, h) dma_free_attrs(d, s, v, h, NULL)
-#define dma_alloc_coherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
-#define dma_free_coherent(d, s, c, h) dma_free_attrs(d, s, c, h, NULL)
-
-static inline void *dma_alloc_attrs(struct device *dev, size_t size,
-   dma_addr_t *dma_handle, gfp_t gfp,
-   struct dma_attrs *attrs)
-{
-   void *ret;
-   struct dma_map_ops *ops = get_dma_ops(dev);
-
-   if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
-   return ret;
-
-   ret = ops->alloc(dev, size, dma_handle, gfp, attrs);
-   debug_dma_alloc_coherent(dev, size, *dma_handle, ret);
-
-   return ret;
-}
-
-static inline void dma_free_attrs(struct device *dev, size_t size,
- void *vaddr, dma_addr_t dma_handle,
- struct dma_attrs *attrs)
-{
-   struct dma_map_ops *ops = get_dma_ops(dev);
-
-   if (dma_release_from_coherent(dev, get_order(size), vaddr))
-   return;
-
-   ops->free(dev, size, vaddr, dma_handle, attrs);
-   debug_dma_free_coherent(dev, size, vaddr, dma_handle);
-}
 
 static inline int
 dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/4] xtensa: fix errors with dma_supported

2015-09-08 Thread Sudip Mukherjee
commit eec17ba9f049 ("dma-mapping: consolidate dma_supported") has
removed dma_supported() from individual arch files to
asm-generic/dma-mapping-common.h or if arch has its own implementation
then we need to set the flag HAVE_ARCH_DMA_SUPPORTED. Otherwise we were
getting error like:
error: redefinition of 'dma_supported'
while building with allmodconfig.

Signed-off-by: Sudip Mukherjee 
---
 arch/xtensa/include/asm/dma-mapping.h | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/xtensa/include/asm/dma-mapping.h 
b/arch/xtensa/include/asm/dma-mapping.h
index 5762d8d..019a94a 100644
--- a/arch/xtensa/include/asm/dma-mapping.h
+++ b/arch/xtensa/include/asm/dma-mapping.h
@@ -30,10 +30,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device 
*dev)
return &xtensa_dma_map_ops;
 }
 
-#include 
-
-#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
-#define dma_free_noncoherent(d, s, v, h) dma_free_attrs(d, s, v, h, NULL)
+#define HAVE_ARCH_DMA_SUPPORTED 1
 
 static inline int
 dma_supported(struct device *dev, u64 mask)
@@ -41,6 +38,11 @@ dma_supported(struct device *dev, u64 mask)
return 1;
 }
 
+#include 
+
+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
+#define dma_free_noncoherent(d, s, v, h) dma_free_attrs(d, s, v, h, NULL)
+
 static inline int
 dma_set_mask(struct device *dev, u64 mask)
 {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/4] xtensa: fix error with dma_set_mask

2015-09-08 Thread Sudip Mukherjee
commit 13bad70fb5ba ("dma-mapping: consolidate dma_set_mask") has
removed dma_set_mask() from individual arch files to
asm-generic/dma-mapping-common.h. But it was not removed for xtensa
architecture and as a result we were getting errors like:
error: redefinition of 'dma_set_mask'
while building with allmodconfig.

Signed-off-by: Sudip Mukherjee 
---
 arch/xtensa/include/asm/dma-mapping.h | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/arch/xtensa/include/asm/dma-mapping.h 
b/arch/xtensa/include/asm/dma-mapping.h
index 019a94a..15992a3 100644
--- a/arch/xtensa/include/asm/dma-mapping.h
+++ b/arch/xtensa/include/asm/dma-mapping.h
@@ -43,17 +43,6 @@ dma_supported(struct device *dev, u64 mask)
 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
 #define dma_free_noncoherent(d, s, v, h) dma_free_attrs(d, s, v, h, NULL)
 
-static inline int
-dma_set_mask(struct device *dev, u64 mask)
-{
-   if(!dev->dma_mask || !dma_supported(dev, mask))
-   return -EIO;
-
-   *dev->dma_mask = mask;
-
-   return 0;
-}
-
 void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
enum dma_data_direction direction);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/4] xtensa: fix error with dma_supported

2015-09-08 Thread Sudip Mukherjee
commit 11bd9421d0ad ("dma-mapping: cosolidate dma_mapping_error") has
removed dma_mapping_error() from arch specific file to
asm-generic/dma-mapping-common.h but it was not removed from xtensa
architecture and as a result we were getting error like:
error: redefinition of 'dma_mapping_error'
while building with allmodconfig.

Signed-off-by: Sudip Mukherjee 
---
 arch/xtensa/include/asm/dma-mapping.h | 9 -
 1 file changed, 9 deletions(-)

diff --git a/arch/xtensa/include/asm/dma-mapping.h 
b/arch/xtensa/include/asm/dma-mapping.h
index bf24c90..5762d8d 100644
--- a/arch/xtensa/include/asm/dma-mapping.h
+++ b/arch/xtensa/include/asm/dma-mapping.h
@@ -36,15 +36,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device 
*dev)
 #define dma_free_noncoherent(d, s, v, h) dma_free_attrs(d, s, v, h, NULL)
 
 static inline int
-dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
-{
-   struct dma_map_ops *ops = get_dma_ops(dev);
-
-   debug_dma_mapping_error(dev, dma_addr);
-   return ops->mapping_error(dev, dma_addr);
-}
-
-static inline int
 dma_supported(struct device *dev, u64 mask)
 {
return 1;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] staging: lustre: lov: remove always false condition

2015-09-08 Thread Sudip Mukherjee
The member qc_idx of struct if_quotactl is unsigned and hence it can
never be less than zero.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c 
b/drivers/staging/lustre/lustre/lov/lov_obd.c
index 2a2fd8d..906503b 100644
--- a/drivers/staging/lustre/lustre/lov/lov_obd.c
+++ b/drivers/staging/lustre/lustre/lov/lov_obd.c
@@ -1487,7 +1487,7 @@ static int lov_iocontrol(unsigned int cmd, struct 
obd_export *exp, int len,
struct obd_quotactl *oqctl;
 
if (qctl->qc_valid == QC_OSTIDX) {
-   if (qctl->qc_idx < 0 || count <= qctl->qc_idx)
+   if (count <= qctl->qc_idx)
return -EINVAL;
 
tgt = lov->lov_tgts[qctl->qc_idx];
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] staging: lustre: lov: fix dereference of ERR_PTR

2015-09-08 Thread Sudip Mukherjee
If lov_sub_get() fails then it returns the error code in ERR_PTR, but
here we were dereferencing sub without checking if lov_sub_get() has
actually succeeded or not. And on error we can directly return the error
code from lov_io_fault_start() as it return 0 on success and the error
code on error.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/lustre/lustre/lov/lov_io.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c 
b/drivers/staging/lustre/lustre/lov/lov_io.c
index bf36291..b5b2580 100644
--- a/drivers/staging/lustre/lustre/lov/lov_io.c
+++ b/drivers/staging/lustre/lustre/lov/lov_io.c
@@ -729,6 +729,8 @@ static int lov_io_fault_start(const struct lu_env *env,
fio = &ios->cis_io->u.ci_fault;
lio = cl2lov_io(env, ios);
sub = lov_sub_get(env, lio, lov_page_stripe(fio->ft_page));
+   if (IS_ERR(sub))
+   return PTR_ERR(sub);
sub->sub_io->u.ci_fault.ft_nob = fio->ft_nob;
lov_sub_put(sub);
return lov_io_start(env, ios);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] staging: lustre: lov: remove always false condition

2015-09-08 Thread Sudip Mukherjee
On Tue, Sep 08, 2015 at 09:53:09AM -0700, Joe Perches wrote:
> On Tue, 2015-09-08 at 21:53 +0530, Sudip Mukherjee wrote:
> > if (qctl->qc_valid == QC_OSTIDX) {
> > -   if (qctl->qc_idx < 0 || count <= qctl->qc_idx)
> > +   if (count <= qctl->qc_idx)
> 
> Perhaps this test would be clearer reversed too
> 
>   if (qctl->qc_idx >= count)
There are more such comparison in that file, like:
1) if (ost_idx >= lov->desc.ld_tgt_count)
2) if (index >= lov->lov_tgt_size)
and some more.
And if I include it in this patch then it will become separate change.
I will better send a separate patch for this.

Regards
Sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/4] xtensa: fix build failure

2015-09-09 Thread Sudip Mukherjee
On Tue, Sep 08, 2015 at 08:34:56PM +0300, Max Filippov wrote:
> Sudip,
> 
> On Tue, Sep 8, 2015 at 4:18 PM, Sudip Mukherjee
>  wrote:
> > While building with allmodconfig the build failed with different dma
> > related errors. It turned out that the dma functions were moved to
> > asm-generic/dma-mapping-common.h() and as a result we were getting the
> > errors of "redefinition".
> > This patch series will move the functions as required and at the end of
> > the series, allmodconfig builds.
> 
> I believe it's fixed in the -mm tree and will be merged soon,
> see the thread at https://lkml.org/lkml/2015/8/26/118
I guess its already merged in Linus tree now. I tested in the morning
with Linus tree and allmodconfig worked. But next-20150909 still failed.
BTW, yesterday when I was testing few of the defconfigs were not
working. Are they also being fixed?

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


[PATCH] drm/gma500: fix double freeing

2015-09-09 Thread Sudip Mukherjee
If backing->stolen is true then we were freeing backing by calling
psb_gtt_free_range() but we called it again after unlocking the mutex.
Lets make it NULL after freeing in psb_gtt_free_range() and check for
NULL before calling the function for the second time.

Signed-off-by: Sudip Mukherjee 
---
 drivers/gpu/drm/gma500/framebuffer.c | 3 ++-
 drivers/gpu/drm/gma500/gtt.c | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/gma500/framebuffer.c 
b/drivers/gpu/drm/gma500/framebuffer.c
index 2eaf1b3..381d7af 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -474,7 +474,8 @@ out_unref:
drm_fb_helper_release_fbi(&fbdev->psb_fb_helper);
 out_err1:
mutex_unlock(&dev->struct_mutex);
-   psb_gtt_free_range(dev, backing);
+   if (backing)
+   psb_gtt_free_range(dev, backing);
return ret;
 }
 
diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c
index ce015db..8130fa8 100644
--- a/drivers/gpu/drm/gma500/gtt.c
+++ b/drivers/gpu/drm/gma500/gtt.c
@@ -385,6 +385,7 @@ void psb_gtt_free_range(struct drm_device *dev, struct 
gtt_range *gt)
WARN_ON(gt->in_gart && !gt->stolen);
release_resource(>->resource);
kfree(gt);
+   gt = NULL;
 }
 
 static void psb_gtt_alloc(struct drm_device *dev)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/4] xtensa: fix build failure

2015-09-09 Thread Sudip Mukherjee
On Wed, Sep 09, 2015 at 03:52:11PM +0300, Max Filippov wrote:
> On Wed, Sep 9, 2015 at 10:11 AM, Sudip Mukherjee
>  wrote:
> > On Tue, Sep 08, 2015 at 08:34:56PM +0300, Max Filippov wrote:
> >> Sudip,
> >>
> >> On Tue, Sep 8, 2015 at 4:18 PM, Sudip Mukherjee
> >>  wrote:
> >> > While building with allmodconfig the build failed with different dma
> >> > related errors. It turned out that the dma functions were moved to
> >> > asm-generic/dma-mapping-common.h() and as a result we were getting the
> >> > errors of "redefinition".
> >> > This patch series will move the functions as required and at the end of
> >> > the series, allmodconfig builds.
> >>
> >> I believe it's fixed in the -mm tree and will be merged soon,
> >> see the thread at https://lkml.org/lkml/2015/8/26/118
> >
> > I guess its already merged in Linus tree now. I tested in the morning
> > with Linus tree and allmodconfig worked. But next-20150909 still failed.
> 
> AFAICS it's not merged yet: arch/xtensa/include/dma-mapping.h still
> has all functions deleted by patch in the mentioned thread.
Ohhh.. I didn't notice it in the morning. I saw Linus tree is building
and I thought it may have been merged. Now on checking I see that the
series by Christoph Hellwig which removes the arch specific functions is
still not in Linus tree and thats why I didnot get any error.


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


[PATCH] drm/nouveau: remove unused function

2015-09-01 Thread Sudip Mukherjee
coverity.com reported that memset was using a buffer of size 0, on
checking the code it turned out that the function was not being used. So
remove it.

Signed-off-by: Sudip Mukherjee 
---
 drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h |  2 --
 drivers/gpu/drm/nouveau/nvkm/subdev/bios/pmu.c | 13 -
 2 files changed, 15 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h 
b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h
index d606875..3a643df 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h
@@ -4,8 +4,6 @@ struct nvbios_pmuT {
 };
 
 u32 nvbios_pmuTe(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
-u32 nvbios_pmuTp(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
-struct nvbios_pmuT *);
 
 struct nvbios_pmuE {
u8  type;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pmu.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pmu.c
index 441ec45..c268e5a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pmu.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pmu.c
@@ -62,19 +62,6 @@ nvbios_pmuTe(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 
*cnt, u8 *len)
 }
 
 u32
-nvbios_pmuTp(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
-struct nvbios_pmuT *info)
-{
-   u32 data = nvbios_pmuTe(bios, ver, hdr, cnt, len);
-   memset(info, 0x00, sizeof(*info));
-   switch (!!data * *ver) {
-   default:
-   break;
-   }
-   return data;
-}
-
-u32
 nvbios_pmuEe(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr)
 {
u8  cnt, len;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kvm: irqchip: fix memory leak

2015-09-02 Thread Sudip Mukherjee
We were taking the exit path after checking ue->flags and return value
of setup_routing_entry(), but 'e' was not freed incase of a failure.

Signed-off-by: Sudip Mukherjee 
---
 virt/kvm/irqchip.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c
index 21c1424..c63e54f 100644
--- a/virt/kvm/irqchip.c
+++ b/virt/kvm/irqchip.c
@@ -213,11 +213,15 @@ int kvm_set_irq_routing(struct kvm *kvm,
goto out;
 
r = -EINVAL;
-   if (ue->flags)
+   if (ue->flags) {
+   kfree(e);
goto out;
+   }
r = setup_routing_entry(new, e, ue);
-   if (r)
+   if (r) {
+   kfree(e);
goto out;
+   }
++ue;
}
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] regulator: core: fix possible NULL dereference

2015-09-02 Thread Sudip Mukherjee
We were checking rdev->supply for NULL after dereferencing it. Lets
check for rdev->supply along with _regulator_is_enabled() and call
regulator_enable() only if rdev->supply is not NULL.

Signed-off-by: Sudip Mukherjee 
---
 drivers/regulator/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 7a85ac9..9283d9f 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1422,11 +1422,10 @@ static int regulator_resolve_supply(struct 
regulator_dev *rdev)
return ret;
 
/* Cascade always-on state to supply */
-   if (_regulator_is_enabled(rdev)) {
+   if (_regulator_is_enabled(rdev) && rdev->supply) {
ret = regulator_enable(rdev->supply);
if (ret < 0) {
-   if (rdev->supply)
-   _regulator_put(rdev->supply);
+   _regulator_put(rdev->supply);
return ret;
}
}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/4] drivers/misc/sgi-gru: fix dereference of ERR_PTR

2015-09-02 Thread Sudip Mukherjee
gru_alloc_gts() can fail and it can return ERR_PTR(errvalue). We should
not dereference it if it has returned error. And incase it has returned
error then just downgrade the write lock and exit.

Signed-off-by: Sudip Mukherjee 
---
 drivers/misc/sgi-gru/grukservices.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/misc/sgi-gru/grukservices.c 
b/drivers/misc/sgi-gru/grukservices.c
index a6fd773..369f7fe 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -161,6 +161,8 @@ static void gru_load_kernel_context(struct gru_blade_state 
*bs, int blade_id)
 
if (!bs->bs_kgts) {
bs->bs_kgts = gru_alloc_gts(NULL, 0, 0, 0, 0, 0);
+   if (IS_ERR(bs->bs_kgts))
+   goto err_gru_alloc_gts;
bs->bs_kgts->ts_user_blade_id = blade_id;
}
kgts = bs->bs_kgts;
@@ -184,6 +186,7 @@ static void gru_load_kernel_context(struct gru_blade_state 
*bs, int blade_id)
bs->kernel_cb = get_gseg_base_address_cb(vaddr, ctxnum, 0);
bs->kernel_dsr = get_gseg_base_address_ds(vaddr, ctxnum, 0);
}
+err_gru_alloc_gts:
downgrade_write(&bs->bs_kgts_sema);
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] drivers/misc/sgi-gru: remove unused variable

2015-09-02 Thread Sudip Mukherjee
These variables were only assigned some value and were never used.

Signed-off-by: Sudip Mukherjee 
---

I have removed the variables in the functions gru_dump_tfm() and
gru_dump_tgh() but it appeared that the intended logic might have been
something like:
bytes = GRU_NUM_TFM * GRU_CACHE_LINE_BYTES;
if (bytes > ubufend - ubuf)
return -EFBIG;

But since I was not sure so removing the variable was the safe choice as
it is not changing the logic.

 drivers/misc/sgi-gru/grukdump.c | 12 ++--
 drivers/misc/sgi-gru/grukservices.c |  2 --
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/misc/sgi-gru/grukdump.c b/drivers/misc/sgi-gru/grukdump.c
index a3700a5..fa515e3 100644
--- a/drivers/misc/sgi-gru/grukdump.c
+++ b/drivers/misc/sgi-gru/grukdump.c
@@ -78,11 +78,7 @@ static int gru_dump_tfm(struct gru_state *gru,
void __user *ubuf, void __user *ubufend)
 {
struct gru_tlb_fault_map *tfm;
-   int i, ret, bytes;
-
-   bytes = GRU_NUM_TFM * GRU_CACHE_LINE_BYTES;
-   if (bytes > ubufend - ubuf)
-   ret = -EFBIG;
+   int i;
 
for (i = 0; i < GRU_NUM_TFM; i++) {
tfm = get_tfm(gru->gs_gru_base_vaddr, i);
@@ -99,11 +95,7 @@ static int gru_dump_tgh(struct gru_state *gru,
void __user *ubuf, void __user *ubufend)
 {
struct gru_tlb_global_handle *tgh;
-   int i, ret, bytes;
-
-   bytes = GRU_NUM_TGH * GRU_CACHE_LINE_BYTES;
-   if (bytes > ubufend - ubuf)
-   ret = -EFBIG;
+   int i;
 
for (i = 0; i < GRU_NUM_TGH; i++) {
tgh = get_tgh(gru->gs_gru_base_vaddr, i);
diff --git a/drivers/misc/sgi-gru/grukservices.c 
b/drivers/misc/sgi-gru/grukservices.c
index 913de07..1f0bdab 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -997,7 +997,6 @@ static int quicktest1(unsigned long arg)
 {
struct gru_message_queue_desc mqd;
void *p, *mq;
-   unsigned long *dw;
int i, ret = -EIO;
char mes[GRU_CACHE_LINE_BYTES], *m;
 
@@ -1007,7 +1006,6 @@ static int quicktest1(unsigned long arg)
return -ENOMEM;
mq = ALIGNUP(p, 1024);
memset(mes, 0xee, sizeof(mes));
-   dw = mq;
 
gru_create_message_queue(&mqd, mq, 8 * GRU_CACHE_LINE_BYTES, 0, 0, 0);
for (i = 0; i < 6; i++) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/4] drivers/misc/sgi-gru: remove always false condition

2015-09-02 Thread Sudip Mukherjee
The member gid in struct gru_dump_chiplet_state_req is unsigned int. So
it can never be less than 0.

Signed-off-by: Sudip Mukherjee 
---
 drivers/misc/sgi-gru/grukdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/sgi-gru/grukdump.c b/drivers/misc/sgi-gru/grukdump.c
index fa515e3..dbba197 100644
--- a/drivers/misc/sgi-gru/grukdump.c
+++ b/drivers/misc/sgi-gru/grukdump.c
@@ -188,7 +188,7 @@ int gru_dump_chiplet_request(unsigned long arg)
return -EFAULT;
 
/* Currently, only dump by gid is implemented */
-   if (req.gid >= gru_max_gids || req.gid < 0)
+   if (req.gid >= gru_max_gids)
return -EINVAL;
 
gru = GID_TO_GRU(req.gid);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/4] drivers/misc/sgi-gru: make functions static

2015-09-02 Thread Sudip Mukherjee
The functions gru_get_cb_exception_detail_str() and gru_abort() were
only called locally from that file. We can make them static.

Signed-off-by: Sudip Mukherjee 
---
 drivers/misc/sgi-gru/grukservices.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/sgi-gru/grukservices.c 
b/drivers/misc/sgi-gru/grukservices.c
index 1f0bdab..a6fd773 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -429,8 +429,8 @@ int gru_get_cb_exception_detail(void *cb,
return 0;
 }
 
-char *gru_get_cb_exception_detail_str(int ret, void *cb,
- char *buf, int size)
+static char *gru_get_cb_exception_detail_str(int ret, void *cb,
+char *buf, int size)
 {
struct gru_control_block_status *gen = (void *)cb;
struct control_block_extended_exc_detail excdet;
@@ -505,7 +505,7 @@ int gru_wait_proc(void *cb)
return ret;
 }
 
-void gru_abort(int ret, void *cb, char *str)
+static void gru_abort(int ret, void *cb, char *str)
 {
char buf[GRU_EXC_STR_SIZE];
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/3] staging: sm7xxfb: move sm712fb out of staging

2015-09-02 Thread Sudip Mukherjee
On Wed, Sep 02, 2015 at 02:58:19PM +0300, Tomi Valkeinen wrote:
> On 01/09/15 16:55, Sudip Mukherjee wrote:
> > On Tue, Sep 01, 2015 at 04:27:24PM +0300, Tomi Valkeinen wrote:
> >> On 18/07/15 07:08, Sudip Mukherjee wrote:
> >>> Now since all cleanups are done and the code is ready to be merged lets
> >>> move it out of staging into fbdev location.

> > Some replies inline and remaining I will fix and send patches to you.
> 
> Wouldn't the time be better spent on the DRM driver?
> 
> This driver will be obsolete immediately when there's a DRM driver for
> this device, and then it'll be yet another obsoleted fbdev driver we
> need to maintain.
Now I am getting confused. :(
Since this has already been merged I guess we need to maintain it now.
So then should I fix the things you pointed out or should i instead
give more priority to the DRM driver and fix these things later?

And, just to inform you, there are two more fbdev drivers in staging,
staging/sm750fb and staging/fbtft. And the ultimate goal of any driver
in staging is to move out staging into the main part of the kernel. And
I expect sm750fb to be ready for moving before 4.6 merge window.
If you don't want any more fbdev drivers to be added then maybe you can
have a talk with Greg about this. He is already in the cc.

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


Re: [PATCH 1/4] drivers/misc/sgi-gru: remove unused variable

2015-09-02 Thread Sudip Mukherjee
On Wed, Sep 02, 2015 at 09:42:04AM -0500, Dimitri Sivanich wrote:
> On Wed, Sep 02, 2015 at 04:54:55PM +0530, Sudip Mukherjee wrote:
> > These variables were only assigned some value and were never used.
> > 
> > Signed-off-by: Sudip Mukherjee 
> > ---
> > 

> > +   int i;
> +
> + if ((GRU_NUM_TFM * GRU_CACHE_LINE_BYTES) > (ubufend - ubuf))
> + return -EFBIG;
Just a minor (or major) doubt.
The function returns GRU_NUM_TFM * GRU_CACHE_LINE_BYTES and the for loop
is also running till GRU_NUM_TFM so I am assuming that the function can
handle buffer till size of GRU_NUM_TFM * GRU_CACHE_LINE_BYTES. So the
error -EFBIG should occur when the buffer is more than this. Then
shouldn't it be:
if ((GRU_NUM_TFM * GRU_CACHE_LINE_BYTES) < (ubufend - ubuf))
return -EFBIG;

or i am wrong in interpreting it?

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


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

2015-09-02 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 
---
 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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/5] drivers/misc/sgi-gru: add return on error

2015-09-03 Thread Sudip Mukherjee
If the buffer is too small then return the error and in the process
remove the variables which became unused.

Signed-off-by: Sudip Mukherjee 
---

v1: only removed variables.

 drivers/misc/sgi-gru/grukdump.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/misc/sgi-gru/grukdump.c b/drivers/misc/sgi-gru/grukdump.c
index a3700a5..7e9aae5 100644
--- a/drivers/misc/sgi-gru/grukdump.c
+++ b/drivers/misc/sgi-gru/grukdump.c
@@ -78,11 +78,10 @@ static int gru_dump_tfm(struct gru_state *gru,
void __user *ubuf, void __user *ubufend)
 {
struct gru_tlb_fault_map *tfm;
-   int i, ret, bytes;
+   int i;
 
-   bytes = GRU_NUM_TFM * GRU_CACHE_LINE_BYTES;
-   if (bytes > ubufend - ubuf)
-   ret = -EFBIG;
+   if (GRU_NUM_TFM * GRU_CACHE_LINE_BYTES > ubufend - ubuf)
+   return -EFBIG;
 
for (i = 0; i < GRU_NUM_TFM; i++) {
tfm = get_tfm(gru->gs_gru_base_vaddr, i);
@@ -99,11 +98,10 @@ static int gru_dump_tgh(struct gru_state *gru,
void __user *ubuf, void __user *ubufend)
 {
struct gru_tlb_global_handle *tgh;
-   int i, ret, bytes;
+   int i;
 
-   bytes = GRU_NUM_TGH * GRU_CACHE_LINE_BYTES;
-   if (bytes > ubufend - ubuf)
-   ret = -EFBIG;
+   if (GRU_NUM_TGH * GRU_CACHE_LINE_BYTES > ubufend - ubuf)
+   return -EFBIG;
 
for (i = 0; i < GRU_NUM_TGH; i++) {
tgh = get_tgh(gru->gs_gru_base_vaddr, i);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 5/5] drivers/misc/sgi-gru: remove unused variable

2015-09-03 Thread Sudip Mukherjee
dw was only assigned some value and was never reused.

Signed-off-by: Sudip Mukherjee 
---

v2: It was part of first patch in v1. But since one logical change in
one patch so it had to be removed from first patch and became separate.

 drivers/misc/sgi-gru/grukservices.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/misc/sgi-gru/grukservices.c 
b/drivers/misc/sgi-gru/grukservices.c
index d64f2a0..ba2d2e5 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -1004,7 +1004,6 @@ static int quicktest1(unsigned long arg)
 {
struct gru_message_queue_desc mqd;
void *p, *mq;
-   unsigned long *dw;
int i, ret = -EIO;
char mes[GRU_CACHE_LINE_BYTES], *m;
 
@@ -1014,7 +1013,6 @@ static int quicktest1(unsigned long arg)
return -ENOMEM;
mq = ALIGNUP(p, 1024);
memset(mes, 0xee, sizeof(mes));
-   dw = mq;
 
gru_create_message_queue(&mqd, mq, 8 * GRU_CACHE_LINE_BYTES, 0, 0, 0);
for (i = 0; i < 6; i++) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 4/5] drivers/misc/sgi-gru: fix dereference of ERR_PTR

2015-09-03 Thread Sudip Mukherjee
gru_alloc_gts() can fail and it can return ERR_PTR(errvalue). We should
not dereference it if it has returned error. And incase it has returned
error then wait for some time and try again.

Signed-off-by: Sudip Mukherjee 
---

v2: on error retry after msleep(1).
v1: returned error.

 drivers/misc/sgi-gru/grukservices.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/sgi-gru/grukservices.c 
b/drivers/misc/sgi-gru/grukservices.c
index 490b79a..d64f2a0 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -160,7 +160,14 @@ static void gru_load_kernel_context(struct gru_blade_state 
*bs, int blade_id)
down_write(&bs->bs_kgts_sema);
 
if (!bs->bs_kgts) {
-   bs->bs_kgts = gru_alloc_gts(NULL, 0, 0, 0, 0, 0);
+   do {
+   bs->bs_kgts = gru_alloc_gts(NULL, 0, 0, 0, 0, 0);
+   if (IS_ERR(bs->bs_kgts)) {
+   msleep(1);
+   continue;
+   }
+   break;
+   } while (true);
bs->bs_kgts->ts_user_blade_id = blade_id;
}
kgts = bs->bs_kgts;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 3/5] drivers/misc/sgi-gru: remove always false condition

2015-09-03 Thread Sudip Mukherjee
The member gid in struct gru_dump_chiplet_state_req is unsigned int. So
it can never be less than 0.

Signed-off-by: Sudip Mukherjee 
Acked-by: Dimitri Sivanich 
---

v2: no change, sent as a part of the series.

 drivers/misc/sgi-gru/grukdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/sgi-gru/grukdump.c b/drivers/misc/sgi-gru/grukdump.c
index 7e9aae5..313da31 100644
--- a/drivers/misc/sgi-gru/grukdump.c
+++ b/drivers/misc/sgi-gru/grukdump.c
@@ -194,7 +194,7 @@ int gru_dump_chiplet_request(unsigned long arg)
return -EFAULT;
 
/* Currently, only dump by gid is implemented */
-   if (req.gid >= gru_max_gids || req.gid < 0)
+   if (req.gid >= gru_max_gids)
return -EINVAL;
 
gru = GID_TO_GRU(req.gid);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   4   5   6   7   8   9   10   >