Loading drivers/slimbus/slim-msm-ngd.c +5 −4 Original line number Diff line number Diff line Loading @@ -392,18 +392,19 @@ static int ngd_get_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn, unsigned long flags; spin_lock_irqsave(&ctrl->txn_lock, flags); if (ctrl->last_tid <= 255) { if (ctrl->last_tid < SLIM_MAX_TXNS) { dev->msg_cnt = ctrl->last_tid; ctrl->last_tid++; } else { int i; for (i = 0; i < 256; i++) { dev->msg_cnt = ((dev->msg_cnt + 1) & 0xFF); for (i = 0; i < SLIM_MAX_TXNS; i++) { dev->msg_cnt = ((dev->msg_cnt + 1) & (SLIM_MAX_TXNS - 1)); if (ctrl->txnt[dev->msg_cnt] == NULL) break; } if (i >= 256) { if (i >= SLIM_MAX_TXNS) { dev_err(&ctrl->dev, "out of TID"); spin_unlock_irqrestore(&ctrl->txn_lock, flags); return -ENOMEM; Loading drivers/slimbus/slimbus.c +2 −2 Original line number Diff line number Diff line Loading @@ -744,7 +744,7 @@ EXPORT_SYMBOL(slim_msg_response); static int slim_processtxn(struct slim_controller *ctrl, struct slim_msg_txn *txn, bool need_tid) { u8 i = 0; unsigned int i = 0; int ret = 0; unsigned long flags; Loading @@ -755,7 +755,7 @@ static int slim_processtxn(struct slim_controller *ctrl, break; } if (i >= ctrl->last_tid) { if (ctrl->last_tid == 255) { if (ctrl->last_tid == SLIM_MAX_TXNS) { spin_unlock_irqrestore(&ctrl->txn_lock, flags); return -ENOMEM; } Loading include/linux/slimbus/slimbus.h +2 −2 Original line number Diff line number Diff line Loading @@ -514,7 +514,7 @@ enum slim_clk_state { * @devs: List of devices on this controller * @wq: Workqueue per controller used to notify devices when they report present * @txnt: Table of transactions having transaction ID * @last_tid: size of the table txnt (can't grow beyond 256 since TID is 8-bits) * @last_tid: size of the table txnt (can't grow beyond 256) * @ports: Ports associated with this controller * @nports: Number of ports supported by the controller * @chans: Channels associated with this controller Loading Loading @@ -576,7 +576,7 @@ struct slim_controller { struct list_head devs; struct workqueue_struct *wq; struct slim_msg_txn *txnt[SLIM_MAX_TXNS]; u8 last_tid; unsigned int last_tid; spinlock_t txn_lock; struct slim_port *ports; int nports; Loading Loading
drivers/slimbus/slim-msm-ngd.c +5 −4 Original line number Diff line number Diff line Loading @@ -392,18 +392,19 @@ static int ngd_get_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn, unsigned long flags; spin_lock_irqsave(&ctrl->txn_lock, flags); if (ctrl->last_tid <= 255) { if (ctrl->last_tid < SLIM_MAX_TXNS) { dev->msg_cnt = ctrl->last_tid; ctrl->last_tid++; } else { int i; for (i = 0; i < 256; i++) { dev->msg_cnt = ((dev->msg_cnt + 1) & 0xFF); for (i = 0; i < SLIM_MAX_TXNS; i++) { dev->msg_cnt = ((dev->msg_cnt + 1) & (SLIM_MAX_TXNS - 1)); if (ctrl->txnt[dev->msg_cnt] == NULL) break; } if (i >= 256) { if (i >= SLIM_MAX_TXNS) { dev_err(&ctrl->dev, "out of TID"); spin_unlock_irqrestore(&ctrl->txn_lock, flags); return -ENOMEM; Loading
drivers/slimbus/slimbus.c +2 −2 Original line number Diff line number Diff line Loading @@ -744,7 +744,7 @@ EXPORT_SYMBOL(slim_msg_response); static int slim_processtxn(struct slim_controller *ctrl, struct slim_msg_txn *txn, bool need_tid) { u8 i = 0; unsigned int i = 0; int ret = 0; unsigned long flags; Loading @@ -755,7 +755,7 @@ static int slim_processtxn(struct slim_controller *ctrl, break; } if (i >= ctrl->last_tid) { if (ctrl->last_tid == 255) { if (ctrl->last_tid == SLIM_MAX_TXNS) { spin_unlock_irqrestore(&ctrl->txn_lock, flags); return -ENOMEM; } Loading
include/linux/slimbus/slimbus.h +2 −2 Original line number Diff line number Diff line Loading @@ -514,7 +514,7 @@ enum slim_clk_state { * @devs: List of devices on this controller * @wq: Workqueue per controller used to notify devices when they report present * @txnt: Table of transactions having transaction ID * @last_tid: size of the table txnt (can't grow beyond 256 since TID is 8-bits) * @last_tid: size of the table txnt (can't grow beyond 256) * @ports: Ports associated with this controller * @nports: Number of ports supported by the controller * @chans: Channels associated with this controller Loading Loading @@ -576,7 +576,7 @@ struct slim_controller { struct list_head devs; struct workqueue_struct *wq; struct slim_msg_txn *txnt[SLIM_MAX_TXNS]; u8 last_tid; unsigned int last_tid; spinlock_t txn_lock; struct slim_port *ports; int nports; Loading