Re: [PATCH v10 04/12] cxl: Cache decoder settings on PCI devices

From: Srirangan Madhavan

Date: Tue Sep 01 2026 - 22:15:07 EST


On 8/21/26 3:12 PM, Dave Jiang wrote:
Use {} for if/else since the else part is multi-lines. Although given that you have to set the id either way, maybe have a helper function cxl_decoder_settings_init() that does it so you don't need the else branch.

DJ
Oops. Sent this to wrong patch as reply.

Thank you, addressed in v11.

- Changed the decoder-count check to return bool and renamed the
internal and wrapper helpers to __cxl_pci_hdm_decoder_count_match() and
cxl_pci_hdm_decoder_count_match().
- Renamed the switch helper to cxl_switch_get_target_list().
- Renamed the cache update helper to cxl_hdm_save_decoder_info().
- Initialize the settings ID before the enabled-decoder check,
removing the multi-line else.
- Added a lock assertion to cxl_decoder_snapshot() using a
lockdep_assert_held().

After the refactor, the snapshot and switch-target changes now appear
in patch 1. The PCI HDM cache updates remain in patch 4.
--
Regards,
Srirangan