diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-03-16 15:51:40 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-19 07:41:02 -0700 |
commit | 699a1fb9f47f6934a3e0ff59d668fdc0ef5b8b8d (patch) | |
tree | 9b766d2a17d9d05fe00c4be0bdacb6f5c04f500b /board/nautilus | |
parent | ec1c7022cdb50268ee54f6fdd185a2b07f3308fb (diff) | |
download | chrome-ec-699a1fb9f47f6934a3e0ff59d668fdc0ef5b8b8d.tar.gz |
nautilus: Increase task stack sizes, add stack analysis annotations
On cros/firmware-poppy-10431.B, plus the patches on this branch:
make BOARD=nautilus SECTION=RW analyzestack | grep Task
Task: HOOKS, Max size: 728 (504 + 224), Allocated size: 800
Task: USB_CHG_P0, Max size: 672 (448 + 224), Allocated size: 720
Task: USB_CHG_P1, Max size: 672 (448 + 224), Allocated size: 720
Task: CHARGER, Max size: 712 (488 + 224), Allocated size: 800
Task: MOTIONSENSE, Max size: 720 (496 + 224), Allocated size: 768
Task: CHIPSET, Max size: 744 (520 + 224), Allocated size: 800
Task: KEYPROTO, Max size: 516 (292 + 224), Allocated size: 600
Task: PDCMD, Max size: 776 (552 + 224), Allocated size: 800
Task: HOSTCMD, Max size: 792 (568 + 224), Allocated size: 840
Task: CONSOLE, Max size: 840 (616 + 224), Allocated size: 880
Task: POWERBTN, Max size: 696 (472 + 224), Allocated size: 800
Task: KEYSCAN, Max size: 584 (360 + 224), Allocated size: 600
Task: PD_C0, Max size: 896 (672 + 224), Allocated size: 1000
Task: PD_C1, Max size: 896 (672 + 224), Allocated size: 1000
RO is identical
200c7720 D __shared_mem_buf
There is still 2272 bytes of shared memory.
BRANCH=poppy
BUG=b:75234825
TEST=See above, software sync still works
Change-Id: Ia98b27a924d0023a5fb3bfef5280e9365e6ddf4b
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/965706
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/nautilus')
-rw-r--r-- | board/nautilus/analyzestack.yaml | 211 | ||||
-rw-r--r-- | board/nautilus/ec.tasklist | 28 |
2 files changed, 225 insertions, 14 deletions
diff --git a/board/nautilus/analyzestack.yaml b/board/nautilus/analyzestack.yaml new file mode 100644 index 0000000000..c9004e6376 --- /dev/null +++ b/board/nautilus/analyzestack.yaml @@ -0,0 +1,211 @@ +# Size of extra stack frame needed by exception context switch. +# See core/cortex-m/switch.S +exception_frame_size: 224 +# Add some missing calls. +add: + # TCPC stuff: + tcpm_init.lto_priv.255[driver/tcpm/tcpm.h:77]: + - tcpci_tcpm_init + tcpm_release[driver/tcpm/tcpm.h:90]: + - ps8xxx_tcpm_release + tcpm_get_cc.lto_priv.246[driver/tcpm/tcpm.h:95]: + - tcpci_tcpm_get_cc + tcpm_select_rp_value[driver/tcpm/tcpm.h:105]: + - tcpci_tcpm_select_rp_value + tcpm_set_cc.lto_priv.239[driver/tcpm/tcpm.h:110]: + - tcpci_tcpm_set_cc + tcpm_set_polarity[driver/tcpm/tcpm.h:115]: + - tcpci_tcpm_set_polarity + tcpm_set_vconn.lto_priv.249[driver/tcpm/tcpm.h:120]: + - tcpci_tcpm_set_vconn + tcpm_set_msg_header[driver/tcpm/tcpm.h:125]: + - tcpci_tcpm_set_msg_header + tcpm_set_rx_enable.lto_priv.252[driver/tcpm/tcpm.h:131]: + - tcpci_tcpm_set_rx_enable + tcpm_get_message[driver/tcpm/tcpm.h:136]: + - tcpci_tcpm_get_message + tcpm_transmit[driver/tcpm/tcpm.h:142]: + - ps8xxx_tcpm_transmit + tcpc_alert[driver/tcpm/tcpm.h:147]: + - tcpci_tcpc_alert + tcpc_discharge_vbus[driver/tcpm/tcpm.h:152]: + - tcpci_tcpc_discharge_vbus + tcpm_set_drp_toggle[driver/tcpm/tcpm.h:163]: + - tcpci_tcpc_drp_toggle + tcpm_get_chip_info[driver/tcpm/tcpm.h:185]: + - tcpci_get_chip_info + board_tcpc_init[board/nautilus/board.c:233]: + - ps8xxx_tcpc_update_hpd_status + tcpci_tcpc_drp_toggle[driver/tcpm/tcpci.c:148]: + - None + # USB mux stuff + usb_mux_init[driver/usb_mux.c:25]: + - tcpci_tcpm_mux_init + usb_mux_init[driver/usb_mux.c:31]: + - None + usb_mux_set[driver/usb_mux.c:52]: + - tcpci_tcpm_mux_set + usb_mux_get[driver/usb_mux.c:71]: + - tcpci_tcpm_mux_get + usb_mux_flip[driver/usb_mux.c:92]: + - tcpci_tcpm_mux_get + usb_mux_flip[driver/usb_mux.c:103]: + - tcpci_tcpm_mux_set + hc_usb_pd_mux_info[driver/usb_mux.c:169]: + - tcpci_tcpm_mux_get + svdm_dp_post_config.lto_priv.271[board/nautilus/usb_pd_policy.c:363]: + - ps8xxx_tcpc_update_hpd_status + svdm_dp_attention.lto_priv.272[board/nautilus/usb_pd_policy.c:378]: + - ps8xxx_tcpc_update_hpd_status + svdm_exit_dp_mode.lto_priv.273[board/nautilus/usb_pd_policy.c:389]: + - ps8xxx_tcpc_update_hpd_status + # pd_svdm + pd_dfp_enter_mode[common/usb_pd_policy.c:459]: + - svdm_enter_dp_mode + dfp_consume_attention.lto_priv.259[common/usb_pd_policy.c:497]: + - svdm_dp_attention + pd_dfp_exit_mode[common/usb_pd_policy.c:563]: + - svdm_exit_dp_mode + pd_dfp_exit_mode[common/usb_pd_policy.c:580]: + - svdm_exit_dp_mode + pd_svdm[common/usb_pd_policy.c:767]: + - svdm_dp_status + pd_svdm[common/usb_pd_policy.c:778]: + - svdm_dp_config + pd_svdm[common/usb_pd_policy.c:784]: + - svdm_dp_post_config + # Motion sense + queue_advance_head[common/queue.c:105]: + - queue_action_null + queue_advance_tail[common/queue.c:116]: + - queue_action_null + motion_sense_set_data_rate[common/motion_sense.c:270]: + - set_data_rate[driver/accelgyro_bmi160.c] + - set_data_rate[driver/accel_bma2x2.c] + motion_sense_set_data_rate[common/motion_sense.c:289]: + - get_data_rate[driver/accelgyro_bmi160.c] + - get_data_rate[driver/accel_bma2x2.c] + motion_sense_set_ec_rate_from_ap[common/motion_sense.c:308]: + - get_data_rate[driver/accelgyro_bmi160.c] + - get_data_rate[driver/accel_bma2x2.c] + motion_sense_set_motion_intervals.lto_priv.303[common/motion_sense.c:414]: + - get_data_rate[driver/accelgyro_bmi160.c] + - get_data_rate[driver/accel_bma2x2.c] + motion_sense_init[common/motion_sense.c:450]: + - init[driver/accelgyro_bmi160.c] + - init[driver/accel_bma2x2.c] + sensor_init_done[common/motion_sense.c:471]: + - set_range[driver/accelgyro_bmi160.c] + - set_range[driver/accel_bma2x2.c] + sensor_init_done[common/motion_sense.c:474]: + - get_range[driver/accelgyro_bmi160.c] + - get_range[driver/accel_bma2x2.c] + motion_sense_process.isra.9[common/motion_sense.c:721]: + - irq_handler[driver/accelgyro_bmi160.c] + host_cmd_motion_sense[common/motion_sense.c:1251]: + - set_range[driver/accelgyro_bmi160.c] + - set_range[driver/accel_bma2x2.c] + host_cmd_motion_sense[common/motion_sense.c:1259]: + - get_range[driver/accelgyro_bmi160.c] + - get_range[driver/accel_bma2x2.c] + host_cmd_motion_sense[common/motion_sense.c:1274]: + - set_offset[driver/accelgyro_bmi160.c] + - set_offset[driver/accel_bma2x2.c] + host_cmd_motion_sense[common/motion_sense.c:1297]: + - perform_calib[driver/accelgyro_bmi160.c] + host_cmd_motion_sense[common/motion_sense.c:1300]: + - get_offset[driver/accelgyro_bmi160.c] + - get_offset[driver/accel_bma2x2.c] + command_accelrange[common/motion_sense.c:1515]: + - set_range[driver/accelgyro_bmi160.c] + - set_range[driver/accel_bma2x2.c] + command_accelrange[common/motion_sense.c:1520]: + - get_range[driver/accelgyro_bmi160.c] + - get_range[driver/accel_bma2x2.c] + host_cmd_motion_sense[common/motion_sense.c:1520]: + - get_range[driver/accelgyro_bmi160.c] + - get_range[driver/accel_bma2x2.c] + command_accelresolution[common/motion_sense.c:1564]: + - None + command_accelresolution[common/motion_sense.c:1568]: + - get_resolution[driver/accelgyro_bmi160.c] + - get_resolution[driver/accel_bma2x2.c] + command_accel_data_rate[common/motion_sense.c:1623]: + - get_data_rate[driver/accelgyro_bmi160.c] + - get_data_rate[driver/accel_bma2x2.c] + command_accel_read_xyz[common/motion_sense.c:1659]: + - read[driver/accelgyro_bmi160.c] + - read[driver/accel_bma2x2.c] + calculate_lid_angle[common/motion_lid.c:255]: + - get_range[driver/accelgyro_bmi160.c] + - get_range[driver/accel_bma2x2.c] + calculate_lid_angle[common/motion_lid.c:256]: + - get_range[driver/accelgyro_bmi160.c] + - get_range[driver/accel_bma2x2.c] + # Temp (see temp_sensors array in board file) + temp_sensor_read[common/temp_sensor.c:26]: + - charge_get_battery_temp + - bd99992gw_get_val + # Misc + jump_to_image[common/system.c:568]: + - None + system_download_from_flash[chip/npcx/system-npcx5.c:257]: + - None + __hibernate_npcx_series[chip/npcx/system-npcx5.c:144]: + - None + handle_command[common/console.c:248]: + - { name: __cmds, stride: 16, offset: 4 } + hook_task[common/hooks.c:197]: + - { name: __deferred_funcs, stride: 4, offset: 0 } + - { name: __hooks_second, stride: 8, offset: 0 } + - { name: __hooks_tick, stride: 8, offset: 0 } + # Note: This assumes worse case, where all hook functions can be called from + # any hook_notify call + # Generate using `grep hooks_.*_end build/nautilus/R*/ec.R*.smap | + # sed -e 's/.*\(__hooks.*\)_end/ - { name: \1, stride: 8, offset: 0 }/' | + # sort -u` + hook_notify[common/hooks.c:127]: + - { name: __hooks_ac_change, stride: 8, offset: 0 } + - { name: __hooks_battery_soc_change, stride: 8, offset: 0 } + - { name: __hooks_chipset_pre_init, stride: 8, offset: 0 } + - { name: __hooks_chipset_reset, stride: 8, offset: 0 } + - { name: __hooks_chipset_resume, stride: 8, offset: 0 } + - { name: __hooks_chipset_shutdown, stride: 8, offset: 0 } + - { name: __hooks_chipset_startup, stride: 8, offset: 0 } + - { name: __hooks_chipset_suspend, stride: 8, offset: 0 } + - { name: __hooks_freq_change, stride: 8, offset: 0 } + - { name: __hooks_lid_change, stride: 8, offset: 0 } + - { name: __hooks_pre_freq_change, stride: 8, offset: 0 } + - { name: __hooks_pwrbtn_change, stride: 8, offset: 0 } + - { name: __hooks_sysjump, stride: 8, offset: 0 } + - { name: __hooks_tablet_mode_change, stride: 8, offset: 0 } + mkbp_get_next_event[common/mkbp_event.c:130]: + - { name: __mkbp_evt_srcs, stride: 8, offset: 4 } + host_send_response[common/host_command.c:153]: + - lpc_send_response + host_packet_respond[common/host_command.c:240]: + - lpc_send_response + host_command_process[common/host_command.c:704]: + - { name: __hcmds, stride: 12, offset: 0 } + # gpio_interrupt.lto_priv.407[chip/npcx/gpio.c:479] + vfnprintf: + # This covers all the addchar in vfnprintf, but stackanalyzer does not + # realize that... + - __tx_char + i2c_command_passthru[common/i2c_master.c:597]: + - None +remove: +# Remove all callsites pointing to panic_assert_fail. +- panic_assert_fail +# Remove hook paths that don't make sense +- [ [ common_intel_x86_power_handle_state, power_button_change_deferred, hook_task, lpc_chipset_reset, espi_chipset_reset ], hook_notify, powerbtn_x86_lid_change ] +- [ system_common_shutdown, hook_notify, system_run_image_copy ] +- [ jump_to_image, hook_notify, [ powerbtn_x86_lid_change, system_common_shutdown, power_up_inhibited_cb, motion_sense_shutdown, motion_sense_resume ] ] +- [ [ extpower_deferred, charger_task, motion_sense_switch_sensor_rate, lid_switch_open, lid_switch_close, motion_sense_task ], hook_notify, [ powerbtn_x86_lid_change, power_up_inhibited_cb, system_common_shutdown, motion_sense_shutdown, motion_sense_resume ] ] +- [ common_intel_x86_power_handle_state, hook_notify, power_up_inhibited_cb ] +# pd_request_power_swap calls set_state with either PD_STATE_SRC_SWAP_INIT or +# PD_STATE_SNK_SWAP_INIT as parameters, which cannot call any of the +# charge_manager functions. +- [ [ pd_request_power_swap, pd_execute_hard_reset, pd_request_data_swap, pd_request_vconn_swap.lto_priv.237, pd_send_request_msg.lto_priv.250 ], set_state.lto_priv.236, [ typec_set_input_current_limit, charge_manager_update_charge, pd_power_supply_reset, pd_dfp_exit_mode, usb_mux_set ] ] +# Debug prints that do not actually need a 64 uint division, of the time +- [ [i2c_reset, i2c_abort_data, i2c_xfer], cprintf, vfnprintf, [uint64divmod.part.3.lto_priv.141, get_time] ] diff --git a/board/nautilus/ec.tasklist b/board/nautilus/ec.tasklist index 0ef0783898..8afac3eebb 100644 --- a/board/nautilus/ec.tasklist +++ b/board/nautilus/ec.tasklist @@ -21,17 +21,17 @@ */ #define CONFIG_TASK_LIST \ - TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(USB_CHG_P0, usb_charger_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(USB_CHG_P1, usb_charger_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CHARGER, charger_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \ - TASK_NOTEST(CHIPSET, chipset_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(PDCMD, pd_command_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(PD_C1, pd_task, NULL, LARGER_TASK_STACK_SIZE) + TASK_ALWAYS(HOOKS, hook_task, NULL, 800) \ + TASK_ALWAYS(USB_CHG_P0, usb_charger_task, NULL, 720) \ + TASK_ALWAYS(USB_CHG_P1, usb_charger_task, NULL, 720) \ + TASK_ALWAYS(CHARGER, charger_task, NULL, 800) \ + TASK_ALWAYS(MOTIONSENSE, motion_sense_task, NULL, 768) \ + TASK_NOTEST(CHIPSET, chipset_task, NULL, 800) \ + TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, 600) \ + TASK_NOTEST(PDCMD, pd_command_task, NULL, 800) \ + TASK_ALWAYS(HOSTCMD, host_command_task, NULL, 840) \ + TASK_ALWAYS(CONSOLE, console_task, NULL, 880) \ + TASK_ALWAYS(POWERBTN, power_button_task, NULL, 800) \ + TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, 600) \ + TASK_ALWAYS(PD_C0, pd_task, NULL, 1000) \ + TASK_ALWAYS(PD_C1, pd_task, NULL, 1000) |