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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100121212247.GH17684@ldl.fc.hp.com>
Date:	Thu, 21 Jan 2010 14:22:47 -0700
From:	Alex Chiang <achiang@...com>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Ingo Molnar <mingo@...e.hu>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ivan Kokshaysky <ink@...assic.park.msu.ru>,
	Kenji Kaneshige <kaneshige.kenji@...fujitsu.com>,
	Bjorn Helgaas <bjorn.helgaas@...com>,
	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [PATCH 8/9] pci: pciehp second try to get big range for pcie
	devices

>  void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
>  {
>  	struct pci_bus *parent = bridge->subordinate;
> +	int tried_times = 0;
> +	struct resource_list_x head, *list;
>  	int retval;
> +	unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
> +				  IORESOURCE_PREFETCH;
> +
> +	head.next = NULL;
>  
> +again:
>  	pci_bus_size_bridges(parent);
> -	__pci_bridge_assign_resources(bridge, NULL);
> +	__pci_bridge_assign_resources(bridge, &head);
>  	retval = pci_reenable_device(bridge);
>  	pci_set_master(bridge);
>  	pci_enable_bridges(parent);
> +
> +	tried_times++;
> +
> +	/* any device complain? */

useless comment.

> +	if (!head.next)
> +		return;
> +
> +	if (tried_times  >= 2) {

stray space

> +		/* still fail, don't need to try more */

useless comment

> +		free_failed_list(&head);
> +		return;
> +	}
> +
> +	printk(KERN_DEBUG "PCI: No. %d try to assign unassigned res\n",
> +			 tried_times + 1);
> +
> +	/*
> +	 * Try to release leaf bridge's resources that doesn't fit resource of
> +	 * child device under that bridge
> +	 */
> +	for (list = head.next; list;) {
> +		struct pci_bus *bus = list->dev->bus;
> +		unsigned long flags = list->flags;
> +
> +		pci_bus_release_bridge_resources(bus, flags & type_mask,
> +						 whole_subtree);
> +		list = list->next;
> +	}
> +	/* retore size and flags */

"restore"

/ac

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