All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ath6kl: Fix SDIO broken scatter hif-scatter
@ 2015-11-06  8:42 Robert Deliën
  2015-11-06 14:13 ` Robert Deliën
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Robert Deliën @ 2015-11-06  8:42 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

This patch fixes broken hif-scatter in ath6kl SDIO. It is not my work; I have found it as a difference between two Digi distributed Kernel source trees. No commit comment was recorded. I am sure there are better/nicer/cleaner way, but copying it as I found it is yet another difference less in the future. Feel free to use it in any way you see fit.

Signed-off-by: Robert Delien <robert@delien.nl>


Index: drivers/net/wireless/ath/ath6kl/sdio.c
===================================================================
--- drivers/net/wireless/ath/ath6kl/sdio.c	(revision 715)
+++ drivers/net/wireless/ath/ath6kl/sdio.c	(revision 716)
@@ -222,6 +222,7 @@
 					struct mmc_data *data)
 {
 	struct scatterlist *sg;
+	struct hif_scatter_item *scat_list;
 	int i;
 
 	data->blksz = HIF_MBOX_BLOCK_SIZE;
@@ -240,14 +241,14 @@
 	sg = scat_req->sgentries;
 	sg_init_table(sg, scat_req->scat_entries);
 
+	scat_list = &scat_req->scat_list[0];
+
 	/* assemble SG list */
-	for (i = 0; i < scat_req->scat_entries; i++, sg++) {
+	for (i = 0; i < scat_req->scat_entries; i++, sg++, scat_list++) {
 		ath6kl_dbg(ATH6KL_DBG_SCATTER, "%d: addr:0x%p, len:%d\n",
-			   i, scat_req->scat_list[i].buf,
-			   scat_req->scat_list[i].len);
+			   i, scat_list->buf, scat_list->len);
 
-		sg_set_buf(sg, scat_req->scat_list[i].buf,
-			   scat_req->scat_list[i].len);
+		sg_set_buf(sg, scat_list->buf, scat_list->len);
 	}
 
 	/* set scatter-gather table for request */
@@ -348,7 +349,7 @@
 	int i, scat_req_sz, scat_list_sz, sg_sz, buf_sz;
 	u8 *virt_buf;
 
-	scat_list_sz = (n_scat_entry - 1) * sizeof(struct hif_scatter_item);
+	scat_list_sz = n_scat_entry * sizeof(struct hif_scatter_item);
 	scat_req_sz = sizeof(*s_req) + scat_list_sz;
 
 	if (!virt_scat)
Index: drivers/net/wireless/ath/ath6kl/hif.h
===================================================================
--- drivers/net/wireless/ath/ath6kl/hif.h	(revision 715)
+++ drivers/net/wireless/ath/ath6kl/hif.h	(revision 716)
@@ -197,9 +197,9 @@
 	/* bounce buffer for upper layers to copy to/from */
 	u8 *virt_dma_buf;
 
-	struct hif_scatter_item scat_list[1];
+	u32 scat_q_depth;
 
-	u32 scat_q_depth;
+	struct hif_scatter_item scat_list[0];
 };
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] ath6kl: Fix SDIO broken scatter hif-scatter
  2015-11-06  8:42 [PATCH 1/1] ath6kl: Fix SDIO broken scatter hif-scatter Robert Deliën
@ 2015-11-06 14:13 ` Robert Deliën
  2016-03-16 23:16 ` Julian Calaby
  2016-06-20 20:04 ` [1/1] " Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Robert Deliën @ 2015-11-06 14:13 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

I have found the original post of this patch:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-November/210624.html
So all credits go to the original author, Jason Liu.

After reading Kalle's comments, I have isolated the cause of my problem and it turns out to be the major bug in drivers/net/wireless/ath/ath6kl/hif.h, causing hif_scatter_item scat_list to corrupt scat_q_depth. At bit unfortunate that this fix wasn't taken in...

Even though I am using GCC 4.8.1, I'm probably not stressing the target hard enough to require the work-around in drivers/net/wireless/ath/ath6kl/sdio.c


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] ath6kl: Fix SDIO broken scatter hif-scatter
  2015-11-06  8:42 [PATCH 1/1] ath6kl: Fix SDIO broken scatter hif-scatter Robert Deliën
  2015-11-06 14:13 ` Robert Deliën
@ 2016-03-16 23:16 ` Julian Calaby
  2016-06-20 20:04 ` [1/1] " Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Julian Calaby @ 2016-03-16 23:16 UTC (permalink / raw)
  To: Robert Deliën, kvalo; +Cc: linux-wireless

Hi Robert,

On Fri, Nov 6, 2015 at 7:42 PM, Robert Deliën <robert@delien.nl> wrote:
> This patch fixes broken hif-scatter in ath6kl SDIO. It is not my work; I have found it as a difference between two Digi distributed Kernel source trees. No commit comment was recorded. I am sure there are better/nicer/cleaner way, but copying it as I found it is yet another difference less in the future. Feel free to use it in any way you see fit.
>
> Signed-off-by: Robert Delien <robert@delien.nl>

Did you ever re-send this patch? It looks like a fairly important fix
and was never applied.

Thanks,

Julian Calaby

>
>
> Index: drivers/net/wireless/ath/ath6kl/sdio.c
> ===================================================================
> --- drivers/net/wireless/ath/ath6kl/sdio.c      (revision 715)
> +++ drivers/net/wireless/ath/ath6kl/sdio.c      (revision 716)
> @@ -222,6 +222,7 @@
>                                         struct mmc_data *data)
>  {
>         struct scatterlist *sg;
> +       struct hif_scatter_item *scat_list;
>         int i;
>
>         data->blksz = HIF_MBOX_BLOCK_SIZE;
> @@ -240,14 +241,14 @@
>         sg = scat_req->sgentries;
>         sg_init_table(sg, scat_req->scat_entries);
>
> +       scat_list = &scat_req->scat_list[0];
> +
>         /* assemble SG list */
> -       for (i = 0; i < scat_req->scat_entries; i++, sg++) {
> +       for (i = 0; i < scat_req->scat_entries; i++, sg++, scat_list++) {
>                 ath6kl_dbg(ATH6KL_DBG_SCATTER, "%d: addr:0x%p, len:%d\n",
> -                          i, scat_req->scat_list[i].buf,
> -                          scat_req->scat_list[i].len);
> +                          i, scat_list->buf, scat_list->len);
>
> -               sg_set_buf(sg, scat_req->scat_list[i].buf,
> -                          scat_req->scat_list[i].len);
> +               sg_set_buf(sg, scat_list->buf, scat_list->len);
>         }
>
>         /* set scatter-gather table for request */
> @@ -348,7 +349,7 @@
>         int i, scat_req_sz, scat_list_sz, sg_sz, buf_sz;
>         u8 *virt_buf;
>
> -       scat_list_sz = (n_scat_entry - 1) * sizeof(struct hif_scatter_item);
> +       scat_list_sz = n_scat_entry * sizeof(struct hif_scatter_item);
>         scat_req_sz = sizeof(*s_req) + scat_list_sz;
>
>         if (!virt_scat)
> Index: drivers/net/wireless/ath/ath6kl/hif.h
> ===================================================================
> --- drivers/net/wireless/ath/ath6kl/hif.h       (revision 715)
> +++ drivers/net/wireless/ath/ath6kl/hif.h       (revision 716)
> @@ -197,9 +197,9 @@
>         /* bounce buffer for upper layers to copy to/from */
>         u8 *virt_dma_buf;
>
> -       struct hif_scatter_item scat_list[1];
> +       u32 scat_q_depth;
>
> -       u32 scat_q_depth;
> +       struct hif_scatter_item scat_list[0];
>  };
>
> --
> 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



-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [1/1] ath6kl: Fix SDIO broken scatter hif-scatter
  2015-11-06  8:42 [PATCH 1/1] ath6kl: Fix SDIO broken scatter hif-scatter Robert Deliën
  2015-11-06 14:13 ` Robert Deliën
  2016-03-16 23:16 ` Julian Calaby
@ 2016-06-20 20:04 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2016-06-20 20:04 UTC (permalink / raw)
  To: Robert Deliën; +Cc: linux-wireless, kvalo

Robert Deliën wrote:

> This patch fixes broken hif-scatter in ath6kl SDIO. It is not my work; I have
> found it as a difference between two Digi distributed Kernel source trees. No
> commit comment was recorded. I am sure there are better/nicer/cleaner way,
> but copying it as I found it is yet another difference less in the future.
> Feel free to use it in any way you see fit.

Robert told me privately that this is fixed in latest versions. The patch has
been dropped.

-- 
Sent by pwcli
https://patchwork.kernel.org/patch/7567481/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-20 20:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06  8:42 [PATCH 1/1] ath6kl: Fix SDIO broken scatter hif-scatter Robert Deliën
2015-11-06 14:13 ` Robert Deliën
2016-03-16 23:16 ` Julian Calaby
2016-06-20 20:04 ` [1/1] " Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.