From patchwork Mon Jan 28 08:33:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi Doyu X-Patchwork-Id: 14294 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C2DCE23F91 for ; Mon, 28 Jan 2013 08:33:38 +0000 (UTC) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by fiordland.canonical.com (Postfix) with ESMTP id 6262CA18385 for ; Mon, 28 Jan 2013 08:33:38 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id p1so1713624vcq.2 for ; Mon, 28 Jan 2013 00:33:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-pgp-universal:from:to:date:thread-topic:thread-index :message-id:accept-language:x-ms-has-attach:x-ms-tnef-correlator :x-nvconfidentiality:acceptlanguage:mime-version:cc:subject :x-beenthere:x-mailman-version:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=A6i4GmH0XSHqbLt3rt0ah6fBMb+GocrfpO8T0+HxiRQ=; b=IMb3hg4FfmcF4eRyhoHcFJsBkOleuG9qF/TiS+sula2PaEXzupohNzs1AbRtYakMHT ew/r+KxNZ+8XBg68EXIU1vKXA+4IsMOufAtFyROTPNmIyL3sazM/k1cclgwo4ETn5HUt BZL2ncMbkBujBd5ZEmZPd8YcR4bwSfKhPK63akJzT76PODAVJkaSCZnVMR7DnkAvNIiz 2oXCdcW9kR755zP2+KWRerZpqw77ois8yPcjetc1bvPXz3gEvKm5ci4xUAW7+Y6MXw3i hOzP8WC+W1sfaNHjOd+cOM3xSt01dLNp1mwgUdjkjGrPMHlJ7vG+az37kSOPliz/1f/t XfHg== X-Received: by 10.220.238.139 with SMTP id ks11mr13807621vcb.49.1359362017820; Mon, 28 Jan 2013 00:33:37 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp74795veb; Mon, 28 Jan 2013 00:33:37 -0800 (PST) X-Received: by 10.14.194.199 with SMTP id m47mr49656466een.11.1359362016524; Mon, 28 Jan 2013 00:33:36 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id k48si15203670een.244.2013.01.28.00.33.34; Mon, 28 Jan 2013 00:33:36 -0800 (PST) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tzk9j-0003Kl-Gm; Mon, 28 Jan 2013 08:33:31 +0000 Received: from hqemgate04.nvidia.com ([216.228.121.35]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tzk9h-0003HI-3C for linaro-mm-sig@lists.linaro.org; Mon, 28 Jan 2013 08:33:29 +0000 Received: from hqnvupgp06.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Mon, 28 Jan 2013 00:33:14 -0800 Received: from hqemhub03.nvidia.com ([172.17.108.22]) by hqnvupgp06.nvidia.com (PGP Universal service); Mon, 28 Jan 2013 00:31:40 -0800 X-PGP-Universal: processed; by hqnvupgp06.nvidia.com on Mon, 28 Jan 2013 00:31:40 -0800 Received: from deemhub01.nvidia.com (10.21.69.137) by hqemhub03.nvidia.com (172.20.150.15) with Microsoft SMTP Server (TLS) id 8.3.297.1; Mon, 28 Jan 2013 00:33:25 -0800 Received: from DEMAIL01.nvidia.com ([10.21.69.139]) by deemhub01.nvidia.com ([10.21.69.137]) with mapi; Mon, 28 Jan 2013 09:33:23 +0100 From: Hiroshi Doyu To: "linux-arm-kernel@lists.infradead.org" Date: Mon, 28 Jan 2013 09:33:20 +0100 Thread-Topic: [RFC] ARM: dma-mapping: Return 0 if no ->set_dma_mask() Thread-Index: Ac39MiJWGdm7lowTRbWr60sxPcew3w== Message-ID: <20130128.103320.355771370936761237.hdoyu@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-nvconfidentiality: public acceptlanguage: en-US MIME-Version: 1.0 Cc: "linaro-mm-sig@lists.linaro.org" Subject: [Linaro-mm-sig] [RFC] ARM: dma-mapping: Return 0 if no ->set_dma_mask() X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQlQrCunihPGGncNdk9BDJB+s66ebZhLkoKzgFAr6SdbC9DY9ubODCj5rKaXyZwNYZ/HGwiv struct dma_map_ops iommu_ops doesn't have ->set_dma_mask, which causes crash when dma_set_mask() is called from some driver. Signed-off-by: Hiroshi Doyu --- 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