Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10515278rwl; Mon, 2 Jan 2023 04:03:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXsRWzS2jsvKsrF9fDfdGaKZF8msL7ClAZZ7SRoMTLO4cl3xoj8TjZCGQpr9aQxBQhn7nWjj X-Received: by 2002:a17:907:6d97:b0:7c1:5ee1:4c56 with SMTP id sb23-20020a1709076d9700b007c15ee14c56mr42544730ejc.55.1672661009284; Mon, 02 Jan 2023 04:03:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672661009; cv=none; d=google.com; s=arc-20160816; b=FX7zYu1PK70R10d0pSVJvePtJrpODGvFhEKxOHfnPdZziHtpraiy77Ac6zJLSqZjpX eqezeOIJPlo7AJZwJgD2v3oKFZ8d4/TPgiHD6i6mP7Ir+h2EzVM4uQXA3aMw+YclaqJw sL9dFu6pXay6m0L4z27qc7m30T22eS71jgL4GwwsIh8xqOc4KNP+3blhZO+22eZR+e9W pZ5nepshS9QpmSL/ccIyTK3H5LjnNLlMLQchhMo9VCUQ932jGpO5JpD0Y4uzY7tyBh02 LVZ4ml6imJD2V3wnkeb5vf+WxjKmkQE4sF/mJp2LFPlh6PDACyytskNTNjQXiy/H2gtp 2yag== 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=x1CQIPTFGI4XvF4eZXRQn4xVZA4mx39SnnoYF2uy778=; b=I0GQQv1NfiEKYqEi/bLO/wog+jfzeA4vIE9UD9fE/icgFlXKO4jpg16Uui0syIosWJ YFu3oWkH+7vuXnxqD3udOVqjKiribgYXk7s04e3zBQMVV4SPUs180tX20vQTh5Yb2R17 a+pc+OhBJFJxVV87P1DZHF+62VLba/2Fppdcyr9XhVPr12GqJux+Zey0O2wBGVVeMSsv 3kXIKlDLyKt69A7xojbB4ftLpqFSwd0jlnpT/V62O5/ubIMzOvsORsQ5YeNJ+P4Irpqg XWVrnGG9Ju7fqLyBMrmqDQDmkR/ZWKjAcMCMBIF5eA841Tzl7TJ5EiFD2jqNQ5asxBLJ wZbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=bxj1RgM0; 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 s4-20020a17090699c400b0084c439a1d98si18765742ejn.454.2023.01.02.04.03.14; Mon, 02 Jan 2023 04:03:29 -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=bxj1RgM0; 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 S232056AbjABL4r (ORCPT + 61 others); Mon, 2 Jan 2023 06:56:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232573AbjABL4n (ORCPT ); Mon, 2 Jan 2023 06:56:43 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 674D425C4; Mon, 2 Jan 2023 03:56:40 -0800 (PST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3028Eebh022345; Mon, 2 Jan 2023 11:56:26 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=x1CQIPTFGI4XvF4eZXRQn4xVZA4mx39SnnoYF2uy778=; b=bxj1RgM0Ic/thEz9uFeDmQlsJLqfPqF89TyZOtkHaq8P3xGWhWxQ7/xHiFc158lVg/5Y FAuzSClKd4mYhYglt/cLq9l8KB96lnY/5jQARatKOhCdaoDg2vlUFxdw2p025JYAQOwQ h1RYKPPV90i3/f2APtXRQ5iDm9xdILf454Jol2tTBIFzfcjLnv5C8cGfGJ4cayz9oiHJ UcAFM6/Ziz69v3wedxFU8ssz7mZz3rSkfetTHeQvrh91gJbpetqxOtr14Bzui0ZWuycy FJybwKUK3MVAPh/y3ShlBpkvyIMx3bCO/vRe9ReTWqZw7vrJXmknurr14wkYK8nyVLjN Qw== Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3mty10yj31-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Jan 2023 11:56:26 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30180E11032663; Mon, 2 Jan 2023 11:56:24 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma05fra.de.ibm.com (PPS) with ESMTPS id 3mtcq6hrts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Jan 2023 11:56:24 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 302BuKMn42926418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 2 Jan 2023 11:56:20 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8AB8620043; Mon, 2 Jan 2023 11:56:20 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C0DC2004B; Mon, 2 Jan 2023 11:56:20 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 2 Jan 2023 11:56:20 +0000 (GMT) From: Niklas Schnelle To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Wenjia Zhang Cc: Matthew Rosato , Gerd Bayer , Pierre Morel , iommu@lists.linux.dev, 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 v3 1/7] s390/ism: Set DMA coherent mask Date: Mon, 2 Jan 2023 12:56:13 +0100 Message-Id: <20230102115619.2088685-2-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230102115619.2088685-1-schnelle@linux.ibm.com> References: <20230102115619.2088685-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: sr0IXvfJQmwYVheqH3Wc8v2N4k7c9ufn X-Proofpoint-ORIG-GUID: sr0IXvfJQmwYVheqH3Wc8v2N4k7c9ufn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-02_06,2022-12-30_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 mlxlogscore=971 mlxscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 bulkscore=0 adultscore=0 impostorscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301020105 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 dfd401d9e362..aba03b613296 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -557,7 +557,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