linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sam Bobroff <sam.bobroff@au1.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/powernv: Check image loaded or not before calling flash
Date: Fri, 13 Feb 2015 13:46:02 +1100	[thread overview]
Message-ID: <54DD656A.4020608@au1.ibm.com> (raw)
In-Reply-To: <1423776439.5965.65.camel@au1.ibm.com>

On 13/02/15 08:27, Benjamin Herrenschmidt wrote:
> On Thu, 2015-02-12 at 15:23 +0530, Vasant Hegde wrote:
>> Present code checks for update_flash_data in opal_flash_term_callback().
>> update_flash_data has been statically initialized to zero, and that
>> is the value of FLASH_IMG_READY. Also code update initialization happens
>> during subsys init.
> 
> Please statically initialize it to a sane value instead.

I've tested this patch and it works for me (the message is suppressed)
but I agree with Ben that it seems cleaner to use a static initializer.

>> So if reboot is issued before the subsys init stage then we endup displaying
>> "Flashing new firmware" message.. which may confuse end user.
>>
>> This patch adds additional validation to make sure image is actually loaded
>> or not.
>>
>> Reported-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
>> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
>> ---
>>  arch/powerpc/platforms/powernv/opal-flash.c |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
>> index 5c21d9c..5455cd4 100644
>> --- a/arch/powerpc/platforms/powernv/opal-flash.c
>> +++ b/arch/powerpc/platforms/powernv/opal-flash.c
>> @@ -319,7 +319,8 @@ void opal_flash_term_callback(void)
>>  {
>>  	struct cpumask mask;
>>  
>> -	if (update_flash_data.status != FLASH_IMG_READY)
>> +	if (update_flash_data.status != FLASH_IMG_READY ||
>> +	    image_data.status != IMAGE_READY)
>>  		return;
>>  
>>  	pr_alert("FLASH: Flashing new firmware\n");
> 
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
> 

  reply	other threads:[~2015-02-13  2:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  9:53 [PATCH] powerpc/powernv: Check image loaded or not before calling flash Vasant Hegde
2015-02-12 21:27 ` Benjamin Herrenschmidt
2015-02-13  2:46   ` Sam Bobroff [this message]
2015-02-13  5:53     ` Vasant Hegde
2015-02-13  5:52   ` Vasant Hegde
2015-02-13  9:48 ` Vasant Hegde
2015-02-13  9:56 ` [PATCH v2] " Vasant Hegde

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=54DD656A.4020608@au1.ibm.com \
    --to=sam.bobroff@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.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).