Skip to content

Commit d024baf

Browse files
committed
Merge remote-tracking branch 'rootd/sigfm' into 0x2a/feat/sigfm
2 parents fcbb48a + 303e4ee commit d024baf

File tree

9 files changed

+139
-68
lines changed

9 files changed

+139
-68
lines changed

.vscode/tasks.json

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
{
2-
"version": "2.0.0",
3-
"tasks": [
4-
{
5-
"type": "shell",
6-
"label": "Configure the project",
7-
"command": "/usr/bin/meson",
8-
"args": [
9-
"${workspaceFolder}/_build"
10-
],
11-
"problemMatcher": []
12-
},
13-
{
14-
"type": "shell",
15-
"label": "Build the project",
16-
"command": "/usr/bin/meson",
17-
"args": [
18-
"compile"
19-
],
20-
"options": {
21-
"cwd": "${workspaceFolder}/_build"
22-
},
23-
"problemMatcher": {
24-
"base": "$gcc",
25-
"fileLocation": [
26-
"relative",
27-
"${workspaceFolder}/_build"
28-
]
29-
},
30-
"group": {
31-
"kind": "build",
32-
"isDefault": true
33-
}
34-
}
35-
]
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "shell",
6+
"label": "Configure the project",
7+
"command": "/usr/bin/meson",
8+
"args": [
9+
"${workspaceFolder}/_build"
10+
],
11+
"problemMatcher": []
12+
},
13+
{
14+
"type": "shell",
15+
"label": "Build the project",
16+
"command": "/usr/bin/meson",
17+
"args": [
18+
"compile"
19+
],
20+
"options": {
21+
"cwd": "${workspaceFolder}/_build"
22+
},
23+
"problemMatcher": {
24+
"base": "$gcc",
25+
"fileLocation": [
26+
"relative",
27+
"${workspaceFolder}/_build"
28+
]
29+
},
30+
"group": {
31+
"kind": "build",
32+
"isDefault": true
33+
}
34+
}
35+
]
3636
}

data/autosuspend.hwdb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ usb:v04F3p0C58*
146146
usb:v04F3p0C7D*
147147
usb:v04F3p0C7E*
148148
usb:v04F3p0C82*
149+
usb:v04F3p0C88*
149150
ID_AUTOSUSPEND=1
150151
ID_PERSIST=0
151152

libfprint/drivers/elanmoc/elanmoc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static const FpIdEntry id_table[] = {
2828
{ .vid = 0x04f3, .pid = 0x0c7d, },
2929
{ .vid = 0x04f3, .pid = 0x0c7e, },
3030
{ .vid = 0x04f3, .pid = 0x0c82, },
31+
{ .vid = 0x04f3, .pid = 0x0c88, },
3132
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
3233
};
3334

libfprint/drivers/goodixmoc/goodix.c

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ fp_enroll_capture_cb (FpiDeviceGoodixMoc *self,
661661
/* */
662662
if (resp->result >= GX_FAILED)
663663
{
664-
fp_warn ("Capture sample failed, result: 0x%x", resp->result);
664+
fp_info ("Capture sample failed, result: 0x%x", resp->result);
665665
fpi_device_enroll_progress (FP_DEVICE (self),
666666
self->enroll_stage,
667667
NULL,
@@ -675,7 +675,7 @@ fp_enroll_capture_cb (FpiDeviceGoodixMoc *self,
675675
if ((resp->capture_data_resp.img_quality < self->sensorcfg->config[4]) ||
676676
(resp->capture_data_resp.img_coverage < self->sensorcfg->config[5]))
677677
{
678-
fp_warn ("Capture sample poor quality(%d): %d or coverage(%d): %d",
678+
fp_info ("Capture sample poor quality(%d): %d or coverage(%d): %d",
679679
self->sensorcfg->config[4],
680680
resp->capture_data_resp.img_quality,
681681
self->sensorcfg->config[5],
@@ -1041,6 +1041,47 @@ fp_init_config_cb (FpiDeviceGoodixMoc *self,
10411041
fpi_ssm_next_state (self->task_ssm);
10421042
}
10431043

1044+
static void
1045+
fp_init_cb_reset_or_complete (FpiDeviceGoodixMoc *self,
1046+
gxfp_cmd_response_t *resp,
1047+
GError *error)
1048+
{
1049+
if (error)
1050+
{
1051+
fp_warn ("Template storage appears to have been corrupted! Error was: %s", error->message);
1052+
fp_warn ("A known reason for this to happen is a firmware bug triggered by another storage area being initialized.");
1053+
fpi_ssm_jump_to_state (self->task_ssm, FP_INIT_RESET_DEVICE);
1054+
}
1055+
else
1056+
{
1057+
fpi_ssm_mark_completed (self->task_ssm);
1058+
}
1059+
}
1060+
1061+
static void
1062+
fp_init_reset_device_cb (FpiDeviceGoodixMoc *self,
1063+
gxfp_cmd_response_t *resp,
1064+
GError *error)
1065+
{
1066+
if (error)
1067+
{
1068+
fp_warn ("Reset failed: %s", error->message);
1069+
fpi_ssm_mark_failed (self->task_ssm, error);
1070+
return;
1071+
}
1072+
if ((resp->result >= GX_FAILED) && (resp->result != GX_ERROR_FINGER_ID_NOEXIST))
1073+
{
1074+
fp_warn ("Reset failed, device reported: 0x%x", resp->result);
1075+
fpi_ssm_mark_failed (self->task_ssm,
1076+
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
1077+
"Failed clear storage, result: 0x%x",
1078+
resp->result));
1079+
return;
1080+
}
1081+
1082+
fp_warn ("Reset completed");
1083+
fpi_ssm_mark_completed (self->task_ssm);
1084+
}
10441085

10451086
static void
10461087
fp_init_sm_run_state (FpiSsm *ssm, FpDevice *device)
@@ -1065,6 +1106,30 @@ fp_init_sm_run_state (FpiSsm *ssm, FpDevice *device)
10651106
sizeof (gxfp_sensor_cfg_t),
10661107
fp_init_config_cb);
10671108
break;
1109+
1110+
case FP_INIT_TEMPLATE_LIST:
1111+
/* List prints to check whether the template DB was corrupted.
1112+
* As of 2022-06-13 there is a known firmware issue that can cause the
1113+
* stored templates for Linux to be corrupted when the Windows storage
1114+
* area is initialized.
1115+
* In that case, we'll get a protocol failure trying to retrieve the
1116+
* list of prints.
1117+
*/
1118+
goodix_sensor_cmd (self, MOC_CMD0_GETFINGERLIST, MOC_CMD1_DEFAULT,
1119+
FALSE,
1120+
(const guint8 *) &dummy,
1121+
1,
1122+
fp_init_cb_reset_or_complete);
1123+
break;
1124+
1125+
case FP_INIT_RESET_DEVICE:
1126+
fp_warn ("Resetting device storage, you will need to enroll all prints again!");
1127+
goodix_sensor_cmd (self, MOC_CMD0_DELETETEMPLATE, MOC_CMD1_DELETE_ALL,
1128+
FALSE,
1129+
NULL,
1130+
0,
1131+
fp_init_reset_device_cb);
1132+
break;
10681133
}
10691134

10701135

libfprint/drivers/goodixmoc/goodix.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ typedef enum {
3535
typedef enum {
3636
FP_INIT_VERSION = 0,
3737
FP_INIT_CONFIG,
38+
FP_INIT_TEMPLATE_LIST,
39+
FP_INIT_RESET_DEVICE,
3840
FP_INIT_NUM_STATES,
3941
} FpInitState;
4042

libfprint/drivers/goodixmoc/goodix_proto.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,8 @@ gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint16_t buffer_len, pgxfp_c
393393
fingerid_length,
394394
&presp->finger_list_resp.finger_list[num]) != 0)
395395
{
396-
g_error ("parse fingerlist error");
397-
presp->finger_list_resp.finger_num = 0;
398-
presp->result = GX_FAILED;
399-
break;
396+
g_warning ("Failed to parse finger list");
397+
return -1;
400398
}
401399
offset += fingerid_length;
402400
}

tests/goodixmoc/custom.pcapng

11.1 KB
Binary file not shown.

tests/goodixmoc/custom.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525

2626
d.open_sync()
2727

28+
# 1. verify clear storage command, 2. make sure later asserts are good
29+
d.clear_storage_sync()
30+
2831
template = FPrint.Print.new(d)
2932

3033
def enroll_progress(*args):

tests/goodixmoc/device

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
P: /devices/pci0000:00/0000:00:14.0/usb1/1-3
2-
N: bus/usb/001/053=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000
3-
E: DEVNAME=/dev/bus/usb/001/053
2+
N: bus/usb/001/023=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000
3+
E: DEVNAME=/dev/bus/usb/001/023
44
E: DEVTYPE=usb_device
55
E: DRIVER=usb
66
E: PRODUCT=27c6/6496/100
77
E: TYPE=239/0/0
88
E: BUSNUM=001
9-
E: DEVNUM=053
9+
E: DEVNUM=023
1010
E: MAJOR=189
11-
E: MINOR=52
11+
E: MINOR=22
1212
E: SUBSYSTEM=usb
1313
E: ID_VENDOR=Goodix_Technology_Co.__Ltd.
1414
E: ID_VENDOR_ENC=Goodix\x20Technology\x20Co.\x2c\x20Ltd.
@@ -23,6 +23,7 @@ E: ID_BUS=usb
2323
E: ID_USB_INTERFACES=:ff0000:
2424
E: ID_VENDOR_FROM_DATABASE=Shenzhen Goodix Technology Co.,Ltd.
2525
E: ID_AUTOSUSPEND=1
26+
E: ID_PERSIST=0
2627
E: ID_PATH=pci-0000:00:14.0-usb-0:3
2728
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3
2829
A: authorized=1\n
@@ -40,8 +41,8 @@ A: bmAttributes=a0\n
4041
A: busnum=1\n
4142
A: configuration=XXXX_MOC_B0\n
4243
H: descriptors=12010002EF000040C627966400010102030109022000010103A0320904000002FF0000040705830240000007050102400000
43-
A: dev=189:52\n
44-
A: devnum=53\n
44+
A: dev=189:22\n
45+
A: devnum=23\n
4546
A: devpath=3\n
4647
L: driver=../../../../../bus/usb/drivers/usb
4748
L: firmware_node=../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d/device:20
@@ -51,16 +52,16 @@ A: ltm_capable=no\n
5152
A: manufacturer=Goodix Technology Co., Ltd.\n
5253
A: maxchild=0\n
5354
L: port=../1-0:1.0/usb1-port3
54-
A: power/active_duration=29262\n
55+
A: power/active_duration=22667\n
5556
A: power/autosuspend=2\n
5657
A: power/autosuspend_delay_ms=2000\n
57-
A: power/connected_duration=57399\n
58+
A: power/connected_duration=917616\n
5859
A: power/control=auto\n
5960
A: power/level=auto\n
6061
A: power/persist=1\n
61-
A: power/runtime_active_time=29308\n
62+
A: power/runtime_active_time=22809\n
6263
A: power/runtime_status=active\n
63-
A: power/runtime_suspended_time=27850\n
64+
A: power/runtime_suspended_time=894564\n
6465
A: power/wakeup=disabled\n
6566
A: power/wakeup_abort_count=\n
6667
A: power/wakeup_active=\n
@@ -77,29 +78,29 @@ A: rx_lanes=1\n
7778
A: serial=XXXX_MOC_B0\n
7879
A: speed=12\n
7980
A: tx_lanes=1\n
80-
A: urbnum=394\n
81+
A: urbnum=298\n
8182
A: version= 2.00\n
8283

8384
P: /devices/pci0000:00/0000:00:14.0/usb1
84-
N: bus/usb/001/001=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
85+
N: bus/usb/001/001=12010002090001406B1D020017050302010109021900010100E0000904000001090000000705810304000C
8586
E: DEVNAME=/dev/bus/usb/001/001
8687
E: DEVTYPE=usb_device
8788
E: DRIVER=usb
88-
E: PRODUCT=1d6b/2/513
89+
E: PRODUCT=1d6b/2/517
8990
E: TYPE=9/0/1
9091
E: BUSNUM=001
9192
E: DEVNUM=001
9293
E: MAJOR=189
9394
E: MINOR=0
9495
E: SUBSYSTEM=usb
95-
E: ID_VENDOR=Linux_5.13.15-200.fc34.x86_64_xhci-hcd
96-
E: ID_VENDOR_ENC=Linux\x205.13.15-200.fc34.x86_64\x20xhci-hcd
96+
E: ID_VENDOR=Linux_5.17.12-300.fc36.x86_64_xhci-hcd
97+
E: ID_VENDOR_ENC=Linux\x205.17.12-300.fc36.x86_64\x20xhci-hcd
9798
E: ID_VENDOR_ID=1d6b
9899
E: ID_MODEL=xHCI_Host_Controller
99100
E: ID_MODEL_ENC=xHCI\x20Host\x20Controller
100101
E: ID_MODEL_ID=0002
101-
E: ID_REVISION=0513
102-
E: ID_SERIAL=Linux_5.13.15-200.fc34.x86_64_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
102+
E: ID_REVISION=0517
103+
E: ID_SERIAL=Linux_5.17.12-300.fc36.x86_64_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
103104
E: ID_SERIAL_SHORT=0000:00:14.0
104105
E: ID_BUS=usb
105106
E: ID_USB_INTERFACES=:090000:
@@ -122,11 +123,11 @@ A: bMaxPacketSize0=64\n
122123
A: bMaxPower=0mA\n
123124
A: bNumConfigurations=1\n
124125
A: bNumInterfaces= 1\n
125-
A: bcdDevice=0513\n
126+
A: bcdDevice=0517\n
126127
A: bmAttributes=e0\n
127128
A: busnum=1\n
128129
A: configuration=\n
129-
H: descriptors=12010002090001406B1D020013050302010109021900010100E0000904000001090000000705810304000C
130+
H: descriptors=12010002090001406B1D020017050302010109021900010100E0000904000001090000000705810304000C
130131
A: dev=189:0\n
131132
A: devnum=1\n
132133
A: devpath=0\n
@@ -136,15 +137,15 @@ A: idProduct=0002\n
136137
A: idVendor=1d6b\n
137138
A: interface_authorized_default=1\n
138139
A: ltm_capable=no\n
139-
A: manufacturer=Linux 5.13.15-200.fc34.x86_64 xhci-hcd\n
140+
A: manufacturer=Linux 5.17.12-300.fc36.x86_64 xhci-hcd\n
140141
A: maxchild=12\n
141-
A: power/active_duration=219578717\n
142+
A: power/active_duration=164289796\n
142143
A: power/autosuspend=0\n
143144
A: power/autosuspend_delay_ms=0\n
144-
A: power/connected_duration=219649620\n
145+
A: power/connected_duration=164360220\n
145146
A: power/control=auto\n
146147
A: power/level=auto\n
147-
A: power/runtime_active_time=219589127\n
148+
A: power/runtime_active_time=164331876\n
148149
A: power/runtime_status=active\n
149150
A: power/runtime_suspended_time=0\n
150151
A: power/wakeup=disabled\n
@@ -163,14 +164,14 @@ A: rx_lanes=1\n
163164
A: serial=0000:00:14.0\n
164165
A: speed=480\n
165166
A: tx_lanes=1\n
166-
A: urbnum=4325\n
167+
A: urbnum=2097\n
167168
A: version= 2.00\n
168169

169170
P: /devices/pci0000:00/0000:00:14.0
170171
E: DRIVER=xhci_hcd
171172
E: PCI_CLASS=C0330
172173
E: PCI_ID=8086:9DED
173-
E: PCI_SUBSYS_ID=17AA:2292\n
174+
E: PCI_SUBSYS_ID=17AA:2292
174175
E: PCI_SLOT_NAME=0000:00:14.0
175176
E: MODALIAS=pci:v00008086d00009DEDsv000017AAsd00002292bc0Csc03i30
176177
E: SUBSYSTEM=pci
@@ -183,7 +184,7 @@ E: ID_MODEL_FROM_DATABASE=Cannon Point-LP USB 3.1 xHCI Controller
183184
A: ari_enabled=0\n
184185
A: broken_parity_status=0\n
185186
A: class=0x0c0330\n
186-
H: config=8680ED9D060490021130030C00008000040022EA000000000000000000000000000000000000000000000000AA179222000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F000000004C084B0100000000316000000000000000000000000000000180C2C1080000000000000000000000059087001803E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000000000000000000008000000040000000000000000000000000000000000000000000000000000000800000004000000000000000000000000000000000000000000000000000000B50F320112000000
187+
H: config=8680ED9D060490021130030C00008000040022EA000000000000000000000000000000000000000000000000AA179222000000007000000000000000FF010000FD0134808FC6FF8300000000000000007F6DDC0F00000000F507312600000000316000000000000000000000000000000180C2C1080000000000000000000000059087001803E0FE0000000000000000090014F01000400100000000C10A080000080E00001800008F40020000010000000000000000000008000000040000000000000000000000000000000000000000000000000000000800000004000000000000000000000000000000000000000000000000000000B50F320112000000
187188
A: consistent_dma_mask_bits=64\n
188189
A: d3cold_allowed=1\n
189190
A: dbc=disabled\n
@@ -201,8 +202,8 @@ A: msi_bus=1\n
201202
A: msi_irqs/128=msi\n
202203
A: numa_node=-1\n
203204
A: pools=poolinfo - 0.1\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 0 0 128 0\nbuffer-32 0 0 32 0\nxHCI 1KB stream ctx arrays 0 0 1024 0\nxHCI 256 byte stream ctx arrays 0 0 256 0\nxHCI input/output contexts 11 12 2112 12\nxHCI ring segments 46 50 4096 50\nbuffer-2048 0 0 2048 0\nbuffer-512 0 0 512 0\nbuffer-128 6 32 128 1\nbuffer-32 0 0 32 0\n
204-
A: power/control=on\n
205-
A: power/runtime_active_time=219589302\n
205+
A: power/control=auto\n
206+
A: power/runtime_active_time=164332777\n
206207
A: power/runtime_status=active\n
207208
A: power/runtime_suspended_time=0\n
208209
A: power/wakeup=enabled\n

0 commit comments

Comments
 (0)