Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp943601rwb; Wed, 16 Nov 2022 09:39:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7W3mtJ6tXtRWwE/M4oUpuifShEKR1Hi2SVf5RR4Bk7b17539uH2nnpnkGp0VhdZz6WDlMy X-Received: by 2002:a17:902:f70c:b0:188:b0db:cd5d with SMTP id h12-20020a170902f70c00b00188b0dbcd5dmr10028247plo.104.1668620388867; Wed, 16 Nov 2022 09:39:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668620388; cv=none; d=google.com; s=arc-20160816; b=aUKShJ4RR+euc//+svlViOnhjdFLT/fZajA53rKM2myKb9MsW/tRXzMFC95IjhKIl5 9r2ZKJh0qyH6gBdZE6IaK/FGEe/abQQWqSOdkcPzB2eiuoH702WGIOjrassv8CKKAUUO xnIbSqaZq4rH8GpKFhyZfvQg0NQ7+flEJeXRuxP0BnvF0p5ggcoUTitiG/PnXTzFKwQ1 5DdLPbZKNya5tKvDrDYt2muzvNSExiI7k4IAYdSoOefL4aK5uFtBq2Q05dA6/ZIiH4v8 scbssBJKa6PnVrqEH8J6oUQhJze/fXIhFh0sEDqoCGsaP5InMAPtmEeWeUxaL4w0dsz/ 0ySw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XLl9jwPWrKUEGMxUqZ8ZOHMSN21/G6zNljyYvTYvI4o=; b=JtxZkNAbcyle7Bf4KXV5HJar7QXVm4IPC8qQcWr9klkc7RwBZPh+deZIqAX6g+MJ4Y War9j9KyH8UdChoeepzfvyoMo0wOt5fRAWHRMp0EgrQ55BxrQRD7h+JEXHn4Sc7E1Ru4 ijc7kDrjw11Bj9Y0oquwdhB0fv1/62keOIdDNQYpmolZWOqNXIBkjG2MG5KDJFgjj6k2 MuHt7nwXxcoU4knUQRNzCK86ME8f42MeQTSmYt3LBxCcK2aDnReU/JQQBUMZlkaDHuXS kFUnX8efKtGMC7QPMLg2XvD725KowvAzxgXDPZocaz5Tm5Zrf0BLAYs7TGruKEkeUdZd Misg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="tAc//YkJ"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 38-20020a631066000000b0046fc9e82c99si14330747pgq.206.2022.11.16.09.39.34; Wed, 16 Nov 2022 09:39:48 -0800 (PST) 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="tAc//YkJ"; 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 S234505AbiKPRSB (ORCPT + 90 others); Wed, 16 Nov 2022 12:18:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234309AbiKPRRk (ORCPT ); Wed, 16 Nov 2022 12:17:40 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA6C15B5B6; Wed, 16 Nov 2022 09:17:25 -0800 (PST) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AGGK3qt037051; Wed, 16 Nov 2022 17:17:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=XLl9jwPWrKUEGMxUqZ8ZOHMSN21/G6zNljyYvTYvI4o=; b=tAc//YkJSEKv5CGActK615FcZZw9K9CaK2oDBl3c87TwlRDXvzXEDV0bHVK+2ocapbya ynvurXvGYw+ZvGcB6Vp3XdSZCRyYZqIDqpa/3bRdIimhm0OFHCfnM+z5qVjDSHiADEL9 eCa6Ypipx4Ho1EidNSzFQggwG5NyYaqspShHMnBrqUpmao8idHqRF9wHbyVNlTyf3hoo c8MT3TGspZmaPp0JdkubkN9FuynTTHEg17vgE1ZxobEIeKflQthkvZl1rpEve3n/7RUI ZG/OdufgYAfX1qbSHnz5DSuiZxC90PJr2m/KbeKQ5g5zCrKALvYcLaPPgVAsZ3WnrLpa SQ== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kw39s1pr7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Nov 2022 17:17:02 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2AGH6k8I009477; Wed, 16 Nov 2022 17:17:00 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03ams.nl.ibm.com with ESMTP id 3kt348xawm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Nov 2022 17:17:00 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2AGHHbju39518624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Nov 2022 17:17:37 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92C4A5204E; Wed, 16 Nov 2022 17:16:57 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 09A0D52050; Wed, 16 Nov 2022 17:16:57 +0000 (GMT) From: Niklas Schnelle To: Matthew Rosato , Gerd Bayer , iommu@lists.linux.dev, Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Wenjia Zhang Cc: Pierre Morel , linux-s390@vger.kernel.org, borntraeger@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, gerald.schaefer@linux.ibm.com, agordeev@linux.ibm.com, svens@linux.ibm.com, linux-kernel@vger.kernel.org, Julian Ruess Subject: [PATCH v2 1/7] s390/ism: Set DMA coherent mask Date: Wed, 16 Nov 2022 18:16:50 +0100 Message-Id: <20221116171656.4128212-2-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221116171656.4128212-1-schnelle@linux.ibm.com> References: <20221116171656.4128212-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: l7jEHWgblB2GeUGu6m8stahNtk2oHL6n X-Proofpoint-GUID: l7jEHWgblB2GeUGu6m8stahNtk2oHL6n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-16_03,2022-11-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 malwarescore=0 phishscore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 mlxscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211160119 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 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: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Niklas Schnelle --- v1 -> v2: - Use dma_set_mask_and_coherent() (Christoph Hellwig) 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 d34bb6ec1490..da8a549b5965 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -556,7 +556,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; -- 2.34.1