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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 18 Aug 2014 23:09:06 +0100
From:	Catalin Marinas <catalin.marinas@....com>
To:	Liviu Dudau <liviu@...au.co.uk>
Cc:	Liviu Dudau <Liviu.Dudau@....com>,
	Wei Yang <weiyang@...ux.vnet.ibm.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Will Deacon <Will.Deacon@....com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Arnd Bergmann <arnd@...db.de>,
	Russell King <linux@....linux.org.uk>,
	Tanmay Inamdar <tinamdar@....com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Sinan Kaya <okaya@...eaurora.org>,
	Jingoo Han <jg1.han@...sung.com>,
	Kukjin Kim <kgene.kim@...sung.com>,
	Suravee Suthikulanit <suravee.suthikulpanit@....com>,
	linux-pci <linux-pci@...r.kernel.org>,
	linux-arch <linux-arch@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Device Tree ML <devicetree@...r.kernel.org>,
	LAKML <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v9 02/12] PCI: OF: Parse and map the IRQ when adding the
 PCI device.

On Mon, Aug 18, 2014 at 10:30:54PM +0100, Liviu Dudau wrote:
> On Mon, Aug 18, 2014 at 03:25:50PM +0100, Catalin Marinas wrote:
> > On Fri, Aug 15, 2014 at 11:30:52AM +0100, Liviu Dudau wrote:
> > > On Fri, Aug 15, 2014 at 09:56:32AM +0100, Wei Yang wrote:
> > > > On Thu, Aug 14, 2014 at 04:49:59PM +0100, Liviu Dudau wrote:
> > > > >On Thu, Aug 14, 2014 at 03:58:04PM +0100, Wei Yang wrote:
> > > > >> On Tue, Aug 12, 2014 at 05:25:15PM +0100, Liviu Dudau wrote:
> > > > >> > int __weak pcibios_add_device(struct pci_dev *dev)
> > > > >> > {
> > > > >> >+	dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
> > > > >> >+
> > > > >> > 	return 0;
> > > > >> > }
> > > > >> 
> > > > >> For this, my suggestion is to add arch dependent function to setup the irq
> > > > >> line for pci devices. I can't find an obvious reason this won't work on other
> > > > >> archs, but maybe this will hurt some of them?
> > > > >
> > > > >I'm not sure I understand your point. Architectures that support OF will obviously
> > > > >benefit from this common approach, and for the other ones the function is empty
> > > > >so it will not change existing behaviour. If you are suggesting that I should
> > > > >create a new API that each architecture could go and implement for setting up the
> > > > >IRQ line then I would agree that it would be nice to have that, but the question
> > > > >is how many architectures are outside OF that need this?
> > > > 
> > > > My suggestion is to define the pcibios_add_device() for arm arch, like the one
> > > > in arch/powerpc/kernel/pci-common.c. If my understanding is correct, this
> > > > patch set address the pci bus setup mostly on arm arch.
> > > 
> > > And also arm64 at the least.
> > ...
> > > Well, it will become necessary as old code gets dismantled and converted towards
> > > this patchset. To give you an example that I'm familiar with, for arch/arm the
> > > host bridge drivers have moved into drivers/pci/host, but they still depend/use
> > > the bios32 infrastructure that takes care of setting up the irq. When they switch
> > > to my version they would have to go and debug the "irq not being assigned" issue
> > > and it is quite likely that some of the people doing the conversion will complain
> > > about my code rather than understanding the issue. What I'm trying to do is to
> > > make switching to my patchset as painless as possible, with a cleanup to remove
> > > redundant operations coming after the switchover.
> > 
> > While the goal is fine, until we see a common pattern for what needs to
> > go into pcibios_add_device() I think we should have an arm64-specific
> > implementation (and probably an arm32 specific one as well). I can see
> > powerpc uses it for setting the DMA ops. Would we have a similar need on
> > arm64 to choose between coherent and non-coherent dma_ops?
> 
> At this point I would like to hear more from people doing the conversion of
> the drivers. I cannot answer fully for all arm or arm64 drivers.

As I read the description of pcibios_add_device(), it is meant as an
architecture hook. While it's nice to generalise this, I'm not sure we
we can find a common denominator. For example, we may want to call
set_dma_ops() as powerpc does but the ops would be arm64 specific (so
even the __weak implementation may not be used by any architecture).

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ