From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D93D5C31E5E for ; Wed, 19 Jun 2019 16:29:06 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD3D22173E for ; Wed, 19 Jun 2019 16:29:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Mu7sgXi6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD3D22173E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 815BFCCC; Wed, 19 Jun 2019 16:29:06 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id A0DA1CC9 for ; Wed, 19 Jun 2019 16:29:05 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 38BB2832 for ; Wed, 19 Jun 2019 16:29:05 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id t8so11320544qkt.1 for ; Wed, 19 Jun 2019 09:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qnUOwWGBCAXAVLri1Ul0fDjUeERWKjKVp0Rio+t6Mw0=; b=Mu7sgXi6O1BEfTzeAxDFiZq9WYAU+8GuA+frzMgX9hRk0/2Eo2VPU9VKN7SPqn7GLw BMmvCbBlMZt8BrrdyjrzJb5mIwmN+Un5ohC6uh52oLeiu3fM9lYGSfsBxw2N/in8YFn5 94JBdMTWXqhPkHC5ogDkAk30Vj3tK2OB7FH+D8RuRjkNrh4KSwvNzZkKLQDt1o6UXnKk akxzg79p5LQYrNgI6wQWhEDCa4i3Wr2Q3GuDm1M6C6XhuTkbEI5dQ8Rzs09QxzMXG/yv 86i6u7h1UReQ+1KLg8ARX3o5vtg8COFFdiinD/3xnzFLxOpaxmET6WHLpP1penmwv6Fz qw4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qnUOwWGBCAXAVLri1Ul0fDjUeERWKjKVp0Rio+t6Mw0=; b=GBitddsFr3YgWuTF4v4gCkuCmlNibH5Ep0Ql3nmisePt+GdxCBfnvxSvXZZATLb5h8 skAUxTVxqmHNRGO/47rhfaUn8J/kAU+DF75E50/FMNl37TFa62CHjk5LBWTRstCcFLgM dR7BRKk/wwwfHwuEyfhkwdfiZn7qMH0uD/Is5wF9UR+nlvIDFZmVkekDpUVXqG0mSu+n r1ip08WjCkkL/PAlUc6mGhra4Z2gmg2WAnD00K3O9mBZjPBEHSmVO4dIvEFXOeHUVCdj SaIZwd5EtN9EacLR0Kzo1bIpm8KyaN4U3t13sO7SvhAXJae7GEG0g3QCX7+wY+TLmXVG kxcg== X-Gm-Message-State: APjAAAWLW//b7U5IdAYjlAwr4nGUj+GzsP6xfFxx8c+qmD1M5DXP1F+E f5Leegt7meycLhwQZakpBzYWyw== X-Google-Smtp-Source: APXvYqxI2A2AbFb1+ZoFRIh7H3fg512a+PNV8rhMF80/TQ7Ui3RJ5j2fJJDqC3jWu2+hRHD8V09puw== X-Received: by 2002:a37:5444:: with SMTP id i65mr23556982qkb.263.1560961744340; Wed, 19 Jun 2019 09:29:04 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-55-100.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.55.100]) by smtp.gmail.com with ESMTPSA id n5sm11854916qta.29.2019.06.19.09.29.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 09:29:03 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hddSJ-0001sf-Di; Wed, 19 Jun 2019 13:29:03 -0300 Date: Wed, 19 Jun 2019 13:29:03 -0300 From: Jason Gunthorpe To: Christoph Hellwig , Potnuri Bharat Teja Subject: Re: use exact allocation for dma coherent memory Message-ID: <20190619162903.GF9360@ziepe.ca> References: <20190614134726.3827-1-hch@lst.de> <20190617082148.GF28859@kadam> <20190617083342.GA7883@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190617083342.GA7883@lst.de> User-Agent: Mutt/1.9.4 (2018-02-28) Cc: Maxime Ripard , Joonas Lahtinen , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, David Airlie , Dan Carpenter , linux-media@vger.kernel.org, Intel Linux Wireless , intel-gfx@lists.freedesktop.org, Maarten Lankhorst , Jani Nikula , Ian Abbott , Rodrigo Vivi , Sean Paul , "moderated list:ARM PORT" , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, H Hartley Sweeten , iommu@lists.linux-foundation.org, Daniel Vetter X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org On Mon, Jun 17, 2019 at 10:33:42AM +0200, Christoph Hellwig wrote: > > drivers/infiniband/hw/cxgb4/qp.c > > 129 static int alloc_host_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) > > 130 { > > 131 sq->queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), sq->memsize, > > 132 &(sq->dma_addr), GFP_KERNEL); > > 133 if (!sq->queue) > > 134 return -ENOMEM; > > 135 sq->phys_addr = virt_to_phys(sq->queue); > > 136 dma_unmap_addr_set(sq, mapping, sq->dma_addr); > > 137 return 0; > > 138 } > > > > Is this a bug? > > Yes. This will blow up badly on many platforms, as sq->queue > might be vmapped, ioremapped, come from a pool without page backing. Gah, this addr gets fed into io_remap_pfn_range/remap_pfn_range too.. Potnuri, you should fix this.. You probably need to use dma_mmap_from_dev_coherent() in the mmap ? Jason _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: use exact allocation for dma coherent memory Date: Wed, 19 Jun 2019 13:29:03 -0300 Message-ID: <20190619162903.GF9360@ziepe.ca> References: <20190614134726.3827-1-hch@lst.de> <20190617082148.GF28859@kadam> <20190617083342.GA7883@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190617083342.GA7883@lst.de> Sender: linux-kernel-owner@vger.kernel.org To: Christoph Hellwig , Potnuri Bharat Teja Cc: Dan Carpenter , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Ian Abbott , H Hartley Sweeten , devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, Intel Linux Wireless , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, iommu@lists.linux-foundati List-Id: linux-rdma@vger.kernel.org On Mon, Jun 17, 2019 at 10:33:42AM +0200, Christoph Hellwig wrote: > > drivers/infiniband/hw/cxgb4/qp.c > > 129 static int alloc_host_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) > > 130 { > > 131 sq->queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), sq->memsize, > > 132 &(sq->dma_addr), GFP_KERNEL); > > 133 if (!sq->queue) > > 134 return -ENOMEM; > > 135 sq->phys_addr = virt_to_phys(sq->queue); > > 136 dma_unmap_addr_set(sq, mapping, sq->dma_addr); > > 137 return 0; > > 138 } > > > > Is this a bug? > > Yes. This will blow up badly on many platforms, as sq->queue > might be vmapped, ioremapped, come from a pool without page backing. Gah, this addr gets fed into io_remap_pfn_range/remap_pfn_range too.. Potnuri, you should fix this.. You probably need to use dma_mmap_from_dev_coherent() in the mmap ? Jason From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f196.google.com ([209.85.222.196]:35718 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727198AbfFSQ3F (ORCPT ); Wed, 19 Jun 2019 12:29:05 -0400 Received: by mail-qk1-f196.google.com with SMTP id l128so11324631qke.2 for ; Wed, 19 Jun 2019 09:29:04 -0700 (PDT) Date: Wed, 19 Jun 2019 13:29:03 -0300 From: Jason Gunthorpe Subject: Re: use exact allocation for dma coherent memory Message-ID: <20190619162903.GF9360@ziepe.ca> References: <20190614134726.3827-1-hch@lst.de> <20190617082148.GF28859@kadam> <20190617083342.GA7883@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190617083342.GA7883@lst.de> Sender: linux-s390-owner@vger.kernel.org List-ID: To: Christoph Hellwig , Potnuri Bharat Teja Cc: Dan Carpenter , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Ian Abbott , H Hartley Sweeten , devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, Intel Linux Wireless , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, "moderated list:ARM PORT" , linux-media@vger.kernel.org On Mon, Jun 17, 2019 at 10:33:42AM +0200, Christoph Hellwig wrote: > > drivers/infiniband/hw/cxgb4/qp.c > > 129 static int alloc_host_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) > > 130 { > > 131 sq->queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), sq->memsize, > > 132 &(sq->dma_addr), GFP_KERNEL); > > 133 if (!sq->queue) > > 134 return -ENOMEM; > > 135 sq->phys_addr = virt_to_phys(sq->queue); > > 136 dma_unmap_addr_set(sq, mapping, sq->dma_addr); > > 137 return 0; > > 138 } > > > > Is this a bug? > > Yes. This will blow up badly on many platforms, as sq->queue > might be vmapped, ioremapped, come from a pool without page backing. Gah, this addr gets fed into io_remap_pfn_range/remap_pfn_range too.. Potnuri, you should fix this.. You probably need to use dma_mmap_from_dev_coherent() in the mmap ? Jason From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49997C31E5B for ; Wed, 19 Jun 2019 16:29:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D5BE2173E for ; Wed, 19 Jun 2019 16:29:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hkqijP3Y"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Mu7sgXi6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D5BE2173E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SePPs3AZY9dJxuuLCMut0E2oTbR5Vhm36pVUpbnGLtE=; b=hkqijP3Y1Keh85 bxJGWPOno8I0kt6vItjhY+js9IXi7YLXQEJ0MnsYi+c4aaBKg4uG4cz4ytRkvvzPjBaxDqiyfpRVL tIHDZf/Oo8Z8cji9wKBPyJuMTee3nwG9JdiP64LGb/kqTt7c+KgO8m0NCDqnlnT48Edr5AGXMjHtF DFEJ5qCsrz5MSojsC6Iv10u8M4SeAx7S2GH99mW6PfUEwoVdm1sagMRbERKqg6noOEhnZbm4MeFn2 j3OnMU5KfANE6P/x4kJliprPuna+FVFCDdOmlXaKHOR4AWRY4KcGBfZarvJ03zLlXvYhTsMbXwKwg G/J5Ml5mW2hgKWdYJlOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hddSO-0006IB-MH; Wed, 19 Jun 2019 16:29:08 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hddSM-0006HB-AC for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2019 16:29:07 +0000 Received: by mail-qk1-x743.google.com with SMTP id r6so11347104qkc.0 for ; Wed, 19 Jun 2019 09:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qnUOwWGBCAXAVLri1Ul0fDjUeERWKjKVp0Rio+t6Mw0=; b=Mu7sgXi6O1BEfTzeAxDFiZq9WYAU+8GuA+frzMgX9hRk0/2Eo2VPU9VKN7SPqn7GLw BMmvCbBlMZt8BrrdyjrzJb5mIwmN+Un5ohC6uh52oLeiu3fM9lYGSfsBxw2N/in8YFn5 94JBdMTWXqhPkHC5ogDkAk30Vj3tK2OB7FH+D8RuRjkNrh4KSwvNzZkKLQDt1o6UXnKk akxzg79p5LQYrNgI6wQWhEDCa4i3Wr2Q3GuDm1M6C6XhuTkbEI5dQ8Rzs09QxzMXG/yv 86i6u7h1UReQ+1KLg8ARX3o5vtg8COFFdiinD/3xnzFLxOpaxmET6WHLpP1penmwv6Fz qw4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qnUOwWGBCAXAVLri1Ul0fDjUeERWKjKVp0Rio+t6Mw0=; b=LqnGdKSIIKqHZ5zcA9RUjYyJxydx5oh9EpXzsTtGUzrFKHxA/mxddH8Y7u9vztTAC8 NQlBxLbyDZNP6ZOdA0aulpduOsJl5bjNm57qIuV+eSpaRlGs/pKBQSCnOYZjLnJN02qx 4+HkoAiH3875a3BUVJnRDNWYOXFS7j4GCW7OzMYajB3WsbEUFWQPzp7TNsX7iAj3NOVu 6Y5/wKt0wRZGecC4tdwUQybsryTERwRaFECY4Q8ppXiOkhR5A723G8MILfoUkVYFTnJB Tx7FAmkVeBxENYLMUdZ5qWqbNQKKDfge11o3r9V28X1e6kqd0c3DPcVQjzQzHDBgzHze rJLA== X-Gm-Message-State: APjAAAWPxcBVjm6cHOJA46adQ85lW49js073+BDP1n3g0t39Ve3kvPfo PvMdmih2QaMHDnyH1YHXcBLynA== X-Google-Smtp-Source: APXvYqxI2A2AbFb1+ZoFRIh7H3fg512a+PNV8rhMF80/TQ7Ui3RJ5j2fJJDqC3jWu2+hRHD8V09puw== X-Received: by 2002:a37:5444:: with SMTP id i65mr23556982qkb.263.1560961744340; Wed, 19 Jun 2019 09:29:04 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-55-100.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.55.100]) by smtp.gmail.com with ESMTPSA id n5sm11854916qta.29.2019.06.19.09.29.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 09:29:03 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hddSJ-0001sf-Di; Wed, 19 Jun 2019 13:29:03 -0300 Date: Wed, 19 Jun 2019 13:29:03 -0300 From: Jason Gunthorpe To: Christoph Hellwig , Potnuri Bharat Teja Subject: Re: use exact allocation for dma coherent memory Message-ID: <20190619162903.GF9360@ziepe.ca> References: <20190614134726.3827-1-hch@lst.de> <20190617082148.GF28859@kadam> <20190617083342.GA7883@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190617083342.GA7883@lst.de> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190619_092906_534801_C1D26960 X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Joonas Lahtinen , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, David Airlie , Dan Carpenter , linux-media@vger.kernel.org, Intel Linux Wireless , intel-gfx@lists.freedesktop.org, Maarten Lankhorst , Jani Nikula , Ian Abbott , Rodrigo Vivi , Sean Paul , "moderated list:ARM PORT" , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, H Hartley Sweeten , iommu@lists.linux-foundation.org, Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 17, 2019 at 10:33:42AM +0200, Christoph Hellwig wrote: > > drivers/infiniband/hw/cxgb4/qp.c > > 129 static int alloc_host_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) > > 130 { > > 131 sq->queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), sq->memsize, > > 132 &(sq->dma_addr), GFP_KERNEL); > > 133 if (!sq->queue) > > 134 return -ENOMEM; > > 135 sq->phys_addr = virt_to_phys(sq->queue); > > 136 dma_unmap_addr_set(sq, mapping, sq->dma_addr); > > 137 return 0; > > 138 } > > > > Is this a bug? > > Yes. This will blow up badly on many platforms, as sq->queue > might be vmapped, ioremapped, come from a pool without page backing. Gah, this addr gets fed into io_remap_pfn_range/remap_pfn_range too.. Potnuri, you should fix this.. You probably need to use dma_mmap_from_dev_coherent() in the mmap ? Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel