public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Aksh Garg <a-garg7@ti.com>
To: Niklas Cassel <cassel@kernel.org>, Koichiro Den <den@valinux.co.jp>
Cc: <linux-pci@vger.kernel.org>, <jingoohan1@gmail.com>,
	<mani@kernel.org>, <lpieralisi@kernel.org>,
	<kwilczynski@kernel.org>, <robh@kernel.org>,
	<bhelgaas@google.com>, <Zhiqiang.Hou@nxp.com>,
	<gustavo.pimentel@synopsys.com>, <linux-kernel@vger.kernel.org>,
	<s-vadapalli@ti.com>, <danishanwar@ti.com>
Subject: Re: [PATCH v4 2/3] PCI: dwc: ep: Add per-PF BAR and inbound ATU mapping support
Date: Fri, 30 Jan 2026 09:42:43 +0530	[thread overview]
Message-ID: <4c71700d-e4a5-496b-825e-01f346f73949@ti.com> (raw)
In-Reply-To: <aXtrW7viGZfMNZur@ryzen>

On 29/01/26 19:44, Niklas Cassel wrote:
> On Thu, Jan 29, 2026 at 02:47:52PM +0530, Aksh Garg wrote:
>> -static void dw_pcie_ep_clear_ib_maps(struct dw_pcie_ep *ep, enum pci_barno bar)
>> +static void dw_pcie_ep_clear_ib_maps(struct dw_pcie_ep *ep, u8 func_no, enum pci_barno bar)
>>  {
>> +	struct dw_pcie_ep_func *ep_func = dw_pcie_ep_get_func_from_ep(ep, func_no);
>>  	struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
>>  	struct device *dev = pci->dev;
>>  	unsigned int i, num;
>> @@ -152,18 +157,18 @@ static void dw_pcie_ep_clear_ib_maps(struct dw_pcie_ep *ep, enum pci_barno bar)
>>  	u32 *indexes;
> 
> Hello Aksh,
> 
> Considering that all other functions that you have modified, you have added a:
> 
> if (!ep_func)
> 	return;
> 
> 
> I think you should do the same to this function.
> 

I omitted this NULL check here because all the current call sites of
dw_pcie_ep_clear_ib_maps() already perform this validation. I felt
adding it here would add redundancy in the code.

> 
>>  
>>  	/* Tear down the BAR Match Mode mapping, if any. */
>> -	if (ep->bar_to_atu[bar]) {
>> -		atu_index = ep->bar_to_atu[bar] - 1;
>> +	if (ep_func->bar_to_atu[bar]) {
>> +		atu_index = ep_func->bar_to_atu[bar] - 1;
>>  		dw_pcie_disable_atu(pci, PCIE_ATU_REGION_DIR_IB, atu_index);
>>  		clear_bit(atu_index, ep->ib_window_map);
>> -		ep->bar_to_atu[bar] = 0;
>> +		ep_func->bar_to_atu[bar] = 0;

  parent reply	other threads:[~2026-01-30  4:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29  9:17 [PATCH v4 0/3] PCI: dwc: ep: Enhance multi-function endpoint support Aksh Garg
2026-01-29  9:17 ` [PATCH v4 1/3] PCI: dwc: ep: Fix resizable BAR support for multi-PF configurations Aksh Garg
2026-01-29  9:17 ` [PATCH v4 2/3] PCI: dwc: ep: Add per-PF BAR and inbound ATU mapping support Aksh Garg
2026-01-29 14:14   ` Niklas Cassel
2026-01-30  2:21     ` Koichiro Den
2026-01-30  9:57       ` Niklas Cassel
2026-01-30 17:16         ` Koichiro Den
2026-01-30 22:51           ` Niklas Cassel
2026-01-31 13:42             ` Koichiro Den
2026-01-30  4:12     ` Aksh Garg [this message]
2026-01-30  9:53       ` Niklas Cassel
2026-01-30 10:39         ` Aksh Garg
2026-01-30 10:47           ` Niklas Cassel
2026-01-30 10:52             ` Aksh Garg
2026-01-29  9:17 ` [PATCH v4 3/3] PCI: dwc: ep: Add comment explaining controller-level PTM access Aksh Garg

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=4c71700d-e4a5-496b-825e-01f346f73949@ti.com \
    --to=a-garg7@ti.com \
    --cc=Zhiqiang.Hou@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=danishanwar@ti.com \
    --cc=den@valinux.co.jp \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=jingoohan1@gmail.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=robh@kernel.org \
    --cc=s-vadapalli@ti.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