All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb/gadget: fix gadgetfs aio support
@ 2016-07-08  6:15 Mathieu Laurendeau
  2016-07-08  9:24 ` kbuild test robot
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Mathieu Laurendeau @ 2016-07-08  6:15 UTC (permalink / raw)
  To: linux-usb; +Cc: Felipe Balbi, stable

Hi,

Since commit 7fe3976e0f3ab26f8ffd9430d3d2a19a70f2c8d2 ("gadget: switch
ep_io_operations to ->read_iter/->write_iter") io submissions fail with
ENODEV.

Fixes: 7fe3976e0f3a ("gadget: switch ep_io_operations to
->read_iter/->write_iter")
Signed-off-by: Mathieu Laurendeau <mat.lau@laposte.net>
---
 drivers/usb/gadget/legacy/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index aa3707b..120a03a 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -542,7 +542,7 @@ static ssize_t ep_aio(struct kiocb *iocb,
 	 */
 	spin_lock_irq(&epdata->dev->lock);
 	value = -ENODEV;
-	if (unlikely(epdata->ep))
+	if (unlikely(epdata->ep) == NULL)
 		goto fail;

 	req = usb_ep_alloc_request(epdata->ep, GFP_ATOMIC);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb/gadget: fix gadgetfs aio support
  2016-07-08  6:15 [PATCH] usb/gadget: fix gadgetfs aio support Mathieu Laurendeau
@ 2016-07-08  9:24 ` kbuild test robot
  2016-07-08  9:34 ` kbuild test robot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2016-07-08  9:24 UTC (permalink / raw)
  To: Mathieu Laurendeau; +Cc: kbuild-all, linux-usb, Felipe Balbi, stable

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

Hi,

[auto build test WARNING on balbi-usb/next]
[also build test WARNING on v4.7-rc6 next-20160707]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Mathieu-Laurendeau/usb-gadget-fix-gadgetfs-aio-support/20160708-164431
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
config: i386-randconfig-r0-07081252 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/usb/gadget/legacy/inode.c: In function 'ep_aio':
>> drivers/usb/gadget/legacy/inode.c:545:27: warning: comparison between pointer and integer
     if (unlikely(epdata->ep) == NULL)
                              ^~

vim +545 drivers/usb/gadget/legacy/inode.c

   529		ssize_t value;
   530	
   531		iocb->private = priv;
   532		priv->iocb = iocb;
   533	
   534		kiocb_set_cancel_fn(iocb, ep_aio_cancel);
   535		get_ep(epdata);
   536		priv->epdata = epdata;
   537		priv->actual = 0;
   538		priv->mm = current->mm; /* mm teardown waits for iocbs in exit_aio() */
   539	
   540		/* each kiocb is coupled to one usb_request, but we can't
   541		 * allocate or submit those if the host disconnected.
   542		 */
   543		spin_lock_irq(&epdata->dev->lock);
   544		value = -ENODEV;
 > 545		if (unlikely(epdata->ep) == NULL)
   546			goto fail;
   547	
   548		req = usb_ep_alloc_request(epdata->ep, GFP_ATOMIC);
   549		value = -ENOMEM;
   550		if (unlikely(!req))
   551			goto fail;
   552	
   553		priv->req = req;

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

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 31675 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb/gadget: fix gadgetfs aio support
  2016-07-08  6:15 [PATCH] usb/gadget: fix gadgetfs aio support Mathieu Laurendeau
  2016-07-08  9:24 ` kbuild test robot
@ 2016-07-08  9:34 ` kbuild test robot
  2016-07-08 10:00 ` kbuild test robot
  2016-07-08 11:01 ` Sergei Shtylyov
  3 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2016-07-08  9:34 UTC (permalink / raw)
  To: Mathieu Laurendeau; +Cc: kbuild-all, linux-usb, Felipe Balbi, stable

[-- Attachment #1: Type: text/plain, Size: 4900 bytes --]

Hi,

[auto build test WARNING on balbi-usb/next]
[also build test WARNING on v4.7-rc6 next-20160707]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Mathieu-Laurendeau/usb-gadget-fix-gadgetfs-aio-support/20160708-164431
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
config: x86_64-randconfig-s5-07081546 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/linux/init.h:4:0,
                    from drivers/usb/gadget/legacy/inode.c:16:
   drivers/usb/gadget/legacy/inode.c: In function 'ep_aio':
   drivers/usb/gadget/legacy/inode.c:545:27: warning: comparison between pointer and integer
     if (unlikely(epdata->ep) == NULL)
                              ^
   include/linux/compiler.h:151:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/usb/gadget/legacy/inode.c:545:2: note: in expansion of macro 'if'
     if (unlikely(epdata->ep) == NULL)
     ^~
   drivers/usb/gadget/legacy/inode.c:545:27: warning: comparison between pointer and integer
     if (unlikely(epdata->ep) == NULL)
                              ^
   include/linux/compiler.h:151:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^~~~
>> drivers/usb/gadget/legacy/inode.c:545:2: note: in expansion of macro 'if'
     if (unlikely(epdata->ep) == NULL)
     ^~
   drivers/usb/gadget/legacy/inode.c:545:27: warning: comparison between pointer and integer
     if (unlikely(epdata->ep) == NULL)
                              ^
   include/linux/compiler.h:162:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^~~~
>> drivers/usb/gadget/legacy/inode.c:545:2: note: in expansion of macro 'if'
     if (unlikely(epdata->ep) == NULL)
     ^~
--
   In file included from /kbuild/src/stress/include/linux/init.h:4:0,
                    from /kbuild/src/stress/drivers/usb/gadget/legacy/inode.c:16:
   /kbuild/src/stress/drivers/usb/gadget/legacy/inode.c: In function 'ep_aio':
   /kbuild/src/stress/drivers/usb/gadget/legacy/inode.c:545:27: warning: comparison between pointer and integer
     if (unlikely(epdata->ep) == NULL)
                              ^
   /kbuild/src/stress/include/linux/compiler.h:151:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> /kbuild/src/stress/drivers/usb/gadget/legacy/inode.c:545:2: note: in expansion of macro 'if'
     if (unlikely(epdata->ep) == NULL)
     ^~
   /kbuild/src/stress/drivers/usb/gadget/legacy/inode.c:545:27: warning: comparison between pointer and integer
     if (unlikely(epdata->ep) == NULL)
                              ^
   /kbuild/src/stress/include/linux/compiler.h:151:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^~~~
>> /kbuild/src/stress/drivers/usb/gadget/legacy/inode.c:545:2: note: in expansion of macro 'if'
     if (unlikely(epdata->ep) == NULL)
     ^~
   /kbuild/src/stress/drivers/usb/gadget/legacy/inode.c:545:27: warning: comparison between pointer and integer
     if (unlikely(epdata->ep) == NULL)
                              ^
   /kbuild/src/stress/include/linux/compiler.h:162:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^~~~
>> /kbuild/src/stress/drivers/usb/gadget/legacy/inode.c:545:2: note: in expansion of macro 'if'
     if (unlikely(epdata->ep) == NULL)
     ^~

vim +/if +545 drivers/usb/gadget/legacy/inode.c

   529		ssize_t value;
   530	
   531		iocb->private = priv;
   532		priv->iocb = iocb;
   533	
   534		kiocb_set_cancel_fn(iocb, ep_aio_cancel);
   535		get_ep(epdata);
   536		priv->epdata = epdata;
   537		priv->actual = 0;
   538		priv->mm = current->mm; /* mm teardown waits for iocbs in exit_aio() */
   539	
   540		/* each kiocb is coupled to one usb_request, but we can't
   541		 * allocate or submit those if the host disconnected.
   542		 */
   543		spin_lock_irq(&epdata->dev->lock);
   544		value = -ENODEV;
 > 545		if (unlikely(epdata->ep) == NULL)
   546			goto fail;
   547	
   548		req = usb_ep_alloc_request(epdata->ep, GFP_ATOMIC);
   549		value = -ENOMEM;
   550		if (unlikely(!req))
   551			goto fail;
   552	
   553		priv->req = req;

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

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 31636 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb/gadget: fix gadgetfs aio support
  2016-07-08  6:15 [PATCH] usb/gadget: fix gadgetfs aio support Mathieu Laurendeau
  2016-07-08  9:24 ` kbuild test robot
  2016-07-08  9:34 ` kbuild test robot
@ 2016-07-08 10:00 ` kbuild test robot
  2016-07-08 11:01 ` Sergei Shtylyov
  3 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2016-07-08 10:00 UTC (permalink / raw)
  To: Mathieu Laurendeau; +Cc: kbuild-all, linux-usb, Felipe Balbi, stable

Hi,

[auto build test WARNING on balbi-usb/next]
[also build test WARNING on v4.7-rc6 next-20160707]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Mathieu-Laurendeau/usb-gadget-fix-gadgetfs-aio-support/20160708-164431
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/compiler.h:232:8: sparse: attribute 'no_sanitize_address': unknown attribute
>> drivers/usb/gadget/legacy/inode.c:545:34: sparse: incompatible types for operation (==)
   drivers/usb/gadget/legacy/inode.c:545:34:    left side has type int
   drivers/usb/gadget/legacy/inode.c:545:34:    right side has type void *
   drivers/usb/gadget/legacy/inode.c: In function 'ep_aio':
   drivers/usb/gadget/legacy/inode.c:545:27: warning: comparison between pointer and integer
     if (unlikely(epdata->ep) == NULL)
                              ^~

vim +545 drivers/usb/gadget/legacy/inode.c

   529		ssize_t value;
   530	
   531		iocb->private = priv;
   532		priv->iocb = iocb;
   533	
   534		kiocb_set_cancel_fn(iocb, ep_aio_cancel);
   535		get_ep(epdata);
   536		priv->epdata = epdata;
   537		priv->actual = 0;
   538		priv->mm = current->mm; /* mm teardown waits for iocbs in exit_aio() */
   539	
   540		/* each kiocb is coupled to one usb_request, but we can't
   541		 * allocate or submit those if the host disconnected.
   542		 */
   543		spin_lock_irq(&epdata->dev->lock);
   544		value = -ENODEV;
 > 545		if (unlikely(epdata->ep) == NULL)
   546			goto fail;
   547	
   548		req = usb_ep_alloc_request(epdata->ep, GFP_ATOMIC);
   549		value = -ENOMEM;
   550		if (unlikely(!req))
   551			goto fail;
   552	
   553		priv->req = req;

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb/gadget: fix gadgetfs aio support
  2016-07-08  6:15 [PATCH] usb/gadget: fix gadgetfs aio support Mathieu Laurendeau
                   ` (2 preceding siblings ...)
  2016-07-08 10:00 ` kbuild test robot
@ 2016-07-08 11:01 ` Sergei Shtylyov
  2016-07-08 11:28   ` Mathieu Laurendeau
  3 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2016-07-08 11:01 UTC (permalink / raw)
  To: Mathieu Laurendeau, linux-usb; +Cc: Felipe Balbi, stable

Hello.

On 7/8/2016 9:15 AM, Mathieu Laurendeau wrote:

> Hi,

    Greetings should not be a part of the patch description.

> Since commit 7fe3976e0f3ab26f8ffd9430d3d2a19a70f2c8d2 ("gadget: switch
> ep_io_operations to ->read_iter/->write_iter") io submissions fail with
> ENODEV.
>
> Fixes: 7fe3976e0f3a ("gadget: switch ep_io_operations to
> ->read_iter/->write_iter")
> Signed-off-by: Mathieu Laurendeau <mat.lau@laposte.net>
> ---
>  drivers/usb/gadget/legacy/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
> index aa3707b..120a03a 100644
> --- a/drivers/usb/gadget/legacy/inode.c
> +++ b/drivers/usb/gadget/legacy/inode.c
> @@ -542,7 +542,7 @@ static ssize_t ep_aio(struct kiocb *iocb,
>  	 */
>  	spin_lock_irq(&epdata->dev->lock);
>  	value = -ENODEV;
> -	if (unlikely(epdata->ep))
> +	if (unlikely(epdata->ep) == NULL)

    This placement of the inner parens doesn't make sense, you should enclose 
the whole comparison.

[...]

MBR, Sergei


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] usb/gadget: fix gadgetfs aio support
  2016-07-08 11:01 ` Sergei Shtylyov
@ 2016-07-08 11:28   ` Mathieu Laurendeau
  0 siblings, 0 replies; 7+ messages in thread
From: Mathieu Laurendeau @ 2016-07-08 11:28 UTC (permalink / raw)
  To: Sergei Shtylyov, linux-usb; +Cc: Felipe Balbi, stable

I'll resend the patch. Sorry for the noise.

Le 08/07/2016 13:01, Sergei Shtylyov a écrit :
> Hello.
> 
> On 7/8/2016 9:15 AM, Mathieu Laurendeau wrote:
> 
>> Hi,
> 
>    Greetings should not be a part of the patch description.
> 
>> Since commit 7fe3976e0f3ab26f8ffd9430d3d2a19a70f2c8d2 ("gadget: switch
>> ep_io_operations to ->read_iter/->write_iter") io submissions fail with
>> ENODEV.
>>
>> Fixes: 7fe3976e0f3a ("gadget: switch ep_io_operations to
>> ->read_iter/->write_iter")
>> Signed-off-by: Mathieu Laurendeau <mat.lau@laposte.net>
>> ---
>>  drivers/usb/gadget/legacy/inode.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
>> index aa3707b..120a03a 100644
>> --- a/drivers/usb/gadget/legacy/inode.c
>> +++ b/drivers/usb/gadget/legacy/inode.c
>> @@ -542,7 +542,7 @@ static ssize_t ep_aio(struct kiocb *iocb,
>>       */
>>      spin_lock_irq(&epdata->dev->lock);
>>      value = -ENODEV;
>> -    if (unlikely(epdata->ep))
>> +    if (unlikely(epdata->ep) == NULL)
> 
>    This placement of the inner parens doesn't make sense, you should enclose the whole comparison.
> 
> [...]
> 
> MBR, Sergei
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] usb/gadget: fix gadgetfs aio support.
@ 2016-07-15 12:58 Mathieu Laurendeau
  0 siblings, 0 replies; 7+ messages in thread
From: Mathieu Laurendeau @ 2016-07-15 12:58 UTC (permalink / raw)
  To: balbi; +Cc: gregkh, linux-usb, linux-kernel, stable

Fix io submissions failing with ENODEV.

Signed-off-by: Mathieu Laurendeau <mat.lau@laposte.net>
Fixes: 7fe3976e0f3a ("gadget: switch ep_io_operations to ->read_iter/->write_iter")
---
 drivers/usb/gadget/legacy/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index aa3707b..be64798 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -542,7 +542,7 @@ static ssize_t ep_aio(struct kiocb *iocb,
 	 */
 	spin_lock_irq(&epdata->dev->lock);
 	value = -ENODEV;
-	if (unlikely(epdata->ep))
+	if (unlikely(epdata->ep == NULL))
 		goto fail;
 
 	req = usb_ep_alloc_request(epdata->ep, GFP_ATOMIC);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-07-15 13:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08  6:15 [PATCH] usb/gadget: fix gadgetfs aio support Mathieu Laurendeau
2016-07-08  9:24 ` kbuild test robot
2016-07-08  9:34 ` kbuild test robot
2016-07-08 10:00 ` kbuild test robot
2016-07-08 11:01 ` Sergei Shtylyov
2016-07-08 11:28   ` Mathieu Laurendeau
2016-07-15 12:58 Mathieu Laurendeau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.