Skip to contentSkip to conversation

OMAP2420: mailbox: fix IVA vs DSP IRQ numbering

PATCH New Kevin Hilman 2 participants 3 messages Feb 11, 2011 – Feb 14, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 OMAP2420: mailbox: fix IVA vs DSP IRQ numbering

The IRQ numbering for the IVA and DSP mailboxes was switched due to the wrong ordering in the OMAP2 mbox list. Switch the ordering so DSP is first and matches all the other SoCs.

Tested on OMAP2420/n810.

---
 arch/arm/mach-omap2/mailbox.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mailbox.c +1 -1
index b4cd2aa..1ccf1d6 100644
@@ -334,7 +334,7 @@ static struct omap_mbox mbox_iva_info = {
 	.priv	= &omap2_mbox_iva_priv,
 };
 
-struct omap_mbox *omap2_mboxes[] = { &mbox_iva_info, &mbox_dsp_info, NULL };
+struct omap_mbox *omap2_mboxes[] = { &mbox_dsp_info, &mbox_iva_info, NULL };
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4)
Signature · 1 line
1.7.4
#1 lore raw

PATCH 2/2 OMAP2+: mailbox: fix lookups for multiple mailboxes

The pointer math in omap_mbox_get() is not quite right, and leads to passing NULL to strcmp() when searching for an mbox that is not first in the list.

Convert to using array indexing as is done in all the other functions which walk the mbox list.

Tested on OMAP2420/n810, OMAP3630/zoom3, OMAP4430/Blaze

---
 arch/arm/plat-omap/mailbox.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
arch/arm/plat-omap/mailbox.c +7 -4
index 459b319..49d3208 100644
@@ -322,15 +322,18 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
 
 struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb)
 {
-	struct omap_mbox *mbox;
-	int ret;
+	struct omap_mbox *_mbox, *mbox = NULL;
+	int i, ret;
 
 	if (!mboxes)
 		return ERR_PTR(-EINVAL);
 
-	for (mbox = *mboxes; mbox; mbox++)
-		if (!strcmp(mbox->name, name))
+	for (i = 0; (_mbox = mboxes[i]); i++) {
+		if (!strcmp(_mbox->name, name)) {
+			mbox = _mbox;
 			break;
+		}
+	}
 
 	if (!mbox)
 		return ERR_PTR(-ENOENT);
Signature · 1 line
1.7.4
maintainer
#2 lore raw

PATCH 1/2 OMAP2420: mailbox: fix IVA vs DSP IRQ numbering

In reply to Kevin Hilman
Quoted 5 lines · Kevin Hilman

The IRQ numbering for the IVA and DSP mailboxes was switched due to the wrong ordering in the OMAP2 mbox list. Switch the ordering so DSP is first and matches all the other SoCs.

Tested on OMAP2420/n810.

I'll queue both as fixes for the -rc cycle.

Tony