lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 9 Sep 2022 12:20:19 +0200
From:   Lorenzo Pieralisi <lpieralisi@...nel.org>
To:     Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Cc:     Kishon Vijay Abraham I <kishon@...com>, bhelgaas@...gle.com,
        kw@...ux.com, robh@...nel.org, vidyas@...dia.com,
        linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] PCI: endpoint: Use link_up() callback in place of
 LINK_UP notifier

On Wed, Aug 31, 2022 at 01:50:25PM +0530, Manivannan Sadhasivam wrote:
> On Thu, Aug 25, 2022 at 03:47:10PM +0530, Kishon Vijay Abraham I wrote:
> > Hi Mani,
> > 
> > On 11/08/22 15:12, Manivannan Sadhasivam wrote:
> > > As a part of the transition towards callback mechanism for signalling the
> > > events from EPC to EPF, let's use the link_up() callback in the place of
> > > the LINK_UP notifier. This also removes the notifier support completely
> > > from the PCI endpoint framework.
> > > 
> > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> > > ---
> > >  drivers/pci/endpoint/functions/pci-epf-test.c | 33 ++++++-------------
> > >  drivers/pci/endpoint/pci-epc-core.c           |  8 +++--
> > >  include/linux/pci-epc.h                       |  8 -----
> > >  include/linux/pci-epf.h                       |  8 ++---
> > >  4 files changed, 18 insertions(+), 39 deletions(-)
> > > 
> > 
> > .
> > .
> > <snip>
> > .
> > .
> > > diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
> > > index 805f3d64f93b..a51ba9f158c3 100644
> > > --- a/drivers/pci/endpoint/pci-epc-core.c
> > > +++ b/drivers/pci/endpoint/pci-epc-core.c
> > > @@ -690,10 +690,15 @@ EXPORT_SYMBOL_GPL(pci_epc_remove_epf);
> > >   */
> > >  void pci_epc_linkup(struct pci_epc *epc)
> > >  {
> > > +	struct pci_epf *epf;
> > > +
> > >  	if (!epc || IS_ERR(epc))
> > >  		return;
> > >  
> > > -	atomic_notifier_call_chain(&epc->notifier, LINK_UP, NULL);
> > > +	list_for_each_entry(epf, &epc->pci_epf, list) {
> > > +		if (epf->event_ops->link_up)
> > > +			epf->event_ops->link_up(epf);
> > > +	}
> > 
> > how do you ensure there is no race while invoking the call back
> > functions during add/remove of epf?
> > 
> 
> Good catch! These should be guarded by epf->lock.

I shall wait for v2 then and mark this one as "Changes requested".

Lorenzo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ