From patchwork Fri May 12 10:47:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 9268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5021112vqo; Fri, 12 May 2023 04:22:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ757YfM2msQkNlRi/7Tmkg/ZNrf6g/SiSKUo+4986IvCWGbk0r7Frpg7H23xONTSpWGyUaC X-Received: by 2002:a17:903:124a:b0:1ac:4d01:dfec with SMTP id u10-20020a170903124a00b001ac4d01dfecmr31870780plh.54.1683890537848; Fri, 12 May 2023 04:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683890537; cv=none; d=google.com; s=arc-20160816; b=XkmwFhfErPKWesEb4a1akY9KpEs0/Vb24kzAunl4HD4bNevQ5ooENIxo05cuEoC9Fh GR2aCNPw3mbnOZq9WtzOjK8QcfzeMXC3WLxfuWJ64IsNNp5JYBI3iOSAeYUP1igEMnon Mv0CJTj4/1SExk1JhQNdYXlp1Jlw84Db4E3yYvvhheIEOM/pCstYFG6wcu+yCMMyaDtD z+The4mqpGtC+VYui/lpPIAxo7SnWuca1sfPQs8YoSLtXDpvHXEeBLEuOwOgv+NGLHPv AsmHwxgY3l3LTpFjn7vim2BtaH+trI6apKJZHbQg449g3dP+LzlGjYrSZm3/99HyY8Ud BmnQ== 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=2hTpJTY/rULQPSOZNXcS/148DUgQ2+YfFfUxNW3uGcc=; b=FzEv/Yp7NKmXbRaYGivMpa+dMADepXZv32ROxpCoEwA6Wo73LmxOy3o1HeJVk8MM+S DsHGKm/fk1oMG9cm2tuqv/XtKzW9ChAfD9JqrQf26iCY3fnLPAwVuL1b37CDE6rOGKyM GPwFPnfI/QvyQiah2CSLyKSGYvuhbeShCqcHg7y0e9E5K/IAfD7/R3srfNCD8m1im7oC FSMuArnTUndpEo6CV2VNlPnKHAfsH/XAEeQAMPN/JXmYD461nJnFSfkIz3A+4yrEvon/ hMHQgMJDDHeL0GDdz2+TNzaMrRNvyziILQmHRATyjTxN9j40PB2jbxwKXTDPHHVTNkf1 FstA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=NKZ9DJMS; 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 d16-20020a170902729000b001ac3103c551si8336130pll.85.2023.05.12.04.22.02; Fri, 12 May 2023 04:22:17 -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=NKZ9DJMS; 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 S240413AbjELKsX (ORCPT + 99 others); Fri, 12 May 2023 06:48:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240134AbjELKsU (ORCPT ); Fri, 12 May 2023 06:48:20 -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 480F513C07 for ; Fri, 12 May 2023 03:47:53 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-560def4d06dso56875547b3.3 for ; Fri, 12 May 2023 03:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683888472; x=1686480472; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:from:to:cc:subject:date:message-id:reply-to; bh=2hTpJTY/rULQPSOZNXcS/148DUgQ2+YfFfUxNW3uGcc=; b=NKZ9DJMSbrzKFRruLJXZDhVxtbnaHEbduW36u8MmXgWhDLEoWSdxfbM8/vhFZBPQpU RLo9qi7IR5o1WzDfJZzlHc4T+BwdqSJnd7Ue+J6qh1mPx1eSHZjjzCaO+8SqGqgt89qT YZd79CSqZyH/7f2gYFkNLQEdTz9dsqPFARBGL8DWIApcA0yY09cf68VS59ozhAIUFOyZ sRIBcO0yIvrBLS1KacnxsYnmkXRbOTHr742w/WlSCLQFUGskhP3MBYcm/nc0nnn+9K3T 3I9m8WoXSDYEXiq8f0j4M76MYxavR8XfB1gmZvtUpCVZXOacOIDeDNPKfDR/T2BZdPWQ D/5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683888472; x=1686480472; 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=2hTpJTY/rULQPSOZNXcS/148DUgQ2+YfFfUxNW3uGcc=; b=H4OX+K/ihCcFrCwAJySaHwnZ11pJJfYAVHYgjhaSnbf/f6EZ/fbmbDQDEtDDSys4XW uqsEgfXh70sBI4aaGEHf71zYvA975Yo4s+AUbn1HhEdz1mE7M8IQwRwTnvLEeO7DsbtC 9MfisekQSENLoRPMCcMuI5DDMYrWBysexBDx41EnESkdL/9KOsTLtcOPtURY9YOvsBPl sykBLNQkHgp784O8wwQMVmAqt+uaHEInMG7qctnMiI/3guo82JnvjRMQ8258oK8LG6n3 nkAA3Vi28o+zl9+JE9Xg+2eZQbol4V216+8KbuGlgffDHFphjLpZxjyOOXRs8lFEfb7H lCKg== X-Gm-Message-State: AC+VfDyrqlbPFMJVcNf7II5LW2tK7rtWWycFFK55Yoqmg5VFz2oeNQaA WDg0EARU4s41jWuum0TdpCkDMjCiXkz9AQ== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a81:430b:0:b0:55d:9a6d:8ce5 with SMTP id q11-20020a81430b000000b0055d9a6d8ce5mr14862719ywa.1.1683888472089; Fri, 12 May 2023 03:47:52 -0700 (PDT) Date: Fri, 12 May 2023 10:47:42 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.1.606.ga4b1b128d6-goog Message-ID: <20230512104746.1797865-1-joychakr@google.com> Subject: [PATCH v11 0/3] spi: dw: DW SPI DMA Driver updates From: Joy Chakraborty To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, manugautam@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?1765687204423221779?= X-GMAIL-MSGID: =?utf-8?q?1765687204423221779?= 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] --- V10->V11 : Resend patches [3/5] to [5/5] on top of : https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git --- Joy Chakraborty (3): 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 | 56 ++++++++++++++++++++++++++++++++------- drivers/spi/spi-dw.h | 1 + 3 files changed, 51 insertions(+), 11 deletions(-)