--- - branch: netbsd-7 date: Sat Aug 25 14:57:35 UTC 2018 files: - new: 1.228.2.3 old: 1.228.2.2 path: src/sys/dev/usb/ehci.c pathrev: src/sys/dev/usb/ehci.c@1.228.2.3 type: modified - new: 1.42.12.2 old: 1.42.12.1 path: src/sys/dev/usb/ehcivar.h pathrev: src/sys/dev/usb/ehcivar.h@1.42.12.2 type: modified - new: 1.6.4.5 old: 1.6.4.4 path: src/sys/dev/usb/motg.c pathrev: src/sys/dev/usb/motg.c@1.6.4.5 type: modified - new: 1.253.2.5 old: 1.253.2.4 path: src/sys/dev/usb/ohci.c pathrev: src/sys/dev/usb/ohci.c@1.253.2.5 type: modified - new: 1.55.4.2 old: 1.55.4.1 path: src/sys/dev/usb/ohcivar.h pathrev: src/sys/dev/usb/ohcivar.h@1.55.4.2 type: modified - new: 1.264.2.4 old: 1.264.2.3 path: src/sys/dev/usb/uhci.c pathrev: src/sys/dev/usb/uhci.c@1.264.2.4 type: modified - new: 1.52.12.2 old: 1.52.12.1 path: src/sys/dev/usb/uhcivar.h pathrev: src/sys/dev/usb/uhcivar.h@1.52.12.2 type: modified - new: 1.161.2.3 old: 1.161.2.2 path: src/sys/dev/usb/usbdi.c pathrev: src/sys/dev/usb/usbdi.c@1.161.2.3 type: modified - new: 1.107.4.3 old: 1.107.4.2 path: src/sys/dev/usb/usbdivar.h pathrev: src/sys/dev/usb/usbdivar.h@1.107.4.3 type: modified - new: 1.23.2.8 old: 1.23.2.7 path: src/sys/dev/usb/xhci.c pathrev: src/sys/dev/usb/xhci.c@1.23.2.8 type: modified - new: 1.4.8.2 old: 1.4.8.1 path: src/sys/dev/usb/xhcivar.h pathrev: src/sys/dev/usb/xhcivar.h@1.4.8.2 type: modified - new: 1.31.2.4 old: 1.31.2.3 path: src/sys/external/bsd/dwc2/dwc2.c pathrev: src/sys/external/bsd/dwc2/dwc2.c@1.31.2.4 type: modified id: 20180825T145735Z.74670d9cb5eadff89508cd16829b2a520e06cbde log: "Pull up following revision(s) (requested by mrg in ticket #1632):\n\n\tsys/dev/usb/usbdivar.h: revision 1.117\n\tsys/external/bsd/dwc2/dwc2.c: revision 1.52\n\tsys/dev/usb/xhcivar.h: revision 1.10\n\tsys/dev/usb/motg.c: revision 1.22\n\tsys/dev/usb/ehci.c: revision 1.260\n\tsys/dev/usb/ehci.c: revision 1.261\n\tsys/dev/usb/xhci.c: revision 1.96\n\tsys/dev/usb/ohci.c: revision 1.282\n\tsys/dev/usb/ohci.c: revision 1.283\n\tsys/dev/usb/ehcivar.h: revision 1.45\n\tsys/dev/usb/uhci.c: revision 1.281\n\tsys/dev/usb/uhci.c: revision 1.282\n\tsys/dev/usb/usbdi.c: revision 1.177\n\tsys/dev/usb/ohcivar.h: revision 1.60\n\tsys/dev/usb/uhcivar.h: revision 1.55\n\t(all via patch)\n\npull across abort fixes from nick-nhusb. add more abort fixes, using\nideas from Taylor and Nick, and myself. special thanks to both who\ninspired much of the code here, if not wrote it directly.\n\namong other problems, this assert should no longer trigger:\n\n panic: kernel diagnostic assertion \"xfer->ux_state == XFER_ONQU\" failed: file \"/current/src/sys/dev/usb/usbdi.c\", line 914\n\nusing usbhist i was able to track down my instance of it being related\nto userland close() beginning, dropping the sc_lock, and then the usb\nsoftintr completes the transfer normally, and when it is done, the\nabort path attempts to re-complete the transfer, and the above assert\nis tripped.\n\nchanges from nhusb were commited with these logs:\n--\nMove the struct usb_task to struct usbd_xfer for everyone to use.\n--\nSet device transfer status to USBD_IN_PROGRESS if start methods succeeds\n--\nActually set the transfer status on transfers in ohci_abort_xfer and\nthe controller is dying\n--\nDon't supply the lock to callout_halt when polling as it won't be held\n--\nImprove transfer abort\n--\nMark device transfers as USBD_IN_PROGRESS appropriately and improve\nabort handling\n--\n--\nMark device transfers as USBD_IN_PROGRESS appropriately and improve\nabort handling\n--\n\nadditional changes include:\n- initialise the usb abort task in the HCI allocx routine, so that it\n can be safely usb_rem_task()'d.\n- rework the handling of softintr vs cancellation vs timeout abort based\n upon a scheme from Taylor:\n when completing a transfer normally:\n - if the status is not in progress, it must be cancelled or timed out,\n and we should not process this xfer.\n - set the status as normal.\n - unconditionallly callout_stop() and usb_rem_task(). they're safe and\n either aren't running, or will run and do nothing.\n - finally call usb_transfer_complete().\n when aborting a transfer:\n - status should be cancelled or timed out.\n - if cancelling, callout_halt and usb_rem_task_wait() to make sure the\n timer is either done or cancelled.\n \ - at this point, the ux_status must not be cancelled or timed out, and\n if it is not in progress we're done.\n - set the status.\n - if the controller is dying, just return.\n - perform HCI-specific tasks to abort this xfer.\n - finally call usb_transfer_complete().\n for the timeout and timeout task:\n - if the HCI is not dying, and the ux_status is in progress, then\n trigger the usb abort task.\n- remove UXFER_ABORTWAIT and UXFER_ABORTING.\n\ntested on:\n- multiple PC systems with several types of devices: ugen/UPS, ucom,\n umass with disk, ssd and cdrom backends, kbd, ms, using uhci, ehci\n and xhci.\n- erlite3: sd@umass on dwc2.\n- sunblade2000: kbd/ms and umass disk on ohci.\n\nuntested:\n- motg, slhci and ahci. motg has some portion of the new scheme\n applied, but slhci and ahci require more study.\n\nfuture work includes pushing a lot of the common abort handling into\nusbdi.c and leaving upm_abort() for HC specific tasks, but this change\nis pullup-able to netbsd-7 and netbsd-8 as it does not change any\nexternal API, as well as removing over 100 lines of code while adding\nover 30 new asserts.\n\nXXX: pullup-7, pullup-8.\n\nfix DIAGNOSTIC build by not copying ub_usepolling to stack before use\n\nSprinkle __diagused\n" module: src subject: 'CVS commit: [netbsd-7] src/sys' unixtime: '1535209055' user: martin