All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Peter Geis <pgwipeout@gmail.com>
Cc: Shawn Lin <shawn.lin@rock-chips.com>,
	Simon Xue <xxm@rock-chips.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	linux-pci@vger.kernel.org,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Johan Jonker <jbx6244@gmail.com>,
	Heiko Stuebner <heiko@sntech.de>
Subject: Re: [PATCH v7] PCI: rockchip: Add Rockchip RK356X host controller driver
Date: Thu, 29 Apr 2021 07:41:17 +0100	[thread overview]
Message-ID: <20210429064117.GA2214470@infradead.org> (raw)
In-Reply-To: <CAMdYzYr=i7X22-38VyY-GQLWs+aV+ZcWwO_uDymFxmaNO8SpmA@mail.gmail.com>

On Wed, Apr 28, 2021 at 09:42:37PM -0400, Peter Geis wrote:
> I have functional MSI support, some devices do not support MSIs
> however and need legacy INTx.
> I'd like to point out that the downstream patch does not actually work
> on downstream.
> The GFP_DMA32 flag is discarded by the slab allocator, this breaks MSI
> allocation when the PCIe driver probes.
> I hacked together my own version which works but would definitely not
> be accepted for submission.

Seriously folks.  Never, ever use GFP_DMA or GFP_DMA32 in actual driver
code.  They fundamentally don't do what you want.  Devices as a rule of
thumb do care about DMA addressability, not CPU addressability, so they
must use the DMA API to allocate the memory, and the dma mask to control
addressability.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Peter Geis <pgwipeout@gmail.com>
Cc: Shawn Lin <shawn.lin@rock-chips.com>,
	Simon Xue <xxm@rock-chips.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	linux-pci@vger.kernel.org,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Johan Jonker <jbx6244@gmail.com>,
	Heiko Stuebner <heiko@sntech.de>
Subject: Re: [PATCH v7] PCI: rockchip: Add Rockchip RK356X host controller driver
Date: Thu, 29 Apr 2021 07:41:17 +0100	[thread overview]
Message-ID: <20210429064117.GA2214470@infradead.org> (raw)
In-Reply-To: <CAMdYzYr=i7X22-38VyY-GQLWs+aV+ZcWwO_uDymFxmaNO8SpmA@mail.gmail.com>

On Wed, Apr 28, 2021 at 09:42:37PM -0400, Peter Geis wrote:
> I have functional MSI support, some devices do not support MSIs
> however and need legacy INTx.
> I'd like to point out that the downstream patch does not actually work
> on downstream.
> The GFP_DMA32 flag is discarded by the slab allocator, this breaks MSI
> allocation when the PCIe driver probes.
> I hacked together my own version which works but would definitely not
> be accepted for submission.

Seriously folks.  Never, ever use GFP_DMA or GFP_DMA32 in actual driver
code.  They fundamentally don't do what you want.  Devices as a rule of
thumb do care about DMA addressability, not CPU addressability, so they
must use the DMA API to allocate the memory, and the dma mask to control
addressability.

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  parent reply	other threads:[~2021-04-29  6:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  7:03 [PATCH v7] PCI: rockchip: Add Rockchip RK356X host controller driver Simon Xue
2021-04-14  7:03 ` Simon Xue
2021-04-28 16:20 ` Peter Geis
2021-04-28 16:20   ` Peter Geis
2021-04-29  0:46   ` Shawn Lin
2021-04-29  1:42     ` Peter Geis
2021-04-29  1:42       ` Peter Geis
2021-04-29  6:32       ` Shawn Lin
2021-04-29 11:21         ` Peter Geis
2021-04-29 11:21           ` Peter Geis
2021-04-29  6:41       ` Christoph Hellwig [this message]
2021-04-29  6:41         ` Christoph Hellwig
     [not found]         ` <CAMdYzYrbfD-jFC3uPVPkhjXWZGeaUw5X=0w1Q=m-6OuhEGOKkQ@mail.gmail.com>
     [not found]           ` <20210429115451.GA2287423@infradead.org>
2021-04-29 12:16             ` Peter Geis
2021-04-29 12:16               ` Peter Geis

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=20210429064117.GA2214470@infradead.org \
    --to=hch@infradead.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=jbx6244@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=pgwipeout@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=xxm@rock-chips.com \
    /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.