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: <86802c440911041049g592770dqc69b0ce34ea04a10@mail.gmail.com>
Date:	Wed, 4 Nov 2009 10:49:13 -0800
From:	Yinghai Lu <yhlu.kernel@...il.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>,
	jbarnes@...tuousgeek.org
Cc:	Bjorn Helgaas <bjorn.helgaas@...com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] resources: when allocate_resource() fails, leave resource 
	untouched

On Wed, Nov 4, 2009 at 10:29 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
>
> On Wed, 4 Nov 2009, Jesse Barnes wrote:
>>
>> Seems like a reasonable change to me.  Linus is usually the gatekeeper
>> for resource.c.
>
> I'm certainly ok with this one. I wouldn't be surprised if it even allows
> for better code generation, apart from leaving resources untouched when
> allocation fails. So:
>
>        Acked-by: Linus Torvalds <torvalds@...ux-foundation.org>
>
> It was apparently sent to Andrew, but I can certainly take it. Or you can
> take it into the PCI tree. Or we can leave it in -mm. Anything goes. Just
> tell me.
>

looks should be put into pci tree.

two of patches that is releasing not big enough range from leaf bridge
could be user.

don't need the "save and restore" trick anymore.

YH

@@ -57,10 +100,23 @@ static void pbus_assign_resources_sorted
        for (list = head.next; list;) {
                res = list->res;
                idx = res - &list->dev->resource[0];
+               /* save the size at first */
+               size = resource_size(res);
                if (pci_assign_resource(list->dev, idx)) {
-                       res->start = 0;
-                       res->end = 0;
-                       res->flags = 0;
+                       if (fail_head && !list->dev->subordinate &&
+                           !pci_is_root_bus(list->dev->bus)) {
+                               /*
+                                * device need to keep flags and size
+                                * for second try
+                                */
+                               res->start = 0;
+                               res->end   = size - 1;
+                               add_to_failed_list(fail_head, list->dev, res);
+                       } else {
+                               res->start = 0;
+                               res->end = 0;
+                               res->flags = 0;
+                       }
                }
                tmp = list;
                list = list->next;
--
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