diff mbox series

Add umount flag for archive handler

Message ID 20221109124658.253373-1-ayoub.zaki@embetrix.com
State Rejected
Headers show
Series Add umount flag for archive handler | expand

Commit Message

Ayoub Zaki Nov. 9, 2022, 12:46 p.m. UTC
add new flag to control if path should be umounted
this is only useful if the mount point specified by path is already
mounted outside of swupdate.

Signed-off-by: Ayoub Zaki <ayoub.zaki@embetrix.com>
---
 doc/source/sw-description.rst | 6 ++++++
 handlers/archive_handler.c    | 8 ++++++++
 include/swupdate.h            | 1 +
 parser/parser.c               | 1 +
 4 files changed, 16 insertions(+)

Comments

Stefano Babic Nov. 9, 2022, 1:09 p.m. UTC | #1
Hi Ayoub,

On 09.11.22 13:46, Ayoub Zaki wrote:
> add new flag to control if path should be umounted
> this is only useful if the mount point specified by path is already
> mounted outside of swupdate.
> 

I see the issue but this is really more a bug than a requested feature. 
SWUpdate is already able to do this: if the attribute "filesystem" is 
set, SWUpdate will mount the filesystem and umount at the end. If 
filesystem is missing, SWUpdate does not try to mount it. However, it 
runs umount at the end, and this is not correct. SWUpdate should umount 
if it has mounted before.

IMHO it is enough to make the choice to umount the filesystem on depend 
if mount was requested or not:

Instead of:

  376         if (is_mounted) {

--- a/handlers/archive_handler.c
+++ b/handlers/archive_handler.c
@@ -373,7 +373,7 @@ out:
         if (FIFO)
                 unlink(FIFO);

-       if (is_mounted) {
+       if (use_mount && is_mounted) {
                 ret = swupdate_umount(DATADST_DIR);
                 if (ret) {
                         TRACE("Failed to unmount directory %s", 
DATADST_DIR);

Best regards,
Stefano Babic

> Signed-off-by: Ayoub Zaki <ayoub.zaki@embetrix.com>
> ---
>   doc/source/sw-description.rst | 6 ++++++
>   handlers/archive_handler.c    | 8 ++++++++
>   include/swupdate.h            | 1 +
>   parser/parser.c               | 1 +
>   4 files changed, 16 insertions(+)
> 
> diff --git a/doc/source/sw-description.rst b/doc/source/sw-description.rst
> index a5182d6..13bba2e 100644
> --- a/doc/source/sw-description.rst
> +++ b/doc/source/sw-description.rst
> @@ -1319,6 +1319,12 @@ There are 4 main sections inside sw-description:
>      |             |          |            | "filesystem" type. (path is always    |
>      |             |          |            | relative to the mount point.)         |
>      +-------------+----------+------------+---------------------------------------+
> +   | umount      | bool     | files      | flag to control whether the given     |
> +   |             |          |            | mount point specified by path         |
> +   |             |          |            | (absolute) where the files are        |
> +   |             |          |            | are installed if already mounted      |
> +   |             |          |            | outside SWUpdate should be umounted   |
> +   +-------------+----------+------------+---------------------------------------+
>      | preserve-\  | bool     | files      | flag to control whether the following |
>      | attributes  |          |            | attributes will be preserved when     |
>      |             |          |            | files are unpacked from an archive    |
> diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c
> index e3a1463..553287f 100644
> --- a/handlers/archive_handler.c
> +++ b/handlers/archive_handler.c
> @@ -228,6 +228,7 @@ static int install_archive_image(struct img_type *img,
>   	struct extract_data tf;
>   	pthread_attr_t attr;
>   	int use_mount = (strlen(img->device) && strlen(img->filesystem)) ? 1 : 0;
> +	int use_umount = img->umount;
>   	int is_mounted = 0;
>   	int exitval = -EFAULT;
>   	char *DATADST_DIR = NULL;
> @@ -380,6 +381,13 @@ out:
>   		}
>   	}
>   
> +	if (use_umount && !use_mount) {
> +		ret = swupdate_umount(img->path);
> +		if (ret) {
> +			TRACE("Failed to unmount directory %s", img->path);
> +		}
> +	}
> +
>   	free(DATADST_DIR);
>   	free(FIFO);
>   
> diff --git a/include/swupdate.h b/include/swupdate.h
> index 4cce892..89f64ea 100644
> --- a/include/swupdate.h
> +++ b/include/swupdate.h
> @@ -81,6 +81,7 @@ struct img_type {
>   	int provided;
>   	int compressed;
>   	int preserve_attributes; /* whether to preserve attributes in archives */
> +	bool umount;
>   	bool is_encrypted;
>   	char ivt_ascii[33];
>   	int install_directly;
> diff --git a/parser/parser.c b/parser/parser.c
> index 5607031..81f69be 100644
> --- a/parser/parser.c
> +++ b/parser/parser.c
> @@ -436,6 +436,7 @@ static int parse_common_attributes(parsertype p, void *elem, struct img_type *im
>   	}
>   	get_field(p, elem, "installed-directly", &image->install_directly);
>   	get_field(p, elem, "preserve-attributes", &image->preserve_attributes);
> +	get_field(p, elem, "umount", &image->umount);
>   	get_field(p, elem, "install-if-different", &image->id.install_if_different);
>   	get_field(p, elem, "install-if-higher", &image->id.install_if_higher);
>   	get_field(p, elem, "encrypted", &image->is_encrypted);
ayoub...@googlemail.com Nov. 9, 2022, 1:41 p.m. UTC | #2
Hi Stefano,

Thanks for the feedback but I have a specific use case where this is 
needed: 

I have an encrypted ubifs mounted outside swupdate under a fixed path 
/var/update, the file system update is provided as tar file to be unpacked 
under /var/update, the FS encryption is handled by fscrypt.
I prefer that swupdate doesn't perform the mount because it's a bit tidy : 
secure storage interface, kernel keyring, fscrypt and so on...

before running the ubifs volumes swap in swupdate type = "ubiswap" the 
/var/update partition need to be umounted otherwise the kernel crashes.

this specific scenario is not handled by swupdate and can be fixed by using 
the new flag : umount=true in the archive handler.

Best,
Ayoub




On Wednesday, November 9, 2022 at 2:09:58 PM UTC+1 Stefano Babic wrote:

> Hi Ayoub,
>
> On 09.11.22 13:46, Ayoub Zaki wrote:
> > add new flag to control if path should be umounted
> > this is only useful if the mount point specified by path is already
> > mounted outside of swupdate.
> > 
>
> I see the issue but this is really more a bug than a requested feature. 
> SWUpdate is already able to do this: if the attribute "filesystem" is 
> set, SWUpdate will mount the filesystem and umount at the end. If 
> filesystem is missing, SWUpdate does not try to mount it. However, it 
> runs umount at the end, and this is not correct. SWUpdate should umount 
> if it has mounted before.
>
> IMHO it is enough to make the choice to umount the filesystem on depend 
> if mount was requested or not:
>
> Instead of:
>
> 376 if (is_mounted) {
>
> --- a/handlers/archive_handler.c
> +++ b/handlers/archive_handler.c
> @@ -373,7 +373,7 @@ out:
> if (FIFO)
> unlink(FIFO);
>
> - if (is_mounted) {
> + if (use_mount && is_mounted) {
> ret = swupdate_umount(DATADST_DIR);
> if (ret) {
> TRACE("Failed to unmount directory %s", 
> DATADST_DIR);
>
> Best regards,
> Stefano Babic
>
> > Signed-off-by: Ayoub Zaki <ayoub...@embetrix.com>
> > ---
> > doc/source/sw-description.rst | 6 ++++++
> > handlers/archive_handler.c | 8 ++++++++
> > include/swupdate.h | 1 +
> > parser/parser.c | 1 +
> > 4 files changed, 16 insertions(+)
> > 
> > diff --git a/doc/source/sw-description.rst 
> b/doc/source/sw-description.rst
> > index a5182d6..13bba2e 100644
> > --- a/doc/source/sw-description.rst
> > +++ b/doc/source/sw-description.rst
> > @@ -1319,6 +1319,12 @@ There are 4 main sections inside sw-description:
> > | | | | "filesystem" type. (path is always |
> > | | | | relative to the mount point.) |
> > 
> +-------------+----------+------------+---------------------------------------+
> > + | umount | bool | files | flag to control whether the given |
> > + | | | | mount point specified by path |
> > + | | | | (absolute) where the files are |
> > + | | | | are installed if already mounted |
> > + | | | | outside SWUpdate should be umounted |
> > + 
> +-------------+----------+------------+---------------------------------------+
> > | preserve-\ | bool | files | flag to control whether the following |
> > | attributes | | | attributes will be preserved when |
> > | | | | files are unpacked from an archive |
> > diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c
> > index e3a1463..553287f 100644
> > --- a/handlers/archive_handler.c
> > +++ b/handlers/archive_handler.c
> > @@ -228,6 +228,7 @@ static int install_archive_image(struct img_type 
> *img,
> > struct extract_data tf;
> > pthread_attr_t attr;
> > int use_mount = (strlen(img->device) && strlen(img->filesystem)) ? 1 : 0;
> > + int use_umount = img->umount;
> > int is_mounted = 0;
> > int exitval = -EFAULT;
> > char *DATADST_DIR = NULL;
> > @@ -380,6 +381,13 @@ out:
> > }
> > }
> > 
> > + if (use_umount && !use_mount) {
> > + ret = swupdate_umount(img->path);
> > + if (ret) {
> > + TRACE("Failed to unmount directory %s", img->path);
> > + }
> > + }
> > +
> > free(DATADST_DIR);
> > free(FIFO);
> > 
> > diff --git a/include/swupdate.h b/include/swupdate.h
> > index 4cce892..89f64ea 100644
> > --- a/include/swupdate.h
> > +++ b/include/swupdate.h
> > @@ -81,6 +81,7 @@ struct img_type {
> > int provided;
> > int compressed;
> > int preserve_attributes; /* whether to preserve attributes in archives */
> > + bool umount;
> > bool is_encrypted;
> > char ivt_ascii[33];
> > int install_directly;
> > diff --git a/parser/parser.c b/parser/parser.c
> > index 5607031..81f69be 100644
> > --- a/parser/parser.c
> > +++ b/parser/parser.c
> > @@ -436,6 +436,7 @@ static int parse_common_attributes(parsertype p, 
> void *elem, struct img_type *im
> > }
> > get_field(p, elem, "installed-directly", &image->install_directly);
> > get_field(p, elem, "preserve-attributes", &image->preserve_attributes);
> > + get_field(p, elem, "umount", &image->umount);
> > get_field(p, elem, "install-if-different", 
> &image->id.install_if_different);
> > get_field(p, elem, "install-if-higher", &image->id.install_if_higher);
> > get_field(p, elem, "encrypted", &image->is_encrypted);
>
> -- 
> =====================================================================
> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 <+49%208142%206698953> Fax: +49-8142-66989-80 
> <+49%208142%206698980> Email: sba...@denx.de
> =====================================================================
>
>
ayoub...@googlemail.com Nov. 9, 2022, 1:59 p.m. UTC | #3
Hi Stefano,

I think archive handler needs also a new option/flag to wipe out the path 
before unpacking the archive if specified.

best
On Wednesday, November 9, 2022 at 2:41:22 PM UTC+1 ayoub...@googlemail.com 
wrote:

> Hi Stefano,
>
> Thanks for the feedback but I have a specific use case where this is 
> needed: 
>
> I have an encrypted ubifs mounted outside swupdate under a fixed path 
> /var/update, the file system update is provided as tar file to be unpacked 
> under /var/update, the FS encryption is handled by fscrypt.
> I prefer that swupdate doesn't perform the mount because it's a bit tidy : 
> secure storage interface, kernel keyring, fscrypt and so on...
>
> before running the ubifs volumes swap in swupdate type = "ubiswap" the 
> /var/update partition need to be umounted otherwise the kernel crashes.
>
> this specific scenario is not handled by swupdate and can be fixed by 
> using the new flag : umount=true in the archive handler.
>
> Best,
> Ayoub
>
>
>
>
> On Wednesday, November 9, 2022 at 2:09:58 PM UTC+1 Stefano Babic wrote:
>
>> Hi Ayoub, 
>>
>> On 09.11.22 13:46, Ayoub Zaki wrote: 
>> > add new flag to control if path should be umounted 
>> > this is only useful if the mount point specified by path is already 
>> > mounted outside of swupdate. 
>> > 
>>
>> I see the issue but this is really more a bug than a requested feature. 
>> SWUpdate is already able to do this: if the attribute "filesystem" is 
>> set, SWUpdate will mount the filesystem and umount at the end. If 
>> filesystem is missing, SWUpdate does not try to mount it. However, it 
>> runs umount at the end, and this is not correct. SWUpdate should umount 
>> if it has mounted before. 
>>
>> IMHO it is enough to make the choice to umount the filesystem on depend 
>> if mount was requested or not: 
>>
>> Instead of: 
>>
>> 376 if (is_mounted) { 
>>
>> --- a/handlers/archive_handler.c 
>> +++ b/handlers/archive_handler.c 
>> @@ -373,7 +373,7 @@ out: 
>> if (FIFO) 
>> unlink(FIFO); 
>>
>> - if (is_mounted) { 
>> + if (use_mount && is_mounted) { 
>> ret = swupdate_umount(DATADST_DIR); 
>> if (ret) { 
>> TRACE("Failed to unmount directory %s", 
>> DATADST_DIR); 
>>
>> Best regards, 
>> Stefano Babic 
>>
>> > Signed-off-by: Ayoub Zaki <ayoub...@embetrix.com> 
>> > --- 
>> > doc/source/sw-description.rst | 6 ++++++ 
>> > handlers/archive_handler.c | 8 ++++++++ 
>> > include/swupdate.h | 1 + 
>> > parser/parser.c | 1 + 
>> > 4 files changed, 16 insertions(+) 
>> > 
>> > diff --git a/doc/source/sw-description.rst 
>> b/doc/source/sw-description.rst 
>> > index a5182d6..13bba2e 100644 
>> > --- a/doc/source/sw-description.rst 
>> > +++ b/doc/source/sw-description.rst 
>> > @@ -1319,6 +1319,12 @@ There are 4 main sections inside sw-description: 
>> > | | | | "filesystem" type. (path is always | 
>> > | | | | relative to the mount point.) | 
>> > 
>> +-------------+----------+------------+---------------------------------------+ 
>>
>> > + | umount | bool | files | flag to control whether the given | 
>> > + | | | | mount point specified by path | 
>> > + | | | | (absolute) where the files are | 
>> > + | | | | are installed if already mounted | 
>> > + | | | | outside SWUpdate should be umounted | 
>> > + 
>> +-------------+----------+------------+---------------------------------------+ 
>>
>> > | preserve-\ | bool | files | flag to control whether the following | 
>> > | attributes | | | attributes will be preserved when | 
>> > | | | | files are unpacked from an archive | 
>> > diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c 
>> > index e3a1463..553287f 100644 
>> > --- a/handlers/archive_handler.c 
>> > +++ b/handlers/archive_handler.c 
>> > @@ -228,6 +228,7 @@ static int install_archive_image(struct img_type 
>> *img, 
>> > struct extract_data tf; 
>> > pthread_attr_t attr; 
>> > int use_mount = (strlen(img->device) && strlen(img->filesystem)) ? 1 : 
>> 0; 
>> > + int use_umount = img->umount; 
>> > int is_mounted = 0; 
>> > int exitval = -EFAULT; 
>> > char *DATADST_DIR = NULL; 
>> > @@ -380,6 +381,13 @@ out: 
>> > } 
>> > } 
>> > 
>> > + if (use_umount && !use_mount) { 
>> > + ret = swupdate_umount(img->path); 
>> > + if (ret) { 
>> > + TRACE("Failed to unmount directory %s", img->path); 
>> > + } 
>> > + } 
>> > + 
>> > free(DATADST_DIR); 
>> > free(FIFO); 
>> > 
>> > diff --git a/include/swupdate.h b/include/swupdate.h 
>> > index 4cce892..89f64ea 100644 
>> > --- a/include/swupdate.h 
>> > +++ b/include/swupdate.h 
>> > @@ -81,6 +81,7 @@ struct img_type { 
>> > int provided; 
>> > int compressed; 
>> > int preserve_attributes; /* whether to preserve attributes in archives 
>> */ 
>> > + bool umount; 
>> > bool is_encrypted; 
>> > char ivt_ascii[33]; 
>> > int install_directly; 
>> > diff --git a/parser/parser.c b/parser/parser.c 
>> > index 5607031..81f69be 100644 
>> > --- a/parser/parser.c 
>> > +++ b/parser/parser.c 
>> > @@ -436,6 +436,7 @@ static int parse_common_attributes(parsertype p, 
>> void *elem, struct img_type *im 
>> > } 
>> > get_field(p, elem, "installed-directly", &image->install_directly); 
>> > get_field(p, elem, "preserve-attributes", &image->preserve_attributes); 
>> > + get_field(p, elem, "umount", &image->umount); 
>> > get_field(p, elem, "install-if-different", 
>> &image->id.install_if_different); 
>> > get_field(p, elem, "install-if-higher", &image->id.install_if_higher); 
>> > get_field(p, elem, "encrypted", &image->is_encrypted); 
>>
>> -- 
>> ===================================================================== 
>> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
>> HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany 
>> Phone: +49-8142-66989-53 <+49%208142%206698953> Fax: +49-8142-66989-80 
>> <+49%208142%206698980> Email: sba...@denx.de 
>> ===================================================================== 
>>
>>
Stefano Babic Nov. 9, 2022, 2:34 p.m. UTC | #4
Hi Ayoub,

On 09.11.22 14:41, 'ayoub...@googlemail.com' via swupdate wrote:
> Hi Stefano,
> 
> Thanks for the feedback but I have a specific use case where this is 
> needed:
> 
> I have an encrypted ubifs mounted outside swupdate under a fixed path 
> /var/update, the file system update is provided as tar file to be 
> unpacked under /var/update, the FS encryption is handled by fscrypt.
> I prefer that swupdate doesn't perform the mount because it's a bit 
> tidy : secure storage interface, kernel keyring, fscrypt and so on...
> 

Yes: it makes sense that filesystem is mounted outside SWUpdate, better 
in a ramdisk before booting.

> before running the ubifs volumes swap in swupdate type = "ubiswap" the 
> /var/update partition need to be umounted otherwise the kernel crashes.
> 

Ok - however, this looks an issue in kernel, and we want to work-around 
it in SWUpdate. The other way for you is to not use "ubiswap", and 
instead of it let toggle via U-Boot variables, setting 
CONFIG_ENV_FLAGS_LIST_STATIC in U-Boot to enable only the variables you 
need (or just one).

Have you already reported this to MTD list and to Richard (Weinberger) ?

> this specific scenario is not handled by swupdate and can be fixed by 
> using the new flag : umount=true in the archive handler.

Ok - I do not want to block it, but it will be nice to check options. In 
SWUpdate, I will suggest this behavior:

- automatic umount should be done only if requested (as I said, I find 
the current behavior buggy)
- the umount flag is also added and takes place to umount it, that is 
the rule should be

if ((use_mount && is_mounted) || use_umount)

- the flag is specific for the archive handler, so I would move it to 
properties, that is you enable it as:

	type = "archive";
	properties: {
		umount = "true";
	}

Then your your use case is covered by SWUpdate, but I will appreciate to 
discuss this with MTD developers, too.

Best regards,
Stefano

> 
> Best,
> Ayoub
> 
> 
> 
> 
> On Wednesday, November 9, 2022 at 2:09:58 PM UTC+1 Stefano Babic wrote:
> 
>     Hi Ayoub,
> 
>     On 09.11.22 13:46, Ayoub Zaki wrote:
>      > add new flag to control if path should be umounted
>      > this is only useful if the mount point specified by path is already
>      > mounted outside of swupdate.
>      >
> 
>     I see the issue but this is really more a bug than a requested feature.
>     SWUpdate is already able to do this: if the attribute "filesystem" is
>     set, SWUpdate will mount the filesystem and umount at the end. If
>     filesystem is missing, SWUpdate does not try to mount it. However, it
>     runs umount at the end, and this is not correct. SWUpdate should umount
>     if it has mounted before.
> 
>     IMHO it is enough to make the choice to umount the filesystem on depend
>     if mount was requested or not:
> 
>     Instead of:
> 
>     376 if (is_mounted) {
> 
>     --- a/handlers/archive_handler.c
>     +++ b/handlers/archive_handler.c
>     @@ -373,7 +373,7 @@ out:
>     if (FIFO)
>     unlink(FIFO);
> 
>     - if (is_mounted) {
>     + if (use_mount && is_mounted) {
>     ret = swupdate_umount(DATADST_DIR);
>     if (ret) {
>     TRACE("Failed to unmount directory %s",
>     DATADST_DIR);
> 
>     Best regards,
>     Stefano Babic
> 
>      > Signed-off-by: Ayoub Zaki <ayoub...@embetrix.com>
>      > ---
>      > doc/source/sw-description.rst | 6 ++++++
>      > handlers/archive_handler.c | 8 ++++++++
>      > include/swupdate.h | 1 +
>      > parser/parser.c | 1 +
>      > 4 files changed, 16 insertions(+)
>      >
>      > diff --git a/doc/source/sw-description.rst
>     b/doc/source/sw-description.rst
>      > index a5182d6..13bba2e 100644
>      > --- a/doc/source/sw-description.rst
>      > +++ b/doc/source/sw-description.rst
>      > @@ -1319,6 +1319,12 @@ There are 4 main sections inside
>     sw-description:
>      > | | | | "filesystem" type. (path is always |
>      > | | | | relative to the mount point.) |
>      >
>     +-------------+----------+------------+---------------------------------------+
>      > + | umount | bool | files | flag to control whether the given |
>      > + | | | | mount point specified by path |
>      > + | | | | (absolute) where the files are |
>      > + | | | | are installed if already mounted |
>      > + | | | | outside SWUpdate should be umounted |
>      > +
>     +-------------+----------+------------+---------------------------------------+
>      > | preserve-\ | bool | files | flag to control whether the
>     following |
>      > | attributes | | | attributes will be preserved when |
>      > | | | | files are unpacked from an archive |
>      > diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c
>      > index e3a1463..553287f 100644
>      > --- a/handlers/archive_handler.c
>      > +++ b/handlers/archive_handler.c
>      > @@ -228,6 +228,7 @@ static int install_archive_image(struct
>     img_type *img,
>      > struct extract_data tf;
>      > pthread_attr_t attr;
>      > int use_mount = (strlen(img->device) && strlen(img->filesystem))
>     ? 1 : 0;
>      > + int use_umount = img->umount;
>      > int is_mounted = 0;
>      > int exitval = -EFAULT;
>      > char *DATADST_DIR = NULL;
>      > @@ -380,6 +381,13 @@ out:
>      > }
>      > }
>      >
>      > + if (use_umount && !use_mount) {
>      > + ret = swupdate_umount(img->path);
>      > + if (ret) {
>      > + TRACE("Failed to unmount directory %s", img->path);
>      > + }
>      > + }
>      > +
>      > free(DATADST_DIR);
>      > free(FIFO);
>      >
>      > diff --git a/include/swupdate.h b/include/swupdate.h
>      > index 4cce892..89f64ea 100644
>      > --- a/include/swupdate.h
>      > +++ b/include/swupdate.h
>      > @@ -81,6 +81,7 @@ struct img_type {
>      > int provided;
>      > int compressed;
>      > int preserve_attributes; /* whether to preserve attributes in
>     archives */
>      > + bool umount;
>      > bool is_encrypted;
>      > char ivt_ascii[33];
>      > int install_directly;
>      > diff --git a/parser/parser.c b/parser/parser.c
>      > index 5607031..81f69be 100644
>      > --- a/parser/parser.c
>      > +++ b/parser/parser.c
>      > @@ -436,6 +436,7 @@ static int parse_common_attributes(parsertype
>     p, void *elem, struct img_type *im
>      > }
>      > get_field(p, elem, "installed-directly", &image->install_directly);
>      > get_field(p, elem, "preserve-attributes",
>     &image->preserve_attributes);
>      > + get_field(p, elem, "umount", &image->umount);
>      > get_field(p, elem, "install-if-different",
>     &image->id.install_if_different);
>      > get_field(p, elem, "install-if-higher",
>     &image->id.install_if_higher);
>      > get_field(p, elem, "encrypted", &image->is_encrypted);
> 
>     -- 
>     =====================================================================
>     DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
>     HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
>     Phone: +49-8142-66989-53 <tel:+49%208142%206698953> Fax:
>     +49-8142-66989-80 <tel:+49%208142%206698980> Email: sba...@denx.de
>     =====================================================================
> 
> -- 
> You received this message because you are subscribed to the Google 
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to swupdate+unsubscribe@googlegroups.com 
> <mailto:swupdate+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer>.
ayoub...@googlemail.com Nov. 9, 2022, 3:57 p.m. UTC | #5
Hi Stefano,


On Wednesday, November 9, 2022 at 3:34:23 PM UTC+1 Stefano Babic wrote:

> Hi Ayoub, 
>
> On 09.11.22 14:41, 'ayoub...@googlemail.com' via swupdate wrote: 
> > Hi Stefano, 
> > 
> > Thanks for the feedback but I have a specific use case where this is 
> > needed: 
> > 
> > I have an encrypted ubifs mounted outside swupdate under a fixed path 
> > /var/update, the file system update is provided as tar file to be 
> > unpacked under /var/update, the FS encryption is handled by fscrypt. 
> > I prefer that swupdate doesn't perform the mount because it's a bit 
> > tidy : secure storage interface, kernel keyring, fscrypt and so on... 
> > 
>
> Yes: it makes sense that filesystem is mounted outside SWUpdate, better 
> in a ramdisk before booting. 
>
> > before running the ubifs volumes swap in swupdate type = "ubiswap" the 
> > /var/update partition need to be umounted otherwise the kernel crashes. 
> > 
>
> Ok - however, this looks an issue in kernel, and we want to work-around 
> it in SWUpdate. The other way for you is to not use "ubiswap", and 
> instead of it let toggle via U-Boot variables, setting 
> CONFIG_ENV_FLAGS_LIST_STATIC in U-Boot to enable only the variables you 
> need (or just one).


I have completely disabled fwenv in uboot for security reasons
 

>
>
> Have you already reported this to MTD list and to Richard (Weinberger) ?


I will try to report it to MTD List, for the moment it looks like my emails 
doesn't go through MTD ML.
there have been other issues related to fscryptctl & mtd-utils that Richard 
checked on github.


>
> > this specific scenario is not handled by swupdate and can be fixed by 
> > using the new flag : umount=true in the archive handler. 
>
> Ok - I do not want to block it, but it will be nice to check options. In 
> SWUpdate, I will suggest this behavior: 
>
> - automatic umount should be done only if requested (as I said, I find 
> the current behavior buggy) 
> - the umount flag is also added and takes place to umount it, that is 
> the rule should be 
>
> if ((use_mount && is_mounted) || use_umount) 
>
> - the flag is specific for the archive handler, so I would move it to 
> properties, that is you enable it as: 
>
> type = "archive"; 
> properties: { 
> umount = "true"; 
> } 
>
>
I agree here to be specific to archive handler
 

> Then your your use case is covered by SWUpdate, but I will appreciate to 
> discuss this with MTD developers, too.



I will rework the patch following your suggestion and send a V2 and a new 
one with wiping out the destination folder before applying archives.


Thanks
 

>
>
> Best regards, 
> Stefano 
>
> > 
> > Best, 
> > Ayoub 
> > 
> > 
> > 
> > 
> > On Wednesday, November 9, 2022 at 2:09:58 PM UTC+1 Stefano Babic wrote: 
> > 
> > Hi Ayoub, 
> > 
> > On 09.11.22 13:46, Ayoub Zaki wrote: 
> > > add new flag to control if path should be umounted 
> > > this is only useful if the mount point specified by path is already 
> > > mounted outside of swupdate. 
> > > 
> > 
> > I see the issue but this is really more a bug than a requested feature. 
> > SWUpdate is already able to do this: if the attribute "filesystem" is 
> > set, SWUpdate will mount the filesystem and umount at the end. If 
> > filesystem is missing, SWUpdate does not try to mount it. However, it 
> > runs umount at the end, and this is not correct. SWUpdate should umount 
> > if it has mounted before. 
> > 
> > IMHO it is enough to make the choice to umount the filesystem on depend 
> > if mount was requested or not: 
> > 
> > Instead of: 
> > 
> > 376 if (is_mounted) { 
> > 
> > --- a/handlers/archive_handler.c 
> > +++ b/handlers/archive_handler.c 
> > @@ -373,7 +373,7 @@ out: 
> > if (FIFO) 
> > unlink(FIFO); 
> > 
> > - if (is_mounted) { 
> > + if (use_mount && is_mounted) { 
> > ret = swupdate_umount(DATADST_DIR); 
> > if (ret) { 
> > TRACE("Failed to unmount directory %s", 
> > DATADST_DIR); 
> > 
> > Best regards, 
> > Stefano Babic 
> > 
> > > Signed-off-by: Ayoub Zaki <ayoub...@embetrix.com> 
> > > --- 
> > > doc/source/sw-description.rst | 6 ++++++ 
> > > handlers/archive_handler.c | 8 ++++++++ 
> > > include/swupdate.h | 1 + 
> > > parser/parser.c | 1 + 
> > > 4 files changed, 16 insertions(+) 
> > > 
> > > diff --git a/doc/source/sw-description.rst 
> > b/doc/source/sw-description.rst 
> > > index a5182d6..13bba2e 100644 
> > > --- a/doc/source/sw-description.rst 
> > > +++ b/doc/source/sw-description.rst 
> > > @@ -1319,6 +1319,12 @@ There are 4 main sections inside 
> > sw-description: 
> > > | | | | "filesystem" type. (path is always | 
> > > | | | | relative to the mount point.) | 
> > > 
> > 
> +-------------+----------+------------+---------------------------------------+ 
>
> > > + | umount | bool | files | flag to control whether the given | 
> > > + | | | | mount point specified by path | 
> > > + | | | | (absolute) where the files are | 
> > > + | | | | are installed if already mounted | 
> > > + | | | | outside SWUpdate should be umounted | 
> > > + 
> > 
> +-------------+----------+------------+---------------------------------------+ 
>
> > > | preserve-\ | bool | files | flag to control whether the 
> > following | 
> > > | attributes | | | attributes will be preserved when | 
> > > | | | | files are unpacked from an archive | 
> > > diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c 
> > > index e3a1463..553287f 100644 
> > > --- a/handlers/archive_handler.c 
> > > +++ b/handlers/archive_handler.c 
> > > @@ -228,6 +228,7 @@ static int install_archive_image(struct 
> > img_type *img, 
> > > struct extract_data tf; 
> > > pthread_attr_t attr; 
> > > int use_mount = (strlen(img->device) && strlen(img->filesystem)) 
> > ? 1 : 0; 
> > > + int use_umount = img->umount; 
> > > int is_mounted = 0; 
> > > int exitval = -EFAULT; 
> > > char *DATADST_DIR = NULL; 
> > > @@ -380,6 +381,13 @@ out: 
> > > } 
> > > } 
> > > 
> > > + if (use_umount && !use_mount) { 
> > > + ret = swupdate_umount(img->path); 
> > > + if (ret) { 
> > > + TRACE("Failed to unmount directory %s", img->path); 
> > > + } 
> > > + } 
> > > + 
> > > free(DATADST_DIR); 
> > > free(FIFO); 
> > > 
> > > diff --git a/include/swupdate.h b/include/swupdate.h 
> > > index 4cce892..89f64ea 100644 
> > > --- a/include/swupdate.h 
> > > +++ b/include/swupdate.h 
> > > @@ -81,6 +81,7 @@ struct img_type { 
> > > int provided; 
> > > int compressed; 
> > > int preserve_attributes; /* whether to preserve attributes in 
> > archives */ 
> > > + bool umount; 
> > > bool is_encrypted; 
> > > char ivt_ascii[33]; 
> > > int install_directly; 
> > > diff --git a/parser/parser.c b/parser/parser.c 
> > > index 5607031..81f69be 100644 
> > > --- a/parser/parser.c 
> > > +++ b/parser/parser.c 
> > > @@ -436,6 +436,7 @@ static int parse_common_attributes(parsertype 
> > p, void *elem, struct img_type *im 
> > > } 
> > > get_field(p, elem, "installed-directly", &image->install_directly); 
> > > get_field(p, elem, "preserve-attributes", 
> > &image->preserve_attributes); 
> > > + get_field(p, elem, "umount", &image->umount); 
> > > get_field(p, elem, "install-if-different", 
> > &image->id.install_if_different); 
> > > get_field(p, elem, "install-if-higher", 
> > &image->id.install_if_higher); 
> > > get_field(p, elem, "encrypted", &image->is_encrypted); 
> > 
> > -- 
> > ===================================================================== 
> > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
> > HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany 
> > Phone: +49-8142-66989-53 <+49%208142%206698953> 
> <tel:+49%208142%206698953> Fax: 
> > +49-8142-66989-80 <+49%208142%206698980> <tel:+49%208142%206698980> 
> Email: sba...@denx.de 
> > ===================================================================== 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "swupdate" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to swupdate+u...@googlegroups.com 
> > <mailto:swupdate+u...@googlegroups.com>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer>. 
>
>
> -- 
> ===================================================================== 
> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
> HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany 
> Phone: +49-8142-66989-53 <+49%208142%206698953> Fax: +49-8142-66989-80 
> <+49%208142%206698980> Email: sba...@denx.de 
> ===================================================================== 
>
>
ayoub...@googlemail.com Nov. 10, 2022, 7 a.m. UTC | #6
Hello Stefano,

I did a manual update :

# kernel update on dormant kernel volume kernel_r
$ ubiupdatevol /dev/ubi0_3 fitImage

# rootfs update on dormant mounted volume rootfs_r on /var/update
$ tar xf some-image-rootfs-tar.bz2 -C /var/update/ 

# ubirename without umounting /var/update !!
$ ubirename /dev/ubi0 kernel kernel_r kernel_r kernel rootfs rootfs_r 
rootfs_r rootfs 


I couldn't see any warnings or errors on dmesg and after reboot everything 
is fine.

It's likely an error/bug in swupdate ubi swap volume handler, for info I'm 
using mtd-utils 2.1.4 and kernel 5.10.116

 here is my sw-description :

software =
{
        version = "@@DISTRO_VERSION@@";

        images:
        (
            {
                name = "tf-a";
                filename = "tf-a.stm32";
                mtdname = "fsbl1";
                type = "flash";
                encrypted = true;
                sha256 = "$swupdate_get_sha256(tf-a.stm32)";
            },
            {
                name = "fip";
                filename = "fip.bin";
                mtdname = "ssbl1";
                type = "flash";
                encrypted = true;
                sha256 = "$swupdate_get_sha256(fip.bin)";
            },
            {
                name = "kernel";
                filename = "fitImage";
                volume ="kernel_r";
                type = "ubivol";
                encrypted = true;
                properties: {
                    decrypted-size = "@@FITIMAGE_DEC_SZ@@";
                }
                sha256 = "$swupdate_get_sha256(fitImage)";
            },
            {
                name = "rootfs";
                filename = "@@IMAGEBASE@@.tar.bz2";
                type = "archive";
                path = "/var/update";
                preserve-attributes = true;
                encrypted = true;
                sha256 = "$swupdate_get_sha256(@@IMAGEBASE@@.tar.bz2)";
            }
        );

        scripts:
        (
            {
                type = "ubiswap";
                properties: {
                    swap-0 = [ "kernel" , "kernel_r" ];
                    swap-1 = [ "rootfs" , "rootfs_r" ];
                },
            },
        );
}

I agree with you the umount flag was just a workaround and the issue should 
be investigated.

Best

On Wednesday, November 9, 2022 at 4:57:27 PM UTC+1 ayoub...@googlemail.com 
wrote:

> Hi Stefano,
>
>
> On Wednesday, November 9, 2022 at 3:34:23 PM UTC+1 Stefano Babic wrote:
>
>> Hi Ayoub, 
>>
>> On 09.11.22 14:41, 'ayoub...@googlemail.com' via swupdate wrote: 
>> > Hi Stefano, 
>> > 
>> > Thanks for the feedback but I have a specific use case where this is 
>> > needed: 
>> > 
>> > I have an encrypted ubifs mounted outside swupdate under a fixed path 
>> > /var/update, the file system update is provided as tar file to be 
>> > unpacked under /var/update, the FS encryption is handled by fscrypt. 
>> > I prefer that swupdate doesn't perform the mount because it's a bit 
>> > tidy : secure storage interface, kernel keyring, fscrypt and so on... 
>> > 
>>
>> Yes: it makes sense that filesystem is mounted outside SWUpdate, better 
>> in a ramdisk before booting. 
>>
>> > before running the ubifs volumes swap in swupdate type = "ubiswap" the 
>> > /var/update partition need to be umounted otherwise the kernel crashes. 
>> > 
>>
>> Ok - however, this looks an issue in kernel, and we want to work-around 
>> it in SWUpdate. The other way for you is to not use "ubiswap", and 
>> instead of it let toggle via U-Boot variables, setting 
>> CONFIG_ENV_FLAGS_LIST_STATIC in U-Boot to enable only the variables you 
>> need (or just one).
>
>
> I have completely disabled fwenv in uboot for security reasons
>  
>
>>
>>
>> Have you already reported this to MTD list and to Richard (Weinberger) ?
>
>
> I will try to report it to MTD List, for the moment it looks like my 
> emails doesn't go through MTD ML.
> there have been other issues related to fscryptctl & mtd-utils that 
> Richard checked on github.
>
>
>>
>> > this specific scenario is not handled by swupdate and can be fixed by 
>> > using the new flag : umount=true in the archive handler. 
>>
>> Ok - I do not want to block it, but it will be nice to check options. In 
>> SWUpdate, I will suggest this behavior: 
>>
>> - automatic umount should be done only if requested (as I said, I find 
>> the current behavior buggy) 
>> - the umount flag is also added and takes place to umount it, that is 
>> the rule should be 
>>
>> if ((use_mount && is_mounted) || use_umount) 
>>
>> - the flag is specific for the archive handler, so I would move it to 
>> properties, that is you enable it as: 
>>
>> type = "archive"; 
>> properties: { 
>> umount = "true"; 
>> } 
>>
>>
> I agree here to be specific to archive handler
>  
>
>> Then your your use case is covered by SWUpdate, but I will appreciate to 
>> discuss this with MTD developers, too.
>
>
>
> I will rework the patch following your suggestion and send a V2 and a new 
> one with wiping out the destination folder before applying archives.
>
>
> Thanks
>  
>
>>
>>
>> Best regards, 
>> Stefano 
>>
>> > 
>> > Best, 
>> > Ayoub 
>> > 
>> > 
>> > 
>> > 
>> > On Wednesday, November 9, 2022 at 2:09:58 PM UTC+1 Stefano Babic wrote: 
>> > 
>> > Hi Ayoub, 
>> > 
>> > On 09.11.22 13:46, Ayoub Zaki wrote: 
>> > > add new flag to control if path should be umounted 
>> > > this is only useful if the mount point specified by path is already 
>> > > mounted outside of swupdate. 
>> > > 
>> > 
>> > I see the issue but this is really more a bug than a requested feature. 
>> > SWUpdate is already able to do this: if the attribute "filesystem" is 
>> > set, SWUpdate will mount the filesystem and umount at the end. If 
>> > filesystem is missing, SWUpdate does not try to mount it. However, it 
>> > runs umount at the end, and this is not correct. SWUpdate should umount 
>> > if it has mounted before. 
>> > 
>> > IMHO it is enough to make the choice to umount the filesystem on depend 
>> > if mount was requested or not: 
>> > 
>> > Instead of: 
>> > 
>> > 376 if (is_mounted) { 
>> > 
>> > --- a/handlers/archive_handler.c 
>> > +++ b/handlers/archive_handler.c 
>> > @@ -373,7 +373,7 @@ out: 
>> > if (FIFO) 
>> > unlink(FIFO); 
>> > 
>> > - if (is_mounted) { 
>> > + if (use_mount && is_mounted) { 
>> > ret = swupdate_umount(DATADST_DIR); 
>> > if (ret) { 
>> > TRACE("Failed to unmount directory %s", 
>> > DATADST_DIR); 
>> > 
>> > Best regards, 
>> > Stefano Babic 
>> > 
>> > > Signed-off-by: Ayoub Zaki <ayoub...@embetrix.com> 
>> > > --- 
>> > > doc/source/sw-description.rst | 6 ++++++ 
>> > > handlers/archive_handler.c | 8 ++++++++ 
>> > > include/swupdate.h | 1 + 
>> > > parser/parser.c | 1 + 
>> > > 4 files changed, 16 insertions(+) 
>> > > 
>> > > diff --git a/doc/source/sw-description.rst 
>> > b/doc/source/sw-description.rst 
>> > > index a5182d6..13bba2e 100644 
>> > > --- a/doc/source/sw-description.rst 
>> > > +++ b/doc/source/sw-description.rst 
>> > > @@ -1319,6 +1319,12 @@ There are 4 main sections inside 
>> > sw-description: 
>> > > | | | | "filesystem" type. (path is always | 
>> > > | | | | relative to the mount point.) | 
>> > > 
>> > 
>> +-------------+----------+------------+---------------------------------------+ 
>>
>> > > + | umount | bool | files | flag to control whether the given | 
>> > > + | | | | mount point specified by path | 
>> > > + | | | | (absolute) where the files are | 
>> > > + | | | | are installed if already mounted | 
>> > > + | | | | outside SWUpdate should be umounted | 
>> > > + 
>> > 
>> +-------------+----------+------------+---------------------------------------+ 
>>
>> > > | preserve-\ | bool | files | flag to control whether the 
>> > following | 
>> > > | attributes | | | attributes will be preserved when | 
>> > > | | | | files are unpacked from an archive | 
>> > > diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c 
>> > > index e3a1463..553287f 100644 
>> > > --- a/handlers/archive_handler.c 
>> > > +++ b/handlers/archive_handler.c 
>> > > @@ -228,6 +228,7 @@ static int install_archive_image(struct 
>> > img_type *img, 
>> > > struct extract_data tf; 
>> > > pthread_attr_t attr; 
>> > > int use_mount = (strlen(img->device) && strlen(img->filesystem)) 
>> > ? 1 : 0; 
>> > > + int use_umount = img->umount; 
>> > > int is_mounted = 0; 
>> > > int exitval = -EFAULT; 
>> > > char *DATADST_DIR = NULL; 
>> > > @@ -380,6 +381,13 @@ out: 
>> > > } 
>> > > } 
>> > > 
>> > > + if (use_umount && !use_mount) { 
>> > > + ret = swupdate_umount(img->path); 
>> > > + if (ret) { 
>> > > + TRACE("Failed to unmount directory %s", img->path); 
>> > > + } 
>> > > + } 
>> > > + 
>> > > free(DATADST_DIR); 
>> > > free(FIFO); 
>> > > 
>> > > diff --git a/include/swupdate.h b/include/swupdate.h 
>> > > index 4cce892..89f64ea 100644 
>> > > --- a/include/swupdate.h 
>> > > +++ b/include/swupdate.h 
>> > > @@ -81,6 +81,7 @@ struct img_type { 
>> > > int provided; 
>> > > int compressed; 
>> > > int preserve_attributes; /* whether to preserve attributes in 
>> > archives */ 
>> > > + bool umount; 
>> > > bool is_encrypted; 
>> > > char ivt_ascii[33]; 
>> > > int install_directly; 
>> > > diff --git a/parser/parser.c b/parser/parser.c 
>> > > index 5607031..81f69be 100644 
>> > > --- a/parser/parser.c 
>> > > +++ b/parser/parser.c 
>> > > @@ -436,6 +436,7 @@ static int parse_common_attributes(parsertype 
>> > p, void *elem, struct img_type *im 
>> > > } 
>> > > get_field(p, elem, "installed-directly", &image->install_directly); 
>> > > get_field(p, elem, "preserve-attributes", 
>> > &image->preserve_attributes); 
>> > > + get_field(p, elem, "umount", &image->umount); 
>> > > get_field(p, elem, "install-if-different", 
>> > &image->id.install_if_different); 
>> > > get_field(p, elem, "install-if-higher", 
>> > &image->id.install_if_higher); 
>> > > get_field(p, elem, "encrypted", &image->is_encrypted); 
>> > 
>> > -- 
>> > ===================================================================== 
>> > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
>> > HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany 
>> > Phone: +49-8142-66989-53 <+49%208142%206698953> 
>> <tel:+49%208142%206698953> Fax: 
>> > +49-8142-66989-80 <+49%208142%206698980> <tel:+49%208142%206698980> 
>> Email: sba...@denx.de 
>> > ===================================================================== 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> > Groups "swupdate" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> > an email to swupdate+u...@googlegroups.com 
>> > <mailto:swupdate+u...@googlegroups.com>. 
>> > To view this discussion on the web visit 
>> > 
>> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com 
>> <
>> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer>. 
>>
>>
>> -- 
>> ===================================================================== 
>> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
>> HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany 
>> Phone: +49-8142-66989-53 <+49%208142%206698953> Fax: +49-8142-66989-80 
>> <+49%208142%206698980> Email: sba...@denx.de 
>> ===================================================================== 
>>
>>
Stefano Babic Nov. 10, 2022, 7:20 a.m. UTC | #7
Hi Ayoub,

On 10.11.22 08:00, 'ayoub...@googlemail.com' via swupdate wrote:
> Hello Stefano,
> 
> I did a manual update :
> 
> # kernel update on dormant kernel volume kernel_r
> $ ubiupdatevol /dev/ubi0_3 fitImage
> 
> # rootfs update on dormant mounted volume rootfs_r on /var/update
> $ tar xf some-image-rootfs-tar.bz2 -C /var/update/
> 
> # ubirename without umounting /var/update !!
> $ ubirename /dev/ubi0 kernel kernel_r kernel_r kernel rootfs rootfs_r 
> rootfs_r rootfs
> 
> 
> I couldn't see any warnings or errors on dmesg and after reboot 
> everything is fine.
> 

Ok

> It's likely an error/bug in swupdate ubi swap volume handler, for info 
> I'm using mtd-utils 2.1.4 and kernel 5.10.116

But you said that you face a kernel error (oops or panic). If this is 
the case, there is an issue in kernel, a user space application should 
never produce this. If you see a SEGV or another error, well, we have to 
check here.

> 
>   here is my sw-description :
> 
> software =
> {
>          version = "@@DISTRO_VERSION@@";
> 
>          images:
>          (
>              {
>                  name = "tf-a";
>                  filename = "tf-a.stm32";
>                  mtdname = "fsbl1";
>                  type = "flash";
>                  encrypted = true;
>                  sha256 = "$swupdate_get_sha256(tf-a.stm32)";
>              },
>              {
>                  name = "fip";
>                  filename = "fip.bin";
>                  mtdname = "ssbl1";
>                  type = "flash";
>                  encrypted = true;
>                  sha256 = "$swupdate_get_sha256(fip.bin)";
>              },
>              {
>                  name = "kernel";
>                  filename = "fitImage";
>                  volume ="kernel_r";
>                  type = "ubivol";
>                  encrypted = true;
>                  properties: {
>                      decrypted-size = "@@FITIMAGE_DEC_SZ@@";
>                  }
>                  sha256 = "$swupdate_get_sha256(fitImage)";
>              },
>              {
>                  name = "rootfs";
>                  filename = "@@IMAGEBASE@@.tar.bz2";
>                  type = "archive";
>                  path = "/var/update";
>                  preserve-attributes = true;
>                  encrypted = true;
>                  sha256 = "$swupdate_get_sha256(@@IMAGEBASE@@.tar.bz2)";
>              }
>          );
> 
>          scripts:
>          (
>              {
>                  type = "ubiswap";
>                  properties: {
>                      swap-0 = [ "kernel" , "kernel_r" ];
>                      swap-1 = [ "rootfs" , "rootfs_r" ];
>                  },
>              },
>          );
> }

The handler and ubirename have just a different way to get the volume's 
id. SWUpdate like mtd-utils is using the libubi library provided by 
mtd-utils, and both are executing the swap by calling ubi_rnvols().

One major difference is that with SWUpdate you are swapping both kernel 
and rootfs quite at the same time, while in the example above you swap 
just one of them. Does it make a difference ?

> 
> I agree with you the umount flag was just a workaround and the issue 
> should be investigated.
> 

Right.

Best regards,
Stefano

> Best
> 
> On Wednesday, November 9, 2022 at 4:57:27 PM UTC+1 
> ayoub...@googlemail.com wrote:
> 
>     Hi Stefano,
> 
> 
>     On Wednesday, November 9, 2022 at 3:34:23 PM UTC+1 Stefano Babic wrote:
> 
>         Hi Ayoub,
> 
>         On 09.11.22 14:41, 'ayoub...@googlemail.com' via swupdate wrote:
>          > Hi Stefano,
>          >
>          > Thanks for the feedback but I have a specific use case where
>         this is
>          > needed:
>          >
>          > I have an encrypted ubifs mounted outside swupdate under a
>         fixed path
>          > /var/update, the file system update is provided as tar file
>         to be
>          > unpacked under /var/update, the FS encryption is handled by
>         fscrypt.
>          > I prefer that swupdate doesn't perform the mount because it's
>         a bit
>          > tidy : secure storage interface, kernel keyring, fscrypt and
>         so on...
>          >
> 
>         Yes: it makes sense that filesystem is mounted outside SWUpdate,
>         better
>         in a ramdisk before booting.
> 
>          > before running the ubifs volumes swap in swupdate type =
>         "ubiswap" the
>          > /var/update partition need to be umounted otherwise the
>         kernel crashes.
>          >
> 
>         Ok - however, this looks an issue in kernel, and we want to
>         work-around
>         it in SWUpdate. The other way for you is to not use "ubiswap", and
>         instead of it let toggle via U-Boot variables, setting
>         CONFIG_ENV_FLAGS_LIST_STATIC in U-Boot to enable only the
>         variables you
>         need (or just one).
> 
> 
>     I have completely disabled fwenv in uboot for security reasons
> 
> 
> 
>         Have you already reported this to MTD list and to Richard
>         (Weinberger) ?
> 
> 
>     I will try to report it to MTD List, for the moment it looks like my
>     emails doesn't go through MTD ML.
>     there have been other issues related to fscryptctl & mtd-utils that
>     Richard checked on github.
> 
> 
> 
>          > this specific scenario is not handled by swupdate and can be
>         fixed by
>          > using the new flag : umount=true in the archive handler.
> 
>         Ok - I do not want to block it, but it will be nice to check
>         options. In
>         SWUpdate, I will suggest this behavior:
> 
>         - automatic umount should be done only if requested (as I said,
>         I find
>         the current behavior buggy)
>         - the umount flag is also added and takes place to umount it,
>         that is
>         the rule should be
> 
>         if ((use_mount && is_mounted) || use_umount)
> 
>         - the flag is specific for the archive handler, so I would move
>         it to
>         properties, that is you enable it as:
> 
>         type = "archive";
>         properties: {
>         umount = "true";
>         }
> 
> 
>     I agree here to be specific to archive handler
> 
>         Then your your use case is covered by SWUpdate, but I will
>         appreciate to
>         discuss this with MTD developers, too.
> 
> 
> 
>     I will rework the patch following your suggestion and send a V2 and
>     a new one with wiping out the destination folder before applying
>     archives.
> 
> 
>     Thanks
> 
> 
> 
>         Best regards,
>         Stefano
> 
>          >
>          > Best,
>          > Ayoub
>          >
>          >
>          >
>          >
>          > On Wednesday, November 9, 2022 at 2:09:58 PM UTC+1 Stefano
>         Babic wrote:
>          >
>          > Hi Ayoub,
>          >
>          > On 09.11.22 13:46, Ayoub Zaki wrote:
>          > > add new flag to control if path should be umounted
>          > > this is only useful if the mount point specified by path is
>         already
>          > > mounted outside of swupdate.
>          > >
>          >
>          > I see the issue but this is really more a bug than a
>         requested feature.
>          > SWUpdate is already able to do this: if the attribute
>         "filesystem" is
>          > set, SWUpdate will mount the filesystem and umount at the
>         end. If
>          > filesystem is missing, SWUpdate does not try to mount it.
>         However, it
>          > runs umount at the end, and this is not correct. SWUpdate
>         should umount
>          > if it has mounted before.
>          >
>          > IMHO it is enough to make the choice to umount the filesystem
>         on depend
>          > if mount was requested or not:
>          >
>          > Instead of:
>          >
>          > 376 if (is_mounted) {
>          >
>          > --- a/handlers/archive_handler.c
>          > +++ b/handlers/archive_handler.c
>          > @@ -373,7 +373,7 @@ out:
>          > if (FIFO)
>          > unlink(FIFO);
>          >
>          > - if (is_mounted) {
>          > + if (use_mount && is_mounted) {
>          > ret = swupdate_umount(DATADST_DIR);
>          > if (ret) {
>          > TRACE("Failed to unmount directory %s",
>          > DATADST_DIR);
>          >
>          > Best regards,
>          > Stefano Babic
>          >
>          > > Signed-off-by: Ayoub Zaki <ayoub...@embetrix.com>
>          > > ---
>          > > doc/source/sw-description.rst | 6 ++++++
>          > > handlers/archive_handler.c | 8 ++++++++
>          > > include/swupdate.h | 1 +
>          > > parser/parser.c | 1 +
>          > > 4 files changed, 16 insertions(+)
>          > >
>          > > diff --git a/doc/source/sw-description.rst
>          > b/doc/source/sw-description.rst
>          > > index a5182d6..13bba2e 100644
>          > > --- a/doc/source/sw-description.rst
>          > > +++ b/doc/source/sw-description.rst
>          > > @@ -1319,6 +1319,12 @@ There are 4 main sections inside
>          > sw-description:
>          > > | | | | "filesystem" type. (path is always |
>          > > | | | | relative to the mount point.) |
>          > >
>          >
>         +-------------+----------+------------+---------------------------------------+
>          > > + | umount | bool | files | flag to control whether the
>         given |
>          > > + | | | | mount point specified by path |
>          > > + | | | | (absolute) where the files are |
>          > > + | | | | are installed if already mounted |
>          > > + | | | | outside SWUpdate should be umounted |
>          > > +
>          >
>         +-------------+----------+------------+---------------------------------------+
>          > > | preserve-\ | bool | files | flag to control whether the
>          > following |
>          > > | attributes | | | attributes will be preserved when |
>          > > | | | | files are unpacked from an archive |
>          > > diff --git a/handlers/archive_handler.c
>         b/handlers/archive_handler.c
>          > > index e3a1463..553287f 100644
>          > > --- a/handlers/archive_handler.c
>          > > +++ b/handlers/archive_handler.c
>          > > @@ -228,6 +228,7 @@ static int install_archive_image(struct
>          > img_type *img,
>          > > struct extract_data tf;
>          > > pthread_attr_t attr;
>          > > int use_mount = (strlen(img->device) &&
>         strlen(img->filesystem))
>          > ? 1 : 0;
>          > > + int use_umount = img->umount;
>          > > int is_mounted = 0;
>          > > int exitval = -EFAULT;
>          > > char *DATADST_DIR = NULL;
>          > > @@ -380,6 +381,13 @@ out:
>          > > }
>          > > }
>          > >
>          > > + if (use_umount && !use_mount) {
>          > > + ret = swupdate_umount(img->path);
>          > > + if (ret) {
>          > > + TRACE("Failed to unmount directory %s", img->path);
>          > > + }
>          > > + }
>          > > +
>          > > free(DATADST_DIR);
>          > > free(FIFO);
>          > >
>          > > diff --git a/include/swupdate.h b/include/swupdate.h
>          > > index 4cce892..89f64ea 100644
>          > > --- a/include/swupdate.h
>          > > +++ b/include/swupdate.h
>          > > @@ -81,6 +81,7 @@ struct img_type {
>          > > int provided;
>          > > int compressed;
>          > > int preserve_attributes; /* whether to preserve attributes in
>          > archives */
>          > > + bool umount;
>          > > bool is_encrypted;
>          > > char ivt_ascii[33];
>          > > int install_directly;
>          > > diff --git a/parser/parser.c b/parser/parser.c
>          > > index 5607031..81f69be 100644
>          > > --- a/parser/parser.c
>          > > +++ b/parser/parser.c
>          > > @@ -436,6 +436,7 @@ static int
>         parse_common_attributes(parsertype
>          > p, void *elem, struct img_type *im
>          > > }
>          > > get_field(p, elem, "installed-directly",
>         &image->install_directly);
>          > > get_field(p, elem, "preserve-attributes",
>          > &image->preserve_attributes);
>          > > + get_field(p, elem, "umount", &image->umount);
>          > > get_field(p, elem, "install-if-different",
>          > &image->id.install_if_different);
>          > > get_field(p, elem, "install-if-higher",
>          > &image->id.install_if_higher);
>          > > get_field(p, elem, "encrypted", &image->is_encrypted);
>          >
>          > --
>          >
>         =====================================================================
>          > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
>          > HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell,
>         Germany
>          > Phone: +49-8142-66989-53 <tel:+49%208142%206698953>
>         <tel:+49%208142%206698953> Fax:
>          > +49-8142-66989-80 <tel:+49%208142%206698980>
>         <tel:+49%208142%206698980> Email: sba...@denx.de
>          >
>         =====================================================================
>          >
>          > --
>          > You received this message because you are subscribed to the
>         Google
>          > Groups "swupdate" group.
>          > To unsubscribe from this group and stop receiving emails from
>         it, send
>          > an email to swupdate+u...@googlegroups.com
>          > <mailto:swupdate+u...@googlegroups.com>.
>          > To view this discussion on the web visit
>          >
>         https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com> <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> 
>         -- 
>         =====================================================================
>         DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
>         HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
>         Phone: +49-8142-66989-53 <tel:+49%208142%206698953> Fax:
>         +49-8142-66989-80 <tel:+49%208142%206698980> Email: sba...@denx.de
>         =====================================================================
> 
> -- 
> You received this message because you are subscribed to the Google 
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to swupdate+unsubscribe@googlegroups.com 
> <mailto:swupdate+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com?utm_medium=email&utm_source=footer>.
ayoub...@googlemail.com Nov. 10, 2022, 7:39 a.m. UTC | #8
Hi,

On Thursday, November 10, 2022 at 8:20:23 AM UTC+1 Stefano Babic wrote:

> Hi Ayoub, 
>
> On 10.11.22 08:00, 'ayoub...@googlemail.com' via swupdate wrote: 
> > Hello Stefano, 
> > 
> > I did a manual update : 
> > 
> > # kernel update on dormant kernel volume kernel_r 
> > $ ubiupdatevol /dev/ubi0_3 fitImage 
> > 
> > # rootfs update on dormant mounted volume rootfs_r on /var/update 
> > $ tar xf some-image-rootfs-tar.bz2 -C /var/update/ 
> > 
> > # ubirename without umounting /var/update !! 
> > $ ubirename /dev/ubi0 kernel kernel_r kernel_r kernel rootfs rootfs_r 
> > rootfs_r rootfs 
> > 
> > 
> > I couldn't see any warnings or errors on dmesg and after reboot 
> > everything is fine. 
> > 
>
> Ok 
>
> > It's likely an error/bug in swupdate ubi swap volume handler, for info 
> > I'm using mtd-utils 2.1.4 and kernel 5.10.116 
>
> But you said that you face a kernel error (oops or panic). If this is 
> the case, there is an issue in kernel, a user space application should 
> never produce this. If you see a SEGV or another error, well, we have to 
> check here.


Here is a stack trace:
[ ============================================================ ] 3 of 4 
100% (fitImage), dwl 0% of 0 bytes-------------- ] 3 of 4 0% (fitImage), 
dwl 0% of 0 bytes
Nov 10 07:29:17 stm32mp157c systemd-journald[338]: Forwarding to syslog 
missed 61 messages.
Nov 10 07:31:00 stm32mp157c swupdate[428]: [TRACE] : SWUPDATE running : 
 [swap_volume] : swap UBI volume kernel_r <-> kernel
Nov 10 07:31:00 stm32mp157c swupdate[428]: [TRACE] : SWUPDATE running : 
 [swap_volume] : swap UBI volume rootfs_r <-> rootfs
Nov 10 07:31:00 stm32mp157c systemd-journald[338]: Forwarding to syslog 
missed 2 messages.
Nov 10 07:31:01 stm32mp157c kernel: ------------[ cut here ]------------
Nov 10 07:31:01 stm32mp157c kernel: WARNING: CPU: 0 PID: 7 at 
drivers/mtd/nand/raw/internals.h:134 nand_prog_page_end_op+0x1f8/0x210
Nov 10 07:31:01 stm32mp157c kernel: Modules linked in:
Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 Not 
tainted 5.10.116 #1
Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
Support)
Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
(flush-ubifs_0_2)
Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
[<c0109ed4>] (show_stack+0x10/0x14)
Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
[<c08f837c>] (dump_stack+0xc4/0xd8)
Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
[<c08f428c>] (__warn+0xc0/0xd8)
Nov 10 07:31:01 stm32mp157c kernel: [<c08f428c>] (__warn) from [<c08f4308>] 
(warn_slowpath_fmt+0x64/0xc0)
Nov 10 07:31:01 stm32mp157c kernel: [<c08f4308>] (warn_slowpath_fmt) from 
[<c05daae0>] (nand_prog_page_end_op+0x1f8/0x210)
Nov 10 07:31:01 stm32mp157c kernel: [<c05daae0>] (nand_prog_page_end_op) 
from [<c05d945c>] (nand_do_write_ops+0x2d8/0x44c)
Nov 10 07:31:01 stm32mp157c kernel: [<c05d945c>] (nand_do_write_ops) from 
[<c05ddb00>] (nand_write_oob+0x50/0x80)
Nov 10 07:31:01 stm32mp157c kernel: [<c05ddb00>] (nand_write_oob) from 
[<c05ceffc>] (mtd_write+0x64/0x88)
Nov 10 07:31:01 stm32mp157c kernel: [<c05ceffc>] (mtd_write) from 
[<c05fa9cc>] (ubi_io_write+0x108/0x664)
Nov 10 07:31:01 stm32mp157c kernel: [<c05fa9cc>] (ubi_io_write) from 
[<c05f80c0>] (ubi_eba_write_leb+0x2a0/0x80c)
Nov 10 07:31:01 stm32mp157c kernel: [<c05f80c0>] (ubi_eba_write_leb) from 
[<c05f65b0>] (ubi_leb_write+0xd0/0xe8)
Nov 10 07:31:01 stm32mp157c kernel: [<c05f65b0>] (ubi_leb_write) from 
[<c0387af4>] (ubifs_leb_write+0xa0/0x110)
Nov 10 07:31:01 stm32mp157c kernel: [<c0387af4>] (ubifs_leb_write) from 
[<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] (ubifs_wbuf_write_nolock) 
from [<c037a2f8>] (write_head+0x140/0x1c0)
Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
[<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
from [<c037ea78>] (do_writepage+0x98/0x288)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
[<c0200a84>] (__writepage+0x14/0x68)
Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
[<c0202b98>] (write_cache_pages+0x194/0x3d4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) from 
[<c0203854>] (do_writepages+0xa4/0xe0)
Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
[<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] (__writeback_single_inode) 
from [<c029a090>] (writeback_sb_inodes+0x1f4/0x424)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) from 
[<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
from [<c029a530>] (wb_writeback+0x194/0x1d8)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
[<c029b37c>] (wb_workfn+0x23c/0x3a4)
Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
[<c0131e74>] (process_one_work+0x1c8/0x420)
Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
[<c0132118>] (worker_thread+0x4c/0x520)
Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
[<c0137cf4>] (kthread+0x150/0x190)
Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
[<c0100148>] (ret_from_fork+0x14/0x2c)
Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
0xc1055ff8)
Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                                   
  00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
00000000 00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
00000000 00000013 00000000
Nov 10 07:31:01 stm32mp157c kernel: ---[ end trace 13062db303db52c6 ]---
Nov 10 07:31:01 stm32mp157c kernel: ubi0 error: ubi_io_write: error -22 
while writing 4096 bytes to PEB 1475:200704, written 0 bytes
Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
Tainted: G        W         5.10.116 #1
Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
Support)
Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
(flush-ubifs_0_2)
Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
[<c0109ed4>] (show_stack+0x10/0x14)
Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
[<c08f837c>] (dump_stack+0xc4/0xd8)
Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
[<c05fadb8>] (ubi_io_write+0x4f4/0x664)
Nov 10 07:31:01 stm32mp157c kernel: [<c05fadb8>] (ubi_io_write) from 
[<c05f80c0>] (ubi_eba_write_leb+0x2a0/0x80c)
Nov 10 07:31:01 stm32mp157c kernel: [<c05f80c0>] (ubi_eba_write_leb) from 
[<c05f65b0>] (ubi_leb_write+0xd0/0xe8)
Nov 10 07:31:01 stm32mp157c kernel: [<c05f65b0>] (ubi_leb_write) from 
[<c0387af4>] (ubifs_leb_write+0xa0/0x110)
Nov 10 07:31:01 stm32mp157c kernel: [<c0387af4>] (ubifs_leb_write) from 
[<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] (ubifs_wbuf_write_nolock) 
from [<c037a2f8>] (write_head+0x140/0x1c0)
Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
[<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
from [<c037ea78>] (do_writepage+0x98/0x288)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
[<c0200a84>] (__writepage+0x14/0x68)
Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
[<c0202b98>] (write_cache_pages+0x194/0x3d4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) from 
[<c0203854>] (do_writepages+0xa4/0xe0)
Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
[<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] (__writeback_single_inode) 
from [<c029a090>] (writeback_sb_inodes+0x1f4/0x424)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) from 
[<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
from [<c029a530>] (wb_writeback+0x194/0x1d8)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
[<c029b37c>] (wb_workfn+0x23c/0x3a4)
Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
[<c0131e74>] (process_one_work+0x1c8/0x420)
Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
[<c0132118>] (worker_thread+0x4c/0x520)
Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
[<c0137cf4>] (kthread+0x150/0x190)
Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
[<c0100148>] (ret_from_fork+0x14/0x2c)
Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
0xc1055ff8)
Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                                   
  00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
00000000 00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
00000000 00000013 00000000
Nov 10 07:31:01 stm32mp157c kernel: ubi0: dumping 4096 bytes of data from 
PEB 1475, offset 200704
Nov 10 07:31:01 stm32mp157c kernel: 00000000: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000020: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000040: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000060: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000080: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000000a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000000c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000000e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000100: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000120: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000140: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000160: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000180: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000001a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000001c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000001e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000200: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000220: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000240: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000260: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000280: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000002a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000002c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000002e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000300: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000320: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000340: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000360: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000380: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000003a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000003c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000003e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000400: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000420: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000440: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000460: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000480: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000004a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000004c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000004e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000500: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000520: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000540: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000560: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000580: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000005a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000005c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000005e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000600: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000620: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000640: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000660: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000680: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000006a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000006c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000006e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000700: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000720: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000740: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000760: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000780: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000007a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000007c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000007e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000800: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000820: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000840: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000860: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000880: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000008a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000008c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000008e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000900: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000920: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000940: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000960: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000980: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000009a0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000009c0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 000009e0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000a00: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000a20: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000a40: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000a60: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000a80: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000aa0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000ac0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000ae0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000b00: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000b20: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000b40: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000b60: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000b80: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000ba0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000bc0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000be0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000c00: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000c20: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000c40: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000c60: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000c80: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000ca0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000cc0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000ce0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000d00: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000d20: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000d40: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000d60: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000d80: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000da0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000dc0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000de0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000e00: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000e20: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000e40: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000e60: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000e80: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000ea0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000ec0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000ee0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000f00: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000f20: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000f40: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000f60: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000f80: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000fa0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000fc0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: 00000fe0: ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
 ................................
Nov 10 07:31:01 stm32mp157c kernel: ubi0 warning: ubi_eba_write_leb: failed 
to write data to PEB 1475
Nov 10 07:31:01 stm32mp157c kernel: ubi0 warning: ubi_ro_mode.part.0: 
switch to read-only mode
Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
Tainted: G        W         5.10.116 #1
Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
Support)
Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
(flush-ubifs_0_2)
Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
[<c0109ed4>] (show_stack+0x10/0x14)
Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
[<c08f837c>] (dump_stack+0xc4/0xd8)
Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
[<c05f8538>] (ubi_eba_write_leb+0x718/0x80c)
Nov 10 07:31:01 stm32mp157c kernel: [<c05f8538>] (ubi_eba_write_leb) from 
[<c05f65b0>] (ubi_leb_write+0xd0/0xe8)
Nov 10 07:31:01 stm32mp157c kernel: [<c05f65b0>] (ubi_leb_write) from 
[<c0387af4>] (ubifs_leb_write+0xa0/0x110)
Nov 10 07:31:01 stm32mp157c kernel: [<c0387af4>] (ubifs_leb_write) from 
[<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] (ubifs_wbuf_write_nolock) 
from [<c037a2f8>] (write_head+0x140/0x1c0)
Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
[<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
from [<c037ea78>] (do_writepage+0x98/0x288)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
[<c0200a84>] (__writepage+0x14/0x68)
Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
[<c0202b98>] (write_cache_pages+0x194/0x3d4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) from 
[<c0203854>] (do_writepages+0xa4/0xe0)
Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
[<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] (__writeback_single_inode) 
from [<c029a090>] (writeback_sb_inodes+0x1f4/0x424)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) from 
[<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
from [<c029a530>] (wb_writeback+0x194/0x1d8)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
[<c029b37c>] (wb_workfn+0x23c/0x3a4)
Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
[<c0131e74>] (process_one_work+0x1c8/0x420)
Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
[<c0132118>] (worker_thread+0x4c/0x520)
Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
[<c0137cf4>] (kthread+0x150/0x190)
Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
[<c0100148>] (ret_from_fork+0x14/0x2c)
Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
0xc1055ff8)
Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                                   
  00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
00000000 00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
00000000 00000013 00000000
Nov 10 07:31:01 stm32mp157c kernel: UBIFS error (ubi0:2 pid 7): 
ubifs_leb_write: writing 4096 bytes to LEB 1270:192512 failed, error -22
Nov 10 07:31:01 stm32mp157c kernel: UBIFS warning (ubi0:2 pid 7): 
ubifs_ro_mode.part.0: switched to read-only mode, error -22
Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
Tainted: G        W         5.10.116 #1
Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
Support)
Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
(flush-ubifs_0_2)
Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
[<c0109ed4>] (show_stack+0x10/0x14)
Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
[<c08f837c>] (dump_stack+0xc4/0xd8)
Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
[<c0387b5c>] (ubifs_leb_write+0x108/0x110)
Nov 10 07:31:01 stm32mp157c kernel: [<c0387b5c>] (ubifs_leb_write) from 
[<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] (ubifs_wbuf_write_nolock) 
from [<c037a2f8>] (write_head+0x140/0x1c0)
Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
[<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
from [<c037ea78>] (do_writepage+0x98/0x288)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
[<c0200a84>] (__writepage+0x14/0x68)
Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
[<c0202b98>] (write_cache_pages+0x194/0x3d4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) from 
[<c0203854>] (do_writepages+0xa4/0xe0)
Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
[<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] (__writeback_single_inode) 
from [<c029a090>] (writeback_sb_inodes+0x1f4/0x424)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) from 
[<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
from [<c029a530>] (wb_writeback+0x194/0x1d8)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
[<c029b37c>] (wb_workfn+0x23c/0x3a4)
Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
[<c0131e74>] (process_one_work+0x1c8/0x420)
Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
[<c0132118>] (worker_thread+0x4c/0x520)
Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
[<c0137cf4>] (kthread+0x150/0x190)
Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
[<c0100148>] (ret_from_fork+0x14/0x2c)
Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
0xc1055ff8)
Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                                   
  00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
00000000 00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
00000000 00000013 00000000
Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
Tainted: G        W         5.10.116 #1
Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
Support)
Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
(flush-ubifs_0_2)
Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
[<c0109ed4>] (show_stack+0x10/0x14)
Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
[<c08f837c>] (dump_stack+0xc4/0xd8)
Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
[<c0387b60>] (ubifs_leb_write+0x10c/0x110)
Nov 10 07:31:01 stm32mp157c kernel: [<c0387b60>] (ubifs_leb_write) from 
[<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] (ubifs_wbuf_write_nolock) 
from [<c037a2f8>] (write_head+0x140/0x1c0)
Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
[<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
from [<c037ea78>] (do_writepage+0x98/0x288)
Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
[<c0200a84>] (__writepage+0x14/0x68)
Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
[<c0202b98>] (write_cache_pages+0x194/0x3d4)
Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) from 
[<c0203854>] (do_writepages+0xa4/0xe0)
Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
[<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] (__writeback_single_inode) 
from [<c029a090>] (writeback_sb_inodes+0x1f4/0x424)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) from 
[<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
from [<c029a530>] (wb_writeback+0x194/0x1d8)
Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
[<c029b37c>] (wb_workfn+0x23c/0x3a4)
Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
[<c0131e74>] (process_one_work+0x1c8/0x420)
Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
[<c0132118>] (worker_thread+0x4c/0x520)
Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
[<c0137cf4>] (kthread+0x150/0x190)
Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
[<c0100148>] (ret_from_fork+0x14/0x2c)
Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
0xc1055ff8)
Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                                   
  00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
00000000 00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
00000000 00000013 00000000
Nov 10 07:31:01 stm32mp157c kernel: UBIFS error (ubi0:2 pid 7): 
ubifs_wbuf_write_nolock: cannot write 1960 bytes to LEB 1270:192512, error 
-22
Nov 10 07:31:01 stm32mp157c kernel:       magic          0x6101831
Nov 10 07:31:01 stm32mp157c kernel:       crc            0xd0a08cd3
Nov 10 07:31:01 stm32mp157c kernel:       node_type      1 (data node)
Nov 10 07:31:01 stm32mp157c kernel:       group_type     0 (no node group)
Nov 10 07:31:01 stm32mp157c kernel:       sqnum          816863
Nov 10 07:31:01 stm32mp157c kernel:       len            1904
Nov 10 07:31:01 stm32mp157c kernel:       key            (45694, data, 39)
Nov 10 07:31:01 stm32mp157c kernel:       size           4096
Nov 10 07:31:01 stm32mp157c kernel:       compr_typ      1
Nov 10 07:31:01 stm32mp157c kernel:       data size      1856
Nov 10 07:31:01 stm32mp157c kernel:       data:
Nov 10 07:31:01 stm32mp157c kernel:       00000000: b9 a9 cd 50 b3 ab 27 4d 
9e ca 9b f2 a6 a1 e3 47 c4 bd a8 1e 8d 6a 28 d7 f6 8e d3 68 1b 0f 73 86
Nov 10 07:31:01 stm32mp157c kernel:       00000020: 8d fd 7b 5e 1a f9 e5 da 
71 6c 86 d3 b0 af 4d 8b f7 15 d0 48 2e e0 17 a2 1f c9 26 84 1a f8 b6 99
Nov 10 07:31:01 stm32mp157c kernel:       00000040: 6b 63 8e 9f 23 09 24 58 
ea 31 f0 30 ae da e6 dc 65 8d 8b 18 6d f2 79 50 67 1b c6 8f c0 2d 0e d6
Nov 10 07:31:01 stm32mp157c kernel:       00000060: 96 bf 34 44 4c 78 13 b2 
cf 2c 0b e6 59 bb 1f ef 49 05 da ff 4a 1a 3a 0b 71 f8 19 c8 fb 96 29 fd
Nov 10 07:31:01 stm32mp157c kernel:       00000080: 3e cc 50 94 60 fd c0 63 
7c 42 b2 86 62 b5 18 4e e5 60 83 ee d6 0f b3 7b a5 1e 93 70 8f 8f d5 19
Nov 10 07:31:01 stm32mp157c kernel:       000000a0: 2a 15 1a 8b 68 5c d8 03 
b5 43 9d bb d4 1a d3 38 8b 45 03 60 ad 8e 61 3d e1 60 49 ae 22 e6 52 84
Nov 10 07:31:01 stm32mp157c kernel:       000000c0: 97 90 bd 4a c4 29 45 08 
d9 3f 68 7f 37 d9 de cf 47 a7 af 10 6a 65 99 d6 e9 e8 a4 7c de 3e cd 44
Nov 10 07:31:01 stm32mp157c kernel:       000000e0: 16 52 c2 3d ea 90 b8 0a 
8f 1c a1 35 25 92 e7 68 08 60 b6 3f ad 40 a9 2d 5e 7d bb 0d 04 e0 15 e8
Nov 10 07:31:01 stm32mp157c kernel:       00000100: ae a7 48 5d 92 83 61 0d 
95 83 5e 99 1f e5 40 4b ce 6d 85 d1 c4 de 69 91 05 46 ed e7 39 68 c5 f0
Nov 10 07:31:01 stm32mp157c kernel:       00000120: e1 df 73 c3 e4 ff b2 1e 
6d b2 ab b8 bd 40 c6 91 92 8d 3a 82 94 0b 22 62 c4 91 b9 92 21 03 22 88
Nov 10 07:31:01 stm32mp157c kernel:       00000140: a4 22 77 fa 54 93 c7 c5 
18 33 e3 fa 8b 2b 7b 0b 05 39 8f db ea b1 5d 28 c9 b5 27 c6 3f e9 f6 c0
Nov 10 07:31:01 stm32mp157c kernel:       00000160: ae d6 2f 2b 16 6a 6c 53 
f1 34 c5 82 24 93 5f 3e 31 d8 f0 7f 72 64 f1 4f 1b ba 23 e4 81 1a 59 14
Nov 10 07:31:01 stm32mp157c kernel:       00000180: 6c a2 df 87 e2 9e 5a f1 
5b 1b cf 71 27 dc 40 4a ee ea 91 cd be 4f 93 a7 bc ac 93 38 92 f0 51 5a
Nov 10 07:31:01 stm32mp157c kernel:       000001a0: db 1a 3f ea 50 a4 6b 77 
7a cc 88 24 5d c7 6c 9f ef 86 48 be 9f d3 f0 99 f6 d9 69 2f 4e b4 a1 fc
Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6b 74 df b4 94 3f 1a 7c 
8d 85 9e ea bd 2a 9a 7e 3f 94 6c c5 30 89 a1 01 13 98 0e ce 38 d3 27 dd
Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 85 a3 89 12 b1 18 b9 3a 
b7 28 1f f0 61 da 5a 69 db 27 58 b5 8d bc 25 d2 63 ba ec 01 30 4a 39 bc
Nov 10 07:31:01 stm32mp157c kernel:       00000200: cc a8 df 88 f5 fa 1f e2 
fd 75 e2 43 8d b3 f9 4a 92 39 da be 77 92 45 d7 1a 6e c4 4f cf 69 d0 f7
Nov 10 07:31:01 stm32mp157c kernel:       00000220: b3 5c b2 5c cb 0a e8 26 
be 54 0f 2f dc d5 19 3c 53 f4 13 83 b8 24 ae a9 01 c8 98 39 7a 88 bf 9e
Nov 10 07:31:01 stm32mp157c kernel:       00000240: 04 3f ea 18 f3 d0 59 10 
79 4a cb bf 6c 44 a3 39 de 36 f7 c1 73 4b fb 5d 00 75 39 2c 79 00 42 f7
Nov 10 07:31:01 stm32mp157c kernel:       00000260: 95 97 a5 f6 7e 2d 22 a4 
ae d8 0c ab 87 b4 7d 7a 85 41 91 47 df 44 5d 19 a0 1c 99 ac e8 d1 2a 30
Nov 10 07:31:01 stm32mp157c kernel:       00000280: 76 98 b3 80 5c 0c 21 5b 
e7 5d 40 88 33 90 27 a6 72 7c f9 ff 34 34 02 b1 7e dc bb c2 91 c3 8b b3
Nov 10 07:31:01 stm32mp157c kernel:       000002a0: 85 a0 2e 0c 27 93 a4 ec 
0d d7 c3 98 28 4f 2c 7a 69 8c 60 b6 d0 81 2b 0b a9 a2 c4 34 4d 85 88 62
Nov 10 07:31:01 stm32mp157c kernel:       000002c0: 0a f2 04 10 54 71 62 de 
67 8c 4f 5c 27 3c f6 73 6f 2c 76 56 37 6c 97 e1 c0 88 fb 25 17 c6 ad 6f
Nov 10 07:31:01 stm32mp157c kernel:       000002e0: 6d d3 b2 ab ff 5a 84 1c 
14 56 44 d1 4a 52 4d 96 b7 3a 92 7a 9a 49 8f 5c be 34 c0 8c 8b e5 0e e2
Nov 10 07:31:01 stm32mp157c kernel:       00000300: a3 65 23 73 cd 65 b3 c9 
79 0c 48 12 70 81 56 4c 87 95 9c 9e 32 fd b7 36 11 4a 5e 26 83 36 9c 27
Nov 10 07:31:01 stm32mp157c kernel:       00000320: 26 04 77 e3 49 79 e5 bb 
af 97 07 6a 54 06 c7 ce 03 8b 42 9f 41 02 ab a3 c6 fe ad 91 d0 7f 10 65
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 7 kernel messages
Nov 10 07:31:01 stm32mp157c kernel:       00000420: e7 1c a7 71 61 5c 2a f5 
9e de f2 ed ad 3f df e0 71 40 d4 33 ac 13 89 2d dc 41 40 ff c4 9f 43 21
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 11 kernel messages
Nov 10 07:31:01 stm32mp157c kernel:       000005a0: 76 6c 8f 5e 3b a6 e8 f4 
0c 1c 23 18 f8 19 14 95 0a 7e 55 c5 be ac a7 d4 bb 4b 2d 64 6f ed 2b 58
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 12 kernel messages
Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
Tainted: G        W         5.10.116 #1
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 22 kernel messages
Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
00000000 00000000 00000000 00000000 00000000
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 23 kernel messages
Nov 10 07:31:01 stm32mp157c kernel:       00000100: 23 c9 81 a9 5f c4 6d b1 
32 51 79 78 a6 00 9f c8 53 7c 31 34 0c 8b 45 32 7a f2 1a 35 5b 46 fc 68
Nov 10 07:31:01 stm32mp157c kernel:       00000120: b9 f0 59 d5 eb 42 e9 ad 
d0 c0 a8 06 f3 c3 a2 88 d8 79 52 83 0b 83 59 6d 28 0d 47 c6 cf 00 37 f3
Nov 10 07:31:01 stm32mp157c kernel:       00000140: 7f eb dc df bc 45 61 5b 
ea 8e 36 90 09 4d 8d 72 1c 98 49 a4 03 79 cd f4 33 c6 d9 12 01 3f 8f 73
Nov 10 07:31:01 stm32mp157c kernel:       00000160: ad d3 ea cf 72 d4 b0 7a 
e2 02 63 14 f5 f3 75 8c fe 06 a2 1f 67 5d 97 19 a0 39 14 51 cd 7e 86 ac
Nov 10 07:31:01 stm32mp157c kernel:       00000180: b5 5a 32 0b ca 0c fb db 
76 02 ba 0c 38 26 3b 5f d1 59 69 8a 2a b3 86 b1 8f 6d e7 58 ee 29 9c f5
Nov 10 07:31:01 stm32mp157c kernel:       000001a0: b1 60 c9 5c 35 79 57 0c 
dc c4 85 be 1f 5c 67 97 e3 cb 56 e7 4d 63 25 dd 7b 2b a3 28 f4 5b 16 91
Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6c 33 40 00 ec d9 6d e0 
1b 98 fe 28 2f 78 e7 b4 49 dc 73 d0 d1 d8 c2 c7 2b 6c aa c1 e6 b3 fd ac
Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 73 6d 91 35 d1 f6 22 d5 
5a 15 8e 27 9e 27 03 09 c2 fc 6b 23 30 4e 86 02 1d 7e cd 1d 2a 37 15 15
Nov 10 07:31:01 stm32mp157c kernel:       00000200: 7e 66 a1 58 5a 91 74 b9 
cd 76 be 3d d7 86 20 88 9d 08 78 ab f8 30 07 59 ff 89 0d 35 1d b0 e5 d7
Nov 10 07:31:01 stm32mp157c kernel:       00000220: 93 bb 89 66 df 28 5e 44 
38 f3 0d 9b e6 4a 2c 7c 22 13 f5 c4 b3 68 0e ed 08 c1 80 f2 38 33 33 f3
Nov 10 07:31:01 stm32mp157c kernel:       00000240: 59 c3 05 f4 d8 00 fd 11 
14 f6 da 82 50 b6 b8 e9 2f f4 08 d6 b6 5b 10 f0 57 bd cb ef 90 ef e0 75
Nov 10 07:31:01 stm32mp157c kernel:       00000260: bd d0 71 91 21 54 86 ba 
c4 85 01 3c 64 ac 42 dd ba 56 2c 56 7c 86 bb 7f 75 ac dd 86 bb 36 ae 27
Nov 10 07:31:01 stm32mp157c kernel:       00000280: d9 89 10 1b 29 d8 c6 e1 
fc 6e bc b4 94 b4 20 e5 92 ed 7a fd 31 cd 91 17 a6 e3 d3 02 f2 81 e1 10
Nov 10 07:31:01 stm32mp157c kernel:       000002a0: db 45 18 8a 60 40 be 74 
7b 65 42 42 b3 b6 39 86 c7 82 4f c3 97 ff 5c c2 33 0f c8 ba 8c f3 b7 c4
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 4 kernel messages
Nov 10 07:31:01 stm32mp157c kernel:       00000340: 3f ca 97 31 a7 0e de e2 
17 41 b1 a8 31 a1 c8 d4 ed 14 8a 9b d0 bc 53 6f c5 75 3a f1 27 cd 0b ce
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 8 kernel messages
Nov 10 07:31:01 stm32mp157c kernel:       00000460: 69 90 eb 76 c0 48 ce fe 
4c a2 a5 3f 8f 71 2f 73 c7 aa 6f 16 49 b8 57 3a 03 51 40 56 72 5c 93 f4
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 14 kernel messages
Nov 10 07:31:01 stm32mp157c kernel:       00000640: 01 0a 4e 73 e5 27 25 f6 
2a b4 25 22 1d 7c df 8b bd b2 81 77 d0 f1 22 1f a6 a4 a7 cd d2 5a ad 47
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 10 kernel messages
Nov 10 07:31:01 stm32mp157c kernel:       000007a0: c3 35 eb ac 55 0b f7 5a 
2d 58 c6 9e f6 b7 02 c8 46 36 8b 1d 4c 0f 27 74 c9 f8 d7 90 a7 5d 30 45
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 13 kernel messages
Nov 10 07:31:01 stm32mp157c kernel:       00000960: 72 1a 5a bf a1 f7 eb 97 
cb 84 4f f8 e4 5c 72 fd fb b0 64 d9 bf 79 09 ef b4 fd 87 73 d7 24 25 38
Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 5 kernel messages

The worst is that SWUpdate is NOT failing and the board restart with a 
faulty system !

 

>
>
> > 
> >  here is my sw-description : 
> > 
> > software = 
> > { 
> >         version = "@@DISTRO_VERSION@@"; 
> > 
> >         images: 
> >         ( 
> >             { 
> >                 name = "tf-a"; 
> >                 filename = "tf-a.stm32"; 
> >                 mtdname = "fsbl1"; 
> >                 type = "flash"; 
> >                 encrypted = true; 
> >                 sha256 = "$swupdate_get_sha256(tf-a.stm32)"; 
> >             }, 
> >             { 
> >                 name = "fip"; 
> >                 filename = "fip.bin"; 
> >                 mtdname = "ssbl1"; 
> >                 type = "flash"; 
> >                 encrypted = true; 
> >                 sha256 = "$swupdate_get_sha256(fip.bin)"; 
> >             }, 
> >             { 
> >                 name = "kernel"; 
> >                 filename = "fitImage"; 
> >                 volume ="kernel_r"; 
> >                 type = "ubivol"; 
> >                 encrypted = true; 
> >                 properties: { 
> >                     decrypted-size = "@@FITIMAGE_DEC_SZ@@"; 
> >                 } 
> >                 sha256 = "$swupdate_get_sha256(fitImage)"; 
> >             }, 
> >             { 
> >                 name = "rootfs"; 
> >                 filename = "@@IMAGEBASE@@.tar.bz2"; 
> >                 type = "archive"; 
> >                 path = "/var/update"; 
> >                 preserve-attributes = true; 
> >                 encrypted = true; 
> >                 sha256 = "$swupdate_get_sha256(@@IMAGEBASE@@.tar.bz2)"; 
> >             } 
> >         ); 
> > 
> >         scripts: 
> >         ( 
> >             { 
> >                 type = "ubiswap"; 
> >                 properties: { 
> >                     swap-0 = [ "kernel" , "kernel_r" ]; 
> >                     swap-1 = [ "rootfs" , "rootfs_r" ]; 
> >                 }, 
> >             }, 
> >         ); 
> > } 
>
> The handler and ubirename have just a different way to get the volume's 
> id. SWUpdate like mtd-utils is using the libubi library provided by 
> mtd-utils, and both are executing the swap by calling ubi_rnvols(). 
>
> One major difference is that with SWUpdate you are swapping both kernel 
> and rootfs quite at the same time, while in the example above you swap 
> just one of them. Does it make a difference ?


good hint I will check this one.

Best
-Ayoub


>
> > 
> > I agree with you the umount flag was just a workaround and the issue 
> > should be investigated. 
> > 
>
> Right. 
>
> Best regards, 
> Stefano 
>
> > Best 
> > 
> > On Wednesday, November 9, 2022 at 4:57:27 PM UTC+1 
> > ayoub...@googlemail.com wrote: 
> > 
> > Hi Stefano, 
> > 
> > 
> > On Wednesday, November 9, 2022 at 3:34:23 PM UTC+1 Stefano Babic wrote: 
> > 
> > Hi Ayoub, 
> > 
> > On 09.11.22 14:41, 'ayoub...@googlemail.com' via swupdate wrote: 
> > > Hi Stefano, 
> > > 
> > > Thanks for the feedback but I have a specific use case where 
> > this is 
> > > needed: 
> > > 
> > > I have an encrypted ubifs mounted outside swupdate under a 
> > fixed path 
> > > /var/update, the file system update is provided as tar file 
> > to be 
> > > unpacked under /var/update, the FS encryption is handled by 
> > fscrypt. 
> > > I prefer that swupdate doesn't perform the mount because it's 
> > a bit 
> > > tidy : secure storage interface, kernel keyring, fscrypt and 
> > so on... 
> > > 
> > 
> > Yes: it makes sense that filesystem is mounted outside SWUpdate, 
> > better 
> > in a ramdisk before booting. 
> > 
> > > before running the ubifs volumes swap in swupdate type = 
> > "ubiswap" the 
> > > /var/update partition need to be umounted otherwise the 
> > kernel crashes. 
> > > 
> > 
> > Ok - however, this looks an issue in kernel, and we want to 
> > work-around 
> > it in SWUpdate. The other way for you is to not use "ubiswap", and 
> > instead of it let toggle via U-Boot variables, setting 
> > CONFIG_ENV_FLAGS_LIST_STATIC in U-Boot to enable only the 
> > variables you 
> > need (or just one). 
> > 
> > 
> > I have completely disabled fwenv in uboot for security reasons 
> > 
> > 
> > 
> > Have you already reported this to MTD list and to Richard 
> > (Weinberger) ? 
> > 
> > 
> > I will try to report it to MTD List, for the moment it looks like my 
> > emails doesn't go through MTD ML. 
> > there have been other issues related to fscryptctl & mtd-utils that 
> > Richard checked on github. 
> > 
> > 
> > 
> > > this specific scenario is not handled by swupdate and can be 
> > fixed by 
> > > using the new flag : umount=true in the archive handler. 
> > 
> > Ok - I do not want to block it, but it will be nice to check 
> > options. In 
> > SWUpdate, I will suggest this behavior: 
> > 
> > - automatic umount should be done only if requested (as I said, 
> > I find 
> > the current behavior buggy) 
> > - the umount flag is also added and takes place to umount it, 
> > that is 
> > the rule should be 
> > 
> > if ((use_mount && is_mounted) || use_umount) 
> > 
> > - the flag is specific for the archive handler, so I would move 
> > it to 
> > properties, that is you enable it as: 
> > 
> > type = "archive"; 
> > properties: { 
> > umount = "true"; 
> > } 
> > 
> > 
> > I agree here to be specific to archive handler 
> > 
> > Then your your use case is covered by SWUpdate, but I will 
> > appreciate to 
> > discuss this with MTD developers, too. 
> > 
> > 
> > 
> > I will rework the patch following your suggestion and send a V2 and 
> > a new one with wiping out the destination folder before applying 
> > archives. 
> > 
> > 
> > Thanks 
> > 
> > 
> > 
> > Best regards, 
> > Stefano 
> > 
> > > 
> > > Best, 
> > > Ayoub 
> > > 
> > > 
> > > 
> > > 
> > > On Wednesday, November 9, 2022 at 2:09:58 PM UTC+1 Stefano 
> > Babic wrote: 
> > > 
> > > Hi Ayoub, 
> > > 
> > > On 09.11.22 13:46, Ayoub Zaki wrote: 
> > > > add new flag to control if path should be umounted 
> > > > this is only useful if the mount point specified by path is 
> > already 
> > > > mounted outside of swupdate. 
> > > > 
> > > 
> > > I see the issue but this is really more a bug than a 
> > requested feature. 
> > > SWUpdate is already able to do this: if the attribute 
> > "filesystem" is 
> > > set, SWUpdate will mount the filesystem and umount at the 
> > end. If 
> > > filesystem is missing, SWUpdate does not try to mount it. 
> > However, it 
> > > runs umount at the end, and this is not correct. SWUpdate 
> > should umount 
> > > if it has mounted before. 
> > > 
> > > IMHO it is enough to make the choice to umount the filesystem 
> > on depend 
> > > if mount was requested or not: 
> > > 
> > > Instead of: 
> > > 
> > > 376 if (is_mounted) { 
> > > 
> > > --- a/handlers/archive_handler.c 
> > > +++ b/handlers/archive_handler.c 
> > > @@ -373,7 +373,7 @@ out: 
> > > if (FIFO) 
> > > unlink(FIFO); 
> > > 
> > > - if (is_mounted) { 
> > > + if (use_mount && is_mounted) { 
> > > ret = swupdate_umount(DATADST_DIR); 
> > > if (ret) { 
> > > TRACE("Failed to unmount directory %s", 
> > > DATADST_DIR); 
> > > 
> > > Best regards, 
> > > Stefano Babic 
> > > 
> > > > Signed-off-by: Ayoub Zaki <ayoub...@embetrix.com> 
> > > > --- 
> > > > doc/source/sw-description.rst | 6 ++++++ 
> > > > handlers/archive_handler.c | 8 ++++++++ 
> > > > include/swupdate.h | 1 + 
> > > > parser/parser.c | 1 + 
> > > > 4 files changed, 16 insertions(+) 
> > > > 
> > > > diff --git a/doc/source/sw-description.rst 
> > > b/doc/source/sw-description.rst 
> > > > index a5182d6..13bba2e 100644 
> > > > --- a/doc/source/sw-description.rst 
> > > > +++ b/doc/source/sw-description.rst 
> > > > @@ -1319,6 +1319,12 @@ There are 4 main sections inside 
> > > sw-description: 
> > > > | | | | "filesystem" type. (path is always | 
> > > > | | | | relative to the mount point.) | 
> > > > 
> > > 
> > 
> +-------------+----------+------------+---------------------------------------+ 
>
> > > > + | umount | bool | files | flag to control whether the 
> > given | 
> > > > + | | | | mount point specified by path | 
> > > > + | | | | (absolute) where the files are | 
> > > > + | | | | are installed if already mounted | 
> > > > + | | | | outside SWUpdate should be umounted | 
> > > > + 
> > > 
> > 
> +-------------+----------+------------+---------------------------------------+ 
>
> > > > | preserve-\ | bool | files | flag to control whether the 
> > > following | 
> > > > | attributes | | | attributes will be preserved when | 
> > > > | | | | files are unpacked from an archive | 
> > > > diff --git a/handlers/archive_handler.c 
> > b/handlers/archive_handler.c 
> > > > index e3a1463..553287f 100644 
> > > > --- a/handlers/archive_handler.c 
> > > > +++ b/handlers/archive_handler.c 
> > > > @@ -228,6 +228,7 @@ static int install_archive_image(struct 
> > > img_type *img, 
> > > > struct extract_data tf; 
> > > > pthread_attr_t attr; 
> > > > int use_mount = (strlen(img->device) && 
> > strlen(img->filesystem)) 
> > > ? 1 : 0; 
> > > > + int use_umount = img->umount; 
> > > > int is_mounted = 0; 
> > > > int exitval = -EFAULT; 
> > > > char *DATADST_DIR = NULL; 
> > > > @@ -380,6 +381,13 @@ out: 
> > > > } 
> > > > } 
> > > > 
> > > > + if (use_umount && !use_mount) { 
> > > > + ret = swupdate_umount(img->path); 
> > > > + if (ret) { 
> > > > + TRACE("Failed to unmount directory %s", img->path); 
> > > > + } 
> > > > + } 
> > > > + 
> > > > free(DATADST_DIR); 
> > > > free(FIFO); 
> > > > 
> > > > diff --git a/include/swupdate.h b/include/swupdate.h 
> > > > index 4cce892..89f64ea 100644 
> > > > --- a/include/swupdate.h 
> > > > +++ b/include/swupdate.h 
> > > > @@ -81,6 +81,7 @@ struct img_type { 
> > > > int provided; 
> > > > int compressed; 
> > > > int preserve_attributes; /* whether to preserve attributes in 
> > > archives */ 
> > > > + bool umount; 
> > > > bool is_encrypted; 
> > > > char ivt_ascii[33]; 
> > > > int install_directly; 
> > > > diff --git a/parser/parser.c b/parser/parser.c 
> > > > index 5607031..81f69be 100644 
> > > > --- a/parser/parser.c 
> > > > +++ b/parser/parser.c 
> > > > @@ -436,6 +436,7 @@ static int 
> > parse_common_attributes(parsertype 
> > > p, void *elem, struct img_type *im 
> > > > } 
> > > > get_field(p, elem, "installed-directly", 
> > &image->install_directly); 
> > > > get_field(p, elem, "preserve-attributes", 
> > > &image->preserve_attributes); 
> > > > + get_field(p, elem, "umount", &image->umount); 
> > > > get_field(p, elem, "install-if-different", 
> > > &image->id.install_if_different); 
> > > > get_field(p, elem, "install-if-higher", 
> > > &image->id.install_if_higher); 
> > > > get_field(p, elem, "encrypted", &image->is_encrypted); 
> > > 
> > > -- 
> > > 
> > ===================================================================== 
> > > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
> > > HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, 
> > Germany 
> > > Phone: +49-8142-66989-53 <+49%208142%206698953> 
> <tel:+49%208142%206698953> 
> > <tel:+49%208142%206698953> Fax: 
> > > +49-8142-66989-80 <+49%208142%206698980> <tel:+49%208142%206698980> 
> > <tel:+49%208142%206698980> Email: sba...@denx.de 
> > > 
> > ===================================================================== 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the 
> > Google 
> > > Groups "swupdate" group. 
> > > To unsubscribe from this group and stop receiving emails from 
> > it, send 
> > > an email to swupdate+u...@googlegroups.com 
> > > <mailto:swupdate+u...@googlegroups.com>. 
> > > To view this discussion on the web visit 
> > > 
> > 
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com> 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer>>. 
>
> > 
> > -- 
> > ===================================================================== 
> > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
> > HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany 
> > Phone: +49-8142-66989-53 <+49%208142%206698953> 
> <tel:+49%208142%206698953> Fax: 
> > +49-8142-66989-80 <+49%208142%206698980> <tel:+49%208142%206698980> 
> Email: sba...@denx.de 
> > ===================================================================== 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "swupdate" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to swupdate+u...@googlegroups.com 
> > <mailto:swupdate+u...@googlegroups.com>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com 
> <
> https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com?utm_medium=email&utm_source=footer>. 
>
>
Stefano Babic Nov. 10, 2022, 8:03 a.m. UTC | #9
Hi Ayoub,

On 10.11.22 08:39, 'ayoub...@googlemail.com' via swupdate wrote:
> Hi,
> 
> On Thursday, November 10, 2022 at 8:20:23 AM UTC+1 Stefano Babic wrote:
> 
>     Hi Ayoub,
> 
>     On 10.11.22 08:00, 'ayoub...@googlemail.com' via swupdate wrote:
>      > Hello Stefano,
>      >
>      > I did a manual update :
>      >
>      > # kernel update on dormant kernel volume kernel_r
>      > $ ubiupdatevol /dev/ubi0_3 fitImage
>      >
>      > # rootfs update on dormant mounted volume rootfs_r on /var/update
>      > $ tar xf some-image-rootfs-tar.bz2 -C /var/update/
>      >
>      > # ubirename without umounting /var/update !!
>      > $ ubirename /dev/ubi0 kernel kernel_r kernel_r kernel rootfs
>     rootfs_r
>      > rootfs_r rootfs
>      >
>      >
>      > I couldn't see any warnings or errors on dmesg and after reboot
>      > everything is fine.
>      >
> 
>     Ok
> 
>      > It's likely an error/bug in swupdate ubi swap volume handler, for
>     info
>      > I'm using mtd-utils 2.1.4 and kernel 5.10.116
> 
>     But you said that you face a kernel error (oops or panic). If this is
>     the case, there is an issue in kernel, a user space application should
>     never produce this. If you see a SEGV or another error, well, we
>     have to
>     check here.
> 
> 
> Here is a stack trace:
> [ ============================================================ ] 3 of 4 
> 100% (fitImage), dwl 0% of 0 bytes-------------- ] 3 of 4 0% (fitImage), 
> dwl 0% of 0 bytes
> Nov 10 07:29:17 stm32mp157c systemd-journald[338]: Forwarding to syslog 
> missed 61 messages.
> Nov 10 07:31:00 stm32mp157c swupdate[428]: [TRACE] : SWUPDATE running : 
>   [swap_volume] : swap UBI volume kernel_r <-> kernel
> Nov 10 07:31:00 stm32mp157c swupdate[428]: [TRACE] : SWUPDATE running : 
>   [swap_volume] : swap UBI volume rootfs_r <-> rootfs
> Nov 10 07:31:00 stm32mp157c systemd-journald[338]: Forwarding to syslog 
> missed 2 messages.
> Nov 10 07:31:01 stm32mp157c kernel: ------------[ cut here ]------------
> Nov 10 07:31:01 stm32mp157c kernel: WARNING: CPU: 0 PID: 7 at 
> drivers/mtd/nand/raw/internals.h:134 nand_prog_page_end_op+0x1f8/0x210
> Nov 10 07:31:01 stm32mp157c kernel: Modules linked in:
> Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 Not 
> tainted 5.10.116 #1
> Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> Support)
> Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> (flush-ubifs_0_2)
> Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> [<c0109ed4>] (show_stack+0x10/0x14)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> [<c08f837c>] (dump_stack+0xc4/0xd8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> [<c08f428c>] (__warn+0xc0/0xd8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c08f428c>] (__warn) from 
> [<c08f4308>] (warn_slowpath_fmt+0x64/0xc0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c08f4308>] (warn_slowpath_fmt) 
> from [<c05daae0>] (nand_prog_page_end_op+0x1f8/0x210)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05daae0>] (nand_prog_page_end_op) 
> from [<c05d945c>] (nand_do_write_ops+0x2d8/0x44c)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05d945c>] (nand_do_write_ops) 
> from [<c05ddb00>] (nand_write_oob+0x50/0x80)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05ddb00>] (nand_write_oob) from 
> [<c05ceffc>] (mtd_write+0x64/0x88)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05ceffc>] (mtd_write) from 
> [<c05fa9cc>] (ubi_io_write+0x108/0x664)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05fa9cc>] (ubi_io_write) from 
> [<c05f80c0>] (ubi_eba_write_leb+0x2a0/0x80c)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05f80c0>] (ubi_eba_write_leb) 
> from [<c05f65b0>] (ubi_leb_write+0xd0/0xe8)

We are definetly in kernel, as at first glance this does not happen when 
volumes are swapped, but when the data are flushed. The last calls in 
the backtrace are related to the NAND driver, and then we are not sure 
if this issue is related to UBI or probably to the STM's NAND driver.

You can check if the issue is related to swap in the handler: just let 
the swap and remove the update of rootfs from sw-description. If the 
issue is relkated to swap when a UBIFS is mounted, you should still see 
these warnings.

It will be also interesting if there is some race condition between 
writing into UBIFS and swapping the volumes. I would also sugggest to 
add a delay after writing rootfs and before the ubiswap takes place. You 
can just add it into the ubiswap handler before starting.

> Nov 10 07:31:01 stm32mp157c kernel: [<c05f65b0>] (ubi_leb_write) from 
> [<c0387af4>] (ubifs_leb_write+0xa0/0x110)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0387af4>] (ubifs_leb_write) from 
> [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> from [<c037ea78>] (do_writepage+0x98/0x288)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> [<c0200a84>] (__writepage+0x14/0x68)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> [<c0202b98>] (write_cache_pages+0x194/0x3d4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> from [<c0203854>] (do_writepages+0xa4/0xe0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> (__writeback_single_inode) from [<c029a090>] 
> (writeback_sb_inodes+0x1f4/0x424)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> from [<c029a530>] (wb_writeback+0x194/0x1d8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> [<c029b37c>] (wb_workfn+0x23c/0x3a4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> [<c0131e74>] (process_one_work+0x1c8/0x420)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> [<c0132118>] (worker_thread+0x4c/0x520)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> [<c0137cf4>] (kthread+0x150/0x190)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> [<c0100148>] (ret_from_fork+0x14/0x2c)
> Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> 0xc1055ff8)
> Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                               
>        00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> 00000000 00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> 00000000 00000013 00000000
> Nov 10 07:31:01 stm32mp157c kernel: ---[ end trace 13062db303db52c6 ]---
> Nov 10 07:31:01 stm32mp157c kernel: ubi0 error: ubi_io_write: error -22 
> while writing 4096 bytes to PEB 1475:200704, written 0 bytes
> Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> Tainted: G        W         5.10.116 #1
> Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> Support)
> Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> (flush-ubifs_0_2)
> Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> [<c0109ed4>] (show_stack+0x10/0x14)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> [<c08f837c>] (dump_stack+0xc4/0xd8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> [<c05fadb8>] (ubi_io_write+0x4f4/0x664)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05fadb8>] (ubi_io_write) from 
> [<c05f80c0>] (ubi_eba_write_leb+0x2a0/0x80c)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05f80c0>] (ubi_eba_write_leb) 
> from [<c05f65b0>] (ubi_leb_write+0xd0/0xe8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05f65b0>] (ubi_leb_write) from 
> [<c0387af4>] (ubifs_leb_write+0xa0/0x110)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0387af4>] (ubifs_leb_write) from 
> [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> from [<c037ea78>] (do_writepage+0x98/0x288)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> [<c0200a84>] (__writepage+0x14/0x68)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> [<c0202b98>] (write_cache_pages+0x194/0x3d4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> from [<c0203854>] (do_writepages+0xa4/0xe0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> (__writeback_single_inode) from [<c029a090>] 
> (writeback_sb_inodes+0x1f4/0x424)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> from [<c029a530>] (wb_writeback+0x194/0x1d8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> [<c029b37c>] (wb_workfn+0x23c/0x3a4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> [<c0131e74>] (process_one_work+0x1c8/0x420)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> [<c0132118>] (worker_thread+0x4c/0x520)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> [<c0137cf4>] (kthread+0x150/0x190)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> [<c0100148>] (ret_from_fork+0x14/0x2c)
> Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> 0xc1055ff8)
> Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                               
>        00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> 00000000 00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> 00000000 00000013 00000000
> Nov 10 07:31:01 stm32mp157c kernel: ubi0: dumping 4096 bytes of data 
> from PEB 1475, offset 200704
> Nov 10 07:31:01 stm32mp157c kernel: 00000000: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000020: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000040: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000060: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000080: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000000a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000000c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000000e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000100: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000120: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000140: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000160: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000180: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000001a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000001c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000001e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000200: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000220: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000240: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000260: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000280: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000002a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000002c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000002e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000300: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000320: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000340: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000360: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000380: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000003a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000003c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000003e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000400: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000420: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000440: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000460: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000480: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000004a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000004c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000004e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000500: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000520: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000540: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000560: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000580: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000005a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000005c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000005e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000600: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000620: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000640: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000660: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000680: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000006a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000006c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000006e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000700: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000720: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000740: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000760: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000780: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000007a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000007c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000007e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000800: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000820: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000840: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000860: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000880: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000008a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000008c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000008e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000900: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000920: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000940: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000960: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000980: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000009a0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000009c0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 000009e0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000a00: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000a20: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000a40: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000a60: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000a80: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000aa0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000ac0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000ae0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000b00: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000b20: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000b40: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000b60: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000b80: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000ba0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000bc0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000be0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000c00: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000c20: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000c40: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000c60: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000c80: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000ca0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000cc0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000ce0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000d00: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000d20: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000d40: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000d60: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000d80: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000da0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000dc0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000de0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000e00: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000e20: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000e40: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000e60: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000e80: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000ea0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000ec0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000ee0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000f00: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000f20: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000f40: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000f60: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000f80: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000fa0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000fc0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: 00000fe0: ff ff ff ff ff ff ff ff ff 
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
>   ................................
> Nov 10 07:31:01 stm32mp157c kernel: ubi0 warning: ubi_eba_write_leb: 
> failed to write data to PEB 1475
> Nov 10 07:31:01 stm32mp157c kernel: ubi0 warning: ubi_ro_mode.part.0: 
> switch to read-only mode
> Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> Tainted: G        W         5.10.116 #1
> Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> Support)
> Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> (flush-ubifs_0_2)
> Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> [<c0109ed4>] (show_stack+0x10/0x14)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> [<c08f837c>] (dump_stack+0xc4/0xd8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> [<c05f8538>] (ubi_eba_write_leb+0x718/0x80c)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05f8538>] (ubi_eba_write_leb) 
> from [<c05f65b0>] (ubi_leb_write+0xd0/0xe8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c05f65b0>] (ubi_leb_write) from 
> [<c0387af4>] (ubifs_leb_write+0xa0/0x110)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0387af4>] (ubifs_leb_write) from 
> [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> from [<c037ea78>] (do_writepage+0x98/0x288)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> [<c0200a84>] (__writepage+0x14/0x68)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> [<c0202b98>] (write_cache_pages+0x194/0x3d4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> from [<c0203854>] (do_writepages+0xa4/0xe0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> (__writeback_single_inode) from [<c029a090>] 
> (writeback_sb_inodes+0x1f4/0x424)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> from [<c029a530>] (wb_writeback+0x194/0x1d8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> [<c029b37c>] (wb_workfn+0x23c/0x3a4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> [<c0131e74>] (process_one_work+0x1c8/0x420)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> [<c0132118>] (worker_thread+0x4c/0x520)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> [<c0137cf4>] (kthread+0x150/0x190)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> [<c0100148>] (ret_from_fork+0x14/0x2c)
> Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> 0xc1055ff8)
> Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                               
>        00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> 00000000 00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> 00000000 00000013 00000000
> Nov 10 07:31:01 stm32mp157c kernel: UBIFS error (ubi0:2 pid 7): 
> ubifs_leb_write: writing 4096 bytes to LEB 1270:192512 failed, error -22
> Nov 10 07:31:01 stm32mp157c kernel: UBIFS warning (ubi0:2 pid 7): 
> ubifs_ro_mode.part.0: switched to read-only mode, error -22
> Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> Tainted: G        W         5.10.116 #1
> Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> Support)
> Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> (flush-ubifs_0_2)
> Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> [<c0109ed4>] (show_stack+0x10/0x14)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> [<c08f837c>] (dump_stack+0xc4/0xd8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> [<c0387b5c>] (ubifs_leb_write+0x108/0x110)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0387b5c>] (ubifs_leb_write) from 
> [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> from [<c037ea78>] (do_writepage+0x98/0x288)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> [<c0200a84>] (__writepage+0x14/0x68)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> [<c0202b98>] (write_cache_pages+0x194/0x3d4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> from [<c0203854>] (do_writepages+0xa4/0xe0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> (__writeback_single_inode) from [<c029a090>] 
> (writeback_sb_inodes+0x1f4/0x424)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> from [<c029a530>] (wb_writeback+0x194/0x1d8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> [<c029b37c>] (wb_workfn+0x23c/0x3a4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> [<c0131e74>] (process_one_work+0x1c8/0x420)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> [<c0132118>] (worker_thread+0x4c/0x520)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> [<c0137cf4>] (kthread+0x150/0x190)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> [<c0100148>] (ret_from_fork+0x14/0x2c)
> Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> 0xc1055ff8)
> Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                               
>        00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> 00000000 00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> 00000000 00000013 00000000
> Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> Tainted: G        W         5.10.116 #1
> Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> Support)
> Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> (flush-ubifs_0_2)
> Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> [<c0109ed4>] (show_stack+0x10/0x14)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> [<c08f837c>] (dump_stack+0xc4/0xd8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> [<c0387b60>] (ubifs_leb_write+0x10c/0x110)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0387b60>] (ubifs_leb_write) from 
> [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> from [<c037ea78>] (do_writepage+0x98/0x288)
> Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> [<c0200a84>] (__writepage+0x14/0x68)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> [<c0202b98>] (write_cache_pages+0x194/0x3d4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> from [<c0203854>] (do_writepages+0xa4/0xe0)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> (__writeback_single_inode) from [<c029a090>] 
> (writeback_sb_inodes+0x1f4/0x424)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> from [<c029a530>] (wb_writeback+0x194/0x1d8)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> [<c029b37c>] (wb_workfn+0x23c/0x3a4)
> Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> [<c0131e74>] (process_one_work+0x1c8/0x420)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> [<c0132118>] (worker_thread+0x4c/0x520)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> [<c0137cf4>] (kthread+0x150/0x190)
> Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> [<c0100148>] (ret_from_fork+0x14/0x2c)
> Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> 0xc1055ff8)
> Nov 10 07:31:01 stm32mp157c kernel: 5fa0:                               
>        00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> 00000000 00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> 00000000 00000013 00000000
> Nov 10 07:31:01 stm32mp157c kernel: UBIFS error (ubi0:2 pid 7): 
> ubifs_wbuf_write_nolock: cannot write 1960 bytes to LEB 1270:192512, 
> error -22

So I doubt this is produce by swapping, it looks like this happens when 
your rootfs is updated.

IMHO the umount you force does this: everything is flushed before umount 
is returning, and when a swap is done, nothing is written into the flash.

> Nov 10 07:31:01 stm32mp157c kernel:       magic          0x6101831
> Nov 10 07:31:01 stm32mp157c kernel:       crc            0xd0a08cd3
> Nov 10 07:31:01 stm32mp157c kernel:       node_type      1 (data node)
> Nov 10 07:31:01 stm32mp157c kernel:       group_type     0 (no node group)
> Nov 10 07:31:01 stm32mp157c kernel:       sqnum          816863
> Nov 10 07:31:01 stm32mp157c kernel:       len            1904
> Nov 10 07:31:01 stm32mp157c kernel:       key            (45694, data, 39)
> Nov 10 07:31:01 stm32mp157c kernel:       size           4096
> Nov 10 07:31:01 stm32mp157c kernel:       compr_typ      1
> Nov 10 07:31:01 stm32mp157c kernel:       data size      1856
> Nov 10 07:31:01 stm32mp157c kernel:       data:
> Nov 10 07:31:01 stm32mp157c kernel:       00000000: b9 a9 cd 50 b3 ab 27 
> 4d 9e ca 9b f2 a6 a1 e3 47 c4 bd a8 1e 8d 6a 28 d7 f6 8e d3 68 1b 0f 73 86
> Nov 10 07:31:01 stm32mp157c kernel:       00000020: 8d fd 7b 5e 1a f9 e5 
> da 71 6c 86 d3 b0 af 4d 8b f7 15 d0 48 2e e0 17 a2 1f c9 26 84 1a f8 b6 99
> Nov 10 07:31:01 stm32mp157c kernel:       00000040: 6b 63 8e 9f 23 09 24 
> 58 ea 31 f0 30 ae da e6 dc 65 8d 8b 18 6d f2 79 50 67 1b c6 8f c0 2d 0e d6
> Nov 10 07:31:01 stm32mp157c kernel:       00000060: 96 bf 34 44 4c 78 13 
> b2 cf 2c 0b e6 59 bb 1f ef 49 05 da ff 4a 1a 3a 0b 71 f8 19 c8 fb 96 29 fd
> Nov 10 07:31:01 stm32mp157c kernel:       00000080: 3e cc 50 94 60 fd c0 
> 63 7c 42 b2 86 62 b5 18 4e e5 60 83 ee d6 0f b3 7b a5 1e 93 70 8f 8f d5 19
> Nov 10 07:31:01 stm32mp157c kernel:       000000a0: 2a 15 1a 8b 68 5c d8 
> 03 b5 43 9d bb d4 1a d3 38 8b 45 03 60 ad 8e 61 3d e1 60 49 ae 22 e6 52 84
> Nov 10 07:31:01 stm32mp157c kernel:       000000c0: 97 90 bd 4a c4 29 45 
> 08 d9 3f 68 7f 37 d9 de cf 47 a7 af 10 6a 65 99 d6 e9 e8 a4 7c de 3e cd 44
> Nov 10 07:31:01 stm32mp157c kernel:       000000e0: 16 52 c2 3d ea 90 b8 
> 0a 8f 1c a1 35 25 92 e7 68 08 60 b6 3f ad 40 a9 2d 5e 7d bb 0d 04 e0 15 e8
> Nov 10 07:31:01 stm32mp157c kernel:       00000100: ae a7 48 5d 92 83 61 
> 0d 95 83 5e 99 1f e5 40 4b ce 6d 85 d1 c4 de 69 91 05 46 ed e7 39 68 c5 f0
> Nov 10 07:31:01 stm32mp157c kernel:       00000120: e1 df 73 c3 e4 ff b2 
> 1e 6d b2 ab b8 bd 40 c6 91 92 8d 3a 82 94 0b 22 62 c4 91 b9 92 21 03 22 88
> Nov 10 07:31:01 stm32mp157c kernel:       00000140: a4 22 77 fa 54 93 c7 
> c5 18 33 e3 fa 8b 2b 7b 0b 05 39 8f db ea b1 5d 28 c9 b5 27 c6 3f e9 f6 c0
> Nov 10 07:31:01 stm32mp157c kernel:       00000160: ae d6 2f 2b 16 6a 6c 
> 53 f1 34 c5 82 24 93 5f 3e 31 d8 f0 7f 72 64 f1 4f 1b ba 23 e4 81 1a 59 14
> Nov 10 07:31:01 stm32mp157c kernel:       00000180: 6c a2 df 87 e2 9e 5a 
> f1 5b 1b cf 71 27 dc 40 4a ee ea 91 cd be 4f 93 a7 bc ac 93 38 92 f0 51 5a
> Nov 10 07:31:01 stm32mp157c kernel:       000001a0: db 1a 3f ea 50 a4 6b 
> 77 7a cc 88 24 5d c7 6c 9f ef 86 48 be 9f d3 f0 99 f6 d9 69 2f 4e b4 a1 fc
> Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6b 74 df b4 94 3f 1a 
> 7c 8d 85 9e ea bd 2a 9a 7e 3f 94 6c c5 30 89 a1 01 13 98 0e ce 38 d3 27 dd
> Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 85 a3 89 12 b1 18 b9 
> 3a b7 28 1f f0 61 da 5a 69 db 27 58 b5 8d bc 25 d2 63 ba ec 01 30 4a 39 bc
> Nov 10 07:31:01 stm32mp157c kernel:       00000200: cc a8 df 88 f5 fa 1f 
> e2 fd 75 e2 43 8d b3 f9 4a 92 39 da be 77 92 45 d7 1a 6e c4 4f cf 69 d0 f7
> Nov 10 07:31:01 stm32mp157c kernel:       00000220: b3 5c b2 5c cb 0a e8 
> 26 be 54 0f 2f dc d5 19 3c 53 f4 13 83 b8 24 ae a9 01 c8 98 39 7a 88 bf 9e
> Nov 10 07:31:01 stm32mp157c kernel:       00000240: 04 3f ea 18 f3 d0 59 
> 10 79 4a cb bf 6c 44 a3 39 de 36 f7 c1 73 4b fb 5d 00 75 39 2c 79 00 42 f7
> Nov 10 07:31:01 stm32mp157c kernel:       00000260: 95 97 a5 f6 7e 2d 22 
> a4 ae d8 0c ab 87 b4 7d 7a 85 41 91 47 df 44 5d 19 a0 1c 99 ac e8 d1 2a 30
> Nov 10 07:31:01 stm32mp157c kernel:       00000280: 76 98 b3 80 5c 0c 21 
> 5b e7 5d 40 88 33 90 27 a6 72 7c f9 ff 34 34 02 b1 7e dc bb c2 91 c3 8b b3
> Nov 10 07:31:01 stm32mp157c kernel:       000002a0: 85 a0 2e 0c 27 93 a4 
> ec 0d d7 c3 98 28 4f 2c 7a 69 8c 60 b6 d0 81 2b 0b a9 a2 c4 34 4d 85 88 62
> Nov 10 07:31:01 stm32mp157c kernel:       000002c0: 0a f2 04 10 54 71 62 
> de 67 8c 4f 5c 27 3c f6 73 6f 2c 76 56 37 6c 97 e1 c0 88 fb 25 17 c6 ad 6f
> Nov 10 07:31:01 stm32mp157c kernel:       000002e0: 6d d3 b2 ab ff 5a 84 
> 1c 14 56 44 d1 4a 52 4d 96 b7 3a 92 7a 9a 49 8f 5c be 34 c0 8c 8b e5 0e e2
> Nov 10 07:31:01 stm32mp157c kernel:       00000300: a3 65 23 73 cd 65 b3 
> c9 79 0c 48 12 70 81 56 4c 87 95 9c 9e 32 fd b7 36 11 4a 5e 26 83 36 9c 27
> Nov 10 07:31:01 stm32mp157c kernel:       00000320: 26 04 77 e3 49 79 e5 
> bb af 97 07 6a 54 06 c7 ce 03 8b 42 9f 41 02 ab a3 c6 fe ad 91 d0 7f 10 65
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 7 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel:       00000420: e7 1c a7 71 61 5c 2a 
> f5 9e de f2 ed ad 3f df e0 71 40 d4 33 ac 13 89 2d dc 41 40 ff c4 9f 43 21
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 11 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel:       000005a0: 76 6c 8f 5e 3b a6 e8 
> f4 0c 1c 23 18 f8 19 14 95 0a 7e 55 c5 be ac a7 d4 bb 4b 2d 64 6f ed 2b 58
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 12 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> Tainted: G        W         5.10.116 #1
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 22 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> 00000000 00000000 00000000 00000000 00000000
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 23 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel:       00000100: 23 c9 81 a9 5f c4 6d 
> b1 32 51 79 78 a6 00 9f c8 53 7c 31 34 0c 8b 45 32 7a f2 1a 35 5b 46 fc 68
> Nov 10 07:31:01 stm32mp157c kernel:       00000120: b9 f0 59 d5 eb 42 e9 
> ad d0 c0 a8 06 f3 c3 a2 88 d8 79 52 83 0b 83 59 6d 28 0d 47 c6 cf 00 37 f3
> Nov 10 07:31:01 stm32mp157c kernel:       00000140: 7f eb dc df bc 45 61 
> 5b ea 8e 36 90 09 4d 8d 72 1c 98 49 a4 03 79 cd f4 33 c6 d9 12 01 3f 8f 73
> Nov 10 07:31:01 stm32mp157c kernel:       00000160: ad d3 ea cf 72 d4 b0 
> 7a e2 02 63 14 f5 f3 75 8c fe 06 a2 1f 67 5d 97 19 a0 39 14 51 cd 7e 86 ac
> Nov 10 07:31:01 stm32mp157c kernel:       00000180: b5 5a 32 0b ca 0c fb 
> db 76 02 ba 0c 38 26 3b 5f d1 59 69 8a 2a b3 86 b1 8f 6d e7 58 ee 29 9c f5
> Nov 10 07:31:01 stm32mp157c kernel:       000001a0: b1 60 c9 5c 35 79 57 
> 0c dc c4 85 be 1f 5c 67 97 e3 cb 56 e7 4d 63 25 dd 7b 2b a3 28 f4 5b 16 91
> Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6c 33 40 00 ec d9 6d 
> e0 1b 98 fe 28 2f 78 e7 b4 49 dc 73 d0 d1 d8 c2 c7 2b 6c aa c1 e6 b3 fd ac
> Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 73 6d 91 35 d1 f6 22 
> d5 5a 15 8e 27 9e 27 03 09 c2 fc 6b 23 30 4e 86 02 1d 7e cd 1d 2a 37 15 15
> Nov 10 07:31:01 stm32mp157c kernel:       00000200: 7e 66 a1 58 5a 91 74 
> b9 cd 76 be 3d d7 86 20 88 9d 08 78 ab f8 30 07 59 ff 89 0d 35 1d b0 e5 d7
> Nov 10 07:31:01 stm32mp157c kernel:       00000220: 93 bb 89 66 df 28 5e 
> 44 38 f3 0d 9b e6 4a 2c 7c 22 13 f5 c4 b3 68 0e ed 08 c1 80 f2 38 33 33 f3
> Nov 10 07:31:01 stm32mp157c kernel:       00000240: 59 c3 05 f4 d8 00 fd 
> 11 14 f6 da 82 50 b6 b8 e9 2f f4 08 d6 b6 5b 10 f0 57 bd cb ef 90 ef e0 75
> Nov 10 07:31:01 stm32mp157c kernel:       00000260: bd d0 71 91 21 54 86 
> ba c4 85 01 3c 64 ac 42 dd ba 56 2c 56 7c 86 bb 7f 75 ac dd 86 bb 36 ae 27
> Nov 10 07:31:01 stm32mp157c kernel:       00000280: d9 89 10 1b 29 d8 c6 
> e1 fc 6e bc b4 94 b4 20 e5 92 ed 7a fd 31 cd 91 17 a6 e3 d3 02 f2 81 e1 10
> Nov 10 07:31:01 stm32mp157c kernel:       000002a0: db 45 18 8a 60 40 be 
> 74 7b 65 42 42 b3 b6 39 86 c7 82 4f c3 97 ff 5c c2 33 0f c8 ba 8c f3 b7 c4
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 4 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel:       00000340: 3f ca 97 31 a7 0e de 
> e2 17 41 b1 a8 31 a1 c8 d4 ed 14 8a 9b d0 bc 53 6f c5 75 3a f1 27 cd 0b ce
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 8 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel:       00000460: 69 90 eb 76 c0 48 ce 
> fe 4c a2 a5 3f 8f 71 2f 73 c7 aa 6f 16 49 b8 57 3a 03 51 40 56 72 5c 93 f4
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 14 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel:       00000640: 01 0a 4e 73 e5 27 25 
> f6 2a b4 25 22 1d 7c df 8b bd b2 81 77 d0 f1 22 1f a6 a4 a7 cd d2 5a ad 47
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 10 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel:       000007a0: c3 35 eb ac 55 0b f7 
> 5a 2d 58 c6 9e f6 b7 02 c8 46 36 8b 1d 4c 0f 27 74 c9 f8 d7 90 a7 5d 30 45
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 13 kernel messages
> Nov 10 07:31:01 stm32mp157c kernel:       00000960: 72 1a 5a bf a1 f7 eb 
> 97 cb 84 4f f8 e4 5c 72 fd fb b0 64 d9 bf 79 09 ef b4 fd 87 73 d7 24 25 38
> Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 5 kernel messages
> 
> The worst is that SWUpdate is NOT failing and the board restart with a 
> faulty system !

SWUpdate relies on the system calls - if the kernel does not return an 
error, everything is fine. The kernel is not returning any error, the 
swap (ubi_rnvols) was successful. After that, the background thread is 
still working, and this is producing the error.

> 
> 
> 
>      >
>      >  here is my sw-description :
>      >
>      > software =
>      > {
>      >         version = "@@DISTRO_VERSION@@";
>      >
>      >         images:
>      >         (
>      >             {
>      >                 name = "tf-a";
>      >                 filename = "tf-a.stm32";
>      >                 mtdname = "fsbl1";
>      >                 type = "flash";
>      >                 encrypted = true;
>      >                 sha256 = "$swupdate_get_sha256(tf-a.stm32)";
>      >             },
>      >             {
>      >                 name = "fip";
>      >                 filename = "fip.bin";
>      >                 mtdname = "ssbl1";
>      >                 type = "flash";
>      >                 encrypted = true;
>      >                 sha256 = "$swupdate_get_sha256(fip.bin)";
>      >             },
>      >             {
>      >                 name = "kernel";
>      >                 filename = "fitImage";
>      >                 volume ="kernel_r";
>      >                 type = "ubivol";
>      >                 encrypted = true;
>      >                 properties: {
>      >                     decrypted-size = "@@FITIMAGE_DEC_SZ@@";
>      >                 }
>      >                 sha256 = "$swupdate_get_sha256(fitImage)";
>      >             },
>      >             {
>      >                 name = "rootfs";
>      >                 filename = "@@IMAGEBASE@@.tar.bz2";
>      >                 type = "archive";
>      >                 path = "/var/update";
>      >                 preserve-attributes = true;
>      >                 encrypted = true;
>      >                 sha256 =
>     "$swupdate_get_sha256(@@IMAGEBASE@@.tar.bz2)";
>      >             }
>      >         );
>      >
>      >         scripts:
>      >         (
>      >             {
>      >                 type = "ubiswap";
>      >                 properties: {
>      >                     swap-0 = [ "kernel" , "kernel_r" ];
>      >                     swap-1 = [ "rootfs" , "rootfs_r" ];
>      >                 },
>      >             },
>      >         );
>      > }
> 
>     The handler and ubirename have just a different way to get the volume's
>     id. SWUpdate like mtd-utils is using the libubi library provided by
>     mtd-utils, and both are executing the swap by calling ubi_rnvols().
> 
>     One major difference is that with SWUpdate you are swapping both kernel
>     and rootfs quite at the same time, while in the example above you swap
>     just one of them. Does it make a difference ?
> 
> 
> good hint I will check this one.

Best regards,
Stefano

> 
> Best
> -Ayoub
> 
> 
> 
>      >
>      > I agree with you the umount flag was just a workaround and the issue
>      > should be investigated.
>      >
> 
>     Right.
> 
>     Best regards,
>     Stefano
> 
>      > Best
>      >
>      > On Wednesday, November 9, 2022 at 4:57:27 PM UTC+1
>      > ayoub...@googlemail.com wrote:
>      >
>      > Hi Stefano,
>      >
>      >
>      > On Wednesday, November 9, 2022 at 3:34:23 PM UTC+1 Stefano Babic
>     wrote:
>      >
>      > Hi Ayoub,
>      >
>      > On 09.11.22 14:41, 'ayoub...@googlemail.com' via swupdate wrote:
>      > > Hi Stefano,
>      > >
>      > > Thanks for the feedback but I have a specific use case where
>      > this is
>      > > needed:
>      > >
>      > > I have an encrypted ubifs mounted outside swupdate under a
>      > fixed path
>      > > /var/update, the file system update is provided as tar file
>      > to be
>      > > unpacked under /var/update, the FS encryption is handled by
>      > fscrypt.
>      > > I prefer that swupdate doesn't perform the mount because it's
>      > a bit
>      > > tidy : secure storage interface, kernel keyring, fscrypt and
>      > so on...
>      > >
>      >
>      > Yes: it makes sense that filesystem is mounted outside SWUpdate,
>      > better
>      > in a ramdisk before booting.
>      >
>      > > before running the ubifs volumes swap in swupdate type =
>      > "ubiswap" the
>      > > /var/update partition need to be umounted otherwise the
>      > kernel crashes.
>      > >
>      >
>      > Ok - however, this looks an issue in kernel, and we want to
>      > work-around
>      > it in SWUpdate. The other way for you is to not use "ubiswap", and
>      > instead of it let toggle via U-Boot variables, setting
>      > CONFIG_ENV_FLAGS_LIST_STATIC in U-Boot to enable only the
>      > variables you
>      > need (or just one).
>      >
>      >
>      > I have completely disabled fwenv in uboot for security reasons
>      >
>      >
>      >
>      > Have you already reported this to MTD list and to Richard
>      > (Weinberger) ?
>      >
>      >
>      > I will try to report it to MTD List, for the moment it looks like my
>      > emails doesn't go through MTD ML.
>      > there have been other issues related to fscryptctl & mtd-utils that
>      > Richard checked on github.
>      >
>      >
>      >
>      > > this specific scenario is not handled by swupdate and can be
>      > fixed by
>      > > using the new flag : umount=true in the archive handler.
>      >
>      > Ok - I do not want to block it, but it will be nice to check
>      > options. In
>      > SWUpdate, I will suggest this behavior:
>      >
>      > - automatic umount should be done only if requested (as I said,
>      > I find
>      > the current behavior buggy)
>      > - the umount flag is also added and takes place to umount it,
>      > that is
>      > the rule should be
>      >
>      > if ((use_mount && is_mounted) || use_umount)
>      >
>      > - the flag is specific for the archive handler, so I would move
>      > it to
>      > properties, that is you enable it as:
>      >
>      > type = "archive";
>      > properties: {
>      > umount = "true";
>      > }
>      >
>      >
>      > I agree here to be specific to archive handler
>      >
>      > Then your your use case is covered by SWUpdate, but I will
>      > appreciate to
>      > discuss this with MTD developers, too.
>      >
>      >
>      >
>      > I will rework the patch following your suggestion and send a V2 and
>      > a new one with wiping out the destination folder before applying
>      > archives.
>      >
>      >
>      > Thanks
>      >
>      >
>      >
>      > Best regards,
>      > Stefano
>      >
>      > >
>      > > Best,
>      > > Ayoub
>      > >
>      > >
>      > >
>      > >
>      > > On Wednesday, November 9, 2022 at 2:09:58 PM UTC+1 Stefano
>      > Babic wrote:
>      > >
>      > > Hi Ayoub,
>      > >
>      > > On 09.11.22 13:46, Ayoub Zaki wrote:
>      > > > add new flag to control if path should be umounted
>      > > > this is only useful if the mount point specified by path is
>      > already
>      > > > mounted outside of swupdate.
>      > > >
>      > >
>      > > I see the issue but this is really more a bug than a
>      > requested feature.
>      > > SWUpdate is already able to do this: if the attribute
>      > "filesystem" is
>      > > set, SWUpdate will mount the filesystem and umount at the
>      > end. If
>      > > filesystem is missing, SWUpdate does not try to mount it.
>      > However, it
>      > > runs umount at the end, and this is not correct. SWUpdate
>      > should umount
>      > > if it has mounted before.
>      > >
>      > > IMHO it is enough to make the choice to umount the filesystem
>      > on depend
>      > > if mount was requested or not:
>      > >
>      > > Instead of:
>      > >
>      > > 376 if (is_mounted) {
>      > >
>      > > --- a/handlers/archive_handler.c
>      > > +++ b/handlers/archive_handler.c
>      > > @@ -373,7 +373,7 @@ out:
>      > > if (FIFO)
>      > > unlink(FIFO);
>      > >
>      > > - if (is_mounted) {
>      > > + if (use_mount && is_mounted) {
>      > > ret = swupdate_umount(DATADST_DIR);
>      > > if (ret) {
>      > > TRACE("Failed to unmount directory %s",
>      > > DATADST_DIR);
>      > >
>      > > Best regards,
>      > > Stefano Babic
>      > >
>      > > > Signed-off-by: Ayoub Zaki <ayoub...@embetrix.com>
>      > > > ---
>      > > > doc/source/sw-description.rst | 6 ++++++
>      > > > handlers/archive_handler.c | 8 ++++++++
>      > > > include/swupdate.h | 1 +
>      > > > parser/parser.c | 1 +
>      > > > 4 files changed, 16 insertions(+)
>      > > >
>      > > > diff --git a/doc/source/sw-description.rst
>      > > b/doc/source/sw-description.rst
>      > > > index a5182d6..13bba2e 100644
>      > > > --- a/doc/source/sw-description.rst
>      > > > +++ b/doc/source/sw-description.rst
>      > > > @@ -1319,6 +1319,12 @@ There are 4 main sections inside
>      > > sw-description:
>      > > > | | | | "filesystem" type. (path is always |
>      > > > | | | | relative to the mount point.) |
>      > > >
>      > >
>      >
>     +-------------+----------+------------+---------------------------------------+
>      > > > + | umount | bool | files | flag to control whether the
>      > given |
>      > > > + | | | | mount point specified by path |
>      > > > + | | | | (absolute) where the files are |
>      > > > + | | | | are installed if already mounted |
>      > > > + | | | | outside SWUpdate should be umounted |
>      > > > +
>      > >
>      >
>     +-------------+----------+------------+---------------------------------------+
>      > > > | preserve-\ | bool | files | flag to control whether the
>      > > following |
>      > > > | attributes | | | attributes will be preserved when |
>      > > > | | | | files are unpacked from an archive |
>      > > > diff --git a/handlers/archive_handler.c
>      > b/handlers/archive_handler.c
>      > > > index e3a1463..553287f 100644
>      > > > --- a/handlers/archive_handler.c
>      > > > +++ b/handlers/archive_handler.c
>      > > > @@ -228,6 +228,7 @@ static int install_archive_image(struct
>      > > img_type *img,
>      > > > struct extract_data tf;
>      > > > pthread_attr_t attr;
>      > > > int use_mount = (strlen(img->device) &&
>      > strlen(img->filesystem))
>      > > ? 1 : 0;
>      > > > + int use_umount = img->umount;
>      > > > int is_mounted = 0;
>      > > > int exitval = -EFAULT;
>      > > > char *DATADST_DIR = NULL;
>      > > > @@ -380,6 +381,13 @@ out:
>      > > > }
>      > > > }
>      > > >
>      > > > + if (use_umount && !use_mount) {
>      > > > + ret = swupdate_umount(img->path);
>      > > > + if (ret) {
>      > > > + TRACE("Failed to unmount directory %s", img->path);
>      > > > + }
>      > > > + }
>      > > > +
>      > > > free(DATADST_DIR);
>      > > > free(FIFO);
>      > > >
>      > > > diff --git a/include/swupdate.h b/include/swupdate.h
>      > > > index 4cce892..89f64ea 100644
>      > > > --- a/include/swupdate.h
>      > > > +++ b/include/swupdate.h
>      > > > @@ -81,6 +81,7 @@ struct img_type {
>      > > > int provided;
>      > > > int compressed;
>      > > > int preserve_attributes; /* whether to preserve attributes in
>      > > archives */
>      > > > + bool umount;
>      > > > bool is_encrypted;
>      > > > char ivt_ascii[33];
>      > > > int install_directly;
>      > > > diff --git a/parser/parser.c b/parser/parser.c
>      > > > index 5607031..81f69be 100644
>      > > > --- a/parser/parser.c
>      > > > +++ b/parser/parser.c
>      > > > @@ -436,6 +436,7 @@ static int
>      > parse_common_attributes(parsertype
>      > > p, void *elem, struct img_type *im
>      > > > }
>      > > > get_field(p, elem, "installed-directly",
>      > &image->install_directly);
>      > > > get_field(p, elem, "preserve-attributes",
>      > > &image->preserve_attributes);
>      > > > + get_field(p, elem, "umount", &image->umount);
>      > > > get_field(p, elem, "install-if-different",
>      > > &image->id.install_if_different);
>      > > > get_field(p, elem, "install-if-higher",
>      > > &image->id.install_if_higher);
>      > > > get_field(p, elem, "encrypted", &image->is_encrypted);
>      > >
>      > > --
>      > >
>      >
>     =====================================================================
>      > > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
>      > > HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell,
>      > Germany
>      > > Phone: +49-8142-66989-53 <tel:+49%208142%206698953>
>     <tel:+49%208142%206698953>
>      > <tel:+49%208142%206698953> Fax:
>      > > +49-8142-66989-80 <tel:+49%208142%206698980>
>     <tel:+49%208142%206698980>
>      > <tel:+49%208142%206698980> Email: sba...@denx.de
>      > >
>      >
>     =====================================================================
>      > >
>      > > --
>      > > You received this message because you are subscribed to the
>      > Google
>      > > Groups "swupdate" group.
>      > > To unsubscribe from this group and stop receiving emails from
>      > it, send
>      > > an email to swupdate+u...@googlegroups.com
>      > > <mailto:swupdate+u...@googlegroups.com>.
>      > > To view this discussion on the web visit
>      > >
>      >
>     https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com> <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com>> <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
>      >
>      > --
>      >
>     =====================================================================
>      > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
>      > HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
>      > Phone: +49-8142-66989-53 <tel:+49%208142%206698953>
>     <tel:+49%208142%206698953> Fax:
>      > +49-8142-66989-80 <tel:+49%208142%206698980>
>     <tel:+49%208142%206698980> Email: sba...@denx.de
>      >
>     =====================================================================
>      >
>      > --
>      > You received this message because you are subscribed to the Google
>      > Groups "swupdate" group.
>      > To unsubscribe from this group and stop receiving emails from it,
>     send
>      > an email to swupdate+u...@googlegroups.com
>      > <mailto:swupdate+u...@googlegroups.com>.
>      > To view this discussion on the web visit
>      >
>     https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com> <https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> 
> -- 
> You received this message because you are subscribed to the Google 
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to swupdate+unsubscribe@googlegroups.com 
> <mailto:swupdate+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/swupdate/f131ef32-8221-4e8c-9dee-e8fba7c1a6f5n%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/f131ef32-8221-4e8c-9dee-e8fba7c1a6f5n%40googlegroups.com?utm_medium=email&utm_source=footer>.
ayoub...@googlemail.com Nov. 10, 2022, 9:57 a.m. UTC | #10
Hello Stefano,

thanks for the valuable input and analysis

On Thursday, November 10, 2022 at 9:03:38 AM UTC+1 Stefano Babic wrote:

> Hi Ayoub, 
>
> On 10.11.22 08:39, 'ayoub...@googlemail.com' via swupdate wrote: 
> > Hi, 
> > 
> > On Thursday, November 10, 2022 at 8:20:23 AM UTC+1 Stefano Babic wrote: 
> > 
> > Hi Ayoub, 
> > 
> > On 10.11.22 08:00, 'ayoub...@googlemail.com' via swupdate wrote: 
> > > Hello Stefano, 
> > > 
> > > I did a manual update : 
> > > 
> > > # kernel update on dormant kernel volume kernel_r 
> > > $ ubiupdatevol /dev/ubi0_3 fitImage 
> > > 
> > > # rootfs update on dormant mounted volume rootfs_r on /var/update 
> > > $ tar xf some-image-rootfs-tar.bz2 -C /var/update/ 
> > > 
> > > # ubirename without umounting /var/update !! 
> > > $ ubirename /dev/ubi0 kernel kernel_r kernel_r kernel rootfs 
> > rootfs_r 
> > > rootfs_r rootfs 
> > > 
> > > 
> > > I couldn't see any warnings or errors on dmesg and after reboot 
> > > everything is fine. 
> > > 
> > 
> > Ok 
> > 
> > > It's likely an error/bug in swupdate ubi swap volume handler, for 
> > info 
> > > I'm using mtd-utils 2.1.4 and kernel 5.10.116 
> > 
> > But you said that you face a kernel error (oops or panic). If this is 
> > the case, there is an issue in kernel, a user space application should 
> > never produce this. If you see a SEGV or another error, well, we 
> > have to 
> > check here. 
> > 
> > 
> > Here is a stack trace: 
> > [ ============================================================ ] 3 of 4 
> > 100% (fitImage), dwl 0% of 0 bytes-------------- ] 3 of 4 0% (fitImage), 
> > dwl 0% of 0 bytes 
> > Nov 10 07:29:17 stm32mp157c systemd-journald[338]: Forwarding to syslog 
> > missed 61 messages. 
> > Nov 10 07:31:00 stm32mp157c swupdate[428]: [TRACE] : SWUPDATE running : 
> >  [swap_volume] : swap UBI volume kernel_r <-> kernel 
> > Nov 10 07:31:00 stm32mp157c swupdate[428]: [TRACE] : SWUPDATE running : 
> >  [swap_volume] : swap UBI volume rootfs_r <-> rootfs 
> > Nov 10 07:31:00 stm32mp157c systemd-journald[338]: Forwarding to syslog 
> > missed 2 messages. 
> > Nov 10 07:31:01 stm32mp157c kernel: ------------[ cut here ]------------ 
> > Nov 10 07:31:01 stm32mp157c kernel: WARNING: CPU: 0 PID: 7 at 
> > drivers/mtd/nand/raw/internals.h:134 nand_prog_page_end_op+0x1f8/0x210 
> > Nov 10 07:31:01 stm32mp157c kernel: Modules linked in: 
> > Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 Not 
> > tainted 5.10.116 #1 
> > Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> > Support) 
> > Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> > (flush-ubifs_0_2) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> > [<c0109ed4>] (show_stack+0x10/0x14) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> > [<c08f837c>] (dump_stack+0xc4/0xd8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> > [<c08f428c>] (__warn+0xc0/0xd8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c08f428c>] (__warn) from 
> > [<c08f4308>] (warn_slowpath_fmt+0x64/0xc0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c08f4308>] (warn_slowpath_fmt) 
> > from [<c05daae0>] (nand_prog_page_end_op+0x1f8/0x210) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05daae0>] (nand_prog_page_end_op) 
> > from [<c05d945c>] (nand_do_write_ops+0x2d8/0x44c) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05d945c>] (nand_do_write_ops) 
> > from [<c05ddb00>] (nand_write_oob+0x50/0x80) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05ddb00>] (nand_write_oob) from 
> > [<c05ceffc>] (mtd_write+0x64/0x88) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05ceffc>] (mtd_write) from 
> > [<c05fa9cc>] (ubi_io_write+0x108/0x664) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05fa9cc>] (ubi_io_write) from 
> > [<c05f80c0>] (ubi_eba_write_leb+0x2a0/0x80c) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05f80c0>] (ubi_eba_write_leb) 
> > from [<c05f65b0>] (ubi_leb_write+0xd0/0xe8) 
>
> We are definetly in kernel, as at first glance this does not happen when 
> volumes are swapped, but when the data are flushed. The last calls in 
> the backtrace are related to the NAND driver, and then we are not sure 
> if this issue is related to UBI or probably to the STM's NAND driver. 
>
> You can check if the issue is related to swap in the handler: just let 
> the swap and remove the update of rootfs from sw-description. If the 
> issue is relkated to swap when a UBIFS is mounted, you should still see 
> these warnings.



I had it running for months without any problems  before introducing 
fscrypt/ubifs file system encryption.
I think that something is quirky with UBIFS+Fscrypt or STM's NAND driver or 
the combination.


>
> It will be also interesting if there is some race condition between 
> writing into UBIFS and swapping the volumes. I would also sugggest to 
> add a delay after writing rootfs and before the ubiswap takes place. You 
> can just add it into the ubiswap handler before starting. 
>
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05f65b0>] (ubi_leb_write) from 
> > [<c0387af4>] (ubifs_leb_write+0xa0/0x110) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0387af4>] (ubifs_leb_write) from 
> > [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> > (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> > [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> > from [<c037ea78>] (do_writepage+0x98/0x288) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> > [<c0200a84>] (__writepage+0x14/0x68) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> > [<c0202b98>] (write_cache_pages+0x194/0x3d4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> > from [<c0203854>] (do_writepages+0xa4/0xe0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> > [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> > (__writeback_single_inode) from [<c029a090>] 
> > (writeback_sb_inodes+0x1f4/0x424) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> > from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> > from [<c029a530>] (wb_writeback+0x194/0x1d8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> > [<c029b37c>] (wb_workfn+0x23c/0x3a4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> > [<c0131e74>] (process_one_work+0x1c8/0x420) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> > [<c0132118>] (worker_thread+0x4c/0x520) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> > [<c0137cf4>] (kthread+0x150/0x190) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> > [<c0100148>] (ret_from_fork+0x14/0x2c) 
> > Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> > 0xc1055ff8) 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fa0: 
> >       00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> > 00000000 00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> > 00000000 00000013 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: ---[ end trace 13062db303db52c6 ]--- 
> > Nov 10 07:31:01 stm32mp157c kernel: ubi0 error: ubi_io_write: error -22 
> > while writing 4096 bytes to PEB 1475:200704, written 0 bytes 
> > Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> > Tainted: G        W         5.10.116 #1 
> > Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> > Support) 
> > Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> > (flush-ubifs_0_2) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> > [<c0109ed4>] (show_stack+0x10/0x14) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> > [<c08f837c>] (dump_stack+0xc4/0xd8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> > [<c05fadb8>] (ubi_io_write+0x4f4/0x664) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05fadb8>] (ubi_io_write) from 
> > [<c05f80c0>] (ubi_eba_write_leb+0x2a0/0x80c) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05f80c0>] (ubi_eba_write_leb) 
> > from [<c05f65b0>] (ubi_leb_write+0xd0/0xe8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05f65b0>] (ubi_leb_write) from 
> > [<c0387af4>] (ubifs_leb_write+0xa0/0x110) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0387af4>] (ubifs_leb_write) from 
> > [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> > (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> > [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> > from [<c037ea78>] (do_writepage+0x98/0x288) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> > [<c0200a84>] (__writepage+0x14/0x68) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> > [<c0202b98>] (write_cache_pages+0x194/0x3d4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> > from [<c0203854>] (do_writepages+0xa4/0xe0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> > [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> > (__writeback_single_inode) from [<c029a090>] 
> > (writeback_sb_inodes+0x1f4/0x424) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> > from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> > from [<c029a530>] (wb_writeback+0x194/0x1d8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> > [<c029b37c>] (wb_workfn+0x23c/0x3a4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> > [<c0131e74>] (process_one_work+0x1c8/0x420) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> > [<c0132118>] (worker_thread+0x4c/0x520) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> > [<c0137cf4>] (kthread+0x150/0x190) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> > [<c0100148>] (ret_from_fork+0x14/0x2c) 
> > Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> > 0xc1055ff8) 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fa0: 
> >       00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> > 00000000 00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> > 00000000 00000013 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: ubi0: dumping 4096 bytes of data 
> > from PEB 1475, offset 200704 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000000: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000020: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000040: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000060: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000080: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000000a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000000c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000000e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000100: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000120: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000140: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000160: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000180: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000001a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000001c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000001e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000200: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000220: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000240: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000260: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000280: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000002a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000002c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000002e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000300: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000320: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000340: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000360: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000380: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000003a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000003c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000003e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000400: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000420: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000440: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000460: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000480: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000004a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000004c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000004e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000500: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000520: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000540: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000560: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000580: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000005a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000005c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000005e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000600: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000620: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000640: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000660: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000680: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000006a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000006c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000006e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000700: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000720: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000740: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000760: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000780: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000007a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000007c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000007e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000800: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000820: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000840: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000860: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000880: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000008a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000008c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000008e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000900: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000920: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000940: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000960: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000980: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000009a0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000009c0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 000009e0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000a00: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000a20: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000a40: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000a60: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000a80: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000aa0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000ac0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000ae0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000b00: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000b20: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000b40: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000b60: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000b80: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000ba0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000bc0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000be0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000c00: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000c20: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000c40: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000c60: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000c80: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000ca0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000cc0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000ce0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000d00: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000d20: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000d40: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000d60: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000d80: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000da0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000dc0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000de0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000e00: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000e20: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000e40: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000e60: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000e80: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000ea0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000ec0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000ee0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000f00: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000f20: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000f40: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000f60: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000f80: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000fa0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000fc0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: 00000fe0: ff ff ff ff ff ff ff ff ff 
> > ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
> >  ................................ 
> > Nov 10 07:31:01 stm32mp157c kernel: ubi0 warning: ubi_eba_write_leb: 
> > failed to write data to PEB 1475 
> > Nov 10 07:31:01 stm32mp157c kernel: ubi0 warning: ubi_ro_mode.part.0: 
> > switch to read-only mode 
> > Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> > Tainted: G        W         5.10.116 #1 
> > Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> > Support) 
> > Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> > (flush-ubifs_0_2) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> > [<c0109ed4>] (show_stack+0x10/0x14) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> > [<c08f837c>] (dump_stack+0xc4/0xd8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> > [<c05f8538>] (ubi_eba_write_leb+0x718/0x80c) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05f8538>] (ubi_eba_write_leb) 
> > from [<c05f65b0>] (ubi_leb_write+0xd0/0xe8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c05f65b0>] (ubi_leb_write) from 
> > [<c0387af4>] (ubifs_leb_write+0xa0/0x110) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0387af4>] (ubifs_leb_write) from 
> > [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> > (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> > [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> > from [<c037ea78>] (do_writepage+0x98/0x288) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> > [<c0200a84>] (__writepage+0x14/0x68) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> > [<c0202b98>] (write_cache_pages+0x194/0x3d4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> > from [<c0203854>] (do_writepages+0xa4/0xe0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> > [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> > (__writeback_single_inode) from [<c029a090>] 
> > (writeback_sb_inodes+0x1f4/0x424) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> > from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> > from [<c029a530>] (wb_writeback+0x194/0x1d8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> > [<c029b37c>] (wb_workfn+0x23c/0x3a4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> > [<c0131e74>] (process_one_work+0x1c8/0x420) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> > [<c0132118>] (worker_thread+0x4c/0x520) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> > [<c0137cf4>] (kthread+0x150/0x190) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> > [<c0100148>] (ret_from_fork+0x14/0x2c) 
> > Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> > 0xc1055ff8) 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fa0: 
> >       00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> > 00000000 00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> > 00000000 00000013 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: UBIFS error (ubi0:2 pid 7): 
> > ubifs_leb_write: writing 4096 bytes to LEB 1270:192512 failed, error -22 
> > Nov 10 07:31:01 stm32mp157c kernel: UBIFS warning (ubi0:2 pid 7): 
> > ubifs_ro_mode.part.0: switched to read-only mode, error -22 
> > Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> > Tainted: G        W         5.10.116 #1 
> > Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> > Support) 
> > Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> > (flush-ubifs_0_2) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> > [<c0109ed4>] (show_stack+0x10/0x14) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> > [<c08f837c>] (dump_stack+0xc4/0xd8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> > [<c0387b5c>] (ubifs_leb_write+0x108/0x110) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0387b5c>] (ubifs_leb_write) from 
> > [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> > (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> > [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> > from [<c037ea78>] (do_writepage+0x98/0x288) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> > [<c0200a84>] (__writepage+0x14/0x68) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> > [<c0202b98>] (write_cache_pages+0x194/0x3d4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> > from [<c0203854>] (do_writepages+0xa4/0xe0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> > [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> > (__writeback_single_inode) from [<c029a090>] 
> > (writeback_sb_inodes+0x1f4/0x424) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> > from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> > from [<c029a530>] (wb_writeback+0x194/0x1d8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> > [<c029b37c>] (wb_workfn+0x23c/0x3a4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> > [<c0131e74>] (process_one_work+0x1c8/0x420) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> > [<c0132118>] (worker_thread+0x4c/0x520) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> > [<c0137cf4>] (kthread+0x150/0x190) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> > [<c0100148>] (ret_from_fork+0x14/0x2c) 
> > Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> > 0xc1055ff8) 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fa0: 
> >       00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> > 00000000 00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> > 00000000 00000013 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> > Tainted: G        W         5.10.116 #1 
> > Nov 10 07:31:01 stm32mp157c kernel: Hardware name: STM32 (Device Tree 
> > Support) 
> > Nov 10 07:31:01 stm32mp157c kernel: Workqueue: writeback wb_workfn 
> > (flush-ubifs_0_2) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c010d494>] (unwind_backtrace) from 
> > [<c0109ed4>] (show_stack+0x10/0x14) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0109ed4>] (show_stack) from 
> > [<c08f837c>] (dump_stack+0xc4/0xd8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c08f837c>] (dump_stack) from 
> > [<c0387b60>] (ubifs_leb_write+0x10c/0x110) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0387b60>] (ubifs_leb_write) from 
> > [<c0388d40>] (ubifs_wbuf_write_nolock+0x318/0x7e4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0388d40>] 
> > (ubifs_wbuf_write_nolock) from [<c037a2f8>] (write_head+0x140/0x1c0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037a2f8>] (write_head) from 
> > [<c037ad54>] (ubifs_jnl_write_data+0x1d4/0x324) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ad54>] (ubifs_jnl_write_data) 
> > from [<c037ea78>] (do_writepage+0x98/0x288) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c037ea78>] (do_writepage) from 
> > [<c0200a84>] (__writepage+0x14/0x68) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0200a84>] (__writepage) from 
> > [<c0202b98>] (write_cache_pages+0x194/0x3d4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0202b98>] (write_cache_pages) 
> > from [<c0203854>] (do_writepages+0xa4/0xe0) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0203854>] (do_writepages) from 
> > [<c0299a54>] (__writeback_single_inode+0x2c/0x1ac) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0299a54>] 
> > (__writeback_single_inode) from [<c029a090>] 
> > (writeback_sb_inodes+0x1f4/0x424) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a090>] (writeback_sb_inodes) 
> > from [<c029a2f8>] (__writeback_inodes_wb+0x38/0xdc) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a2f8>] (__writeback_inodes_wb) 
> > from [<c029a530>] (wb_writeback+0x194/0x1d8) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029a530>] (wb_writeback) from 
> > [<c029b37c>] (wb_workfn+0x23c/0x3a4) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c029b37c>] (wb_workfn) from 
> > [<c0131e74>] (process_one_work+0x1c8/0x420) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0131e74>] (process_one_work) from 
> > [<c0132118>] (worker_thread+0x4c/0x520) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0132118>] (worker_thread) from 
> > [<c0137cf4>] (kthread+0x150/0x190) 
> > Nov 10 07:31:01 stm32mp157c kernel: [<c0137cf4>] (kthread) from 
> > [<c0100148>] (ret_from_fork+0x14/0x2c) 
> > Nov 10 07:31:01 stm32mp157c kernel: Exception stack(0xc1055fb0 to 
> > 0xc1055ff8) 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fa0: 
> >       00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> > 00000000 00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fe0: 00000000 00000000 00000000 
> > 00000000 00000013 00000000 
> > Nov 10 07:31:01 stm32mp157c kernel: UBIFS error (ubi0:2 pid 7): 
> > ubifs_wbuf_write_nolock: cannot write 1960 bytes to LEB 1270:192512, 
> > error -22 
>
> So I doubt this is produce by swapping, it looks like this happens when 
> your rootfs is updated. 
>
> IMHO the umount you force does this: everything is flushed before umount 
> is returning, and when a swap is done, nothing is written into the flash.



maybe I can call a sync() to force flushing at the end archive handler ?  
shouldn't be that added in swupdate ?



>
> > Nov 10 07:31:01 stm32mp157c kernel:       magic          0x6101831 
> > Nov 10 07:31:01 stm32mp157c kernel:       crc            0xd0a08cd3 
> > Nov 10 07:31:01 stm32mp157c kernel:       node_type      1 (data node) 
> > Nov 10 07:31:01 stm32mp157c kernel:       group_type     0 (no node 
> group) 
> > Nov 10 07:31:01 stm32mp157c kernel:       sqnum          816863 
> > Nov 10 07:31:01 stm32mp157c kernel:       len            1904 
> > Nov 10 07:31:01 stm32mp157c kernel:       key            (45694, data, 
> 39) 
> > Nov 10 07:31:01 stm32mp157c kernel:       size           4096 
> > Nov 10 07:31:01 stm32mp157c kernel:       compr_typ      1 
> > Nov 10 07:31:01 stm32mp157c kernel:       data size      1856 
> > Nov 10 07:31:01 stm32mp157c kernel:       data: 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000000: b9 a9 cd 50 b3 ab 27 
> > 4d 9e ca 9b f2 a6 a1 e3 47 c4 bd a8 1e 8d 6a 28 d7 f6 8e d3 68 1b 0f 73 
> 86 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000020: 8d fd 7b 5e 1a f9 e5 
> > da 71 6c 86 d3 b0 af 4d 8b f7 15 d0 48 2e e0 17 a2 1f c9 26 84 1a f8 b6 
> 99 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000040: 6b 63 8e 9f 23 09 24 
> > 58 ea 31 f0 30 ae da e6 dc 65 8d 8b 18 6d f2 79 50 67 1b c6 8f c0 2d 0e 
> d6 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000060: 96 bf 34 44 4c 78 13 
> > b2 cf 2c 0b e6 59 bb 1f ef 49 05 da ff 4a 1a 3a 0b 71 f8 19 c8 fb 96 29 
> fd 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000080: 3e cc 50 94 60 fd c0 
> > 63 7c 42 b2 86 62 b5 18 4e e5 60 83 ee d6 0f b3 7b a5 1e 93 70 8f 8f d5 
> 19 
> > Nov 10 07:31:01 stm32mp157c kernel:       000000a0: 2a 15 1a 8b 68 5c d8 
> > 03 b5 43 9d bb d4 1a d3 38 8b 45 03 60 ad 8e 61 3d e1 60 49 ae 22 e6 52 
> 84 
> > Nov 10 07:31:01 stm32mp157c kernel:       000000c0: 97 90 bd 4a c4 29 45 
> > 08 d9 3f 68 7f 37 d9 de cf 47 a7 af 10 6a 65 99 d6 e9 e8 a4 7c de 3e cd 
> 44 
> > Nov 10 07:31:01 stm32mp157c kernel:       000000e0: 16 52 c2 3d ea 90 b8 
> > 0a 8f 1c a1 35 25 92 e7 68 08 60 b6 3f ad 40 a9 2d 5e 7d bb 0d 04 e0 15 
> e8 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000100: ae a7 48 5d 92 83 61 
> > 0d 95 83 5e 99 1f e5 40 4b ce 6d 85 d1 c4 de 69 91 05 46 ed e7 39 68 c5 
> f0 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000120: e1 df 73 c3 e4 ff b2 
> > 1e 6d b2 ab b8 bd 40 c6 91 92 8d 3a 82 94 0b 22 62 c4 91 b9 92 21 03 22 
> 88 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000140: a4 22 77 fa 54 93 c7 
> > c5 18 33 e3 fa 8b 2b 7b 0b 05 39 8f db ea b1 5d 28 c9 b5 27 c6 3f e9 f6 
> c0 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000160: ae d6 2f 2b 16 6a 6c 
> > 53 f1 34 c5 82 24 93 5f 3e 31 d8 f0 7f 72 64 f1 4f 1b ba 23 e4 81 1a 59 
> 14 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000180: 6c a2 df 87 e2 9e 5a 
> > f1 5b 1b cf 71 27 dc 40 4a ee ea 91 cd be 4f 93 a7 bc ac 93 38 92 f0 51 
> 5a 
> > Nov 10 07:31:01 stm32mp157c kernel:       000001a0: db 1a 3f ea 50 a4 6b 
> > 77 7a cc 88 24 5d c7 6c 9f ef 86 48 be 9f d3 f0 99 f6 d9 69 2f 4e b4 a1 
> fc 
> > Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6b 74 df b4 94 3f 1a 
> > 7c 8d 85 9e ea bd 2a 9a 7e 3f 94 6c c5 30 89 a1 01 13 98 0e ce 38 d3 27 
> dd 
> > Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 85 a3 89 12 b1 18 b9 
> > 3a b7 28 1f f0 61 da 5a 69 db 27 58 b5 8d bc 25 d2 63 ba ec 01 30 4a 39 
> bc 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000200: cc a8 df 88 f5 fa 1f 
> > e2 fd 75 e2 43 8d b3 f9 4a 92 39 da be 77 92 45 d7 1a 6e c4 4f cf 69 d0 
> f7 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000220: b3 5c b2 5c cb 0a e8 
> > 26 be 54 0f 2f dc d5 19 3c 53 f4 13 83 b8 24 ae a9 01 c8 98 39 7a 88 bf 
> 9e 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000240: 04 3f ea 18 f3 d0 59 
> > 10 79 4a cb bf 6c 44 a3 39 de 36 f7 c1 73 4b fb 5d 00 75 39 2c 79 00 42 
> f7 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000260: 95 97 a5 f6 7e 2d 22 
> > a4 ae d8 0c ab 87 b4 7d 7a 85 41 91 47 df 44 5d 19 a0 1c 99 ac e8 d1 2a 
> 30 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000280: 76 98 b3 80 5c 0c 21 
> > 5b e7 5d 40 88 33 90 27 a6 72 7c f9 ff 34 34 02 b1 7e dc bb c2 91 c3 8b 
> b3 
> > Nov 10 07:31:01 stm32mp157c kernel:       000002a0: 85 a0 2e 0c 27 93 a4 
> > ec 0d d7 c3 98 28 4f 2c 7a 69 8c 60 b6 d0 81 2b 0b a9 a2 c4 34 4d 85 88 
> 62 
> > Nov 10 07:31:01 stm32mp157c kernel:       000002c0: 0a f2 04 10 54 71 62 
> > de 67 8c 4f 5c 27 3c f6 73 6f 2c 76 56 37 6c 97 e1 c0 88 fb 25 17 c6 ad 
> 6f 
> > Nov 10 07:31:01 stm32mp157c kernel:       000002e0: 6d d3 b2 ab ff 5a 84 
> > 1c 14 56 44 d1 4a 52 4d 96 b7 3a 92 7a 9a 49 8f 5c be 34 c0 8c 8b e5 0e 
> e2 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000300: a3 65 23 73 cd 65 b3 
> > c9 79 0c 48 12 70 81 56 4c 87 95 9c 9e 32 fd b7 36 11 4a 5e 26 83 36 9c 
> 27 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000320: 26 04 77 e3 49 79 e5 
> > bb af 97 07 6a 54 06 c7 ce 03 8b 42 9f 41 02 ab a3 c6 fe ad 91 d0 7f 10 
> 65 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 7 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000420: e7 1c a7 71 61 5c 2a 
> > f5 9e de f2 ed ad 3f df e0 71 40 d4 33 ac 13 89 2d dc 41 40 ff c4 9f 43 
> 21 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 11 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel:       000005a0: 76 6c 8f 5e 3b a6 e8 
> > f4 0c 1c 23 18 f8 19 14 95 0a 7e 55 c5 be ac a7 d4 bb 4b 2d 64 6f ed 2b 
> 58 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 12 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0 
> > Tainted: G        W         5.10.116 #1 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 22 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000 
> > 00000000 00000000 00000000 00000000 00000000 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 23 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000100: 23 c9 81 a9 5f c4 6d 
> > b1 32 51 79 78 a6 00 9f c8 53 7c 31 34 0c 8b 45 32 7a f2 1a 35 5b 46 fc 
> 68 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000120: b9 f0 59 d5 eb 42 e9 
> > ad d0 c0 a8 06 f3 c3 a2 88 d8 79 52 83 0b 83 59 6d 28 0d 47 c6 cf 00 37 
> f3 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000140: 7f eb dc df bc 45 61 
> > 5b ea 8e 36 90 09 4d 8d 72 1c 98 49 a4 03 79 cd f4 33 c6 d9 12 01 3f 8f 
> 73 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000160: ad d3 ea cf 72 d4 b0 
> > 7a e2 02 63 14 f5 f3 75 8c fe 06 a2 1f 67 5d 97 19 a0 39 14 51 cd 7e 86 
> ac 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000180: b5 5a 32 0b ca 0c fb 
> > db 76 02 ba 0c 38 26 3b 5f d1 59 69 8a 2a b3 86 b1 8f 6d e7 58 ee 29 9c 
> f5 
> > Nov 10 07:31:01 stm32mp157c kernel:       000001a0: b1 60 c9 5c 35 79 57 
> > 0c dc c4 85 be 1f 5c 67 97 e3 cb 56 e7 4d 63 25 dd 7b 2b a3 28 f4 5b 16 
> 91 
> > Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6c 33 40 00 ec d9 6d 
> > e0 1b 98 fe 28 2f 78 e7 b4 49 dc 73 d0 d1 d8 c2 c7 2b 6c aa c1 e6 b3 fd 
> ac 
> > Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 73 6d 91 35 d1 f6 22 
> > d5 5a 15 8e 27 9e 27 03 09 c2 fc 6b 23 30 4e 86 02 1d 7e cd 1d 2a 37 15 
> 15 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000200: 7e 66 a1 58 5a 91 74 
> > b9 cd 76 be 3d d7 86 20 88 9d 08 78 ab f8 30 07 59 ff 89 0d 35 1d b0 e5 
> d7 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000220: 93 bb 89 66 df 28 5e 
> > 44 38 f3 0d 9b e6 4a 2c 7c 22 13 f5 c4 b3 68 0e ed 08 c1 80 f2 38 33 33 
> f3 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000240: 59 c3 05 f4 d8 00 fd 
> > 11 14 f6 da 82 50 b6 b8 e9 2f f4 08 d6 b6 5b 10 f0 57 bd cb ef 90 ef e0 
> 75 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000260: bd d0 71 91 21 54 86 
> > ba c4 85 01 3c 64 ac 42 dd ba 56 2c 56 7c 86 bb 7f 75 ac dd 86 bb 36 ae 
> 27 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000280: d9 89 10 1b 29 d8 c6 
> > e1 fc 6e bc b4 94 b4 20 e5 92 ed 7a fd 31 cd 91 17 a6 e3 d3 02 f2 81 e1 
> 10 
> > Nov 10 07:31:01 stm32mp157c kernel:       000002a0: db 45 18 8a 60 40 be 
> > 74 7b 65 42 42 b3 b6 39 86 c7 82 4f c3 97 ff 5c c2 33 0f c8 ba 8c f3 b7 
> c4 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 4 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000340: 3f ca 97 31 a7 0e de 
> > e2 17 41 b1 a8 31 a1 c8 d4 ed 14 8a 9b d0 bc 53 6f c5 75 3a f1 27 cd 0b 
> ce 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 8 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000460: 69 90 eb 76 c0 48 ce 
> > fe 4c a2 a5 3f 8f 71 2f 73 c7 aa 6f 16 49 b8 57 3a 03 51 40 56 72 5c 93 
> f4 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 14 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000640: 01 0a 4e 73 e5 27 25 
> > f6 2a b4 25 22 1d 7c df 8b bd b2 81 77 d0 f1 22 1f a6 a4 a7 cd d2 5a ad 
> 47 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 10 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel:       000007a0: c3 35 eb ac 55 0b f7 
> > 5a 2d 58 c6 9e f6 b7 02 c8 46 36 8b 1d 4c 0f 27 74 c9 f8 d7 90 a7 5d 30 
> 45 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 13 kernel 
> messages 
> > Nov 10 07:31:01 stm32mp157c kernel:       00000960: 72 1a 5a bf a1 f7 eb 
> > 97 cb 84 4f f8 e4 5c 72 fd fb b0 64 d9 bf 79 09 ef b4 fd 87 73 d7 24 25 
> 38 
> > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 5 kernel 
> messages 
> > 
> > The worst is that SWUpdate is NOT failing and the board restart with a 
> > faulty system ! 
>
> SWUpdate relies on the system calls - if the kernel does not return an 
> error, everything is fine. The kernel is not returning any error, the 
> swap (ubi_rnvols) was successful. After that, the background thread is 
> still working, and this is producing the error. 
>
>
you are right swupdate could not know.
  

> > 
> > 
> > 
> > > 
> > >  here is my sw-description : 
> > > 
> > > software = 
> > > { 
> > >         version = "@@DISTRO_VERSION@@"; 
> > > 
> > >         images: 
> > >         ( 
> > >             { 
> > >                 name = "tf-a"; 
> > >                 filename = "tf-a.stm32"; 
> > >                 mtdname = "fsbl1"; 
> > >                 type = "flash"; 
> > >                 encrypted = true; 
> > >                 sha256 = "$swupdate_get_sha256(tf-a.stm32)"; 
> > >             }, 
> > >             { 
> > >                 name = "fip"; 
> > >                 filename = "fip.bin"; 
> > >                 mtdname = "ssbl1"; 
> > >                 type = "flash"; 
> > >                 encrypted = true; 
> > >                 sha256 = "$swupdate_get_sha256(fip.bin)"; 
> > >             }, 
> > >             { 
> > >                 name = "kernel"; 
> > >                 filename = "fitImage"; 
> > >                 volume ="kernel_r"; 
> > >                 type = "ubivol"; 
> > >                 encrypted = true; 
> > >                 properties: { 
> > >                     decrypted-size = "@@FITIMAGE_DEC_SZ@@"; 
> > >                 } 
> > >                 sha256 = "$swupdate_get_sha256(fitImage)"; 
> > >             }, 
> > >             { 
> > >                 name = "rootfs"; 
> > >                 filename = "@@IMAGEBASE@@.tar.bz2"; 
> > >                 type = "archive"; 
> > >                 path = "/var/update"; 
> > >                 preserve-attributes = true; 
> > >                 encrypted = true; 
> > >                 sha256 = 
> > "$swupdate_get_sha256(@@IMAGEBASE@@.tar.bz2)"; 
> > >             } 
> > >         ); 
> > > 
> > >         scripts: 
> > >         ( 
> > >             { 
> > >                 type = "ubiswap"; 
> > >                 properties: { 
> > >                     swap-0 = [ "kernel" , "kernel_r" ]; 
> > >                     swap-1 = [ "rootfs" , "rootfs_r" ]; 
> > >                 }, 
> > >             }, 
> > >         ); 
> > > } 
> > 
> > The handler and ubirename have just a different way to get the volume's 
> > id. SWUpdate like mtd-utils is using the libubi library provided by 
> > mtd-utils, and both are executing the swap by calling ubi_rnvols(). 
> > 
> > One major difference is that with SWUpdate you are swapping both kernel 
> > and rootfs quite at the same time, while in the example above you swap 
> > just one of them. Does it make a difference ? 
> > 
> > 
> > good hint I will check this one. 
>
> Best regards, 
> Stefano 
>
> > 
> > Best 
> > -Ayoub 
> > 
> > 
> > 
> > > 
> > > I agree with you the umount flag was just a workaround and the issue 
> > > should be investigated. 
> > > 
> > 
> > Right. 
> > 
> > Best regards, 
> > Stefano 
> > 
> > > Best 
> > > 
> > > On Wednesday, November 9, 2022 at 4:57:27 PM UTC+1 
> > > ayoub...@googlemail.com wrote: 
> > > 
> > > Hi Stefano, 
> > > 
> > > 
> > > On Wednesday, November 9, 2022 at 3:34:23 PM UTC+1 Stefano Babic 
> > wrote: 
> > > 
> > > Hi Ayoub, 
> > > 
> > > On 09.11.22 14:41, 'ayoub...@googlemail.com' via swupdate wrote: 
> > > > Hi Stefano, 
> > > > 
> > > > Thanks for the feedback but I have a specific use case where 
> > > this is 
> > > > needed: 
> > > > 
> > > > I have an encrypted ubifs mounted outside swupdate under a 
> > > fixed path 
> > > > /var/update, the file system update is provided as tar file 
> > > to be 
> > > > unpacked under /var/update, the FS encryption is handled by 
> > > fscrypt. 
> > > > I prefer that swupdate doesn't perform the mount because it's 
> > > a bit 
> > > > tidy : secure storage interface, kernel keyring, fscrypt and 
> > > so on... 
> > > > 
> > > 
> > > Yes: it makes sense that filesystem is mounted outside SWUpdate, 
> > > better 
> > > in a ramdisk before booting. 
> > > 
> > > > before running the ubifs volumes swap in swupdate type = 
> > > "ubiswap" the 
> > > > /var/update partition need to be umounted otherwise the 
> > > kernel crashes. 
> > > > 
> > > 
> > > Ok - however, this looks an issue in kernel, and we want to 
> > > work-around 
> > > it in SWUpdate. The other way for you is to not use "ubiswap", and 
> > > instead of it let toggle via U-Boot variables, setting 
> > > CONFIG_ENV_FLAGS_LIST_STATIC in U-Boot to enable only the 
> > > variables you 
> > > need (or just one). 
> > > 
> > > 
> > > I have completely disabled fwenv in uboot for security reasons 
> > > 
> > > 
> > > 
> > > Have you already reported this to MTD list and to Richard 
> > > (Weinberger) ? 
> > > 
> > > 
> > > I will try to report it to MTD List, for the moment it looks like my 
> > > emails doesn't go through MTD ML. 
> > > there have been other issues related to fscryptctl & mtd-utils that 
> > > Richard checked on github. 
> > > 
> > > 
> > > 
> > > > this specific scenario is not handled by swupdate and can be 
> > > fixed by 
> > > > using the new flag : umount=true in the archive handler. 
> > > 
> > > Ok - I do not want to block it, but it will be nice to check 
> > > options. In 
> > > SWUpdate, I will suggest this behavior: 
> > > 
> > > - automatic umount should be done only if requested (as I said, 
> > > I find 
> > > the current behavior buggy) 
> > > - the umount flag is also added and takes place to umount it, 
> > > that is 
> > > the rule should be 
> > > 
> > > if ((use_mount && is_mounted) || use_umount) 
> > > 
> > > - the flag is specific for the archive handler, so I would move 
> > > it to 
> > > properties, that is you enable it as: 
> > > 
> > > type = "archive"; 
> > > properties: { 
> > > umount = "true"; 
> > > } 
> > > 
> > > 
> > > I agree here to be specific to archive handler 
> > > 
> > > Then your your use case is covered by SWUpdate, but I will 
> > > appreciate to 
> > > discuss this with MTD developers, too. 
> > > 
> > > 
> > > 
> > > I will rework the patch following your suggestion and send a V2 and 
> > > a new one with wiping out the destination folder before applying 
> > > archives. 
> > > 
> > > 
> > > Thanks 
> > > 
> > > 
> > > 
> > > Best regards, 
> > > Stefano 
> > > 
> > > > 
> > > > Best, 
> > > > Ayoub 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > On Wednesday, November 9, 2022 at 2:09:58 PM UTC+1 Stefano 
> > > Babic wrote: 
> > > > 
> > > > Hi Ayoub, 
> > > > 
> > > > On 09.11.22 13:46, Ayoub Zaki wrote: 
> > > > > add new flag to control if path should be umounted 
> > > > > this is only useful if the mount point specified by path is 
> > > already 
> > > > > mounted outside of swupdate. 
> > > > > 
> > > > 
> > > > I see the issue but this is really more a bug than a 
> > > requested feature. 
> > > > SWUpdate is already able to do this: if the attribute 
> > > "filesystem" is 
> > > > set, SWUpdate will mount the filesystem and umount at the 
> > > end. If 
> > > > filesystem is missing, SWUpdate does not try to mount it. 
> > > However, it 
> > > > runs umount at the end, and this is not correct. SWUpdate 
> > > should umount 
> > > > if it has mounted before. 
> > > > 
> > > > IMHO it is enough to make the choice to umount the filesystem 
> > > on depend 
> > > > if mount was requested or not: 
> > > > 
> > > > Instead of: 
> > > > 
> > > > 376 if (is_mounted) { 
> > > > 
> > > > --- a/handlers/archive_handler.c 
> > > > +++ b/handlers/archive_handler.c 
> > > > @@ -373,7 +373,7 @@ out: 
> > > > if (FIFO) 
> > > > unlink(FIFO); 
> > > > 
> > > > - if (is_mounted) { 
> > > > + if (use_mount && is_mounted) { 
> > > > ret = swupdate_umount(DATADST_DIR); 
> > > > if (ret) { 
> > > > TRACE("Failed to unmount directory %s", 
> > > > DATADST_DIR); 
> > > > 
> > > > Best regards, 
> > > > Stefano Babic 
> > > > 
> > > > > Signed-off-by: Ayoub Zaki <ayoub...@embetrix.com> 
> > > > > --- 
> > > > > doc/source/sw-description.rst | 6 ++++++ 
> > > > > handlers/archive_handler.c | 8 ++++++++ 
> > > > > include/swupdate.h | 1 + 
> > > > > parser/parser.c | 1 + 
> > > > > 4 files changed, 16 insertions(+) 
> > > > > 
> > > > > diff --git a/doc/source/sw-description.rst 
> > > > b/doc/source/sw-description.rst 
> > > > > index a5182d6..13bba2e 100644 
> > > > > --- a/doc/source/sw-description.rst 
> > > > > +++ b/doc/source/sw-description.rst 
> > > > > @@ -1319,6 +1319,12 @@ There are 4 main sections inside 
> > > > sw-description: 
> > > > > | | | | "filesystem" type. (path is always | 
> > > > > | | | | relative to the mount point.) | 
> > > > > 
> > > > 
> > > 
> > 
> +-------------+----------+------------+---------------------------------------+ 
>
> > > > > + | umount | bool | files | flag to control whether the 
> > > given | 
> > > > > + | | | | mount point specified by path | 
> > > > > + | | | | (absolute) where the files are | 
> > > > > + | | | | are installed if already mounted | 
> > > > > + | | | | outside SWUpdate should be umounted | 
> > > > > + 
> > > > 
> > > 
> > 
> +-------------+----------+------------+---------------------------------------+ 
>
> > > > > | preserve-\ | bool | files | flag to control whether the 
> > > > following | 
> > > > > | attributes | | | attributes will be preserved when | 
> > > > > | | | | files are unpacked from an archive | 
> > > > > diff --git a/handlers/archive_handler.c 
> > > b/handlers/archive_handler.c 
> > > > > index e3a1463..553287f 100644 
> > > > > --- a/handlers/archive_handler.c 
> > > > > +++ b/handlers/archive_handler.c 
> > > > > @@ -228,6 +228,7 @@ static int install_archive_image(struct 
> > > > img_type *img, 
> > > > > struct extract_data tf; 
> > > > > pthread_attr_t attr; 
> > > > > int use_mount = (strlen(img->device) && 
> > > strlen(img->filesystem)) 
> > > > ? 1 : 0; 
> > > > > + int use_umount = img->umount; 
> > > > > int is_mounted = 0; 
> > > > > int exitval = -EFAULT; 
> > > > > char *DATADST_DIR = NULL; 
> > > > > @@ -380,6 +381,13 @@ out: 
> > > > > } 
> > > > > } 
> > > > > 
> > > > > + if (use_umount && !use_mount) { 
> > > > > + ret = swupdate_umount(img->path); 
> > > > > + if (ret) { 
> > > > > + TRACE("Failed to unmount directory %s", img->path); 
> > > > > + } 
> > > > > + } 
> > > > > + 
> > > > > free(DATADST_DIR); 
> > > > > free(FIFO); 
> > > > > 
> > > > > diff --git a/include/swupdate.h b/include/swupdate.h 
> > > > > index 4cce892..89f64ea 100644 
> > > > > --- a/include/swupdate.h 
> > > > > +++ b/include/swupdate.h 
> > > > > @@ -81,6 +81,7 @@ struct img_type { 
> > > > > int provided; 
> > > > > int compressed; 
> > > > > int preserve_attributes; /* whether to preserve attributes in 
> > > > archives */ 
> > > > > + bool umount; 
> > > > > bool is_encrypted; 
> > > > > char ivt_ascii[33]; 
> > > > > int install_directly; 
> > > > > diff --git a/parser/parser.c b/parser/parser.c 
> > > > > index 5607031..81f69be 100644 
> > > > > --- a/parser/parser.c 
> > > > > +++ b/parser/parser.c 
> > > > > @@ -436,6 +436,7 @@ static int 
> > > parse_common_attributes(parsertype 
> > > > p, void *elem, struct img_type *im 
> > > > > } 
> > > > > get_field(p, elem, "installed-directly", 
> > > &image->install_directly); 
> > > > > get_field(p, elem, "preserve-attributes", 
> > > > &image->preserve_attributes); 
> > > > > + get_field(p, elem, "umount", &image->umount); 
> > > > > get_field(p, elem, "install-if-different", 
> > > > &image->id.install_if_different); 
> > > > > get_field(p, elem, "install-if-higher", 
> > > > &image->id.install_if_higher); 
> > > > > get_field(p, elem, "encrypted", &image->is_encrypted); 
> > > > 
> > > > -- 
> > > > 
> > > 
> > ===================================================================== 
> > > > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
> > > > HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, 
> > > Germany 
> > > > Phone: +49-8142-66989-53 <+49%208142%206698953> 
> <tel:+49%208142%206698953> 
> > <tel:+49%208142%206698953> 
> > > <tel:+49%208142%206698953> Fax: 
> > > > +49-8142-66989-80 <+49%208142%206698980> <tel:+49%208142%206698980> 
> > <tel:+49%208142%206698980> 
> > > <tel:+49%208142%206698980> Email: sba...@denx.de 
> > > > 
> > > 
> > ===================================================================== 
> > > > 
> > > > -- 
> > > > You received this message because you are subscribed to the 
> > > Google 
> > > > Groups "swupdate" group. 
> > > > To unsubscribe from this group and stop receiving emails from 
> > > it, send 
> > > > an email to swupdate+u...@googlegroups.com 
> > > > <mailto:swupdate+u...@googlegroups.com>. 
> > > > To view this discussion on the web visit 
> > > > 
> > > 
> > 
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com> 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com>> 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer> 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer 
> <
> https://groups.google.com/d/msgid/swupdate/fe218821-f1e8-4da4-b099-ba056271810cn%40googlegroups.com?utm_medium=email&utm_source=footer>>>. 
>
> > > 
> > > -- 
> > > 
> > ===================================================================== 
> > > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
> > > HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany 
> > > Phone: +49-8142-66989-53 <+49%208142%206698953> 
> <tel:+49%208142%206698953> 
> > <tel:+49%208142%206698953> Fax: 
> > > +49-8142-66989-80 <+49%208142%206698980> <tel:+49%208142%206698980> 
> > <tel:+49%208142%206698980> Email: sba...@denx.de 
> > > 
> > ===================================================================== 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > > Groups "swupdate" group. 
> > > To unsubscribe from this group and stop receiving emails from it, 
> > send 
> > > an email to swupdate+u...@googlegroups.com 
> > > <mailto:swupdate+u...@googlegroups.com>. 
> > > To view this discussion on the web visit 
> > > 
> > 
> https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com 
> <
> https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com> 
> <
> https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com?utm_medium=email&utm_source=footer 
> <
> https://groups.google.com/d/msgid/swupdate/116b4670-b47c-4e33-b522-1daf539b5b80n%40googlegroups.com?utm_medium=email&utm_source=footer>>. 
>
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "swupdate" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to swupdate+u...@googlegroups.com 
> > <mailto:swupdate+u...@googlegroups.com>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/swupdate/f131ef32-8221-4e8c-9dee-e8fba7c1a6f5n%40googlegroups.com 
> <
> https://groups.google.com/d/msgid/swupdate/f131ef32-8221-4e8c-9dee-e8fba7c1a6f5n%40googlegroups.com?utm_medium=email&utm_source=footer>. 
>
>
> -- 
> ===================================================================== 
> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 
> HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany 
> Phone: +49-8142-66989-53 <+49%208142%206698953> Fax: +49-8142-66989-80 
> <+49%208142%206698980> Email: sba...@denx.de 
> ===================================================================== 
>
>
Stefano Babic Nov. 10, 2022, 10:21 a.m. UTC | #11
Hi Ayoub,

On 10.11.22 10:57, 'ayoub...@googlemail.com' via swupdate wrote:
> Hello Stefano,
> 
> thanks for the valuable input and analysis
> 
> On Thursday, November 10, 2022 at 9:03:38 AM UTC+1 Stefano Babic wrote:
> 

[snip]
>     We are definetly in kernel, as at first glance this does not happen
>     when
>     volumes are swapped, but when the data are flushed. The last calls in
>     the backtrace are related to the NAND driver, and then we are not sure
>     if this issue is related to UBI or probably to the STM's NAND driver.
> 
>     You can check if the issue is related to swap in the handler: just let
>     the swap and remove the update of rootfs from sw-description. If the
>     issue is relkated to swap when a UBIFS is mounted, you should still see
>     these warnings.
> 
> 
> 
> I had it running for months without any problems  before introducing 
> fscrypt/ubifs file system encryption.
> I think that something is quirky with UBIFS+Fscrypt or STM's NAND driver 
> or the combination.

Understood.

> 
> 
> 
>     It will be also interesting if there is some race condition between
>     writing into UBIFS and swapping the volumes. I would also sugggest to
>     add a delay after writing rootfs and before the ubiswap takes place.
>     You
>     can just add it into the ubiswap handler before starting.
> 

> 
>     So I doubt this is produce by swapping, it looks like this happens when
>     your rootfs is updated.
> 
>     IMHO the umount you force does this: everything is flushed before
>     umount
>     is returning, and when a swap is done, nothing is written into the
>     flash.
> 
> 
> 
> maybe I can call a sync() to force flushing at the end archive handler 
> ?  shouldn't be that added in swupdate ?

You could test it - and yes, we can add it to SWUpdate. A sync is 
generally not required, because SWUpdate opens all files in not buffered 
mode t oavoid this issue. But here we use libarchive that makes usage of 
buffered files.

Anyway, this does not explain the issue.

> 
> 
> 
> 
>      > Nov 10 07:31:01 stm32mp157c kernel:       magic          0x6101831
>      > Nov 10 07:31:01 stm32mp157c kernel:       crc            0xd0a08cd3
>      > Nov 10 07:31:01 stm32mp157c kernel:       node_type      1 (data
>     node)
>      > Nov 10 07:31:01 stm32mp157c kernel:       group_type     0 (no
>     node group)
>      > Nov 10 07:31:01 stm32mp157c kernel:       sqnum          816863
>      > Nov 10 07:31:01 stm32mp157c kernel:       len            1904
>      > Nov 10 07:31:01 stm32mp157c kernel:       key            (45694,
>     data, 39)
>      > Nov 10 07:31:01 stm32mp157c kernel:       size           4096
>      > Nov 10 07:31:01 stm32mp157c kernel:       compr_typ      1
>      > Nov 10 07:31:01 stm32mp157c kernel:       data size      1856
>      > Nov 10 07:31:01 stm32mp157c kernel:       data:
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000000: b9 a9 cd 50
>     b3 ab 27
>      > 4d 9e ca 9b f2 a6 a1 e3 47 c4 bd a8 1e 8d 6a 28 d7 f6 8e d3 68 1b
>     0f 73 86
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000020: 8d fd 7b 5e
>     1a f9 e5
>      > da 71 6c 86 d3 b0 af 4d 8b f7 15 d0 48 2e e0 17 a2 1f c9 26 84 1a
>     f8 b6 99
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000040: 6b 63 8e 9f
>     23 09 24
>      > 58 ea 31 f0 30 ae da e6 dc 65 8d 8b 18 6d f2 79 50 67 1b c6 8f c0
>     2d 0e d6
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000060: 96 bf 34 44
>     4c 78 13
>      > b2 cf 2c 0b e6 59 bb 1f ef 49 05 da ff 4a 1a 3a 0b 71 f8 19 c8 fb
>     96 29 fd
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000080: 3e cc 50 94
>     60 fd c0
>      > 63 7c 42 b2 86 62 b5 18 4e e5 60 83 ee d6 0f b3 7b a5 1e 93 70 8f
>     8f d5 19
>      > Nov 10 07:31:01 stm32mp157c kernel:       000000a0: 2a 15 1a 8b
>     68 5c d8
>      > 03 b5 43 9d bb d4 1a d3 38 8b 45 03 60 ad 8e 61 3d e1 60 49 ae 22
>     e6 52 84
>      > Nov 10 07:31:01 stm32mp157c kernel:       000000c0: 97 90 bd 4a
>     c4 29 45
>      > 08 d9 3f 68 7f 37 d9 de cf 47 a7 af 10 6a 65 99 d6 e9 e8 a4 7c de
>     3e cd 44
>      > Nov 10 07:31:01 stm32mp157c kernel:       000000e0: 16 52 c2 3d
>     ea 90 b8
>      > 0a 8f 1c a1 35 25 92 e7 68 08 60 b6 3f ad 40 a9 2d 5e 7d bb 0d 04
>     e0 15 e8
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000100: ae a7 48 5d
>     92 83 61
>      > 0d 95 83 5e 99 1f e5 40 4b ce 6d 85 d1 c4 de 69 91 05 46 ed e7 39
>     68 c5 f0
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000120: e1 df 73 c3
>     e4 ff b2
>      > 1e 6d b2 ab b8 bd 40 c6 91 92 8d 3a 82 94 0b 22 62 c4 91 b9 92 21
>     03 22 88
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000140: a4 22 77 fa
>     54 93 c7
>      > c5 18 33 e3 fa 8b 2b 7b 0b 05 39 8f db ea b1 5d 28 c9 b5 27 c6 3f
>     e9 f6 c0
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000160: ae d6 2f 2b
>     16 6a 6c
>      > 53 f1 34 c5 82 24 93 5f 3e 31 d8 f0 7f 72 64 f1 4f 1b ba 23 e4 81
>     1a 59 14
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000180: 6c a2 df 87
>     e2 9e 5a
>      > f1 5b 1b cf 71 27 dc 40 4a ee ea 91 cd be 4f 93 a7 bc ac 93 38 92
>     f0 51 5a
>      > Nov 10 07:31:01 stm32mp157c kernel:       000001a0: db 1a 3f ea
>     50 a4 6b
>      > 77 7a cc 88 24 5d c7 6c 9f ef 86 48 be 9f d3 f0 99 f6 d9 69 2f 4e
>     b4 a1 fc
>      > Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6b 74 df b4
>     94 3f 1a
>      > 7c 8d 85 9e ea bd 2a 9a 7e 3f 94 6c c5 30 89 a1 01 13 98 0e ce 38
>     d3 27 dd
>      > Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 85 a3 89 12
>     b1 18 b9
>      > 3a b7 28 1f f0 61 da 5a 69 db 27 58 b5 8d bc 25 d2 63 ba ec 01 30
>     4a 39 bc
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000200: cc a8 df 88
>     f5 fa 1f
>      > e2 fd 75 e2 43 8d b3 f9 4a 92 39 da be 77 92 45 d7 1a 6e c4 4f cf
>     69 d0 f7
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000220: b3 5c b2 5c
>     cb 0a e8
>      > 26 be 54 0f 2f dc d5 19 3c 53 f4 13 83 b8 24 ae a9 01 c8 98 39 7a
>     88 bf 9e
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000240: 04 3f ea 18
>     f3 d0 59
>      > 10 79 4a cb bf 6c 44 a3 39 de 36 f7 c1 73 4b fb 5d 00 75 39 2c 79
>     00 42 f7
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000260: 95 97 a5 f6
>     7e 2d 22
>      > a4 ae d8 0c ab 87 b4 7d 7a 85 41 91 47 df 44 5d 19 a0 1c 99 ac e8
>     d1 2a 30
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000280: 76 98 b3 80
>     5c 0c 21
>      > 5b e7 5d 40 88 33 90 27 a6 72 7c f9 ff 34 34 02 b1 7e dc bb c2 91
>     c3 8b b3
>      > Nov 10 07:31:01 stm32mp157c kernel:       000002a0: 85 a0 2e 0c
>     27 93 a4
>      > ec 0d d7 c3 98 28 4f 2c 7a 69 8c 60 b6 d0 81 2b 0b a9 a2 c4 34 4d
>     85 88 62
>      > Nov 10 07:31:01 stm32mp157c kernel:       000002c0: 0a f2 04 10
>     54 71 62
>      > de 67 8c 4f 5c 27 3c f6 73 6f 2c 76 56 37 6c 97 e1 c0 88 fb 25 17
>     c6 ad 6f
>      > Nov 10 07:31:01 stm32mp157c kernel:       000002e0: 6d d3 b2 ab
>     ff 5a 84
>      > 1c 14 56 44 d1 4a 52 4d 96 b7 3a 92 7a 9a 49 8f 5c be 34 c0 8c 8b
>     e5 0e e2
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000300: a3 65 23 73
>     cd 65 b3
>      > c9 79 0c 48 12 70 81 56 4c 87 95 9c 9e 32 fd b7 36 11 4a 5e 26 83
>     36 9c 27
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000320: 26 04 77 e3
>     49 79 e5
>      > bb af 97 07 6a 54 06 c7 ce 03 8b 42 9f 41 02 ab a3 c6 fe ad 91 d0
>     7f 10 65
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 7
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000420: e7 1c a7 71
>     61 5c 2a
>      > f5 9e de f2 ed ad 3f df e0 71 40 d4 33 ac 13 89 2d dc 41 40 ff c4
>     9f 43 21
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 11
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel:       000005a0: 76 6c 8f 5e
>     3b a6 e8
>      > f4 0c 1c 23 18 f8 19 14 95 0a 7e 55 c5 be ac a7 d4 bb 4b 2d 64 6f
>     ed 2b 58
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 12
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0
>      > Tainted: G        W         5.10.116 #1
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 22
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000
>      > 00000000 00000000 00000000 00000000 00000000
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 23
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000100: 23 c9 81 a9
>     5f c4 6d
>      > b1 32 51 79 78 a6 00 9f c8 53 7c 31 34 0c 8b 45 32 7a f2 1a 35 5b
>     46 fc 68
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000120: b9 f0 59 d5
>     eb 42 e9
>      > ad d0 c0 a8 06 f3 c3 a2 88 d8 79 52 83 0b 83 59 6d 28 0d 47 c6 cf
>     00 37 f3
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000140: 7f eb dc df
>     bc 45 61
>      > 5b ea 8e 36 90 09 4d 8d 72 1c 98 49 a4 03 79 cd f4 33 c6 d9 12 01
>     3f 8f 73
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000160: ad d3 ea cf
>     72 d4 b0
>      > 7a e2 02 63 14 f5 f3 75 8c fe 06 a2 1f 67 5d 97 19 a0 39 14 51 cd
>     7e 86 ac
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000180: b5 5a 32 0b
>     ca 0c fb
>      > db 76 02 ba 0c 38 26 3b 5f d1 59 69 8a 2a b3 86 b1 8f 6d e7 58 ee
>     29 9c f5
>      > Nov 10 07:31:01 stm32mp157c kernel:       000001a0: b1 60 c9 5c
>     35 79 57
>      > 0c dc c4 85 be 1f 5c 67 97 e3 cb 56 e7 4d 63 25 dd 7b 2b a3 28 f4
>     5b 16 91
>      > Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6c 33 40 00
>     ec d9 6d
>      > e0 1b 98 fe 28 2f 78 e7 b4 49 dc 73 d0 d1 d8 c2 c7 2b 6c aa c1 e6
>     b3 fd ac
>      > Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 73 6d 91 35
>     d1 f6 22
>      > d5 5a 15 8e 27 9e 27 03 09 c2 fc 6b 23 30 4e 86 02 1d 7e cd 1d 2a
>     37 15 15
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000200: 7e 66 a1 58
>     5a 91 74
>      > b9 cd 76 be 3d d7 86 20 88 9d 08 78 ab f8 30 07 59 ff 89 0d 35 1d
>     b0 e5 d7
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000220: 93 bb 89 66
>     df 28 5e
>      > 44 38 f3 0d 9b e6 4a 2c 7c 22 13 f5 c4 b3 68 0e ed 08 c1 80 f2 38
>     33 33 f3
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000240: 59 c3 05 f4
>     d8 00 fd
>      > 11 14 f6 da 82 50 b6 b8 e9 2f f4 08 d6 b6 5b 10 f0 57 bd cb ef 90
>     ef e0 75
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000260: bd d0 71 91
>     21 54 86
>      > ba c4 85 01 3c 64 ac 42 dd ba 56 2c 56 7c 86 bb 7f 75 ac dd 86 bb
>     36 ae 27
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000280: d9 89 10 1b
>     29 d8 c6
>      > e1 fc 6e bc b4 94 b4 20 e5 92 ed 7a fd 31 cd 91 17 a6 e3 d3 02 f2
>     81 e1 10
>      > Nov 10 07:31:01 stm32mp157c kernel:       000002a0: db 45 18 8a
>     60 40 be
>      > 74 7b 65 42 42 b3 b6 39 86 c7 82 4f c3 97 ff 5c c2 33 0f c8 ba 8c
>     f3 b7 c4
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 4
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000340: 3f ca 97 31
>     a7 0e de
>      > e2 17 41 b1 a8 31 a1 c8 d4 ed 14 8a 9b d0 bc 53 6f c5 75 3a f1 27
>     cd 0b ce
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 8
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000460: 69 90 eb 76
>     c0 48 ce
>      > fe 4c a2 a5 3f 8f 71 2f 73 c7 aa 6f 16 49 b8 57 3a 03 51 40 56 72
>     5c 93 f4
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 14
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000640: 01 0a 4e 73
>     e5 27 25
>      > f6 2a b4 25 22 1d 7c df 8b bd b2 81 77 d0 f1 22 1f a6 a4 a7 cd d2
>     5a ad 47
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 10
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel:       000007a0: c3 35 eb ac
>     55 0b f7
>      > 5a 2d 58 c6 9e f6 b7 02 c8 46 36 8b 1d 4c 0f 27 74 c9 f8 d7 90 a7
>     5d 30 45
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 13
>     kernel messages
>      > Nov 10 07:31:01 stm32mp157c kernel:       00000960: 72 1a 5a bf
>     a1 f7 eb
>      > 97 cb 84 4f f8 e4 5c 72 fd fb b0 64 d9 bf 79 09 ef b4 fd 87 73 d7
>     24 25 38
>      > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 5
>     kernel messages
>      >
>      > The worst is that SWUpdate is NOT failing and the board restart
>     with a
>      > faulty system !
> 
>     SWUpdate relies on the system calls - if the kernel does not return an
>     error, everything is fine. The kernel is not returning any error, the
>     swap (ubi_rnvols) was successful. After that, the background thread is
>     still working, and this is producing the error.
> 
> 
> you are right swupdate could not know.
> 

Exactly.

Best regards,
Stefano
ayoub...@googlemail.com Nov. 13, 2022, 1:34 p.m. UTC | #12
Hello Stefano,

a simple call of sync() at the end of libarchive handler did solve my issue 
:-)
If you don't mind we can have it added in swupdate as a workaround.

I'm sending a patch

Best,
-Ayoub 

On Thursday, November 10, 2022 at 11:21:31 AM UTC+1 Stefano Babic wrote:

> Hi Ayoub,
>
> On 10.11.22 10:57, 'ayoub...@googlemail.com' via swupdate wrote:
> > Hello Stefano,
> > 
> > thanks for the valuable input and analysis
> > 
> > On Thursday, November 10, 2022 at 9:03:38 AM UTC+1 Stefano Babic wrote:
> > 
>
> [snip]
> > We are definetly in kernel, as at first glance this does not happen
> > when
> > volumes are swapped, but when the data are flushed. The last calls in
> > the backtrace are related to the NAND driver, and then we are not sure
> > if this issue is related to UBI or probably to the STM's NAND driver.
> > 
> > You can check if the issue is related to swap in the handler: just let
> > the swap and remove the update of rootfs from sw-description. If the
> > issue is relkated to swap when a UBIFS is mounted, you should still see
> > these warnings.
> > 
> > 
> > 
> > I had it running for months without any problems  before introducing 
> > fscrypt/ubifs file system encryption.
> > I think that something is quirky with UBIFS+Fscrypt or STM's NAND driver 
> > or the combination.
>
> Understood.
>
> > 
> > 
> > 
> > It will be also interesting if there is some race condition between
> > writing into UBIFS and swapping the volumes. I would also sugggest to
> > add a delay after writing rootfs and before the ubiswap takes place.
> > You
> > can just add it into the ubiswap handler before starting.
> > 
>
> > 
> > So I doubt this is produce by swapping, it looks like this happens when
> > your rootfs is updated.
> > 
> > IMHO the umount you force does this: everything is flushed before
> > umount
> > is returning, and when a swap is done, nothing is written into the
> > flash.
> > 
> > 
> > 
> > maybe I can call a sync() to force flushing at the end archive handler 
> > ?  shouldn't be that added in swupdate ?
>
> You could test it - and yes, we can add it to SWUpdate. A sync is 
> generally not required, because SWUpdate opens all files in not buffered 
> mode t oavoid this issue. But here we use libarchive that makes usage of 
> buffered files.
>
> Anyway, this does not explain the issue.
>
> > 
> > 
> > 
> > 
> > > Nov 10 07:31:01 stm32mp157c kernel:       magic          0x6101831
> > > Nov 10 07:31:01 stm32mp157c kernel:       crc            0xd0a08cd3
> > > Nov 10 07:31:01 stm32mp157c kernel:       node_type      1 (data
> > node)
> > > Nov 10 07:31:01 stm32mp157c kernel:       group_type     0 (no
> > node group)
> > > Nov 10 07:31:01 stm32mp157c kernel:       sqnum          816863
> > > Nov 10 07:31:01 stm32mp157c kernel:       len            1904
> > > Nov 10 07:31:01 stm32mp157c kernel:       key            (45694,
> > data, 39)
> > > Nov 10 07:31:01 stm32mp157c kernel:       size           4096
> > > Nov 10 07:31:01 stm32mp157c kernel:       compr_typ      1
> > > Nov 10 07:31:01 stm32mp157c kernel:       data size      1856
> > > Nov 10 07:31:01 stm32mp157c kernel:       data:
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000000: b9 a9 cd 50
> > b3 ab 27
> > > 4d 9e ca 9b f2 a6 a1 e3 47 c4 bd a8 1e 8d 6a 28 d7 f6 8e d3 68 1b
> > 0f 73 86
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000020: 8d fd 7b 5e
> > 1a f9 e5
> > > da 71 6c 86 d3 b0 af 4d 8b f7 15 d0 48 2e e0 17 a2 1f c9 26 84 1a
> > f8 b6 99
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000040: 6b 63 8e 9f
> > 23 09 24
> > > 58 ea 31 f0 30 ae da e6 dc 65 8d 8b 18 6d f2 79 50 67 1b c6 8f c0
> > 2d 0e d6
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000060: 96 bf 34 44
> > 4c 78 13
> > > b2 cf 2c 0b e6 59 bb 1f ef 49 05 da ff 4a 1a 3a 0b 71 f8 19 c8 fb
> > 96 29 fd
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000080: 3e cc 50 94
> > 60 fd c0
> > > 63 7c 42 b2 86 62 b5 18 4e e5 60 83 ee d6 0f b3 7b a5 1e 93 70 8f
> > 8f d5 19
> > > Nov 10 07:31:01 stm32mp157c kernel:       000000a0: 2a 15 1a 8b
> > 68 5c d8
> > > 03 b5 43 9d bb d4 1a d3 38 8b 45 03 60 ad 8e 61 3d e1 60 49 ae 22
> > e6 52 84
> > > Nov 10 07:31:01 stm32mp157c kernel:       000000c0: 97 90 bd 4a
> > c4 29 45
> > > 08 d9 3f 68 7f 37 d9 de cf 47 a7 af 10 6a 65 99 d6 e9 e8 a4 7c de
> > 3e cd 44
> > > Nov 10 07:31:01 stm32mp157c kernel:       000000e0: 16 52 c2 3d
> > ea 90 b8
> > > 0a 8f 1c a1 35 25 92 e7 68 08 60 b6 3f ad 40 a9 2d 5e 7d bb 0d 04
> > e0 15 e8
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000100: ae a7 48 5d
> > 92 83 61
> > > 0d 95 83 5e 99 1f e5 40 4b ce 6d 85 d1 c4 de 69 91 05 46 ed e7 39
> > 68 c5 f0
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000120: e1 df 73 c3
> > e4 ff b2
> > > 1e 6d b2 ab b8 bd 40 c6 91 92 8d 3a 82 94 0b 22 62 c4 91 b9 92 21
> > 03 22 88
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000140: a4 22 77 fa
> > 54 93 c7
> > > c5 18 33 e3 fa 8b 2b 7b 0b 05 39 8f db ea b1 5d 28 c9 b5 27 c6 3f
> > e9 f6 c0
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000160: ae d6 2f 2b
> > 16 6a 6c
> > > 53 f1 34 c5 82 24 93 5f 3e 31 d8 f0 7f 72 64 f1 4f 1b ba 23 e4 81
> > 1a 59 14
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000180: 6c a2 df 87
> > e2 9e 5a
> > > f1 5b 1b cf 71 27 dc 40 4a ee ea 91 cd be 4f 93 a7 bc ac 93 38 92
> > f0 51 5a
> > > Nov 10 07:31:01 stm32mp157c kernel:       000001a0: db 1a 3f ea
> > 50 a4 6b
> > > 77 7a cc 88 24 5d c7 6c 9f ef 86 48 be 9f d3 f0 99 f6 d9 69 2f 4e
> > b4 a1 fc
> > > Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6b 74 df b4
> > 94 3f 1a
> > > 7c 8d 85 9e ea bd 2a 9a 7e 3f 94 6c c5 30 89 a1 01 13 98 0e ce 38
> > d3 27 dd
> > > Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 85 a3 89 12
> > b1 18 b9
> > > 3a b7 28 1f f0 61 da 5a 69 db 27 58 b5 8d bc 25 d2 63 ba ec 01 30
> > 4a 39 bc
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000200: cc a8 df 88
> > f5 fa 1f
> > > e2 fd 75 e2 43 8d b3 f9 4a 92 39 da be 77 92 45 d7 1a 6e c4 4f cf
> > 69 d0 f7
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000220: b3 5c b2 5c
> > cb 0a e8
> > > 26 be 54 0f 2f dc d5 19 3c 53 f4 13 83 b8 24 ae a9 01 c8 98 39 7a
> > 88 bf 9e
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000240: 04 3f ea 18
> > f3 d0 59
> > > 10 79 4a cb bf 6c 44 a3 39 de 36 f7 c1 73 4b fb 5d 00 75 39 2c 79
> > 00 42 f7
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000260: 95 97 a5 f6
> > 7e 2d 22
> > > a4 ae d8 0c ab 87 b4 7d 7a 85 41 91 47 df 44 5d 19 a0 1c 99 ac e8
> > d1 2a 30
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000280: 76 98 b3 80
> > 5c 0c 21
> > > 5b e7 5d 40 88 33 90 27 a6 72 7c f9 ff 34 34 02 b1 7e dc bb c2 91
> > c3 8b b3
> > > Nov 10 07:31:01 stm32mp157c kernel:       000002a0: 85 a0 2e 0c
> > 27 93 a4
> > > ec 0d d7 c3 98 28 4f 2c 7a 69 8c 60 b6 d0 81 2b 0b a9 a2 c4 34 4d
> > 85 88 62
> > > Nov 10 07:31:01 stm32mp157c kernel:       000002c0: 0a f2 04 10
> > 54 71 62
> > > de 67 8c 4f 5c 27 3c f6 73 6f 2c 76 56 37 6c 97 e1 c0 88 fb 25 17
> > c6 ad 6f
> > > Nov 10 07:31:01 stm32mp157c kernel:       000002e0: 6d d3 b2 ab
> > ff 5a 84
> > > 1c 14 56 44 d1 4a 52 4d 96 b7 3a 92 7a 9a 49 8f 5c be 34 c0 8c 8b
> > e5 0e e2
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000300: a3 65 23 73
> > cd 65 b3
> > > c9 79 0c 48 12 70 81 56 4c 87 95 9c 9e 32 fd b7 36 11 4a 5e 26 83
> > 36 9c 27
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000320: 26 04 77 e3
> > 49 79 e5
> > > bb af 97 07 6a 54 06 c7 ce 03 8b 42 9f 41 02 ab a3 c6 fe ad 91 d0
> > 7f 10 65
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 7
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000420: e7 1c a7 71
> > 61 5c 2a
> > > f5 9e de f2 ed ad 3f df e0 71 40 d4 33 ac 13 89 2d dc 41 40 ff c4
> > 9f 43 21
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 11
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel:       000005a0: 76 6c 8f 5e
> > 3b a6 e8
> > > f4 0c 1c 23 18 f8 19 14 95 0a 7e 55 c5 be ac a7 d4 bb 4b 2d 64 6f
> > ed 2b 58
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 12
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm: kworker/u4:0
> > > Tainted: G        W         5.10.116 #1
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 22
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000 00000000
> > > 00000000 00000000 00000000 00000000 00000000
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 23
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000100: 23 c9 81 a9
> > 5f c4 6d
> > > b1 32 51 79 78 a6 00 9f c8 53 7c 31 34 0c 8b 45 32 7a f2 1a 35 5b
> > 46 fc 68
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000120: b9 f0 59 d5
> > eb 42 e9
> > > ad d0 c0 a8 06 f3 c3 a2 88 d8 79 52 83 0b 83 59 6d 28 0d 47 c6 cf
> > 00 37 f3
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000140: 7f eb dc df
> > bc 45 61
> > > 5b ea 8e 36 90 09 4d 8d 72 1c 98 49 a4 03 79 cd f4 33 c6 d9 12 01
> > 3f 8f 73
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000160: ad d3 ea cf
> > 72 d4 b0
> > > 7a e2 02 63 14 f5 f3 75 8c fe 06 a2 1f 67 5d 97 19 a0 39 14 51 cd
> > 7e 86 ac
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000180: b5 5a 32 0b
> > ca 0c fb
> > > db 76 02 ba 0c 38 26 3b 5f d1 59 69 8a 2a b3 86 b1 8f 6d e7 58 ee
> > 29 9c f5
> > > Nov 10 07:31:01 stm32mp157c kernel:       000001a0: b1 60 c9 5c
> > 35 79 57
> > > 0c dc c4 85 be 1f 5c 67 97 e3 cb 56 e7 4d 63 25 dd 7b 2b a3 28 f4
> > 5b 16 91
> > > Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6c 33 40 00
> > ec d9 6d
> > > e0 1b 98 fe 28 2f 78 e7 b4 49 dc 73 d0 d1 d8 c2 c7 2b 6c aa c1 e6
> > b3 fd ac
> > > Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 73 6d 91 35
> > d1 f6 22
> > > d5 5a 15 8e 27 9e 27 03 09 c2 fc 6b 23 30 4e 86 02 1d 7e cd 1d 2a
> > 37 15 15
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000200: 7e 66 a1 58
> > 5a 91 74
> > > b9 cd 76 be 3d d7 86 20 88 9d 08 78 ab f8 30 07 59 ff 89 0d 35 1d
> > b0 e5 d7
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000220: 93 bb 89 66
> > df 28 5e
> > > 44 38 f3 0d 9b e6 4a 2c 7c 22 13 f5 c4 b3 68 0e ed 08 c1 80 f2 38
> > 33 33 f3
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000240: 59 c3 05 f4
> > d8 00 fd
> > > 11 14 f6 da 82 50 b6 b8 e9 2f f4 08 d6 b6 5b 10 f0 57 bd cb ef 90
> > ef e0 75
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000260: bd d0 71 91
> > 21 54 86
> > > ba c4 85 01 3c 64 ac 42 dd ba 56 2c 56 7c 86 bb 7f 75 ac dd 86 bb
> > 36 ae 27
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000280: d9 89 10 1b
> > 29 d8 c6
> > > e1 fc 6e bc b4 94 b4 20 e5 92 ed 7a fd 31 cd 91 17 a6 e3 d3 02 f2
> > 81 e1 10
> > > Nov 10 07:31:01 stm32mp157c kernel:       000002a0: db 45 18 8a
> > 60 40 be
> > > 74 7b 65 42 42 b3 b6 39 86 c7 82 4f c3 97 ff 5c c2 33 0f c8 ba 8c
> > f3 b7 c4
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 4
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000340: 3f ca 97 31
> > a7 0e de
> > > e2 17 41 b1 a8 31 a1 c8 d4 ed 14 8a 9b d0 bc 53 6f c5 75 3a f1 27
> > cd 0b ce
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 8
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000460: 69 90 eb 76
> > c0 48 ce
> > > fe 4c a2 a5 3f 8f 71 2f 73 c7 aa 6f 16 49 b8 57 3a 03 51 40 56 72
> > 5c 93 f4
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 14
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000640: 01 0a 4e 73
> > e5 27 25
> > > f6 2a b4 25 22 1d 7c df 8b bd b2 81 77 d0 f1 22 1f a6 a4 a7 cd d2
> > 5a ad 47
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 10
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel:       000007a0: c3 35 eb ac
> > 55 0b f7
> > > 5a 2d 58 c6 9e f6 b7 02 c8 46 36 8b 1d 4c 0f 27 74 c9 f8 d7 90 a7
> > 5d 30 45
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 13
> > kernel messages
> > > Nov 10 07:31:01 stm32mp157c kernel:       00000960: 72 1a 5a bf
> > a1 f7 eb
> > > 97 cb 84 4f f8 e4 5c 72 fd fb b0 64 d9 bf 79 09 ef b4 fd 87 73 d7
> > 24 25 38
> > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 5
> > kernel messages
> > >
> > > The worst is that SWUpdate is NOT failing and the board restart
> > with a
> > > faulty system !
> > 
> > SWUpdate relies on the system calls - if the kernel does not return an
> > error, everything is fine. The kernel is not returning any error, the
> > swap (ubi_rnvols) was successful. After that, the background thread is
> > still working, and this is producing the error.
> > 
> > 
> > you are right swupdate could not know.
> > 
>
> Exactly.
>
> Best regards,
> Stefano
>
> -- 
> =====================================================================
> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 <+49%208142%206698953> Fax: +49-8142-66989-80 
> <+49%208142%206698980> Email: sba...@denx.de
> =====================================================================
>
>
Stefano Babic Nov. 13, 2022, 2:08 p.m. UTC | #13
Hi Ayoub,

On 13.11.22 14:34, 'ayoub...@googlemail.com' via swupdate wrote:
> Hello Stefano,
> 
> a simple call of sync() at the end of libarchive handler did solve my 
> issue :-)

This was our supposition :-)


> If you don't mind we can have it added in swupdate as a workaround.

It is fine.

Stefano

> 
> I'm sending a patch
> 
> Best,
> -Ayoub
> 
> On Thursday, November 10, 2022 at 11:21:31 AM UTC+1 Stefano Babic wrote:
> 
>     Hi Ayoub,
> 
>     On 10.11.22 10:57, 'ayoub...@googlemail.com' via swupdate wrote:
>      > Hello Stefano,
>      >
>      > thanks for the valuable input and analysis
>      >
>      > On Thursday, November 10, 2022 at 9:03:38 AM UTC+1 Stefano Babic
>     wrote:
>      >
> 
>     [snip]
>      > We are definetly in kernel, as at first glance this does not happen
>      > when
>      > volumes are swapped, but when the data are flushed. The last
>     calls in
>      > the backtrace are related to the NAND driver, and then we are not
>     sure
>      > if this issue is related to UBI or probably to the STM's NAND
>     driver.
>      >
>      > You can check if the issue is related to swap in the handler:
>     just let
>      > the swap and remove the update of rootfs from sw-description. If the
>      > issue is relkated to swap when a UBIFS is mounted, you should
>     still see
>      > these warnings.
>      >
>      >
>      >
>      > I had it running for months without any problems  before introducing
>      > fscrypt/ubifs file system encryption.
>      > I think that something is quirky with UBIFS+Fscrypt or STM's NAND
>     driver
>      > or the combination.
> 
>     Understood.
> 
>      >
>      >
>      >
>      > It will be also interesting if there is some race condition between
>      > writing into UBIFS and swapping the volumes. I would also
>     sugggest to
>      > add a delay after writing rootfs and before the ubiswap takes place.
>      > You
>      > can just add it into the ubiswap handler before starting.
>      >
> 
>      >
>      > So I doubt this is produce by swapping, it looks like this
>     happens when
>      > your rootfs is updated.
>      >
>      > IMHO the umount you force does this: everything is flushed before
>      > umount
>      > is returning, and when a swap is done, nothing is written into the
>      > flash.
>      >
>      >
>      >
>      > maybe I can call a sync() to force flushing at the end archive
>     handler
>      > ?  shouldn't be that added in swupdate ?
> 
>     You could test it - and yes, we can add it to SWUpdate. A sync is
>     generally not required, because SWUpdate opens all files in not
>     buffered
>     mode t oavoid this issue. But here we use libarchive that makes
>     usage of
>     buffered files.
> 
>     Anyway, this does not explain the issue.
> 
>      >
>      >
>      >
>      >
>      > > Nov 10 07:31:01 stm32mp157c kernel:       magic          0x6101831
>      > > Nov 10 07:31:01 stm32mp157c kernel:       crc          
>       0xd0a08cd3
>      > > Nov 10 07:31:01 stm32mp157c kernel:       node_type      1 (data
>      > node)
>      > > Nov 10 07:31:01 stm32mp157c kernel:       group_type     0 (no
>      > node group)
>      > > Nov 10 07:31:01 stm32mp157c kernel:       sqnum          816863
>      > > Nov 10 07:31:01 stm32mp157c kernel:       len            1904
>      > > Nov 10 07:31:01 stm32mp157c kernel:       key            (45694,
>      > data, 39)
>      > > Nov 10 07:31:01 stm32mp157c kernel:       size           4096
>      > > Nov 10 07:31:01 stm32mp157c kernel:       compr_typ      1
>      > > Nov 10 07:31:01 stm32mp157c kernel:       data size      1856
>      > > Nov 10 07:31:01 stm32mp157c kernel:       data:
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000000: b9 a9 cd 50
>      > b3 ab 27
>      > > 4d 9e ca 9b f2 a6 a1 e3 47 c4 bd a8 1e 8d 6a 28 d7 f6 8e d3 68 1b
>      > 0f 73 86
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000020: 8d fd 7b 5e
>      > 1a f9 e5
>      > > da 71 6c 86 d3 b0 af 4d 8b f7 15 d0 48 2e e0 17 a2 1f c9 26 84 1a
>      > f8 b6 99
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000040: 6b 63 8e 9f
>      > 23 09 24
>      > > 58 ea 31 f0 30 ae da e6 dc 65 8d 8b 18 6d f2 79 50 67 1b c6 8f c0
>      > 2d 0e d6
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000060: 96 bf 34 44
>      > 4c 78 13
>      > > b2 cf 2c 0b e6 59 bb 1f ef 49 05 da ff 4a 1a 3a 0b 71 f8 19 c8 fb
>      > 96 29 fd
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000080: 3e cc 50 94
>      > 60 fd c0
>      > > 63 7c 42 b2 86 62 b5 18 4e e5 60 83 ee d6 0f b3 7b a5 1e 93 70 8f
>      > 8f d5 19
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000000a0: 2a 15 1a 8b
>      > 68 5c d8
>      > > 03 b5 43 9d bb d4 1a d3 38 8b 45 03 60 ad 8e 61 3d e1 60 49 ae 22
>      > e6 52 84
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000000c0: 97 90 bd 4a
>      > c4 29 45
>      > > 08 d9 3f 68 7f 37 d9 de cf 47 a7 af 10 6a 65 99 d6 e9 e8 a4 7c de
>      > 3e cd 44
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000000e0: 16 52 c2 3d
>      > ea 90 b8
>      > > 0a 8f 1c a1 35 25 92 e7 68 08 60 b6 3f ad 40 a9 2d 5e 7d bb 0d 04
>      > e0 15 e8
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000100: ae a7 48 5d
>      > 92 83 61
>      > > 0d 95 83 5e 99 1f e5 40 4b ce 6d 85 d1 c4 de 69 91 05 46 ed e7 39
>      > 68 c5 f0
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000120: e1 df 73 c3
>      > e4 ff b2
>      > > 1e 6d b2 ab b8 bd 40 c6 91 92 8d 3a 82 94 0b 22 62 c4 91 b9 92 21
>      > 03 22 88
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000140: a4 22 77 fa
>      > 54 93 c7
>      > > c5 18 33 e3 fa 8b 2b 7b 0b 05 39 8f db ea b1 5d 28 c9 b5 27 c6 3f
>      > e9 f6 c0
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000160: ae d6 2f 2b
>      > 16 6a 6c
>      > > 53 f1 34 c5 82 24 93 5f 3e 31 d8 f0 7f 72 64 f1 4f 1b ba 23 e4 81
>      > 1a 59 14
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000180: 6c a2 df 87
>      > e2 9e 5a
>      > > f1 5b 1b cf 71 27 dc 40 4a ee ea 91 cd be 4f 93 a7 bc ac 93 38 92
>      > f0 51 5a
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000001a0: db 1a 3f ea
>      > 50 a4 6b
>      > > 77 7a cc 88 24 5d c7 6c 9f ef 86 48 be 9f d3 f0 99 f6 d9 69 2f 4e
>      > b4 a1 fc
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6b 74 df b4
>      > 94 3f 1a
>      > > 7c 8d 85 9e ea bd 2a 9a 7e 3f 94 6c c5 30 89 a1 01 13 98 0e ce 38
>      > d3 27 dd
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 85 a3 89 12
>      > b1 18 b9
>      > > 3a b7 28 1f f0 61 da 5a 69 db 27 58 b5 8d bc 25 d2 63 ba ec 01 30
>      > 4a 39 bc
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000200: cc a8 df 88
>      > f5 fa 1f
>      > > e2 fd 75 e2 43 8d b3 f9 4a 92 39 da be 77 92 45 d7 1a 6e c4 4f cf
>      > 69 d0 f7
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000220: b3 5c b2 5c
>      > cb 0a e8
>      > > 26 be 54 0f 2f dc d5 19 3c 53 f4 13 83 b8 24 ae a9 01 c8 98 39 7a
>      > 88 bf 9e
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000240: 04 3f ea 18
>      > f3 d0 59
>      > > 10 79 4a cb bf 6c 44 a3 39 de 36 f7 c1 73 4b fb 5d 00 75 39 2c 79
>      > 00 42 f7
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000260: 95 97 a5 f6
>      > 7e 2d 22
>      > > a4 ae d8 0c ab 87 b4 7d 7a 85 41 91 47 df 44 5d 19 a0 1c 99 ac e8
>      > d1 2a 30
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000280: 76 98 b3 80
>      > 5c 0c 21
>      > > 5b e7 5d 40 88 33 90 27 a6 72 7c f9 ff 34 34 02 b1 7e dc bb c2 91
>      > c3 8b b3
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000002a0: 85 a0 2e 0c
>      > 27 93 a4
>      > > ec 0d d7 c3 98 28 4f 2c 7a 69 8c 60 b6 d0 81 2b 0b a9 a2 c4 34 4d
>      > 85 88 62
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000002c0: 0a f2 04 10
>      > 54 71 62
>      > > de 67 8c 4f 5c 27 3c f6 73 6f 2c 76 56 37 6c 97 e1 c0 88 fb 25 17
>      > c6 ad 6f
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000002e0: 6d d3 b2 ab
>      > ff 5a 84
>      > > 1c 14 56 44 d1 4a 52 4d 96 b7 3a 92 7a 9a 49 8f 5c be 34 c0 8c 8b
>      > e5 0e e2
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000300: a3 65 23 73
>      > cd 65 b3
>      > > c9 79 0c 48 12 70 81 56 4c 87 95 9c 9e 32 fd b7 36 11 4a 5e 26 83
>      > 36 9c 27
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000320: 26 04 77 e3
>      > 49 79 e5
>      > > bb af 97 07 6a 54 06 c7 ce 03 8b 42 9f 41 02 ab a3 c6 fe ad 91 d0
>      > 7f 10 65
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 7
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000420: e7 1c a7 71
>      > 61 5c 2a
>      > > f5 9e de f2 ed ad 3f df e0 71 40 d4 33 ac 13 89 2d dc 41 40 ff c4
>      > 9f 43 21
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 11
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000005a0: 76 6c 8f 5e
>      > 3b a6 e8
>      > > f4 0c 1c 23 18 f8 19 14 95 0a 7e 55 c5 be ac a7 d4 bb 4b 2d 64 6f
>      > ed 2b 58
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 12
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel: CPU: 0 PID: 7 Comm:
>     kworker/u4:0
>      > > Tainted: G        W         5.10.116 #1
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 22
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel: 5fc0: 00000000 00000000
>     00000000
>      > > 00000000 00000000 00000000 00000000 00000000
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 23
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000100: 23 c9 81 a9
>      > 5f c4 6d
>      > > b1 32 51 79 78 a6 00 9f c8 53 7c 31 34 0c 8b 45 32 7a f2 1a 35 5b
>      > 46 fc 68
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000120: b9 f0 59 d5
>      > eb 42 e9
>      > > ad d0 c0 a8 06 f3 c3 a2 88 d8 79 52 83 0b 83 59 6d 28 0d 47 c6 cf
>      > 00 37 f3
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000140: 7f eb dc df
>      > bc 45 61
>      > > 5b ea 8e 36 90 09 4d 8d 72 1c 98 49 a4 03 79 cd f4 33 c6 d9 12 01
>      > 3f 8f 73
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000160: ad d3 ea cf
>      > 72 d4 b0
>      > > 7a e2 02 63 14 f5 f3 75 8c fe 06 a2 1f 67 5d 97 19 a0 39 14 51 cd
>      > 7e 86 ac
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000180: b5 5a 32 0b
>      > ca 0c fb
>      > > db 76 02 ba 0c 38 26 3b 5f d1 59 69 8a 2a b3 86 b1 8f 6d e7 58 ee
>      > 29 9c f5
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000001a0: b1 60 c9 5c
>      > 35 79 57
>      > > 0c dc c4 85 be 1f 5c 67 97 e3 cb 56 e7 4d 63 25 dd 7b 2b a3 28 f4
>      > 5b 16 91
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000001c0: 6c 33 40 00
>      > ec d9 6d
>      > > e0 1b 98 fe 28 2f 78 e7 b4 49 dc 73 d0 d1 d8 c2 c7 2b 6c aa c1 e6
>      > b3 fd ac
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000001e0: 73 6d 91 35
>      > d1 f6 22
>      > > d5 5a 15 8e 27 9e 27 03 09 c2 fc 6b 23 30 4e 86 02 1d 7e cd 1d 2a
>      > 37 15 15
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000200: 7e 66 a1 58
>      > 5a 91 74
>      > > b9 cd 76 be 3d d7 86 20 88 9d 08 78 ab f8 30 07 59 ff 89 0d 35 1d
>      > b0 e5 d7
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000220: 93 bb 89 66
>      > df 28 5e
>      > > 44 38 f3 0d 9b e6 4a 2c 7c 22 13 f5 c4 b3 68 0e ed 08 c1 80 f2 38
>      > 33 33 f3
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000240: 59 c3 05 f4
>      > d8 00 fd
>      > > 11 14 f6 da 82 50 b6 b8 e9 2f f4 08 d6 b6 5b 10 f0 57 bd cb ef 90
>      > ef e0 75
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000260: bd d0 71 91
>      > 21 54 86
>      > > ba c4 85 01 3c 64 ac 42 dd ba 56 2c 56 7c 86 bb 7f 75 ac dd 86 bb
>      > 36 ae 27
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000280: d9 89 10 1b
>      > 29 d8 c6
>      > > e1 fc 6e bc b4 94 b4 20 e5 92 ed 7a fd 31 cd 91 17 a6 e3 d3 02 f2
>      > 81 e1 10
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000002a0: db 45 18 8a
>      > 60 40 be
>      > > 74 7b 65 42 42 b3 b6 39 86 c7 82 4f c3 97 ff 5c c2 33 0f c8 ba 8c
>      > f3 b7 c4
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 4
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000340: 3f ca 97 31
>      > a7 0e de
>      > > e2 17 41 b1 a8 31 a1 c8 d4 ed 14 8a 9b d0 bc 53 6f c5 75 3a f1 27
>      > cd 0b ce
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 8
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000460: 69 90 eb 76
>      > c0 48 ce
>      > > fe 4c a2 a5 3f 8f 71 2f 73 c7 aa 6f 16 49 b8 57 3a 03 51 40 56 72
>      > 5c 93 f4
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 14
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000640: 01 0a 4e 73
>      > e5 27 25
>      > > f6 2a b4 25 22 1d 7c df 8b bd b2 81 77 d0 f1 22 1f a6 a4 a7 cd d2
>      > 5a ad 47
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 10
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel:       000007a0: c3 35 eb ac
>      > 55 0b f7
>      > > 5a 2d 58 c6 9e f6 b7 02 c8 46 36 8b 1d 4c 0f 27 74 c9 f8 d7 90 a7
>      > 5d 30 45
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 13
>      > kernel messages
>      > > Nov 10 07:31:01 stm32mp157c kernel:       00000960: 72 1a 5a bf
>      > a1 f7 eb
>      > > 97 cb 84 4f f8 e4 5c 72 fd fb b0 64 d9 bf 79 09 ef b4 fd 87 73 d7
>      > 24 25 38
>      > > Nov 10 07:31:01 stm32mp157c systemd-journald[338]: Missed 5
>      > kernel messages
>      > >
>      > > The worst is that SWUpdate is NOT failing and the board restart
>      > with a
>      > > faulty system !
>      >
>      > SWUpdate relies on the system calls - if the kernel does not
>     return an
>      > error, everything is fine. The kernel is not returning any error,
>     the
>      > swap (ubi_rnvols) was successful. After that, the background
>     thread is
>      > still working, and this is producing the error.
>      >
>      >
>      > you are right swupdate could not know.
>      >
> 
>     Exactly.
> 
>     Best regards,
>     Stefano
> 
>     -- 
>     =====================================================================
>     DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
>     HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
>     Phone: +49-8142-66989-53 <tel:+49%208142%206698953> Fax:
>     +49-8142-66989-80 <tel:+49%208142%206698980> Email: sba...@denx.de
>     =====================================================================
> 
> -- 
> You received this message because you are subscribed to the Google 
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to swupdate+unsubscribe@googlegroups.com 
> <mailto:swupdate+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/swupdate/c8c46662-f5b4-4c80-99eb-5ac2e8a0ba69n%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/c8c46662-f5b4-4c80-99eb-5ac2e8a0ba69n%40googlegroups.com?utm_medium=email&utm_source=footer>.
diff mbox series

Patch

diff --git a/doc/source/sw-description.rst b/doc/source/sw-description.rst
index a5182d6..13bba2e 100644
--- a/doc/source/sw-description.rst
+++ b/doc/source/sw-description.rst
@@ -1319,6 +1319,12 @@  There are 4 main sections inside sw-description:
    |             |          |            | "filesystem" type. (path is always    |
    |             |          |            | relative to the mount point.)         |
    +-------------+----------+------------+---------------------------------------+
+   | umount      | bool     | files      | flag to control whether the given     |
+   |             |          |            | mount point specified by path         |
+   |             |          |            | (absolute) where the files are        |
+   |             |          |            | are installed if already mounted      |
+   |             |          |            | outside SWUpdate should be umounted   |
+   +-------------+----------+------------+---------------------------------------+
    | preserve-\  | bool     | files      | flag to control whether the following |
    | attributes  |          |            | attributes will be preserved when     |
    |             |          |            | files are unpacked from an archive    |
diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c
index e3a1463..553287f 100644
--- a/handlers/archive_handler.c
+++ b/handlers/archive_handler.c
@@ -228,6 +228,7 @@  static int install_archive_image(struct img_type *img,
 	struct extract_data tf;
 	pthread_attr_t attr;
 	int use_mount = (strlen(img->device) && strlen(img->filesystem)) ? 1 : 0;
+	int use_umount = img->umount;
 	int is_mounted = 0;
 	int exitval = -EFAULT;
 	char *DATADST_DIR = NULL;
@@ -380,6 +381,13 @@  out:
 		}
 	}
 
+	if (use_umount && !use_mount) {
+		ret = swupdate_umount(img->path);
+		if (ret) {
+			TRACE("Failed to unmount directory %s", img->path);
+		}
+	}
+
 	free(DATADST_DIR);
 	free(FIFO);
 
diff --git a/include/swupdate.h b/include/swupdate.h
index 4cce892..89f64ea 100644
--- a/include/swupdate.h
+++ b/include/swupdate.h
@@ -81,6 +81,7 @@  struct img_type {
 	int provided;
 	int compressed;
 	int preserve_attributes; /* whether to preserve attributes in archives */
+	bool umount;
 	bool is_encrypted;
 	char ivt_ascii[33];
 	int install_directly;
diff --git a/parser/parser.c b/parser/parser.c
index 5607031..81f69be 100644
--- a/parser/parser.c
+++ b/parser/parser.c
@@ -436,6 +436,7 @@  static int parse_common_attributes(parsertype p, void *elem, struct img_type *im
 	}
 	get_field(p, elem, "installed-directly", &image->install_directly);
 	get_field(p, elem, "preserve-attributes", &image->preserve_attributes);
+	get_field(p, elem, "umount", &image->umount);
 	get_field(p, elem, "install-if-different", &image->id.install_if_different);
 	get_field(p, elem, "install-if-higher", &image->id.install_if_higher);
 	get_field(p, elem, "encrypted", &image->is_encrypted);