USBMSC: Fix reversed logic on waiting for SCSI thread start.

The scsi thread was waiting for the wrong condition.

However, this was masked by the fact that the code creating the scsi thread
was also holding usbmsc_scsi_lock(priv) while initializing data, hence this
lock synchronized the scsi thread start with init completion.
This commit is contained in:
Wolfgang Reissnegger 2016-07-23 20:11:00 -07:00
parent 2974d2b07e
commit 4f83d58b24
1 changed files with 2 additions and 2 deletions

View File

@ -2641,8 +2641,8 @@ int usbmsc_scsi_main(int argc, char *argv[])
uinfo("Waiting to be signalled\n");
usbmsc_scsi_lock(priv);
priv->thstate = USBMSC_STATE_STARTED;
while ((priv->theventset & USBMSC_EVENT_READY) != 0 &&
(priv->theventset & USBMSC_EVENT_TERMINATEREQUEST) != 0)
while ((priv->theventset & USBMSC_EVENT_READY) == 0 &&
(priv->theventset & USBMSC_EVENT_TERMINATEREQUEST) == 0)
{
usbmsc_scsi_wait(priv);
}