linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: zero fill txq->txb on queue reset
@ 2011-02-14 14:33 Stanislaw Gruszka
  2011-02-14 14:53 ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Stanislaw Gruszka @ 2011-02-14 14:33 UTC (permalink / raw)
  To: Wey-Yi Guy, Intel Linux Wireless; +Cc: linux-wireless, Stanislaw Gruszka

We allocate txq->txb area with kzalloc, but when reseting queue
during __iwl_down / __iwl_up we we leave old values, let's zero
initialize in such case as well.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/iwlwifi/iwl-tx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index a8935cd..0c8555c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -418,6 +418,8 @@ void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq,
 
 	if (txq_id == priv->cmd_queue)
 		actual_slots++;
+	else
+		memset(txq->txb, 0, sizeof(txq->txb[0]) * TFD_QUEUE_SIZE_MAX);
 
 	memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * actual_slots);
 
-- 
1.7.1


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

* Re: [PATCH] iwlwifi: zero fill txq->txb on queue reset
  2011-02-14 14:33 [PATCH] iwlwifi: zero fill txq->txb on queue reset Stanislaw Gruszka
@ 2011-02-14 14:53 ` Johannes Berg
  2011-02-14 14:55   ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2011-02-14 14:53 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Wey-Yi Guy, Intel Linux Wireless, linux-wireless

On Mon, 2011-02-14 at 15:33 +0100, Stanislaw Gruszka wrote:
> We allocate txq->txb area with kzalloc, but when reseting queue
> during __iwl_down / __iwl_up we we leave old values, let's zero
> initialize in such case as well.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-tx.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
> index a8935cd..0c8555c 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-tx.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
> @@ -418,6 +418,8 @@ void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq,
>  
>  	if (txq_id == priv->cmd_queue)
>  		actual_slots++;
> +	else
> +		memset(txq->txb, 0, sizeof(txq->txb[0]) * TFD_QUEUE_SIZE_MAX);

I don't mind -- but I think the changelog should say that this isn't
necessary since the device will never use any of those entries?

johannes


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

* Re: [PATCH] iwlwifi: zero fill txq->txb on queue reset
  2011-02-14 14:53 ` Johannes Berg
@ 2011-02-14 14:55   ` Johannes Berg
  2011-02-15 11:39     ` Stanislaw Gruszka
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2011-02-14 14:55 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Wey-Yi Guy, Intel Linux Wireless, linux-wireless

On Mon, 2011-02-14 at 15:53 +0100, Johannes Berg wrote:
> On Mon, 2011-02-14 at 15:33 +0100, Stanislaw Gruszka wrote:
> > We allocate txq->txb area with kzalloc, but when reseting queue
> > during __iwl_down / __iwl_up we we leave old values, let's zero
> > initialize in such case as well.
> > 
> > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> > ---
> >  drivers/net/wireless/iwlwifi/iwl-tx.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
> > index a8935cd..0c8555c 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-tx.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
> > @@ -418,6 +418,8 @@ void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq,
> >  
> >  	if (txq_id == priv->cmd_queue)
> >  		actual_slots++;
> > +	else
> > +		memset(txq->txb, 0, sizeof(txq->txb[0]) * TFD_QUEUE_SIZE_MAX);
> 
> I don't mind -- but I think the changelog should say that this isn't
> necessary since the device will never use any of those entries?

Err, I confused txb and tfds. But it still shouldn't be necessary --
aren't the entries reset to NULL when taken out of use?

johannes


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

* Re: [PATCH] iwlwifi: zero fill txq->txb on queue reset
  2011-02-14 14:55   ` Johannes Berg
@ 2011-02-15 11:39     ` Stanislaw Gruszka
  2011-02-15 11:48       ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Stanislaw Gruszka @ 2011-02-15 11:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Wey-Yi Guy, Intel Linux Wireless, linux-wireless

On Mon, Feb 14, 2011 at 03:55:25PM +0100, Johannes Berg wrote:
> On Mon, 2011-02-14 at 15:53 +0100, Johannes Berg wrote:
> > On Mon, 2011-02-14 at 15:33 +0100, Stanislaw Gruszka wrote:
> > > We allocate txq->txb area with kzalloc, but when reseting queue
> > > during __iwl_down / __iwl_up we we leave old values, let's zero
> > > initialize in such case as well.
> > > 
> > > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> > > ---
> > >  drivers/net/wireless/iwlwifi/iwl-tx.c |    2 ++
> > >  1 files changed, 2 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
> > > index a8935cd..0c8555c 100644
> > > --- a/drivers/net/wireless/iwlwifi/iwl-tx.c
> > > +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
> > > @@ -418,6 +418,8 @@ void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq,
> > >  
> > >  	if (txq_id == priv->cmd_queue)
> > >  		actual_slots++;
> > > +	else
> > > +		memset(txq->txb, 0, sizeof(txq->txb[0]) * TFD_QUEUE_SIZE_MAX);
> > 
> > I don't mind -- but I think the changelog should say that this isn't
> > necessary since the device will never use any of those entries?
> 
> Err, I confused txb and tfds. But it still shouldn't be necessary --
> aren't the entries reset to NULL when taken out of use?

There are memset zero before the use in {iwlagn,iwl3945}_tx_skb(),
so patch is unneeded as well kzalloc in current code (I add replace
to kmalloc to my todo list).

Stanislaw

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

* Re: [PATCH] iwlwifi: zero fill txq->txb on queue reset
  2011-02-15 11:39     ` Stanislaw Gruszka
@ 2011-02-15 11:48       ` Johannes Berg
  2011-02-15 13:06         ` Stanislaw Gruszka
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2011-02-15 11:48 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Wey-Yi Guy, Intel Linux Wireless, linux-wireless

On Tue, 2011-02-15 at 12:39 +0100, Stanislaw Gruszka wrote:

> > > >  	if (txq_id == priv->cmd_queue)
> > > >  		actual_slots++;
> > > > +	else
> > > > +		memset(txq->txb, 0, sizeof(txq->txb[0]) * TFD_QUEUE_SIZE_MAX);
> > > 
> > > I don't mind -- but I think the changelog should say that this isn't
> > > necessary since the device will never use any of those entries?
> > 
> > Err, I confused txb and tfds. But it still shouldn't be necessary --
> > aren't the entries reset to NULL when taken out of use?
> 
> There are memset zero before the use in {iwlagn,iwl3945}_tx_skb(),
> so patch is unneeded as well kzalloc in current code (I add replace
> to kmalloc to my todo list).

Well, don't worry, the change is fine -- I just wanted to understand if
I missed something that made it necessary.

johannes


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

* Re: [PATCH] iwlwifi: zero fill txq->txb on queue reset
  2011-02-15 11:48       ` Johannes Berg
@ 2011-02-15 13:06         ` Stanislaw Gruszka
  0 siblings, 0 replies; 6+ messages in thread
From: Stanislaw Gruszka @ 2011-02-15 13:06 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Wey-Yi Guy, Intel Linux Wireless, linux-wireless

On Tue, Feb 15, 2011 at 12:48:02PM +0100, Johannes Berg wrote:
> On Tue, 2011-02-15 at 12:39 +0100, Stanislaw Gruszka wrote:
> 
> > > > >  	if (txq_id == priv->cmd_queue)
> > > > >  		actual_slots++;
> > > > > +	else
> > > > > +		memset(txq->txb, 0, sizeof(txq->txb[0]) * TFD_QUEUE_SIZE_MAX);
> > > > 
> > > > I don't mind -- but I think the changelog should say that this isn't
> > > > necessary since the device will never use any of those entries?
> > > 
> > > Err, I confused txb and tfds. But it still shouldn't be necessary --
> > > aren't the entries reset to NULL when taken out of use?
> > 
> > There are memset zero before the use in {iwlagn,iwl3945}_tx_skb(),
> > so patch is unneeded as well kzalloc in current code (I add replace
> > to kmalloc to my todo list).
> 
> Well, don't worry, the change is fine -- 

hmm, I think is not, it just add more confusion

Stanislaw

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

end of thread, other threads:[~2011-02-15 13:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-14 14:33 [PATCH] iwlwifi: zero fill txq->txb on queue reset Stanislaw Gruszka
2011-02-14 14:53 ` Johannes Berg
2011-02-14 14:55   ` Johannes Berg
2011-02-15 11:39     ` Stanislaw Gruszka
2011-02-15 11:48       ` Johannes Berg
2011-02-15 13:06         ` Stanislaw Gruszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).