Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp585833ybv; Wed, 5 Feb 2020 10:46:21 -0800 (PST) X-Google-Smtp-Source: APXvYqytaSbRQdx1t8FU4+l58Ai4xdfuANbER+zZbd6i9krozTqF0QjrFMY+3+hKl3q4bStGgBaB X-Received: by 2002:a54:4117:: with SMTP id l23mr3917894oic.140.1580928381185; Wed, 05 Feb 2020 10:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580928381; cv=none; d=google.com; s=arc-20160816; b=jzKRVtOQ/FqR4rHQG3vpE4zgO3JQIrAgELvBkg8jIw1/z/68GhB+bC+m+r3g8j6gF4 wEhZoT6152AWrQBXHa6nBbIjrfnJgZEjrOAb2v5FlmdtgNhFExMUDMjLaKTWL3pTfoiR /ntsLll/ucvRZgb71P22yp0qoa/Hgz8MX/W+fOKsNUVZFuJAjg/WJeaxsaJKNrBkXdiP 1ne84qDPRBeZ5lPRsMpmoFVNMUzeuR/iGNNk0MXQtkzUe65Tq0G1SYLfypwEIlm50Ytq DEzg2O0I6wZ4DhM8ZKwU7YMeImQIm1Nos5PdnmS8giN9dbR+TPyOb19gdHzO+Ps3gctq QDPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=ZUCD5tdE1PbDWeBAp0hPO4Sa8gywjaH99I9g45cHbLE=; b=e2yO7Vjt7i9xZVozEEPyOyjbMbYBS0NDhDqojTyTFBheH8fvj0jz/V6rg4kOwxqsG2 hD7uN+yF8p77M8TL6Ku8PoTzUXh7yx16UN7PdcLMdomOr26iOpY34d/BOEwTEfnwVCQF uskNeHI6PkIswusjZhnySuDkhgRSIDP+rMof1+vF90HKbkSOVhZwDCIGv+Xr+Q6vsPSa aQeKPyaBHRZV+n+3JIof4oYlWgBLXG+uOzFXHqcVeoU9C1c9VdBu40H8LXimqD7qhnX8 GfZTJX28FhWV3NEZPuruNR4gPHUDJn88u8wtDgxu/MLVopOaMXwZICOAMDarO8koe7Py tgFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si195851otp.200.2020.02.05.10.46.08; Wed, 05 Feb 2020 10:46:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727440AbgBESoL (ORCPT + 99 others); Wed, 5 Feb 2020 13:44:11 -0500 Received: from ale.deltatee.com ([207.54.116.67]:55462 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727081AbgBESoL (ORCPT ); Wed, 5 Feb 2020 13:44:11 -0500 Received: from s0106ac1f6bb1ecac.cg.shawcable.net ([70.73.163.230] helo=[192.168.11.155]) by ale.deltatee.com with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1izPej-0005YR-F5; Wed, 05 Feb 2020 11:44:10 -0700 To: Arindam Nath , Jon Mason , Dave Jiang , Allen Hubbe , Sanjay R Mehta Cc: linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org References: From: Logan Gunthorpe Message-ID: <761e76e0-2e5e-6c71-3384-1ec10dcf8e88@deltatee.com> Date: Wed, 5 Feb 2020 11:44:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 70.73.163.230 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-ntb@googlegroups.com, sanju.mehta@amd.com, allenbh@gmail.com, dave.jiang@intel.com, jdmason@kudzu.us, arindam.nath@amd.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_FREE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Subject: Re: [PATCH 3/4] ntb_perf: pass correct struct device to dma_alloc_coherent X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-05 10:16 a.m., Arindam Nath wrote: > From: Sanjay R Mehta > > Currently, ntb->dev is passed to dma_alloc_coherent > and dma_free_coherent calls. The returned dma_addr_t > is the CPU physical address. This works fine as long > as IOMMU is disabled. But when IOMMU is enabled, we > need to make sure that IOVA is returned for dma_addr_t. > So the correct way to achieve this is by changing the > first parameter of dma_alloc_coherent() as ntb->pdev->dev > instead. > > Fixes: 5648e56 ("NTB: ntb_perf: Add full multi-port NTB API support") > Signed-off-by: Sanjay R Mehta > Signed-off-by: Arindam Nath Ugh, this has been fixed repeatedly and independently by a number of people. I sent a fix[1] in more than a year ago and Sanjay repeated the effort a couple months ago[2]. I have the same feed back for you that I had for him: once we fix the bug we should also go in and remove the now unnecessary dma_coerce_mask_and_coherent() calls in the drivers at the same time seeing it no longer makes any sense. My patch did this already. Thanks, Logan [1] https://lore.kernel.org/lkml/20190109192233.5752-3-logang@deltatee.com/ [2] https://lore.kernel.org/lkml/1575983255-70377-1-git-send-email-Sanju.Mehta@amd.com/