From patchwork Thu Apr 27 12:33:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 8720 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp253087vqo; Thu, 27 Apr 2023 06:06:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GMdyLh+xV5WR4ne+hqrULFQ+1mgudJDy5JEbgM8b5W5zdO8z7gixhj5dJOnZDv2qvbjRk X-Received: by 2002:a17:90a:a89:b0:249:7224:41bf with SMTP id 9-20020a17090a0a8900b00249722441bfmr1828644pjw.47.1682600819301; Thu, 27 Apr 2023 06:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682600819; cv=none; d=google.com; s=arc-20160816; b=hkmFsf0nM3+VQ+kywmeXUGZU+Pvo1/QXnwVEAEupNH99FkmTttMp1b5pV/FQvWknnd 3Cs4rjxDQKNN6fE4cHQ4hCk900QxxszqbuT0VxoVrNWzzt7t1WPfFXsxDcMv1qJZhDmX pxeyUVXwb4Wbf9iahR8yVpKRwx2vvXvySGbp1ZwlxhMi2kuskiiJdAEAgUvKDdYG01ZM nmFDhb3Aec7iUqbz2Ul50DIwF/VBOW0xRbZhIxUo4PnZ1xLUiFi4XWdFfKlhFcqboqPx 3TDTo7Gq8KTvhV1LCBIJMSaPoZFGztXPbiQq0pv1Qk4ncY4c4wUUUtJo0XVs6WWUQgfD A4XQ== 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:mime-version:date :dkim-signature; bh=PCcqnfxouwoiDswqAajWA4urOkAKuA44YgC+Tktp544=; b=012SQrEtu6obBSOSy0o/NxQmsnr0euuBrWLpq0b2+kKAotIS86CVUMBi2KiWQmvY7Q Br+hpXshy1wK6PPu9LPHnPFxz+fx0QgyACK3+yn026jhZnJ16i2I3+vOCoqrHh6/OlXW THE6JZmf053CVvBJwVsaflwxh1mX/ss6SG3P3wEnDe98Osi5uHmP0tj7rjuxulfk18X9 dO4oYsOiK1DC9UCWJhtk6lIQkR4CjCxYIoakiOKz7DYiaDa+5aRNyMjM/3DU/D7gWnFe TKqr0C+gt65M3PPOE0rMR0Wtp/e+8eam53zCp45FtizeR9LGnI19HeUm2cYHOHje3Qev rGsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=3KGaMF9m; 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 lr14-20020a17090b4b8e00b0024b881044e4si15273305pjb.82.2023.04.27.06.06.39; Thu, 27 Apr 2023 06:06: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=3KGaMF9m; 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 S243343AbjD0MdY (ORCPT + 99 others); Thu, 27 Apr 2023 08:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242986AbjD0MdX (ORCPT ); Thu, 27 Apr 2023 08:33:23 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AA4A4483 for ; Thu, 27 Apr 2023 05:33:21 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-b9a8075bd7cso683725276.1 for ; Thu, 27 Apr 2023 05:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682598800; x=1685190800; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=PCcqnfxouwoiDswqAajWA4urOkAKuA44YgC+Tktp544=; b=3KGaMF9mrtJ0d4l78cukq0C5LMKpgS2XhpTcB1wXE8fSquZXHLudJlb1nMx14VIr+y bXgagFXM0Rzz/hODdXMyk9Vu1Qyqez2fj22KHHuL8ZivYVGSPAN/BzDycQequQVtu9+r u+YyloxqFCKHBiRG+MfQmjZMQHra70t5pVYB01OWJ+H6L43DKfCmCV4QljH374IjOd2t oWuNKaAr7A8vp0+m8LAyUrfDAu1VXPyb2YKQFenM6j/d8Q5s911Ennh7CwXFjHdQ9hMr zPuT9vL53taAE9oemtvl+ntgX7mTGO6VYQbRyWSnLYtVFT0BSwUk906i6CoElPjdIb/A 71OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682598800; x=1685190800; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PCcqnfxouwoiDswqAajWA4urOkAKuA44YgC+Tktp544=; b=ULr6CNRFG30BBlO86ymDoTQmyC2rk24GdaHIuyV3JWB1GYkJL02fNR/iCP0g8En6Kd pUc3fi3NY3c6twwCy5g2AbgyLtFSFeUl7xX3GvQXYj3ySi1hJc09zPWJhZIPg3jTgWZb NTwMzCjDDScDc3nl/ga3utz3z/+hMTTsq3jms48WfwORYOr/am1v3eVQJ8u+qwNag0pu Rciq6TTxY4ghsSJbn6YyvUwtt8xm3+R36NVPNHhnjWEhX5xDXi/AEhwUpSq8q/cbF0/t JV3PgErw4lYESFWp5prpTxQ5QT/VoRSKF1LZnAkNHrZZYQp9HRfTZixBBeOehEVWUG9w 5qFg== X-Gm-Message-State: AC+VfDzadCpQs6z1+Gi/PIv0UwR68nqKTQaTa6oAEdFjbEPv/3NotYm/ GEnP+ae4Gf733NaBridBwmMM795CDqjG4A== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:6902:100e:b0:b8b:f584:6b73 with SMTP id w14-20020a056902100e00b00b8bf5846b73mr479350ybt.10.1682598800223; Thu, 27 Apr 2023 05:33:20 -0700 (PDT) Date: Thu, 27 Apr 2023 12:33:09 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230427123314.1997152-1-joychakr@google.com> Subject: [PATCH v9 0/5] spi: dw: DW SPI DMA Driver updates From: Joy Chakraborty To: Serge Semin , Mark Brown , Andy Shevchenko Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, manugautam@google.com, rohitner@google.com, Joy Chakraborty 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=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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764334837080038486?= X-GMAIL-MSGID: =?utf-8?q?1764334837080038486?= This Patch series adds support for 32 bits per word trasfers using DMA and some defensive checks around dma controller capabilities. --- V1 Changes : Add support for AxSize=4 bytes to support 32bits/word. --- V1->V2 Changes : Add dma capability check to make sure address widths are supported. --- V2->V3 Changes : Split changes , add DMA direction check and other cosmetic chnages. --- V3->V4 Changes : Fix Sparce Warning | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202303270715.w9sMJhIh-lkp@intel.com/ --- V4->V5 Changes : Preserve reverse xmas Tree order, move direction check before initalisation of further capabilities, remove zero initialisations, remove error OR'ing. --- V5->V6 Changes : -Remove case of n_bytes=3 using 4_bytes buswidth -Avoid forward decaration -Break capability check patch into 2 -round n_bytes to power of 2 ( Bug Fix) -Add more explanation in commit text. --- V6->V7 Changes : Remove extra spaces, refer to functions in commit as func() --- V7->V8 Changes : Minor commment updates in patch 4/5 --- V8->V9 Changes : Minor formatting changes in patch 5/5 --- Joy Chakraborty (5): spi: dw: Add 32 bpw support to SPI DW DMA driver spi: dw: Move dw_spi_can_dma() spi: dw: Add DMA directional capability check spi: dw: Add DMA address widths capability check spi: dw: Round of n_bytes to power of 2 drivers/spi/spi-dw-core.c | 5 ++- drivers/spi/spi-dw-dma.c | 76 +++++++++++++++++++++++++++++---------- drivers/spi/spi-dw.h | 1 + 3 files changed, 63 insertions(+), 19 deletions(-)