public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Fix Android A/B backup
@ 2024-03-12 12:57 Colin McAllister
  2024-03-12 12:57 ` [PATCH v4 1/2] android_ab: Add missing semicolon Colin McAllister
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Colin McAllister @ 2024-03-12 12:57 UTC (permalink / raw)
  To: u-boot
  Cc: Colin McAllister, JPEWhacker, sjg, Sam Protsenko,
	Mattijs Korpershoek, Igor Opaniuk

- Addresses compiler error due to missing semicolon
- Removes use of preprocessor macros with ANDROID_AB_BACKUP_OFFSET

Bug was found by noticing a semicolon was missing and not causing a
compiler error when CONFIG_ANDROID_AB_BACKUP_OFFSET was set. I submitted
a patch to fix the semicolon before fixing the #if's. Testing the latter
patch without the former with ANDORID_AB_BACKUP_OFFSET set will cause a
compiler error.

What's changed in V2?
---------------------

The second verison of changes removes the #if preprocessor macros to use
C conditionals instead. There was some minor refactoring required to get
this to work, so I did more thourough testing to ensure the backup data
works as expected.

I also realized that CONFIG_VAL is not needed because there's no reason
for the SPL or TPL to have different values for the backup address. I
opted to just use CONFIG_ANDROID_AB_BACKUP_OFFSET directly.

What's changed in V3?
---------------------

Added "Fixes:" tag to patches. Performed additonal testing as described
in the second paragraph in the testing notes below.

I opted to not use CONFIG_IS_ENABLED because that macro appears to only
be intended for y/n configurations. See note at top of linux/kconfig.h:

"Note that these only work with boolean and tristate options."

What's changed in V4?
---------------------

Nothing other than sending the patch in through a different email
address in order to see if the Garmin SMTP server is borking the
patches.

How was this patch series tested?
---------------------------------

I built for my target with CONFIG_ANDROID_AB_BACKUP_OFFSET set to
0x1000. I first verified that the device can normally boot. I then ran
dd before rebooting to corrupt the primary data. I confirmed that the
backup was used to properly restore the primary. I then corrupted both
the primary and backup data and confirmed that the primary and backup
were both reinitialized to default values. Lastly, I corrupted the
backup data and not the primary data and confirmed that the backup was
restored the primary data.

Addtionally, I disabled CONFIG_ANDROID_AB_BACKUP_OFFSET for my device
and confirmed that after I corrupt the primary data, no backup is used.
When the primary data is not corrupt, the device boots normally. This is
what I would expect, because CONFIG_ANDROID_AB_BACKUP_OFFSET's default
value is 0x0, which would evaluate to false for all C if conditions.

Colin McAllister (2):
  android_ab: Add missing semicolon
  android_ab: Fix ANDROID_AB_BACKUP_OFFSET

 boot/android_ab.c | 97 ++++++++++++++++++++++-------------------------
 1 file changed, 45 insertions(+), 52 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2024-03-22  7:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-12 12:57 [PATCH v4 0/2] Fix Android A/B backup Colin McAllister
2024-03-12 12:57 ` [PATCH v4 1/2] android_ab: Add missing semicolon Colin McAllister
2024-03-12 15:12   ` Mattijs Korpershoek
2024-03-13 17:18   ` Igor Opaniuk
2024-03-12 12:57 ` [PATCH v4 2/2] android_ab: Fix ANDROID_AB_BACKUP_OFFSET Colin McAllister
2024-03-12 15:19   ` Mattijs Korpershoek
2024-03-13 17:22     ` Igor Opaniuk
2024-03-21  9:29       ` Mattijs Korpershoek
2024-03-21 12:19         ` Colin
2024-03-22  7:41 ` [PATCH v4 0/2] Fix Android A/B backup Mattijs Korpershoek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox