Message ID | 20230310-dma_iommu-v10-1-f1fbd8310854@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c790:0:b0:3b6:ef29:a0d7 with SMTP id b16csp3086443vqu; Wed, 24 May 2023 08:04:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ntCXWsziEoX8kAD1ZvICPMU57asXTpdP9hS/1KBqZxW1uYqLJutX2GtXszuOjnOBsPuKa X-Received: by 2002:a05:6a00:10c6:b0:634:7ba3:d140 with SMTP id d6-20020a056a0010c600b006347ba3d140mr3698423pfu.15.1684940658042; Wed, 24 May 2023 08:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684940658; cv=none; d=google.com; s=arc-20160816; b=h3MQ29LRLCRogZh9if2NrtWShpzbCKU81PTciXe5FvG6m3aFOK9ogEOMmIcMD/rxy9 Yy6VtGOicbQr3yDzabCmwxqsSu14R0ZxsLM5vssYGd8r63Y6N4n19aUpXbE5STuugaor lsEjCdACPQwYpvsi/SQgMK+GEqBg/pRvYGXsJonxJZ2KKgkngtKuIPhq9ySlTtmVnAEp dltzqDc5A2ll5et6EYrWoHx/2iO5Ohn/7Ygz57EJ5Fgwc0laBRG5lhuGzj9/EI/kobrR a7RvzIUca3hB9djKU1DBw9slt32GBaUQudtNF+bwa8hXDlDRhOPJEdX/Z1HLV0ScQHAT JV7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=K1ceBo8oBz97cqIN7NIgj9rIYC6qSR/oJdYjykMdHW8=; b=FPpPlOsNnCnnFI5G2rxSX6KL5L+Hqb9ntonHbkan2oNjZu0El4u1aeoahniz+OlldG wHmZpcsqEO12/4QH43kqpj5I2hsrasF5dGg1waQIdnXEr9kA1o7O5QdjoYynYLQsuzG3 5gtVXU6tNbrfL4xpAZeTTYIMGaiVmKb5MIvEf/an0/XgCPL6fA+mjHZMXdtt4jgHuwt7 9ge6RAi+I7fa6EFtbOcvCbs+gSoFhjhABhjnxEVXki/1d/8SgflW21vAk9+kWc7ioWfo 6tZMaieR5R8hZlcajV7fAPEpWHOMgxdtWLCNoE+7ECA8NXnz7mJWqAmeDxN99k5KJCpz usMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="OiIL/Ca+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i28-20020aa796fc000000b00640d9c06df3si8447664pfq.329.2023.05.24.08.04.04; Wed, 24 May 2023 08:04:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="OiIL/Ca+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236323AbjEXO4Z (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Wed, 24 May 2023 10:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236389AbjEXO4R (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 24 May 2023 10:56:17 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C98DE47; Wed, 24 May 2023 07:55:41 -0700 (PDT) Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34OEnupv023360; Wed, 24 May 2023 14:53:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : date : subject : mime-version : content-type : content-transfer-encoding : message-id : references : in-reply-to : to : cc; s=pp1; bh=K1ceBo8oBz97cqIN7NIgj9rIYC6qSR/oJdYjykMdHW8=; b=OiIL/Ca+DNz6t1Och1049chXvS8BTIoyOp8u+j3hfWG8HiaQCOK7uTza4lxLFKGVariK D+snIjJJ5AhMGvdS+cGHoZvC89cyPE2QW36L/1HozGImVKq+w7WaZOiKDXaNRdgRZrh6 X/040RVJysgrmBJQRchJE99SVeuyIA+DbzW/GzdLBiTXZ/ALFBSgNtB+9O9xSHTXFqmu gUKVj2bTaqgTNbLYqtoU1XktrQpY0FSWusUqpJuw8Ij+B2QW0TioIxDjAZv4ELeAoIHF 3f6npBzij7obwzMbmOwhPgu+xPc3z0d1SX89Gjeg3I+Lp0ovttfIjF/EzIMwOrvaut7/ YQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qsmpm01re-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 May 2023 14:53:28 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34OEqWC6030205; Wed, 24 May 2023 14:53:27 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qsmpm01qx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 May 2023 14:53:27 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34OCNhYg029074; Wed, 24 May 2023 14:53:25 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3qppc11nru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 May 2023 14:53:24 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34OErLg923659020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 May 2023 14:53:21 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4544920043; Wed, 24 May 2023 14:53:21 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 641EE2004F; Wed, 24 May 2023 14:53:19 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 24 May 2023 14:53:19 +0000 (GMT) From: Niklas Schnelle <schnelle@linux.ibm.com> Date: Wed, 24 May 2023 16:53:04 +0200 Subject: [PATCH v10 1/6] s390/ism: Set DMA coherent mask MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230310-dma_iommu-v10-1-f1fbd8310854@linux.ibm.com> References: <20230310-dma_iommu-v10-0-f1fbd8310854@linux.ibm.com> In-Reply-To: <20230310-dma_iommu-v10-0-f1fbd8310854@linux.ibm.com> To: Joerg Roedel <joro@8bytes.org>, Matthew Rosato <mjrosato@linux.ibm.com>, Will Deacon <will@kernel.org>, Wenjia Zhang <wenjia@linux.ibm.com>, Robin Murphy <robin.murphy@arm.com>, Jason Gunthorpe <jgg@ziepe.ca> Cc: Gerd Bayer <gbayer@linux.ibm.com>, Julian Ruess <julianr@linux.ibm.com>, Pierre Morel <pmorel@linux.ibm.com>, Alexandra Winter <wintera@linux.ibm.com>, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Sven Schnelle <svens@linux.ibm.com>, Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>, Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>, Alyssa Rosenzweig <alyssa@rosenzweig.io>, David Woodhouse <dwmw2@infradead.org>, Lu Baolu <baolu.lu@linux.intel.com>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Yong Wu <yong.wu@mediatek.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Gerald Schaefer <gerald.schaefer@linux.ibm.com>, Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Thierry Reding <thierry.reding@gmail.com>, Krishna Reddy <vdumpa@nvidia.com>, Jonathan Hunter <jonathanh@nvidia.com>, Niklas Schnelle <schnelle@linux.ibm.com>, Jonathan Corbet <corbet@lwn.net>, 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 X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1376; i=schnelle@linux.ibm.com; h=from:subject:message-id; bh=c2AUHQeLSNc+e1q7e31+UGNVymw7M3BeuxQZt/EM8Cs=; b=owGbwMvMwCH2Wz534YHOJ2GMp9WSGFLyVO7Oj6k69bhO4HXHw/kWijMZY4Mvd21ZHVBmWrLm1 Qn+VRMdO0pZGMQ4GGTFFFkWdTn7rSuYYronqL8DZg4rE8gQBi5OAZjIQhmGfypBb20P+Heum/BG t3W3t+LUz7ceNH98xq8a7TLH4iTX1peMDD8jFU3+hp07eXcRw/HwAxy/+y/Hq7lc8pgddNWb3a/ ClBUA X-Developer-Key: i=schnelle@linux.ibm.com; a=openpgp; fpr=9DB000B2D2752030A5F72DDCAFE43F15E8C26090 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: tW_0F9zVMfihTA3vmlWx3bBHRxFbRoB0 X-Proofpoint-GUID: hjqN-wxPtO6IqyJSRj_SLLQGZ-5XqL57 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-24_09,2023-05-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 impostorscore=0 malwarescore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305240119 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766788335442907221?= X-GMAIL-MSGID: =?utf-8?q?1766788335442907221?= |
Series |
iommu/dma: s390 DMA API conversion and optimized IOTLB flushing
|
|
Commit Message
Niklas Schnelle
May 24, 2023, 2:53 p.m. UTC
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 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 <wintera@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.ibm.com> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> --- 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)); if (ret) goto err_resource;