On 2024/9/4 04:14, Alison Schofield wrote: > On Tue, Sep 03, 2024 at 08:41:44PM +0800, Zijun Hu wrote: >> From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx> >> >> match_free_decoder()'s logic for finding a free cxl decoder depends on >> a prerequisite that all child decoders are sorted by ID in ascending order >> but the prerequisite may not be guaranteed, fix by finding a free cxl >> decoder with minimal ID. > > After reading the 'Closes' tag below I have a better understanding of > why you may be doing this, but I don't want to have to jump to that > Link. Can you describe here examples of when the ordered allocation > may not be guaranteed, and the impact when that happens. > thank you for code review. let me try to do it. > This includes a change to device_for_each_child() which I see mentioned > in the Closes tag discussion too. Is that required for this fix? > yes, device_for_each_child() is better than device_find_child() to correct logic for finding a free cxl decoder. > It's feeling like the fix and api update are comingled. Please clarify. > actually, there are two concerns as shown below: concern A: device_find_child() modifies caller's match data. concern B: weird logic for finding a free cxl decoder this patch focuses on concern B, and it also solve concern A in passing. the following exclusive patch only solves concern A. https://lore.kernel.org/all/20240905-const_dfc_prepare-v4-1-4180e1d5a244@xxxxxxxxxxx/ either will solve concern A i care about. > Thanks, > Alison > >>