Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3588874imu; Fri, 30 Nov 2018 02:54:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/WCFVMkBzy9tqIVEvOkbuZIQYW6gn9JGEKrt5p4TdemHfetxBWNc/uZQMlmyI+O/Zk4nTt/ X-Received: by 2002:a65:514c:: with SMTP id g12mr4405310pgq.169.1543575277161; Fri, 30 Nov 2018 02:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543575277; cv=none; d=google.com; s=arc-20160816; b=LALmE+c5EsMjDyOtzSkTglxIp3wwy2ysM1FBeL5RU82MmG4FBAvytEAcFMRehYWg0N 2npm08JR0N9UCTD1l/im45csD5LiHsU7j55sr08ZXRZRCuJ25S4pRF4/ZQ8YDjI7qcwm DmdcLTNOO3PajYTRqsGvYDy9ZRwL4/22mZSmXkOSQAuHkuvaWdGLIP+99QLzGhn3JBs3 Ta1lKE/FEi3yQosRD2B7UMxz9Zfnuu47YbhnmUt+9iAeSXSydGY3Cfm8eyid8uvkee5o zylVGG/cXIn0yCXjZnGUzsrR+pDQWGAtJNi1Xk0jf6naXqWGvbxOrGUJCIRZJO/KqwpO P0ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Mtqf17R5es53vh2+aIJDVz6UXgrloNl1idhImL4eMLI=; b=yabvM41e/aSSkoIMKZqEkGQfTNL3pK4rNrrRWfDrWPeOj+L0L6cqYLSCsKqYTGICVd UWQTkIOp/9YvZ+VTdyNIK9+hdobn4YVOxC+xyVJN2QrfYw6vD2ZPCV0p/kfwxCd2HmDh t9NVZ/6+Z+zakmr8CPcCzaZ+Xrimay023CDMrd5pcoIqHMpMBJsQHvCVhC5Q6mPzAsVG N/pVwtgvmGk6N7cku0FScFUReOGpR4Tmry/rREGVioxxl04P7qs4J7bWYF4OvdXA5h9y e5DrUXttb4grkItTrmLmsL/O+pcxDz3Ih8KEwB54rBaHneRWEb3D54UwCZnkfaiCgHhs lE/w== 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 k18si4870600pgf.97.2018.11.30.02.54.22; Fri, 30 Nov 2018 02:54:37 -0800 (PST) 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 S1726776AbeK3WCl (ORCPT + 99 others); Fri, 30 Nov 2018 17:02:41 -0500 Received: from verein.lst.de ([213.95.11.211]:49553 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726527AbeK3WCk (ORCPT ); Fri, 30 Nov 2018 17:02:40 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 7081F68BE5; Fri, 30 Nov 2018 11:53:46 +0100 (CET) Date: Fri, 30 Nov 2018 11:53:46 +0100 From: Christoph Hellwig To: Christian Zigotzky Cc: Christoph Hellwig , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linux-arch@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Olof Johansson Subject: Re: use generic DMA mapping code in powerpc V4 Message-ID: <20181130105346.GB26765@lst.de> References: <20181114082314.8965-1-hch@lst.de> <20181127074253.GB30186@lst.de> <87zhttfonk.fsf@concordia.ellerman.id.au> <4d4e3cdd-d1a9-affe-0f63-45b8c342bbd6@xenosoft.de> <20181129170351.GC27951@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hi Christian, for such a diverse architecture like powerpc we'll have to rely on users / non core developers like you to help with testing. Can you try the patch below for he cyrus config? For the nemo one I have no idea yet, there is no chance I could trick you into a git bisect to see which patch caused the problem, is there? diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 7b70dcbce1b9..2f0ca6560e47 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h @@ -47,7 +47,7 @@ struct machdep_calls { #endif #endif /* CONFIG_PPC64 */ - int (*dma_set_mask)(struct device *dev, u64 dma_mask); + void (*dma_set_mask)(struct device *dev, u64 dma_mask); int (*probe)(void); void (*setup_arch)(void); /* Optional, may be NULL */ diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c index bded4127791a..2587eb0f3fde 100644 --- a/arch/powerpc/kernel/dma-swiotlb.c +++ b/arch/powerpc/kernel/dma-swiotlb.c @@ -22,11 +22,10 @@ #include #include -bool arch_dma_set_mask(struct device *dev, u64 dma_mask) +void arch_dma_set_mask(struct device *dev, u64 dma_mask) { - if (!ppc_md.dma_set_mask) - return 0; - return ppc_md.dma_set_mask(dev, dma_mask); + if (ppc_md.dma_set_mask) + ppc_md.dma_set_mask(dev, dma_mask); } EXPORT_SYMBOL(arch_dma_set_mask); diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 9584765dbe3b..8582a418516b 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -134,7 +134,7 @@ static void setup_swiotlb_ops(struct pci_controller *hose) static inline void setup_swiotlb_ops(struct pci_controller *hose) {} #endif -static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask) +static void fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask) { /* * Fix up PCI devices that are able to DMA to the large inbound @@ -144,8 +144,6 @@ static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask) dev->bus_dma_mask = 0; dev->archdata.dma_offset = pci64_dma_offset; } - - return 0; } static int setup_one_atmu(struct ccsr_pci __iomem *pci, diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 8dd19e66c0e5..94a4db5f7ec3 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -599,17 +599,16 @@ static inline int dma_supported(struct device *dev, u64 mask) } #ifdef CONFIG_ARCH_HAS_DMA_SET_MASK -bool arch_dma_set_mask(struct device *dev, u64 mask); +void arch_dma_set_mask(struct device *dev, u64 mask); #else -#define arch_dma_set_mask(dev, mask) true +#define arch_dma_set_mask(dev, mask) do { } while (0) #endif static inline int dma_set_mask(struct device *dev, u64 mask) { if (!dev->dma_mask || !dma_supported(dev, mask)) return -EIO; - if (!arch_dma_set_mask(dev, mask)) - return -EIO; + arch_dma_set_mask(dev, mask); dma_check_mask(dev, mask); *dev->dma_mask = mask;