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 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 > > >@@ -107,9 +107,12 @@ io_mapping_init_wc(struct

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 > >resource_size_t base, > >

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
On Tue, 21 Jul 2020 13:19:36 -0400 "Michael J. Ruhl" wrote: > 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

[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