Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Gokulkrishna Sekar" <gokulkrishnasr@gmail.com>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: Encode corrected PCIe port type with FIELD_PREP()
Date: Wed, 18 Nov 2026 15:40:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-221352@kernel.org> (raw)
In-Reply-To: <20261118153505.95686-1-Gokulkrishna.Sekar@harman.com>

> set_pcie_port_type() validates PCIe port topology and corrects
> invalid upstream/downstream port type information in the cached
> pcie_flags_reg value.
> 
> When performing these corrections, the code clears the
> PCI_EXP_FLAGS_TYPE field but writes PCI_EXP_TYPE_UPSTREAM or
> PCI_EXP_TYPE_DOWNSTREAM directly into pcie_flags_reg. The
> PCI_EXP_TYPE_* values are decoded port type numbers, not values
> encoded for the PCI_EXP_FLAGS_TYPE bitfield, so the corrected type
> is stored in the wrong bit position.
> 
> As a result, the cached port type may not match the corrected
> topology and subsequent users of pcie_flags_reg can observe an
> incorrect PCIe device type.
> 
> Use FIELD_PREP(PCI_EXP_FLAGS_TYPE, ...) when updating the cached
> field so the corrected port type is encoded consistently with the
> format used in the PCI Express Capabilities Register.
> 
> Fixes: ca78410403dd ("PCI: Get rid of dev->has_secondary_link flag")
> Signed-off-by: Gokulkrishna Sekar <Gokulkrishna.Sekar@harman.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118153505.95686-1-Gokulkrishna.Sekar@harman.com?part=1


  reply	other threads:[~2026-11-18 15:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 15:35 [PATCH] PCI: Encode corrected PCIe port type with FIELD_PREP() Gokulkrishna Sekar
2026-11-18 15:40 ` sashiko-bot [this message]
2026-11-18 16:25 ` Bjorn Helgaas
2026-11-18 19:15   ` Bjorn Helgaas

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=sashiko-outbox-221352@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=gokulkrishnasr@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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