Skip to content

Commit 75dfbcb

Browse files
committed
mailbox: mpfs: fix an incorrect mask width
The system controller registers on PolarFire SoC are 32 bits wide, so 16 + 16 as the first input to GENMASK_ULL() gives a 33 bit wide mask. It probably should have been immediately obvious when it was pointed out during review that the width required using GENMASK_ULL() - but I scarcely knew what I was doing at the time and missed it. The mistake ends up being moot as it is a mask after all, but it is incorrect and should be fixed. No functional change intended. Acked-by: Jassi Brar <jaswinder.singh@linaro.org> Tested-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
1 parent fe15c26 commit 75dfbcb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/mailbox/mailbox-mpfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#define SCB_CTRL_NOTIFY_MASK BIT(SCB_CTRL_NOTIFY)
4040

4141
#define SCB_CTRL_POS (16)
42-
#define SCB_CTRL_MASK GENMASK_ULL(SCB_CTRL_POS + SCB_MASK_WIDTH, SCB_CTRL_POS)
42+
#define SCB_CTRL_MASK GENMASK(SCB_CTRL_POS + SCB_MASK_WIDTH - 1, SCB_CTRL_POS)
4343

4444
/* SCBCTRL service status register */
4545

@@ -118,6 +118,7 @@ static int mpfs_mbox_send_data(struct mbox_chan *chan, void *data)
118118
}
119119

120120
opt_sel = ((msg->mbox_offset << 7u) | (msg->cmd_opcode & 0x7fu));
121+
121122
tx_trigger = (opt_sel << SCB_CTRL_POS) & SCB_CTRL_MASK;
122123
tx_trigger |= SCB_CTRL_REQ_MASK | SCB_STATUS_NOTIFY_MASK;
123124
writel_relaxed(tx_trigger, mbox->ctrl_base + SERVICES_CR_OFFSET);

0 commit comments

Comments
 (0)