xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH] ACPI/APEI: Unlock apei_iomaps_lock on error path
Date: Fri, 22 Mar 2013 08:20:37 +0000	[thread overview]
Message-ID: <CD71C4D5.4E78F%keir.xen@gmail.com> (raw)
In-Reply-To: <514C214C02000078000C7AAB@nat28.tlf.novell.com>

On 22/03/2013 08:15, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 22.03.13 at 00:19, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> This causes deadlocks during early boot on hardware with broken/buggy APEI
>> implementations, such as a Dell Poweredge 2950 with the latest currently
>> available BIOS.
>> 
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> 
>> diff -r 7babbd46586b -r 6a952c14c4dc xen/drivers/acpi/apei/apei-io.c
>> --- a/xen/drivers/acpi/apei/apei-io.c
>> +++ b/xen/drivers/acpi/apei/apei-io.c
>> @@ -147,12 +147,15 @@ static void __init apei_post_unmap(paddr
>> spin_lock_irqsave(&apei_iomaps_lock, flags);
>> map = __apei_find_iomap(paddr, size);
>> if (!map)
>> -  return;
>> +  goto err;
>>  
>> list_del(&map->list);
>> spin_unlock_irqrestore(&apei_iomaps_lock, flags);
>>  
>> xfree(map);
>> + return;
>> +err:
>> + spin_unlock_irqrestore(&apei_iomaps_lock, flags);
>>  }
>>  
>>  /* In NMI handler, should set silent = 1 */
> 
> I'd prefer doing this slightly differently:

In this case, agreed.

 -- Keir

> --- a/xen/drivers/acpi/apei/apei-io.c
> +++ b/xen/drivers/acpi/apei/apei-io.c
> @@ -146,10 +146,8 @@ static void __init apei_post_unmap(paddr
>  
> spin_lock_irqsave(&apei_iomaps_lock, flags);
> map = __apei_find_iomap(paddr, size);
> - if (!map)
> -  return;
> -
> - list_del(&map->list);
> + if (map)
> +  list_del(&map->list);
> spin_unlock_irqrestore(&apei_iomaps_lock, flags);
>  
> xfree(map);
> 
> Jan
> 

      reply	other threads:[~2013-03-22  8:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 23:19 [PATCH] ACPI/APEI: Unlock apei_iomaps_lock on error path Andrew Cooper
2013-03-22  8:15 ` Jan Beulich
2013-03-22  8:20   ` Keir Fraser [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CD71C4D5.4E78F%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).