slimbus: Modify check for empty slots

There was a corner case where the open slot count was going -ve
indicating that there are no slots left for messaging. The current
check to ensure non-zero messaging slots does not take that into
account. This commit fixes that check.

CRs-fixed: 370229
Change-Id: I832ce0a26f1919d3d03b4ef0311603a5a778685e
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
This commit is contained in:
Sagar Dharia
2012-06-25 12:44:02 -06:00
committed by Stephen Boyd
parent c813a00b9d
commit e82e79bf76

View File

@@ -1979,7 +1979,7 @@ static int slim_sched_chans(struct slim_device *sb, u32 clkgear,
}
}
/* Leave some slots for messaging space */
if (opensl1[1] == 0 && opensl1[0] == 0)
if (opensl1[1] <= 0 && opensl1[0] <= 0)
return -EXFULL;
if (opensl1[1] > opensl1[0]) {
int temp = opensl1[0];
@@ -2184,7 +2184,7 @@ static int slim_sched_chans(struct slim_device *sb, u32 clkgear,
}
}
/* Leave some slots for messaging space */
if (opensl3[1] == 0 && opensl3[0] == 0)
if (opensl3[1] <= 0 && opensl3[0] <= 0)
return -EXFULL;
/* swap 1st and 2nd bucket if 2nd bucket has more open slots */
if (opensl3[1] > opensl3[0]) {