Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Felipe Infante de Castro" <felipe.infante.de.castro@gmail.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: dwc: Skip the empty CFG1 window for a two-bus ECAM range
Date: Thu, 26 Nov 2026 19:33:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-236097@kernel.org> (raw)
In-Reply-To: <CADy1qsYumu=QY34qDxL2dPjQc4teadMaMgFS4rR2iAr3rMiqag@mail.gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] PCI: dwc: commit message includes email greeting and duplicates
  changelog
--

commit 7a5d39707aeeca95411c9f51ba2051ccdefb49e1
Author: Felipe Infante de Castro <felipe.infante.de.castro@gmail.com>

> PCI: dwc: Skip the empty CFG1 window for a two-bus ECAM range
>
> Hi,
>
> The patch is attached as a file rather than inline, because my mail
> client cannot send it inline without wrapping lines and converting
> tabs. Apologies for that. The commit message is repeated below for
> review.
>
> With the iATU-based ECAM mechanism and a host bus resource of [bus
> 00-01] (bus-range = <0 1> in a device tree),
> dw_pcie_config_ecam_iatu() programs the CFG0 window for bus 1 and then
> requests a CFG1 window of zero bytes:
>
>   atu.size = (SZ_1M * bus_range_max) - SZ_2M;
>
> dw_pcie_prog_outbound_atu() rejects a zero-size window with -EINVAL,
> the error propagates through dw_pcie_host_init() and the host bridge
> is never registered.
>
> resource_size() counts both ends of the range, so [bus 00-01] holds
> two buses. Bus 0 uses the DBI registers and bus 1 uses the CFG0
> window. A CFG1 window is needed only from bus 2 on, that is for three
> buses or more. The early return tests "bus_range_max < 2", which lets
> the two-bus case through. The patch returns early for two buses as
> well.
>
> Tested by replaying dw_pcie_config_ecam_iatu() and
> dw_pcie_prog_outbound_atu() in user space against memory-backed
> registers, for every bus count from 2 to 256 at two ECAM bases.
> Without the change the two-bus case fails with -EINVAL; with it all
> 510 cases pass and the CFG1 window for three or more buses is
> unchanged. Not tested on hardware with a two-bus range. The patch also
> builds cleanly on a 7.3.6 tree with W=1.
>
> The code was introduced by f6fd357f7afb ("PCI: dwc: Prepare the driver
> for enabling ECAM mechanism using iATU 'CFG Shift Feature'") and is
> unchanged in v7.4-rc4.
>
> Thanks,
> Felipe
>
> With the iATU-based ECAM mechanism and a host bus resource of [bus 00-01]
> (bus-range = <0 1> in a device tree), dw_pcie_config_ecam_iatu() programs
> the CFG0 window for bus 1 and then requests a CFG1 window of zero bytes:
>
>   atu.size = (SZ_1M * bus_range_max) - SZ_2M;
>
> dw_pcie_prog_outbound_atu() rejects a zero-size window with -EINVAL, the
> error propagates through dw_pcie_host_init() and the host bridge is never
> registered.
>
> resource_size() counts both ends of the range, so [bus 00-01] holds two
> buses. Bus 0 uses the DBI registers and bus 1 uses the CFG0 window. A
> CFG1 window is needed only from bus 2 on, that is for three buses or
> more. The early return tests "bus_range_max < 2", which lets the two-bus
> case through.
>
> Return early for two buses as well.
>
> Tested by replaying dw_pcie_config_ecam_iatu() and
> dw_pcie_prog_outbound_atu() in user space against memory-backed
> registers, for every bus count from 2 to 256 at two ECAM bases. Without
> the change the two-bus case fails with -EINVAL; with it all 510 cases
> pass and the CFG1 window for three or more buses is unchanged. Not
> tested on hardware with a two-bus range.
>
> Fixes: f6fd357f7afb ("PCI: dwc: Prepare the driver for enabling ECAM mechanism using iATU 'CFG Shift Feature'")
> Assisted-by: OpenAI Codex
> Assisted-by: Claude Fable 5.2
> Signed-off-by: Felipe Infante de Castro <felipe.infante.de.castro@gmail.com>

[Severity: Low]
This isn't a bug in the code, but the commit message includes the email
greeting ("Hi," ... "Thanks, Felipe") and repeats the entire changelog
body twice.  Any mail-client commentary belongs below the "---" separator
so it is not recorded in git history, and the duplicate copy of the
changelog should be dropped.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/CADy1qsYumu=QY34qDxL2dPjQc4teadMaMgFS4rR2iAr3rMiqag@mail.gmail.com?part=1

      reply	other threads:[~2026-11-26 19:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 19:28 [PATCH] PCI: dwc: Skip the empty CFG1 window for a two-bus ECAM range Felipe Infante de Castro
2026-11-26 19:33 ` sashiko-bot [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=sashiko-outbox-236097@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=felipe.infante.de.castro@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