From nobody Thu Oct 2 10:38:47 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1758221164; cv=none; d=zohomail.com; s=zohoarc; b=Gugc2BXwzQZPeHiDF0aWqZL2u83yYj4+6PTRTrddU504zz8bfKA7V6tMFkeYWE6GfB9uZqx8xxNcJ9KjblAi/lU4nhMBbSWoomMCKbIZzny9W7YnPNQXjXxRA0Vtk/7oKazqRF7KiYjmiQUfHjmaIYXLE7UrM20k5DGU9djmWGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758221164; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bg8xqpMBUtdlqTI2ykkShdQnC07dLGsTGDMSd10qgbo=; b=nbxHJOuPm0J2LtKCu5H7IgULqXQJz4P8Ts0xWBRwGuhQGxBQgkoZuDY2oVqpjgVjCD0aPM9fQL1YUAUeGGm0hJkiRnd6XJ4+zpp0o83/UhWhaISEu5UZnNee11iJMcnQzmD/GVNUoU+IyX/fMFe4lLe/MA0zK4ZQ5K1PA0z60JA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1758221164547310.1758620754556; Thu, 18 Sep 2025 11:46:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1126438.1468033 (Exim 4.92) (envelope-from ) id 1uzJdg-0004PD-H9; Thu, 18 Sep 2025 18:45:52 +0000 Received: by outflank-mailman (output) from mailman id 1126438.1468033; Thu, 18 Sep 2025 18:45:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uzJdg-0004P2-EU; Thu, 18 Sep 2025 18:45:52 +0000 Received: by outflank-mailman (input) for mailman id 1126438; Thu, 18 Sep 2025 18:45:50 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uzJde-0003Vt-Rq for xen-devel@lists.xenproject.org; Thu, 18 Sep 2025 18:45:50 +0000 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b1703eb6-94bf-11f0-9809-7dc792cee155; Thu, 18 Sep 2025 20:45:49 +0200 (CEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 441A56020F; Thu, 18 Sep 2025 18:45:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 160A2C4CEE7; Thu, 18 Sep 2025 18:45:47 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b1703eb6-94bf-11f0-9809-7dc792cee155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758221147; bh=cZbejEi6nkNmkzheeCBAGk92h84S9bA1MI/LRocXjWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sNr2edIlUVPpwBqbOV9yBQP1/FOhaJ6YeDv3YF3kmR8I+TMxL1QjnGjSU1FxrbpQ/ lQ6VcMvO1t0Fx87meU0SneChvQ6BiwlfAXAVkQw/+mZLpALEBWt/7dbuxqQajOetpg E0UpfldbzcJ5ehVg/st5XBRiSC6U7x11vRJ6y4GDfv5SOH4qS/egi0PrkYatzt2/al IaK4aFx2ASuaQdtIxto4VB/hGINa/kGkbBcnJ0j1gtF3HkRNcWWSOO8gn40Leemglo 4dtHyTyMQB3UcRW4eJch2wTwtgCcaQp2MoPH5kDS581Z+XWWHAWeK4xod4u549Jg4N Sqf5FMk/Rnwhw== From: Leon Romanovsky To: Marek Szyprowski Cc: Leon Romanovsky , Jason Gunthorpe , Andreas Larsson , Borislav Petkov , Dave Hansen , "David S. Miller" , Geoff Levand , Helge Deller , Ingo Molnar , iommu@lists.linux.dev, "James E.J. Bottomley" , Jason Wang , Juergen Gross , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Madhavan Srinivasan , Matt Turner , Michael Ellerman , "Michael S. Tsirkin" , Richard Henderson , sparclinux@vger.kernel.org, Stefano Stabellini , Thomas Bogendoerfer , Thomas Gleixner , virtualization@lists.linux.dev, x86@kernel.org, xen-devel@lists.xenproject.org Subject: [PATCH 2/9] MIPS/jazzdma: Provide physical address directly Date: Thu, 18 Sep 2025 21:45:02 +0300 Message-ID: X-Mailer: git-send-email 2.51.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1758221165069116601 Content-Type: text/plain; charset="utf-8" From: Leon Romanovsky MIPS jazz uses physical addresses for mapping pages, so convert it to get them directly from DMA mapping routine. Signed-off-by: Leon Romanovsky --- arch/mips/jazz/jazzdma.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c index c97b089b99029..45fe71aa454b7 100644 --- a/arch/mips/jazz/jazzdma.c +++ b/arch/mips/jazz/jazzdma.c @@ -521,18 +521,24 @@ static void jazz_dma_free(struct device *dev, size_t = size, void *vaddr, __free_pages(virt_to_page(vaddr), get_order(size)); } =20 -static dma_addr_t jazz_dma_map_page(struct device *dev, struct page *page, - unsigned long offset, size_t size, enum dma_data_direction dir, - unsigned long attrs) +static dma_addr_t jazz_dma_map_phys(struct device *dev, phys_addr_t phys, + size_t size, enum dma_data_direction dir, unsigned long attrs) { - phys_addr_t phys =3D page_to_phys(page) + offset; + if (attrs & DMA_ATTR_MMIO) + /* + * This check is included because older versions of the code lacked + * MMIO path support, and my ability to test this path is limited. + * However, from a software technical standpoint, there is no restrictio= n, + * as the following code operates solely on physical addresses. + */ + return DMA_MAPPING_ERROR; =20 if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC)) arch_sync_dma_for_device(phys, size, dir); return vdma_alloc(phys, size); } =20 -static void jazz_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, +static void jazz_dma_unmap_phys(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir, unsigned long attrs) { if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC)) @@ -607,8 +613,8 @@ static void jazz_dma_sync_sg_for_cpu(struct device *dev, const struct dma_map_ops jazz_dma_ops =3D { .alloc =3D jazz_dma_alloc, .free =3D jazz_dma_free, - .map_page =3D jazz_dma_map_page, - .unmap_page =3D jazz_dma_unmap_page, + .map_phys =3D jazz_dma_map_phys, + .unmap_phys =3D jazz_dma_unmap_phys, .map_sg =3D jazz_dma_map_sg, .unmap_sg =3D jazz_dma_unmap_sg, .sync_single_for_cpu =3D jazz_dma_sync_single_for_cpu, --=20 2.51.0