Skip to contentSkip to conversation

staging: tidspbridge for 2.6.38

PATCH In review Omar Ramirez Luna 2 participants 6 messages Jan 14, 2011 – Jan 20, 2011 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: tidspbridge for 2.6.38

Set of important changes for 2.6.38, to fix a critical bug (1) and a compile break (2).

Guzman Lugo, Fernando (1):
staging: tidspbridge: configure full L1 MMU range

Omar Ramirez Luna (1):
staging: tidspbridge: replace mbox callback with notifier_call

 drivers/staging/tidspbridge/core/tiomap3430.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
#1 lore raw

PATCH 1/2 staging: tidspbridge: configure full L1 MMU range

From: Guzman Lugo, Fernando <[email protected]>

IVA MMU can manage up to 4GB of address space through its page tables, given that it's L1 is divided into 1MB sections it requires at least 16KB for its table which represents 4096 entries of 32 bits each.

Previously, only 1GB was being handled by setting the page table size to 4KB, any virtual address beyond of the L1 size used, would fall into memory that does not belong to L1 translation tables, leading to unpredictable results.

So, set the L1 table size to cover the entire MMU range (4GB) whether is meant to be used or not.

---
 drivers/staging/tidspbridge/core/tiomap3430.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/staging/tidspbridge/core/tiomap3430.c +1 -4
index 1be081f..d6f333e 100644
@@ -786,10 +786,7 @@ static int bridge_dev_create(struct bridge_dev_context
 
 	pt_attrs = kzalloc(sizeof(struct pg_table_attrs), GFP_KERNEL);
 	if (pt_attrs != NULL) {
-		/* Assuming that we use only DSP's memory map
-		 * until 0x4000:0000 , we would need only 1024
-		 * L1 enties i.e L1 size = 4K */
-		pt_attrs->l1_size = 0x1000;
+		pt_attrs->l1_size = SZ_16K; /* 4096 entries of 32 bits */
 		align_size = pt_attrs->l1_size;
 		/* Align sizes are expected to be power of 2 */
 		/* we like to get aligned on L1 table size */
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/2 staging: tidspbridge: replace mbox callback with notifier_call

In reply to Omar Ramirez Luna

Lately, mailbox callbacks have been replaced by notifier block call chains, this needs to be changed in the users of mailbox, otherwise compilation will break due to missing parameters.

---
 drivers/staging/tidspbridge/core/tiomap3430.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/staging/tidspbridge/core/tiomap3430.c +6 -4
index d6f333e..7652c06 100644
@@ -223,6 +223,10 @@ static struct bridge_drv_interface drv_interface_fxns = {
 	bridge_msg_set_queue_id,
 };
 
+static struct notifier_block dsp_mbox_notifier = {
+	.notifier_call = io_mbox_msg,
+};
+
 static inline void flush_all(struct bridge_dev_context *dev_context)
 {
 	if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION ||
@@ -553,7 +557,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
 		 * Enable Mailbox events and also drain any pending
 		 * stale messages.
 		 */
-		dev_context->mbox = omap_mbox_get("dsp");
+		dev_context->mbox = omap_mbox_get("dsp", &dsp_mbox_notifier);
 		if (IS_ERR(dev_context->mbox)) {
 			dev_context->mbox = NULL;
 			pr_err("%s: Failed to get dsp mailbox handle\n",
@@ -563,8 +567,6 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
 
 	}
 	if (!status) {
-		dev_context->mbox->rxq->callback = (int (*)(void *))io_mbox_msg;
-
 /*PM_IVA2GRPSEL_PER = 0xC0;*/
 		temp = readl(resources->dw_per_pm_base + 0xA8);
 		temp = (temp & 0xFFFFFF30) | 0xC0;
@@ -685,7 +687,7 @@ static int bridge_brd_stop(struct bridge_dev_context *dev_ctxt)
 	/* Disable the mailbox interrupts */
 	if (dev_context->mbox) {
 		omap_mbox_disable_irq(dev_context->mbox, IRQ_RX);
-		omap_mbox_put(dev_context->mbox);
+		omap_mbox_put(dev_context->mbox, &dsp_mbox_notifier);
 		dev_context->mbox = NULL;
 	}
 	/* Reset IVA2 clocks*/
Signature · 1 line
1.7.1
#3 lore raw

Re: [PATCH 2/2] staging: tidspbridge: replace mbox callback with notifier_call

Quoted 3 lines · Omar Ramirez Luna

Lately, mailbox callbacks have been replaced by notifier block call chains, this needs to be changed in the users of mailbox, otherwise compilation will break due to missing parameters.

Please hold on applying this patch, it is not right as io_mbx_msg differs on what a notifier_call parameters and type should be.

Regards,

Omar

#4 lore raw

Re: [PATCH 2/2] staging: tidspbridge: replace mbox callback with notifier_call

Quoted 7 lines · Omar
Quoted 3 lines · Omar Ramirez Luna

Lately, mailbox callbacks have been replaced by notifier block call chains, this needs to be changed in the users of mailbox, otherwise compilation will break due to missing parameters.

Please hold on applying this patch, it is not right as io_mbx_msg differs on what a notifier_call parameters and type should be.

Ok, I'll just queue up the 1st patch in this series.

greg k-h

#5 lore raw
In reply to Omar Ramirez Luna

Hi Greg,

Quoted 11 lines · Omar Ramirez Luna

Set of important changes for 2.6.38, to fix a critical bug (1) and a compile break (2).

Guzman Lugo, Fernando (1):
 staging: tidspbridge: configure full L1 MMU range

Omar Ramirez Luna (1):
 staging: tidspbridge: replace mbox callback with notifier_call

 drivers/staging/tidspbridge/core/tiomap3430.c |   15 +++++++--------

 1 files changed, 7 insertions(+), 8 deletions(-)

Ping... to include these critical fixes, I made a correction on my patch and sent v2, please let me know if you want me to send the two patches again.

Regards,

Omar