All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Chuang <yhchuang@realtek.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: "kvalo@codeaurora.org" <kvalo@codeaurora.org>,
	"Larry.Finger@lwfinger.net" <Larry.Finger@lwfinger.net>,
	Pkshih <pkshih@realtek.com>, Andy Huang <tehuang@realtek.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [RFC v2 06/12] rtw88: fw and efuse files
Date: Fri, 5 Oct 2018 09:19:31 +0000	[thread overview]
Message-ID: <F7CD281DE3E379468C6D07993EA72F84D172A29B@RTITMBSVM01.realtek.com.tw> (raw)
In-Reply-To: <20181004104929.GA16819@redhat.com>



> -----Original Message-----
> From: Stanislaw Gruszka [mailto:sgruszka@redhat.com]
> Sent: Thursday, October 04, 2018 6:50 PM
> To: Tony Chuang
> Cc: kvalo@codeaurora.org; Larry.Finger@lwfinger.net; Pkshih; Andy Huang;
> linux-wireless@vger.kernel.org
> Subject: Re: [RFC v2 06/12] rtw88: fw and efuse files
> 
> Hi
> 
> On Wed, Oct 03, 2018 at 04:02:22PM +0800, yhchuang@realtek.com wrote:
> > +void rtw_fw_do_iqk(struct rtw_dev *rtwdev, struct rtw_iqk_para *para)
> > +{
> > +	u8 h2c_pkt[H2C_PKT_SIZE] = {0};
> 
> Not sure if '= {0}' work as expected for arrays, you
> want to nulify first byte or whole h2c_pkt ?

I want to nullify the whole h2c_pkt.
And I think it works as expected.

> 
> > +void rtw_add_rsvd_page(struct rtw_dev *rtwdev, enum
> rtw_rsvd_packet_type type,
> > +		       bool txdesc)
> > +{
> > +	struct rtw_rsvd_page *rsvd_pkt;
> > +
> > +	list_for_each_entry(rsvd_pkt, &rtwdev->rsvd_page_list, list) {
> > +		if (rsvd_pkt->type == type)
> > +			return;
> > +	}
> > +
> > +	rsvd_pkt = kmalloc(sizeof(*rsvd_pkt),
> > +			   in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
> 
> It's never called from interrupt. You have to check kmalloc output value.
> 

OK, it's better.

> > +	rsvd_pkt->type = type;
> > +	rsvd_pkt->add_txdesc = txdesc;
> > +	list_add_tail(&rsvd_pkt->list, &rtwdev->rsvd_page_list);
> <snip>
> > +
> > +void rtw_reset_rsvd_page(struct rtw_dev *rtwdev)
> > +{
> > +	struct rtw_rsvd_page *rsvd_pkt, *tmp;
> > +
> > +	list_for_each_entry_safe(rsvd_pkt, tmp, &rtwdev->rsvd_page_list, list) {
> > +		if (rsvd_pkt->type == RSVD_BEACON)
> > +			continue;
> > +		list_del(&rsvd_pkt->list);
> > +		kfree(rsvd_pkt);
> > +	}
> 
> It also not clear how the list is protected agains concurrent access.
> However seems like much simpler solution would be use array instead of
> the list. For example above code could be replaced by:


It should be protected bu rtwdev->mutex, but indeed it is not clear
Would have to add lockdep for it.


> 
> for (i = RSVD_BEACON + 1; i <= RSVD_QOS_NULL ; i++) {
> 	kfree(rwdev->rsvd_page_arr[i]));
> 	rsvd_page_arr[i] = NULL;
> }
> 
> And other operations like adding / removing / checking if present could
> be simplified as well.
> 
> Also RSVD_PROBE_RESP page is never created.

RSVD_PROBE_RESP will be used for AP/GO mode,
so I think I might leave it here.

And change rsvd_list to array is not a good idea if there is more than
one interfaces running. For this case will need to download more rsvd
packets, and the order can be changed. Array seems not enough to
handle that.

> 
> > +	*size = (total_page - 1) * page_size + page_margin;
> > +	buf = kzalloc(*size, GFP_KERNEL | GFP_ATOMIC);
> 
> Those GPF flags contradict to each other :-)
> and buf not checked agains NULL.

fixed

> 
> Thanks
> Stanislaw
> 

Thanks
Yan-Hsuan Chuang

  reply	other threads:[~2018-10-05  9:19 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03  8:02 [RFC v2 00/12] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips yhchuang
2018-10-03  8:02 ` [RFC v2 01/12] rtw88: main files yhchuang
2018-10-03  8:02 ` [RFC v2 02/12] rtw88: core files yhchuang
2018-10-04 11:42   ` Stanislaw Gruszka
2018-10-04 13:52     ` Stanislaw Gruszka
2018-10-08  8:22     ` Tony Chuang
2018-10-03  8:02 ` [RFC v2 03/12] rtw88: hci files yhchuang
2018-10-04 13:02   ` Stanislaw Gruszka
2018-10-04 13:25     ` Stanislaw Gruszka
2018-10-05 12:07     ` Tony Chuang
2018-10-06 12:29       ` Kalle Valo
2018-10-08  9:03         ` Tony Chuang
2018-10-08  9:34       ` Stanislaw Gruszka
2019-03-25 14:33         ` Brian Norris
2018-10-03  8:02 ` [RFC v2 04/12] rtw88: trx files yhchuang
2018-10-04 13:19   ` Stanislaw Gruszka
2018-10-05  9:20     ` Tony Chuang
2018-10-06 12:32       ` Kalle Valo
2018-10-08  9:19         ` Stanislaw Gruszka
2018-10-08  9:35           ` Tony Chuang
2018-10-08  9:25       ` Stanislaw Gruszka
2018-10-03  8:02 ` [RFC v2 05/12] rtw88: mac files yhchuang
2018-10-03  8:02 ` [RFC v2 06/12] rtw88: fw and efuse files yhchuang
2018-10-04 10:49   ` Stanislaw Gruszka
2018-10-05  9:19     ` Tony Chuang [this message]
2018-10-08  9:15       ` Stanislaw Gruszka
2018-10-06 12:34     ` Kalle Valo
2018-10-03  8:02 ` [RFC v2 07/12] rtw88: phy files yhchuang
2018-10-03  8:02 ` [RFC v2 08/12] rtw88: debug files yhchuang
2018-10-03  8:02 ` [RFC v2 09/12] rtw88: chip files yhchuang
2018-10-03  8:02 ` [RFC v2 10/12] rtw88: 8822B init table yhchuang
2018-10-03  8:02 ` [RFC v2 11/12] rtw88: 8822C " yhchuang
2018-10-03  8:02 ` [RFC v2 12/12] rtw88: Kconfig & Makefile yhchuang
2018-10-03 16:15 ` [RFC v2 00/12] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips Sid Hayn
2018-10-03 16:52   ` Larry Finger
2018-10-03 16:57     ` Sid Hayn
2018-10-03 17:38       ` Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F7CD281DE3E379468C6D07993EA72F84D172A29B@RTITMBSVM01.realtek.com.tw \
    --to=yhchuang@realtek.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=sgruszka@redhat.com \
    --cc=tehuang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.