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:	Wed, 20 May 2015 10:31:15 +0100
From:	Catalin Marinas <catalin.marinas@....com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:	linaro-acpi@...ts.linaro.org, will.deacon@....com,
	herbert@...dor.apana.org.au, al.stone@...aro.org,
	linux-acpi@...r.kernel.org, Murali Karicheri <m-karicheri2@...com>,
	msalter@...hat.com, grant.likely@...aro.org, lenb@...nel.org,
	thomas.lendacky@....com, arnd@...db.de,
	linux-crypto@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
	bhelgaas@...gle.com, linux-arm-kernel@...ts.infradead.org,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	leo.duran@....com, hanjun.guo@...aro.org,
	Suravee Suthikulpanit <Suravee.Suthikulpanit@....com>,
	David Woodhouse <dwmw2@...radead.org>, davem@...emloft.net
Subject: Re: [V4 PATCH 3/6] pci: Generic function for setting up PCI device
 DMA coherency

On Wed, May 20, 2015 at 10:24:15AM +0100, Catalin Marinas wrote:
> On Sat, May 16, 2015 at 01:59:00AM +0200, Rafael J. Wysocki wrote:
> > On Friday, May 15, 2015 04:23:11 PM Suravee Suthikulpanit wrote:
> > > +/**
> > > + * pci_dma_configure - Setup DMA configuration
> > > + * @pci_dev: ptr to pci_dev struct of the PCI device
> > > + *
> > > + * Function to update PCI devices's DMA configuration using the same
> > > + * info from the OF node or ACPI node of host bridge's parent (if any).
> > > + */
> > > +static void pci_dma_configure(struct pci_dev *pci_dev)
> > > +{
> > > +	struct device *dev = &pci_dev->dev;
> > > +	struct device *bridge = pci_get_host_bridge_device(pci_dev);
> > > +	struct device *host = bridge->parent;
> > > +	struct acpi_device *adev;
> > > +
> > > +	if (!host)
> > > +		return;
> > > +
> > > +	if (acpi_disabled) {
> > > +		of_dma_configure(dev, host->of_node);
> > 
> > I'd rather do
> > 
> > 	if (IS_ENABLED(CONFIG_OF) && host->of_node) {
> > 		of_dma_configure(dev, host->of_node);
> 
> Nitpick: do we need the CONFIG_OF check? If disabled, I don't think
> anyone would set host->of_node.

Please ignore this, there is no point in checking host->of_node if
CONFIG_OF is disabled (I was just thinking from an arm64 perspective
where we always have CONFIG_OF enabled).

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ