Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2310488rwl; Thu, 6 Apr 2023 08:30:53 -0700 (PDT) X-Google-Smtp-Source: AKy350bJmhiwFZy3R1bPrcHlgpAXNxDJmXD2+1zzk/eAuzAqVBeIcjWT3Wo/D+UoSB20KPOp7pxP X-Received: by 2002:a17:906:6bc4:b0:931:86cf:9556 with SMTP id t4-20020a1709066bc400b0093186cf9556mr7278368ejs.23.1680795052803; Thu, 06 Apr 2023 08:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680795052; cv=none; d=google.com; s=arc-20160816; b=fB5tzyP619o0IY2Cg+u3S5c540DU+cVHVS/1VTU/QNP4KFb1mGWlmoC/m72IIrwKth +b+V5+lC347Ew9VCcSoDIHY5QX8YHOuMT6Bp6QaFgZivVIFreMCRR2ssp8sXtlLGV+pM /6cYfV0EfL94rrDmYl2zCgIjvCqDhnP6XMLEGpH17NJeYNitHMTV5AZ44quAgngS/i8i cCN8NBiSwDqVJJt94HFYw45WgaUNnKgDKU1vyL7b0X0iD83DQ6VkPyACOdqfaqfPJEdq 7Qlf2Mey2ko78VWLqp4No8BtCg4DeCyZZLvxGxwTiMK9aZYOuF//V0KnJMxckWocuGiw x2UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P0vlFkURwRWFEzxhlHZaTSCuqNS0AZn0ClBmyihrtrY=; b=Av3NEPwaFSyzaIFDwZGpN8G3SUjYojHosFzaHIIYYvYc09IuDGAU913cMwiKbtgZOh 1bErVM8pWNj8Pk5f2mcxy2DSCXDzarbdAWWBfTAYCWLiOaaZvJG1Ube9ybHaWDb+7BY4 p8+oPxI7it4nfl6jLRu+twoLLUUat/jKuWSlQ+5e5kdBuY7Zf4fnRWtpy/FTy7/aHhMp AItE/woDe7Vo57i/yycPmaZ8pYQ9MQYR8Dt8WfaLcPOxT4whoLREzobBlnCHLVcQwdQG okdgHEU2oY+6tsGuGWEwNSZ5rlb9PIhXHBaCXH50TkKZ+4eHhGdmyj+0uQoGM1R5sAG5 SK8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KTPLish9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x17-20020a1709064bd100b0093b794c719csi1334124ejv.690.2023.04.06.08.30.26; Thu, 06 Apr 2023 08:30:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KTPLish9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S239192AbjDFP2h (ORCPT + 99 others); Thu, 6 Apr 2023 11:28:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbjDFP2f (ORCPT ); Thu, 6 Apr 2023 11:28:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04099E61; Thu, 6 Apr 2023 08:28:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9C545647DF; Thu, 6 Apr 2023 15:28:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72296C433EF; Thu, 6 Apr 2023 15:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680794914; bh=jw9QDNpzIUYXB+9TakAdXq9GVBcm2ix7VND/CemLEy8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KTPLish9joEfAk9+CCA/5O/JHM4jCNpuIpQR1oVHz1ViiLF+KxhBNXU8TNlXSkca1 1YrmxjOJ9KTZYQHBAicx8rXHq6CLcwk4KmZphs2ldA0q+02mB1Y9xsi0RWSQwNJRZc P/YDszwqvmO+liPpm1DQrU+1HN5FS4d3i9NLgi6+QD4914OhStpt5EWLRNFXVwn5nT aycLztlLYZHq3NOWdwC8wCxGV0gd3eSISP9GH+ImQps3xQderzBQx7bK9JM9/Pr10t YI+CaYhW9K6T/B/BoRBTxcS1W8KFdEQeKjzZNiWxIlxhJBcv2Oom+8+WyDis8w/7df k/grSMm4nBVEw== Date: Thu, 6 Apr 2023 16:28:27 +0100 From: Mark Brown To: Vijaya Krishna Nivarthi Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, vkoul@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, quic_msavaliy@quicinc.com, dianders@chromium.org, mka@chromium.org, swboyd@chromium.org, quic_vtanuku@quicinc.com Subject: Re: [PATCH 2/2] spi: spi-qcom-qspi: Add DMA mode support Message-ID: <92690348-21c3-45de-bdb1-d0977b859702@sirena.org.uk> References: <1680631400-28865-1-git-send-email-quic_vnivarth@quicinc.com> <1680631400-28865-3-git-send-email-quic_vnivarth@quicinc.com> <0b182a36-0254-6720-4a35-f9e617c12797@quicinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zYcIuw0bOKg30pT2" Content-Disposition: inline In-Reply-To: <0b182a36-0254-6720-4a35-f9e617c12797@quicinc.com> X-Cookie: Man and wife make one fool. X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zYcIuw0bOKg30pT2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 06, 2023 at 08:23:21PM +0530, Vijaya Krishna Nivarthi wrote: > On 4/4/2023 11:47 PM, Mark Brown wrote: > > On Tue, Apr 04, 2023 at 11:33:20PM +0530, Vijaya Krishna Nivarthi wrote: > > > + uint32_t reserved2:7; > > > + uint32_t length:16; > > > + //------------------------// > > What does this mean? > That separates the part of cmd_desc that is visible to the HW and the part > that is required by the SW after xfer is complete. > I can add a comment in v2? Yes, please. > > > + for (ii = 0; ii < sgt->nents; ii++) > > > + sg_total_len += sg_dma_len(sgt->sgl + ii); > > Why are we calling the iterator ii here? > Calling it ii helps in finding iterator more easily in code. > should I stick to i in v2? Given that multiple people queried this... > > > + if (ctrl->xfer.dir == QSPI_READ) > > > + byte_ptr = (uint8_t *)xfer->rx_buf; > > > + else > > > + byte_ptr = (uint8_t *)xfer->tx_buf; > > If we need to cast to or from void * there's some sort of problem. > the tx_buf is a const void* > in v2 I will cast for tx_buf only? Or just keep byte_ptr as const - we're not modifying it are we? > > > +#if NO_TX_DATA_DELAY_FOR_DMA > > > + mstr_cfg &= ~(TX_DATA_OE_DELAY_MSK | TX_DATA_DELAY_MSK); > > > +#endif > > Why would we add extra delays if we don't need them, might someone set > > this and if so when? > I believe its used when some slave devices need a delay between clock and > data. > Its configured as 1 for PIO_MODE(FIFO) right now. > For DMA_MODE we are not using same, both seem to work for DMA. If some devices need this to be configured it needs to be configured either from the driver for that device or via DT depending on the exact requirements. --zYcIuw0bOKg30pT2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmQu5RoACgkQJNaLcl1U h9A2Wwf7BdgiPpI1nqHATQUbOCXG1wEA33/yRFJIYrDDrS9X/qxM8mjv67vm0aDY QKBjEGMftTCIqiZrDffi2CM3F4EW/xcP/JPs28pSAvtyvRUsnV9uu0Y2/SFJGBrc XcZTRofs4b7k4pyqYjgYc/HGGskigoHjQzOAqwIEHGET6ijey7Xtek1jhZJbd2X2 h41M3eoh/zbrq+TPylPgGuDHR0UpsFKeJr3aRho0y2SaDcRDcRX88U9n0ITaPzDK SDZr73Z0IxFV06aJF75tkQ7+XnmflXgxnDY374rw7g9WdbOQr/HNOup5VOeBhBAG rJ/Ia5knt+Zqdud8qUBikIeVSRN1sQ== =R5Mx -----END PGP SIGNATURE----- --zYcIuw0bOKg30pT2--