All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Fabio Estevam <festevam@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	ath10k@lists.infradead.org, Ulf Hansson <ulf.hansson@linaro.org>,
	Bough Chen <haibo.chen@nxp.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: imx7: dev->coherent_dma_mask NULL warning
Date: Wed, 18 Aug 2021 07:11:28 +0200	[thread overview]
Message-ID: <20210818051128.GA8550@lst.de> (raw)
In-Reply-To: <CAOMZO5DEAMMKHwDkXxqWxg6uj_GQjBUQ5jV+4AzxAr2DCrgTVg@mail.gmail.com>

On Tue, Aug 17, 2021 at 09:23:26PM -0300, Fabio Estevam wrote:
> 
> void *dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle,
> ....
> WARN_ON_ONCE(!dev->coherent_dma_mask);
> 
> Where should the coherent_dma_mask be set to avoid this problem?

Looking at the ath10k code ar->dev is set by ath10k_core_create, which
has multiple callers.

For ath10k_pci_probe it is a pci_dev, whoch should always have a
dma_mask.
For ath10k_ahb_probe is is a device tree probed platform_device,
which should have a dma mask.
For ath10k_sdio_probe it is a sdio_func, which from my understanding is
a virtual device can't do DMA itself.
For ath10k_snoc_probe it is a platform device wit an explicit
dma_set_mask_and_coherent and above so the dma_mask is set.
For ath10k_usb_probe it is an usb device which can't do USB

So unless I misred the driver you're using the SDIO or USB variant,
and those are not allowed to just call dma_* functions on their
respective devices.

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Fabio Estevam <festevam@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	ath10k@lists.infradead.org, Ulf Hansson <ulf.hansson@linaro.org>,
	Bough Chen <haibo.chen@nxp.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: imx7: dev->coherent_dma_mask NULL warning
Date: Wed, 18 Aug 2021 07:11:28 +0200	[thread overview]
Message-ID: <20210818051128.GA8550@lst.de> (raw)
In-Reply-To: <CAOMZO5DEAMMKHwDkXxqWxg6uj_GQjBUQ5jV+4AzxAr2DCrgTVg@mail.gmail.com>

On Tue, Aug 17, 2021 at 09:23:26PM -0300, Fabio Estevam wrote:
> 
> void *dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle,
> ....
> WARN_ON_ONCE(!dev->coherent_dma_mask);
> 
> Where should the coherent_dma_mask be set to avoid this problem?

Looking at the ath10k code ar->dev is set by ath10k_core_create, which
has multiple callers.

For ath10k_pci_probe it is a pci_dev, whoch should always have a
dma_mask.
For ath10k_ahb_probe is is a device tree probed platform_device,
which should have a dma mask.
For ath10k_sdio_probe it is a sdio_func, which from my understanding is
a virtual device can't do DMA itself.
For ath10k_snoc_probe it is a platform device wit an explicit
dma_set_mask_and_coherent and above so the dma_mask is set.
For ath10k_usb_probe it is an usb device which can't do USB

So unless I misred the driver you're using the SDIO or USB variant,
and those are not allowed to just call dma_* functions on their
respective devices.

  reply	other threads:[~2021-08-18  5:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  0:23 imx7: dev->coherent_dma_mask NULL warning Fabio Estevam
2021-08-18  0:23 ` Fabio Estevam
2021-08-18  5:11 ` Christoph Hellwig [this message]
2021-08-18  5:11   ` Christoph Hellwig
2021-08-18  9:31   ` Fabio Estevam
2021-08-18  9:31     ` Fabio Estevam
2021-08-18 13:28     ` Christoph Hellwig
2021-08-18 13:28       ` Christoph Hellwig
2021-08-18 13:37       ` Fabio Estevam
2021-08-18 13:37         ` Fabio Estevam
2021-08-18 14:47         ` Fabio Estevam
2021-08-18 14:47           ` Fabio Estevam

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=20210818051128.GA8550@lst.de \
    --to=hch@lst.de \
    --cc=ath10k@lists.infradead.org \
    --cc=festevam@gmail.com \
    --cc=haibo.chen@nxp.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.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.