Re: [PATCH 6/7] omap:mailbox-add notification support for multiple readers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 10/14/2010 9:13 PM, Hari Kanigeri wrote:
@@ -252,41 +253,39 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
...
+	if (!mbox->use_count++) {
+		ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
+					mbox->name, mbox);
...
@@ -296,29 +295,36 @@ fail_alloc_txq:
...
  static void omap_mbox_fini(struct omap_mbox *mbox)
  {
+	if (!--mbox->use_count) {
+		tasklet_kill(&mbox->txq->tasklet);
+		flush_work(&mbox->rxq->work);
+		mbox_queue_free(mbox->txq);
+		mbox_queue_free(mbox->rxq);
+	}
+
+	if (likely(mbox->ops->shutdown)) {
+		if (!--mbox_configured) {
+			free_irq(mbox->irq, mbox);

Above hunks will create an imbalance of free_irq, as request_irq can be called per registered mailbox and free_irq is only done for the last caller releasing the mailbox handle.

e.g.: mbox-1, mbox-N will request a shared irq on the same interrupt line, but only the last caller of omap_mbox_put will free its irq, leaving the other one there.

This can be fixed if the free is moved to be executed within the following block:

	if (!--mbox->use_count) {
		...
		free_irq(mbox->irq, mbox);
	}

Regards,

Omar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux