Procedure inquiry when using RPMB - raspberry-pi

I am studying RPMB in Raspberry pi 3B model.
The development environment I have configured is as follows. For reference I tested two eMMC modules.
Target : Raspberry pi 3B Storage
Storage
eMMC module made by hardkernel
eMMC: https://www.hardkernel.com/shop/8gb-emmc-module-xu4-linux/
eMMC Reader: https://www.hardkernel.com/shop/emmc-module-reader-board-for-os-upgrade/
eMMC module made by uugear
https://www.uugear.com/product/raspikey-plug-and-play-emmc-module-for-raspberry-pi/
firmware: 2021-05-07-raspios-buster-armhf-lite.zip
After the above configuration, the following work was carried out.
In ubuntu pc
1. Initialize the partition using fdisk
2. Write firmware image to eMMC.
- unzip -p 2021-05-07-raspios-buster-armhf-lite.zip | sudo dd of=/dev/sdd bs=4M conv=fsync
After raspbian is written successfully, the partition configuration checked through fdisk is as follows.
Command (m for help): p
Disk /dev/sdd: 7.3 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb6b2958f
Device Boot Start End Sectors Size Id Type
/dev/sdd1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/sdd2 532480 15269887 14737408 7G 83 Linux
After that, I inserted the eMMC module into the sdcard in raspberry pi3 slot and booted it up successfully.
Looking at the log during booting, 512KB of mmcblk0rpmb chardev was recognized as shown below.
[ 4.853413] mmc0: new high speed MMC card at address 0001
[ 4.865921] mmcblk0: mmc0:0001 8GTF4R 7.28 GiB
[ 4.876187] mmcblk0boot0: mmc0:0001 8GTF4R partition 1 4.00 MiB
[ 4.888825] mmcblk0boot1: mmc0:0001 8GTF4R partition 2 4.00 MiB
[ 4.901321] mmcblk0rpmb: mmc0:0001 8GTF4R partition 3 512 KiB, chardev (245:0)
[ 4.918023] mmcblk0: p1 p2
[ 4.943312] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
[ 4.957735] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
After I booted, when I checked the device, it was not found in lsblk, but when I searched the /dev directory, rpmb dev was also found.
pi#raspberrypi:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 7.3G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 7G 0 part /
mmcblk0boot0 179:32 0 4M 1 disk
mmcblk0boot1 179:64 0 4M 1 disk
pi#raspberrypi:~ $ ls -l /dev/mmcblk0*
brw-rw---- 1 root disk 179, 0 May 7 16:00 /dev/mmcblk0
brw-rw---- 1 root disk 179, 32 May 7 16:00 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 64 May 7 16:00 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179, 1 May 7 16:00 /dev/mmcblk0p1
brw-rw---- 1 root disk 179, 2 May 7 16:00 /dev/mmcblk0p2
crw------- 1 root root 245, 0 May 7 16:00 /dev/mmcblk0rpmb
I installed mmc-utils for RPMB test, and first checked extcsd information.
pi#raspberrypi:~ $ sudo mmc extcsd read /dev/mmcblk0
=============================================
Extended CSD rev 1.8 (MMC 5.1)
=============================================
Card Supported Command sets [S_CMD_SET: 0x01]
HPI Features [HPI_FEATURE: 0x01]: implementation based on CMD13
Background operations support [BKOPS_SUPPORT: 0x01]
Max Packet Read Cmd [MAX_PACKED_READS: 0x3f]
Max Packet Write Cmd [MAX_PACKED_WRITES: 0x3f]
Data TAG support [DATA_TAG_SUPPORT: 0x01]
Data TAG Unit Size [TAG_UNIT_SIZE: 0x02]
Tag Resources Size [TAG_RES_SIZE: 0x00]
Context Management Capabilities [CONTEXT_CAPABILITIES: 0x05]
Large Unit Size [LARGE_UNIT_SIZE_M1: 0x07]
Extended partition attribute support [EXT_SUPPORT: 0x03]
Generic CMD6 Timer [GENERIC_CMD6_TIME: 0x0a]
Power off notification [POWER_OFF_LONG_TIME: 0x3c]
Cache Size [CACHE_SIZE] is 65536 KiB
Background operations status [BKOPS_STATUS: 0x00]
1st Initialisation Time after programmed sector [INI_TIMEOUT_AP: 0x1e]
Power class for 52MHz, DDR at 3.6V [PWR_CL_DDR_52_360: 0x00]
Power class for 52MHz, DDR at 1.95V [PWR_CL_DDR_52_195: 0x00]
Power class for 200MHz at 3.6V [PWR_CL_200_360: 0x00]
Power class for 200MHz, at 1.95V [PWR_CL_200_195: 0x00]
Minimum Performance for 8bit at 52MHz in DDR mode:
[MIN_PERF_DDR_W_8_52: 0x00]
[MIN_PERF_DDR_R_8_52: 0x00]
TRIM Multiplier [TRIM_MULT: 0x02]
Secure Feature support [SEC_FEATURE_SUPPORT: 0x55]
Boot Information [BOOT_INFO: 0x07]
Device supports alternative boot method
Device supports dual data rate during boot
Device supports high speed timing during boot
Boot partition size [BOOT_SIZE_MULTI: 0x20]
Access size [ACC_SIZE: 0x07]
High-capacity erase unit size [HC_ERASE_GRP_SIZE: 0x01]
i.e. 512 KiB
High-capacity erase timeout [ERASE_TIMEOUT_MULT: 0x01]
Reliable write sector count [REL_WR_SEC_C: 0x01]
High-capacity W protect group size [HC_WP_GRP_SIZE: 0x10]
i.e. 8192 KiB
Sleep current (VCC) [S_C_VCC: 0x07]
Sleep current (VCCQ) [S_C_VCCQ: 0x07]
Sleep/awake timeout [S_A_TIMEOUT: 0x11]
Sector Count [SEC_COUNT: 0x00e90000]
Device is block-addressed
Minimum Write Performance for 8bit:
[MIN_PERF_W_8_52: 0x00]
[MIN_PERF_R_8_52: 0x00]
[MIN_PERF_W_8_26_4_52: 0x00]
[MIN_PERF_R_8_26_4_52: 0x00]
Minimum Write Performance for 4bit:
[MIN_PERF_W_4_26: 0x00]
[MIN_PERF_R_4_26: 0x00]
Power classes registers:
[PWR_CL_26_360: 0x00]
[PWR_CL_52_360: 0x00]
[PWR_CL_26_195: 0x00]
[PWR_CL_52_195: 0x00]
Partition switching timing [PARTITION_SWITCH_TIME: 0x02]
Out-of-interrupt busy timing [OUT_OF_INTERRUPT_TIME: 0x0a]
I/O Driver Strength [DRIVER_STRENGTH: 0x1f]
Card Type [CARD_TYPE: 0x57]
HS200 Single Data Rate eMMC #200MHz 1.8VI/O
HS Dual Data Rate eMMC #52MHz 1.8V or 3VI/O
HS eMMC #52MHz - at rated device voltage(s)
HS eMMC #26MHz - at rated device voltage(s)
CSD structure version [CSD_STRUCTURE: 0x02]
Command set [CMD_SET: 0x00]
Command set revision [CMD_SET_REV: 0x00]
Power class [POWER_CLASS: 0x00]
High-speed interface timing [HS_TIMING: 0x01]
Erased memory content [ERASED_MEM_CONT: 0x00]
Boot configuration bytes [PARTITION_CONFIG: 0x48]
Boot Partition 1 enabled
No access to boot partition
Boot config protection [BOOT_CONFIG_PROT: 0x00]
Boot bus Conditions [BOOT_BUS_CONDITIONS: 0x01]
High-density erase group definition [ERASE_GROUP_DEF: 0x01]
Boot write protection status registers [BOOT_WP_STATUS]: 0x00
Boot Area Write protection [BOOT_WP]: 0x00
Power ro locking: possible
Permanent ro locking: possible
ro lock status: not locked
User area write protection register [USER_WP]: 0x00
FW configuration [FW_CONFIG]: 0x00
RPMB Size [RPMB_SIZE_MULT]: 0x04
Write reliability setting register [WR_REL_SET]: 0x1f
user area: the device protects existing data if a power failure occurs during a write operation
partition 1: the device protects existing data if a power failure occurs during a write operation
partition 2: the device protects existing data if a power failure occurs during a write operation
partition 3: the device protects existing data if a power failure occurs during a write operation
partition 4: the device protects existing data if a power failure occurs during a write operation
Write reliability parameter register [WR_REL_PARAM]: 0x14
Device supports the enhanced def. of reliable write
Enable background operations handshake [BKOPS_EN]: 0x00
H/W reset function [RST_N_FUNCTION]: 0x01
HPI management [HPI_MGMT]: 0x01
Partitioning Support [PARTITIONING_SUPPORT]: 0x07
Device support partitioning feature
Device can have enhanced tech.
Max Enhanced Area Size [MAX_ENH_SIZE_MULT]: 0x0001d2
i.e. 3817472 KiB
Partitions attribute [PARTITIONS_ATTRIBUTE]: 0x00
Partitioning Setting [PARTITION_SETTING_COMPLETED]: 0x00
Device partition setting NOT complete
General Purpose Partition Size
[GP_SIZE_MULT_4]: 0x000000
[GP_SIZE_MULT_3]: 0x000000
[GP_SIZE_MULT_2]: 0x000000
[GP_SIZE_MULT_1]: 0x000000
Enhanced User Data Area Size [ENH_SIZE_MULT]: 0x000000
i.e. 0 KiB
Enhanced User Data Start Address [ENH_START_ADDR]: 0x00000000
i.e. 0 bytes offset
Bad Block Management mode [SEC_BAD_BLK_MGMNT]: 0x00
Periodic Wake-up [PERIODIC_WAKEUP]: 0x00
Program CID/CSD in DDR mode support [PROGRAM_CID_CSD_DDR_SUPPORT]: 0x01
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[127]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[126]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[125]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[124]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[123]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[122]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[121]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[120]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[119]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[118]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[117]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[116]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[115]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[114]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[113]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[112]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[111]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[110]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[109]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[108]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[107]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[106]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[105]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[104]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[103]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[102]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[101]]: 0x05
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[100]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[99]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[98]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[97]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[96]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[95]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[94]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[93]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[92]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[91]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[90]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[89]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[88]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[87]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[86]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[85]]: 0x01
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[84]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[83]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[82]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[81]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[80]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[79]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[78]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[77]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[76]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[75]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[74]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[73]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[72]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[71]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[70]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[69]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[68]]: 0xc8
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[67]]: 0xc8
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[66]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[65]]: 0x00
Vendor Specific Fields [VENDOR_SPECIFIC_FIELD[64]]: 0x0f
Native sector size [NATIVE_SECTOR_SIZE]: 0x00
Sector size emulation [USE_NATIVE_SECTOR]: 0x00
Sector size [DATA_SECTOR_SIZE]: 0x00
1st initialization after disabling sector size emulation [INI_TIMEOUT_EMU]: 0x00
Class 6 commands control [CLASS_6_CTRL]: 0x00
Number of addressed group to be Released[DYNCAP_NEEDED]: 0x00
Exception events control [EXCEPTION_EVENTS_CTRL]: 0x0000
Exception events status[EXCEPTION_EVENTS_STATUS]: 0x0000
Extended Partitions Attribute [EXT_PARTITIONS_ATTRIBUTE]: 0x0000
Context configuration [CONTEXT_CONF[51]]: 0x00
Context configuration [CONTEXT_CONF[50]]: 0x00
Context configuration [CONTEXT_CONF[49]]: 0x00
Context configuration [CONTEXT_CONF[48]]: 0x00
Context configuration [CONTEXT_CONF[47]]: 0x00
Context configuration [CONTEXT_CONF[46]]: 0x00
Context configuration [CONTEXT_CONF[45]]: 0x00
Context configuration [CONTEXT_CONF[44]]: 0x00
Context configuration [CONTEXT_CONF[43]]: 0x00
Context configuration [CONTEXT_CONF[42]]: 0x00
Context configuration [CONTEXT_CONF[41]]: 0x00
Context configuration [CONTEXT_CONF[40]]: 0x00
Context configuration [CONTEXT_CONF[39]]: 0x00
Context configuration [CONTEXT_CONF[38]]: 0x00
Context configuration [CONTEXT_CONF[37]]: 0x00
Packed command status [PACKED_COMMAND_STATUS]: 0x00
Packed command failure index [PACKED_FAILURE_INDEX]: 0x00
Power Off Notification [POWER_OFF_NOTIFICATION]: 0x01
Control to turn the Cache ON/OFF [CACHE_CTRL]: 0x01
eMMC Firmware Version:
eMMC Life Time Estimation A [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]: 0x01
eMMC Life Time Estimation B [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]: 0x01
eMMC Pre EOL information [EXT_CSD_PRE_EOL_INFO]: 0x01
Command Queue Support [CMDQ_SUPPORT]: 0x01
Command Queue Depth [CMDQ_DEPTH]: 16
Command Enabled [CMDQ_MODE_EN]: 0x00
After that, I entered the following command to check the read-counter, but the problem is occurring as follows.
pi#raspberrypi:~ $ sudo mmc rpmb read-counter /dev/mmcblk0rpmb
RPMB ioctl failed: Connection timed out
The dmesg information at this time is as follows. (Due to the character limit, the middle part is omitted. )
[ 1547.320372] sdhost-bcm2835 3f202000.mmc: Card stuck in wrong state! card_busy_detect status: 0xd00
[ 1547.320398] sdhost_busy_irq: intmask 440, data 00000000
[ 1557.600386] mmc0: timeout waiting for hardware interrupt.
[ 1557.600403] [5c86e95a] FCM> 81791b70 0
[ 1557.600414] [5c86e95a] CMD d 0
[ 1557.600424] [5c86e95a] REQ> 81791b70 0
[ 1557.600433] [5c86e967] TSK< 81791b70 0
[ 1557.600443] [5c86e96e] TSK> 81791b70 0
[ 1557.600452] [5c86e975] REQ< 81791b70 10801
[ 1557.600463] [5c86e976] CMD< d 10000
[ 1557.600473] [5c86e977] FCM< 81791b70 81791bdc
[ 1557.600482] [5c86e979] RSP d00 0
[ 1557.600491] [5c86e979] FCM> 81791b70 0
[ 1557.600501] [5c86e97a] CMD d 0
[ 1557.600510] [5c86e97a] REQ> 81791b70 0
[ 1557.600519] [5c86e987] TSK< 81791b70 0
[ 1557.600529] [5c86e98e] TSK> 81791b70 0
[ 1557.600538] [5c86e996] REQ< 81791b70 10801
[ 1557.600547] [5c86e996] CMD< d 10000
[ 1557.600557] [5c86e997] FCM< 81791b70 81791bdc
[ 1557.600566] [5c86e999] RSP d00 0
[ 1557.600575] [5c86e999] FCM> 81791b70 0
[ 1557.600584] [5c86e99a] CMD d 0
[ 1557.600594] [5c86e99a] REQ> 81791b70 0
[ 1557.600604] [5c86e9a7] TSK< 81791b70 0
[ 1557.600613] [5c86e9ae] TSK> 81791b70 0
[ 1557.600622] [5c86e9bd] REQ< 81791b70 10801
[ 1557.600632] [5c86e9be] CMD< d 10000
[ 1557.600641] [5c86e9be] FCM< 81791b70 81791bdc
[ 1557.600650] [5c86e9c1] RSP d00 0
[ 1557.600660] [5c86e9c1] FCM> 81791b70 0
[ 1557.600669] [5c86e9c1] CMD d 0
[ 1557.600678] [5c86e9c2] REQ> 81791b70 0
[ 1557.600688] [5c86e9d0] TSK< 81791b70 0
[ 1557.600697] [5c86e9d7] TSK> 81791b70 0
[ 1557.600706] [5c86e9de] REQ< 81791b70 10801
[ 1557.600716] [5c86e9de] CMD< d 10000
[ 1557.600726] [5c86e9df] FCM< 81791b70 81791bdc
[ 1557.600735] [5c86e9e1] RSP d00 0
[ 1557.600745] [5c86e9e2] FCM> 81791b70 0
[ 1557.600754] [5c86e9e2] CMD d 0
[ 1557.600763] [5c86e9e2] REQ> 81791b70 0
[ 1557.600772] [5c86e9f0] TSK< 81791b70 0
[ 1557.600782] [5c86e9f7] TSK> 81791b70 0
[ 1557.600791] [5c86ea05] REQ< 81791b70 10801
[ 1557.600801] [5c86ea06] CMD< d 10000
[ 1557.600810] [5c86ea06] FCM< 81791b70 81791bdc
[ 1557.600819] [5c86ea09] RSP d00 0
[ 1557.600828] [5c86ea09] FCM> 81791b70 0
[ 1557.600837] [5c86ea0a] CMD d 0
[ 1557.600846] [5c86ea0a] REQ> 81791b70 0
[ 1557.600857] [5c86ea17] TSK< 81791b70 0
[ 1557.600866] [5c86ea1e] TSK> 81791b70 0
[ 1557.600875] [5c86ea25] REQ< 81791b70 10801
[ 1557.600885] [5c86ea26] CMD< d 10000
[ 1557.600894] [5c86ea26] FCM< 81791b70 81791bdc
[ 1557.600903] [5c86ea29] RSP d00 0
[ 1557.600913] [5c86ea29] FCM> 81791b70 0
[ 1557.600922] [5c86ea29] CMD d 0
[ 1557.600931] [5c86ea2a] REQ> 81791b70 0
[ 1557.600940] [5c86ea37] TSK< 81791b70 0
[ 1557.600949] [5c86ea3e] TSK> 81791b70 0
[ 1557.600958] [5c86ea4e] REQ< 81791b70 10801
[ 1557.600968] [5c86ea4e] CMD< d 10000
[ 1557.600978] [5c86ea4f] FCM< 81791b70 81791bdc
[ 1557.600987] [5c86ea51] RSP d00 0
[ 1557.600996] [5c86ea52] FCM> 81791b70 0
[ 1557.601005] [5c86ea52] CMD d 0
[ 1557.601014] [5c86ea52] REQ> 81791b70 0
[ 1557.601023] [5c86ea5f] TSK< 81791b70 0
[ 1557.601032] [5c86ea67] TSK> 81791b70 0
[ 1557.601042] [5c86ea6e] REQ< 81791b70 10801
[ 1557.601051] [5c86ea6e] CMD< d 10000
[ 1557.601061] [5c86ea6f] FCM< 81791b70 81791bdc
[ 1557.601070] [5c86ea71] RSP d00 0
[ 1557.601079] [5c86ea72] FCM> 81791b70 0
[ 1557.601088] [5c86ea72] CMD d 0
[ 1557.601098] [5c86ea72] REQ> 81791b70 0
[ 1557.601107] [5c86ea80] TSK< 81791b70 0
[ 1557.601117] [5c86ea87] TSK> 81791b70 0
[ 1557.601126] [5c86ea95] REQ< 81791b70 10801
[ 1557.601135] [5c86ea96] CMD< d 10000
[ 1557.601145] [5c86ea97] FCM< 81791b70 81791bdc
[ 1557.601154] [5c86ea99] RSP d00 0
[ 1557.601163] [5c86ea99] FCM> 81791b70 0
[ 1557.601172] [5c86ea9a] CMD d 0
[ 1557.601181] [5c86ea9a] REQ> 81791b70 0
[ 1557.601191] [5c86eaa7] TSK< 81791b70 0
[ 1557.601200] [5c86eaae] TSK> 81791b70 0
[ 1557.601209] [5c86eab5] REQ< 81791b70 10801
[ 1557.601218] [5c86eab6] CMD< d 10000
[ 1557.601228] [5c86eab7] FCM< 81791b70 81791bdc
[ 1557.601238] [5c86eab9] RSP d00 0
[ 1557.601247] [5c86eab9] FCM> 81791b70 0
[ 1557.601256] [5c86eaba] CMD d 0
[ 1557.601265] [5c86eaba] REQ> 81791b70 0
[ 1557.601274] [5c86eac8] TSK< 81791b70 0
[ 1557.601283] [5c86eacf] TSK> 81791b70 0
[ 1557.601293] [5c86eade] REQ< 81791b70 10801
[ 1557.601302] [5c86eade] CMD< d 10000
[ 1557.601311] [5c86eadf] FCM< 81791b70 81791bdc
[ 1557.601320] [5c86eae1] RSP d00 0
[ 1557.601330] [5c86eae2] FCM> 81791b70 0
[ 1557.601339] [5c86eae2] CMD d 0
[ 1557.601349] [5c86eae2] REQ> 81791b70 0
[ 1557.601358] [5c86eaf0] TSK< 81791b70 0
[ 1557.601367] [5c86eaf7] TSK> 81791b70 0
[ 1557.601377] [5c86eafe] REQ< 81791b70 10801
[ 1557.601386] [5c86eafe] CMD< d 10000
[ 1557.601395] [5c86eaff] FCM< 81791b70 81791bdc
[ 1557.601404] [5c86eb02] RSP d00 0
[ 1557.601414] [5c86eb02] FCM> 81791b70 0
[ 1557.601423] [5c86eb02] CMD d 0
[ 1557.601432] [5c86eb02] REQ> 81791b70 0
[ 1557.601441] [5c86eb10] TSK< 81791b70 0
[ 1557.601450] [5c86eb17] TSK> 81791b70 0
[ 1557.601460] [5c86eb1e] REQ< 81791b70 10801
[ 1557.601469] [5c86eb1e] CMD< d 10000
[ 1557.601479] [5c86eb1f] FCM< 81791b70 81791bdc
[ 1557.601489] [5c86eb22] RSP d00 0
[ 1557.601498] [5c86eb22] FCM> 81791b70 0
[ 1557.601507] [5c86eb22] CMD d 0
[ 1557.601516] [5c86eb22] REQ> 81791b70 0
[ 1557.601525] [5c86eb30] TSK< 81791b70 0
[ 1557.601534] [5c86eb37] TSK> 81791b70 0
[ 1557.601543] [5c86eb46] REQ< 81791b70 10801
[ 1557.601553] [5c86eb47] CMD< d 10000
[ 1557.601562] [5c86eb48] FCM< 81791b70 81791bdc
[ 1557.601571] [5c86eb4a] RSP d00 0
[ 1557.601580] [5c86eb4a] FCM> 81791b70 0
[ 1557.601589] [5c86eb4b] CMD d 0
[ 1557.601600] [5c86eb4b] REQ> 81791b70 0
[ 1557.601609] [5c86eb58] TSK< 81791b70 0
[ 1557.601618] [5c86eb5f] TSK> 81791b70 0
[ 1557.601627] [5c86eb66] REQ< 81791b70 10801
[ 1557.601637] [5c86eb67] CMD< d 10000
[ 1557.601646] [5c86eb67] FCM< 81791b70 81791bdc
[ 1557.601655] [5c86eb6a] RSP d00 0
[ 1557.601665] [5c86eb6a] FCM> 81791b70 0
[ 1557.601674] [5c86eb6b] CMD d 0
[ 1557.601683] [5c86eb6b] REQ> 81791b70 0
[ 1557.601692] [5c86eb78] TSK< 81791b70 0
[ 1557.601701] [5c86eb7f] TSK> 81791b70 0
[ 1557.601710] [5c86eb8e] REQ< 81791b70 10801
[ 1557.601720] [5c86eb8e] CMD< d 10000
[ 1557.601730] [5c86eb8f] FCM< 81791b70 81791bdc
[ 1557.601739] [5c86eb91] RSP d00 0
[ 1557.601748] [5c86eb92] FCM> 81791b70 0
[ 1557.601757] [5c86eb92] CMD d 0
[ 1557.601766] [5c86eb92] REQ> 81791b70 0
[ 1557.601775] [5c86eba0] TSK< 81791b70 0
[ 1557.601785] [5c86eba7] TSK> 81791b70 0
[ 1557.601794] [5c86ebae] REQ< 81791b70 10801
[ 1557.601803] [5c86ebae] CMD< d 10000
[ 1557.601813] [5c86ebaf] FCM< 81791b70 81791bdc
[ 1557.601822] [5c86ebb1] RSP d00 0
[ 1557.601831] [5c86ebb2] FCM> 81791b70 0
[ 1557.601840] [5c86ebb2] CMD d 0
[ 1557.601850] [5c86ebb2] REQ> 81791b70 0
[ 1557.601859] [5c86ebc0] TSK< 81791b70 0
[ 1557.601868] [5c86ebc8] TSK> 81791b70 0
[ 1557.601877] [5c86ebd7] REQ< 81791b70 10801
[ 1557.601887] [5c86ebd7] CMD< d 10000
[ 1557.601896] [5c86ebd8] FCM< 81791b70 81791bdc
[ 1557.601905] [5c86ebdb] RSP d00 0
[ 1557.601914] [5c86ebdb] FCM> 81791b70 0
[ 1557.601923] [5c86ebdb] CMD d 0
[ 1557.601932] [5c86ebdc] REQ> 81791b70 0
[ 1557.601942] [5c86ebe9] TSK< 81791b70 0
[ 1557.601951] [5c86ebf0] TSK> 81791b70 0
[ 1557.601960] [5c86ebf8] REQ< 81791b70 10801
[ 1557.601969] [5c86ebf8] CMD< d 10000
[ 1557.601979] [5c86ebf9] FCM< 81791b70 81791bdc
[ 1557.601988] [5c86ebfb] RSP d00 0
[ 1557.601998] [5c86ebfb] FCM> 81791b70 0
[ 1557.602007] [5c86ebfc] CMD d 0
[ 1557.602016] [5c86ebfc] REQ> 81791b70 0
[ 1557.602025] [5c86ec09] TSK< 81791b70 0
[ 1557.602034] [5c86ec11] TSK> 81791b70 0
[ 1557.602044] [5c86ec1f] REQ< 81791b70 10801
[ 1557.602053] [5c86ec20] CMD< d 10000
[ 1557.602062] [5c86ec20] FCM< 81791b70 81791bdc
[ 1557.602071] [5c86ec23] RSP d00 0
[ 1557.602081] [5c86ec23] FCM> 81791b70 0
[ 1557.602090] [5c86ec23] CMD d 0
[ 1557.602100] [5c86ec24] REQ> 81791b70 0
[ 1557.602109] [5c86ec31] TSK< 81791b70 0
[ 1557.602118] [5c86ec38] TSK> 81791b70 0
[ 1557.602127] [5c86ec40] REQ< 81791b70 10801
[ 1557.602136] [5c86ec40] CMD< d 10000
[ 1557.602146] [5c86ec41] FCM< 81791b70 81791bdc
[ 1557.602155] [5c86ec43] RSP d00 0
[ 1557.602164] [5c86ec44] FCM> 81791b70 0
[ 1557.602173] [5c86ec44] CMD d 0
[ 1557.602182] [5c86ec44] REQ> 81791b70 0
[ 1557.602191] [5c86ec52] TSK< 81791b70 0
[ 1557.602201] [5c86ec59] TSK> 81791b70 0
[ 1557.602210] [5c86ec68] REQ< 81791b70 10801
[ 1557.602219] [5c86ec68] CMD< d 10000
[ 1557.602230] [5c86ec69] FCM< 81791b70 81791bdc
[ 1557.602239] [5c86ec6b] RSP d00 0
[ 1557.602248] [5c86ec6c] FCM> 81791b70 0
[ 1557.602257] [5c86ec6c] CMD d 0
[ 1557.602266] [5c86ec6c] REQ> 81791b70 0
[ 1557.602276] [5c86ec79] TSK< 81791b70 0
[ 1557.602285] [5c86ec80] TSK> 81791b70 0
[ 1557.602294] [5c86ec88] REQ< 81791b70 10801
[ 1557.602304] [5c86ec88] CMD< d 10000
[ 1557.602313] [5c86ec89] FCM< 81791b70 81791bdc
[ 1557.602322] [5c86ec8b] RSP d00 0
[ 1557.602332] [5c86ec8b] FCM> 81791b70 0
[ 1557.602341] [5c86ec8c] CMD d 0
[ 1557.602351] [5c86ec8c] REQ> 81791b70 0
[ 1557.602360] [5c86ec9a] TSK< 81791b70 0
[ 1557.602369] [5c86eca1] TSK> 81791b70 0
[ 1557.602379] [5c86eca8] REQ< 81791b70 10801
[ 1557.602388] [5c86eca8] CMD< d 10000
[ 1557.602397] [5c86eca9] FCM< 81791b70 81791bdc
[ 1557.602406] [5c86ecab] RSP d00 0
[ 1557.602415] [5c86ecac] FCM> 81791b70 0
[ 1557.602424] [5c86ecac] CMD d 0
[ 1557.602433] [5c86ecac] REQ> 81791b70 0
[ 1557.602442] [5c86ecba] TSK< 81791b70 0
[ 1557.602452] [5c86ecc1] TSK> 81791b70 0
[ 1557.602461] [5c86ecd0] REQ< 81791b70 10801
[ 1557.602470] [5c86ecd0] CMD< d 10000
[ 1557.602480] [5c86ecd1] FCM< 81791b70 81791bdc
[ 1557.602489] [5c86ecd3] RSP d00 0
[ 1557.602499] [5c86ecd4] FCM> 81791b70 0
[ 1557.602508] [5c86ecd4] CMD d 0
[ 1557.602517] [5c86ecd4] REQ> 81791b70 0
[ 1557.602526] [5c86ece2] TSK< 81791b70 0
[ 1557.602536] [5c86ece9] TSK> 81791b70 0
[ 1557.602545] [5c86ecf0] REQ< 81791b70 10801
[ 1557.602554] [5c86ecf0] CMD< d 10000
[ 1557.602563] [5c86ecf1] FCM< 81791b70 81791bdc
[ 1557.602572] [5c86ecf4] RSP d00 0
[ 1557.602581] [5c86ecf4] FCM> 81791b70 0
[ 1557.602590] [5c86ecf4] CMD d 0
[ 1557.602600] [5c86ecf4] REQ> 81791b70 0
[ 1557.602610] [5c86ed02] TSK< 81791b70 0
[ 1557.602619] [5c86ed09] TSK> 81791b70 0
[ 1557.602628] [5c86ed20] REQ< 81791b70 10801
[ 1557.602637] [5c86ed21] CMD< d 10000
[ 1557.602647] [5c86ed21] FCM< 81791b70 81791bdc
[ 1557.602656] [5c86ed24] RSP d00 0
[ 1557.602665] [5c86ed24] FCM> 81791b70 0
[ 1557.602674] [5c86ed25] CMD d 0
[ 1557.602685] [5c86ed25] REQ> 81791b70 0
[ 1557.602694] [5c86ed32] TSK< 81791b70 0
[ 1557.602703] [5c86ed3a] TSK> 81791b70 0
[ 1557.602712] [5c86ed59] REQ< 81791c80 10801
[ 1557.602721] [5c86ed59] CMD< 6 3b34801
[ 1557.602731] [5c86ed5a] CMD 6 0
[ 1557.602741] [5c86ed5a] REQ> 81791c80 0
[ 1557.602750] [1c86ed63] IRQ< 440 0
[ 1557.602759] [1c86ed64] IRQB 81791d04 440
[ 1557.602768] [1c86ed6c] IRQ> 40 0
[ 1557.602777] [5d23c9ab] TIM< 0 0
[ 1557.602793] mmc0:>cmd op 6 arg 0x3b34801 flags 0x49d - resp 00000000 00000000 00000000 00000000, err -110
[ 1557.602801] mmc0: =========== REGISTER DUMP ===========
[ 1557.602809] mmc0: SDCMD 0x00004806
[ 1557.602816] mmc0: SDARG 0x03b34801
[ 1557.602824] mmc0: SDTOUT 0x017d7840
[ 1557.602832] mmc0: SDCDIV 0x00000006
[ 1557.602839] mmc0: SDRSP0 0xffffffff
[ 1557.602846] mmc0: SDRSP1 0x0000ff7f
[ 1557.602855] mmc0: SDRSP2 0xc3400003
[ 1557.602862] mmc0: SDRSP3 0xffffffff
[ 1557.602870] mmc0: SDHSTS 0x00000040
[ 1557.602877] mmc0: SDVDD 0x00000001
[ 1557.602884] mmc0: SDEDM 0x00010801
[ 1557.602892] mmc0: SDHCFG 0x0000040e
[ 1557.602899] mmc0: SDHBCT 0x00000200
[ 1557.602906] mmc0: SDHBLC 0x00000001
[ 1557.602913] mmc0: ===========================================
[ 1557.604758] sdhost_busy_irq: intmask 440, data 00000000
[ 1567.840437] mmc0: timeout waiting for hardware interrupt.
I know that RPMB runs in the trustzone zone. I am analyzing optee.
As a result of checking the RPMB-related code in optee, I understand that reading the write counter value should be performed even if the HMAC key is not injected into the eMMC.
(HMAC Key is One Time Programmable, so I am approaching it with caution.)
For reference, the kernel version currently used in raspbian is as follows.
pi#raspberrypi:~ $ uname -a
Linux raspberrypi 5.10.63-v7+ #1457 SMP Tue Sep 28 11:25:31 BST 2021 armv7l GNU/Linux
I have not made any modifications or additions other than the above work. All of the eMMC modules I purchased (hardkernel, uugear) are experiencing the same problem.
If anyone knows how to solve this problem, please help me.

That is most likely because the area has not been used - the key has not been written.
Try reading the counter after setting the key with 'mmc rpmb write-key' command ( and yes, this is one-time operation).

Related

Respberry Pi 4 debian HDD not detected on USB3 but works on USB2

I have a brand new Raspberri Pi 4 loaded with NextCloudPi_11-27-20 image on the SD which seems to boot and work perfectly. The system info tells me that the distribution is: Debian GNU/Linux10 \n\l
I am a linux noob, but think debian is causing the following problem.
I have a 4tb HDD in an USB3.0 enclosure (DELOCK 42613) which should support UASP
If I connect the HDD to USB3 it does not show up on sudo fdisk -l
If I connect to USB2 it works fine.
Where can I start to investigate this problem?
How can I get it to work on the USB3.0 port?
edit 2020-12-14 17:05:
sudo dmesg output (part of it, characters limit 30000):
pi#nextcloudpi:~ $ sudo dmesg
[ 1423.007653] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1423.020119] scsi host0: uas
[ 1423.026589] scsi 0:0:0:0: Direct-Access JMicron Generic 0508 PQ : 0 ANSI: 6
[ 1423.027759] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1423.029003] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3. 64 TiB)
[ 1423.029017] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 1423.029705] sd 0:0:0:0: [sda] Write Protect is off
[ 1423.029720] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 1423.030162] sd 0:0:0:0: [sda] Disabling FUA
[ 1423.030175] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, does n't support DPO or FUA
[ 1423.031003] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a mult iple of physical block size (4096 bytes)
[ 1423.060421] sda: sda1
[ 1423.063607] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1423.243629] BTRFS info (device sda1): disk space caching is enabled
[ 1423.243638] BTRFS info (device sda1): has skinny extents
[ 1429.361794] usb 2-2: USB disconnect, device number 6
[ 1429.364055] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1429.410539] btrfs_dev_stat_print_on_error: 17 callbacks suppressed
[ 1429.410558] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 1, flush 0, corrupt 0, gen 0
[ 1429.410641] BTRFS error (device sda1): error reading free space cache
[ 1429.410661] BTRFS warning (device sda1): failed to load free space cache for block group 30408704, rebuilding it now
[ 1429.413058] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 2, flush 0, corrupt 0, gen 0
[ 1429.413142] BTRFS error (device sda1): error reading free space cache
[ 1429.413161] BTRFS warning (device sda1): failed to load free space cache for block group 1104150528, rebuilding it now
[ 1429.413300] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 3, flush 0, corrupt 0, gen 0
[ 1429.413389] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 4, flush 0, corrupt 0, gen 0
[ 1429.413528] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 5, flush 0, corrupt 0, gen 0
[ 1429.414158] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 6, flush 0, corrupt 0, gen 0
[ 1429.417529] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 7, flush 0, corrupt 0, gen 0
[ 1429.419569] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 8, flush 0, corrupt 0, gen 0
[ 1429.419721] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 9, flush 0, corrupt 0, gen 0
[ 1429.422261] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 10, flus h 0, corrupt 0, gen 0
[ 1429.434640] BTRFS: error (device sda1) in btrfs_commit_transaction:2280: errn o=-5 IO failure (Error while writing out transaction)
[ 1429.434694] BTRFS info (device sda1): forced readonly
[ 1429.434865] BTRFS warning (device sda1): Skipping commit of aborted transacti on.
[ 1429.434964] BTRFS: error (device sda1) in cleanup_transaction:1832: errno=-5 IO failure
[ 1429.435003] BTRFS info (device sda1): delayed_refs has NO entry
[ 1429.435065] BTRFS error (device sda1): commit super ret -5
[ 1429.609779] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte= 0x07 driverbyte=0x00
[ 1429.934124] usb 2-2: new SuperSpeed Gen 1 USB device number 7 using xhci_hcd
[ 1429.955630] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcd Device= 5.08
[ 1429.955638] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1429.955643] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 1429.955648] usb 2-2: Manufacturer: JMicron
[ 1429.955653] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1429.963062] scsi host0: uas
[ 1429.964088] scsi 0:0:0:0: Direct-Access JMicron Generic 0508 PQ : 0 ANSI: 6
[ 1429.964904] scsi 0:0:0:0: Attached scsi generic sg0 type 0
[ 1429.967036] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3. 64 TiB)
[ 1429.967045] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 1429.967258] sd 0:0:0:0: [sda] Write Protect is off
[ 1429.967265] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 1429.971214] sd 0:0:0:0: [sda] Disabling FUA
[ 1429.971224] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, does n't support DPO or FUA
[ 1429.972135] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a mult iple of physical block size (4096 bytes)
[ 1429.999874] sda: sda1
[ 1430.002411] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1430.137855] BTRFS info (device sda1): disk space caching is enabled
[ 1430.137863] BTRFS info (device sda1): has skinny extents
[ 1431.729784] usb 2-2: USB disconnect, device number 7
[ 1431.735147] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1431.751329] BTRFS error (device sda1): error reading free space cache
[ 1431.751341] BTRFS warning (device sda1): failed to load free space cache for block group 30408704, rebuilding it now
[ 1431.752415] BTRFS error (device sda1): error reading free space cache
[ 1431.752426] BTRFS warning (device sda1): failed to load free space cache for block group 1104150528, rebuilding it now
[ 1431.764016] BTRFS: error (device sda1) in btrfs_commit_transaction:2280: errn o=-5 IO failure (Error while writing out transaction)
[ 1431.764042] BTRFS info (device sda1): forced readonly
[ 1431.764050] BTRFS warning (device sda1): Skipping commit of aborted transacti on.
[ 1431.764056] BTRFS: error (device sda1) in cleanup_transaction:1832: errno=-5 IO failure
[ 1431.764070] BTRFS info (device sda1): delayed_refs has NO entry
[ 1431.764095] BTRFS error (device sda1): commit super ret -5
[ 1431.973817] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte= 0x07 driverbyte=0x00
[ 1432.298081] usb 2-2: new SuperSpeed Gen 1 USB device number 8 using xhci_hcd
[ 1432.319407] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcd Device= 5.08
[ 1432.319415] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1432.319420] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 1432.319425] usb 2-2: Manufacturer: JMicron
[ 1432.319429] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1432.326883] scsi host0: uas
[ 1432.327907] scsi 0:0:0:0: Direct-Access JMicron Generic 0508 PQ : 0 ANSI: 6
[ 1432.328999] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1432.329458] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3. 64 TiB)
[ 1432.329465] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 1432.329658] sd 0:0:0:0: [sda] Write Protect is off
[ 1432.329664] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 1432.330349] sd 0:0:0:0: [sda] Disabling FUA
[ 1432.330358] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, does n't support DPO or FUA
[ 1432.331041] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a mult iple of physical block size (4096 bytes)
[ 1432.367646] sda: sda1
[ 1432.370047] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1432.507942] BTRFS info (device sda1): disk space caching is enabled
[ 1432.507950] BTRFS info (device sda1): has skinny extents
[ 1461.210242] usb 2-2: USB disconnect, device number 8
[ 1461.212707] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1461.261515] btrfs_dev_stat_print_on_error: 44 callbacks suppressed
[ 1461.261529] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 1, flush 0, corrupt 0, gen 0
[ 1461.261584] BTRFS error (device sda1): error reading free space cache
[ 1461.261597] BTRFS warning (device sda1): failed to load free space cache for block group 30408704, rebuilding it now
[ 1461.263394] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 2, flush 0, corrupt 0, gen 0
[ 1461.263451] BTRFS error (device sda1): error reading free space cache
[ 1461.263464] BTRFS warning (device sda1): failed to load free space cache for block group 1104150528, rebuilding it now
[ 1461.263572] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 3, flush 0, corrupt 0, gen 0
[ 1461.263632] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 4, flush 0, corrupt 0, gen 0
[ 1461.263727] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 5, flush 0, corrupt 0, gen 0
[ 1461.264137] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 6, flush 0, corrupt 0, gen 0
[ 1461.265950] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 7, flush 0, corrupt 0, gen 0
[ 1461.267334] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 8, flush 0, corrupt 0, gen 0
[ 1461.267450] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 9, flush 0, corrupt 0, gen 0
[ 1461.268909] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 10, flus h 0, corrupt 0, gen 0
[ 1461.276797] BTRFS: error (device sda1) in btrfs_commit_transaction:2280: errn o=-5 IO failure (Error while writing out transaction)
[ 1461.276837] BTRFS info (device sda1): forced readonly
[ 1461.276849] BTRFS warning (device sda1): Skipping commit of aborted transacti on.
[ 1461.276860] BTRFS: error (device sda1) in cleanup_transaction:1832: errno=-5 IO failure
[ 1461.276882] BTRFS info (device sda1): delayed_refs has NO entry
[ 1461.276925] BTRFS error (device sda1): commit super ret -5
[ 1461.450357] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte= 0x07 driverbyte=0x00
[ 1461.778707] usb 2-2: new SuperSpeed Gen 1 USB device number 9 using xhci_hcd
[ 1461.800117] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcd Device= 5.08
[ 1461.800136] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1461.800148] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 1461.800159] usb 2-2: Manufacturer: JMicron
[ 1461.800170] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1461.817993] scsi host0: uas
[ 1461.819782] scsi 0:0:0:0: Direct-Access JMicron Generic 0508 PQ : 0 ANSI: 6
[ 1461.821059] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1461.823080] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3. 64 TiB)
[ 1461.823097] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 1461.823586] sd 0:0:0:0: [sda] Write Protect is off
[ 1461.823603] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 1461.824346] sd 0:0:0:0: [sda] Disabling FUA
[ 1461.824364] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, does n't support DPO or FUA
[ 1461.825347] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a mult iple of physical block size (4096 bytes)
[ 1461.858003] sda: sda1
[ 1461.861222] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1462.037017] BTRFS info (device sda1): disk space caching is enabled
[ 1462.037025] BTRFS info (device sda1): has skinny extents
[ 1468.382334] usb 2-2: USB disconnect, device number 9
[ 1468.390236] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1468.437584] btrfs_dev_stat_print_on_error: 17 callbacks suppressed
[ 1468.437603] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 1, flush 0, corrupt 0, gen 0
[ 1468.437705] BTRFS error (device sda1): error reading free space cache
[ 1468.437724] BTRFS warning (device sda1): failed to load free space cache for block group 30408704, rebuilding it now
[ 1468.440437] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 2, flush 0, corrupt 0, gen 0
[ 1468.440526] BTRFS error (device sda1): error reading free space cache
[ 1468.440544] BTRFS warning (device sda1): failed to load free space cache for block group 1104150528, rebuilding it now
[ 1468.440706] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 3, flush 0, corrupt 0, gen 0
[ 1468.440801] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 4, flush 0, corrupt 0, gen 0
[ 1468.440943] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 5, flush 0, corrupt 0, gen 0
[ 1468.441490] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 6, flush 0, corrupt 0, gen 0
[ 1468.441599] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 7, flush 0, corrupt 0, gen 0
[ 1468.443710] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 8, flush 0, corrupt 0, gen 0
[ 1468.443844] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 9, flush 0, corrupt 0, gen 0
[ 1468.446474] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 10, flus h 0, corrupt 0, gen 0
[ 1468.453787] BTRFS: error (device sda1) in btrfs_commit_transaction:2280: errn o=-5 IO failure (Error while writing out transaction)
[ 1468.453843] BTRFS info (device sda1): forced readonly
[ 1468.453861] BTRFS warning (device sda1): Skipping commit of aborted transacti on.
[ 1468.453877] BTRFS: error (device sda1) in cleanup_transaction:1832: errno=-5 IO failure
[ 1468.453910] BTRFS info (device sda1): delayed_refs has NO entry
[ 1468.454426] BTRFS error (device sda1): commit super ret -5
[ 1468.650318] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte= 0x07 driverbyte=0x00
[ 1468.978696] usb 2-2: new SuperSpeed Gen 1 USB device number 10 using xhci_hcd
[ 1468.999948] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcd Device= 5.08
[ 1468.999957] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1468.999962] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 1468.999967] usb 2-2: Manufacturer: JMicron
[ 1468.999972] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1469.007193] scsi host0: uas
[ 1469.008256] scsi 0:0:0:0: Direct-Access JMicron Generic 0508 PQ : 0 ANSI: 6
[ 1469.009373] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1469.009815] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3.
Apparently this is a known problem:
STICKY: If you have a Raspberry Pi 4 and are getting bad speeds transferring data to/from USB3.0 SSDs, read this
I would not be surprised if there is a similar question on SO
In short: Something to do with the chips in the SATA adapters to USB and UAS. (if I got it right)
Please go to the link above for the full story. Quick solution:
Get the idVendor=xxxx and idProduct=xxxx by disconnecting the adapter, run sudo dmesg -C, reconnect and run dmesg
sudo nano /boot/cmdline.txt and add at the start of the line of parameters 'usb-storage.quirks=[idVendor]:[idProduct]:u'
In my case it looks like this usb-storage.quirks=152d:0578:u from the code snippet in my question.
reboot
check with dmesg | grep usb-storage, you should see something like this:
[ 2.495725] usb 2-1: UAS is blacklisted for this device, using usb-storage instead
[ 2.512739] usb 2-1: UAS is blacklisted for this device, using usb-storage instead
[ 2.531823] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 2.549642] usb-storage 2-1:1.0: Quirks match for vid 2109 pid 0715: 800000
[ 2.566177] scsi host0: usb-storage 2-1:1.0

Set burst for bandwidth limit for a pod

For what I know, there're two way to limit bandwidth with k8s.
First, configure the CNI with
{
"type": "bandwidth",
"capabilities": {"bandwidth": true},
"ingressRate": 10000000,
"ingressBurst": 10000000,
"egressRate": 10000000,
"egressBurst": 10000000
}
And second, annotate a pod with:
annotations:
kubernetes.io/ingress-bandwidth: 8M
kubernetes.io/egress-bandwidth: 8M
I read through the documentations but didn't find any way to configure burst for a pod.
But the default burst is too large to make the limitation useful:
qdisc tbf 1: dev calia2333445823 root refcnt 2 rate 8Mbit burst 256Mb lat 25.0ms
And it seems when the CNI is configured with bandwidth limit, then pod annotations will not override the CNI's configure and take effect.
So how can I set a burst for just a pod?
iperf output to illustrate the burst:
server:
Accepted connection from 192.168.0.34, port 49470
[ 5] local 192.168.203.129 port 1234 connected to 192.168.0.34 port 49472
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-1.00 sec 246 MBytes 2060541 Kbits/sec (omitted)
[ 5] 1.00-2.00 sec 935 KBytes 7657 Kbits/sec (omitted)
[ 5] 2.00-3.00 sec 933 KBytes 7645 Kbits/sec (omitted)
[ 5] 0.00-1.00 sec 935 KBytes 7655 Kbits/sec
[ 5] 1.00-2.00 sec 935 KBytes 7659 Kbits/sec
[ 5] 2.00-3.00 sec 935 KBytes 7655 Kbits/sec
[ 5] 3.00-4.00 sec 933 KBytes 7645 Kbits/sec
[ 5] 4.00-5.00 sec 932 KBytes 7637 Kbits/sec
[ 5] 5.00-6.00 sec 935 KBytes 7657 Kbits/sec
[ 5] 6.00-7.00 sec 936 KBytes 7667 Kbits/sec
[ 5] 7.00-8.00 sec 932 KBytes 7632 Kbits/sec
[ 5] 8.00-9.00 sec 935 KBytes 7659 Kbits/sec
[ 5] 9.00-10.00 sec 933 KBytes 7647 Kbits/sec
[ 5] 10.00-11.00 sec 935 KBytes 7654 Kbits/sec
[ 5] 11.00-11.15 sec 141 KBytes 7582 Kbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-11.15 sec 0.00 Bytes 0.00 Kbits/sec sender
[ 5] 0.00-11.15 sec 10.2 MBytes 7650 Kbits/sec receiver
client:
[ 4] local 192.168.0.34 port 49472 connected to 192.168.203.129 port 1234
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 247 MBytes 2073202 Kbits/sec 0 324 KBytes (omitted)
[ 4] 1.00-2.00 sec 700 KBytes 5732 Kbits/sec 0 366 KBytes (omitted)
[ 4] 2.00-3.00 sec 1.55 MBytes 13037 Kbits/sec 0 407 KBytes (omitted)
[ 4] 0.00-1.00 sec 891 KBytes 7291 Kbits/sec 0 448 KBytes
[ 4] 1.00-2.00 sec 954 KBytes 7821 Kbits/sec 0 491 KBytes
[ 4] 2.00-3.00 sec 1018 KBytes 8344 Kbits/sec 0 532 KBytes
[ 4] 3.00-4.00 sec 1.06 MBytes 8858 Kbits/sec 0 573 KBytes
[ 4] 4.00-5.00 sec 1.18 MBytes 9897 Kbits/sec 0 615 KBytes
[ 4] 5.00-6.00 sec 1.24 MBytes 10433 Kbits/sec 0 656 KBytes
[ 4] 6.00-7.00 sec 1.25 MBytes 10487 Kbits/sec 0 697 KBytes
[ 4] 7.00-8.00 sec 1.25 MBytes 10488 Kbits/sec 0 766 KBytes
[ 4] 8.00-9.00 sec 0.00 Bytes 0.00 Kbits/sec 0 899 KBytes
[ 4] 9.00-10.00 sec 1.25 MBytes 10485 Kbits/sec 0 1.03 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 10.0 MBytes 8410 Kbits/sec 0 sender
[ 4] 0.00-10.00 sec 10.2 MBytes 8532 Kbits/sec receiver
Environment:
Kubernetes 1.15.7
Calico v3.11.1
bandwidth plugin v0.8.0
tc iproute 4.11.0-14.el7
Unfortunately current implementation of bandwidth control does not support limiting burst for pod. I had the same results testing this. I also looked at the cni code on kubernetes github and found out that there are
only annotations visible are for ingress bandwidth and egress bandwidth.
bandwidthAnnotation := make(map[string]string)
bandwidthAnnotation["kubernetes.io/ingress-bandwidth"] = "1M"
bandwidthAnnotation["kubernetes.io/egress-bandwidth"] = "1M"
Since network shaping is still in alpha stage you could raise a request on github and ask
for this functionality.

mount - can't find /dev/sdc in fstab error

I'm trying to mount xfs disk.
I prepared directories.
sudo mkdir /grid/;
sudo mkdir /grid/0;
then I tried
sudo mount -t xfs /dev/sdc /grid/0;
But I always receive
can't find /dev/sdc /grid/0 in /etc/fstab
My fstab looks like this
#
# /etc/fstab
# Created by anaconda on Tue Dec 18 11:05:19 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=xxx /boot xfs defaults 0 0
UUID=zzz /boot/efi vfat umask=0077,shortname=winnt 0 0
/dev/mapper/rhel-home /home xfs defaults 0 0
/dev/mapper/rhel-var_log /var/log xfs defaults 0 0
/dev/mapper/rhel-swap swap swap defaults 0 0
/dev/sdc /grid/0 xfs defaults,noatime 0 0
/dev/sdd /grid/1 xfs defaults,noatime 0 0
/dev/sde /grid/2 xfs defaults,noatime 0 0
/dev/sdf /grid/3 xfs defaults,noatime 0 0
/dev/sdg /grid/4 xfs defaults,noatime 0 0
/dev/sdh /grid/5 xfs defaults,noatime 0 0
/dev/sdi /grid/6 xfs defaults,noatime 0 0
/dev/sdj /grid/7 xfs defaults,noatime 0 0
is something wrong with my fstab ? I can't find what I did wrong.
edit: lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
\u251c\u2500sda1 8:1 0 200M 0 part /boot/efi
\u251c\u2500sda2 8:2 0 1G 0 part /boot
\u2514\u2500sda3 8:3 0 445.9G 0 part
\u251c\u2500rhel-root 253:0 0 361.9G 0 lvm /
\u251c\u2500rhel-swap 253:1 0 4G 0 lvm [SWAP]
\u251c\u2500rhel-home 253:2 0 50G 0 lvm /home
\u2514\u2500rhel-var_log 253:3 0 30G 0 lvm /var/log
sdc 8:32 0 3.7T 0 disk
sdd 8:48 0 3.7T 0 disk
sde 8:64 0 3.7T 0 disk
sdf 8:80 0 3.7T 0 disk
sdg 8:96 0 3.7T 0 disk
sdh 8:112 0 3.7T 0 disk
sdi 8:128 0 3.7T 0 disk
sdj 8:144 0 3.7T 0 disk
The issue was caused by non-breakable space which was mixed in fstab records and in mount command.
After converting text to ASCII and checking on "Show All Characters" in notepad++ I replaced all non-breakable space with ordinary space and command finished successfully.

Matlab crashes when plotting specific 3D functions

Matlab crashes (closes) when I try to plot a 3D function of the like z=(x,y), whenever the function involves the following conditions together:
incorrect multiplication and power notation: e.g. x*y^2 instead of x.*y.^2
x,y support grid very small: e.g. meshgrid(0.01:.01:0.99)
For example, the following code doesn't work:
[x,y] = meshgrid(0.01:.01:0.99);
z=x*y^2;
surf(z)
Same happens if I use mesh instead of surf. Normally, you would expect an error about the notation.
It seems to be a bug of Matlab. An automatic crash report contain this:
------------------------------------------------------------------------
Illegal instruction detected at Fri Aug 7 15:59:56 2015
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled
Crash Mode : continue (default)
Current Graphics Driver: ATI Technologies Inc. AMD Radeon HD 8400 / R3 Series Version 4.4.13374 Compatibility Profile Context 15.20.1013
Current Visual : 0x23 (class 4, depth 24)
Default Encoding : UTF-8
GNU C Library : 2.19 stable
Host Name : -------
MATLAB Architecture : glnxa64
MATLAB Root : /usr/local/MATLAB/R2015a
MATLAB Version : 8.5.0.197613 (R2015a)
OpenGL : hardware
Operating System : Linux 3.16.0-45-generic #60~14.04.1-Ubuntu SMP Fri Jul 24 21:16:23 UTC 2015 x86_64
Processor ID : x86 Family 127 Model 0 Stepping 1, AuthenticAMD
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : The X.Org Foundation (11600000), display :0.0
Fault Count: 4
Abnormal termination:
Illegal instruction
Register State (from fault):
RAX = 00007feb4c01b000 RBX = 00007feb4c01e000
RCX = 0000000000000010 RDX = 00007febabd64e80
RSP = 00007feb20d48400 RBP = 0000000000000018
RSI = 0000000000000000 RDI = 00007feb20d484d0
R8 = 0000000000000400 R9 = 00007feb4c01e000
R10 = 0000000000000948 R11 = 0000000000000318
R12 = 0000000000000020 R13 = 0000000000000018
R14 = 0000000000000040 R15 = 0000000000000020
RIP = 00007feb0bf47e02 EFL = 0000000000010216
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007feb0bf47e02 /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+30535170 mkl_blas_cnr_def_dgemm_kernel_bdz+00000210
[ 1] 0x00007feb0bf3f665 /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+30500453 mkl_blas_cnr_def_xdgemm_bdz+00001381
[ 2] 0x00007feb0a4dbe4f /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+02829903 mkl_blas_dgemm_2d_bsrc+00000527
[ 3] 0x00007feb0a4d709e /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+02810014
[ 4] 0x00007febb8bd3623 /usr/local/MATLAB/R2015a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00558627 __kmp_invoke_microtask+00000147
[ 5] 0x00007febb8babf64 /usr/local/MATLAB/R2015a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00397156
[ 6] 0x00007febb8baae02 /usr/local/MATLAB/R2015a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00392706
[ 7] 0x00007febb8bd38d9 /usr/local/MATLAB/R2015a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00559321
[ 8] 0x00007febcd62f182 /lib/x86_64-linux-gnu/libpthread.so.0+00033154
[ 9] 0x00007febcd35c47d /lib/x86_64-linux-gnu/libc.so.6+01025149 clone+00000109
[ 10] 0x0000000000000000 <unknown-module>+00000000
Abnormal termination:
Illegal instruction
Register State (from fault):
RAX = 00007febabd95000 RBX = 00007febabd97000
RCX = 0000000000000010 RDX = 00007febabd64c40
RSP = 00007febb7ea4d00 RBP = 0000000000000018
RSI = 0000000000000000 RDI = 00007febb7ea4dd0
R8 = 0000000000000400 R9 = 00007febabd97000
R10 = 0000000000000948 R11 = 0000000000000318
R12 = 0000000000000020 R13 = 0000000000000018
R14 = 0000000000000040 R15 = 0000000000000020
RIP = 00007feb0bf47e02 EFL = 0000000000010216
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007feb0bf47e02 /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+30535170 mkl_blas_cnr_def_dgemm_kernel_bdz+00000210
[ 1] 0x00007feb0bf3f665 /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+30500453 mkl_blas_cnr_def_xdgemm_bdz+00001381
[ 2] 0x00007feb0a4dbe4f /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+02829903 mkl_blas_dgemm_2d_bsrc+00000527
[ 3] 0x00007feb0a4d709e /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+02810014
[ 4] 0x00007febb8bd3623 /usr/local/MATLAB/R2015a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00558627 __kmp_invoke_microtask+00000147
[ 5] 0x00007febb8babf64 /usr/local/MATLAB/R2015a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00397156
[ 6] 0x00007febb8bad26a /usr/local/MATLAB/R2015a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00402026 __kmp_fork_call+00004474
[ 7] 0x00007febb8b8c2e8 /usr/local/MATLAB/R2015a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00266984 __kmpc_fork_call+00000200
[ 8] 0x00007feb0a4d6cf0 /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+02809072
[ 9] 0x00007feb0a4d2db3 /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+02792883 mkl_blas_dgemm+00001475
[ 10] 0x00007feb0a9d23b2 /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+08033202 mkl_lapack_dgehrd+00001826
[ 11] 0x00007feb0a9d65a2 /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+08050082 mkl_lapack_dgeevx+00002706
[ 12] 0x00007feb0a350537 /usr/local/MATLAB/R2015a/bin/glnxa64/mkl.so+01209655 dgeevx_+00000327
[ 13] 0x00007feb32addf04 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmathlinalg.so+01310468
[ 14] 0x00007feb32adc875 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmathlinalg.so+01304693
[ 15] 0x00007feb32a6b4a2 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmathlinalg.so+00840866
[ 16] 0x00007feb32a6b83e /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmathlinalg.so+00841790
[ 17] 0x00007febc217d305 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00557829
[ 18] 0x00007febc2164744 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00456516 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000244
[ 19] 0x00007febc142bd20 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04189472
[ 20] 0x00007febc13db432 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03859506
[ 21] 0x00007febc13dd612 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03868178
[ 22] 0x00007febc13e3597 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03892631
[ 23] 0x00007febc13decff /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03874047
[ 24] 0x00007febc13df934 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03877172
[ 25] 0x00007febc14552ce /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04358862
[ 26] 0x00007febc21bbaea /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00813802 _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_+00000762
[ 27] 0x00007febc21bbfb0 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00815024 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000032
[ 28] 0x00007febb52e8edd /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcos_impl.so+02473693
[ 29] 0x00007febb527e5c2 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcos_impl.so+02037186
[ 30] 0x00007febb527fddf /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcos_impl.so+02043359
[ 31] 0x00007febb52858e0 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcos_impl.so+02066656
[ 32] 0x00007febb5281053 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcos_impl.so+02048083
[ 33] 0x00007febb52efbb6 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcos_impl.so+02501558
[ 34] 0x00007febb537471b /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcos_impl.so+03045147
[ 35] 0x00007febc2164744 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00456516 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000244
[ 36] 0x00007febb5372451 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcos_impl.so+03036241
[ 37] 0x00007feb32a9737c /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmathlinalg.so+01020796
[ 38] 0x00007febc217d305 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00557829
[ 39] 0x00007febc2164744 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00456516 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000244
[ 40] 0x00007febc154dfee /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+05378030
[ 41] 0x00007febc147ca71 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04520561
[ 42] 0x00007febc147d7ee /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04524014
[ 43] 0x00007febc1489619 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04572697
[ 44] 0x00007febc1489783 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04573059
[ 45] 0x00007febc15c0b54 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+05847892
[ 46] 0x00007febc13dd9b9 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03869113
[ 47] 0x00007febc13e3597 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03892631
[ 48] 0x00007febc13decff /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03874047
[ 49] 0x00007febc13df934 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03877172
[ 50] 0x00007febc14552ce /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04358862
[ 51] 0x00007febc21bbc39 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00814137 _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_+00001097
[ 52] 0x00007febc21bbfb0 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00815024 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000032
[ 53] 0x00007febc142bd20 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04189472
[ 54] 0x00007febc13ac4b3 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03667123
[ 55] 0x00007febc13dc6ee /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03864302
[ 56] 0x00007febc13e3597 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03892631
[ 57] 0x00007febc13decff /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03874047
[ 58] 0x00007febc13df934 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03877172
[ 59] 0x00007febc14552ce /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04358862
[ 60] 0x00007febc21bbc39 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00814137 _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_+00001097
[ 61] 0x00007febc21bbfb0 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_dispatcher.so+00815024 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000032
[ 62] 0x00007febc1414495 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+04093077
[ 63] 0x00007febc13d4fb9 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03833785
[ 64] 0x00007febc13d13f5 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03818485
[ 65] 0x00007febc13d1ad3 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwm_interpreter.so+03820243
[ 66] 0x00007febc30c7b6c /usr/local/MATLAB/R2015a/bin/glnxa64/libmwbridge.so+00228204
[ 67] 0x00007febc30c8751 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwbridge.so+00231249 _Z8mnParserv+00000737
[ 68] 0x00007febce7cc3af /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcr.so+00799663 _ZN11mcrInstance30mnParser_on_interpreter_threadEv+00000031
[ 69] 0x00007febce7ac133 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcr.so+00667955
[ 70] 0x00007febce7adfd9 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcr.so+00675801 _ZN5boost6detail11task_objectIvNS_3_bi6bind_tIvPFvRKNS_8functionIFvvEEEENS2_5list1INS2_5valueIS6_EEEEEEE6do_runEv+00000025
[ 71] 0x00007febce7ae9a7 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcr.so+00678311 _ZN5boost6detail9task_baseIvE3runEv+00000071
[ 72] 0x00007febce7aea07 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcr.so+00678407
[ 73] 0x00007febce7a9d8a /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcr.so+00658826
[ 74] 0x00007febc0767a56 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwuix.so+00334422
[ 75] 0x00007febc074f3a2 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwuix.so+00234402
[ 76] 0x00007febcef9af1f /usr/local/MATLAB/R2015a/bin/glnxa64/libmwservices.so+02621215
[ 77] 0x00007febcef9b08c /usr/local/MATLAB/R2015a/bin/glnxa64/libmwservices.so+02621580
[ 78] 0x00007febcef9cbdf /usr/local/MATLAB/R2015a/bin/glnxa64/libmwservices.so+02628575
[ 79] 0x00007febcef9d61c /usr/local/MATLAB/R2015a/bin/glnxa64/libmwservices.so+02631196 _Z25svWS_ProcessPendingEventsiib+00000092
[ 80] 0x00007febce7aa408 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcr.so+00660488
[ 81] 0x00007febce7aa724 /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcr.so+00661284
[ 82] 0x00007febce796b0d /usr/local/MATLAB/R2015a/bin/glnxa64/libmwmcr.so+00580365
[ 83] 0x00007febcd62f182 /lib/x86_64-linux-gnu/libpthread.so.0+00033154
[ 84] 0x00007febcd35c47d /lib/x86_64-linux-gnu/libc.so.6+01025149 clone+00000109
[ 85] 0x0000000000000000 <unknown-module>+00000000
Abnormal termination
If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.
Thank you for your help.
In suggestion from this forum, I submitted a service request. Clearly, I solved my problem by using the correct dot notation. Yet, regardless of any wrong notation, Matlab should not crash. I will update this post once I receive further information and either delete or answer this question.

Measure height of 3d block for [x y] point

I have following data:
kx = 20;
ky = 20;
k = [kx ky];
PointsL = [
[ 32 0 0] % P1
[387 0 0]
[475 0 0]
[475 30 0]
[602 30 0] % P5
[602 220 0]
[475 220 0]
[475 737 0]
[387 737 0]
[ 32 737 0] % P10
[ 32 555 0]
[ 0 555 0]
[ 0 277 0]
[ 27 277 0]
[ 27 250 0] % P15
[ 0 250 0]
[ 0 57 0]
[ 32 57 0] % P18
];
PointsH = [
[ 32 0 270] % P1
[387 0 270]
[475 0 183]
[475 30 183]
[602 30 183] % P5
[602 220 183]
[475 220 183]
[475 737 183]
[387 737 270]
[ 32 737 270] % P10
[ 32 555 270]
[ 0 555 270]
[ 0 277 270]
[ 27 277 270]
[ 27 250 270] % P15
[ 0 250 270]
[ 0 57 270]
[ 32 57 270] % P18
];
PointsL are points of the lower surface - all with z=0.
PointsH are points of the higher surface - changable in z-axis.
All of them are representing points of room.
Following code draws 3d model:
plength = size(PointsL,1);
for i=1:plength
if i == 1
pl1 = PointsL(plength,:);
ph1 = PointsH(plength,:);
else
pl1 = PointsL(i-1,:);
ph1 = PointsH(i-1,:);
end
pl2 = PointsL(i,:);
ph2 = PointsH(i,:);
line([pl1(1) pl2(1)], [pl1(2) pl2(2)], [pl1(3) pl2(3)]);
line([ph1(1) ph2(1)], [ph1(2) ph2(2)], [ph1(3) ph2(3)]);
line([pl1(1) ph1(1)], [pl1(2) ph1(2)], [pl1(3) ph1(3)]);
end
p1 = PointsH(2,:);
p2 = PointsH(9,:);
line([p1(1) p2(1)], [p1(2) p2(2)], [p1(3) p2(3)]);
p1 = PointsH(4,:);
p2 = PointsH(7,:);
line([p1(1) p2(1)], [p1(2) p2(2)], [p1(3) p2(3)]);
Is it possible to get height (z value) for given x,y values ?
Ok, I was going to say that this could easily be done using TriScatteredInterp() on PointsH. I realised that it was not that simple to get it to produce what I wanted. I resorted to adding extra points and moving them around to create the right interpolation triangles.
I finally got something that can produce the z-value corresponding to the point (a,b).
Here is what I ended up doing...
epsilon = 1e-8;
PointsL_diff = epsilon*[
[ -1 0 0] % P1
[ 0 -1 0]
[ 0 -1 0]
[ 1 0 0]
[ 0 -1 0] % added
[ 1 -1 0]
[ 1 0 0] % P5
[ 0 -1 0]
[ 1 1 0]
[ 1 1 0]
[ 0 1 0]
[ 1 0 0] % added
[ 0 1 0]
[ -1 0 0] % P10
[ 0 1 0] % added
[ -1 1 0]
[ -1 1 0]
[ -1 0 0]
[ 0 -1 0] % added
[ -1 -1 0]
[ -1 1 0] % P15
[ -1 0 0]
[ 0 1 0] % added
[ -1 -1 0]
[ -1 -1 0] % P18
];
PointsL = [
[ 32 0 0] % P1
[ 32 0 0] % added
[387 0 0]
[475 0 0]
[475 0 0] % added
[475 30 0]
[602 30 0] % P5
[602 30 0] % added
[602 220 0]
[475 220 0]
[475 737 0]
[475 737 0] % added
[387 737 0]
[ 32 737 0] % P10
[ 32 737 0] % added
[ 32 555 0]
[ 0 555 0]
[ 0 277 0]
[ 0 277 0] % added
[ 27 277 0]
[ 27 250 0] % P15
[ 0 250 0]
[ 0 250 0] % added
[ 0 57 0]
[ 32 57 0] % P18
];
PointsH = [
[ 32 0 270] % P1
[387 0 270]
[475 0 183]
[475 30 183]
[602 30 183] % P5
[602 220 183]
[475 220 183]
[475+epsilon 220 183] % added
[475 220+epsilon 183] % added
[475 737 183]
[387 737 270]
[387 220 270] % added
[ 32 737 270] % P10
[ 32 555 270]
[ 0 555 270]
[ 0 277 270]
[ 27 277 270]
[ 27 250 270] % P15
[ 0 250 270]
[ 0 57 270]
[ 32 57 270] % P18
];
% plot bounds
x_min = -200;
x_max = 800;
y_min = -200;
y_max = 800;
newPointsL = PointsL + PointsL_diff;
x = [PointsH(:,1); newPointsL(:,1); x_min; x_max; x_min; x_max];
y = [PointsH(:,2); newPointsL(:,2); y_min; y_min; y_max; y_max];
z = [PointsH(:,3); newPointsL(:,3); 0; 0; 0; 0];
F = TriScatteredInterp(x,y,z); % default is linear interpolation
% find z-value for point (a,b)
a = 100;
b = 200;
z_value = F(a,b)
% generate mesh and plot surface
ti_x = x_min:10:x_max;
ti_y = y_min:10:y_max;
[qx,qy] = meshgrid(ti_x,ti_y);
qz = F(qx,qy);
mesh(qx,qy,qz);
hold on;
plot3(x,y,z,'o');
... and here is the figure the code produces:
Quick general way:
Try Data Cursor option in the figure windows Tool bar.
And, if you want to do it programatically, follow this link.