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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18745C77B7A for ; Tue, 16 May 2023 08:08:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231347AbjEPIIa (ORCPT ); Tue, 16 May 2023 04:08:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbjEPIIZ (ORCPT ); Tue, 16 May 2023 04:08:25 -0400 X-Greylist: delayed 600 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 16 May 2023 01:08:23 PDT Received: from bee.tesarici.cz (bee.tesarici.cz [IPv6:2a03:3b40:fe:2d4::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 002A43C12; Tue, 16 May 2023 01:08:23 -0700 (PDT) Received: from meshulam.tesarici.cz (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bee.tesarici.cz (Postfix) with ESMTPSA id 022691617A9; Tue, 16 May 2023 09:58:20 +0200 (CEST) Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail; t=1684223901; bh=vgp/F7g/spz90YI9EAe5zEYmTaqdHJkzRNoRv0QNyqo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PiKtJUDXeLIXLILtSnIYL0BWgkz+1wtz3Skq/knjoFpezpja2UdK19+qCjZ7PudN3 Y30ABlU9VOPl9n8xKjK5pH/3a8JiDL195rF6HNNpdMHP6wArDy70+Zi6x/LxqQIQlu ibT19G77KLEtOH9rfxVy+qRNl4Bzq6+qxaP4382xqIziuSKvlMU3p8RupyFg5U5W/o tFWS2oTyGYyMLRjdnCK2qeWtiHho1mdvnndZuLvLV1+H80+qAAYo8Pq83ef4A8xA4R +bQXyF5Kf4JJ/L0goFRsCBPLCj0g5AtWa0385zU9r4oMTsoeg4N3n8jhCgkY5fSenZ tDBAOVxUZcDdg== Date: Tue, 16 May 2023 09:58:19 +0200 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Niklas Schnelle Cc: Joerg Roedel , Matthew Rosato , Will Deacon , Wenjia Zhang , Robin Murphy , Jason Gunthorpe , Gerd Bayer , Julian Ruess , Pierre Morel , Alexandra Winter , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Suravee Suthikulpanit , Hector Martin , Sven Peter , Alyssa Rosenzweig , David Woodhouse , Lu Baolu , Andy Gross , Bjorn Andersson , Konrad Dybcio , Yong Wu , Matthias Brugger , AngeloGioacchino Del Regno , Gerald Schaefer , Orson Zhai , Baolin Wang , Chunyan Zhang , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Krishna Reddy , Jonathan Hunter , Jonathan Corbet , linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v9 1/6] s390/ism: Set DMA coherent mask Message-ID: <20230516095819.78442f09@meshulam.tesarici.cz> In-Reply-To: <20230310-dma_iommu-v9-1-65bb8edd2beb@linux.ibm.com> References: <20230310-dma_iommu-v9-0-65bb8edd2beb@linux.ibm.com> <20230310-dma_iommu-v9-1-65bb8edd2beb@linux.ibm.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org On Mon, 15 May 2023 11:15:51 +0200 Niklas Schnelle wrote: > A future change will convert the DMA API implementation from the > architecture specific arch/s390/pci/pci_dma.c to using the common code > drivers/iommu/dma-iommu.c which the utilizes the same IOMMU hardware > through the s390-iommu driver. Unlike the s390 specific DMA API this > requires devices to correctly call set the coherent mask to be allowed > to use IOVAs >2^32 in dma_alloc_coherent(). This was however not done > for ISM devices. ISM requires such addresses since currently the DMA > aperture for PCI devices starts at 2^32 and all calls to > dma_alloc_coherent() would thus fail. > > Reviewed-by: Alexandra Winter > Reviewed-by: Matthew Rosato > Signed-off-by: Niklas Schnelle > --- > drivers/s390/net/ism_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c > index 8acb9eba691b..1399b5dc646c 100644 > --- a/drivers/s390/net/ism_drv.c > +++ b/drivers/s390/net/ism_drv.c > @@ -660,7 +660,7 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id) > if (ret) > goto err_disable; > > - ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); > + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); Ah. I love this change. I have already wondered a few times if the coherent DMA mask for this device may actually be different from dma_mask. Now I know. ;-) Thanks! Petr T