mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Cc: mani@kernel.org, kwilczynski@kernel.org,
	linux-pci@vger.kernel.org, kishon@kernel.org,
	Frank.Li@kernel.org, bhelgaas@google.com, den@valinux.co.jp,
	thierry.reding@kernel.org, jonathanh@nvidia.com,
	vidyas@nvidia.com, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] PCI: endpoint: Skip upper halves of 64-bit BARs during search
Date: Wed, 21 Oct 2026 12:45:57 +0200	[thread overview]
Message-ID: <atiX5UoJ0qgV0wGN@ryzen> (raw)
In-Reply-To: <20261021080644.1346549-1-mmaddireddy@nvidia.com>

On Wed, Oct 21, 2026 at 01:36:44PM +0530, Manikanta Maddireddy wrote:
> pci_epc_get_next_free_bar() skips the upper half of a 64-bit BAR only
> when it is the starting BAR. If the search subsequently passes a
> reserved or disabled 64-bit BAR, it can return its upper half as an
> independent BAR because that slot has a default programmable descriptor.
> 
> For example, Tegra exposes a programmable 64-bit BAR0 and reserved
> 64-bit BAR2 and BAR4. A search starting at BAR1 skips BAR1 and BAR2,
> then incorrectly returns BAR3. The next search can similarly return
> BAR5, causing the EPF test driver to allocate and program BARs that
> belong to the reserved hardware windows.

The 'only_64bit' property tells an EPF that it can only configure the
BAR as 64-bit.

BARs that are reserved are hidden from an EPF, and can not be programmed
at all, so the 'only_64bit' property does not make sense on reserved BARs.

See:
9266514689fe ("PCI: endpoint: Drop only_64bit on reserved BARs")

At least when I cleanup up all the properties (including tegra) in:
e01c9797c0eb ("PCI: endpoint: Clean up hardware description for BARs")

I made sure that there were no BARs that were marked both reserved and
only_64bit.


This also matches the @only_64bit kdoc in include/linux/pci-epc.h.


I see you changed this in:
12a22fb38cbb ("PCI: tegra194: Expose BAR2 (MSI-X) and BAR4 (DMA) as
64-bit BAR_RESERVED").


I'm fine with this patch, but I think you need to rephrase the kdoc
to reflect this new reality, because currently the kdoc is confusing/
not in line with the 'new' meaning of BAR_RESERVED, which can contain
MSI-X table etc.

(The old BAR_RESERVED was renamed to be BAR_DISABLED, to be more clear.)


Kind regards,
Niklas

  reply	other threads:[~2026-10-21 10:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21  8:06 Manikanta Maddireddy
2026-10-21 10:45 ` Niklas Cassel [this message]
2026-10-21 14:25   ` Niklas Cassel

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=atiX5UoJ0qgV0wGN@ryzen \
    --to=cassel@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=den@valinux.co.jp \
    --cc=jonathanh@nvidia.com \
    --cc=kishon@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=thierry.reding@kernel.org \
    --cc=vidyas@nvidia.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

all inboxes | Powered by JetHome®