From nobody Fri Apr 26 23:26:25 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1570563798; cv=none; d=zoho.com; s=zohoarc; b=ewnG3e5sVTpHwG4pekyKaMuJXeoCnNYyKJ+0wG/2aZ6NF4fGokXpN4hhJseH9Jw80vmX4Zj6W9IqI+FVwZvmthoBI0yw3yAJQfKCwsk1zn3D21JwYlkX1AwtHFGSSHibqcywggMhOU3qQh8HM5R+I+y0l/nndFwnJd/7HiW/V54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570563798; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=cLLisONpLgo0WMrG8IR6qwtMazklgFeoSAy2FCaMR/g=; b=AKPYwITMJRqF9+z1mv/3bjULYYNoj1eMelELBvIgnk1z3VUzEc+crrBVYjREJpwsiqXgWlHu5XzyE/9SksTufFA09AXaKuJMwjcrpMo1c5spzTwtJtQPA3GTPmmQjAdfzmZkbL1HnPb64FDx8SyEG/exJdR7+29/M/TAAD7MFC4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 157056379817361.747083643616065; Tue, 8 Oct 2019 12:43:18 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iHvMu-0000Wa-6y; Tue, 08 Oct 2019 19:42:00 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iHvMt-0000WU-1L for xen-devel@lists.xenproject.org; Tue, 08 Oct 2019 19:41:59 +0000 Received: from mail-ot1-f65.google.com (unknown [209.85.210.65]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b07fea66-ea03-11e9-96dc-bc764e2007e4; Tue, 08 Oct 2019 19:41:58 +0000 (UTC) Received: by mail-ot1-f65.google.com with SMTP id k32so15083562otc.4 for ; Tue, 08 Oct 2019 12:41:58 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id z12sm5364645oth.71.2019.10.08.12.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2019 12:41:56 -0700 (PDT) X-Inumbo-ID: b07fea66-ea03-11e9-96dc-bc764e2007e4 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cM/iEPaCvfOjsvb7CWmfva5BP/wvMw5x+2gKptZwcOk=; b=MVPMNWWSkwso1IyPFFGk7KgyO9FBs9QN/n9ofRX1GIej3XDVDS3+euZkZKmjygOTIM HznV/OGCeecPn7pVQGiZDHkphYXHWeuSXBE+11o1iqa6hfW0jG8+M72vT611gq7c7zyG gmX9Qc5ysAPBDByn526C9hedpv0G+jlFo0CkuCr0CvsqYA7/yA4Ez3pDR5ISkddBhfDx rxNJq7aDv/sLQX95GR0Lj3kunpgYPQSqv1GPwGdJy3vnPu5HaRf2MEkDV9z7xxQcMSfS e3dXKmOSVZCAUhylGaAMKFDKH9rl/drS8BauY+j+7rl7NA1+Xpl8wxjxKs477JSNc+Tv mX5Q== X-Gm-Message-State: APjAAAU3jbwlHA1u5qsysdRyaoLDjl9TQWhQ3rAKEiQ62ZqO52NATxDV pzlNRoiCJFASPjImJxJI7uHdAjs= X-Google-Smtp-Source: APXvYqxBTulxVQeCUzNrniHc4WOTx+3wOd+GgT82xa9DGnUA1ysJ04S1+2IdRLJi/4rEbo0Ce1tAvg== X-Received: by 2002:a9d:7418:: with SMTP id n24mr2934782otk.19.1570563717135; Tue, 08 Oct 2019 12:41:57 -0700 (PDT) From: Rob Herring To: xen-devel@lists.xenproject.org Date: Tue, 8 Oct 2019 14:41:55 -0500 Message-Id: <20191008194155.4810-1-robh@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2] xen: Stop abusing DT of_dma_configure API X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Oleksandr Andrushchenko , linux-kernel@vger.kernel.org, Julien Grall , Boris Ostrovsky , Robin Murphy , Christoph Hellwig , Nicolas Saenz Julienne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" As the removed comments say, these aren't DT based devices. of_dma_configure() is going to stop allowing a NULL DT node and calling it will no longer work. The comment is also now out of date as of commit 9ab91e7c5c51 ("arm64: default to the direct mapping in get_arch_dma_ops"). Direct mapping is now the default rather than dma_dummy_ops. According to Stefano and Oleksandr, the only other part needed is setting the DMA masks and there's no reason to restrict the masks to 32-bits. So set the masks to 64 bits. Cc: Robin Murphy Cc: Julien Grall Cc: Nicolas Saenz Julienne Cc: Oleksandr Andrushchenko Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Christoph Hellwig Cc: xen-devel@lists.xenproject.org Signed-off-by: Rob Herring Reviewed-by: Stefano Stabellini --- v2: - Setup dma masks - Also fix xen_drm_front.c =20 This can now be applied to the Xen tree independent of the coming of_dma_configure() changes. Rob drivers/gpu/drm/xen/xen_drm_front.c | 12 ++---------- drivers/xen/gntdev.c | 13 ++----------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_= drm_front.c index ba1828acd8c9..4be49c1aef51 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.c +++ b/drivers/gpu/drm/xen/xen_drm_front.c @@ -718,17 +718,9 @@ static int xen_drv_probe(struct xenbus_device *xb_dev, struct device *dev =3D &xb_dev->dev; int ret; =20 - /* - * The device is not spawn from a device tree, so arch_setup_dma_ops - * is not called, thus leaving the device with dummy DMA ops. - * This makes the device return error on PRIME buffer import, which - * is not correct: to fix this call of_dma_configure() with a NULL - * node to set default DMA ops. - */ - dev->coherent_dma_mask =3D DMA_BIT_MASK(32); - ret =3D of_dma_configure(dev, NULL, true); + ret =3D dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64)); if (ret < 0) { - DRM_ERROR("Cannot setup DMA ops, ret %d", ret); + DRM_ERROR("Cannot setup DMA mask, ret %d", ret); return ret; } =20 diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index a446a7221e13..81401f386c9c 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -22,6 +22,7 @@ =20 #define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt =20 +#include #include #include #include @@ -34,9 +35,6 @@ #include #include #include -#ifdef CONFIG_XEN_GRANT_DMA_ALLOC -#include -#endif =20 #include #include @@ -625,14 +623,7 @@ static int gntdev_open(struct inode *inode, struct fil= e *flip) flip->private_data =3D priv; #ifdef CONFIG_XEN_GRANT_DMA_ALLOC priv->dma_dev =3D gntdev_miscdev.this_device; - - /* - * The device is not spawn from a device tree, so arch_setup_dma_ops - * is not called, thus leaving the device with dummy DMA ops. - * Fix this by calling of_dma_configure() with a NULL node to set - * default DMA ops. - */ - of_dma_configure(priv->dma_dev, NULL, true); + dma_coerce_mask_and_coherent(priv->dma_dev, DMA_BIT_MASK(64)); #endif pr_debug("priv %p\n", priv); =20 --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel