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

Report errors returned by _qspi_configure_format #11603

Merged
merged 3 commits into from Oct 18, 2019

Conversation

@kyle-cypress
Copy link

kyle-cypress commented Sep 30, 2019

Description

The function returns a qspi_status_t but most usages in QSPIFBlockDevice assume that it always succeeds.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[x] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

@ciarmcom ciarmcom requested review from ARMmbed/mbed-os-maintainers Sep 30, 2019
@ciarmcom

This comment has been minimized.

Copy link
Member

ciarmcom commented Sep 30, 2019

@kyle-cypress, thank you for your changes.
@ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

@SeppoTakalo

This comment has been minimized.

Copy link
Contributor

SeppoTakalo commented Oct 1, 2019

I like the fixes, but I don't like to extend more error codes into the system.
It is a pain to maintain and document.

To me the _qspi_configure_format() sounds like it will always pass or always fails on my device, depending whether I'm passing right parameters. Therefore QSPIF_BD_ERROR_DEVICE_ERROR should be sufficient error code.

The driver can produce more info by doing tr_error() call, so that while you are debugging the device, you will see that actual problem. But once running in the field, more error codes don't make sense.

@0xc0170
0xc0170 approved these changes Oct 1, 2019
Copy link
Member

0xc0170 left a comment

LGTM , just a question about error numbering

Edit: rethinking my review after the above comment, missed it prior reviewing

QSPIF_BD_ERROR_INVALID_ERASE_PARAMS = -4005, /* Erase command not on sector aligned addresses or exceeds device size */
QSPIF_BD_ERROR_DEVICE_NOT_UNIQE = -4006, /* Only one instance per csel is allowed */
QSPIF_BD_ERROR_DEVICE_MAX_EXCEED = -4007 /* Max active QSPIF devices exceeded */
QSPIF_BD_ERROR_CONF_FORMAT_FAILED = -4005, /* Configure format failed */

This comment has been minimized.

Copy link
@0xc0170

0xc0170 Oct 1, 2019

Member

QSPIF_BD_ERROR_CONF_FORMAT_FAILED shall this be 4008? Or this follows _FAILED thus placed irght after the latest failure status and the rest is shifted.

This comment has been minimized.

Copy link
@kyle-cypress

kyle-cypress Oct 1, 2019

Author

This is made moot by 5b3b147 which removes the new error code entirely.

@0xc0170 0xc0170 self-requested a review Oct 1, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 1, 2019

@SeppoTakalo Acceptable patch would be to revert adding new error code and use QSPIF_BD_ERROR_DEVICE_ERROR instead ?

@0xc0170 0xc0170 added needs: work and removed needs: review labels Oct 1, 2019
@SeppoTakalo

This comment has been minimized.

Copy link
Contributor

SeppoTakalo commented Oct 1, 2019

Yes.

When no new error codes are added, it does not change the API and is acceptable as a "fix" into the next patch release.

@bulislaw

This comment has been minimized.

Copy link
Member

bulislaw commented Oct 1, 2019

When no new error codes are added, it does not change the API and is acceptable as a "fix" into the next patch release.

Agreed

Copy link
Contributor

SeppoTakalo left a comment

LGTM

@@ -302,17 +306,23 @@ int QSPIFBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
_mutex.lock();

This comment has been minimized.

Copy link
@VeijoPesonen

VeijoPesonen Oct 10, 2019

Contributor

Remember to release this. Could you also check all the places where the code decides to jump to goto exit_point-label as the the same issue seems to be found also from other functions inside this file. Scratch that, other places seem to be fine.

This comment has been minimized.

Copy link
@kyle-cypress

kyle-cypress Oct 14, 2019

Author

Updated to follow the goto exit_point pattern used everywhere else.

@adbridge

This comment has been minimized.

Copy link
Contributor

adbridge commented Oct 11, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Oct 11, 2019

Test run: SUCCESS

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

@adbridge

This comment has been minimized.

Copy link
Contributor

adbridge commented Oct 11, 2019

@kyle-cypress looks like this needs a rebase

@kyle-cypress kyle-cypress force-pushed the kyle-cypress:pr/qspi-bd-format-error branch from 5b3b147 to 9730ee2 Oct 11, 2019
@kyle-cypress

This comment has been minimized.

Copy link
Author

kyle-cypress commented Oct 11, 2019

Rebased

Kyle Kearney added 2 commits Sep 30, 2019
The function returns a qspi_status_t but most usages in QSPIFBlockDevice
assume that it always succeeds.
Use QSPIF_BD_ERROR_DEVICE_ERROR instead of introducing a new error code.
Add tr_error calls whenever _qspi_configure_format fails to aid in debugging.
@kyle-cypress kyle-cypress force-pushed the kyle-cypress:pr/qspi-bd-format-error branch from 9730ee2 to 3f20b80 Oct 11, 2019
Copy link
Contributor

VeijoPesonen left a comment

Please see my previous comment.

Update to follow the same `goto exit_point` pattern that is used
by the rest of the functions to avoid leaving the mutex locked
when errors are detected and require the function to abort.
@kyle-cypress

This comment has been minimized.

Copy link
Author

kyle-cypress commented Oct 14, 2019

Please see my previous comment.

I missed the non-struck-out text at the beginning before. Should be fixed now.

Copy link
Contributor

VeijoPesonen left a comment

Looks good to me

@jeromecoutant

This comment has been minimized.

Copy link
Contributor

jeromecoutant commented Oct 15, 2019

Hi
Quick test with N25Q128A and MX25R6435F seems OK,

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Oct 17, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 17, 2019

CI restarted

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Oct 17, 2019

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-IAR
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 17, 2019

There's internal CI license issue, we are investigating.

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 18, 2019

CI restarted

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Oct 18, 2019

Test run: FAILED

Summary: 7 of 11 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-test
  • jenkins-ci/mbed-os-ci_mbed2-build-ARM
  • jenkins-ci/mbed-os-ci_dynamic-memory-usage
  • jenkins-ci/mbed-os-ci_greentea-test
  • jenkins-ci/mbed-os-ci_mbed2-build-IAR
  • jenkins-ci/mbed-os-ci_exporter
  • jenkins-ci/mbed-os-ci_mbed2-build-GCC_ARM
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 18, 2019

CI restarted

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Oct 18, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Oct 18, 2019
@0xc0170 0xc0170 merged commit 7ba151a into ARMmbed:master Oct 18, 2019
25 checks passed
25 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 9611 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8464B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.