Skip to content

goodixmoc: Remove internal cancellable

Benjamin Berg requested to merge benzea/goodix-remove-cancellable into master

The driver has an internal cancellable that simply forwards the external cancellation in the cancel callback. This is not really needed, we can instead just use the external cancellable directly by fetching it using fpi_device_get_cancellable().


So, the whole cancellation confuses me a bit. The proposed commit here is just a cleanup, but looking at the code makes me wonder what is going on.

Lets say:

  • Enroll is started
  • Screen shield is turned on
  • FP_ENROLL_CAPTURE state is reached
  • User cancels enroll

What happens now is:

  • fp_cmd_receive_cb receives cancellation error, sets it on the command SSM
  • fp_cmd_ssm_done forwards it to callback
  • fp_enroll_capture_cb marks task_ssm as failed
  • fp_enroll_ssm_done returns the error to fpi_device_enroll_complete

The thing to note here is that screen shield is not being reset. Also, we never explicitly tell the device that the enroll has been cancelled, so it may just continue with the enroll as if nothing has happened.

So, that opens up two questions for me:

  1. Is there a cancel command that we can/should send on cancellation?
  2. Should we move screen shield disabling into fp_enroll_ssm_done, and wait for that to complete before calling fpi_device_enroll_complete?

Hmm, I wonder if we could add some feature to libfprint to simplify the screen shield handling. We could add a cleanup handler that is run after the driver has signalled completion. That would save drivers from having to track the results until they have finished cleaning up everything.

CC: @bogerwang, @FengJungle

Edited by Benjamin Berg

Merge request reports