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]
Message-ID: <7748275.Tf0dzsPZdA@wuerfel>
Date:	Mon, 19 Jan 2015 09:44:31 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	linux-arm-kernel@...ts.infradead.org
Cc:	Yijing Wang <wangyijing@...wei.com>,
	Liviu Dudau <liviu@...au.co.uk>,
	Tony Luck <tony.luck@...el.com>,
	Russell King <linux@....linux.org.uk>,
	Marc Zyngier <marc.zyngier@....com>, linux-pci@...r.kernel.org,
	x86@...nel.org, linux-kernel@...r.kernel.org,
	"David S. Miller" <davem@...emloft.net>,
	linux-m68k@...ts.linux-m68k.org,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	linux-alpha@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>,
	linux-ia64@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Guan Xuetao <gxt@...c.pku.edu.cn>,
	Yinghai Lu <yinghai@...nel.org>,
	Jiang Liu <jiang.liu@...ux.intel.com>
Subject: Re: [PATCH 18/28] PCI/sparc: Use pci_scan_root_bridge() for simplicity

On Monday 19 January 2015 11:17:02 Yijing Wang wrote:
> On 2015/1/16 18:01, Arnd Bergmann wrote:
> > On Friday 16 January 2015 09:44:16 Yijing Wang wrote:
> >> +static void pci_host_bridge_probe_mode(
> >> +               struct pci_host_bridge *host)
> >> +{
> >> +       host->of_scan = true;
> >> +}
> >>
> > 
> > I probably missed something here, but where does host->of_scan
> > get used?
> > 
> 
> It is used in __pci_scan_root_bus() to detect whether of scan bus is needed in patch 11.

Ok, I see it now.

> @@ -2051,10 +2053,17 @@ static struct pci_bus *__pci_scan_root_bus(
>  		pci_bus_insert_busn_res(b, host->busnum, 255);
>  	}
> 
> -	max = pci_scan_child_bus(b);
> +	if (host->ops && host->ops->phb_probe_mode)
> +		host->ops->phb_probe_mode(host);
> 
> -	if (!found)
> -		pci_bus_update_busn_res_end(b, max);
> +	if (host->of_scan) {
> +		if (host->ops &&host->ops->phb_of_scan_bus)
> +			host->ops->phb_of_scan_bus(host);
> +	} else {
> +		max = pci_scan_child_bus(b);
> +		if (!found)
> +			pci_bus_update_busn_res_end(b, max);
> +	}
> 

I think we can simplify this based on the knowledge that this code
will remain powerpc specific. How about removing the phb_probe_mode()
callback and replacing it with just a phb_scan_bus() callback that
will always get set on sparc, and do this on powerpc:

+static void pci_host_bridge_of_scan_bus(struct pci_host_bridge *host)
+{
+       int mode = PCI_PROBE_NORMAL;
+       struct pci_bus *bus = host->bus;
+       struct pci_controller *hose = dev_get_drvdata(&host->dev);
+
+       /* Get probe mode and perform scan */
+       if (hose->dn && ppc_md.pci_probe_mode)
+               mode = ppc_md.pci_probe_mode(bus);
+
+       pr_debug("    probe mode: %d\n", mode);
+       if (mode == PCI_PROBE_DEVTREE) {
+               of_scan_bus(host->dn, bus);
+		return max; // XXX need to get this from somewhere
+	}
+	return pci_scan_child_bus(b);
+}

Would that work?

	Arnd
--
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