Skip to content

Commit

Permalink
usb: isp1760: fix memory pool initialization
Browse files Browse the repository at this point in the history
[ Upstream commit f757f92 ]

The loops to setup the memory pool were skipping some
blocks, that was not visible on the ISP1763 because it has
fewer blocks than the ISP1761. But won testing on that IP
from the family that would be an issue.

Reported-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210827131154.4151862-2-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rmsilva authored and gregkh committed Sep 18, 2021
1 parent c0b94df commit ce1ef47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/isp1760/isp1760-hcd.c
Expand Up @@ -588,8 +588,8 @@ static void init_memory(struct isp1760_hcd *priv)

payload_addr = PAYLOAD_OFFSET;

for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++) {
for (j = 0; j < mem->blocks[i]; j++, curr++) {
for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++, curr += j) {
for (j = 0; j < mem->blocks[i]; j++) {
priv->memory_pool[curr + j].start = payload_addr;
priv->memory_pool[curr + j].size = mem->blocks_size[i];
priv->memory_pool[curr + j].free = 1;
Expand Down

0 comments on commit ce1ef47

Please sign in to comment.