Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1144171rdg; Wed, 11 Oct 2023 16:20:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2OuQEJdfT8B76KAhafntnHCzJURTihJ89xdVdwfAI2I16nitI3mABE6EE6POKmDcWBkIy X-Received: by 2002:a17:90a:1c0f:b0:263:f521:da3e with SMTP id s15-20020a17090a1c0f00b00263f521da3emr30020387pjs.2.1697066402155; Wed, 11 Oct 2023 16:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697066402; cv=none; d=google.com; s=arc-20160816; b=MzVBDf1JLvk0kRZTS1nDVZVDSYzsbRlIV7ukkbo9oR+L7Jtxl2GTHHKvNgT5AEFPZH IGI6dqE6bL2ipnbi6v9G6I30IBUAYj9lf+vsL69TDtx4GCbmBHp+mXQBBNwNvFbp9Wcc cn1CK8z0JWFZR54pBB8TMr4hGRy3Cw5VbGjkDHb+QLXkXJBk5HlGiYCNqOp4Am8TqUiB BcAo2Uqj5n85VnPMDekEjzOF5nZ3PsYcuLZLROUgqDSTp566Y3aIRGBajGRr5Vu8r+jj Q+gu294cLAmosQ79yXfzRrVHud4qYubnGcYWhGIxQm8F7OfRydzXqw2Yx1Tb3t2mI1yx t0Aw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=KWEKF0yIKStU3u4AIv0MnJZ3MnKFIv9mfsBoLs0zUsk=; fh=fceSU1jQ04VMyTCmPdqFOVJcxpawsXLwKBqnX3u0Cvw=; b=g98DBCxmUKa5fKlJL7SZPkbGlBfoypYESY72oI93otEP2tR5RmBUA4bmE+kFCE4gYB aGnuIbeO9Fh2BT0Y6tA3Rl8maJTBu4Otl/W2zniuRnXI5XqfV0koXoAbgJiV3ugG/DCm dfniCKMJBFch8EuKIWjbssePCtgMz/Ct642lgLPT8udJT3vUBCXe5bixoR8sxz58dmVr 0Kid1ZkE6d/jmnkcOJYo4Ebe+CE9DKlH2MMWbIMOb8UoacwNvtruQI2JMn03XrKAMPt1 c7AjP4d2eQHnFkjaa2h72Qqy7WpP8JcFz7uNOBYW58MscFXEJWTsp3GhQkJYGgyWircU Fdww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=QKQv7Tpm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a3-20020a17090abe0300b002791817ea73si866093pjs.83.2023.10.11.16.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 16:20:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=QKQv7Tpm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C315E80C9DC7; Wed, 11 Oct 2023 16:19:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376524AbjJKXTa (ORCPT + 99 others); Wed, 11 Oct 2023 19:19:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235224AbjJKXT3 (ORCPT ); Wed, 11 Oct 2023 19:19:29 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25FA7B7; Wed, 11 Oct 2023 16:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1697066365; x=1728602365; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vvo7LKxDtn+dhGniV+Jep3LTLgLsqxD4oMrYFynpoGU=; b=QKQv7Tpm5ilHI4L42q/lJPed9nYYYdKZII31N38nsx7mXIYeG7iyctKv MwXq0oYfdrnHwj0PI8YKKzCTLv6tsmkNDAOo+6s9/Br2siaiuK+ShrYL9 SaaPnzzyJ7kBSCDnGhA9VoyMnfOXsxtSFvVjm8mgTyUMglkIZqzOdR0vA gFBaD9SGoyXKd+olHLtAyOj+lk+s65gaE5jIszf6jlsgSqr4GyXxGL0tx +vRKI9e22gU4/vIQCXktaRIZu2d1QIaLe87SDilfkf6xW2wGOmK//1Mve aI5R8HXfmVMv7h2cUpT0Ixf1lvrhfHxqTGAWBRL7Ck+InlwnLxez3qvoY A==; X-CSE-ConnectionGUID: twOhyNXNSDyRHsnv4e4Mig== X-CSE-MsgGUID: kxYypUiIQoac9KnJlxVTJQ== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.03,217,1694761200"; d="scan'208";a="10056651" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Oct 2023 16:19:24 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 11 Oct 2023 16:18:43 -0700 Received: from localhost (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Wed, 11 Oct 2023 16:18:43 -0700 From: Kelvin Cao To: , , CC: , , , Subject: [PATCH v7 0/1] Switchtec Switch DMA Engine Driver Date: Wed, 11 Oct 2023 15:00:08 -0700 Message-ID: <20231011220009.206201-1-kelvin.cao@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Wed, 11 Oct 2023 16:19:58 -0700 (PDT) X-Spam-Level: ** Hi, This is v7 of the Switchtec Switch DMA Engine Driver, incorporating changes for the v2/v3/v4/v5/v6 review comments. v7 changes: - Remove implementation of device_prep_dma_imm_data v6 changes: - Fix './scripts/checkpatch.pl --strict' warnings - Use readl_poll_timeout_atomic for status checking with timeout - Wrap enable_channel/disable_channel over channel_op - Use flag GFP_NOWAIT for mem allocation in switchtec_dma_alloc_desc - Use proper comment for macro SWITCHTEC_DMA_DEVICE v5 changes: - Remove unnecessary structure modifier '__packed' - Remove the use of union of identical data types in a structure - Remove unnecessary call sites of synchronize_irq - Remove unnecessary rcu lock for pdev during device initialization - Use pci_request_irq/pci_free_irq to replace request_irq/free_irq - Add mailing list info in file MAINTAINERS - Miscellaneous cleanups v4 changes: - Sort driver entry in drivers/dma/Kconfig and drivers/dma/Makefile alphabetically - Fix miscellaneous style issues - Correct year in copyright - Add function and call sites to flush PCIe MMIO Write - Add a helper to wait for status register update - Move synchronize_irq out of RCU critical section - Remove unnecessary endianness conversion for register access - Remove some unused code - Use pci_enable_device/pci_request_mem_regions instead of pcim_enable_device/pcim_iomap_regions to make the resource lifetime management more understandable - Use offset macros instead of memory mapped structures when accessing some registers - Remove the attempt to set DMA mask with smaller number as it would never succeed if the first attempt with bigger number fails - Use PCI_VENDOR_ID_MICROSEMI in include/linux/pci_ids.h as device ID v3 changes: - Remove some unnecessary memory/variable zeroing v2 changes: - Move put_device(dma_dev->dev) before kfree(swdma_dev) as dma_dev is part of swdma_dev. - Convert dev_ print calls to pci_ print calls to make the use of print functions consistent within switchtec_dma_create(). - Remove some dev_ print calls, which use device pointer as handles, to ensure there's no reference issue when the device is unbound. - Remove unused .driver_data from pci_device_id structure. v1: The following patch implements a DMAEngine driver to use the DMA controller in Switchtec PSX/PFX switchtes. The DMA controller appears as a PCI function on the switch upstream port. The DMA function can include one or more DMA channels. This patchset is based off of 6.6.0-rc5. Kelvin Cao (1): dmaengine: switchtec-dma: Introduce Switchtec DMA engine PCI driver MAINTAINERS | 6 + drivers/dma/Kconfig | 9 + drivers/dma/Makefile | 1 + drivers/dma/switchtec_dma.c | 1522 +++++++++++++++++++++++++++++++++++ 4 files changed, 1538 insertions(+) create mode 100644 drivers/dma/switchtec_dma.c -- 2.25.1