]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mailbox: bcm-pdc: Convert from interrupts to poll for tx done
authorRob Rice <rob.rice@broadcom.com>
Mon, 14 Nov 2016 18:25:58 +0000 (13:25 -0500)
committerJassi Brar <jaswinder.singh@linaro.org>
Mon, 19 Dec 2016 14:40:19 +0000 (20:10 +0530)
commitab8d1b2d564f6649547b97e65806556c42f93a26
treef32f34cb719bdcba8bf7c8f7a9e5ae810497cbeb
parent9310f1ded44067b2da61fa0471ca5b7768dd28ae
mailbox: bcm-pdc: Convert from interrupts to poll for tx done

The PDC driver is a mailbox controller. A mailbox controller
can report that a mailbox message has been "transmitted" either when
a tx interrupt fires or by having the mailbox framework poll. This
commit converts the PDC driver to the poll method. We found that the
tx interrupt happens when the descriptors are read by the SPU hw. Thus,
the interrupt method does not allow more than one tx message in the PDC
tx DMA ring at a time. To keep the SPU hw busy, we would like to keep
the tx ring full under heavy load.

With the poll method, the PDC driver responds that the previous message
has been transmitted if the tx ring has space for another message.
SPU request messages take a variable number of descriptors. If 15
descriptors are available, there is a good chance another message will
fit. Also increased the ring size from 128 to 512 descriptors.

With this change, I found the PDC driver hangs on its spinlock under
heavy load. The PDC spinlock is not required; so I removed it. Calls
to pdc_send_data() are already synchronized because of the channel
spinlock in the mailbox framework. Other references to ring indexes
should not require locking because they only written on either the
tx or rx side.

Signed-off-by: Rob Rice <rob.rice@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/bcm-pdc-mailbox.c