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

Fix userallocatedevent imp #12319

Merged
merged 5 commits into from
Mar 11, 2020

Conversation

maciejbocianski
Copy link
Contributor

Summary of changes

Fix user allocated events implementation:

  • store delay and period inside UserAllocatedEvent and set it at every post
  • fix user allocated events canceling
  • update tests accordingly

Impact of changes

Migration actions required

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@jamesbeyond @kjbracey-arm


@jamesbeyond jamesbeyond requested a review from kjbracey January 28, 2020 09:47
@ciarmcom ciarmcom requested review from jamesbeyond and a team January 28, 2020 10:00
@ciarmcom
Copy link
Member

@maciejbocianski, thank you for your changes.
@jamesbeyond @ARMmbed/mbed-os-core @ARMmbed/mbed-os-test @ARMmbed/mbed-os-maintainers please review.

@@ -402,6 +404,10 @@ void equeue_post_user_allocated(equeue_t *q, void (*cb)(void *), void *p)
unsigned tick = equeue_tick();
e->cb = cb;
e->target = tick + e->target;
// for user allocated events use event id to track event state
Copy link
Member

Choose a reason for hiding this comment

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

That is not very readable, can we use some kind of enum maybe? So we don't introduce magic numbers. Also are you sure that hijacking of this fields is ok (to be fair i'm not 100% sure how it's being used)

Copy link
Contributor Author

@maciejbocianski maciejbocianski Feb 4, 2020

Choose a reason for hiding this comment

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

True, I will use enum.

Hijacking id field should be OK - all user_allocated equeue APIs (and whole equeue implementation) use event address instead event id when dealing with user allocated events.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bulislaw I have reviewed equeue code once more and found one place where id was altered without checking event type. Already fixed see 7215f99

@@ -260,17 +262,22 @@ class UserAllocatedEvent<F, void(ArgTs...)> {
return false;
}
core_util_atomic_incr_u8(&_post_ref, 1);
equeue_event_delay(&_e + 1, _delay);
Copy link
Member

Choose a reason for hiding this comment

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

I think that changes the behavior? As before we could change delay and period of already posted events?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't allowed previously. It was guarded by MBED_ASSERT(!_post_ref).
It isn't a valid use case to change delay/period while dispatching is ongoing.

@maciejbocianski maciejbocianski force-pushed the fix_userallocatedevent_imp branch from 37b2ad1 to 1f9b5de Compare February 4, 2020 20:51
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 5, 2020

PR was updated, please review

bulislaw
bulislaw previously approved these changes Feb 7, 2020
@mergify mergify bot added needs: CI and removed needs: review labels Feb 7, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 7, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 7, 2020

Test run: FAILED

Summary: 2 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR

@maciejbocianski
Copy link
Contributor Author

not related - problems with IAR licence,

Compile [ 20.0%]: ip_fsc.c
Compile [ 20.1%]: common_functions.c
[ERROR] Fatal error[LMS001]: License check failed. Use the IAR License Manager to
Compile [ 12.5%]: QUECTEL_BG96_CellularStack.cpp
[ERROR] 
Failed to build library

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 10, 2020

Ci restarted

@mergify mergify bot added needs: work and removed needs: CI labels Feb 10, 2020
@mbed-ci
Copy link

mbed-ci commented Feb 10, 2020

Test run: FAILED

Summary: 1 of 4 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 10, 2020

Java error, restarted

@mbed-ci
Copy link

mbed-ci commented Feb 10, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 3
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 10, 2020

There was one more CI job created 👀

@0xc0170 0xc0170 removed the request for review from a team February 10, 2020 15:56
@mbed-ci
Copy link

mbed-ci commented Feb 10, 2020

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 4
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@mergify mergify bot added needs: work and removed needs: CI labels Feb 10, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 13, 2020

Ci completed, reviews required

@0xc0170 0xc0170 added release-version: 6.0.0-alpha-3 and removed release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 labels Feb 27, 2020
@adbridge
Copy link
Contributor

adbridge commented Mar 6, 2020

This ran through ci 22 days ago so needs to be re-run

@mbed-ci
Copy link

mbed-ci commented Mar 6, 2020

Test run: FAILED

Summary: 1 of 7 test jobs failed
Build number : 6
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-pytest

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 9, 2020

Client restarted

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.

7 participants