Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-6.19/cxl-misc' into cxl-for-next

- Remove ret_limit race condition in mock_get_event()
- Assign overflow_err_count from log->nr_overflow

+5 -6
+5 -6
tools/testing/cxl/test/mem.c
··· 250 250 * Vary the number of events returned to simulate events occuring while the 251 251 * logs are being read. 252 252 */ 253 - static int ret_limit = 0; 253 + static atomic_t event_counter = ATOMIC_INIT(0); 254 254 255 255 static int mock_get_event(struct device *dev, struct cxl_mbox_cmd *cmd) 256 256 { 257 257 struct cxl_get_event_payload *pl; 258 258 struct mock_event_log *log; 259 - u16 nr_overflow; 259 + int ret_limit; 260 260 u8 log_type; 261 261 int i; 262 262 263 263 if (cmd->size_in != sizeof(log_type)) 264 264 return -EINVAL; 265 265 266 - ret_limit = (ret_limit + 1) % CXL_TEST_EVENT_RET_MAX; 267 - if (!ret_limit) 268 - ret_limit = 1; 266 + /* Vary return limit from 1 to CXL_TEST_EVENT_RET_MAX */ 267 + ret_limit = (atomic_inc_return(&event_counter) % CXL_TEST_EVENT_RET_MAX) + 1; 269 268 270 269 if (cmd->size_out < struct_size(pl, records, ret_limit)) 271 270 return -EINVAL; ··· 298 299 u64 ns; 299 300 300 301 pl->flags |= CXL_GET_EVENT_FLAG_OVERFLOW; 301 - pl->overflow_err_count = cpu_to_le16(nr_overflow); 302 + pl->overflow_err_count = cpu_to_le16(log->nr_overflow); 302 303 ns = ktime_get_real_ns(); 303 304 ns -= 5000000000; /* 5s ago */ 304 305 pl->first_overflow_timestamp = cpu_to_le64(ns);