All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
Cc: catalin.marinas-5wv7dgnIgG8@public.gmane.org,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	will.deacon-5wv7dgnIgG8@public.gmane.org,
	Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH] arm64: remove dummy_dma_ops
Date: Thu, 2 Aug 2018 14:43:28 +0200	[thread overview]
Message-ID: <20180802124328.GA24812@lst.de> (raw)
In-Reply-To: <bbb22836-8f2f-5b2f-4801-342643fd9c1b-5wv7dgnIgG8@public.gmane.org>

On Thu, Aug 02, 2018 at 01:32:17PM +0100, Robin Murphy wrote:
> On 02/08/18 13:13, Christoph Hellwig wrote:
>> Returning NULL from get_arch_dma_ops makes all DMA mapping routines
>> retourn sensible errors, so remove the dummy ops.
>
> Does it? AFAICS all of the non-optional callbacks will still either 
> BUG_ON(!ops) or blindly dereference the null pointer. Have I lost track of 
> another cleanup patch somewhere?

First thing any driver needs to do is dma_set_mask, which first calls
dma_supported:

static inline int dma_supported(struct device *dev, u64 mask)
{
        const struct dma_map_ops *ops = get_dma_ops(dev);

	if (!ops)
		return 0;
	...
}

WARNING: multiple messages have this Message-ID (diff)
From: hch@lst.de (Christoph Hellwig)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: remove dummy_dma_ops
Date: Thu, 2 Aug 2018 14:43:28 +0200	[thread overview]
Message-ID: <20180802124328.GA24812@lst.de> (raw)
In-Reply-To: <bbb22836-8f2f-5b2f-4801-342643fd9c1b@arm.com>

On Thu, Aug 02, 2018 at 01:32:17PM +0100, Robin Murphy wrote:
> On 02/08/18 13:13, Christoph Hellwig wrote:
>> Returning NULL from get_arch_dma_ops makes all DMA mapping routines
>> retourn sensible errors, so remove the dummy ops.
>
> Does it? AFAICS all of the non-optional callbacks will still either 
> BUG_ON(!ops) or blindly dereference the null pointer. Have I lost track of 
> another cleanup patch somewhere?

First thing any driver needs to do is dma_set_mask, which first calls
dma_supported:

static inline int dma_supported(struct device *dev, u64 mask)
{
        const struct dma_map_ops *ops = get_dma_ops(dev);

	if (!ops)
		return 0;
	...
}

  parent reply	other threads:[~2018-08-02 12:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02 12:13 [PATCH] arm64: remove dummy_dma_ops Christoph Hellwig
2018-08-02 12:13 ` Christoph Hellwig
     [not found] ` <20180802121318.5785-1-hch-jcswGhMUV9g@public.gmane.org>
2018-08-02 12:32   ` Robin Murphy
2018-08-02 12:32     ` Robin Murphy
     [not found]     ` <bbb22836-8f2f-5b2f-4801-342643fd9c1b-5wv7dgnIgG8@public.gmane.org>
2018-08-02 12:43       ` Christoph Hellwig [this message]
2018-08-02 12:43         ` Christoph Hellwig
     [not found]         ` <20180802124328.GA24812-jcswGhMUV9g@public.gmane.org>
2018-08-03 15:05           ` Robin Murphy
2018-08-03 15:05             ` Robin Murphy

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=20180802124328.GA24812@lst.de \
    --to=hch-jcswghmuv9g@public.gmane.org \
    --cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.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.