From patchwork Tue May 9 08:22:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 9071 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2721910vqo; Tue, 9 May 2023 01:52:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Tl4Or7IjkqQMvLrl2DtMgX3oeb2sVCZpvXTfLteCGYYod8lG+ABlldL3z8al9pg4ATHNR X-Received: by 2002:a05:6a00:17a3:b0:643:aa8d:8cd7 with SMTP id s35-20020a056a0017a300b00643aa8d8cd7mr18283412pfg.32.1683622336350; Tue, 09 May 2023 01:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683622336; cv=none; d=google.com; s=arc-20160816; b=dadAG4ky/R5RtBZNCjDwl8EjZ65rW7WAykFmjYTj/CYsAsFNfLMeNA3GGuqSJWICnN UEPDuROWPhykuZIxDH8R7EaqEsCbNoaotD89rHD85zz20//bGQYc4JRH/wOPKDQwySvX MJr8y+apeUITXEvZtcic7Zurv/1QfcixgSuyromqb09UGWcur96cUT0QgqTQGyO5Ilq1 S8hZVqcJVvj3Mmv1a7OZkWbLz6czO+2P5mw+HUKkER34zLxI6zyPiDlHg/JzxEdDoID6 RhhCsh2sbb1lBgUP39gCGBc80rJ+PYmoaQJV7jpKM3kYa1vCdTLLEQjpoR/N087qKV4y nGeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:from:subject :message-id:mime-version:date:dkim-signature; bh=EYZzu5uKAv2K3CUFKdV+PnrKtAXzT9zaDvfq92PiXpQ=; b=USiQLATOVQk1E3pbp3ZEU5vesD10AyENtlD8Q/W60xQJ+qToAbwxAHRxQbBxhx0gu6 WU4UWxN8y07lNT2Dk30WI8xAKgue72pP+TJyAOP0QO0NgRj5rkYYph4plOpvP1HiKdGH j3TO6p7RnkgoOGcsim0juh5vLZfIq6J0rek0xjqRShovaIK7IwSRdTIxgev6ZoqoztDL HYy3lFyZjnkg7MFitgujDVEvnpXsSzp7dIPsetKegrOQ/WC06tTJ/oXKjlRpwTc9axaX OkN1uOYudkNJBupRe1WtucW7QP4zrdqP462kmUy/lAKMTNuGPrNjAU8kq7MNtu60FTfZ pk7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=6VaIk8BU; 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 p22-20020a639516000000b0051358b5c887si938709pgd.843.2023.05.09.01.52.03; Tue, 09 May 2023 01:52:16 -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=6VaIk8BU; 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 S234528AbjEIIWy (ORCPT + 99 others); Tue, 9 May 2023 04:22:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234341AbjEIIWx (ORCPT ); Tue, 9 May 2023 04:22:53 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99556E72 for ; Tue, 9 May 2023 01:22:51 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-b9a6eeea78cso1277107276.0 for ; Tue, 09 May 2023 01:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683620571; x=1686212571; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:from:to:cc:subject:date:message-id:reply-to; bh=EYZzu5uKAv2K3CUFKdV+PnrKtAXzT9zaDvfq92PiXpQ=; b=6VaIk8BU1+iBlJ+77HD/FYD7NedD7l/shwrtU1U5jS0VwZtEU7QE4T7XXUhZI17OZ8 U9JSKU+iOohlvTCS1rn5lBDusZWAPfZkhuoM0UjliXqV/4rqDDaP0aaIMAuf9HDYrwjk iB+oxn+z0CTNn27ICs/OOF5Dy5jX+UFGdzSSPMXhlhD5MMBvgPj3uJW/9BeAgOM3mpvK HMSxpMuZr0s8KnPlBMQh/eRFhbl0WJweyW3Cb20JKkjSf21qlLA1fxe68Gh5tROIvZod HB6Amj6ZBwvjC0m9pe7kU4aIzOibxxk1R6wnnKfdf2+l6N1KYXPGRthT1w9IvEjtj9V8 f4qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683620571; x=1686212571; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EYZzu5uKAv2K3CUFKdV+PnrKtAXzT9zaDvfq92PiXpQ=; b=LSUZCYLfFPI1l8rlY6LY9K31TTcumgXe9dm7j4HJi5AQUyeywQBWUgB7rpapqkwxsV S5Rq/YoKyrzdEUorxcgve76QCLaRQtcyYIhYBDKTpyXMpgCnUzFX1F8l/r5xziDdPyTj Ug/UwgVAWWtCuFNoD8EgMjDYKxxZ/TPFsROmOraSZgbZYL8Nx1ea0DTKKQG42IEwmXyb ORYncYPg6QkPbDxtI/9pGuGDKcEJo51rfAzRjKgbNmKn5lzNHnnsxkd9kuv3lfyyYcAg Ds3WZZ4YFg0ctQHQl3oNLI3SfNR5RbP6UicC/3B0ZrjyJJvy77GF0FIHmOhT0FuWYMe3 mfEw== X-Gm-Message-State: AC+VfDwtd1VPzXvcThuMbNJm14oQPB1KW46xORbkQTOZrrWfod0nG1sk bnZ1oj27ZkGvqEYWPfLlD58aliwMzfqY7A== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a25:c016:0:b0:ba1:ac14:7e1d with SMTP id c22-20020a25c016000000b00ba1ac147e1dmr8789084ybf.3.1683620570885; Tue, 09 May 2023 01:22:50 -0700 (PDT) Date: Tue, 9 May 2023 08:22:39 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog Message-ID: <20230509082244.1069623-1-joychakr@google.com> Subject: [PATCH v10 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?1765405974781933423?= X-GMAIL-MSGID: =?utf-8?q?1765405974781933423?= 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 --- V9->V10 Changes : Moving "return 0" at the end of dw_spi_dma_caps_init() from patch [4/5] to patch [3/5] to solve : spi-dw-dma.c: In function ‘dw_spi_dma_caps_init’: spi-dw-dma.c:100:1: control reaches end of non-void function [-Werror=return-type] --- 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(-)