All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Paunovic <royalnet026@gmail.com>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net>,
	Oded Gabbay <ogabbay@kernel.org>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Igor Paunovic <royalnet026@gmail.com>
Subject: Re: [PATCH] accel/rocket: clear rdev on device init failure
Date: Thu, 30 Jul 2026 09:21:24 +0200	[thread overview]
Message-ID: <20260730072124.174165-1-royalnet026@gmail.com> (raw)
In-Reply-To: <20260708062845.716487-1-lgs201920130244@gmail.com>

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 <royalnet026@gmail.com>

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

      parent reply	other threads:[~2026-07-30  7:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08  6:28 [PATCH] accel/rocket: clear rdev on device init failure Guangshuo Li
2026-07-08  6:45 ` sashiko-bot
2026-07-30  7:21 ` Igor Paunovic [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260730072124.174165-1-royalnet026@gmail.com \
    --to=royalnet026@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ogabbay@kernel.org \
    --cc=tomeu@tomeuvizoso.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.