From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B61581EFF8D for ; Fri, 31 Jul 2026 06:49:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785480600; cv=none; b=FPX6Alx/SF3ofqo4q+Td7VFDjkp/6lKVH7/2pxbNbtJZa+pBTnQ7zPSGN7+S1vWQTZU1Kq369sUxofYYrra9m8HMGhoDiDuFS9siwHyfBT2Rd7ve9WGQoChlAkbVUNxlEaij1X5Txly8/GOIgKXRK0hsN8IbtcLAR8dlGXysTS4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785480600; c=relaxed/simple; bh=jNpgtpb0fK8kak0BlEmwP9UcS3Lt1s+MMyWJJ3v2ExA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=onkBlm934jZqxsqtFfFJAk4enc5o3F3iCAYQhg3pzBJCzrp2WZijQFa5p/6NYsxKVd5uf/eyxN9mSBG/5yl0HVlBjgFpuIHeXUbCUiOhoz3iSDoWNh6i52qxcvZOimxplgcKMuS3MscDzAOR03/sZPhUog5HpU9mi8KEFl9J0Co= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YiZQc/FD; arc=none smtp.client-ip=209.85.221.43 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YiZQc/FD" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-47f611b3af9so80560f8f.3 for ; Thu, 30 Jul 2026 23:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785480596; x=1786085396; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=vsR6hWzy4D9+PPoxqFEdaQVVVEVdpxP3yoc1mBPPEeI=; b=YiZQc/FDagn/3KzsJJglhkXcfgb0ZS8c8O2ZkCWwe4gql0vHafHs1sMYHkVrskT9Mz lG42lZ5bNLTJfAvnLgC0fCehLTotrLAuexdFmTEkBgXIUAqxZzzpdq1QUSs19IKq2dnl KfvslO68/xHW6sA5Y+Rt7M5mTS1Z2qxgEzKRJzNHcMCqdd1rw4C5EgMIH3YP/XgzWe1T BsuuWAdLyfkc2csRIwpfElAD20tEk5HaERvOWwNnm8gYJs2/Ma6mneLCBRQfL27DSAFz vz5vpUNh+AJYUkWqSwByECBCArL9C9GA/SO/2p9uNm1Bglv2re3vxBAGZ3UTkuKSwsFl pwqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785480596; x=1786085396; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=vsR6hWzy4D9+PPoxqFEdaQVVVEVdpxP3yoc1mBPPEeI=; b=RnYSJafZz4ulMgSYEvgt06slOggx2Lm/bGVS+qDa3KBzdIULJdsaYxtO4VCj5Nh9gX AF+A3C35XxJb2GrtRe9l1ciq/w7gbpXzNvTKnUHqSqzp9LsknZ8UpG9CuUNpKGZnY1ap F+MAYl52LdZjrOMSvwqVJHGzteDm728U6JcuSg6U1MvAweycPVb02NNQgvUocpOaidTA bXpsOUiPhe0UZisIcn6Kdv/nUhFtLnguetWe7ZYmHMXorYXd8fUnCDCY4g0VGbRimePi QDZvChcuJ23JeoVt2Rp9fL2ElxChUHLerLury0DQMUsRy1mNP9K/XtnYuV2/VKH3azWw /z/g== X-Forwarded-Encrypted: i=1; AHgh+RoJ7L8GGNlnU3KkSvhQJG/n6mhTc7G2WVArr6LyNTBiMaBthUzL/Gge7m+skHOyqezjw2LfjxVfodAY6+w=@vger.kernel.org X-Gm-Message-State: AOJu0YycD7dWad4Av6ILrkVVb/v3r2B2A4mpimWKFUfJZIjfj7JTM5A3 cV4JP9C5RxLEoyVFVNJwj+adm/ndlWbhlNCWpS/U2LzmerQ/rkkkJ3QC X-Gm-Gg: AR+sD10zPMbETgNwOrOiVbI2ss7pEmP1uvw0zXA3QxqN53YZM2V7K7LWq2oo6mOyLcr cngCkg55qVYq3KMAyaw3QM6Ca1vguvtXk+wbxSg2vQHLG0py+T+BelBN9ZXNXHPN0e2aBYWbJnO gvLzJja6++tvyTpIZ1ryW/PDZSdqKGbRJwSgHSxcDmrRg0pxLWJSqLheeeL2B7diDoXB5Cz1GjC e7T8CgImTkOj45VPtDNk78Ll7TwW4IZEIY3vJkfp8gRWeE+YXfJkSIai3wkoyf8QU9dK7tBXNNS jcXPGDLlKAmtrCOGsetKo8t/DL6mL3w1gUuIR3AHHEY5jlid7miFnxtIhmZ4/6a/F93NWnGPwol Irz1ey8AiQkEzvlFC45V3fCYMchzpLvJJIcHg27j3unUPeARABWaxTgH2WqvymnR9r0GHkR4bb0 /TJqoyRbgYXLZt2o4c9MJk1vUawgrn8kQ+yY1fzGVPsLk7IsMyF/fT+e7ZmxL+GdCjQ12XMvp76 McDWPHPXrlJayWao+7s5VfDi6+sVg61Cza1INMUsIsbvXodaikLg3JvpVDBdIza0T3+5w== X-Received: by 2002:a5d:64ed:0:b0:47f:7e91:3d55 with SMTP id ffacd0b85a97d-47fd2b3e820mr2256719f8f.2.1785480596373; Thu, 30 Jul 2026 23:49:56 -0700 (PDT) Received: from OrangePi5-Plus.BB-HOME (20014C4E1B8B8B0053881A2C61CA978D.dsl.pool.telekom.hu. [2001:4c4e:1b8b:8b00:5388:1a2c:61ca:978d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fd41e2abbsm1212753f8f.9.2026.07.30.23.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 23:49:55 -0700 (PDT) From: Igor Paunovic To: Tomeu Vizoso Cc: Oded Gabbay , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Guangshuo Li , Jiaxing Hu , Igor Paunovic Subject: [PATCH v2 0/2] accel/rocket: fix shared-device lifecycle on probe failure and unbind Date: Fri, 31 Jul 2026 08:49:31 +0200 Message-ID: <20260731064933.12548-1-royalnet026@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The rocket driver keeps a single shared DRM device on a driverless "rknn" platform device: the first core to probe initializes it, the last one to go away tears it down. This series fixes two independent bugs in that lifecycle. Both were flagged by the Sashiko AI review on my clks patch; I verified each by hand against the code and then on hardware before writing the fixes. Patch 1 releases the devres of the shared device on teardown. Today every fini/re-init cycle leaks the previous rocket_device and pins its accel minor - observable as /dev/accel/accel0 coming back as accel1, then accel2, on unbind/rebind cycles of all cores. Patch 2 makes the per-core slot bookkeeping stable across unbind and rebind in any order. Today unbinding a lower-numbered core makes higher-numbered ones unfindable (their runtime PM callbacks start returning -ENODEV), a later unbind of such a core is silently skipped, and a subsequent bind overwrites a slot whose IRQ handler and DRM scheduler are still live. Verified on RK3588 (Orange Pi 5 Plus, all three cores): the unbind/rebind matrix keeps /dev/accel/accel0 stable and every core findable; single-core operation works from the highest slot alone (confirmed via the per-core IRQ counters moving to that core); the forced-init-failure path releases its slot cleanly; and MobileNetV1 inference via the Teflon TFLite delegate stays bit-identical to the stock driver throughout. The series applies on top of Guangshuo Li's pending fix, on which patch 1 depends textually (reviewed on-list): https://lore.kernel.org/dri-devel/20260708062845.716487-1-lgs201920130244@gmail.com/ v2: - patch 2: clear the slot's .dev when rocket_core_init() fails - with .dev as the liveness marker a failed init left a half-initialised core visible to lookups and made rocket_job_open()'s live-slot walk overflow its allocation by one entry (Jiaxing Hu); make the never-initialised slot skip in sched_to_core() explicit; document the synchronous-probe assumption - patch 1: unchanged v1: https://lore.kernel.org/dri-devel/20260730080355.177422-1-royalnet026@gmail.com/ Igor Paunovic (2): accel/rocket: release the shared device's devres on teardown accel/rocket: keep core slots stable across unbind and rebind drivers/accel/rocket/rocket_device.c | 2 ++ drivers/accel/rocket/rocket_device.h | 3 +++ drivers/accel/rocket/rocket_drv.c | 41 ++++++++++++++++++++++++++++++++---- drivers/accel/rocket/rocket_job.c | 13 +++++++------ 4 files changed, 53 insertions(+), 10 deletions(-) -- 2.53.0