RE: [PATCH v2] io-mapping: Indicate mapping failure

2020-07-22 Thread Ruhl, Michael J
>-Original Message- >From: Andrew Morton >Sent: Tuesday, July 21, 2020 5:24 PM >To: Ruhl, Michael J >Cc: dri-devel@lists.freedesktop.org; Mike Rapoport ; >Andy Shevchenko ; Chris Wilson >; sta...@vger.kernel.org >Subject: Re: [PATCH v2] io-mapping: Indicate mappi

Re: [PATCH v1] io-mapping: Indicate mapping failure

2020-07-22 Thread Andy Shevchenko
On Tue, Jul 21, 2020 at 11:34:26AM -0400, Michael J. Ruhl wrote: Thanks for an update, my comments below. > The !ATOMIC_IOMAP version of io_maping_init_wc will always return > success, even when the ioremap fails. > > Since the ATOMIC_IOMAP version returns NULL when the init fails, and > callers

Re: [PATCH] io-mapping: Indicate mapping failure

2020-07-22 Thread Andy Shevchenko
On Tue, Jul 21, 2020 at 10:16:41AM -0400, Michael J. Ruhl wrote: > Sometimes it is good to know when your mapping failed. Can you elaborate... > Fixes: cafaf14a5d8f ("io-mapping: Always create a struct to hold metadata > about the io-mapping" ...especially taking into account that Fixes implies

Re: [PATCH] io-mapping: Indicate mapping failure

2020-07-22 Thread Mike Rapoport
ike Rapoport ; Chris Wilson > >; sta...@vger.kernel.org > >Subject: Re: [PATCH] io-mapping: Indicate mapping failure > > > >On Tue, Jul 21, 2020 at 10:16:41AM -0400, Michael J. Ruhl wrote: > >> Sometimes it is good to know when your mapping failed. I was going to say

Re: io-mapping: Indicate mapping failure

2020-07-22 Thread Andy Shevchenko
On Tue, Jul 21, 2020 at 11:34:25AM -0400, Michael J. Ruhl wrote: > I found this when my system crashed long after the mapping failure. > The expected behavior should have been driver exit. > > Since this is almost exclusively used for drm, I am posting to > the dri mailing list. Should this go to

Re: [PATCH v2] io-mapping: Indicate mapping failure

2020-07-21 Thread Daniel Vetter
On Tue, Jul 21, 2020 at 11:24 PM Andrew Morton wrote: > > On Tue, 21 Jul 2020 21:02:44 + "Ruhl, Michael J" > wrote: > > > >--- a/include/linux/io-mapping.h~io-mapping-indicate-mapping-failure-fix > > >+++ a/include/linux/io-mapping.h > > &

Re: [PATCH v2] io-mapping: Indicate mapping failure

2020-07-21 Thread Andrew Morton
On Tue, 21 Jul 2020 21:02:44 + "Ruhl, Michael J" wrote: > >--- a/include/linux/io-mapping.h~io-mapping-indicate-mapping-failure-fix > >+++ a/include/linux/io-mapping.h > >@@ -107,9 +107,12 @@ io_mapping_init_wc(struct io_mapping *io > >

RE: [PATCH v2] io-mapping: Indicate mapping failure

2020-07-21 Thread Ruhl, Michael J
>-Original Message- >From: Andrew Morton >Sent: Tuesday, July 21, 2020 4:57 PM >To: Ruhl, Michael J >Cc: dri-devel@lists.freedesktop.org; Mike Rapoport ; >Andy Shevchenko ; Chris Wilson >; sta...@vger.kernel.org >Subject: Re: [PATCH v2] io-mapping: Indicate mappi

Re: [PATCH v2] io-mapping: Indicate mapping failure

2020-07-21 Thread Andrew Morton
would be stylistically better/typical to detect and handle the error early, rather than to blunder on, pointlessly initializing things? --- a/include/linux/io-mapping.h~io-mapping-indicate-mapping-failure-fix +++ a/include/linux/io-mapping.h @@ -107,9 +107,12 @@ io_mapping_init_wc(struct io_mapping *i

[PATCH v2] io-mapping: Indicate mapping failure

2020-07-21 Thread Michael J. Ruhl
The !ATOMIC_IOMAP version of io_maping_init_wc will always return success, even when the ioremap fails. Since the ATOMIC_IOMAP version returns NULL when the init fails, and callers check for a NULL return on error this is unexpected. During a device probe, where the ioremap failed, a crash can lo

[PATCH v1] io-mapping: Indicate mapping failure

2020-07-21 Thread Michael J. Ruhl
The !ATOMIC_IOMAP version of io_maping_init_wc will always return success, even when the ioremap fails. Since the ATOMIC_IOMAP version returns NULL when the init fails, and callers check for a NULL return on error this is unexpected. Return NULL on ioremap failure. Fixes: cafaf14a5d8f ("io-mappi

io-mapping: Indicate mapping failure

2020-07-21 Thread Michael J. Ruhl
I found this when my system crashed long after the mapping failure. The expected behavior should have been driver exit. Since this is almost exclusively used for drm, I am posting to the dri mailing list. Should this go to another list as well? Thanks, Mike Cc: Mike Rapoport Cc: Andy Shevchen

RE: [PATCH] io-mapping: Indicate mapping failure

2020-07-21 Thread Ruhl, Michael J
>-Original Message- >From: Andy Shevchenko >Sent: Tuesday, July 21, 2020 10:47 AM >To: Ruhl, Michael J >Cc: dri-devel@lists.freedesktop.org; Andrew Morton foundation.org>; Mike Rapoport ; Chris Wilson >; sta...@vger.kernel.org >Subject: Re: [PATCH] io-mapping:

[PATCH] io-mapping: Indicate mapping failure

2020-07-21 Thread Michael J. Ruhl
Sometimes it is good to know when your mapping failed. Fixes: cafaf14a5d8f ("io-mapping: Always create a struct to hold metadata about the io-mapping" Cc: Andrew Morton Cc: Mike Rapoport Cc: Andy Shevchenko Cc: Chris Wilson Cc: sta...@vger.kernel.org Signed-off-by: Michael J. Ruhl --- inclu

io-mapping: Indicate mapping failure

2020-07-21 Thread Michael J. Ruhl
I found this when my system crashed long after the mapping failure. The expected behavior should have been driver exit. Since this is almost exclusively used for drm, I am posting to the dri mailing list. Should this go to another list as well? Thanks, Mike __