public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: m.szyprowski@samsung•com (Marek Szyprowski)
To: linux-arm-kernel@lists•infradead.org
Subject: [RFC] ARM: dma-mapping: Return 0 if no ->set_dma_mask()
Date: Tue, 29 Jan 2013 12:31:13 +0100	[thread overview]
Message-ID: <5107B301.2060802@samsung.com> (raw)
In-Reply-To: <20130128.103320.355771370936761237.hdoyu@nvidia.com>

Hello,

On 1/28/2013 9:33 AM, Hiroshi Doyu wrote:
> struct dma_map_ops iommu_ops doesn't have ->set_dma_mask, which causes
> crash when dma_set_mask() is called from some driver.

I think that the issue is a bit different. It looks that iommu_ops lacks
the mandatory set_dma_mask callback. arm_dma_set_mask() can be used for it,
so please update your patch to add this missing callback.

> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia•com>
> ---
>   arch/arm/include/asm/dma-mapping.h |    6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
> index a58e0f5..95328bf 100644
> --- a/arch/arm/include/asm/dma-mapping.h
> +++ b/arch/arm/include/asm/dma-mapping.h
> @@ -32,7 +32,11 @@ static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops)
>   
>   static inline int dma_set_mask(struct device *dev, u64 mask)
>   {
> -	return get_dma_ops(dev)->set_dma_mask(dev, mask);
> +	struct dma_map_ops *ops = get_dma_ops(dev);
> +
> +	if (ops->set_dma_mask)
> +		return ops->set_dma_mask(dev, mask);
> +	return 0;
>   }
>   
>   #ifdef __arch_page_to_dma

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center

  reply	other threads:[~2013-01-29 11:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28  8:33 [RFC] ARM: dma-mapping: Return 0 if no ->set_dma_mask() Hiroshi Doyu
2013-01-29 11:31 ` Marek Szyprowski [this message]
2013-01-29 12:27   ` [v2 1/1] ARM: dma-mapping: Call arm_dma_set_mask() " Hiroshi Doyu
2013-01-29 12:47     ` Marek Szyprowski
2013-01-29 12:57       ` [v3 1/1] ARM: dma-mapping: Set arm_dma_set_mask() for iommu->set_dma_mask() Hiroshi Doyu

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=5107B301.2060802@samsung.com \
    --to=m.szyprowski@samsung$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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