Message ID | 20230509082244.1069623-2-joychakr@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2710878vqo; Tue, 9 May 2023 01:25:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4IKXPrrE9EOOrJ0FiBBeD8cLFUcKUrHhUb7zQK79G41OzDCDP+Lz6K4cuB1C1EgTM5K3hO X-Received: by 2002:a17:90b:4c4f:b0:246:85ec:d816 with SMTP id np15-20020a17090b4c4f00b0024685ecd816mr13434576pjb.3.1683620759526; Tue, 09 May 2023 01:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683620759; cv=none; d=google.com; s=arc-20160816; b=m5n9Y64NLVd8wtBp5CqZ9vvLqi10Q001P/SRm8E/DelJdh+xwCmZWF+1DewkrGj4Ae bqG13mKX7TqlVd0gi0NhWfH1MvbGeXKH046Kud1J3EXpPkyqhsHmNOOdV+VBGiFFJCL0 iZ2oO83fLprMj07h7pjQE2YgtFvSZwo77S0HCxfZuCSLcVFSfwCxlqKeTgodG39pJe/J FP6wRdSQNJAhDoheV7ULU6AW5X4+QAw2KAmaNhQnAxbITvXaFBOnML/e9cvbSIZHp7Sf pEyeBO/0Nwi0+ZyFYZM/XotBfqZ3pPSR+4Ub6DPqUg5nPXNM6Ie6irxSjyGeZdpj7C1b YoDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=P/eUVtluKbHYoh34+9oF2eiC1PMtH+2gVKFzulzf0Dc=; b=VVXgfJG+j7jYxvJ/Cqd0JnKiy1IPsqsmPjJSudKt6oBHJnMiyrO775O3G8IfGf0YC+ BeE36alFsJgn6jh3ANmzgjreNollW8U+MtCXBUszatn6RSWHG3Xe1k+WP6eCsn/UvGQI 4a2IVlkt3MeX2mufAg6YFjw7wRVEmW/goFoEb+CUgMutIzh7A5s4koRea+rLFU+E+AGb EncpcniQk0Ep7JdbXZqJI9Y9UzvoaNh7Ovz5IympZnnxEIxFjeLvIbpiSig/sbzto/3z nm6/iDSW8CTRiyqAz0jEBuEYRpads6XOKEiBNzjtyrSYX3jMTa7FVgYRBHRXXwZzqqko qqyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="MOl/ueia"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my8-20020a17090b4c8800b0025069d02778si6406879pjb.28.2023.05.09.01.25.47; Tue, 09 May 2023 01:25:59 -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=@google.com header.s=20221208 header.b="MOl/ueia"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234814AbjEIIXB (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Tue, 9 May 2023 04:23:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbjEIIW5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 9 May 2023 04:22:57 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D83285FD2 for <linux-kernel@vger.kernel.org>; Tue, 9 May 2023 01:22:55 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-55a42c22300so91021157b3.2 for <linux-kernel@vger.kernel.org>; Tue, 09 May 2023 01:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683620575; x=1686212575; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=P/eUVtluKbHYoh34+9oF2eiC1PMtH+2gVKFzulzf0Dc=; b=MOl/ueia/VczvDyjT3T7HYTqdbT3tGq7e/qZgsdHLgfTJc6xduTdB70L6CR+tIEKXC 6EXTVk126gPItF25Of5O7fVF6UVJFXoeDtJSh85kNratW2ypIYLNIcEJhsWOoD3DwPIA 73gEFnRt9TduebE6GB+/AE02x6hmYT/i305jrOYJ7/i8E2Ts0HH5E1K8nZgHMVItEzpm rWj/3GYLmUzCBiQi1vnGi9jxqMp/fjSVJvegrBlGq8b/qE3OUi6WL2s6MTPgOlrKkeu6 rHrumiATgCHtZa5kExrL9Vu39ZtlDuG8EJJ4C58nMpDZBxy66RKeTFPDH7GkKELaTrDC 9Qdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683620575; x=1686212575; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=P/eUVtluKbHYoh34+9oF2eiC1PMtH+2gVKFzulzf0Dc=; b=c1yZD/rtJh50444cbmS/Yek/xto4kjPRlxR6FESnXk1Rkm/QXsSa+AYFEu7/A+lUHm L6DkBvONalLVpu7IJPet8s814waTdY32H0YZPdVJ2z5GgBJYfGShihqMVGTzKelxUO8Z KB5HvxijJO9K+7Rg+zHdXdy6IRXiVy5+jtK7PXqtfMseWHTvvfHPN8W3Npk3PR36ejsA M+IlqML0Gt8/5ZIBj+O8gRdpf1gH4eGhW8BNQFacZLj7TZ23ob37IIRi/MsjNHxR6Qne mMYgr4l9xUfh55Bikgm+u2/3BC9ZVlLiTP20vvRqxhVfkoONT5+e52uJxJJZ7E67h411 PX6w== X-Gm-Message-State: AC+VfDz3Tp227gCUzIuRWrbw3IkJ7hS+STDL1RQmHC5lRKtznozsEx3N h+2Nlg3Z+Dqurbnw7loyX265s/zvFOKBow== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a81:b65a:0:b0:55a:8e39:57a7 with SMTP id h26-20020a81b65a000000b0055a8e3957a7mr7726750ywk.6.1683620575080; Tue, 09 May 2023 01:22:55 -0700 (PDT) Date: Tue, 9 May 2023 08:22:40 +0000 In-Reply-To: <20230509082244.1069623-1-joychakr@google.com> Mime-Version: 1.0 References: <20230509082244.1069623-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog Message-ID: <20230509082244.1069623-2-joychakr@google.com> Subject: [PATCH v10 1/5] spi: dw: Add 32 bpw support to SPI DW DMA driver From: Joy Chakraborty <joychakr@google.com> To: Serge Semin <fancer.lancer@gmail.com>, Mark Brown <broonie@kernel.org>, Andy Shevchenko <andriy.shevchenko@intel.com> Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, manugautam@google.com, rohitner@google.com, Joy Chakraborty <joychakr@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765404321524979567?= X-GMAIL-MSGID: =?utf-8?q?1765404321524979567?= |
Series |
spi: dw: DW SPI DMA Driver updates
|
|
Commit Message
Joy Chakraborty
May 9, 2023, 8:22 a.m. UTC
Add Support for AxSize = 4 bytes configuration from dw dma driver if n_bytes i.e. number of bytes per write to fifo is 4. Number of bytes written to fifo per write is depended on the bits/word configuration being used which the DW core driver translates to n_bytes. Hence, for bits per word values between 17 and 32 n_bytes should be equal to 4. Signed-off-by: Joy Chakraborty <joychakr@google.com> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Serge Semin <fancer.lancer@gmail.com> * tested on Baikal-T1 based system with DW SPI-looped back interface transferring a chunk of data with DFS:8,12,16. --- drivers/spi/spi-dw-dma.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
Comments
On Tue, May 09, 2023 at 08:22:40AM +0000, Joy Chakraborty wrote: > Add Support for AxSize = 4 bytes configuration from dw dma driver if > n_bytes i.e. number of bytes per write to fifo is 4. This doesn't apply against current code, please check and resend.
On Thu, May 11, 2023 at 6:59 AM Mark Brown <broonie@kernel.org> wrote: > > On Tue, May 09, 2023 at 08:22:40AM +0000, Joy Chakraborty wrote: > > Add Support for AxSize = 4 bytes configuration from dw dma driver if > > n_bytes i.e. number of bytes per write to fifo is 4. > > This doesn't apply against current code, please check and resend. Hello Mark, This patch seems to be applied already as per the reply to the cover letter: [1/5] spi: dw: Add 32 bpw support to SPI DW DMA driver commit: 5147d5bfddc807e990a762aed0e56724afeda663 [2/5] spi: dw: Move dw_spi_can_dma() commit: d2ae5d42464e990b4d26734c180fbff64233992c [3/5] spi: dw: Add DMA directional capability check (no commit info) [4/5] spi: dw: Add DMA address widths capability check (no commit info) [5/5] spi: dw: Round of n_bytes to power of 2 (no commit info) Whereas [3/5] to [5/5] has not been applied. Do I need to rebase and send the whole series again or resend the last 3 patches based on https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git ? Thanks Joy
On Thu, May 11, 2023 at 03:02:00PM +0530, Joy Chakraborty wrote: > This patch seems to be applied already as per the reply to the cover letter: > > [1/5] spi: dw: Add 32 bpw support to SPI DW DMA driver > commit: 5147d5bfddc807e990a762aed0e56724afeda663 > [2/5] spi: dw: Move dw_spi_can_dma() > commit: d2ae5d42464e990b4d26734c180fbff64233992c > [3/5] spi: dw: Add DMA directional capability check > (no commit info) > [4/5] spi: dw: Add DMA address widths capability check > (no commit info) > [5/5] spi: dw: Round of n_bytes to power of 2 > (no commit info) > Whereas [3/5] to [5/5] has not been applied. > Do I need to rebase and send the whole series again or resend the last > 3 patches based on > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git ? You need to resend the last three patches, I probably just picked the wrong one to reply to.
diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c index ababb910b391..c1b42cb59965 100644 --- a/drivers/spi/spi-dw-dma.c +++ b/drivers/spi/spi-dw-dma.c @@ -208,12 +208,16 @@ static bool dw_spi_can_dma(struct spi_controller *master, static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes) { - if (n_bytes == 1) + switch (n_bytes) { + case 1: return DMA_SLAVE_BUSWIDTH_1_BYTE; - else if (n_bytes == 2) + case 2: return DMA_SLAVE_BUSWIDTH_2_BYTES; - - return DMA_SLAVE_BUSWIDTH_UNDEFINED; + case 4: + return DMA_SLAVE_BUSWIDTH_4_BYTES; + default: + return DMA_SLAVE_BUSWIDTH_UNDEFINED; + } } static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed)