From 8e35431b2e5f14e63e58b9296789e5fdc26c377e Mon Sep 17 00:00:00 2001 From: Roy Pledge Date: Wed, 24 Apr 2013 14:00:49 -0400 Subject: Fix pool channel ID checking so it works based on the global pool channel ID variable Signed-off-by: Roy Pledge Change-Id: I076964896bd1a54cf72aa16a25270a978c7d73d3 Reviewed-on: http://git.am.freescale.net:8181/2493 Reviewed-by: Thorpe Geoff-R01361 Reviewed-by: Wang Haiying-R54964 Reviewed-by: Fleming Andrew-AFLEMING Tested-by: Fleming Andrew-AFLEMING diff --git a/drivers/staging/fsl_qbman/qman_low.h b/drivers/staging/fsl_qbman/qman_low.h index 26641b6..e210f6a 100644 --- a/drivers/staging/fsl_qbman/qman_low.h +++ b/drivers/staging/fsl_qbman/qman_low.h @@ -1235,13 +1235,21 @@ static inline int qm_shutdown_fq(struct qm_portal *portal, u32 fqid) /* Flag that we need to drain FQ */ drain = 1; - if (channel >= 0x400 && channel < 0x410) { + if (channel >= qm_channel_pool1 && + channel < (qm_channel_pool1 + 15)) { /* Pool channel, enable the bit in the portal */ - dequeue_wq = (channel-0x400)<<4 | wq; - } else if (channel < 0x400) { + dequeue_wq = (channel - + qm_channel_pool1 + 1)<<4 | wq; + } else if (channel < qm_channel_pool1) { /* Dedicated channel */ dequeue_wq = wq; + } else { + pr_info("Cannot recover FQ 0x%x, it is " + "scheduled on channel 0x%x", + fqid, channel); + return -EBUSY; } + while (!found_fqrn) { /* Keep draining DQRR while checking the MR*/ qm_dqrr_sdqcr_set(portal, -- cgit v0.10.2