From 705dfc1c5b0359bc5cda11d9d3500d5c80276c3b Mon Sep 17 00:00:00 2001 From: xx979xx <40252818+xx979xx@users.noreply.github.com> Date: Sun, 9 Aug 2020 11:08:09 +0300 Subject: [PATCH] fix for PC: detach panda kernel driver if active (#1950) old-commit-hash: 4f0c75291b9c56b9eb219cbe74025c6897635d85 --- selfdrive/boardd/panda.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/boardd/panda.cc b/selfdrive/boardd/panda.cc index 8bec94345..5820fa400 100644 --- a/selfdrive/boardd/panda.cc +++ b/selfdrive/boardd/panda.cc @@ -25,6 +25,10 @@ Panda::Panda(){ dev_handle = libusb_open_device_with_vid_pid(ctx, 0xbbaa, 0xddcc); if (dev_handle == NULL) { goto fail; } + if (libusb_kernel_driver_active(dev_handle, 0) == 1) { + libusb_detach_kernel_driver(dev_handle, 0); + } + err = libusb_set_configuration(dev_handle, 1); if (err != 0) { goto fail; }