public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/xe: Suppress Surprise Link Down on non-hotplug device
Date: Mon, 25 May 2026 21:57:10 +1000	[thread overview]
Message-ID: <review-patch5-20260520113351.171119-12-mallesh.koujalagi@intel.com> (raw)
In-Reply-To: <20260520113351.171119-12-mallesh.koujalagi@intel.com>

Patch Review

The rationale is sound: a cold reset drops the PCIe link, and on non-hotplug slots this triggers a spurious Surprise Link Down AER event that defeats the recovery. Masking SLD on the USP before requesting the cold reset prevents this.

**Concern: SLD mask is never restored**

```c
pci_read_config_dword(usp, aer_cap + PCI_ERR_UNCOR_MASK, &aer_uncorr_mask);
aer_uncorr_mask |= PCI_ERR_UNC_SURPDN;
pci_write_config_dword(usp, aer_cap + PCI_ERR_UNCOR_MASK, aer_uncorr_mask);
```

If the cold reset succeeds, hardware presumably reinitializes the AER registers, so the mask is implicitly cleared. But if the cold reset is never performed (userspace ignores the uevent) or fails, the SLD mask remains permanently applied on the USP. This means legitimate surprise link-down events would be silently masked for the remaining uptime of the system. Consider documenting this trade-off explicitly, or adding a comment explaining why restoration isn't needed.

**`pcie_slot_is_hotplug_capable()` — correct but worth a comment**

```c
static bool pcie_slot_is_hotplug_capable(struct pci_dev *usp)
{
	struct pci_dev *root_port = pci_upstream_bridge(usp);
```

The function name says "slot" but it takes the USP and walks up to the root port. This is correct (the slot the USP is plugged into is owned by the root port), but the naming could confuse readers. A brief comment like `/* The hotplug slot is on usp's parent (root port) */` would help.

**Hotplug capability check:**

```c
return (sltcap & (PCI_EXP_SLTCAP_HPC | PCI_EXP_SLTCAP_PCP)) ==
	(PCI_EXP_SLTCAP_HPC | PCI_EXP_SLTCAP_PCP);
```

Checking both Hot-Plug Capable and Power Controller Present is correct — both must be present for the slot to support power cycling that would make a surprise link-down expected.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-25 11:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 11:33 [PATCH v6 0/5] Introduce cold reset recovery method Mallesh Koujalagi
2026-05-20 11:33 ` [PATCH v6 1/5] Introduce Xe Uncorrectable Error Handling Mallesh Koujalagi
2026-05-25 11:57   ` Claude review: " Claude Code Review Bot
2026-05-20 11:33 ` [PATCH v6 2/5] drm: Add DRM_WEDGE_RECOVERY_COLD_RESET recovery method Mallesh Koujalagi
2026-05-25 11:57   ` Claude review: " Claude Code Review Bot
2026-05-20 11:33 ` [PATCH v6 3/5] drm/doc: Document " Mallesh Koujalagi
2026-05-25 11:57   ` Claude review: " Claude Code Review Bot
2026-05-20 11:33 ` [PATCH v6 4/5] drm/xe: Handle PUNIT errors by requesting cold-reset recovery Mallesh Koujalagi
2026-05-25 11:57   ` Claude review: " Claude Code Review Bot
2026-05-20 11:33 ` [PATCH v6 5/5] drm/xe: Suppress Surprise Link Down on non-hotplug device Mallesh Koujalagi
2026-05-25 11:57   ` Claude Code Review Bot [this message]
2026-05-25 11:57 ` Claude review: Introduce cold reset recovery method Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-12 13:26 [PATCH v5 0/5] " Mallesh Koujalagi
2026-05-12 13:26 ` [PATCH v5 5/5] drm/xe: Suppress Surprise Link Down on non-hotplug device Mallesh Koujalagi
2026-05-16  3:17   ` Claude review: " 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-patch5-20260520113351.171119-12-mallesh.koujalagi@intel.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