mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Rick Wertenbroek <rick.wertenbroek@gmail.com>
Cc: rick.wertenbroek@heig-vd.ch, alberto.dassatti@heig-vd.ch,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Frank Li" <Frank.Li@nxp.com>,
	"Damien Le Moal" <dlemoal@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: endpoint: Introduce 'get_bar' to map fixed address BARs in EPC
Date: Tue, 23 Jul 2024 18:48:27 +0200	[thread overview]
Message-ID: <Zp/e2+NanHRNVfRJ@x1-carbon.lan> (raw)
In-Reply-To: <CAAEEuho08Taw3v2BeCjNDQZ0BRU0oweiLuOuhfrLd7PqAyzSCQ@mail.gmail.com>

Hello Rick,

On Tue, Jul 23, 2024 at 06:06:26PM +0200, Rick Wertenbroek wrote:
> >
> > But like you suggested in the other mail, the right thing is to merge
> > alloc_space() and set_bar() anyway. (Basically instead of where EPF drivers
> > currently call set_bar(), the should call alloc_and_set_bar() (or whatever)
> > instead.)
> >
> 
> Yes, if we merge both, the code will need to be in the EPC code
> (because of the set_bar), and then the pci_epf_alloc_space (if needed)
> would be called internally in the EPC code and not in the endpoint
> function code.
> 
> The only downside, as I said in my other mail, is the very niche case
> where the contents of a BAR should be moved and remain unchanged when
> rebinding a given endpoint function from one controller to another.
> But this is not expected in any endpoint function currently, and with
> the new changes, the endpoint could simply copy the BAR contents to a
> local buffer and then set the contents in the BAR of the new
> controller.
> Anyways, probably no one is moving live functions between controllers,
> and if needed it still can be done, so no problem here...

I think we need to wait for Mani's opinion, but I've never heard of anyone
doing so, and I agree with your suggested feature to copy the BAR contents
in case anyone actually changes the backing EPC controller to an EPF.
(You would need to stop the EPC to unbind + bind anyway, IIRC.)

Converting pci-epf-test to a new alloc_and_set_bar() API/helper which is
done at .epc_init()-time instead of at .bind()-time shouldn't be too hard.

pci-epf-ntb and pci-epf-vntb looks a lot less trivial, but perhaps it is
okay to convert pci-epf-test, and let the other more complex EPF drivers
continue to use the lower-level APIs.


Kind regards,
Niklas

  reply	other threads:[~2024-07-23 16:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-19 11:57 [PATCH 0/2] " Rick Wertenbroek
2024-07-19 11:57 ` [PATCH 1/2] " Rick Wertenbroek
2024-07-23  0:03   ` Damien Le Moal
2024-07-23  7:06     ` Rick Wertenbroek
2024-07-23  7:16       ` Damien Le Moal
2024-07-23  7:41         ` Rick Wertenbroek
2024-07-23 14:05           ` Niklas Cassel
2024-07-23 14:17   ` Niklas Cassel
2024-07-23 16:06     ` Rick Wertenbroek
2024-07-23 16:48       ` Niklas Cassel [this message]
2024-07-25  5:33         ` Manivannan Sadhasivam
2024-07-25  6:30           ` Damien Le Moal
2024-07-25  7:40             ` Manivannan Sadhasivam
2024-07-25  8:13               ` Damien Le Moal
2024-07-25  8:06           ` Rick Wertenbroek
2024-07-25  8:20             ` Damien Le Moal
2024-07-25 14:07               ` Manivannan Sadhasivam
2024-07-25 13:53             ` Manivannan Sadhasivam
2024-07-25 14:17             ` Niklas Cassel
2024-07-25 16:36               ` Manivannan Sadhasivam
2024-07-25 21:52                 ` Niklas Cassel
2024-07-25 22:53                   ` Damien Le Moal
2024-07-26 11:21                     ` Rick Wertenbroek
2024-07-26 13:41                       ` Niklas Cassel
2024-07-29 16:42                         ` Manivannan Sadhasivam
2024-07-19 11:57 ` [PATCH 2/2] PCI: endpoint: pci-epf-test: Add support for controller with fixed addr BARs Rick Wertenbroek

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=Zp/e2+NanHRNVfRJ@x1-carbon.lan \
    --to=cassel@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=alberto.dassatti@heig-vd.ch \
    --cc=bhelgaas@google.com \
    --cc=dlemoal@kernel.org \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=rick.wertenbroek@gmail.com \
    --cc=rick.wertenbroek@heig-vd.ch \
    /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®