From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 AD7D73BB11B for ; Thu, 30 Jul 2026 07:21:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785396103; cv=none; b=JsnUyHiXaNdDtUAr2JMIxdtrv/EXhEJ4vGrc3MBtm5SEtku1Gq4ZvTvXFT6PPmNwVO3GheRA94tfFNEsw6LRwDPTSszDNTmWCW3AApZAWsIU8DH6dZdNVyf239eOb0lhiyi4GRFKIJc3gbeZ6yuBNzi/qdBB25mwpdsQO/9EXfE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785396103; c=relaxed/simple; bh=osIUkOhlQAjkEic0TVs83/n4l1Oun0+u9F3TBF+lujI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PfF+hMxUfA7waXVTHSzLV70CUAy2EI26Xxb4vxkjq+JTWRbm+AxRVPgRVC1TjKcJCVxAOjCeY/rW92/HyfpJIqEIp9l9yqZHOMXb2lIYE9mMG++PqWMhLQ8Ibe7xdAxLsHiw1b2cwJ25BbY0ZPA5RKuxfwU5DUt2Apuj7z1mDK8= 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=ebP/3fbY; arc=none smtp.client-ip=209.85.128.53 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="ebP/3fbY" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4957799b92fso1373625e9.1 for ; Thu, 30 Jul 2026 00:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785396100; x=1786000900; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=gbV641T0LN96g2Xmc5h13OPzy/3kHyekAXKlELi/Eas=; b=ebP/3fbY93xlac/8wO+oSva5OzTZp9p/WBQZ24W57cHGLdS5pfm77AVL+g2Oouw9xW EWE/5K0xeLhJh+tMKs/tLw11mHIWk57DvafdEO8vl6uh2XwvbhW3/MT48INZ8TcJI73z xoAjJgfwoCyi6zFZDhCmBeuCqJ0C0PklT0NhffVyRFdlcMvEuk2Tw9+Z70PiH8LIWPnE DzeTC+zENF+C5xTxKXKaElQZC4L23oPwneXmSf+14W1r7dtRyQJxIeKAwt29h2dJSYKU DLCRq2jfQ8udcFjOKfGMy/1P+t5JKhxT07biNu5nQZ06pg9wmGdN4WnmBuoGTVKuaEwq +eVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785396100; x=1786000900; h=content-transfer-encoding:mime-version:references:in-reply-to :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=gbV641T0LN96g2Xmc5h13OPzy/3kHyekAXKlELi/Eas=; b=WQMD/RZc3JjZzAk6SCi8ySHy++Hq9le4Wmca1hM0+FhyzM1qb3jtSNhvt8oVGRg7Zp p1hjn4iMOAP8g/h+iRF5XCTIwIJSlFaiRc6fegklp5ubgki6D/UdV7v/NcBW6Sq4+lTy uVQGHL5ujfsifuuag0a2uNhZmWTgbRAzVgC4sf1ajLp+A5BrWEUpr6Qip7OkYQlEtoKk 87OTOMNS1RInNtGsB+6AV6puy2e+smm49yZovb2hcabItwd4BtpIHAx5tmAbHrVOd80H uWXphU9puXDmdOVG/wU/FCw5ZTNtHA8khM4b2CS6P2Fp4d+8SYHFqDOQDj+/KaKhsndL 2IDA== X-Forwarded-Encrypted: i=1; AHgh+RqmDb8hiNK3289PfyqdEMh2X3p+yaVVOpU2b/iQLw5w7uNKe2C0xo65A1THbkAnVthMq8Ys6Fj8RVdcMcQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwZSqup6u6SVrMP8S5XjJtFvtRatMfugozOlGwKbdUyPb03SHp1 wa+e3XSEB/gs5AEsz5jCc3UWUXSqT9XHnL1otPPEf+mupd0HidAJrwrt X-Gm-Gg: AR+sD132qG8Z9be0/cUe4PPQKDm7LsbhC8/nGEbuFe8zWtov2I3J91mgnPOFK3EoYvw xq+vF1vzZ7+XhX4up9Sj7OzWKFplNpHtuKXUx7p32r/NXfNSDFY0YONq1ConMIczKQCkPUE0Lem IhsGm0HsXsGHsMcWpQKpLnXi3odHwX8qrYddeymhyj5xBvUdntTP672ofgpxVVE2yuAEvZHPxmS DMxuF8FxnD8JiXgYbrXKsPl/OrjzmJB0vymqZSO+izGL69TlAfr4+unBHY4G/ximPEAAiRpUfwe bj+AkXdRDEFx+KDo/YEqP19W0b8ahSBO8CTMAcc7Wz1fJ5hVqrnSpwcH55bPlZUmC39oh3/DrkF GcbTm8RSB6LMhpTpANco8Dwol+GoZR3c7zqPxJX8Vcx5zLdCz98OPEH5/DCruUtjiALuf3qPRbg bRKr2XQBaDAc4D/RaMfx07IaCUrGiwxwWHhx9Tyrb0xt3qqfQ/xMhbz3EvjZMUJSvGTIwfYMyku CECvK0+QREZeAxLKQlZxBM3UD/cGHUB7ARe/Uoq0bsWpOULneQFXOmd0uNGSyyrfYHXng== X-Received: by 2002:a05:600c:4ec6:b0:495:71ff:598d with SMTP id 5b1f17b1804b1-49800e6d0b8mr16966975e9.1.1785396099679; Thu, 30 Jul 2026 00:21:39 -0700 (PDT) Received: from OrangePi5-Plus.BB-HOME (20014C4E1B8A5A00BF2D55A7591B4173.dsl.pool.telekom.hu. [2001:4c4e:1b8a:5a00:bf2d:55a7:591b:4173]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-498010aaceasm37002475e9.12.2026.07.30.00.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 00:21:39 -0700 (PDT) From: Igor Paunovic To: Guangshuo Li Cc: Tomeu Vizoso , Oded Gabbay , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Igor Paunovic Subject: Re: [PATCH] accel/rocket: clear rdev on device init failure Date: Thu, 30 Jul 2026 09:21:24 +0200 Message-ID: <20260730072124.174165-1-royalnet026@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260708062845.716487-1-lgs201920130244@gmail.com> References: <20260708062845.716487-1-lgs201920130244@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Guangshuo, I have been working on this driver on RK3588 (Orange Pi 5 Plus) and went through your fix carefully: - The analysis matches the code: rocket_probe() publishes the ERR_PTR into the file-scoped rdev before the IS_ERR() check, and since __driver_attach() keeps probing the remaining devices after a failed probe, the next rknn-core dereferences the poisoned pointer at rdev->num_cores. Every RK3588 DT carries three rknn-core nodes, so the follow-up probe is guaranteed. - rocket_device_init() cannot return -EPROBE_DEFER (it does no clock, regulator or supplier lookups), so clearing rdev here cannot interfere with the deferral path in rocket_core_init(), which already resets rdev correctly further down in rocket_probe(). - The fix mirrors the shape the driver already uses on the rocket_core_init() failure path (fini + rdev = NULL) and changes nothing on the success path. Reviewed-by: Igor Paunovic I also ran the patched driver on RK3588: normal three-core probe, runtime PM suspend/resume and a Teflon/MobileNetV1 inference run are all unaffected. Thanks, Igor