Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205820
b: refs/heads/master
c: ec71c8f
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Contreras authored and Greg Kroah-Hartman committed Jul 8, 2010
1 parent a0d5be4 commit 6561aaf
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 62f5242e2e275fe526d65733535591c065cc87a5
refs/heads/master: ec71c8fe23ca236119c7176a8a3e77529a393283
65 changes: 36 additions & 29 deletions trunk/drivers/staging/tidspbridge/core/ue_deh.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ int bridge_deh_register_notify(struct deh_mgr *deh_mgr, u32 event_mask,
return ntfy_unregister(deh_mgr->ntfy_obj, hnotification);
}

void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo)
static void mmu_fault_print_stack(struct bridge_dev_context *dev_context)
{
struct bridge_dev_context *dev_context;
struct cfg_hostres *resources;
struct hw_mmu_map_attrs_t map_attrs = {
.endianism = HW_LITTLE_ENDIAN,
Expand All @@ -151,12 +150,45 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo)
};
void *dummy_va_addr;

resources = dev_context->resources;
dummy_va_addr = (void*)__get_free_page(GFP_ATOMIC);

/*
* Before acking the MMU fault, let's make sure MMU can only
* access entry #0. Then add a new entry so that the DSP OS
* can continue in order to dump the stack.
*/
hw_mmu_twl_disable(resources->dw_dmmu_base);
hw_mmu_tlb_flush_all(resources->dw_dmmu_base);

hw_mmu_tlb_add(resources->dw_dmmu_base,
virt_to_phys(dummy_va_addr), fault_addr,
HW_PAGE_SIZE4KB, 1,
&map_attrs, HW_SET, HW_SET);

dsp_clk_enable(DSP_CLK_GPT8);

dsp_gpt_wait_overflow(DSP_CLK_GPT8, 0xfffffffe);

/* Clear MMU interrupt */
hw_mmu_event_ack(resources->dw_dmmu_base,
HW_MMU_TRANSLATION_FAULT);
dump_dsp_stack(dev_context);
dsp_clk_disable(DSP_CLK_GPT8);

hw_mmu_disable(resources->dw_dmmu_base);
free_page((unsigned long)dummy_va_addr);
}

void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo)
{
struct bridge_dev_context *dev_context;

if (!deh_mgr)
return;

dev_info(bridge, "%s: device exception\n", __func__);
dev_context = deh_mgr->hbridge_context;
resources = dev_context->resources;

switch (ulEventMask) {
case DSP_SYSERROR:
Expand All @@ -181,36 +213,11 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo)
(unsigned int) deh_mgr->err_info.dw_val1,
(unsigned int) deh_mgr->err_info.dw_val2,
(unsigned int) fault_addr);
dummy_va_addr = (void*)__get_free_page(GFP_ATOMIC);

print_dsp_trace_buffer(dev_context);
dump_dl_modules(dev_context);

/*
* Before acking the MMU fault, let's make sure MMU can only
* access entry #0. Then add a new entry so that the DSP OS
* can continue in order to dump the stack.
*/
hw_mmu_twl_disable(resources->dw_dmmu_base);
hw_mmu_tlb_flush_all(resources->dw_dmmu_base);

hw_mmu_tlb_add(resources->dw_dmmu_base,
virt_to_phys(dummy_va_addr), fault_addr,
HW_PAGE_SIZE4KB, 1,
&map_attrs, HW_SET, HW_SET);

dsp_clk_enable(DSP_CLK_GPT8);

dsp_gpt_wait_overflow(DSP_CLK_GPT8, 0xfffffffe);

/* Clear MMU interrupt */
hw_mmu_event_ack(resources->dw_dmmu_base,
HW_MMU_TRANSLATION_FAULT);
dump_dsp_stack(dev_context);
dsp_clk_disable(DSP_CLK_GPT8);

hw_mmu_disable(resources->dw_dmmu_base);
free_page((unsigned long)dummy_va_addr);
mmu_fault_print_stack(dev_context);
break;
#ifdef CONFIG_BRIDGE_NTFY_PWRERR
case DSP_PWRERROR:
Expand Down

0 comments on commit 6561aaf

Please sign in to comment.