Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OTA] Shutdown server and stop event loop directly from OTA Image Processor #16698

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

carol-apple
Copy link
Contributor

Problem

Instead of using OTARequestorInterface as a way to access mServer->DispatchShutDownAndStopEventLoop(), just directly call the necessary platform APIs to shtudown

Fixes: #16697

Change overview

  • Remove OTARequestorInterface::Shutdown
  • Directly schedule calls to DeviceLayer::PlatformMgr().HandleServerShuttingDown() and DeviceLayer::PlatformMgr().StopEventLoopTask()

Testing

  • Verified after successful transfer of image, the server is shutdown and even loop stopped and new image is booted on Darwin

@github-actions
Copy link

github-actions bot commented Mar 27, 2022

PR #16698: Size comparison from 58cd5fb to 6672d45

Decreases (6 builds for cyw30739, efr32, esp32, k32w, nrfconnect)
platform target config section 58cd5fb 6672d45 change % change
cyw30739 ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 574890 574746 -144 -0.0
.app_xip_area 473940 473796 -144 -0.0
efr32 lighting-app BRD4161A (read only) 925760 925604 -156 -0.0
(read/write) 128712 128708 -4 -0.0
.text 925752 925596 -156 -0.0
BRD4161A+rpc (read only) 954576 954412 -164 -0.0
.text 954568 954404 -164 -0.0
esp32 all-clusters-app m5stack (read only) 1022583 1022579 -4 -0.0
.flash.text 1017199 1017195 -4 -0.0
k32w light k32w061+release (read/write) 703320 703180 -140 -0.0
.text 618076 617936 -140 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1141091 1140951 -140 -0.0
rodata 142060 142032 -28 -0.0
text 781660 781552 -108 -0.0
Full report (18 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 58cd5fb 6672d45 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 604818 604818 0 0.0
.app_xip_area 511988 511988 0 0.0
.bss 75576 75576 0 0.0
.data 604 604 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 562630 562630 0 0.0
.app_xip_area 471328 471328 0 0.0
.bss 74080 74080 0 0.0
.data 568 568 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 574890 574746 -144 -0.0
.app_xip_area 473940 473796 -144 -0.0
.bss 83408 83408 0 0.0
.data 508 508 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 925760 925604 -156 -0.0
(read/write) 128712 128708 -4 -0.0
.bss 126712 126712 0 0.0
.data 1996 1996 0 0.0
.text 925752 925596 -156 -0.0
BRD4161A+rpc (read only) 954576 954412 -164 -0.0
(read/write) 144664 144664 0 0.0
.bss 142488 142488 0 0.0
.data 2176 2176 0 0.0
.text 954568 954404 -164 -0.0
window-app BRD4161A (read only) 855180 855180 0 0.0
(read/write) 126672 126672 0 0.0
.bss 124800 124800 0 0.0
.data 1872 1872 0 0.0
.text 855172 855172 0 0.0
esp32 all-clusters-app c3devkit (read only) 966138 966138 0 0.0
(read/write) 1394306 1394306 0 0.0
.dram0.bss 62000 62000 0 0.0
.dram0.data 14204 14204 0 0.0
.flash.rodata 199192 199192 0 0.0
.flash.text 966138 966138 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1022583 1022579 -4 -0.0
(read/write) 462076 462076 0 0.0
.dram0.bss 67528 67528 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 228688 228688 0 0.0
.flash.text 1017199 1017195 -4 -0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 703320 703180 -140 -0.0
.bss 77568 77568 0 0.0
.data 1876 1876 0 0.0
.text 618076 617936 -140 -0.0
lock k32w061+release (read/write) 702436 702436 0 0.0
.bss 77544 77544 0 0.0
.data 1916 1916 0 0.0
.text 617176 617176 0 0.0
linux chip-tool-ipv6only arm64 (read only) 9813772 9813772 0 0.0
(read/write) 473697 473697 0 0.0
.bss 40737 40737 0 0.0
.data 1144 1144 0 0.0
.data.rel.ro 372656 372656 0 0.0
.dynamic 560 560 0 0.0
.got 55352 55352 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 493972 493972 0 0.0
.text 8266628 8266628 0 0.0
thermostat-no-ble arm64 (read only) 2273828 2273828 0 0.0
(read/write) 148353 148353 0 0.0
.bss 62801 62801 0 0.0
.data 1040 1040 0 0.0
.data.rel.ro 77000 77000 0 0.0
.dynamic 560 560 0 0.0
.got 4504 4504 0 0.0
.init 24 24 0 0.0
.init_array 360 360 0 0.0
.rodata 139780 139780 0 0.0
.text 1910688 1910688 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2354996 2354996 0 0.0
.bss 184620 184620 0 0.0
.data 5760 5760 0 0.0
.text 1317596 1317596 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1141091 1140951 -140 -0.0
bss 142500 142500 0 0.0
rodata 142060 142032 -28 -0.0
text 781660 781552 -108 -0.0
p6 all-clusters-app default (read/write) 2497544 2497544 0 0.0
.bss 118040 118040 0 0.0
.data 2640 2640 0 0.0
.text 1455808 1455808 0 0.0
light-app default (read/write) 2399976 2399976 0 0.0
.bss 111512 111512 0 0.0
.data 2496 2496 0 0.0
.text 1358240 1358240 0 0.0
lock-app default (read/write) 2363512 2363512 0 0.0
.bss 111256 111256 0 0.0
.data 2456 2456 0 0.0
.text 1321776 1321776 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 897670 897670 0 0.0
bss 87356 87356 0 0.0
noinit 37160 37160 0 0.0
text 635054 635054 0 0.0

@bzbarsky-apple bzbarsky-apple changed the title [OTA] Shutdown server and stop even loop directly from OTA Image Processor [OTA] Shutdown server and stop event loop directly from OTA Image Processor Mar 28, 2022
@carol-apple carol-apple force-pushed the ota_requestor_shutdown branch from 6672d45 to 115a4c3 Compare March 31, 2022 03:13
@github-actions
Copy link

github-actions bot commented Mar 31, 2022

PR #16698: Size comparison from 8928308 to 115a4c3

Increases (5 builds for cc13x2_26x2, efr32, linux)
platform target config section 8928308 115a4c3 change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read/write) 183956 184116 160 0.1
pump-app LP_CC2652R7 (read/write) 166288 166440 152 0.1
pump-controller-app LP_CC2652R7 (read/write) 183144 183304 160 0.1
efr32 lighting-app BRD4161A+rpc (read/write) 145084 145088 4 0.0
linux ota-requestor-app debug (read only) 2000137 2000457 320 0.0
.rodata 163940 164004 64 0.0
.text 1683154 1683458 304 0.0
Decreases (11 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, nrfconnect)
platform target config section 8928308 115a4c3 change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 667787 667627 -160 -0.0
.rodata 79627 79595 -32 -0.0
.text 587680 587552 -128 -0.0
lock-mtd LP_CC2652R7 (read only) 616923 616763 -160 -0.0
.rodata 79507 79475 -32 -0.0
.text 536928 536800 -128 -0.0
pump-app LP_CC2652R7 (read only) 686607 686455 -152 -0.0
.rodata 81631 81607 -24 -0.0
.text 604492 604364 -128 -0.0
pump-controller-app LP_CC2652R7 (read only) 669503 669343 -160 -0.0
.rodata 78039 78007 -32 -0.0
.text 590980 590852 -128 -0.0
cyw30739 ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 579270 579118 -152 -0.0
.app_xip_area 477892 477740 -152 -0.0
efr32 lighting-app BRD4161A (read only) 930548 930376 -172 -0.0
.text 930540 930368 -172 -0.0
BRD4161A+rpc (read only) 959540 959376 -164 -0.0
.text 959532 959368 -164 -0.0
esp32 all-clusters-app m5stack (read only) 1025759 1025755 -4 -0.0
.flash.text 1020375 1020371 -4 -0.0
k32w light k32w061+release (read/write) 707572 707432 -140 -0.0
.text 621908 621768 -140 -0.0
linux ota-requestor-app debug (read/write) 116008 115976 -32 -0.0
.data.rel.ro 60552 60520 -32 -0.1
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1146903 1146779 -124 -0.0
rodata 142696 142668 -28 -0.0
text 786320 786212 -108 -0.0
Full report (31 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 8928308 115a4c3 change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 667787 667627 -160 -0.0
(read/write) 183956 184116 160 0.1
.bss 81784 81784 0 0.0
.data 3132 3132 0 0.0
.rodata 79627 79595 -32 -0.0
.text 587680 587552 -128 -0.0
lock-mtd LP_CC2652R7 (read only) 616923 616763 -160 -0.0
(read/write) 154500 154500 0 0.0
.bss 77512 77512 0 0.0
.data 3132 3132 0 0.0
.rodata 79507 79475 -32 -0.0
.text 536928 536800 -128 -0.0
pump-app LP_CC2652R7 (read only) 686607 686455 -152 -0.0
(read/write) 166288 166440 152 0.1
.bss 82168 82168 0 0.0
.data 3128 3128 0 0.0
.rodata 81631 81607 -24 -0.0
.text 604492 604364 -128 -0.0
pump-controller-app LP_CC2652R7 (read only) 669503 669343 -160 -0.0
(read/write) 183144 183304 160 0.1
.bss 81920 81920 0 0.0
.data 3128 3128 0 0.0
.rodata 78039 78007 -32 -0.0
.text 590980 590852 -128 -0.0
cyw30739 light cyw930739m2evb_01 (read/write) 609826 609826 0 0.0
.app_xip_area 516576 516576 0 0.0
.bss 75996 75996 0 0.0
.data 600 600 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 567330 567330 0 0.0
.app_xip_area 475616 475616 0 0.0
.bss 74500 74500 0 0.0
.data 564 564 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 579270 579118 -152 -0.0
.app_xip_area 477892 477740 -152 -0.0
.bss 83836 83836 0 0.0
.data 504 504 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 930548 930376 -172 -0.0
(read/write) 129120 129120 0 0.0
.bss 127128 127128 0 0.0
.data 1992 1992 0 0.0
.text 930540 930368 -172 -0.0
BRD4161A+rpc (read only) 959540 959376 -164 -0.0
(read/write) 145084 145088 4 0.0
.bss 142912 142912 0 0.0
.data 2172 2172 0 0.0
.text 959532 959368 -164 -0.0
window-app BRD4161A (read only) 860064 860064 0 0.0
(read/write) 127088 127088 0 0.0
.bss 125216 125216 0 0.0
.data 1868 1868 0 0.0
.text 860056 860056 0 0.0
esp32 all-clusters-app c3devkit (read only) 970018 970018 0 0.0
(read/write) 1394914 1394914 0 0.0
.dram0.bss 62432 62432 0 0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 199352 199352 0 0.0
.flash.text 970018 970018 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1025759 1025755 -4 -0.0
(read/write) 462684 462684 0 0.0
.dram0.bss 67960 67960 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 228864 228864 0 0.0
.flash.text 1020375 1020371 -4 -0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 707572 707432 -140 -0.0
.bss 77992 77992 0 0.0
.data 1872 1872 0 0.0
.text 621908 621768 -140 -0.0
lock k32w061+release (read/write) 706680 706680 0 0.0
.bss 77960 77960 0 0.0
.data 1912 1912 0 0.0
.text 621008 621008 0 0.0
linux all-clusters-app debug (read only) 2547825 2547825 0 0.0
(read/write) 143448 143448 0 0.0
.bss 57408 57408 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 79032 79032 0 0.0
.dynamic 592 592 0 0.0
.got 4184 4184 0 0.0
.init 27 27 0 0.0
.init_array 944 944 0 0.0
.rodata 217349 217349 0 0.0
.text 2166482 2166482 0 0.0
bridge-app debug+rpc (read only) 1779789 1779789 0 0.0
(read/write) 89632 89632 0 0.0
.bss 44536 44536 0 0.0
.data 1968 1968 0 0.0
.data.rel.ro 38040 38040 0 0.0
.dynamic 592 592 0 0.0
.got 3928 3928 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 145393 145393 0 0.0
.text 1518869 1518869 0 0.0
chip-tool debug (read only) 10329165 10329165 0 0.0
(read/write) 356408 356408 0 0.0
.bss 22048 22048 0 0.0
.data 1072 1072 0 0.0
.data.rel.ro 327072 327072 0 0.0
.dynamic 624 624 0 0.0
.got 4896 4896 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 528269 528269 0 0.0
.text 9013173 9013173 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9937332 9937332 0 0.0
(read/write) 475393 475393 0 0.0
.bss 40385 40385 0 0.0
.data 1128 1128 0 0.0
.data.rel.ro 373848 373848 0 0.0
.dynamic 560 560 0 0.0
.got 56232 56232 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 501916 501916 0 0.0
.text 8377252 8377252 0 0.0
door-lock-app debug (read only) 2032513 2032513 0 0.0
(read/write) 117056 117056 0 0.0
.bss 47648 47648 0 0.0
.data 1008 1008 0 0.0
.data.rel.ro 62984 62984 0 0.0
.dynamic 592 592 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 181985 181985 0 0.0
.text 1700546 1700546 0 0.0
lighting-app debug+rpc (read only) 2210273 2210273 0 0.0
(read/write) 124080 124080 0 0.0
.bss 48960 48960 0 0.0
.data 1488 1488 0 0.0
.data.rel.ro 68056 68056 0 0.0
.dynamic 608 608 0 0.0
.got 4176 4176 0 0.0
.init 27 27 0 0.0
.init_array 744 744 0 0.0
.rodata 176001 176001 0 0.0
.text 1874930 1874930 0 0.0
ota-provider-app debug (read only) 1972345 1972345 0 0.0
(read/write) 112816 112816 0 0.0
.bss 47584 47584 0 0.0
.data 1288 1288 0 0.0
.data.rel.ro 58296 58296 0 0.0
.dynamic 608 608 0 0.0
.got 4384 4384 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 167651 167651 0 0.0
.text 1652658 1652658 0 0.0
ota-requestor-app debug (read only) 2000137 2000457 320 0.0
(read/write) 116008 115976 -32 -0.0
.bss 48512 48512 0 0.0
.data 1480 1480 0 0.0
.data.rel.ro 60552 60520 -32 -0.1
.dynamic 592 592 0 0.0
.got 4192 4192 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 163940 164004 64 0.0
.text 1683154 1683458 304 0.0
shell debug (read only) 2463113 2463113 0 0.0
(read/write) 147496 147496 0 0.0
.bss 67304 67304 0 0.0
.data 784 784 0 0.0
.data.rel.ro 73696 73696 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 210482 210482 0 0.0
.text 2095442 2095442 0 0.0
thermostat-no-ble arm64 (read only) 2289220 2289220 0 0.0
(read/write) 148433 148433 0 0.0
.bss 62833 62833 0 0.0
.data 1032 1032 0 0.0
.data.rel.ro 77040 77040 0 0.0
.dynamic 560 560 0 0.0
.got 4512 4512 0 0.0
.init 24 24 0 0.0
.init_array 360 360 0 0.0
.rodata 140228 140228 0 0.0
.text 1925488 1925488 0 0.0
tv-app debug (read only) 2711401 2711401 0 0.0
(read/write) 247968 247968 0 0.0
.bss 164608 164608 0 0.0
.data 3136 3136 0 0.0
.data.rel.ro 74176 74176 0 0.0
.dynamic 592 592 0 0.0
.got 4552 4552 0 0.0
.init 27 27 0 0.0
.init_array 888 888 0 0.0
.rodata 207147 207147 0 0.0
.text 2329458 2329458 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2358604 2358604 0 0.0
.bss 185044 185044 0 0.0
.data 5760 5760 0 0.0
.text 1321204 1321204 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1146903 1146779 -124 -0.0
bss 143076 143076 0 0.0
rodata 142696 142668 -28 -0.0
text 786320 786212 -108 -0.0
p6 all-clusters-app default (read/write) 2502488 2502488 0 0.0
.bss 118464 118464 0 0.0
.data 2640 2640 0 0.0
.text 1460752 1460752 0 0.0
light-app default (read/write) 2404648 2404648 0 0.0
.bss 111936 111936 0 0.0
.data 2496 2496 0 0.0
.text 1362912 1362912 0 0.0
lock-app default (read/write) 2368256 2368256 0 0.0
.bss 111680 111680 0 0.0
.data 2456 2456 0 0.0
.text 1326520 1326520 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 791548 791548 0 0.0
bss 70288 70288 0 0.0
noinit 40416 40416 0 0.0
text 561516 561516 0 0.0

@carol-apple carol-apple merged commit ce6fc06 into project-chip:master Mar 31, 2022
rochaferraz pushed a commit to rochaferraz/connectedhomeip that referenced this pull request Mar 31, 2022
chencheung pushed a commit to chencheung/connectedhomeip that referenced this pull request Apr 6, 2022
chencheung pushed a commit to chencheung/connectedhomeip that referenced this pull request Apr 6, 2022
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find a better way to shutdown server and stop event loop for OTA Linux platform
3 participants