All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.ibm.com>
To: "Ruhl, Michael J" <michael.j.ruhl@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Chris Wilson <chris@chris-wilson.co.uk>
Subject: Re: [PATCH] io-mapping: Indicate mapping failure
Date: Tue, 21 Jul 2020 18:06:52 +0300	[thread overview]
Message-ID: <20200721150652.GI802087@linux.ibm.com> (raw)
In-Reply-To: <14063C7AD467DE4B82DEDB5C278E866301245DF505@FMSMSX108.amr.corp.intel.com>

On Tue, Jul 21, 2020 at 03:00:41PM +0000, Ruhl, Michael J wrote:
> >-----Original Message-----
> >From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >Sent: Tuesday, July 21, 2020 10:47 AM
> >To: Ruhl, Michael J <michael.j.ruhl@intel.com>
> >Cc: dri-devel@lists.freedesktop.org; Andrew Morton <akpm@linux-
> >foundation.org>; Mike Rapoport <rppt@linux.ibm.com>; Chris Wilson
> ><chris@chris-wilson.co.uk>; stable@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 it's always a good idea ;-)

> >Can you elaborate...
> 
> Sure, guess I was too glib. 😊
> 
> Currently  the io_mapping_init_wc (the !ATOMIC_IOMAP version), function will
> always return success.
> 
> If the setting of the iomem (from ioremap_wc) fails, the only way for the 
> caller to know is to check the value of iomap->iomem.
> 
> Since all of the callers expect a NULL return on error, and check for a NULL,
> I felt this needed a fixes (i.e. unexpected behavior).
> 
> >> Fixes: cafaf14a5d8f ("io-mapping: Always create a struct to hold metadata
> >about the io-mapping"
> >
> >...especially taking into account that Fixes implies regression / bug?
> 
> The failure (in my case a crash) is not revealed until the address is accessed
> long after the init.
> 
> I will update the commit.
> 
> Mike
> 
> >--
> >With Best Regards,
> >Andy Shevchenko
> >
> 

-- 
Sincerely yours,
Mike.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Mike Rapoport <rppt@linux.ibm.com>
To: "Ruhl, Michael J" <michael.j.ruhl@intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] io-mapping: Indicate mapping failure
Date: Tue, 21 Jul 2020 18:06:52 +0300	[thread overview]
Message-ID: <20200721150652.GI802087@linux.ibm.com> (raw)
In-Reply-To: <14063C7AD467DE4B82DEDB5C278E866301245DF505@FMSMSX108.amr.corp.intel.com>

On Tue, Jul 21, 2020 at 03:00:41PM +0000, Ruhl, Michael J wrote:
> >-----Original Message-----
> >From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >Sent: Tuesday, July 21, 2020 10:47 AM
> >To: Ruhl, Michael J <michael.j.ruhl@intel.com>
> >Cc: dri-devel@lists.freedesktop.org; Andrew Morton <akpm@linux-
> >foundation.org>; Mike Rapoport <rppt@linux.ibm.com>; Chris Wilson
> ><chris@chris-wilson.co.uk>; stable@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 it's always a good idea ;-)

> >Can you elaborate...
> 
> Sure, guess I was too glib. 😊
> 
> Currently  the io_mapping_init_wc (the !ATOMIC_IOMAP version), function will
> always return success.
> 
> If the setting of the iomem (from ioremap_wc) fails, the only way for the 
> caller to know is to check the value of iomap->iomem.
> 
> Since all of the callers expect a NULL return on error, and check for a NULL,
> I felt this needed a fixes (i.e. unexpected behavior).
> 
> >> Fixes: cafaf14a5d8f ("io-mapping: Always create a struct to hold metadata
> >about the io-mapping"
> >
> >...especially taking into account that Fixes implies regression / bug?
> 
> The failure (in my case a crash) is not revealed until the address is accessed
> long after the init.
> 
> I will update the commit.
> 
> Mike
> 
> >--
> >With Best Regards,
> >Andy Shevchenko
> >
> 

-- 
Sincerely yours,
Mike.

  reply	other threads:[~2020-07-22  7:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 14:16 io-mapping: Indicate mapping failure Michael J. Ruhl
2020-07-21 14:16 ` [PATCH] " Michael J. Ruhl
2020-07-21 14:16   ` Michael J. Ruhl
2020-07-21 14:47   ` Andy Shevchenko
2020-07-21 14:47     ` Andy Shevchenko
2020-07-21 15:00     ` Ruhl, Michael J
2020-07-21 15:00       ` Ruhl, Michael J
2020-07-21 15:06       ` Mike Rapoport [this message]
2020-07-21 15:06         ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200721150652.GI802087@linux.ibm.com \
    --to=rppt@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=michael.j.ruhl@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.