Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1590225ybt; Mon, 15 Jun 2020 04:28:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlAIVtbW1a5fBBe+49tuKjtEbRj+PVkDig5pCh/qnoaJG0ABOO+mboRlAYNXHHjexO7WBv X-Received: by 2002:a05:6402:1d10:: with SMTP id dg16mr22808070edb.309.1592220539557; Mon, 15 Jun 2020 04:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592220539; cv=none; d=google.com; s=arc-20160816; b=m6ky0IXH7lGGoodPWRtTAhz6tuNaZDNPQHdMNbAcOstCwH/qCkeX9S1mxB03sZfYdG ET25Gkj8+2gmvYpZTeu8eTiv++9rCx3AiTEwGBPn4H1IDb7jjnBaTzPy5SKQ9ksGGBaj 3RLB18Q/OSCcz17fYxRRh1LTdY/v04/psldeO62pK3JTSg+5GGe+MckKHceVpz2FdZdn +oELCQbRnG7sRa+PU2YzdJJnKphZQGYMF5OnG/N0V1XSkPn220ebiV0XlERysGYIBtmV PHJ4Gsg/jZXy2CLLH/Mf7ST3RjEwwT/AUPNkkzDtYnHssExBQdl2jhwjfL4pTzur+k2H k0yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=udjJogEpBdunpSq1YqH1eLSeMqYIEWyCAuW3cHJzEcs=; b=CEXDz266wL9t8ogCv0WDYpErPqrW6htfVRGhE9VZFFOUi66QQbLXmw1qEVymmIO/pX +Su6fz8bqp/EYMz492vtD7wxGhLPsjXqnqEZry3cyiZdU99LcT/YGOUjsCLfheagTOCC ukdwC3cLWd0qXr60RposLOgjyzMifcKRIr+YC1OF1xGAwbtNRgl6Ifg3K3buYuxiDTsc /UicFN5ZdFYoGf/CCJHpOTKYmXU2sCMnNNLzhasASEM+palBgVHu8P54la2ttd32aIxT jMlqPn5r773vgTJZUG6OIuJfYevH9QDw0ELwz2BVAgeH6wQY3YACSTrOtg8tad+j51+k z+rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m8rK1weu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q9si8631258edb.473.2020.06.15.04.28.36; Mon, 15 Jun 2020 04:28:59 -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; dkim=pass header.i=@kernel.org header.s=default header.b=m8rK1weu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729693AbgFOLZ4 (ORCPT + 99 others); Mon, 15 Jun 2020 07:25:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbgFOLZ4 (ORCPT ); Mon, 15 Jun 2020 07:25:56 -0400 Received: from localhost (unknown [171.61.66.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4C58E20663; Mon, 15 Jun 2020 11:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592220355; bh=hheBwTSFc6iwBWB8MsUTDTdzd+3OLaOnprLkDFHzJZ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m8rK1weuyASMxJgo3gsh7sPxRrQAYD12kwRU1DXbJp57frQ+XcatZNTgVFVlxrzQI HOg/s3WpJX7CJxde07iTNDrw+n3kKCCoA2P+oBdHx2M9cBJqLd2p4ITInuMOO2Twgz poRfTxYiKMbsrXKoOOM3hCXA5vN9EbhrexQch/hA= Date: Mon, 15 Jun 2020 16:55:49 +0530 From: Vinod Koul To: Robin Gong Cc: Mark Brown , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "festevam@gmail.com" , "robin.murphy@arm.com" , "matthias.schiffer@ew.tq-group.com" , "kernel@pengutronix.de" , dl-linux-imx , "linux-spi@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1 RFC 1/2] spi: introduce fallback to pio Message-ID: <20200615112549.GL1393454@vkoul-mobl> References: <1591880310-1813-1-git-send-email-yibin.gong@nxp.com> <1591880310-1813-2-git-send-email-yibin.gong@nxp.com> <20200611134042.GG4671@sirena.org.uk> <20200612101357.GA5396@sirena.org.uk> <20200612141611.GI5396@sirena.org.uk> <20200615071931.GK1393454@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robin, On 15-06-20, 08:59, Robin Gong wrote: > On 2020/06/15 15:20 Vinod Koul wrote: > > > Yes, but both assume spi controller driver could detect such dma > > > failure before dmaengine_prep_*(). Let's wait Vinod's comment for that > > > if dmaengine_slave_config could keep direction. > > > > The direction is already in the prep_ call, so sending in dmaengine_slave_config > > is not required, pls pass it in the prep_ call > Hi Vinod, > Is there any way to let the device driver to know dma controller is ready > (in sdma case is sdma firmware loaded or not)before prep_call? Hence, spi core > could map dma buffer or not. Prep_call is too late for spi core since the buffers > have been already mapped. Can you use .device_alloc_chan_resources for that? This is where all the resource allocation for a channel should happen... > From my view, seems dmaengine_slave_config is the only one...Further, > sdma need direction in dmaengine_slave_config phase, because currently > what's the tx/rx script used on sdma channel is decided not only peripheral_type > but also direction. For example, spi tx dma is running ram script to workaround > ecspi ERR009165 while rx dma is running rom script, so only spi tx dma channel > depends on sdma firmware loaded(now that could be detect by ' load_address > < 0' in sdma_load_context() and prep_ call finally). > I knew direction is deprecated in dmaengine_slave_config, but that's really > very useful for sdma to check if firmware loaded and spi core could get it earlier > before prep_call(fallback to PIO if dma is not ready). I think that is wrong expectation, dmaengine_slave_config should pass the slave_config to driver and nothing else. The relevant action should be taken in respective prep_ calls here, so that should be fixed as well -- ~Vinod