1. 11 May, 2010 6 commits
    • Cindy H Kao's avatar
      wimax/i2400m: fix for missed reset events if triggered by dev_reset_handle() · f4e41345
      Cindy H Kao authored
      The problem is only seen on SDIO interface since on USB, a bus reset would
      really re-probe the driver, but on SDIO interface, a bus reset will not
      re-enumerate the SDIO bus, so no driver re-probe is happening. Therefore,
      on SDIO interface, the reset event should be still detected and handled by
      dev_reset_handle().
      
      Problem description:
      Whenever a reboot barker is received during operational mode (i2400m->boot_mode == 0),
      dev_reset_handle() is invoked to handle that function reset event.
      dev_reset_handle() then sets the flag i2400m->boot_mode to 1 indicating the device is
      back to bootmode before proceeding to dev_stop() and dev_start().
      If dev_start() returns failure, a bus reset is triggered by dev_reset_handle().
      
      The flag i2400m->boot_mode then remains 1 when the second reboot barker arrives.
      However the interrupt service routine i2400ms_rx() instead of invoking dev_reset_handle()
      to handle that reset event, it filters out that boot event to bootmode because it sees
      the flag i2400m->boot_mode equal to 1.
      
      The fix:
      Maintain the flag i2400m->boot_mode within dev_reset_handle() and set the flag
      i2400m->boot_mode to 1 when entering dev_reset_handle(). It remains 1
      until the dev_reset_handle() issues a bus reset. ie: the bus reset is
      taking place just like it happens for the first time during operational mode.
      
      To denote the actual device state and the state we expect, a flag i2400m->alive
      is introduced in addition to the existing flag i2400m->updown.
      It's maintained with the same way for i2400m->updown but instead of reflecting
      the actual state like i2400m->updown does, i2400m->alive maintains the state
      we expect. i2400m->alive is set 1 just like whenever i2400m->updown is set 1.
      Yet i2400m->alive remains 1 since we expect the device to be up all the time
      until the driver is removed. See the doc for @alive in i2400m.h.
      
      An enumeration I2400M_BUS_RESET_RETRIES is added to define the maximum number of
      bus resets that a device reboot can retry.
      
      A counter i2400m->bus_reset_retries is added to track how many bus resets
      have been retried in one device reboot. If I2400M_BUS_RESET_RETRIES bus resets
      were retried in this boot, we give up any further retrying so the device would enter
      low power state. The counter i2400m->bus_reset_retries is incremented whenever
      dev_reset_handle() is issuing a bus reset and is cleared to 0 when dev_start() is
      successfully done, ie: a successful reboot.
      Signed-off-by: default avatarCindy H Kao <cindy.h.kao@intel.com>
      f4e41345
    • Cindy H Kao's avatar
      wimax/i2400m: correct the error path handlers in dev_start() · 49d72df3
      Cindy H Kao authored
      This fix is to correct order of the handlers in the error path
      of dev_start(). When i2400m_firmware_check fails, all the works done
      before it should be released or cleared.
      Signed-off-by: default avatarCindy H Kao <cindy.h.kao@intel.com>
      49d72df3
    • Cindy H Kao's avatar
      wimax/i2400m: fix the race condition for accessing TX queue · f22cf689
      Cindy H Kao authored
      The race condition happens when the TX queue is accessed by
      the TX work while the same TX queue is being destroyed because
      a bus reset is triggered either by debugfs entry or simply
      by failing waking up the device from WiMAX IDLE mode.
      
      This fix is to prevent the TX queue from being accessed by
      multiple threads
      Signed-off-by: default avatarCindy H Kao <cindy.h.kao@intel.com>
      f22cf689
    • Prasanna S. Panchamukhi's avatar
      wimax/i2400m: fix insufficient size of Tx buffer for 12 payload of 1400 MTU. · 570eb0ea
      Prasanna S. Panchamukhi authored
      This patch increases the Tx buffer size so as to accommodate 12 payloads
      of 1408 (1400 MTU 16 bytes aligned). Currently Tx buffer is 32 KiB which
      is insufficient to accommodate 12 payloads of 1408 size.
      This patch
       - increases I2400M_TX_BUF_SIZE from 32KiB to 64KiB
       - Adds a BUILD_BUG_ON if the calculated buffer size based
         on the given MTU exceeds the I2400M_TX_BUF_SIZE.
      
      Below is how we calculate the size of the Tx buffer.
      Payload + 4 bytes prefix for each payload (1400 MTU 16 bytes boundary aligned)
      		= (1408 + sizeof(struct i2400m_pl_data_hdr)) * I2400M_TX_PLD_MAX
      Adding 16 byte message header = + sizeof(struct i2400m_msg_hdr)
      Aligning to 256 byte boundary
      Total Tx buffer = (((((1408 + sizeof(struct i2400m_pl_data_hdr))
      		* I2400M_TX_PLD_MAX )+ sizeof(struct i2400m_msg_hdr))
      		/ 256) + 1) * 256 * 2
      Signed-off-by: default avatarPrasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      570eb0ea
    • Prasanna S. Panchamukhi's avatar
      wimax/i2400m: move I2400M_MAX_MTU enum from netdev.c to i2400m.h · 080de04e
      Prasanna S. Panchamukhi authored
      This patch moves I2400M_MAX_MTU enum defined in netdev.c to i2400m.h.
      Follow up changes will make use of this value in other location,
      thus requiring it to be moved to a global header file i2400m.h.
      Signed-off-by: default avatarPrasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      080de04e
    • Prasanna S.Panchamukhi's avatar
      wimax/i2400m: fix incorrect return -ESHUTDOWN when there is no Tx buffer available · 4818d14d
      Prasanna S.Panchamukhi authored
      i2400m_tx() routine was returning -ESHUTDOWN even when there was no Tx buffer
      available. This patch fixes the i2400m_tx() to return -ESHUTDOWN only when
      the device is down(i2400m->tx_buf is NULL) and also to return -ENOSPC
      when there is no Tx buffer. Error seen in the kernel log.
      kernel: i2400m_sdio mmc0:0001:1: can't send message 0x5606: -108
      kernel: i2400m_sdio mmc0:0001:1: Failed to issue 'Enter power save'command: -108
      Signed-off-by: default avatarPrasanna S.Panchamukhi <prasannax.s.panchamukhi@intel.com>
      4818d14d
  2. 10 May, 2010 34 commits