All of lore.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: "Frank Li" <Frank.li@nxp.com>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	imx@lists.linux.dev, dlemoal@kernel.org, maz@kernel.org,
	tglx@linutronix.de, jdmason@kudzu.us
Subject: Re: [PATCH v8 3/6] PCI: endpoint: Add pci_epf_align_addr() helper for address alignment
Date: Tue, 26 Nov 2024 11:27:01 +0100	[thread overview]
Message-ID: <Z0Widd3IZNV4DGS_@ryzen> (raw)
In-Reply-To: <20241126041903.lq6zunvzoc2mmgbl@thinkpad>

On Tue, Nov 26, 2024 at 09:49:03AM +0530, Manivannan Sadhasivam wrote:
> On Mon, Nov 25, 2024 at 02:22:23PM -0500, Frank Li wrote:
> > On Sun, Nov 24, 2024 at 01:02:39PM +0530, Manivannan Sadhasivam wrote:
> > > On Sat, Nov 16, 2024 at 09:40:43AM -0500, Frank Li wrote:
> > > > +static inline int pci_epf_align_inbound_addr_lo_hi(struct pci_epf *epf, enum pci_barno bar,
> > > > +						   u32 low, u32 high, u64 *base, size_t *off)
> > >
> > > Why can't you just use pci_epf_align_inbound_addr() directly? Or the caller
> > > could pass u64 address directly.
> > 
> > 
> > msi message sperate low32 and high32.  (h << 32 | low) is quite easy to
> > cause build warning.  it should be ((u64) h << 32) | low. Avoid copy this
> > logic code at many EPF places.
> > 
> 
> There is absolutely no overhead in doing so. Also the concern for me is,
> pci_epf_align_inbound_addr() is exported but only used within
> pci_epf_align_inbound_addr_lo_hi(). This causes confusion. So I'd prefer to have
> a single exported API that is used by the callers.

Yes, other EPF drivers will need to copy the line:
pci_epf_align_inbound_addr(..., ((u64) h << 32) | low, ...)
instead of:
pci_epf_align_inbound_addr_lo_hi(..., low, high, ...)

which I think is fine to be honest.

Probably simplest thing is just to kill
pci_epf_align_inbound_addr_lo_hi().


Kind regards,
Niklas


  parent reply	other threads:[~2024-11-26 10:27 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-16 14:40 [PATCH v8 0/6] PCI: EP: Add RC-to-EP doorbell with platform MSI controller Frank Li
2024-11-16 14:40 ` [PATCH v8 1/6] PCI: endpoint: Add pci_epc_get_fn() API for customizable filtering Frank Li
2024-11-16 14:40 ` [PATCH v8 2/6] PCI: endpoint: Add RC-to-EP doorbell support using platform MSI controller Frank Li
2024-11-24  7:11   ` Manivannan Sadhasivam
2024-11-24  9:56     ` Niklas Cassel
2024-11-24 13:17       ` Manivannan Sadhasivam
2024-11-24 15:26         ` Niklas Cassel
2024-11-25 18:03     ` Frank Li
2024-11-26  4:14       ` Manivannan Sadhasivam
2024-11-26 17:19         ` Frank Li
2024-11-27  6:20           ` Manivannan Sadhasivam
2024-11-16 14:40 ` [PATCH v8 3/6] PCI: endpoint: Add pci_epf_align_addr() helper for address alignment Frank Li
2024-11-24  7:32   ` Manivannan Sadhasivam
2024-11-25 19:22     ` Frank Li
2024-11-26  4:19       ` Manivannan Sadhasivam
2024-11-26  9:36         ` Niklas Cassel
2024-11-26 10:27         ` Niklas Cassel [this message]
2024-11-16 14:40 ` [PATCH v8 4/6] PCI: endpoint: pci-epf-test: Add doorbell test support Frank Li
2024-11-24  7:56   ` Manivannan Sadhasivam
2024-11-25 19:17     ` Frank Li
2024-11-26  4:25       ` Manivannan Sadhasivam
2024-11-26 10:00         ` Niklas Cassel
2024-11-26 12:41           ` Manivannan Sadhasivam
2024-11-26 16:55             ` Frank Li
2024-11-27  8:53               ` Niklas Cassel
2024-11-26 16:46         ` Frank Li
2024-11-16 14:40 ` [PATCH v8 5/6] misc: pci_endpoint_test: Add doorbell test case Frank Li
2024-11-24 13:51   ` Manivannan Sadhasivam
2024-11-25 19:12     ` Frank Li
2024-11-16 14:40 ` [PATCH v8 6/6] tools: PCI: Add 'B' option for test doorbell Frank Li

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=Z0Widd3IZNV4DGS_@ryzen \
    --to=cassel@kernel.org \
    --cc=Frank.li@nxp.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=dlemoal@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=imx@lists.linux.dev \
    --cc=jdmason@kudzu.us \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.