From patchwork Sun Nov 15 09:32:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 487 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 0BB061C44E3 for ; Sun, 15 Nov 2026 10:33:16 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27657-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-27657-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 6810C27825 for ; Sun, 15 Nov 2026 09:33:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794735194; b=Q7cYbXX1wwjHLgKJkX/Yp4f6gjD5nGG6Te/3S4Qtc6PmTrHbKMOG+4cGrUa6SfErYHxF vpqn5YTBZKEWkS1OVxhe+cEgX8zhkb6J5SesPOfczF73sX49CRS5AlMas/5SiBY/eBceg U8svLjFFPQEqYi68p67asWHiwqPcrhYFtPkq4f4WocTxlOkzeSGxDHIbk2uB4hyAGypDn 1i1k0Zftuv89IUXjcWh2HdDTHOvN7Rip89UYDRRWPi/uhXw7vw/wHZzNvK+4ZtAE6yN4y Ca/pl5LzXXckMo3OgNFqkKR3QOmLRNDaHbZGiv96J35IkWtvALpLRzOA5Fb4b/R1WYw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794735194; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Subject:Date:Message-Id: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer; bh=5e7EmmrAmNsJKP6AOjhCJAku3QB+VBI4feI+to/QFAw=; b=mJyNkrrS9gzQSLxJM1yA/DgAlYbkyGoqccmBNVZhOSk/fztq9Ay1S4H1R5soFTBqrEq6 xjiJmPuDerhIhRi2uWRs8K1DvdgBRydCvlT8/dbNqHxwtiul1bnvHQIJNtg3zlR7TAVYV q0swBcI9vi+vVF1bZZCo2OY+Fq7EwohVXqoYG2+FXt6Be4snClC3cdor6keFhCL3QSxUz Osmbza38clDe0CPxfbcScWEDtUL70ei6qFbGMIQ6Vl5rc8quCShslqLMLhGySwSYzRt4L or//8RX4TidVSVM2mjNm1hw/AnloBQA5bCKNzjnbQHMr7sdgRfS5e/R1g/yAwV2UCVA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bDXUvIaD; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EB76606A31D; Sun, 15 Nov 2026 09:33:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bDXUvIaD X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.161.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794735194; b=WUO8W7qUDLbjyUA1Lnz4vQ2Q5X/RxhsrZ+PvVmcunVzrdcelwSxfu93vtrrgoNDHMnEU X61hlkXfoJt7OX9B0J2kC3xEaRGWOIeT9MBEpHpoV1g9ia5w24lQB2NaZgBZUPA3tXkaj 5w3HyvTip/Ka+vfZB+YX/sBPMVXQ26Bci8lBIi0jMHPXu6jbJK78ihgGecUAIwcW+2b30 P6AtidSwdnG+wCqY+hYfbTnbRioUcslSHLojUY0lG7N8BkFVOiXnXOovajgHyB5DHqkQ3 P6eiP2r852nqD87Ksp0wpHd9ijI5D3txtMHFWji76nNXtfiNunFkjUFiIsh02uCTGHQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794735194; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer; bh=5e7EmmrAmNsJKP6AOjhCJAku3QB+VBI4feI+to/QFAw=; b=CbMsFNQYGgdPyDQer2v2OR9aIMFXV69KBDD3ZvTobOcKxDr5VIijxLm1i3dchQfYPSXe VkSPoaGPm73e5kZo7sHpanyX39qIfOxNIh/J6zugotFE0okRuwUhA+rf5dxwDcJ3M1iM9 FrwIIhEwJK4v/ALOkN2ktGKxmHNjbzdFK77ohHZ/RdcZrFT1CBByA0pKe/FWPLvScPIjN r8FbOq6QRdivQv192YfdU/7R7+oFHCmzigr0ivYX7J9roERhqF6tV3LH5nyxDpOwszGsT KziIDQQWDnT+lCk9FkGx4FDM7Jv0KNFd0eiAIIaDI4wIao+yKDsSJOcmo8UThyYNBKw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bDXUvIaD; arc=none smtp.remote-ip=209.85.161.51 Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9304B606A31F for ; Sun, 15 Nov 2026 09:33:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9304B606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f51.google.com with SMTP id 006d021491bc7-716b58a4365so1874910eaf.3 for ; Sun, 15 Nov 2026 01:33:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794735192; x=1795339992; darn=lists.linux.dev; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=5e7EmmrAmNsJKP6AOjhCJAku3QB+VBI4feI+to/QFAw=; b=bDXUvIaDON7BLcdFdVlsOTcIZPp8lebwl1H+aqJn+7TTdKALIm7/v84hPBhRVGtQ+Y NWJTPPUxf9iiptDngu7xzi9cl6QkuJOtQVNDGj7rHfb7uhw8FXv+h9zZbOIHuqnb7faF iivkrV5K6o76fgKKdj/RnAQ8Es4HVyYcqd7aP4/O0bpIH5kJaw0cOGQArYZCb/NlZPWo cKUtUD9KufODzeft+bJtvLsC+YgCrDC93Jp166z4zNr/cNm5AjbzKZVQo5fkOo3HCS26 CW28NA/53mqe2zG0hLKEYSoSlUzkIJAklcxybTSIcX2nurcZWgvrUp01RksAAYaQIxQ9 TihA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794735192; x=1795339992; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=5e7EmmrAmNsJKP6AOjhCJAku3QB+VBI4feI+to/QFAw=; b=QojU7hxWSK0eiwQDfS5qS5Ew82RhbIVUpe4+XBnacqLdRjanWSZKH5LUD1lmOC3rop 4t79kcOEVkLdHDDDo93TWhWHUUnkSUVZpIavqAVbLAFat+veHrNpHsDSDI7NzDEcFUh+ Q6aYafoU6M/jwTsN6MAd6Ci5pNvSsfu3QCHjukbBmpS8BcG/VjQnWmMHdGFCV2/XXcxS r3EvoXxVliQwvOlm80eRFrJzVqxcE21SmJGUAsGuX9oAuKSkBmyXyX1FbTL7DzEVnYr1 CaAsmwaNOqAK5y4vn33kdJWdl/nw6BBR4zp210hAGqZLYQ6Hbe9x6Q8TxmIwG/WPrWlp QL5g== X-Forwarded-Encrypted: i=1; AL+hErE3JbVhWoD74ZYl1xP1WsSwBelqF6Ix39G1SphATrV27KcVUNdsgp/Jy5W+I8pZ4PCwCQTn2CdRp7eguA==@lists.linux.dev X-Gm-Message-State: APuU4Z/whdtTh999XRk2A/h0vtWcTb8lLgxJGR/l4Lv3npY8HRx2RVzV fcI0qpFB1CN2HsESroBg9+7mMfkTEtoQYvGgjYpxyxGnx+/hqTaZj8T8 X-Gm-Gg: AYBFou2maW7wDaiFGwNM4PSRXEKj4tSRNOWu/+JIVDNJRvfzZHS4cvkzsDrJUhNLNH/ DRB6zsOV7SYunyTJnZs0EeBB/I4bHvbbSYxOvKt9BTISemkdHpR+r1Z4NmluUNEFfx3Pv+QyP8H 6D5UeBD3W+DuPozLCTNVKcsXa73k+qFsTkaEyvzX1LjSp3Qw754Ve7Qf9vuAauDxfLjZotYbzLD 9LB7MXN3YU/N8nwnCUNNxmG8Fgk/gr1Hpm6nP/2TysjIGZ+rS6q3sEYicCwLkit4p97IzRMYFGs Hag9mdJepbCFYgdUAdjowRqP02AMVhFYf1IRJ4VwcJ78KCLzN+bFnhzK4b9sYH03SX6AwnvC45k KD0WOjK/W+QqAsU2PTCtDQ5Hz5JrXK7QL2d1ttXBBHOH9IxWORiuXaEJkTKZgIDi7G7Poj3dM04 +PrEu6avd8ENjzJfcIOmILEoloVDrLPio6yAnLvxMpSNuUhE0PBdt0YeF3sFyO70+v5uzQjsuU/ mPkh8rskL9cwdWFZLVgw3kXoKDb1XvDYo5l0qDAAEV8Gwa4j1U+6qKGiz3PXpF0MqchEdpmah2C YCFCS2BxUWG0v5qp6EH7bi6udi8G1xO1vAaY/RUNsrWv8sUlG5numGoIckZ7VDZ0A7/Oxay3Ktx HP9ffqfOCb9eCwwZoiwY9KbDeHObyCLBxeTccBqx6C4x2UuO7LkTfaMD30ziyROWXO+EpAWrwl/ /pPnWmvXxyQ+Oap6kRYwF+HbFvfRSdkLrlnQnIVDEcICPxR+cmlww= X-Received: by 2002:a05:6820:617:b0:71a:e82c:1eb8 with SMTP id 006d021491bc7-71ae82c267cmr724986eaf.7.1794735192405; Sun, 15 Nov 2026 01:33:12 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-71ab43347b9sm5933617eaf.12.2026.11.15.01.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2026 01:33:11 -0800 (PST) From: James Hilliard Subject: [PATCH v4 0/9] dmaengine: sun6i: fix interrupt routing and channel lifetime Date: Sun, 15 Nov 2026 02:32:48 -0700 Message-Id: <20261115-submit-sun6i-dma-lifetime-next-v1-v4-0-043cd476a45f@gmail.com> X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAAAAAAAC/5XQzW4cIQwA4FdZzblUBoyBPfU9qhwMmCxVZredm awSRfvudSY9dHtqJCRkyf788zatsgxZp+PhbVrkOtZxOWuAXw5TPfH5UcxoGk8OHFlwzqzPZR6 bfmcaps1snkaXbcxizvKymas1wVdvQ+qY0E7q/Fykj5e9x/eHj1iRH1K3d/hPxiK/nrX59pE2F V7F1MusrY4HIpckNqxUXKip2dStxyCeHTRnk8vMEgV3ird60pmPh0Y+J8RIGJmhlQIQShBqynA mIXTSOdF9VadYbU8ttSxgsVYK0F33yiSdAz1UX2Is91XoI2AB9UqkmLlx6EAlh8wBLCCE6BEyT +/7n8a6XZbX/eRXu6/7ievqA6NmCp0S1ty/Pc48nr7qsXb96v4W/f+ITsWq68ZaEUtP/4r+06J XUbrlWqBIpDvxdrv9Bqn1lJV2AgAA X-Change-ID: 20261022-submit-sun6i-dma-lifetime-next-v1-53c3158f4841 To: Vinod Koul , Frank Li , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Arnd Bergmann , Maxime Ripard , Jens Kuske , Jean-Francois Moine Cc: Hongling Zeng , Chengfeng Ye , Nguyen Minh Tien , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, James Hilliard , stable@vger.kernel.org, Frank Li , Sashiko X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.31 / 15.00]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; TAGGED_RCPT(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWELVE(0.00)[20]; FREEMAIL_CC(0.00)[kylinos.cn,connect.ust.hk,embeddedlinux.blog,vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com,nxp.com,kernel.org]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:helo,sea.lore.kernel.org:rdns,sholland.org:email,msgid.link:url,arndb.de:email,infradead.org:email,linux.dev:email]; FORGED_SENDER_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_FROM(0.00)[bounces-27657-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; FREEMAIL_TO(0.00)[kernel.org,gmail.com,sholland.org,arndb.de,free.fr]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; MID_RHS_MATCH_FROM(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.234.253.10:from] X-Rspamd-Queue-Id: 0BB061C44E3 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX Correct interrupt routing and serialize physical-channel ownership across allocation, completion, pause and termination. Keep paused virtual channels off the allocator, drain completion callbacks before releasing resources, and associate cyclic state with the descriptor that owns it. The first patch carries Hongling Zeng's physical-channel indexing fix [0], adapted to the configurable interrupt-bank size introduced for A733. The second handles partially populated banks, including H3's twelve channels. The ownership work is split into lock ordering, physical-channel locking, completed-descriptor retirement and interrupt cleanup. Pause bookkeeping, callback synchronization and per-descriptor cyclic state follow separately. Based on DMAengine next at 6628e7d4c6b, with the posted IRQ-safe locking fix [1], channel pause-bit fix [2], and shared virt-dma synchronization helper [3] applied first. The synchronization patch uses that helper for the sun6i device_synchronize callback. [0] https://lore.kernel.org/r/20260706064123.66035-1-zenghongling@kylinos.cn [1] https://lore.kernel.org/r/20260926171049.841335-1-tien.nguyenminh@embeddedlinux.blog [2] https://lore.kernel.org/r/20261021-submit-sun6i-dma-pause-bit-v1-v1-1-38d286b69dab@gmail.com [3] https://lore.kernel.org/r/20261027-submit-mtk-uart-dma-synchronize-v1-v3-1-aad7a6b3c62e@gmail.com Assisted-by: Codex:gpt-6-astra Signed-off-by: James Hilliard --- Changes in v4: - Explain that reading the pause register flushes the MMIO request before returning to the client, following Frank's review. - Collect Frank's Reviewed-by tags on the interrupt-bank, lock-ordering, ownership, completion, interrupt-retirement, synchronization and cyclic-mode patches. - Rebase onto current DMAengine next, retaining the upstream residue snapshot and NULL-descriptor fixes. - Use the standalone shared virt-dma helper from MediaTek synchronization v3 as a prerequisite. - Link to v3: https://patch.msgid.link/20261023-submit-sun6i-dma-lifetime-next-v1-v3-0-ef1acb0be768@gmail.com Changes in v3: - Split the ownership patch into four commits covering lock ordering, physical-channel locking, completed-descriptor retirement and interrupt cleanup, following Frank Li's review. - Document why virt-dma still takes vc.lock independently of sdev->lock. - Check pending interrupt status first in the per-bank loop condition. - Link to v2: https://lore.kernel.org/r/20261023-submit-sun6i-dma-lifetime-next-v1-v2-0-c9e07cc44bf8@gmail.com Changes in v2: - Clear the active descriptor pointer before handing finite completion to virt-dma, replacing the completed-descriptor pointer. - Release completed physical channels while their virtual channels remain paused, and clear the hardware pause request before reassignment. - Keep the ownership changes in patch 3 and the pause policy in patch 4. - Link to v1: https://lore.kernel.org/r/20261022-submit-sun6i-dma-lifetime-next-v1-v1-0-01085f684c9f@gmail.com To: Vinod Koul To: Frank Li To: Chen-Yu Tsai To: Jernej Skrabec To: Samuel Holland To: Arnd Bergmann To: Maxime Ripard To: Jens Kuske To: Jean-Francois Moine Cc: dmaengine@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-sunxi@lists.linux.dev Cc: linux-kernel@vger.kernel.org --- Hongling Zeng (1): dmaengine: sun6i: fix physical channel index in interrupt handler James Hilliard (8): dmaengine: sun6i: handle the last partial interrupt bank dmaengine: sun6i: take the device lock before the virtual channel lock dmaengine: sun6i: serialize physical channel ownership dmaengine: sun6i: detach completed descriptors before invoking callbacks dmaengine: sun6i: retire interrupt state before reusing physical channels dmaengine: sun6i: track paused virtual channels dmaengine: sun6i: synchronize callbacks before releasing channel resources dmaengine: sun6i: keep cyclic state with the prepared descriptor drivers/dma/sun6i-dma.c | 184 ++++++++++++++++++++++++++++-------------------- 1 file changed, 107 insertions(+), 77 deletions(-) --- base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 change-id: 20261022-submit-sun6i-dma-lifetime-next-v1-53c3158f4841 prerequisite-patch-id: d6398447647aa0dbb005b5e6dc6ba96e642efa86 prerequisite-patch-id: f67c1f8d8d9e014cc650f2f37648662430c3b77b prerequisite-patch-id: 43704b0efab7679ada5f06b959a501040573409a Best regards, -- James Hilliard