Re: [PATCH v3 06/15] Introduce structured tag value definition
From: Herve Codina <herve.codina@bootlin.com>
Date: 2026-09-10 07:58:39
Also in:
lkml
Hi david, On Thu, 10 Sep 2026 15:33:58 +1000 David Gibson [off-list ref] wrote:
On Wed, Aug 26, 2026 at 10:31:37AM +0200, Herve Codina wrote: [snip]quoted
+#define FDT_TAG_CAN_SKIP(tag_data, tag_id) \ + (FDT_TAG_STRUCTURED | FDT_TAG_SKIP_SAFE | tag_data | tag_id) + +/* Tests reserved tags */ +#define FDT_TEST_NONE_CAN_SKIP FDT_TAG_CAN_SKIP(FDT_TAG_DATA_NONE, 0) +#define FDT_TEST_1CELL_CAN_SKIP FDT_TAG_CAN_SKIP(FDT_TAG_DATA_1CELL, 0) +#define FDT_TEST_2CELLS_CAN_SKIP FDT_TAG_CAN_SKIP(FDT_TAG_DATA_2CELLS, 0) +#define FDT_TEST_VARLEN_CAN_SKIP FDT_TAG_CAN_SKIP(FDT_TAG_DATA_VARLEN, 0) +#define FDT_TEST_NONE_NO_SKIP FDT_TAG_NO_SKIP(FDT_TAG_DATA_NONE, 0)Sorry, missed until I saw the later treegen changes that this is defining some specific tag values. Given that, "Tests reserved tags" needs to be expanded to better explain what these tags are for - what should readers do upon encountering them, when should writers use it ("never, unless you're a test case" is acceptable).
I would say, in both cases, consider them as "unknown" tags. And so: /* * Tests reserved tags * * When those tags are encountered they should be considered as "unknown" * tags and rules related to "unknown" tags must be followed. * * Readers should skip them or fail depending on the SKIP_SAFE flag. Writers * should never use those tags. Their usage is only acceptable in test cases. */
It might be worth reserving a whole range of tag values for tests / documentation / experimentation, rather than just a handful of specific values.
Ok. The range reservation will added be in the comment. /* * Tests reserved tags * * A TAG_ID range in "structured tags" is reserved to tests tags. * This tests reserved range is from tag_id 0 to tag_id 0x100. * * When those tags are encountered they should be considered as "unknown" * tags and rules related to "unknown" tags must be followed. * * Readers should skip them or fail depending on the SKIP_SAFE flag. Writers * should never use those tags. Their usage is only acceptable in test cases. */ Is it ok? Best regards, Hervé -- Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com