Add definitions for trace events to show the scanning flow.
Unified · Split
| @@ -24,9 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | #include "fsi-master.h" |
| 26 | 26 | |
| 27 | −#define CREATE_TRACE_POINTS | |
| 28 | −#include <trace/events/fsi.h> | |
| 29 | − | |
| 30 | 27 | #define FSI_SLAVE_CONF_NEXT_MASK GENMASK(31, 31) |
| 31 | 28 | #define FSI_SLAVE_CONF_SLOTS_MASK GENMASK(23, 16) |
| 32 | 29 | #define FSI_SLAVE_CONF_SLOTS_SHIFT 16 |
| @@ -95,6 +92,9 @@ struct fsi_slave { · 62 unmodified lines | ||
| 95 | 92 | u8 t_echo_delay; |
| 96 | 93 | }; |
| 97 | 94 | |
| 95 | +#define CREATE_TRACE_POINTS | |
| 96 | +#include <trace/events/fsi.h> | |
| 97 | + | |
| 98 | 98 | #define to_fsi_master(d) container_of(d, struct fsi_master, dev) |
| 99 | 99 | #define to_fsi_slave(d) container_of(d, struct fsi_slave, dev) |
| 100 | 100 | |
| @@ -524,6 +524,8 @@ static int fsi_slave_scan(struct fsi_slave *slave) · 423 unmodified lines | ||
| 524 | 524 | dev->addr = engine_addr; |
| 525 | 525 | dev->size = slots * engine_page_size; |
| 526 | 526 | |
| 527 | + trace_fsi_dev_init(dev); | |
| 528 | + | |
| 527 | 529 | dev_dbg(&slave->dev, |
| 528 | 530 | "engine[%i]: type %x, version %x, addr %x size %x\n", |
| 529 | 531 | dev->unit, dev->engine_type, version, |
| @@ -1006,6 +1008,7 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id) · 476 unmodified lines | ||
| 1006 | 1008 | |
| 1007 | 1009 | crc = crc4(0, cfam_id, 32); |
| 1008 | 1010 | if (crc) { |
| 1011 | + trace_fsi_slave_invalid_cfam(master, link, cfam_id); | |
| 1009 | 1012 | dev_warn(&master->dev, "slave %02x:%02x invalid cfam id CRC!\n", |
| 1010 | 1013 | link, id); |
| 1011 | 1014 | return -EIO; |
| @@ -1080,6 +1083,8 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id) · 68 unmodified lines | ||
| 1080 | 1083 | if (rc) |
| 1081 | 1084 | goto err_free; |
| 1082 | 1085 | |
| 1086 | + trace_fsi_slave_init(slave); | |
| 1087 | + | |
| 1083 | 1088 | /* Create chardev for userspace access */ |
| 1084 | 1089 | cdev_init(&slave->cdev, &cfam_fops); |
| 1085 | 1090 | rc = cdev_device_add(&slave->cdev, &slave->dev); |
| @@ -449,11 +449,13 @@ static ssize_t cfam_reset_store(struct device *dev, struct device_attribute *att · 448 unmodified lines | ||
| 449 | 449 | { |
| 450 | 450 | struct fsi_master_aspeed *aspeed = dev_get_drvdata(dev); |
| 451 | 451 | |
| 452 | + trace_fsi_master_aspeed_cfam_reset(true); | |
| 452 | 453 | mutex_lock(&aspeed->lock); |
| 453 | 454 | gpiod_set_value(aspeed->cfam_reset_gpio, 1); |
| 454 | 455 | usleep_range(900, 1000); |
| 455 | 456 | gpiod_set_value(aspeed->cfam_reset_gpio, 0); |
| 456 | 457 | mutex_unlock(&aspeed->lock); |
| 458 | + trace_fsi_master_aspeed_cfam_reset(false); | |
| 457 | 459 | |
| 458 | 460 | return count; |
| 459 | 461 | } |
| @@ -122,6 +122,92 @@ TRACE_EVENT(fsi_master_break, · 121 unmodified lines | ||
| 122 | 122 | ) |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | +TRACE_EVENT(fsi_slave_init, | |
| 126 | + TP_PROTO(const struct fsi_slave *slave), | |
| 127 | + TP_ARGS(slave), | |
| 128 | + TP_STRUCT__entry( | |
| 129 | + __field(int, master_idx) | |
| 130 | + __field(int, master_n_links) | |
| 131 | + __field(int, idx) | |
| 132 | + __field(int, link) | |
| 133 | + __field(int, chip_id) | |
| 134 | + __field(__u32, cfam_id) | |
| 135 | + __field(__u32, size) | |
| 136 | + ), | |
| 137 | + TP_fast_assign( | |
| 138 | + __entry->master_idx = slave->master->idx; | |
| 139 | + __entry->master_n_links = slave->master->n_links; | |
| 140 | + __entry->idx = slave->cdev_idx; | |
| 141 | + __entry->link = slave->link; | |
| 142 | + __entry->chip_id = slave->chip_id; | |
| 143 | + __entry->cfam_id = slave->cfam_id; | |
| 144 | + __entry->size = slave->size; | |
| 145 | + ), | |
| 146 | + TP_printk("fsi%d: idx:%d link:%d/%d cid:%d cfam:%08x %08x", | |
| 147 | + __entry->master_idx, | |
| 148 | + __entry->idx, | |
| 149 | + __entry->link, | |
| 150 | + __entry->master_n_links, | |
| 151 | + __entry->chip_id, | |
| 152 | + __entry->cfam_id, | |
| 153 | + __entry->size | |
| 154 | + ) | |
| 155 | +); | |
| 156 | + | |
| 157 | +TRACE_EVENT(fsi_slave_invalid_cfam, | |
| 158 | + TP_PROTO(const struct fsi_master *master, int link, uint32_t cfam_id), | |
| 159 | + TP_ARGS(master, link, cfam_id), | |
| 160 | + TP_STRUCT__entry( | |
| 161 | + __field(int, master_idx) | |
| 162 | + __field(int, master_n_links) | |
| 163 | + __field(int, link) | |
| 164 | + __field(__u32, cfam_id) | |
| 165 | + ), | |
| 166 | + TP_fast_assign( | |
| 167 | + __entry->master_idx = master->idx; | |
| 168 | + __entry->master_n_links = master->n_links; | |
| 169 | + __entry->link = link; | |
| 170 | + __entry->cfam_id = cfam_id; | |
| 171 | + ), | |
| 172 | + TP_printk("fsi%d: cfam:%08x link:%d/%d", | |
| 173 | + __entry->master_idx, | |
| 174 | + __entry->cfam_id, | |
| 175 | + __entry->link, | |
| 176 | + __entry->master_n_links | |
| 177 | + ) | |
| 178 | +); | |
| 179 | + | |
| 180 | +TRACE_EVENT(fsi_dev_init, | |
| 181 | + TP_PROTO(const struct fsi_device *dev), | |
| 182 | + TP_ARGS(dev), | |
| 183 | + TP_STRUCT__entry( | |
| 184 | + __field(int, master_idx) | |
| 185 | + __field(int, link) | |
| 186 | + __field(int, type) | |
| 187 | + __field(int, unit) | |
| 188 | + __field(int, version) | |
| 189 | + __field(__u32, addr) | |
| 190 | + __field(__u32, size) | |
| 191 | + ), | |
| 192 | + TP_fast_assign( | |
| 193 | + __entry->master_idx = dev->slave->master->idx; | |
| 194 | + __entry->link = dev->slave->link; | |
| 195 | + __entry->type = dev->engine_type; | |
| 196 | + __entry->unit = dev->unit; | |
| 197 | + __entry->version = dev->version; | |
| 198 | + __entry->addr = dev->addr; | |
| 199 | + __entry->size = dev->size; | |
| 200 | + ), | |
| 201 | + TP_printk("fsi%d: slv%d: t:%02x u:%02x v:%02x %08x@%08x", | |
| 202 | + __entry->master_idx, | |
| 203 | + __entry->link, | |
| 204 | + __entry->type, | |
| 205 | + __entry->unit, | |
| 206 | + __entry->version, | |
| 207 | + __entry->size, | |
| 208 | + __entry->addr | |
| 209 | + ) | |
| 210 | +); | |
| 125 | 211 | |
| 126 | 212 | #endif /* _TRACE_FSI_H */ |
| 127 | 213 | |
| @@ -72,6 +72,18 @@ TRACE_EVENT(fsi_master_aspeed_opb_error, · 71 unmodified lines | ||
| 72 | 72 | ) |
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | +TRACE_EVENT(fsi_master_aspeed_cfam_reset, | |
| 76 | + TP_PROTO(bool start), | |
| 77 | + TP_ARGS(start), | |
| 78 | + TP_STRUCT__entry( | |
| 79 | + __field(bool, start) | |
| 80 | + ), | |
| 81 | + TP_fast_assign( | |
| 82 | + __entry->start = start; | |
| 83 | + ), | |
| 84 | + TP_printk("%s", __entry->start ? "start" : "end") | |
| 85 | +); | |
| 86 | + | |
| 75 | 87 | #endif |
| 76 | 88 | |
| 77 | 89 | #include <trace/define_trace.h> |