From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: net: mhi_net: Hold runtime PM during active data path operations
Date: Mon, 25 May 2026 19:03:04 +1000 [thread overview]
Message-ID: <review-patch3-20260522-mhi_runtimepm-v2-3-fbebf41a82bb@oss.qualcomm.com> (raw)
In-Reply-To: <20260522-mhi_runtimepm-v2-3-fbebf41a82bb@oss.qualcomm.com>
Patch Review
**Issue 1 - pm_runtime_put ordering in UL callback:**
```c
+ pm_runtime_put(&mdev->dev);
if (netif_queue_stopped(ndev) && !mhi_queue_is_full(mdev, DMA_TO_DEVICE))
netif_wake_queue(ndev);
```
The `pm_runtime_put` is placed *before* the `mhi_queue_is_full` check. While `mhi_queue_is_full` likely only inspects software ring state and doesn't touch hardware registers, it's better practice to put after all usage of `mdev` is complete. If autosuspend fires immediately (e.g., no autosuspend delay configured), the device state could change under you.
**Issue 2 - Asymmetric probe/remove PM handling:**
In probe, the pattern is get-then-put bracketing the initialization:
```c
+ err = pm_runtime_resume_and_get(&mhi_dev->dev);
...
err = mhi_net_newlink(mhi_dev, ndev);
...
+ pm_runtime_put(&mhi_dev->dev);
```
But in remove:
```c
+ err = pm_runtime_resume_and_get(&mhi_dev->dev);
+ if (err)
+ dev_err(...)
mhi_net_dellink(mhi_dev, mhi_netdev->ndev);
+ if (!err)
+ pm_runtime_put(&mhi_dev->dev);
```
The remove path proceeds with `mhi_net_dellink` even if `pm_runtime_resume_and_get` fails. This is reasonable since removal must complete, but the conditional `pm_runtime_put` only on success could leave the refcount unbalanced in practice. Consider using `pm_runtime_put_noidle` in the error case, or just always calling put since the device is being torn down anyway.
**Issue 3 - Noisy error logging:**
```c
+ err = pm_runtime_get(&mdev->dev);
+ if (err < 0 && err != -EINPROGRESS) {
+ dev_err(&mdev->dev, "pm_runtime_get failed %d\n", err);
```
Using `dev_err` for a runtime PM failure on the hot data path (xmit) can be very noisy. Consider `dev_err_ratelimited` or `dev_dbg`.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 9:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 10:00 [PATCH v2 0/6] bus: mhi: Fix broken runtime PM design Krishna Chaitanya Chundru
2026-05-22 10:00 ` [PATCH v2 1/6] bus: mhi: Replace controller runtime_get/put callbacks with direct PM runtime APIs Krishna Chaitanya Chundru
2026-05-25 9:03 ` Claude review: " Claude Code Review Bot
2026-05-22 10:00 ` [PATCH v2 2/6] bus: mhi: Drop controller runtime PM callback indirection Krishna Chaitanya Chundru
2026-05-25 9:03 ` Claude review: " Claude Code Review Bot
2026-05-22 10:00 ` [PATCH v2 3/6] net: mhi_net: Hold runtime PM during active data path operations Krishna Chaitanya Chundru
2026-05-22 20:09 ` Loic Poulain
2026-05-25 9:03 ` Claude Code Review Bot [this message]
2026-05-22 10:00 ` [PATCH v2 4/6] net: qrtr: " Krishna Chaitanya Chundru
2026-05-25 9:03 ` Claude review: " Claude Code Review Bot
2026-05-22 10:00 ` [PATCH v2 5/6] net: wwan: " Krishna Chaitanya Chundru
2026-05-25 9:03 ` Claude review: " Claude Code Review Bot
2026-05-22 10:00 ` [PATCH v2 6/6] bus: mhi: host: Fix runtime PM ownership between clients and controller Krishna Chaitanya Chundru
2026-05-25 9:03 ` Claude review: " Claude Code Review Bot
2026-05-25 9:03 ` Claude review: bus: mhi: Fix broken runtime PM design Claude Code Review Bot
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=review-patch3-20260522-mhi_runtimepm-v2-3-fbebf41a82bb@oss.qualcomm.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox