BTReal: Use FromThread::ANY for USB transfer replies

libusb transfer callbacks might be called immediately during transfer
submission in some cases. (libusb doesn't even specify what thread
the callback is invoked on.) In other words, it is possible to reach
the transfer callback from the CPU thread, and not just from the
USB event handling thread.

So CoreTiming::FromThread::NON_CPU is incorrect and should instead
be ANY.
This commit is contained in:
Léo Lam 2019-06-16 15:07:06 +02:00 committed by Léo Lam
parent cf60a9a7f7
commit e85fa26768

View File

@ -592,8 +592,7 @@ void BluetoothReal::HandleCtrlTransfer(libusb_transfer* tr)
} }
const auto& command = m_current_transfers.at(tr).command; const auto& command = m_current_transfers.at(tr).command;
command->FillBuffer(libusb_control_transfer_get_data(tr), tr->actual_length); command->FillBuffer(libusb_control_transfer_get_data(tr), tr->actual_length);
m_ios.EnqueueIPCReply(command->ios_request, tr->actual_length, 0, m_ios.EnqueueIPCReply(command->ios_request, tr->actual_length, 0, CoreTiming::FromThread::ANY);
CoreTiming::FromThread::NON_CPU);
m_current_transfers.erase(tr); m_current_transfers.erase(tr);
} }
@ -641,8 +640,7 @@ void BluetoothReal::HandleBulkOrIntrTransfer(libusb_transfer* tr)
const auto& command = m_current_transfers.at(tr).command; const auto& command = m_current_transfers.at(tr).command;
command->FillBuffer(tr->buffer, tr->actual_length); command->FillBuffer(tr->buffer, tr->actual_length);
m_ios.EnqueueIPCReply(command->ios_request, tr->actual_length, 0, m_ios.EnqueueIPCReply(command->ios_request, tr->actual_length, 0, CoreTiming::FromThread::ANY);
CoreTiming::FromThread::NON_CPU);
m_current_transfers.erase(tr); m_current_transfers.erase(tr);
} }
} // namespace IOS::HLE::Device } // namespace IOS::HLE::Device