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.

dmaengine: idxd: reformat swerror output to standard Linux bitmap output

SWERROR register is 4 64bit wide registers. Currently the sysfs attribute
just outputs 4 64bit hex integers. Convert to output with %*pb format
specifier.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Co-developed-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Link: https://lore.kernel.org/r/20230303213732.3357494-2-fenghua.yu@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Dave Jiang and committed by
Vinod Koul
34ca0066 6fec8938

+6 -7
+1
drivers/dma/idxd/idxd.h
··· 598 598 void idxd_unregister_driver(void); 599 599 void idxd_wqs_quiesce(struct idxd_device *idxd); 600 600 bool idxd_queue_int_handle_resubmit(struct idxd_desc *desc); 601 + void multi_u64_to_bmap(unsigned long *bmap, u64 *val, int count); 601 602 602 603 /* device interrupt control */ 603 604 irqreturn_t idxd_misc_thread(int vec, void *data);
+1 -1
drivers/dma/idxd/init.c
··· 388 388 dev_dbg(dev, "IDXD Perfmon Offset: %#x\n", idxd->perfmon_offset); 389 389 } 390 390 391 - static void multi_u64_to_bmap(unsigned long *bmap, u64 *val, int count) 391 + void multi_u64_to_bmap(unsigned long *bmap, u64 *val, int count) 392 392 { 393 393 int i, j, nr; 394 394
+4 -6
drivers/dma/idxd/sysfs.c
··· 1452 1452 struct device_attribute *attr, char *buf) 1453 1453 { 1454 1454 struct idxd_device *idxd = confdev_to_idxd(dev); 1455 - int i, out = 0; 1455 + DECLARE_BITMAP(swerr_bmap, 256); 1456 1456 1457 + bitmap_zero(swerr_bmap, 256); 1457 1458 spin_lock(&idxd->dev_lock); 1458 - for (i = 0; i < 4; i++) 1459 - out += sysfs_emit_at(buf, out, "%#018llx ", idxd->sw_err.bits[i]); 1459 + multi_u64_to_bmap(swerr_bmap, &idxd->sw_err.bits[0], 4); 1460 1460 spin_unlock(&idxd->dev_lock); 1461 - out--; 1462 - out += sysfs_emit_at(buf, out, "\n"); 1463 - return out; 1461 + return sysfs_emit(buf, "%*pb\n", 256, swerr_bmap); 1464 1462 } 1465 1463 static DEVICE_ATTR_RO(errors); 1466 1464