Skip to content

Add panic info into panic dump and fix some issues to make code build - #423

Merged
lgirdwood merged 8 commits into
thesofproject:masterfrom
xiulipan:panicinfo
Sep 27, 2018
Merged

lgirdwood merged 8 commits into
thesofproject:masterfrom
xiulipan:panicinfo

Conversation

@xiulipan

Copy link
Copy Markdown
Contributor
  1. Store the PS register and dump the oldps
  2. Fix some header issues when adding some header into panic.h
  3. Add panic info into panic dump.

Work with thesofproject/linux#162

The register PS will always be changed due to the IRQ disable.
Store the old PS and dump that value.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Include dma.h in alloc.h will cause some error, remove the unneeded
dma.h and add some need header after remove it.
Also move some helper function into alloc.c to avoid some warnings.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
clk will use timer function, add timer.h include for it.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
platform_panic is defined in platform/platform.h
empty define in sof/platform.h is no use

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Use sof_ipc_panic_info to store panic info inclueded filename and line
number.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Add filename and line number of the panic call into the panic info. Then
dump this info to host.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
@xiulipan

Copy link
Copy Markdown
Contributor Author

@lgirdwood
Need #422 to fix host build failed by #411

Comment thread src/include/sof/alloc.h
void free_heap(int zone);

/* flush block map from cache to sram */
static inline void flush_block_map(struct block_map *map)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error, please include error this fixes in commit message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will be very long list.
Since I add
#include <sof/alloc.h>
in panic.h
I just fixed the related header to have these patches.
I will list the errors later.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiulipan I dont need a list of errors, but just something similar to "fixes build error for target X caused by missing header Y" will do.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgirdwood
So I need to modify the comments?

Comment thread src/include/sof/alloc.h
#include <string.h>
#include <stdint.h>
#include <sof/bit.h>
#include <sof/dma.h>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • alloc: fix some build issues in alloc

In file included from ../../src/include/sof/alloc.h:38,
from ../../src/include/sof/panic.h:35,
from /home/pxl/work/sof/sof/src/arch/xtensa/include/arch/wait.h:33,
from ../../src/include/sof/wait.h:38,
from ../../src/include/sof/schedule.h:41,
from /home/pxl/work/sof/sof/src/arch/xtensa/include/arch/task.h:41,
from ../../src/include/sof/task.h:34,
from init.c:36:
../../src/include/sof/dma.h:291:2: error: unknown type name 'completion_t'
completion_t complete;

Comment thread src/include/sof/alloc.h
#include <stdint.h>
#include <sof/bit.h>
#include <sof/dma.h>
#include <sof/platform.h>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

../../src/include/sof/alloc.h:89:31: error: 'PLATFORM_DCACHE_ALIGN' undeclared here (not in a function); did you mean 'PLATFORM_HEAP_RUNTIME'?
} attribute ((aligned(PLATFORM_DCACHE_ALIGN)));
^~~~~~~~~~~~~~~~~~~~~
PLATFORM_HEAP_RUNTIME

PLATFORM_DCACHE_ALIGN is defined in sof/platform.h

Comment thread src/include/sof/alloc.h
#include <sof/dma.h>
#include <sof/platform.h>
#include <platform/memory.h>
#include <arch/spinlock.h>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

../../src/include/sof/alloc.h:113:2: error: unknown type name 'spinlock_t'
spinlock_t lock; /* all allocs and frees are atomic */
spinlock_t is defined in arch/spinlock.h

Comment thread src/include/sof/alloc.h
/* flush block map from cache to sram */
static inline void flush_block_map(struct block_map *map)
{
dcache_writeback_invalidate_region(map->block,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

../../src/include/sof/alloc.h: In function 'flush_block_map':
../../src/include/sof/alloc.h:144:2: error: implicit declaration of function 'dcache_writeback_invalidate_region' [-Werror=implicit-function-declaration]
dcache_writeback_invalidate_region(map->block,

This function is only a helper function for alloc.c
No need to be in header.

int platform_init(struct sof *sof);

/**
* \brief Called by the panic handler.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

../../src/include/sof/platform.h:76:20: error: 'platform_panic' declared 'static' but never defined [-Werror=unused-function]
static inline void platform_panic(uint32_t p);

platform_panic is defined in platform/platform.h
Redeclared here


#include <sof/lock.h>
#include <sof/trace.h>
#include <sof/wait.h>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/home/pxl/work/sof/sof/src/platform/intel/include/platform/cavs/pm_runtime.h:57:3: error: implicit declaration of function 'wait_delay'; did you mean 'init_heap'? [-Werror=implicit-function-declaration]
wait_delay(PLATFORM_FORCE_L1_EXIT_TIME);

wait_delay is defined in sof/wait.h

Comment thread src/lib/agent.c
#include <platform/timer.h>
#include <platform/platform.h>
#include <platform/clk.h>
#include <sof/drivers/timer.h>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agent.c:58:18: error: implicit declaration of function 'platform_timer_get'; did you mean 'platform_init'? [-Werror=implicit-function-declaration]
sa->last_idle = platform_timer_get(platform_timer);

platform_timer_get is defined in sof/drivers/timer.h

@xiulipan

xiulipan commented Sep 27, 2018 •

Copy link
Copy Markdown
Contributor Author

@lrgirdwo
Did not know why modify one include file will cause domino effect error in building.
If that means we have some wrong include or over include file in our headers?

@lgirdwood

lgirdwood commented Sep 27, 2018 •

Copy link
Copy Markdown
Member

@xiulipan modifying one include that is included by others or included in a different order in other files may have some knock on effects if there are missing declaration or dependencies. It seem you have fixed one.

@lgirdwood
lgirdwood merged commit 803b4b3 into thesofproject:master Sep 27, 2018
@xiulipan
xiulipan deleted the panicinfo branch September 19, 2019 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants