Commit 20b5ec31 authored by David E. Box's avatar David E. Box Committed by Hans de Goede

platform/x86/intel/sdsi: Fix bug in multi packet reads

Fix bug that added an offset to the mailbox addr during multi-packet
reads. Did not affect current ABI since it doesn't support multi-packet
transactions.

Fixes: 2546c600 ("platform/x86: Add Intel Software Defined Silicon driver")
Signed-off-by: default avatarDavid E. Box <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20220420155622.1763633-4-david.e.box@linux.intel.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 5a79615c
...@@ -83,7 +83,7 @@ enum sdsi_command { ...@@ -83,7 +83,7 @@ enum sdsi_command {
struct sdsi_mbox_info { struct sdsi_mbox_info {
u64 *payload; u64 *payload;
u64 *buffer; void *buffer;
int size; int size;
}; };
...@@ -165,9 +165,7 @@ static int sdsi_mbox_cmd_read(struct sdsi_priv *priv, struct sdsi_mbox_info *inf ...@@ -165,9 +165,7 @@ static int sdsi_mbox_cmd_read(struct sdsi_priv *priv, struct sdsi_mbox_info *inf
total = 0; total = 0;
loop = 0; loop = 0;
do { do {
int offset = SDSI_SIZE_MAILBOX * loop; void *buf = info->buffer + (SDSI_SIZE_MAILBOX * loop);
void __iomem *addr = priv->mbox_addr + offset;
u64 *buf = info->buffer + offset / SDSI_SIZE_CMD;
u32 packet_size; u32 packet_size;
/* Poll on ready bit */ /* Poll on ready bit */
...@@ -198,7 +196,7 @@ static int sdsi_mbox_cmd_read(struct sdsi_priv *priv, struct sdsi_mbox_info *inf ...@@ -198,7 +196,7 @@ static int sdsi_mbox_cmd_read(struct sdsi_priv *priv, struct sdsi_mbox_info *inf
break; break;
} }
sdsi_memcpy64_fromio(buf, addr, round_up(packet_size, SDSI_SIZE_CMD)); sdsi_memcpy64_fromio(buf, priv->mbox_addr, round_up(packet_size, SDSI_SIZE_CMD));
total += packet_size; total += packet_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment