Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1269758pxa; Fri, 28 Aug 2020 08:13:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGGWg/t7CipjBjksALYdnzg3WcXXnGze9bN9yoxnBDhQOWlyjtGT6V/idetpeI6ZODgyVz X-Received: by 2002:a17:906:4089:: with SMTP id u9mr2408484ejj.235.1598627595952; Fri, 28 Aug 2020 08:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598627595; cv=none; d=google.com; s=arc-20160816; b=yoVi75aGtq/6A1ad4IsPWLjFDJxXneQmxWjc9r8Y7WbB2qdm3CaLXS5slVcvsJpt68 uOsFV59+iEKAadVD/C6Ij6Si+5PLHPaAz356w98tH9o8dCRzDjYJmFI/KD3SNMa+dH+F Vf1QEjQRsokO+9zZlvB4hQIAYkU+yw8wLVulHqT4phyj9GWSJ/tybmDH5IVLK8ks1EgI ROAtgN0J5ZXwt/Kg1qbiUH4gQ5uAosDnzlS49Gtca9xWNlSWJd4s45RUp1ZXCSYfyaVW r08y/35biyiB9hBP3AHG160BAVcD9KWMsZSVLcuu5Pm5i3GAEreuCosuFVO80y6eXQbE KjpA== 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=iFCEqV2+z5eoaaT10LUq2KPcmcUBFPRDQt263LowTwQ=; b=D3lvzw1h025ldF10Vv6WZIkXX9Ol7CFrc2i75WX26b7AE3ANZ3X+PzUNLklarVUpir PF3XQ6blmU1MnZeneqMLGbKzNXMD7wAhVRuIE3DWeZ74RfbGXbprchlrtqTvY+I3FK7q Y50MfuYKW6eoHjwRpTOveYphkhSrtwL+UzNpWEadDcKe954Y42oQgchtV2rGhfOdnbY2 /NZ0jDlBOey2lDjp1iYj6DAdGbk58LmFnTQOxL28v2CRF2G1nmepAx+xkm4jorrajTde /p/kJdjKl2Iph2mFfD2r7qduYrsLj0MKvAKRqzPPGML+wVvw76/JOE7Gdln9cgucjWya RBiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo17si914466ejb.362.2020.08.28.08.12.52; Fri, 28 Aug 2020 08:13:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728245AbgH1PJ6 (ORCPT + 99 others); Fri, 28 Aug 2020 11:09:58 -0400 Received: from brightrain.aerifal.cx ([216.12.86.13]:47644 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbgH1PJq (ORCPT ); Fri, 28 Aug 2020 11:09:46 -0400 Date: Fri, 28 Aug 2020 11:09:43 -0400 From: Rich Felker To: Ulf Hansson Cc: Christoph Hellwig , Yoshinori Sato , Linux-sh list , Linux Kernel Mailing List , "linux-mmc@vger.kernel.org" , linux-spi@vger.kernel.org Subject: Re: [PATCH 09/10] sh: don't allow non-coherent DMA for NOMMU Message-ID: <20200828150942.GV3265@brightrain.aerifal.cx> References: <20200714121856.955680-1-hch@lst.de> <20200714121856.955680-10-hch@lst.de> <20200828020045.GT3265@brightrain.aerifal.cx> <20200828021152.GU3265@brightrain.aerifal.cx> <20200828042422.GA29734@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2020 at 11:26:57AM +0200, Ulf Hansson wrote: > On Fri, 28 Aug 2020 at 06:24, Christoph Hellwig wrote: > > > > On Thu, Aug 27, 2020 at 10:11:53PM -0400, Rich Felker wrote: > > > > This change broke SD card support on J2 because MMC_SPI spuriously > > > > depends on HAS_DMA. It looks like it can be fixed just by removing > > > > that dependency from drivers/mmc/host/Kconfig. > > > > > > It can't. mmp_spi_probe fails with ENOMEM, probably due to trying to > > > do some DMA setup thing that's not going to be needed if the > > > underlying SPI device doesn't support/use DMA. > > > > Adding the linux-mmc and linux-spi lists, as that seems pretty odd. > > The mmc_spi driver needs modernizations, so I am not surprised to see > odd things. > > My guess is that in ->probe() we check "if > (spi->master->dev.parent->dma_mask)" - > and runs dma_map*() > operations, which fails and leads to bailing out of ->probe() to > return an error code. > > However, by looking at the code, one get the feeling that the DMA > support is somewhat prepared to be made optional. I guess it has never > been really tested, as the Kconfig option has "depends on HAS_DMA" - > and it's been like that as long as I can remember. It always worked on our "byte-banged" SPI controller, with no DMA controller present, before Christoph's changes in this patch series, and seems to be working now (although I have some other, hopefully unrelated regressions to debug) with #ifdef CONFIG_HAS_DMA around the if (spi->master->dev.parent->dma_mask) block in mmc_spi_probe. That's probably not the right fix though -- why isn't it checking host->dma_dev instead and only attempting DMA setup if dma_dev is non-null? Rich