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

coresight: stm: Support marked packet

STP_PACKET_MARKED is not supported by STM currently.
Add STM_FLAG_MARKED to support marked packet in STM.

Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200916191737.4001561-3-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tingwei Zhang and committed by
Greg Kroah-Hartman
4af8b3d3 2d1a8bfb

+8 -4
+7 -4
drivers/hwtracing/coresight/coresight-stm.c
··· 412 412 void __iomem *ch_addr; 413 413 struct stm_drvdata *drvdata = container_of(stm_data, 414 414 struct stm_drvdata, stm); 415 + unsigned int stm_flags; 415 416 416 417 if (!(drvdata && local_read(&drvdata->mode))) 417 418 return -EACCES; ··· 422 421 423 422 ch_addr = stm_channel_addr(drvdata, channel); 424 423 425 - flags = (flags == STP_PACKET_TIMESTAMPED) ? STM_FLAG_TIMESTAMPED : 0; 426 - flags |= test_bit(channel, drvdata->chs.guaranteed) ? 424 + stm_flags = (flags & STP_PACKET_TIMESTAMPED) ? 425 + STM_FLAG_TIMESTAMPED : 0; 426 + stm_flags |= test_bit(channel, drvdata->chs.guaranteed) ? 427 427 STM_FLAG_GUARANTEED : 0; 428 428 429 429 if (size > drvdata->write_bytes) ··· 434 432 435 433 switch (packet) { 436 434 case STP_PACKET_FLAG: 437 - ch_addr += stm_channel_off(STM_PKT_TYPE_FLAG, flags); 435 + ch_addr += stm_channel_off(STM_PKT_TYPE_FLAG, stm_flags); 438 436 439 437 /* 440 438 * The generic STM core sets a size of '0' on flag packets. ··· 446 444 break; 447 445 448 446 case STP_PACKET_DATA: 449 - ch_addr += stm_channel_off(STM_PKT_TYPE_DATA, flags); 447 + stm_flags |= (flags & STP_PACKET_MARKED) ? STM_FLAG_MARKED : 0; 448 + ch_addr += stm_channel_off(STM_PKT_TYPE_DATA, stm_flags); 450 449 stm_send(ch_addr, payload, size, 451 450 drvdata->write_bytes); 452 451 break;
+1
include/uapi/linux/coresight-stm.h
··· 5 5 #include <linux/const.h> 6 6 7 7 #define STM_FLAG_TIMESTAMPED _BITUL(3) 8 + #define STM_FLAG_MARKED _BITUL(4) 8 9 #define STM_FLAG_GUARANTEED _BITUL(7) 9 10 10 11 /*