Quoting Lina Iyer (2018-03-02 08:43:08)[...]
+#include <linux/module.h>MODULE_DEVICE_TABLE seems to need this.
If the driver doesn't become tristate, this should become export.h
instead of module.h
No, it wont. The read is to make sure that the write went through before+
+static void write_tcs_reg_sync(struct rsc_drv *drv, int reg, int m, int n,
+ u32 data)
+{
+ write_tcs_reg(drv, reg, m, n, data);
+ for (;;) {
+ if (data == read_tcs_reg(drv, reg, m, n))
+ break;
+ udelay(1);
Hopefully this never gets stuck. Add a timeout?
Hopefully, I would like to use a pre-allocateed pool instead of alloc+ list_del(&resp->list);
+ spin_unlock_irqrestore(&drv->drv_lock, flags);
+ free_response(resp);
But all this function does is free the structure? Will it do more later?
+ for_each_set_bit(j, &curr_enabled, MAX_CMDS_PER_TCS) {It is, but not too expensive. The alternatives involves more locking..
+ addr = read_tcs_reg(drv, RSC_DRV_CMD_ADDR, m, j);
+ for (k = 0; k < msg->num_payload; k++) {
+ if (addr == msg->payload[k].addr)
+ return -EBUSY;
+ }
+ }
+ }
There isn't any way to do this in software only? Hopefully this isn't
costly to read the TCS to see if something matches.