linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-mm@kvack.org, mhocko@kernel.org, cl@linux.com,
	Jan Kara <jack@suse.cz>,
	matthew@wil.cx, x86@kernel.org, luto@amacapital.net,
	martin.petersen@oracle.com, jthumshirn@suse.de,
	broonie@kernel.org, Juergen Gross <jgross@suse.com>,
	linux-spi@vger.kernel.org, Joerg Roedel <joro@8bytes.org>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	"lsf-pc@lists.linux-foundation.org"
	<lsf-pc@lists.linux-foundation.org>
Subject: Re: [LSF/MM TOPIC NOTES] x86 ZONE_DMA love
Date: Sat, 28 Apr 2018 13:41:18 -0700	[thread overview]
Message-ID: <20180428204118.GA3305@bombadil.infradead.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1804282145450.2532@hadrien>

On Sat, Apr 28, 2018 at 09:46:52PM +0200, Julia Lawall wrote:
> FWIW, here is my semantic patch and the output - it reports on things that
> appear to be too small and things that it doesn't know about.
> 
> What are the relevant pci wrappers?  I didn't find them.

Basically all of the functions in include/linux/pci-dma-compat.h

> too small: drivers/gpu/drm/i915/i915_drv.c:1138: 30
> too small: drivers/net/wireless/broadcom/b43/dma.c:1068: 30
> unknown: sound/pci/ctxfi/cthw20k2.c:2033: DMA_BIT_MASK(dma_bits)
> unknown: sound/pci/ctxfi/cthw20k2.c:2034: DMA_BIT_MASK(dma_bits)

This one's good:

        const unsigned int dma_bits = BITS_PER_LONG;

> unknown: drivers/scsi/megaraid/megaraid_sas_base.c:6036: consistent_mask

and this one:
        consistent_mask = (instance->adapter_type == VENTURA_SERIES) ?
                                DMA_BIT_MASK(64) : DMA_BIT_MASK(32);

> unknown: drivers/net/wireless/ath/wil6210/txrx.c:200: DMA_BIT_MASK(wil->dma_addr_size)

        if (wil->dma_addr_size > 32)
                dma_set_mask_and_coherent(dev,
                                          DMA_BIT_MASK(wil->dma_addr_size));

> unknown: drivers/net/ethernet/netronome/nfp/nfp_main.c:452: DMA_BIT_MASK(NFP_NET_MAX_DMA_BITS)

drivers/net/ethernet/netronome/nfp/nfp_net.h:#define NFP_NET_MAX_DMA_BITS       40

> unknown: drivers/gpu/host1x/dev.c:199: host->info->dma_mask

Looks safe ...

drivers/gpu/host1x/bus.c:       device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask;
drivers/gpu/host1x/bus.c:       device->dev.dma_mask = &device->dev.coherent_dma_mask;
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(32),
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(32),
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(34),
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(34),
drivers/gpu/host1x/dev.c:       .dma_mask = DMA_BIT_MASK(34),
drivers/gpu/host1x/dev.c:       dma_set_mask_and_coherent(host->dev, host->info->dma_mask);
drivers/gpu/host1x/dev.h:       u64 dma_mask; /* mask of addressable memory */

... but that reminds us that maybe some drivers aren't using dma_set_mask()
but rather touching dma_mask directly.

... 57 more to look at ...

  reply	other threads:[~2018-04-28 20:41 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 21:54 [LSF/MM TOPIC NOTES] x86 ZONE_DMA love Luis R. Rodriguez
2018-04-27  1:09 ` [Lsf-pc] " Rik van Riel
2018-04-27  5:35 ` Christoph Hellwig
2018-04-27  7:18   ` Michal Hocko
2018-04-27 16:07     ` Christopher Lameter
2018-04-27 16:18       ` Matthew Wilcox
2018-04-27 16:36         ` Christopher Lameter
2018-04-28  8:33           ` Christoph Hellwig
2018-04-27 16:37       ` Michal Hocko
2018-04-28  8:33       ` Christoph Hellwig
2018-04-28  8:30     ` Christoph Hellwig
2018-04-27 16:14   ` Luis R. Rodriguez
2018-04-27 16:28     ` Matthew Wilcox
2018-04-28  8:42     ` Christoph Hellwig
2018-04-28 18:55       ` Luis R. Rodriguez
2018-04-28 19:46         ` Julia Lawall
2018-04-28 20:41           ` Matthew Wilcox [this message]
2018-04-29 14:34             ` Julia Lawall
     [not found]         ` <CAFhKne8u7KcBkpgiQ0fFZyh5_EorfY-_MJJaEYk3feCOd9LsRQ@mail.gmail.com>
2018-05-03 12:03           ` Michal Hocko
2018-05-03 12:13             ` Christoph Hellwig
2018-05-03  8:20 ` Geert Uytterhoeven
2018-05-05 16:08 ` Are media drivers abusing of GFP_DMA? - was: " Mauro Carvalho Chehab
2018-05-07 13:26   ` Laurent Pinchart
2018-05-07 15:19     ` Mauro Carvalho Chehab
2018-05-14  8:00       ` Fabien DESSENNE
2018-05-14 10:35         ` Mauro Carvalho Chehab
2018-05-14 10:39           ` Mauro Carvalho Chehab
2018-05-15  7:30             ` Fabien DESSENNE
2018-05-15  8:27               ` Laurent Pinchart
2018-05-15 10:30                 ` Mauro Carvalho Chehab
2018-05-15 16:24           ` Luis R. Rodriguez
2018-05-10  4:39   ` Yasunari.Takiguchi

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=20180428204118.GA3305@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=broonie@kernel.org \
    --cc=cl@linux.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=jgross@suse.com \
    --cc=joro@8bytes.org \
    --cc=jthumshirn@suse.de \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=luto@amacapital.net \
    --cc=martin.petersen@oracle.com \
    --cc=matthew@wil.cx \
    --cc=mcgrof@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).