€•5Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ/translations/zh_CN/usb/dwc3”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/zh_TW/usb/dwc3”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/it_IT/usb/dwc3”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/ja_JP/usb/dwc3”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/ko_KR/usb/dwc3”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/pt_BR/usb/dwc3”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/sp_SP/usb/dwc3”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ DWC3 driver”h]”hŒ DWC3 driver”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ6/var/lib/git/docbuild/linux/Documentation/usb/dwc3.rst”h´Kubh¶)”}”(hhh]”(h»)”}”(hŒTODO”h]”hŒTODO”…””}”(hhÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhËh²hh³hÊh´KubhŒ paragraph”“”)”}”(hŒ&Please pick something while reading :)”h]”hŒ&Please pick something while reading :)”…””}”(hhÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hhËh²hubhŒ bullet_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hXÀConvert interrupt handler to per-ep-thread-irq As it turns out some DWC3-commands ~1ms to complete. Currently we spin until the command completes which is bad. Implementation idea: - dwc core implements a demultiplexing irq chip for interrupts per endpoint. The interrupt numbers are allocated during probe and belong to the device. If MSI provides per-endpoint interrupt this dummy interrupt chip can be replaced with "real" interrupts. - interrupts are requested / allocated on usb_ep_enable() and removed on usb_ep_disable(). Worst case are 32 interrupts, the lower limit is two for ep0/1. - dwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout() until the command completes. - the interrupt handler is split into the following pieces: - primary handler of the device goes through every event and calls generic_handle_irq() for event it. On return from generic_handle_irq() in acknowledges the event counter so interrupt goes away (eventually). - threaded handler of the device none - primary handler of the EP-interrupt reads the event and tries to process it. Everything that requires sleeping is handed over to the Thread. The event is saved in an per-endpoint data-structure. We probably have to pay attention not to process events once we handed something to thread so we don't process event X prio Y where X > Y. - threaded handler of the EP-interrupt handles the remaining EP work which might sleep such as waiting for command completion. Latency: There should be no increase in latency since the interrupt-thread has a high priority and will be run before an average task in user land (except the user changed priorities).”h]”(hÝ)”}”(hŒ.Convert interrupt handler to per-ep-thread-irq”h]”hŒ.Convert interrupt handler to per-ep-thread-irq”…””}”(hh÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hhóubhÝ)”}”(hŒpAs it turns out some DWC3-commands ~1ms to complete. Currently we spin until the command completes which is bad.”h]”hŒpAs it turns out some DWC3-commands ~1ms to complete. Currently we spin until the command completes which is bad.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hhóubhÝ)”}”(hŒImplementation idea:”h]”hŒImplementation idea:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khhóubhí)”}”(hhh]”(hò)”}”(hŒþdwc core implements a demultiplexing irq chip for interrupts per endpoint. The interrupt numbers are allocated during probe and belong to the device. If MSI provides per-endpoint interrupt this dummy interrupt chip can be replaced with "real" interrupts.”h]”hÝ)”}”(hŒþdwc core implements a demultiplexing irq chip for interrupts per endpoint. The interrupt numbers are allocated during probe and belong to the device. If MSI provides per-endpoint interrupt this dummy interrupt chip can be replaced with "real" interrupts.”h]”hXdwc core implements a demultiplexing irq chip for interrupts per endpoint. The interrupt numbers are allocated during probe and belong to the device. If MSI provides per-endpoint interrupt this dummy interrupt chip can be replaced with “real†interrupts.”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj$ubah}”(h]”h ]”h"]”h$]”h&]”uh1hñhj!ubhò)”}”(hŒ˜interrupts are requested / allocated on usb_ep_enable() and removed on usb_ep_disable(). Worst case are 32 interrupts, the lower limit is two for ep0/1.”h]”hÝ)”}”(hŒ˜interrupts are requested / allocated on usb_ep_enable() and removed on usb_ep_disable(). Worst case are 32 interrupts, the lower limit is two for ep0/1.”h]”hŒ˜interrupts are requested / allocated on usb_ep_enable() and removed on usb_ep_disable(). Worst case are 32 interrupts, the lower limit is two for ep0/1.”…””}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khj<ubah}”(h]”h ]”h"]”h$]”h&]”uh1hñhj!ubhò)”}”(hŒbdwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout() until the command completes.”h]”hÝ)”}”(hŒbdwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout() until the command completes.”h]”hŒbdwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout() until the command completes.”…””}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhjTubah}”(h]”h ]”h"]”h$]”h&]”uh1hñhj!ubhò)”}”(hXthe interrupt handler is split into the following pieces: - primary handler of the device goes through every event and calls generic_handle_irq() for event it. On return from generic_handle_irq() in acknowledges the event counter so interrupt goes away (eventually). - threaded handler of the device none - primary handler of the EP-interrupt reads the event and tries to process it. Everything that requires sleeping is handed over to the Thread. The event is saved in an per-endpoint data-structure. We probably have to pay attention not to process events once we handed something to thread so we don't process event X prio Y where X > Y. - threaded handler of the EP-interrupt handles the remaining EP work which might sleep such as waiting for command completion. ”h]”(hÝ)”}”(hŒ9the interrupt handler is split into the following pieces:”h]”hŒ9the interrupt handler is split into the following pieces:”…””}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khjlubhí)”}”(hhh]”(hò)”}”(hŒÏprimary handler of the device goes through every event and calls generic_handle_irq() for event it. On return from generic_handle_irq() in acknowledges the event counter so interrupt goes away (eventually). ”h]”hÝ)”}”(hŒÎprimary handler of the device goes through every event and calls generic_handle_irq() for event it. On return from generic_handle_irq() in acknowledges the event counter so interrupt goes away (eventually).”h]”hŒÎprimary handler of the device goes through every event and calls generic_handle_irq() for event it. On return from generic_handle_irq() in acknowledges the event counter so interrupt goes away (eventually).”…””}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1hñhj~ubhò)”}”(hŒ$threaded handler of the device none ”h]”hÝ)”}”(hŒ#threaded handler of the device none”h]”hŒ#threaded handler of the device none”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K"hj™ubah}”(h]”h ]”h"]”h$]”h&]”uh1hñhj~ubhò)”}”(hXNprimary handler of the EP-interrupt reads the event and tries to process it. Everything that requires sleeping is handed over to the Thread. The event is saved in an per-endpoint data-structure. We probably have to pay attention not to process events once we handed something to thread so we don't process event X prio Y where X > Y. ”h]”hÝ)”}”(hXMprimary handler of the EP-interrupt reads the event and tries to process it. Everything that requires sleeping is handed over to the Thread. The event is saved in an per-endpoint data-structure. We probably have to pay attention not to process events once we handed something to thread so we don't process event X prio Y where X > Y.”h]”hXOprimary handler of the EP-interrupt reads the event and tries to process it. Everything that requires sleeping is handed over to the Thread. The event is saved in an per-endpoint data-structure. We probably have to pay attention not to process events once we handed something to thread so we don’t process event X prio Y where X > Y.”…””}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K%hj±ubah}”(h]”h ]”h"]”h$]”h&]”uh1hñhj~ubhò)”}”(hŒ}threaded handler of the EP-interrupt handles the remaining EP work which might sleep such as waiting for command completion. ”h]”hÝ)”}”(hŒ|threaded handler of the EP-interrupt handles the remaining EP work which might sleep such as waiting for command completion.”h]”hŒ|threaded handler of the EP-interrupt handles the remaining EP work which might sleep such as waiting for command completion.”…””}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K-hjÉubah}”(h]”h ]”h"]”h$]”h&]”uh1hñhj~ubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1hìh³hÊh´Khjlubeh}”(h]”h ]”h"]”h$]”h&]”uh1hñhj!ubeh}”(h]”h ]”h"]”h$]”h&]”jçjèuh1hìh³hÊh´KhhóubhÝ)”}”(hŒLatency:”h]”hŒLatency:”…””}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K1hhóubhŒ block_quote”“”)”}”(hŒ¯There should be no increase in latency since the interrupt-thread has a high priority and will be run before an average task in user land (except the user changed priorities).”h]”hÝ)”}”(hŒ¯There should be no increase in latency since the interrupt-thread has a high priority and will be run before an average task in user land (except the user changed priorities).”h]”hŒ¯There should be no increase in latency since the interrupt-thread has a high priority and will be run before an average task in user land (except the user changed priorities).”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K3hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K3hhóubeh}”(h]”h ]”h"]”h$]”h&]”uh1hñhhîh²hh³hÊh´Nubah}”(h]”h ]”h"]”h$]”h&]”jçjèuh1hìh³hÊh´K hhËh²hubeh}”(h]”Œtodo”ah ]”h"]”Œtodo”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubeh}”(h]”Œ dwc3-driver”ah ]”h"]”Œ dwc3 driver”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j\Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j6j3j.j+uŒ nametypes”}”(j6‰j.‰uh}”(j3h·j+hËuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.