1. 29 11月, 2021 20 次提交
  2. 27 11月, 2021 11 次提交
  3. 26 11月, 2021 9 次提交
    • A
      net: ipa: support enhanced channel flow control · fe68c43c
      Alex Elder 提交于
      IPA v4.2 introduced GSI channel flow control, used instead of IPA
      endpoint DELAY mode to prevent a TX channel from injecting packets
      into the IPA core.  It used a new FLOW_CONTROLLED channel state
      which could be entered using GSI generic commands.
      
      IPA v4.11 extended the channel flow control model.  Rather than
      having a distinct FLOW_CONTROLLED channel state, each channel has a
      "flow control" property that can be enabled or not--independent of
      the channel state.  The AP (or modem) can modify this property using
      the same GSI generic commands as before.
      
      The AP only uses channel flow control on modem TX channels, and only
      when recovering from a modem crash.  The AP has no way to discover
      the state of a modem channel, so the fact that (starting with IPA
      v4.11) flow control no longer uses a distinct channel state is
      invisible to the AP.  So enhanced flow control generally does not
      change the way AP uses flow control.
      
      There are a few small differences, however:
        - There is a notion of "primary" or "secondary" flow control, and
          when enabling or disabling flow control that must be specified
          in a new field in the GSI generic command register.  For now, we
          always specify 0 (meaning "primary").
        - When disabling flow control, it's possible a request will need
          to be retried.  We retry up to 5 times in this case.
        - Another new generic command allows the current flow control
          state to be queried.  We do not use this.
      
      Other than the need for retries, the code essentially works the same
      way as before.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      fe68c43c
    • A
      net: ipa: introduce channel flow control · 4c9d631a
      Alex Elder 提交于
      One quirk for certain versions of IPA is that endpoint DELAY mode
      does not work properly.  IPA DELAY mode prevents any packets from
      being delivered to the IPA core for processing on a TX endpoint.
      The AP uses DELAY mode when the modem crashes, to prevent modem TX
      endpoints from generating traffic during crash recovery.  Without
      this, there is a chance the hardware will stall during recovery from
      a modem crash.
      
      To achieve a similar effect, a GSI FLOW_CONTROLLED channel state
      was created.  A STARTED TX channel can be placed in FLOW_CONTROLLED
      state, which prevents the transfer of any more packets.  A channel
      in FLOW_CONTROLLED state can be either returned to STARTED state, or
      can be transitioned to STOPPED state.
      
      Because this operates on GSI channels, two generic commands were
      added to allow the AP to control this state for modem channels
      (similar to the ALLOCATE and HALT channel commands).
      
      Previously the code assumed this quirk only applied to IPA v4.2.
      In fact, channel flow control (rather than endpoint DELAY mode)
      should be used for all versions *starting* with IPA v4.2.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4c9d631a
    • J
      mctp: serial: remove unnecessary ldisc data check · d1c99f36
      Jeremy Kerr 提交于
      Jiri assures me that a ldisc->open with tty->disc_data set should never
      happen, so this check doesn't do anything.
      Reported-by: NJiri Slaby <jirislaby@kernel.org>
      Signed-off-by: NJeremy Kerr <jk@codeconstruct.com.au>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      d1c99f36
    • J
      mctp: serial: enforce fixed MTU · d154cd07
      Jeremy Kerr 提交于
      The current serial driver requires a maximum MTU of 68, and it doesn't
      make sense to set a MTU below the MCTP-required baseline (of 68) either.
      
      This change sets the min_mtu & max_mtu of the mctp netdev, essentially
      disallowing changes. By using these instead of a ndo_change_mtu op, we
      get the netlink extacks reported too.
      Signed-off-by: NJeremy Kerr <jk@codeconstruct.com.au>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      d154cd07
    • J
      mctp: serial: cancel tx work on ldisc close · 7bd9890f
      Jeremy Kerr 提交于
      We want to ensure that the tx work has finished before returning from
      the ldisc close op, so do a synchronous cancel.
      Reported-by: NJiri Slaby <jirislaby@kernel.org>
      Signed-off-by: NJeremy Kerr <jk@codeconstruct.com.au>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      7bd9890f
    • A
      net: ipa: rearrange GSI structure fields · faa88ece
      Alex Elder 提交于
      The dummy net_device is a large field in the GSI structure, but it
      is not at all interesting from the perspective of debugging.  Move
      it to the end of the GSI structure so the other fields are easier to
      find in memory.
      
      The channel and event ring arrays are also very large, so move them
      near the end of the structure as well.
      
      Swap the position of the result and completion fields to improve
      structure packing.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      faa88ece
    • A
      net: ipa: GSI only needs one completion · 7ece9eaa
      Alex Elder 提交于
      A mutex ensures we never submit more than one GSI command of any
      kind at once.  This means the per-channel and per-event ring
      completion structures provide no benefit.  Instead, just use the
      single (existing) GSI completion to signal the completion of GSI
      commands of all types.
      
      This makes gsi_evt_ring_init() a trivial function with no inverse,
      so open-code it in its sole caller and get rid of the function.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      7ece9eaa
    • A
      net: ipa: skip SKB copy if no netdev · 1b65bbcc
      Alex Elder 提交于
      In ipa_endpoint_skb_copy(), a new socket buffer structure is
      allocated so that some data can be copied into it.  However, after
      doing this, if the endpoint has a null netdev pointer, we just drop
      free the socket buffer.
      
      Instead, check endpoint->netdev pointer first, and just return early
      if it's null.  Also return early if the SKB allocation fails, to
      avoid the deeper indentation in the normal path.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      1b65bbcc
    • A
      net: ipa: explicitly disable HOLB drop during setup · 01c36637
      Alex Elder 提交于
      During setup, ipa_endpoint_program() programs each endpoint with
      various configuration parameters.  One of those registers defines
      whether to drop packets when a head-of-line blocking condition is
      detected on an RX endpoint.  We currently assume this is disabled;
      instead, explicitly set it to be disabled.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      01c36637