Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp155639pxk; Wed, 2 Sep 2020 17:46:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUQSN1+YDPglOMbLYWO90r0Brx96PsHV+r26cA6ylnBfTeHhOOCfV0baA07sr0s4Y0hWYl X-Received: by 2002:a17:906:640c:: with SMTP id d12mr754036ejm.388.1599093986482; Wed, 02 Sep 2020 17:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599093986; cv=none; d=google.com; s=arc-20160816; b=oSSinDvYn3pVVIWfj90ULCx/jODsJ9hgrDcGmIS4atI5Wqm/taLQTR7WEdcCmPN7JD HwJfWuj868Usw70ICSf9wzZHZnZqv1Csa42qmWLizIqvEUxBt/oxzymcKp20DYrE3cdm XKJSN1qG72/zP40vepQrqTUFhovBacRr7T6S2AYeNELevlb/9A8eUif+VllTcI1qodNd 84wxcECsTZMtNMAq/ToBDAqzXnBW/hI8NfPQBYAXYuWFxLigiwAb9cKdlO0tZOamFKES i7BWbDQs0Kw7IggPtc9dLTdx0/7iFtQK88IkYcA7f0p+7Wo2HE3PUQujB7pgrcOqQRx4 ucpQ== 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=njlBCkXeW/oUKjC/14U9fUIxvaeKQu9QVlj4nJlfkrc=; b=jl2qfP1Wug/Y4nQiKIRUhxvjtBUlhqVaH7vnhKaqUF8e+7WeQGKkzrSQp3CmAvIQoo NFZrCuCvEKPtocj9+j6zQYCdODWcp3i8RiOD/FFI3HbuzfXz1t1HdzQSAmZmyNFsPfV5 YIqchK9C3ZfY3GXRFQF62gQ7D95InC8oZF0D0goTraOUBm7eqG8ihguHjBT0MIPbo3Cq zOvLFGrR2uX4dpa6q0E9jD3++S8BC9iqPhQOTDBIxkFScWcywtKgZ7Utr0GN8+01uUpD oamgY7oVQNoo2iWkoDr1+qn0ks+oFjZYBssCL8i/Z0EcveVhr9gRkN+RC7soGU144VUc vxGg== 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 u1si522683eda.449.2020.09.02.17.46.01; Wed, 02 Sep 2020 17:46:26 -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 S1726594AbgICAlh (ORCPT + 99 others); Wed, 2 Sep 2020 20:41:37 -0400 Received: from brightrain.aerifal.cx ([216.12.86.13]:49010 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726312AbgICAlh (ORCPT ); Wed, 2 Sep 2020 20:41:37 -0400 Date: Wed, 2 Sep 2020 20:41:35 -0400 From: Rich Felker To: Geert Uytterhoeven Cc: Ulf Hansson , Christoph Hellwig , "linux-mmc@vger.kernel.org" , Mark Brown , Linux-sh list , Linux Kernel Mailing List Subject: Re: [PATCH v2] mmc: mmc_spi: Allow the driver to be built when CONFIG_HAS_DMA is unset Message-ID: <20200903004135.GT3265@brightrain.aerifal.cx> References: <20200901150438.228887-1-ulf.hansson@linaro.org> <20200901150654.GB30034@lst.de> <20200901154049.GA376@lst.de> <20200902134418.GR3265@brightrain.aerifal.cx> 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 Wed, Sep 02, 2020 at 05:51:16PM +0200, Geert Uytterhoeven wrote: > Hi Rich, > > On Wed, Sep 2, 2020 at 5:43 PM Rich Felker wrote: > > On Wed, Sep 02, 2020 at 10:31:47AM +0200, Ulf Hansson wrote: > > > On Tue, 1 Sep 2020 at 17:40, Christoph Hellwig wrote: > > > > On Tue, Sep 01, 2020 at 05:36:17PM +0200, Ulf Hansson wrote: > > > > > > I still don't think this makes sense, as the dma_mask should always > > > > > > be non-NULL here. > > > > > > > > > > If that is the case, I wonder how the driver could even have worked without DMA. > > > > > > > > > > Because in the existing code, host->dma_dev gets assigned to > > > > > spi->master->dev.parent->dma_mask - which seems to turn on the DMA > > > > > usage in the driver. > > > > > > > > > > What am I missing? > > > > > > > > Do you know of other non-DMA users? For SH nommu it probably worked > > > > > > I don't know of other non-DMA users. As I said, I wish someone could > > > step in and take better care of mmc_spi - as I know it's being used a > > > lot. > > > > > > > because SH nommu used to provide a DMA implementation that worked > > > > fine for streaming maps, but was completely broken for coherent > > > > allocation. And this driver appears to only use the former. > > > > > > Alright, so you are saying the DMA support may potentially never have > > > been optional to this driver. In any case, I can remove the check in > > > $subject patch, as it shouldn't matter. > > > > DMA support was always optional, because even on systems where DMA is > > present, it doesn't necessarily mean the SPI controller uses DMA. In > > particular, pure bit-banged SPI via GPIOs doesn't have DMA, but has > > always worked. See my previous reply to Christoph about host->dma_dev > > for my current-best understanding of what's going on here. > > > > > Anyway, let's see what Rich thinks of this. I am curious to see if the > > > patch works on his SH boards - as I haven't been able to test it. > > > > I'll rebuild and retest just to confirm, but I already tested a > > functionally equivalent patch that just did the #ifdef inline (rather > > than moving the logic out to separate functions) and it worked fine. > > Hence, Tested-by? ;-) Confirmed that this version of the patch works too. Thus, Tested-by: Rich Felker