Message ID | 1308774283.29571.24.camel@jlt3.sipsolutions.net (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Wed, 2011-06-22 at 22:24 +0200, Johannes Berg wrote: > Andy, could you try this patch? > > I haven't tested it at all yet, it's kinda late here. Oh, it also requires this patch first: http://git.kernel.org/?p=linux/kernel/git/iwlwifi/iwlwifi-2.6.git;a=commitdiff;h=3d007d90374fe263d9e7982d04217cdcbaceb54c johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Jun 22, 2011 at 2:24 PM, Johannes Berg <johannes@sipsolutions.net> wrote: > Andy, could you try this patch? > > I haven't tested it at all yet, it's kinda late here. > > johannes > > iwlagn: map command buffers BIDI Works for me. Tested-by: Andy Lutomirski <luto@mit.edu> Thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, 2011-06-24 at 09:13 -0600, Andrew Lutomirski wrote: > On Wed, Jun 22, 2011 at 2:24 PM, Johannes Berg > <johannes@sipsolutions.net> wrote: > > Andy, could you try this patch? > > > > I haven't tested it at all yet, it's kinda late here. > Works for me. > > Tested-by: Andy Lutomirski <luto@mit.edu> Thanks Andrew, Kyle. I don't pretend to understand what the device is doing, but for now I guess we'll keep this and I'll try to figure out independently why this happens. johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c 2011-06-22 22:19:35.000000000 +0200 +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c 2011-06-22 22:21:48.000000000 +0200 @@ -126,7 +126,7 @@ static inline u8 iwl_tfd_get_num_tbs(str } static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta, - struct iwl_tfd *tfd) + struct iwl_tfd *tfd, enum dma_data_direction dma_dir) { int i; int num_tbs; @@ -150,7 +150,7 @@ static void iwlagn_unmap_tfd(struct iwl_ /* Unmap chunks, if any. */ for (i = 1; i < num_tbs; i++) dma_unmap_single(priv->bus.dev, iwl_tfd_tb_get_addr(tfd, i), - iwl_tfd_tb_get_len(tfd, i), DMA_TO_DEVICE); + iwl_tfd_tb_get_len(tfd, i), dma_dir); } /** @@ -166,7 +166,8 @@ void iwlagn_txq_free_tfd(struct iwl_priv struct iwl_tfd *tfd_tmp = txq->tfds; int index = txq->q.read_ptr; - iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index]); + iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index], + DMA_TO_DEVICE); /* free SKB */ if (txq->txb) { @@ -309,7 +310,8 @@ void iwl_cmd_queue_unmap(struct iwl_priv i = get_cmd_index(q, q->read_ptr); if (txq->meta[i].flags & CMD_MAPPED) { - iwlagn_unmap_tfd(priv, &txq->meta[i], &txq->tfds[i]); + iwlagn_unmap_tfd(priv, &txq->meta[i], &txq->tfds[i], + DMA_BIDIRECTIONAL); txq->meta[i].flags = 0; } @@ -691,10 +693,11 @@ int iwl_enqueue_hcmd(struct iwl_priv *pr if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)) continue; phys_addr = dma_map_single(priv->bus.dev, (void *)cmd->data[i], - cmd->len[i], DMA_TO_DEVICE); + cmd->len[i], DMA_BIDIRECTIONAL); if (dma_mapping_error(priv->bus.dev, phys_addr)) { iwlagn_unmap_tfd(priv, out_meta, - &txq->tfds[q->write_ptr]); + &txq->tfds[q->write_ptr], + DMA_BIDIRECTIONAL); idx = -ENOMEM; goto out; } @@ -798,7 +801,7 @@ void iwl_tx_cmd_complete(struct iwl_priv cmd = txq->cmd[cmd_index]; meta = &txq->meta[cmd_index]; - iwlagn_unmap_tfd(priv, meta, &txq->tfds[index]); + iwlagn_unmap_tfd(priv, meta, &txq->tfds[index], DMA_BIDIRECTIONAL); /* Input error checking is done when commands are added to queue. */ if (meta->flags & CMD_WANT_SKB) {