Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-18 Thread John Hubbard
On 9/17/20 7:21 PM, Souptick Joarder wrote: On Thu, Sep 17, 2020 at 11:17 PM John Hubbard wrote: ... I sort of feel like returning partial successes is not working. We could easily make a wrapper which either pins everything or it returns an error code. Yes we could. And I have the same

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-18 Thread Dan Carpenter
On Fri, Sep 18, 2020 at 07:55:05AM +0530, Souptick Joarder wrote: > Hi Dan, > > On Thu, Sep 17, 2020 at 6:10 PM Dan Carpenter > wrote: > > > > On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > > > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > > > There is

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-17 Thread Souptick Joarder
Hi Dan, On Thu, Sep 17, 2020 at 6:10 PM Dan Carpenter wrote: > > On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > > There is an error when pin_user_pages_fast() returns -ERRNO and > > > inside error handling

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-17 Thread Souptick Joarder
On Thu, Sep 17, 2020 at 11:17 PM John Hubbard wrote: > > On 9/17/20 10:34 AM, Ira Weiny wrote: > > On Thu, Sep 17, 2020 at 03:39:51PM +0300, Dan Carpenter wrote: > >> On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > >>> On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-17 Thread John Hubbard
On 9/17/20 10:34 AM, Ira Weiny wrote: On Thu, Sep 17, 2020 at 03:39:51PM +0300, Dan Carpenter wrote: On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: There is an error when pin_user_pages_fast() returns -ERRNO and

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-17 Thread Ira Weiny
On Thu, Sep 17, 2020 at 03:39:51PM +0300, Dan Carpenter wrote: > On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > > There is an error when pin_user_pages_fast() returns -ERRNO and > > > inside error handling

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-17 Thread Dan Carpenter
On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > There is an error when pin_user_pages_fast() returns -ERRNO and > > inside error handling path driver end up calling unpin_user_pages() > > with -ERRNO which is

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread Ira Weiny
On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > There is an error when pin_user_pages_fast() returns -ERRNO and > > inside error handling path driver end up calling unpin_user_pages() > > with -ERRNO which is

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread Dan Carpenter
On Wed, Sep 16, 2020 at 08:16:09AM -0700, Ira Weiny wrote: > On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > > There is an error when pin_user_pages_fast() returns -ERRNO and > > > inside error handling path

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread Ira Weiny
On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > There is an error when pin_user_pages_fast() returns -ERRNO and > inside error handling path driver end up calling unpin_user_pages() > with -ERRNO which is not correct. > > This patch will fix the problem. > > Fixes:

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread Dan Carpenter
On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > There is an error when pin_user_pages_fast() returns -ERRNO and > > inside error handling path driver end up calling unpin_user_pages() > > with -ERRNO which is

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread Dan Carpenter
On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > There is an error when pin_user_pages_fast() returns -ERRNO and > inside error handling path driver end up calling unpin_user_pages() > with -ERRNO which is not correct. > > This patch will fix the problem. There are a few ways

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread John Hubbard
On 9/15/20 8:42 PM, Souptick Joarder wrote: There is an error when pin_user_pages_fast() returns -ERRNO and inside error handling path driver end up calling unpin_user_pages() with -ERRNO which is not correct. > This patch will fix the problem. How about: rio_dma_transfer() attempts to clamp

[linux-next PATCH] rapidio: Fix error handling path

2020-09-15 Thread Souptick Joarder
There is an error when pin_user_pages_fast() returns -ERRNO and inside error handling path driver end up calling unpin_user_pages() with -ERRNO which is not correct. This patch will fix the problem. Fixes: e8de370188d09 ("rapidio: add mport char device driver") Signed-off-by: Souptick Joarder