Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4235275rwe; Mon, 17 Apr 2023 09:40:55 -0700 (PDT) X-Google-Smtp-Source: AKy350ZSomNsdLeiXhy9vCnQ0odyjOQQCy46SgwxLMqMWGsFrFNg6hJ3e3pHYKspmhgtlhw1aH2T X-Received: by 2002:a05:6a00:190f:b0:623:c117:f20e with SMTP id y15-20020a056a00190f00b00623c117f20emr20721183pfi.19.1681749655220; Mon, 17 Apr 2023 09:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749655; cv=none; d=google.com; s=arc-20160816; b=Ppq8uRmSLlZek/btli30ZNIL48iwJct9+aPp/rHNroWuZr2FQjh07ZSkkcfdf0eSr3 ZHQT3mPZvox5vm5xr3W0lH9Kyz1YWVRtqDyRoy3H7vFQT/WSNhUm5IZpIest4CaJwod9 VsHd0yl/9Pz4BDrogfC3Jlc1tHIaBg5JCXESPIxL4uD7TyMeIrMv/05ODQscmC9xsekl Lu3JQLmgZs5HM4Dab1axrMqT4jvDZCE5klD/PLMU3kNATIPlaNQ+lBQTinrY7num8gEm Z2D+b797CS6NIMUUDmSO6oujS5Lo+KFLtwsnpegiyqCsMNn509i98r1DTS30smj5NKE3 OBFQ== 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=FAIysyqG0a1rgefE7D2T0SjZEFRPrBP3Arnqe1lfd7Q=; b=IJty3nVDJMR64nGJNfbz7hSfaqZB8xEiXeKs6gQdTRCBQvQTBukOeaWtQUNEX7ulRg 2mBFwsfzlv5fW2qnkgEUcdrB9Ar84nNjC5k6P+N2Duw55EcwXzyhiOndzAaFTeKCNzav FYeFQ6Q0TS6f9mIoTKZa5l1aV+5/tOSWRSXKovSaNJb736yNCs0qL94fM4TGYXYMLafd tvkMPTuYZs7180iUbA58yL1aZlWGmtWANL+vRrTBzNqTucv4sO0CbV/38YBQDugD7uGx 6UZYI5PgV1eBagLkLHL49wfsTGA/i7Zv1TyLac0qHEwldsh0DeV94NKFi72P8Z8LLL7o F01g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gSIGsY6q; 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 g4-20020aa796a4000000b0063bba133a6esi3145494pfk.4.2023.04.17.09.40.41; Mon, 17 Apr 2023 09:40:55 -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=gSIGsY6q; 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 S229865AbjDQQjN (ORCPT + 99 others); Mon, 17 Apr 2023 12:39:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjDQQjK (ORCPT ); Mon, 17 Apr 2023 12:39:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 563C56E8E; Mon, 17 Apr 2023 09:39:09 -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 E3B1261182; Mon, 17 Apr 2023 16:39:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EF05C433EF; Mon, 17 Apr 2023 16:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681749548; bh=JCqP49Xpz85bHJtVkhJeBIQ8R7VedWXznxPSZaz5a90=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gSIGsY6qXIZBY2NmJowvUhPOroGWnVYrnpjj4HZdKj0Loy/wX1y/xPyPuwYFUvvn+ co7RimQUmLGRtnUpjGKsE5ICf4LznyfxJdKLNrJhKG9zduhhxqq8la7D/XX438acy/ vayM/0atTfF7YHY/j1icwAFcAIrXbORhu/5XOrdnoKT6HXkg9shZkPnSZ0A9VuYHUw 7xwk6ljyzDwt62NfX80+9EJZNRSnRyazJ3g8BauDFFtcO339AIHkNCgYgkfimoFrKo ABvdpia6wEBBeoawryExFPwqHBhlqku09RoYg8jBmycH2TzqjUolgLQfVyl6YZlu5N AGVCKbHVg077g== Date: Mon, 17 Apr 2023 17:39:01 +0100 From: Mark Brown To: Vijaya Krishna Nivarthi Cc: Doug Anderson , agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, cros-qcom-dts-watchers@chromium.org, linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_msavaliy@quicinc.com, mka@chromium.org, swboyd@chromium.org, quic_vtanuku@quicinc.com Subject: Re: [PATCH v3 3/3] spi: spi-qcom-qspi: Add DMA mode support Message-ID: <85225dd4-7ecd-4ce9-8447-184f749022fe@sirena.org.uk> References: <1681481153-24036-1-git-send-email-quic_vnivarth@quicinc.com> <1681481153-24036-4-git-send-email-quic_vnivarth@quicinc.com> <30a752c9-3ea0-43d3-959a-da2e8b526cb4@sirena.org.uk> <46249e7e-ac2c-00d3-b3b0-7b15848e7b7c@quicinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8OVq0bfjkI9I0UjH" Content-Disposition: inline In-Reply-To: <46249e7e-ac2c-00d3-b3b0-7b15848e7b7c@quicinc.com> X-Cookie: Two heads are more numerous than one. X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 --8OVq0bfjkI9I0UjH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 17, 2023 at 09:27:16PM +0530, Vijaya Krishna Nivarthi wrote: > However, Like Doug pointed, dma_alignment is not being used by core. The core will use kmalloc() for any new buffers it allocates, this is guaranteed to satisfy DMA constraints. > Is it up to the SPI consumers to read this and ensure they are providing > dmaable buffers of required alignment? If they're doing anything fun for allocation. Or they can just use kmalloc() themselves. > The dma_addresses coming from core are aligned for larger sized buffers but > for small ones like 1 and 3 bytes they are not aligned. In theory even buffers that small should be DMA safe, in practice that rarely matters since it's vanishingly rare that it's sensible to DMA such tiny buffers rather than PIOing them so drivers will tend to never actually try to do so and I'd expect bugs. It is likely worth checking that DMA makes sense for this hardware. > I have not checked the spi-nor driver, but is it the consumer driver's job > to ensure required alignment in all cases? Yes. --8OVq0bfjkI9I0UjH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmQ9diQACgkQJNaLcl1U h9AnLwf/SFrq8jwQOq601LZUGWq/RZOBA8bDTO1wfWl54flsCjecwLtsvd9kSxAu RnvPBbH8WYfqFWPPqrNhFXCLnLQUAopOnN2jv1l4qU+JXtAaWh64c/6tzoDFIlH6 zrYIjh7HhLcxd72py5K9AXJwYFI+VtKCq08obGiUICl9PwZbOxJZnehf7wFnJhKM J93W7fU9FohfKY35qWab854R+xgi5b53NJN5GkuvG+t43QOV1ERFYT26GyHdjKtI UEiqahdm+2iw6i0xxqIeurkjasM63IXU+K/F4Te+rGPda7wwXQpzTUt3muhnXx2f 5Ls7OU3Ht8KLYxk8ckc6BUuI5f8fBg== =m+st -----END PGP SIGNATURE----- --8OVq0bfjkI9I0UjH--