From patchwork Thu Dec 7 22:13:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 175453 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5096191vqy; Thu, 7 Dec 2023 14:15:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsKiOeMsrtNxChqR+aif/YJbF4saHtL47ubBT1B4EYbUUqWR5T35QmPgL3JpWUAvwOS3IS X-Received: by 2002:a05:6a20:6e22:b0:18f:cb0e:ae88 with SMTP id go34-20020a056a206e2200b0018fcb0eae88mr2050144pzb.98.1701987346749; Thu, 07 Dec 2023 14:15:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701987346; cv=none; d=google.com; s=arc-20160816; b=eY14C0bkhqkD3JiYyeH/B9bhKoAOdqSGmGAPtN7LIfVdiry6N4upmmK2x8T4b6WGue DxkRSppSMjP5N8o74ZDPMGqvCA/fiUBPxGH0WpaztXHTATnF6wT8NXmpvCO59YLOXW9c 9QkFsLFBUILPySPV4sLfSkuQKpFkDJpu8l46y6aaLUy3kpQBjkGHhCj/ows+YPjnZ2gf jaRF39XijK2In8QO8HSH5nKuDjelRr3oHH+TVya6ZBtwRNJmgMIq5YmFtrn72HG/c3pW Vo/0LBamiKCL0hW6jWmHnltn6PIpFvK7Q9HKstAMZ7C/IvKl9LfYHL/h3McDc3PtJbXr ezMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UtKR7egClHpJxixpRn5RoXWyDtqHmRv+wVHGtRNm8mI=; fh=ZJpYoXBO1b6J/XX+cBUZ1SR7Li64ejvvuRmIauHDBq4=; b=wMMrEdEc5YCV0OL6x7VfWmIWjxV+dgYRl14QckfmtAZ6HNzzvQcUoP51CvqQNGfl9+ KXnBjdL/YEaH63Wcga0BkMsWPY1i8VuRrp3o5izO3axgr/p5WKgdoDSl8bEuzJoduEoL jEWw9xF0VYI4LKY5zQfn8qTVyo8/ozP9VpVOUifH4roKIR8ytTmGRv1ZVHKn4VmMD4E+ CNhXA1aBgwTJNklJbGj1kDzObbZTT1AJAwq63VG+jJTbXphagWc5B79C0UdUH1JHGiW8 WBRCSvkkTWhjBiYddqfn89q4pqKEn7toPXL7+66Y5C2SDkr8Sp6EmudWJAhhou0Ry2/R +Ogw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PvfkDxCV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id sj14-20020a17090b2d8e00b00286880259d9si497167pjb.12.2023.12.07.14.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 14:15:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PvfkDxCV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C3553807C5DA; Thu, 7 Dec 2023 14:14:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444062AbjLGWOc (ORCPT + 99 others); Thu, 7 Dec 2023 17:14:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232144AbjLGWOa (ORCPT ); Thu, 7 Dec 2023 17:14:30 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DA9310F1; Thu, 7 Dec 2023 14:14:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701987276; x=1733523276; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eZrxGwvAgFB0+puF74LZGetWU1/ZtE90ClSmlKQ8eEM=; b=PvfkDxCVK8SKvJRq+WukJ1bwWBVC9fjofUFWVJ5+0Ouyla4xqxAvudLE hnunuCppeuNM9is/AiCMOEJpH6aYptpXHi0OtQDljX281C2IOrDPgt9oF nlZxy+/9Gye1p2x3KBWByAL41lPBe4cJYuZj4/Et5ZsA/08oNs6ejK91H chF7d4lo5iIEYVj558fkRY4e3ywbxAS6F63Fg6CmeSE+gMRaQaxUzEUTV hFKafu0zuG10J8FwDcJxvRZbInLnb2K10b1IARnYvv7QRksq5fy3g8i1e cbhHM5FPWJ/Lqle7tThiqgx9dShhaxIx0haWnuoC33KERHcFVeNnE+0ye w==; X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="1197557" X-IronPort-AV: E=Sophos;i="6.04,258,1695711600"; d="scan'208";a="1197557" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 14:14:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="842365246" X-IronPort-AV: E=Sophos;i="6.04,258,1695711600"; d="scan'208";a="842365246" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 07 Dec 2023 14:14:34 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1993E648; Fri, 8 Dec 2023 00:14:33 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Brown Subject: [PATCH v1 2/2] spi: pxa2xx: Update DMA mapping and using logic in the documentation Date: Fri, 8 Dec 2023 00:13:40 +0200 Message-ID: <20231207221426.3259806-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231207221426.3259806-1-andriy.shevchenko@linux.intel.com> References: <20231207221426.3259806-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 07 Dec 2023 14:14:46 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784663083860914640 X-GMAIL-MSGID: 1784663083860914640 Update DMA mapping and using logic in the documentation to follow what the code does. Signed-off-by: Andy Shevchenko --- Documentation/spi/pxa2xx.rst | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Documentation/spi/pxa2xx.rst b/Documentation/spi/pxa2xx.rst index b66702724ccf..61c7b9dd833b 100644 --- a/Documentation/spi/pxa2xx.rst +++ b/Documentation/spi/pxa2xx.rst @@ -193,17 +193,14 @@ mode supports both coherent and stream based DMA mappings. The following logic is used to determine the type of I/O to be used on a per "spi_transfer" basis:: - if !enable_dma then - always use PIO transfers + if spi_message.len > 65536 then + if spi_message.is_dma_mapped or rx_dma_buf != 0 or tx_dma_buf != 0 then + reject premapped transfers - if spi_message.len > 8191 then print "rate limited" warning use PIO transfers - if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then - use coherent DMA mode - - if rx_buf and tx_buf are aligned on 8 byte boundary then + if enable_dma and the size is in the range [DMA burst size..65536] then use streaming DMA mode otherwise