Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp526098qtb; Wed, 19 Oct 2022 08:07:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+s0hy5N+K8fFRZwIWNflstX08jl+icgMCewLLwCMAZcCsdF3OfGnPFwlrBAvJSj6gncCg X-Received: by 2002:a05:6402:2319:b0:45c:4231:de18 with SMTP id l25-20020a056402231900b0045c4231de18mr8077718eda.383.1666192046579; Wed, 19 Oct 2022 08:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666192046; cv=none; d=google.com; s=arc-20160816; b=PcBX3yDUGMo2YiGNAUYpLRr9SfeD6A0gQ4VCjizImZhUytrnNwrn533gR6FIQzKRGj d65UsxAtzqtTDhm+jwf554RjQ89DYJ6WPIDNmRH2X7v54s2E/usF4BuVy60xnrOvSYsH fY48Df4qfRfwlN+GfByPzS4cQo4wg73VtZ9a//3lEv4c1bxzj6EsBEti4vZeAUKEsuTa b6aKw80IEfmlqv+YFcfvw3w8/M7hwM5e66OJqa+OVGaqzITTFvtHn5zE+6YZ6HnmA4zo m/s37Dv2HgrzfnAzLG+tuDUoYUUgiklxGhR1CjDqst8tnfQfm9Dm3LOHn404XWmVeOHT hgGA== 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=LKkV5K5rNGundAibUGPmtOynU0ETPEYcazy0gCFkFf4=; b=cn3E6wAQHWIyz3gYystQUtP0Zy5cw+NZyyDhnZ2EF28Mv7gf+7U3YiOVrsBbAAN13X n0BRbYcWo5IY1UMOJhnQdX2wkE4nmHwoHMnYkjKnTlDDh3D8FsbjYb2QZpRmQb9XWIKe mWgzSpBNHLGmkasvl7zT45P977ye55qxARXC1fBwqTNi6zK92I/JSL+VdAuBLKQmdBNq GNTyQSIVQSbIxvrIHRC12vu9GK14dIn50SgNM20gs+D826iQcxLCi+tQqRZs6iz08vrz DIgGAnw+J7n14OCp6U8lYG+Re++AnJbLA6i4eibx06yQ0OM7LAB/55T8wKLay3r34pCJ 7SCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=my7ASZfV; 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=NONE 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 i20-20020a056402055400b0045886d9ab84si12516052edx.279.2022.10.19.08.06.58; Wed, 19 Oct 2022 08:07:26 -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=my7ASZfV; 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=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231631AbiJSOxk (ORCPT + 99 others); Wed, 19 Oct 2022 10:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbiJSOxD (ORCPT ); Wed, 19 Oct 2022 10:53:03 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DBCA3AA2; Wed, 19 Oct 2022 07:44:56 -0700 (PDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29JEgcHD001063; Wed, 19 Oct 2022 14:44:43 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=LKkV5K5rNGundAibUGPmtOynU0ETPEYcazy0gCFkFf4=; b=my7ASZfVmUtWVWX8Jc55M6UHT6LOJW0gPM1/u2dl8OOivGT90TIBCEYIf+A69tuOx1wH uFwDB3Q1HqDKr+49ypOhB6BsxadY/XKpWJDsxwYZS8VbauAmP8bz7hvP4lmUZts2ES3f nKyPkY0RrGvlbLX+kuQrNIW3woaWXFNlFSFD7yVIvhIQ095ZxntgbivjFJw2SUifDzxM wfA8Zn6WPeTXUBvOh79ELAolvFCWpeaeTDbFz93n5UjnlWTMn9AaM1lZBRRzHWPQudLl KeKpWqDFO3FqIvVI9Kelk+Oj9RE7XxQ/kb9oJpr0R65rMIeMFyIeZqj9QV9CrT70w7Jq 6g== Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kak7yg1wk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Oct 2022 14:44:42 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 29JEaXtV012198; Wed, 19 Oct 2022 14:44:40 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06ams.nl.ibm.com with ESMTP id 3kajmrr1uw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Oct 2022 14:44:40 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 29JEjAWe41877924 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Oct 2022 14:45:10 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 12D9D4C044; Wed, 19 Oct 2022 14:44:37 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 884854C046; Wed, 19 Oct 2022 14:44:36 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 19 Oct 2022 14:44:36 +0000 (GMT) From: Niklas Schnelle To: Matthew Rosato , iommu@lists.linux.dev, Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe Cc: Gerd Bayer , 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, Wenjia Zhang , Julian Ruess Subject: [RFC 1/6] s390/ism: Set DMA coherent mask Date: Wed, 19 Oct 2022 16:44:30 +0200 Message-Id: <20221019144435.369902-2-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019144435.369902-1-schnelle@linux.ibm.com> References: <20221019144435.369902-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: kgIwSg_7thUhemU_Qkr748Yhx-njvXWG X-Proofpoint-ORIG-GUID: kgIwSg_7thUhemU_Qkr748Yhx-njvXWG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-19_08,2022-10-19_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 malwarescore=0 impostorscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 mlxlogscore=929 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210190081 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 dma_set_coherent_mask() to be allowed to use IOVAs >2^32 in dma_alloc_coherent(). This was however not done for ISM devices which require such addresses since currently the DMA aperture for PCI devices starts a 2^32 and all calls to dma_alloc_coherent() would thus fail. Signed-off-by: Niklas Schnelle --- drivers/s390/net/ism_drv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index d34bb6ec1490..5890c32a9e1f 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -560,6 +560,10 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (ret) goto err_resource; + ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); + if (ret) + goto err_resource; + dma_set_seg_boundary(&pdev->dev, SZ_1M - 1); dma_set_max_seg_size(&pdev->dev, SZ_1M); pci_set_master(pdev); -- 2.34.1