Received: by 10.192.165.148 with SMTP id m20csp419940imm; Fri, 20 Apr 2018 01:17:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/mj6cjE7cYsyxdD/cIpiMcJTZbpkVaDYB04Ktt+esSxgJcoTHq2l9PpQO5c51/MNukpipZ X-Received: by 10.98.84.7 with SMTP id i7mr8751165pfb.174.1524212278063; Fri, 20 Apr 2018 01:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524212278; cv=none; d=google.com; s=arc-20160816; b=l0U73wMVpJvptmiquVWOfMcRfAj0zPszeK5WpU2sMGnFIbUwqh+OOwWDkrTHqbonyg uCm4V6P7aUtqGGZiN6ovOVXPji1p0/d06RoR7UC44TqH8kk0XXcPMobJ5zfBIbLj/wTF kqiWK6XsgKm0HYxBQxtAhHgczNRsh5SZ87mCK4ds+4qJ85aytDktypU+iR/ixk1fgNfA eP/Nu5BWSlC7hV7xsIwJXmqcGamW+lfaMFIQGAdoBhXaM3TCh54OCosW+BzyPrHeOTcl ygUQOZJJ9m3a1F6R5Rz9LK0OjD28gHwOlfOyW8QrM95j8+5NqYyFsna6ylQ3WOFMqBu0 hVTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature:arc-authentication-results; bh=IzCp6P2zRLI1PTlZUgTg+LmFS1ljnx4Z36LjGAkVy9w=; b=zdtLhxQgaum1AZNtjVOdIrKudugY63g7KuKVY0p8fqfpwW4LGYskC2FAMt2nkoidM9 /8NorNQndhLIHLQ28Xa8Nmt8muZ/1iu+il1eS1/zlBhCjIGmrfeJNtgVFjAVN+YU4bHH nFh1weZ+kpieGyf9T0Gc57YgloUI8NwxMi9E1jmBM8Axz/B+UWR75ybRMcXdK9Wa6G2B 3BjPGv4z0yXoyYPcl6DZgySgbBUMfMQNiVpg9o0NpWcNJKYCOmqXrCGv04y99OmcuXvL d6jt3CSUMZSMf8DCjnuK9nXU808KS70N5bLg9zB7JIW3wxlP4soy42RENbS5Wli+F8L2 UlLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rsTdr3GN; 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 p85si5008423pfk.77.2018.04.20.01.17.44; Fri, 20 Apr 2018 01:17:58 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rsTdr3GN; 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 S1754122AbeDTIEJ (ORCPT + 99 others); Fri, 20 Apr 2018 04:04:09 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39606 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753854AbeDTIED (ORCPT ); Fri, 20 Apr 2018 04:04:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IzCp6P2zRLI1PTlZUgTg+LmFS1ljnx4Z36LjGAkVy9w=; b=rsTdr3GNnRMjZFluj5NpuxCkm W2u7FJmj0TzEOwtfPLQzHLfud8gLxON811DOTx85uZi91wiFy8H53LD48jeUySVWqrE4kZzxOq+Fu ZKaj2+83OfUOjqEFPGYss3r07HX//UuXmuk2jGUOt4vRHvS35mzdw6v4odDvsKYPGglJjuHilaEal oy2O4+XnzvqCTi5RW0zqzoDhHcNUZOb5cWU2walgy7QOslf/dMdI3o6slV9L0/TialCfKQEy2M1sn UnaIRm4YdFls8eKKgzeMZ83wg1+5haccpwfjTFKbouxhEzawXozLj3Gw+5eOBR2tiHEpjVyVJGlOJ yK1IBr7mw==; Received: from static-242-42-24-46.ipcom.comunitel.net ([46.24.42.242] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9R0y-0007KE-Ls; Fri, 20 Apr 2018 08:03:29 +0000 From: Christoph Hellwig Cc: linux-arch@vger.kernel.org, Michal Simek , Greentime Hu , Vincent Chen , linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/22] alpha: use dma_direct_ops for jensen Date: Fri, 20 Apr 2018 10:02:55 +0200 Message-Id: <20180420080313.18796-5-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180420080313.18796-1-hch@lst.de> References: <20180420080313.18796-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The generic dma_direct implementation does the same thing as the alpha pci-noop implementation, just with more bells and whistles. And unlike the current code it at least has a theoretical chance to actually compile. Signed-off-by: Christoph Hellwig --- arch/alpha/Kconfig | 1 + arch/alpha/include/asm/dma-mapping.h | 4 ++++ arch/alpha/kernel/pci-noop.c | 33 ---------------------------- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index aa7df1a36fd0..94af0c7f494a 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -204,6 +204,7 @@ config ALPHA_EIGER config ALPHA_JENSEN bool "Jensen" depends on BROKEN + select DMA_DIRECT_OPS help DEC PC 150 AXP (aka Jensen): This is a very old Digital system - one of the first-generation Alpha systems. A number of these systems diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h index b78f61f20796..76ce923ecca1 100644 --- a/arch/alpha/include/asm/dma-mapping.h +++ b/arch/alpha/include/asm/dma-mapping.h @@ -6,7 +6,11 @@ extern const struct dma_map_ops *dma_ops; static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) { +#ifdef CONFIG_ALPHA_JENSEN + return &dma_direct_ops; +#else return dma_ops; +#endif } #endif /* _ALPHA_DMA_MAPPING_H */ diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c index b6ebb65127a8..c7c5879869d3 100644 --- a/arch/alpha/kernel/pci-noop.c +++ b/arch/alpha/kernel/pci-noop.c @@ -102,36 +102,3 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, else return -ENODEV; } - -static void *alpha_noop_alloc_coherent(struct device *dev, size_t size, - dma_addr_t *dma_handle, gfp_t gfp, - unsigned long attrs) -{ - void *ret; - - if (!dev || *dev->dma_mask >= 0xffffffffUL) - gfp &= ~GFP_DMA; - ret = (void *)__get_free_pages(gfp, get_order(size)); - if (ret) { - memset(ret, 0, size); - *dma_handle = virt_to_phys(ret); - } - return ret; -} - -static int alpha_noop_supported(struct device *dev, u64 mask) -{ - return mask < 0x00ffffffUL ? 0 : 1; -} - -const struct dma_map_ops alpha_noop_ops = { - .alloc = alpha_noop_alloc_coherent, - .free = dma_noop_free_coherent, - .map_page = dma_noop_map_page, - .map_sg = dma_noop_map_sg, - .mapping_error = dma_noop_mapping_error, - .dma_supported = alpha_noop_supported, -}; - -const struct dma_map_ops *dma_ops = &alpha_noop_ops; -EXPORT_SYMBOL(dma_ops); -- 2.17.0