Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp665241ybi; Fri, 2 Aug 2019 02:14:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaSBiPgyzaC8CkxRvsDzgbXfbtDSsdsmpp+14+BgA4nD14bQgNtGVHV6J4nJ2JZxs+jckP X-Received: by 2002:aa7:8b51:: with SMTP id i17mr59468694pfd.33.1564737273294; Fri, 02 Aug 2019 02:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564737273; cv=none; d=google.com; s=arc-20160816; b=Opk4o9ZALLyWY8crmXSFCR5yMe/b7J8CDLi6IrCrOwCo8i1MXgvgRFUR+Iqmyd9t1M Yn8uXgwCR8O855kP8asZUvKWygbHBBGUMxypUlyaDnDbNEnHcMA8EKdIUmUAEE4rQO52 mJAVMqd16aOjKRc7Ky0jPiWY3AFUl8q9RmR6mFMl+GtKWUHEspnAVgFCH+C7kbpcZXxI TXQvjdjAAN0/KWW28KBUCuBe85HCWL87iA2zOhShd7EYZ1LvUfcgG9XUvWEMbqNZIXHG WOUkAINiF1PGv9oyCI2Tt1gaXAra0nyoc4f3RuqydIHSt/f/UFK3BtJ3zHpz3bqTTDOs pmQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=FI1/tujvW8CLURUuKvN84BnfpDhm41dC+hUAjzW3S80=; b=qnkOiFXhqLgis/H3p5rpdGT0PqgzVuDZNgxbsZAJLveb7IV/Je0roSSmk0jpOjH/tJ YxfOrMlfzMJ6XviU0WBpFXNKPoMBhNsOSUThw8T+Ex39vOmjeaivNhCYWghPJCh4PSbZ qRNYY5glnpZIlY7u1a0ADjrxYnwHbYUAUTPZVPbPKbKEFCid157SZwD7frl63br0wODc djFvkykoyuVgcpF3jXUiMqPmk9GQ+EECJVAd/fkSCstxPsyn/bNJ2upmUlyzjVRpXJuh M5D5T7so9CHH/DA+LCaPjJM7nWWA5KzqZwGFPxWEGkfOu0qk1QEBKsP7N8cAsP2oZm9B Qz9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m68si41866108pfb.75.2019.08.02.02.14.17; Fri, 02 Aug 2019 02:14:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388741AbfHBGhQ (ORCPT + 99 others); Fri, 2 Aug 2019 02:37:16 -0400 Received: from verein.lst.de ([213.95.11.211]:50078 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729432AbfHBGhP (ORCPT ); Fri, 2 Aug 2019 02:37:15 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 80CFE68C65; Fri, 2 Aug 2019 08:37:12 +0200 (CEST) Date: Fri, 2 Aug 2019 08:37:12 +0200 From: Christoph Hellwig To: Alex Smith Cc: Sadegh Abbasi , Paul Burton , James Hogan , linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: DMA_ATTR_WRITE_COMBINE on mips Message-ID: <20190802063712.GA7553@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [I hope the imgtec address still works, but maybe the mips folks know if it moved to mips] Hi Alex, you added DMA_ATTR_WRITE_COMBINE support in dma_mmap_attrs to mips in commit 8c172467be36f7c9591e59b647e4cd342ce2ef41 ("MIPS: Add implementation of dma_map_ops.mmap()"), but that commit only added the support in mmap, not in dma_alloc_attrs. This means the memory is now used in kernel space through KSEG1, and thus uncached, while for userspace mappings through dma_mmap_* pgprot_writebombine is used, which creates a write combine mapping, which on some MIPS CPUs sets the _CACHE_UNCACHED_ACCELERATED pte bit instead of the _CACHE_UNCACHED one. I know at least on arm, powerpc and x86 such mixed page cachability attributes can cause pretty severe problems. Are they ok on mips? Or was the DMA_ATTR_WRITE_COMBINE supported unintended and not correct and we should remove it?