LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] efi/capsule-loader: Don't output reset log when header flags is not set
@ 2018-04-25  3:10 Shunyong Yang
  2018-05-01  9:54 ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Shunyong Yang @ 2018-04-25  3:10 UTC (permalink / raw)
  To: ard.biesheuvel; +Cc: linux-efi, linux-kernel, Shunyong Yang, Joey Zheng

It means firmware attempts to immediately process or launch the capsule
when flags in capsule header is not set. Moreover, reset is not needed
in this case. Current code will output log to indicate reset.

This patch adds a branch to avoid reset log output when the flags is not
set.

Cc: Joey Zheng <yu.zheng@hxt-semitech.com>
Signed-off-by: Shunyong Yang <shunyong.yang@hxt-semitech.com>
---
 drivers/firmware/efi/capsule-loader.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
index e456f4602df1..a63b8e5bde23 100644
--- a/drivers/firmware/efi/capsule-loader.c
+++ b/drivers/firmware/efi/capsule-loader.c
@@ -134,10 +134,15 @@ static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info)
 
 	/* Indicate capsule binary uploading is done */
 	cap_info->index = NO_FURTHER_WRITE_ACTION;
-	pr_info("Successfully upload capsule file with reboot type '%s'\n",
-		!cap_info->reset_type ? "RESET_COLD" :
-		cap_info->reset_type == 1 ? "RESET_WARM" :
-		"RESET_SHUTDOWN");
+
+	if (cap_info->header.flags)
+		pr_info("Successfully upload capsule file with reboot type '%s'\n",
+			!cap_info->reset_type ? "RESET_COLD" :
+			cap_info->reset_type == 1 ? "RESET_WARM" :
+			"RESET_SHUTDOWN");
+	else
+		pr_info("Successfully upload, process and launch capsule file\n");
+
 	return 0;
 }
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] efi/capsule-loader: Don't output reset log when header flags is not set
  2018-04-25  3:10 [PATCH] efi/capsule-loader: Don't output reset log when header flags is not set Shunyong Yang
@ 2018-05-01  9:54 ` Ard Biesheuvel
  2018-05-02  1:29   ` Yang, Shunyong
  0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2018-05-01  9:54 UTC (permalink / raw)
  To: Shunyong Yang; +Cc: linux-efi, Linux Kernel Mailing List, Joey Zheng

On 25 April 2018 at 05:10, Shunyong Yang <shunyong.yang@hxt-semitech.com> wrote:
> It means firmware attempts to immediately process or launch the capsule
> when flags in capsule header is not set. Moreover, reset is not needed
> in this case. Current code will output log to indicate reset.
>
> This patch adds a branch to avoid reset log output when the flags is not
> set.
>
> Cc: Joey Zheng <yu.zheng@hxt-semitech.com>
> Signed-off-by: Shunyong Yang <shunyong.yang@hxt-semitech.com>
> ---
>  drivers/firmware/efi/capsule-loader.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
> index e456f4602df1..a63b8e5bde23 100644
> --- a/drivers/firmware/efi/capsule-loader.c
> +++ b/drivers/firmware/efi/capsule-loader.c
> @@ -134,10 +134,15 @@ static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info)
>
>         /* Indicate capsule binary uploading is done */
>         cap_info->index = NO_FURTHER_WRITE_ACTION;
> -       pr_info("Successfully upload capsule file with reboot type '%s'\n",
> -               !cap_info->reset_type ? "RESET_COLD" :
> -               cap_info->reset_type == 1 ? "RESET_WARM" :
> -               "RESET_SHUTDOWN");
> +
> +       if (cap_info->header.flags)

You should check for the relevant flag bits here, because the 16 lower
bits are platform dependent.

> +               pr_info("Successfully upload capsule file with reboot type '%s'\n",
> +                       !cap_info->reset_type ? "RESET_COLD" :
> +                       cap_info->reset_type == 1 ? "RESET_WARM" :
> +                       "RESET_SHUTDOWN");
> +       else
> +               pr_info("Successfully upload, process and launch capsule file\n");
> +
>         return 0;
>  }
>
> --
> 1.8.3.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] efi/capsule-loader: Don't output reset log when header flags is not set
  2018-05-01  9:54 ` Ard Biesheuvel
@ 2018-05-02  1:29   ` Yang, Shunyong
  2018-05-02  7:19     ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Yang, Shunyong @ 2018-05-02  1:29 UTC (permalink / raw)
  To: ard.biesheuvel; +Cc: linux-efi, linux-kernel, Zheng, Joey

Hi, Ard,

On Tue, 2018-05-01 at 11:54 +0200, Ard Biesheuvel wrote:
> On 25 April 2018 at 05:10, Shunyong Yang <shunyong.yang@hxt-semitech.
> com> wrote:
> > 
> > It means firmware attempts to immediately process or launch the
> > capsule
> > when flags in capsule header is not set. Moreover, reset is not
> > needed
> > in this case. Current code will output log to indicate reset.
> > 
> > This patch adds a branch to avoid reset log output when the flags
> > is not
> > set.
> > 
> > Cc: Joey Zheng <yu.zheng@hxt-semitech.com>
> > Signed-off-by: Shunyong Yang <shunyong.yang@hxt-semitech.com>
> > ---
> >  drivers/firmware/efi/capsule-loader.c | 13 +++++++++----
> >  1 file changed, 9 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/firmware/efi/capsule-loader.c
> > b/drivers/firmware/efi/capsule-loader.c
> > index e456f4602df1..a63b8e5bde23 100644
> > --- a/drivers/firmware/efi/capsule-loader.c
> > +++ b/drivers/firmware/efi/capsule-loader.c
> > @@ -134,10 +134,15 @@ static ssize_t
> > efi_capsule_submit_update(struct capsule_info *cap_info)
> > 
> >         /* Indicate capsule binary uploading is done */
> >         cap_info->index = NO_FURTHER_WRITE_ACTION;
> > -       pr_info("Successfully upload capsule file with reboot type
> > '%s'\n",
> > -               !cap_info->reset_type ? "RESET_COLD" :
> > -               cap_info->reset_type == 1 ? "RESET_WARM" :
> > -               "RESET_SHUTDOWN");
> > +
> > +       if (cap_info->header.flags)
> You should check for the relevant flag bits here, because the 16
> lower
> bits are platform dependent.
In current three bits in flags, CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE and
CAPSULE_FLAGS_INITIATE_RESET are dependent on
CAPSULE_FLAGS_PERSIST_ACROSS_RESET.

So, maybe I only need to check CAPSULE_FLAGS_PERSIST_ACROSS_RESET?

Thanks.
Shunyong.
> 
> > 
> > +               pr_info("Successfully upload capsule file with
> > reboot type '%s'\n",
> > +                       !cap_info->reset_type ? "RESET_COLD" :
> > +                       cap_info->reset_type == 1 ? "RESET_WARM" :
> > +                       "RESET_SHUTDOWN");
> > +       else
> > +               pr_info("Successfully upload, process and launch
> > capsule file\n");
> > +
> >         return 0;
> >  }
> > 
> > --
> > 1.8.3.1
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] efi/capsule-loader: Don't output reset log when header flags is not set
  2018-05-02  1:29   ` Yang, Shunyong
@ 2018-05-02  7:19     ` Ard Biesheuvel
  0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2018-05-02  7:19 UTC (permalink / raw)
  To: Yang, Shunyong; +Cc: linux-efi, linux-kernel, Zheng, Joey

On 2 May 2018 at 03:29, Yang, Shunyong <shunyong.yang@hxt-semitech.com> wrote:
> Hi, Ard,
>
> On Tue, 2018-05-01 at 11:54 +0200, Ard Biesheuvel wrote:
>> On 25 April 2018 at 05:10, Shunyong Yang <shunyong.yang@hxt-semitech.
>> com> wrote:
>> >
>> > It means firmware attempts to immediately process or launch the
>> > capsule
>> > when flags in capsule header is not set. Moreover, reset is not
>> > needed
>> > in this case. Current code will output log to indicate reset.
>> >
>> > This patch adds a branch to avoid reset log output when the flags
>> > is not
>> > set.
>> >
>> > Cc: Joey Zheng <yu.zheng@hxt-semitech.com>
>> > Signed-off-by: Shunyong Yang <shunyong.yang@hxt-semitech.com>
>> > ---
>> >  drivers/firmware/efi/capsule-loader.c | 13 +++++++++----
>> >  1 file changed, 9 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/drivers/firmware/efi/capsule-loader.c
>> > b/drivers/firmware/efi/capsule-loader.c
>> > index e456f4602df1..a63b8e5bde23 100644
>> > --- a/drivers/firmware/efi/capsule-loader.c
>> > +++ b/drivers/firmware/efi/capsule-loader.c
>> > @@ -134,10 +134,15 @@ static ssize_t
>> > efi_capsule_submit_update(struct capsule_info *cap_info)
>> >
>> >         /* Indicate capsule binary uploading is done */
>> >         cap_info->index = NO_FURTHER_WRITE_ACTION;
>> > -       pr_info("Successfully upload capsule file with reboot type
>> > '%s'\n",
>> > -               !cap_info->reset_type ? "RESET_COLD" :
>> > -               cap_info->reset_type == 1 ? "RESET_WARM" :
>> > -               "RESET_SHUTDOWN");
>> > +
>> > +       if (cap_info->header.flags)
>> You should check for the relevant flag bits here, because the 16
>> lower
>> bits are platform dependent.
> In current three bits in flags, CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE and
> CAPSULE_FLAGS_INITIATE_RESET are dependent on
> CAPSULE_FLAGS_PERSIST_ACROSS_RESET.
>
> So, maybe I only need to check CAPSULE_FLAGS_PERSIST_ACROSS_RESET?
>

Yes I think that's fine

>>
>> >
>> > +               pr_info("Successfully upload capsule file with
>> > reboot type '%s'\n",
>> > +                       !cap_info->reset_type ? "RESET_COLD" :
>> > +                       cap_info->reset_type == 1 ? "RESET_WARM" :
>> > +                       "RESET_SHUTDOWN");
>> > +       else
>> > +               pr_info("Successfully upload, process and launch
>> > capsule file\n");
>> > +
>> >         return 0;
>> >  }
>> >
>> > --
>> > 1.8.3.1
>> > --
> To unsubscribe from this list: send the line "unsubscribe linux-efi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-02  7:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25  3:10 [PATCH] efi/capsule-loader: Don't output reset log when header flags is not set Shunyong Yang
2018-05-01  9:54 ` Ard Biesheuvel
2018-05-02  1:29   ` Yang, Shunyong
2018-05-02  7:19     ` Ard Biesheuvel

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