1. 18 Dec, 2020 3 commits
    • Marek Vasut's avatar
      redpine: Move card interrupt handling to RX thread · 4a513b13
      Marek Vasut authored and Angus Ainslie's avatar Angus Ainslie committed
      
      
      The interrupt handling of the RS911x is particularly heavy. For each RX
      packet, the card does three SDIO transactions, one to read interrupt
      status register, one to RX buffer length, one to read the RX packet(s).
      This translates to ~330 uS per one cycle of interrupt handler. In case
      there is more incoming traffic, this will be more.
      
      The drivers/mmc/core/sdio_irq.c has the following comment, quote "Just
      like traditional hard IRQ handlers, we expect SDIO IRQ handlers to be
      quick and to the point, so that the holding of the host lock does not
      cover too much work that doesn't require that lock to be held."
      
      The RS911x interrupt handler does not fit that. This patch therefore
      changes it such that the entire IRQ handler is moved to the RX thread
      instead, and the interrupt handler only wakes the RX thread.
      
      This is OK, because the interrupt handler only does things which can
      also be done in the RX thread, that is, it checks for firmware loading
      error(s), it checks buffer status, it checks whether a packet arrived
      and if so, reads out the packet and passes it to network stack.
      
      Moreover, this change permits removal of a code which allocated an
      skbuff only to get 4-byte-aligned buffer, read up to 8kiB of data
      into the skbuff, queue this skbuff into local private queue, then in
      RX thread, this buffer is dequeued, the data in the skbuff as passed
      to the RSI driver core, and the skbuff is deallocated. All this is
      replaced by directly calling the RSI driver core with local buffer.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      4a513b13
    • Marek Vasut's avatar
      rsi: Fix TX EAPOL packet handling against iwlwifi AP · 4314a27f
      Marek Vasut authored and Angus Ainslie's avatar Angus Ainslie committed
      In case RSI9116 SDIO WiFi operates in STA mode against Intel 9260 in AP mode,
      the association fails. The former is using wpa_supplicant during association,
      the later is set up using hostapd:
      
      iwl$ cat hostapd.conf
      interface=wlp1s0
      ssid=test
      country_code=DE
      hw_mode=g
      channel=1
      wpa=2
      wpa_passphrase=test
      wpa_key_mgmt=WPA-PSK
      iwl$ hostapd -d hostapd.conf
      
      rsi$ wpa_supplicant -i wlan0 -c <(wpa_passphrase test test)
      
      The problem is that the TX EAPOL data descriptor RSI_DESC_REQUIRE_CFM_TO_HOST
      flag and extended descriptor EAPOL4_CONFIRM frame type are not set in case the
      AP is iwlwifi, because in that case the TX EAPOL packet is 2 bytes shorter.
      
      The downstream vendor driver has this change in place already [1], however
      there is no explanation for it, neither is there any commit history from which
      such explanation could be obtained.
      
      [1] https://github.com/SiliconLabs/RS911X-nLink-OSD/blob/master/rsi/rsi_91x_hal.c#L238
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Angus Ainslie <angus@akkea.ca>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Martin Kepplinger <martink@posteo.de>
      Cc: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
      Cc: Siva Rebbagondla <siva8118@gmail.com>
      Cc: linux-wireless@vger.kernel.org
      Cc: netdev@vger.kernel.org
      4314a27f
    • Marek Vasut's avatar
      rsi: Move card interrupt handling to RX thread · 89690a18
      Marek Vasut authored and Angus Ainslie's avatar Angus Ainslie committed
      
      
      The interrupt handling of the RS911x is particularly heavy. For each RX
      packet, the card does three SDIO transactions, one to read interrupt
      status register, one to RX buffer length, one to read the RX packet(s).
      This translates to ~330 uS per one cycle of interrupt handler. In case
      there is more incoming traffic, this will be more.
      
      The drivers/mmc/core/sdio_irq.c has the following comment, quote "Just
      like traditional hard IRQ handlers, we expect SDIO IRQ handlers to be
      quick and to the point, so that the holding of the host lock does not
      cover too much work that doesn't require that lock to be held."
      
      The RS911x interrupt handler does not fit that. This patch therefore
      changes it such that the entire IRQ handler is moved to the RX thread
      instead, and the interrupt handler only wakes the RX thread.
      
      This is OK, because the interrupt handler only does things which can
      also be done in the RX thread, that is, it checks for firmware loading
      error(s), it checks buffer status, it checks whether a packet arrived
      and if so, reads out the packet and passes it to network stack.
      
      Moreover, this change permits removal of a code which allocated an
      skbuff only to get 4-byte-aligned buffer, read up to 8kiB of data
      into the skbuff, queue this skbuff into local private queue, then in
      RX thread, this buffer is dequeued, the data in the skbuff as passed
      to the RSI driver core, and the skbuff is deallocated. All this is
      replaced by directly calling the RSI driver core with local buffer.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Angus Ainslie <angus@akkea.ca>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Martin Kepplinger <martink@posteo.de>
      Cc: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
      Cc: Siva Rebbagondla <siva8118@gmail.com>
      Cc: linux-wireless@vger.kernel.org
      Cc: netdev@vger.kernel.org
      89690a18
  2. 17 Dec, 2020 5 commits
  3. 10 Dec, 2020 1 commit
  4. 02 Dec, 2020 31 commits