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

fby3.5: common: Fix sensor post read function parameter issue #545

Conversation

DelphineChiu
Copy link

Summary:

  • Fix sensor post read function parameter is NULL causing error message to be printed.

Test Plan:

  • Build code: Pass
  • BIC doesn't print post read error message at sensor initial stage and sensor read fail: Pass

Log:

  • CL BIC console
    • Before fix

Hello, welcome to yv35 craterlake 2022.34.1
BIC class type(class-1), 1ou present status(0), 2ou present status(0), board revision(0x2) [00:00:00.003,000] usb_dc_aspeed: pre-selected ep[0x2] as IN endpoint [00:00:00.003,000] usb_dc_aspeed: select ep[0x3] as OUT endpoint [00:00:00.056,000] kcs_aspeed: KCS3: addr=0xca2, idr=0x2c, odr=0x38, str=0x44

[init_drive_type] sensor 0x14 post sensor read failed! [init_drive_type] sensor 0x30 post sensor read failed! [init_drive_type] sensor 0x39 post sensor read failed!

[set_DC_status] gpio number(15) status(1)
[set_post_status] gpio number(1) status(0)

[00:00:00.203,000] usb_cdc_acm: Device suspended [00:00:00.402,000] usb_cdc_acm: Device resumed [00:00:00.402,000] usb_cdc_acm: from suspend [00:00:00.707,000] usb_cdc_acm: Device configured BIC Ready

[get_sensor_reading]sensor number 0x14 reading and post_read fail [get_sensor_reading]sensor number 0x14 reading and post_read fail Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4 Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4

  • After fix

Hello, welcome to yv35 craterlake 2022.34.1
BIC class type(class-1), 1ou present status(0), 2ou present status(0), board revision(0x2) [00:00:00.003,000] usb_dc_aspeed: pre-selected ep[0x2] as IN endpoint [00:00:00.003,000] usb_dc_aspeed: select ep[0x3] as OUT endpoint [00:00:00.056,000] kcs_aspeed: KCS3: addr=0xca2, idr=0x2c, odr=0x38, str=0x44

[set_DC_status] gpio number(15) status(1)
[set_post_status] gpio number(1) status(0)

[00:00:00.203,000] usb_cdc_acm: Device suspended [00:00:00.402,000] usb_cdc_acm: Device resumed [00:00:00.402,000] usb_cdc_acm: from suspend [00:00:00.707,000] usb_cdc_acm: Device configured BIC Ready

Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4

  • DL BIC console
    • Before fix

Hello, welcome to yv3 deltalake 2022.34.ee

[00:00:00.003VR type: RNS
[add_sensor_config] replace the sensor[0x29] configuration [add_sensor_config] replace the sensor[0x2a] configuration [add_sensor_config] replace the sensor[0x2c] configuration [add_sensor_config] replace the sensor[0x2d] configuration [add_sensor_config] replace the sensor[0x27] configuration [add_sensor_config] replace the sensor[0x28] configuration [add_sensor_config] replace the sensor[0x33] configuration [add_sensor_config] replace the sensor[0x34] configuration [add_sensor_config] replace the sensor[0x35] configuration [add_sensor_config] replace the sensor[0x36] configuration [add_sensor_config] replace the sensor[0x31] configuration [add_sensor_config] replace the sensor[0x32] configuration [add_sensor_config] replace the sensor[0x12] configuration [add_sensor_config] replace the sensor[0x13] configuration [add_sensor_config] replace the sensor[0x14] configuration [add_sensor_config] replace the sensor[0x15] configuration [add_sensor_config] replace the sensor[0x10] configuration [add_sensor_config] replace the sensor[0x11] configuration [add_sensor_config] replace the sensor[0x3d] configuration [add_sensor_config] replace the sensor[0x3e] configuration [add_sensor_config] replace the sensor[0x3f] configuration [add_sensor_config] replace the sensor[0x42] configuration [add_sensor_config] replace the sensor[0x3a] configuration [add_sensor_config] replace the sensor[0x3c] configuration [init_drive_type] sensor 0x29 post sensor read failed! [init_drive_type] sensor 0x2a post sensor read failed! [init_drive_type] sensor 0x2c post sensor read failed! [init_drive_type] sensor 0x2d post sensor read failed! [init_drive_type] sensor 0x27 post sensor read failed! [init_drive_type] sensor 0x28 post sensor read failed! [init_drive_type] sensor 0x33 post sensor read failed! [init_drive_type] sensor 0x34 post sensor read failed! [init_drive_type] sensor 0x35 post sensor read failed! [init_drive_type] sensor 0x36 post sensor read failed! [init_drive_type] sensor 0x31 post sensor read failed! [init_drive_type] sensor 0x32 post sensor read failed! [init_drive_type] sensor 0x12 post sensor read failed! [init_drive_type] sensor 0x13 post sensor read failed! [init_drive_type] sensor 0x14 post sensor read failed! [init_drive_type] sensor 0x15 post sensor read failed! [init_drive_type] sensor 0x10 post sensor read failed! [init_drive_type] sensor 0x11 post sensor read failed! [init_drive_type] sensor 0x3d post sensor read failed! [init_drive_type] sensor 0x3e post sensor read failed! [init_drive_type] sensor 0x3f post sensor read failed! [init_drive_type] sensor 0x42 post sensor read failed! [init_drive_type] sensor 0x3a post sensor read failed! [init_drive_type] sensor 0x3c post sensor read failed! [init_drive_type] sensor 0xd post sensor read failed!

[set_DC_status] gpio number(15) status(1)
[set_post_status] gpio number(1) status(1)
kcs_aspeed: KCS4: addr=0xca2, idr=0x114, odr=0x118, str=0x11c

[00:00:00.068,000] spi_nor_multi_dev: [1347][spi1_cs0]SFDP magic ffffffff invalid [00:00:00.068,000] spi_nor_multi_dev: [1609]SFDP read failed: -22 [00:00:00.659,000] usb_cdc_acm: Device suspended

uart:~$ [get_sensor_reading]sensor number 0xd reading and post_read fail BIC Ready
[get_sensor_reading]sensor number 0xd reading and post_read fail [get_sensor_reading]sensor number 0xd reading and post_read fail

Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4 Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4

  • After fix

Hello, welcome to yv3 deltalake 2022.34.ef

[00:00:00.003VR type: RNS
[add_sensor_config] replace the sensor[0x29] configuration [add_sensor_config] replace the sensor[0x2a] configuration [add_sensor_config] replace the sensor[0x2c] configuration [add_sensor_config] replace the sensor[0x2d] configuration [add_sensor_config] replace the sensor[0x27] configuration [add_sensor_config] replace the sensor[0x28] configuration [add_sensor_config] replace the sensor[0x33] configuration [add_sensor_config] replace the sensor[0x34] configuration [add_sensor_config] replace the sensor[0x35] configuration [add_sensor_config] replace the sensor[0x36] configuration [add_sensor_config] replace the sensor[0x31] configuration [add_sensor_config] replace the sensor[0x32] configuration [add_sensor_config] replace the sensor[0x12] configuration [add_sensor_config] replace the sensor[0x13] configuration [add_sensor_config] replace the sensor[0x14] configuration [add_sensor_config] replace the sensor[0x15] configuration [add_sensor_config] replace the sensor[0x10] configuration [add_sensor_config] replace the sensor[0x11] configuration [add_sensor_config] replace the sensor[0x3d] configuration [add_sensor_config] replace the sensor[0x3e] configuration [add_sensor_config] replace the sensor[0x3f] configuration [add_sensor_config] replace the sensor[0x42] configuration [add_sensor_config] replace the sensor[0x3a] configuration [add_sensor_config] replace the sensor[0x3c] configuration [set_DC_status] gpio number(15) status(1)
[set_post_status] gpio number(1) status(1)

[00:00:00.068,000] spi_nor_multi_dev: [1347][spi1_cs0]SFDP magic ffffffff invalid [00:00:00.068,000] spi_nor_multi_dev: [1609]SFDP read failed: -22 [00:00:00.395,000] usb_cdc_acm: Device suspended

uart:~$ BIC Ready
Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4
Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4

Summary:
- Fix sensor post read function parameter is NULL causing error message to be printed.

Test Plan:
- Build code: Pass
- BIC doesn't print post read error message at sensor initial stage and sensor read fail: Pass

Log:
- CL BIC console
  - Before fix

Hello, welcome to yv35 craterlake 2022.34.1
BIC class type(class-1), 1ou present status(0), 2ou present status(0), board revision(0x2)
[00:00:00.003,000] <inf> usb_dc_aspeed: pre-selected ep[0x2] as IN endpoint
[00:00:00.003,000] <inf> usb_dc_aspeed: select ep[0x3] as OUT endpoint
[00:00:00.056,000] <inf> kcs_aspeed: KCS3: addr=0xca2, idr=0x2c, odr=0x38, str=0x44

[init_drive_type] sensor 0x14 post sensor read failed!
[init_drive_type] sensor 0x30 post sensor read failed!
[init_drive_type] sensor 0x39 post sensor read failed!

[set_DC_status] gpio number(15) status(1)
[set_post_status] gpio number(1) status(0)

[00:00:00.203,000] <inf> usb_cdc_acm: Device suspended
[00:00:00.402,000] <inf> usb_cdc_acm: Device resumed
[00:00:00.402,000] <inf> usb_cdc_acm: from suspend
[00:00:00.707,000] <inf> usb_cdc_acm: Device configured
BIC Ready

[get_sensor_reading]sensor number 0x14 reading and post_read fail
[get_sensor_reading]sensor number 0x14 reading and post_read fail
Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4
Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4

  - After fix

Hello, welcome to yv35 craterlake 2022.34.1
BIC class type(class-1), 1ou present status(0), 2ou present status(0), board revision(0x2)
[00:00:00.003,000] <inf> usb_dc_aspeed: pre-selected ep[0x2] as IN endpoint
[00:00:00.003,000] <inf> usb_dc_aspeed: select ep[0x3] as OUT endpoint
[00:00:00.056,000] <inf> kcs_aspeed: KCS3: addr=0xca2, idr=0x2c, odr=0x38, str=0x44

[set_DC_status] gpio number(15) status(1)
[set_post_status] gpio number(1) status(0)

[00:00:00.203,000] <inf> usb_cdc_acm: Device suspended
[00:00:00.402,000] <inf> usb_cdc_acm: Device resumed
[00:00:00.402,000] <inf> usb_cdc_acm: from suspend
[00:00:00.707,000] <inf> usb_cdc_acm: Device configured
BIC Ready

Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4

- DL BIC console
  - Before fix

Hello, welcome to yv3 deltalake 2022.34.ee

[00:00:00.003VR type: RNS
[add_sensor_config] replace the sensor[0x29] configuration
[add_sensor_config] replace the sensor[0x2a] configuration
[add_sensor_config] replace the sensor[0x2c] configuration
[add_sensor_config] replace the sensor[0x2d] configuration
[add_sensor_config] replace the sensor[0x27] configuration
[add_sensor_config] replace the sensor[0x28] configuration
[add_sensor_config] replace the sensor[0x33] configuration
[add_sensor_config] replace the sensor[0x34] configuration
[add_sensor_config] replace the sensor[0x35] configuration
[add_sensor_config] replace the sensor[0x36] configuration
[add_sensor_config] replace the sensor[0x31] configuration
[add_sensor_config] replace the sensor[0x32] configuration
[add_sensor_config] replace the sensor[0x12] configuration
[add_sensor_config] replace the sensor[0x13] configuration
[add_sensor_config] replace the sensor[0x14] configuration
[add_sensor_config] replace the sensor[0x15] configuration
[add_sensor_config] replace the sensor[0x10] configuration
[add_sensor_config] replace the sensor[0x11] configuration
[add_sensor_config] replace the sensor[0x3d] configuration
[add_sensor_config] replace the sensor[0x3e] configuration
[add_sensor_config] replace the sensor[0x3f] configuration
[add_sensor_config] replace the sensor[0x42] configuration
[add_sensor_config] replace the sensor[0x3a] configuration
[add_sensor_config] replace the sensor[0x3c] configuration
[init_drive_type] sensor 0x29 post sensor read failed!
[init_drive_type] sensor 0x2a post sensor read failed!
[init_drive_type] sensor 0x2c post sensor read failed!
[init_drive_type] sensor 0x2d post sensor read failed!
[init_drive_type] sensor 0x27 post sensor read failed!
[init_drive_type] sensor 0x28 post sensor read failed!
[init_drive_type] sensor 0x33 post sensor read failed!
[init_drive_type] sensor 0x34 post sensor read failed!
[init_drive_type] sensor 0x35 post sensor read failed!
[init_drive_type] sensor 0x36 post sensor read failed!
[init_drive_type] sensor 0x31 post sensor read failed!
[init_drive_type] sensor 0x32 post sensor read failed!
[init_drive_type] sensor 0x12 post sensor read failed!
[init_drive_type] sensor 0x13 post sensor read failed!
[init_drive_type] sensor 0x14 post sensor read failed!
[init_drive_type] sensor 0x15 post sensor read failed!
[init_drive_type] sensor 0x10 post sensor read failed!
[init_drive_type] sensor 0x11 post sensor read failed!
[init_drive_type] sensor 0x3d post sensor read failed!
[init_drive_type] sensor 0x3e post sensor read failed!
[init_drive_type] sensor 0x3f post sensor read failed!
[init_drive_type] sensor 0x42 post sensor read failed!
[init_drive_type] sensor 0x3a post sensor read failed!
[init_drive_type] sensor 0x3c post sensor read failed!
[init_drive_type] sensor 0xd post sensor read failed!

[set_DC_status] gpio number(15) status(1)
[set_post_status] gpio number(1) status(1)
<inf> kcs_aspeed: KCS4: addr=0xca2, idr=0x114, odr=0x118, str=0x11c

[00:00:00.068,000] <err> spi_nor_multi_dev: [1347][spi1_cs0]SFDP magic ffffffff invalid
[00:00:00.068,000] <err> spi_nor_multi_dev: [1609]SFDP read failed: -22
[00:00:00.659,000] <inf> usb_cdc_acm: Device suspended

uart:~$ [get_sensor_reading]sensor number 0xd reading and post_read fail
BIC Ready
[get_sensor_reading]sensor number 0xd reading and post_read fail
[get_sensor_reading]sensor number 0xd reading and post_read fail

Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4
Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4

  - After fix

Hello, welcome to yv3 deltalake 2022.34.ef

[00:00:00.003VR type: RNS
[add_sensor_config] replace the sensor[0x29] configuration
[add_sensor_config] replace the sensor[0x2a] configuration
[add_sensor_config] replace the sensor[0x2c] configuration
[add_sensor_config] replace the sensor[0x2d] configuration
[add_sensor_config] replace the sensor[0x27] configuration
[add_sensor_config] replace the sensor[0x28] configuration
[add_sensor_config] replace the sensor[0x33] configuration
[add_sensor_config] replace the sensor[0x34] configuration
[add_sensor_config] replace the sensor[0x35] configuration
[add_sensor_config] replace the sensor[0x36] configuration
[add_sensor_config] replace the sensor[0x31] configuration
[add_sensor_config] replace the sensor[0x32] configuration
[add_sensor_config] replace the sensor[0x12] configuration
[add_sensor_config] replace the sensor[0x13] configuration
[add_sensor_config] replace the sensor[0x14] configuration
[add_sensor_config] replace the sensor[0x15] configuration
[add_sensor_config] replace the sensor[0x10] configuration
[add_sensor_config] replace the sensor[0x11] configuration
[add_sensor_config] replace the sensor[0x3d] configuration
[add_sensor_config] replace the sensor[0x3e] configuration
[add_sensor_config] replace the sensor[0x3f] configuration
[add_sensor_config] replace the sensor[0x42] configuration
[add_sensor_config] replace the sensor[0x3a] configuration
[add_sensor_config] replace the sensor[0x3c] configuration
[set_DC_status] gpio number(15) status(1)
[set_post_status] gpio number(1) status(1)

[00:00:00.068,000] <err> spi_nor_multi_dev: [1347][spi1_cs0]SFDP magic ffffffff invalid
[00:00:00.068,000] <err> spi_nor_multi_dev: [1609]SFDP read failed: -22
[00:00:00.395,000] <inf> usb_cdc_acm: Device suspended

uart:~$ BIC Ready
Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4
Failed to read sensor value from cache, sensor number: 0x5, cache status: 0x4
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 12, 2022
@facebook-github-bot
Copy link
Contributor

@GoldenBug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants