€•94Œ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Œ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.”…””}”(hhñhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K hhßubhÉ)”}”(hŒImplementation idea:”h]”hŒImplementation idea:”…””}”(hhÿhž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.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khjubah}”(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.”…””}”(hjDhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khj@ubah}”(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:”…””}”(hj\hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KhjXubhÙ)”}”(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).”…””}”(hjqhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khjmubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjjubhÞ)”}”(hŒ$threaded handler of the device none ”h]”hÉ)”}”(hŒ#threaded handler of the device none”h]”hŒ#threaded handler of the device none”…””}”(hj‰hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K"hj…ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjjubhÞ)”}”(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%hjubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjjubhÞ)”}”(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Ýhjjubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1hØhŸh¶h KhjXubeh}”(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 K3hjñubah}”(h]”h ]”h"]”h$]”h&]”uh1jïhŸ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”jHŒ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”}”(j"jjjuŒ nametypes”}”(j"‰j‰uh}”(jh£jh·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.