lkml.org 
[lkml]   [2021]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectnet/mac80211/scan.c:653:12: warning: stack frame size of 2176 bytes in function '__ieee80211_start_scan'
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 17ae69aba89dbfa2139b7f8024b757ab3cc42f59
commit: c8cb5b854b40f2ce52ccd032fa19750f4181d5fc nl80211/cfg80211: support 6 GHz scanning
date: 7 months ago
config: powerpc64-randconfig-r026-20210430 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8f5a2a5836cc8e4c1def2bdeb022e7b496623439)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c8cb5b854b40f2ce52ccd032fa19750f4181d5fc
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout c8cb5b854b40f2ce52ccd032fa19750f4181d5fc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

net/mac80211/scan.c:1001:6: warning: stack frame size of 2080 bytes in function 'ieee80211_scan_work' [-Wframe-larger-than=]
void ieee80211_scan_work(struct work_struct *work)
^
>> net/mac80211/scan.c:653:12: warning: stack frame size of 2176 bytes in function '__ieee80211_start_scan' [-Wframe-larger-than=]
static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
^
2 warnings generated.


vim +/__ieee80211_start_scan +653 net/mac80211/scan.c

8a690674e0601e Ben Greear 2012-04-17 652
f3b85252f08158 Johannes Berg 2009-04-23 @653 static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
f3b85252f08158 Johannes Berg 2009-04-23 654 struct cfg80211_scan_request *req)
f3b85252f08158 Johannes Berg 2009-04-23 655 {
f3b85252f08158 Johannes Berg 2009-04-23 656 struct ieee80211_local *local = sdata->local;
e9da68ddea6030 Johannes Berg 2018-10-18 657 bool hw_scan = local->ops->hw_scan;
f3b85252f08158 Johannes Berg 2009-04-23 658 int rc;
f3b85252f08158 Johannes Berg 2009-04-23 659
e229f844d7223b Stanislaw Gruszka 2010-10-06 660 lockdep_assert_held(&local->mtx);
e229f844d7223b Stanislaw Gruszka 2010-10-06 661
dc0c18ed229cdc Aaron Komisar 2019-10-02 662 if (local->scan_req)
dc0c18ed229cdc Aaron Komisar 2019-10-02 663 return -EBUSY;
dc0c18ed229cdc Aaron Komisar 2019-10-02 664
dc0c18ed229cdc Aaron Komisar 2019-10-02 665 if (!__ieee80211_can_leave_ch(sdata))
f3b85252f08158 Johannes Berg 2009-04-23 666 return -EBUSY;
f3b85252f08158 Johannes Berg 2009-04-23 667
133d40f9a22bdf Stanislaw Gruszka 2012-03-28 668 if (!ieee80211_can_scan(local, sdata)) {
6e7e6213e49568 John W. Linville 2010-02-08 669 /* wait for the work to finish/time out */
6ea0a69ca21bbd Johannes Berg 2014-11-19 670 rcu_assign_pointer(local->scan_req, req);
e2fd5dbc1c7031 Johannes Berg 2012-07-06 671 rcu_assign_pointer(local->scan_sdata, sdata);
c0ce77b8323c1a Johannes Berg 2010-02-03 672 return 0;
c0ce77b8323c1a Johannes Berg 2010-02-03 673 }
c0ce77b8323c1a Johannes Berg 2010-02-03 674
e9da68ddea6030 Johannes Berg 2018-10-18 675 again:
e9da68ddea6030 Johannes Berg 2018-10-18 676 if (hw_scan) {
f3b85252f08158 Johannes Berg 2009-04-23 677 u8 *ies;
f3b85252f08158 Johannes Berg 2009-04-23 678
e4dcbb375cd829 David Spinadel 2014-02-11 679 local->hw_scan_ies_bufsize = local->scan_ies_len + req->ie_len;
c56ef6725068c0 David Spinadel 2014-02-05 680
30686bf7f5b3c3 Johannes Berg 2015-06-02 681 if (ieee80211_hw_check(&local->hw, SINGLE_SCAN_ON_ALL_BANDS)) {
c56ef6725068c0 David Spinadel 2014-02-05 682 int i, n_bands = 0;
c56ef6725068c0 David Spinadel 2014-02-05 683 u8 bands_counted = 0;
c56ef6725068c0 David Spinadel 2014-02-05 684
c56ef6725068c0 David Spinadel 2014-02-05 685 for (i = 0; i < req->n_channels; i++) {
c56ef6725068c0 David Spinadel 2014-02-05 686 if (bands_counted & BIT(req->channels[i]->band))
c56ef6725068c0 David Spinadel 2014-02-05 687 continue;
c56ef6725068c0 David Spinadel 2014-02-05 688 bands_counted |= BIT(req->channels[i]->band);
c56ef6725068c0 David Spinadel 2014-02-05 689 n_bands++;
c56ef6725068c0 David Spinadel 2014-02-05 690 }
c56ef6725068c0 David Spinadel 2014-02-05 691
c56ef6725068c0 David Spinadel 2014-02-05 692 local->hw_scan_ies_bufsize *= n_bands;
c56ef6725068c0 David Spinadel 2014-02-05 693 }
c56ef6725068c0 David Spinadel 2014-02-05 694
4d36ec58239eec Johannes Berg 2009-10-27 695 local->hw_scan_req = kmalloc(
4d36ec58239eec Johannes Berg 2009-10-27 696 sizeof(*local->hw_scan_req) +
4d36ec58239eec Johannes Berg 2009-10-27 697 req->n_channels * sizeof(req->channels[0]) +
c604b9f219422e Johannes Berg 2012-11-29 698 local->hw_scan_ies_bufsize, GFP_KERNEL);
4d36ec58239eec Johannes Berg 2009-10-27 699 if (!local->hw_scan_req)
f3b85252f08158 Johannes Berg 2009-04-23 700 return -ENOMEM;
f3b85252f08158 Johannes Berg 2009-04-23 701
c56ef6725068c0 David Spinadel 2014-02-05 702 local->hw_scan_req->req.ssids = req->ssids;
c56ef6725068c0 David Spinadel 2014-02-05 703 local->hw_scan_req->req.n_ssids = req->n_ssids;
4d36ec58239eec Johannes Berg 2009-10-27 704 ies = (u8 *)local->hw_scan_req +
4d36ec58239eec Johannes Berg 2009-10-27 705 sizeof(*local->hw_scan_req) +
4d36ec58239eec Johannes Berg 2009-10-27 706 req->n_channels * sizeof(req->channels[0]);
c56ef6725068c0 David Spinadel 2014-02-05 707 local->hw_scan_req->req.ie = ies;
c56ef6725068c0 David Spinadel 2014-02-05 708 local->hw_scan_req->req.flags = req->flags;
e345f44f2b7c6a Jouni Malinen 2016-02-26 709 eth_broadcast_addr(local->hw_scan_req->req.bssid);
7947d3e075cde1 Avraham Stern 2016-07-05 710 local->hw_scan_req->req.duration = req->duration;
7947d3e075cde1 Avraham Stern 2016-07-05 711 local->hw_scan_req->req.duration_mandatory =
7947d3e075cde1 Avraham Stern 2016-07-05 712 req->duration_mandatory;
4d36ec58239eec Johannes Berg 2009-10-27 713
4d36ec58239eec Johannes Berg 2009-10-27 714 local->hw_scan_band = 0;
c8cb5b854b40f2 Tova Mussai 2020-09-18 715 local->hw_scan_req->req.n_6ghz_params = req->n_6ghz_params;
c8cb5b854b40f2 Tova Mussai 2020-09-18 716 local->hw_scan_req->req.scan_6ghz_params =
c8cb5b854b40f2 Tova Mussai 2020-09-18 717 req->scan_6ghz_params;
c8cb5b854b40f2 Tova Mussai 2020-09-18 718 local->hw_scan_req->req.scan_6ghz = req->scan_6ghz;
6e7e6213e49568 John W. Linville 2010-02-08 719
6e7e6213e49568 John W. Linville 2010-02-08 720 /*
6e7e6213e49568 John W. Linville 2010-02-08 721 * After allocating local->hw_scan_req, we must
6e7e6213e49568 John W. Linville 2010-02-08 722 * go through until ieee80211_prep_hw_scan(), so
6e7e6213e49568 John W. Linville 2010-02-08 723 * anything that might be changed here and leave
6e7e6213e49568 John W. Linville 2010-02-08 724 * this function early must not go after this
6e7e6213e49568 John W. Linville 2010-02-08 725 * allocation.
6e7e6213e49568 John W. Linville 2010-02-08 726 */
f3b85252f08158 Johannes Berg 2009-04-23 727 }
f3b85252f08158 Johannes Berg 2009-04-23 728
6ea0a69ca21bbd Johannes Berg 2014-11-19 729 rcu_assign_pointer(local->scan_req, req);
e2fd5dbc1c7031 Johannes Berg 2012-07-06 730 rcu_assign_pointer(local->scan_sdata, sdata);
f3b85252f08158 Johannes Berg 2009-04-23 731
a344d6778a98e4 Johannes Berg 2014-06-12 732 if (req->flags & NL80211_SCAN_FLAG_RANDOM_ADDR)
a344d6778a98e4 Johannes Berg 2014-06-12 733 get_random_mask_addr(local->scan_addr,
a344d6778a98e4 Johannes Berg 2014-06-12 734 req->mac_addr,
a344d6778a98e4 Johannes Berg 2014-06-12 735 req->mac_addr_mask);
a344d6778a98e4 Johannes Berg 2014-06-12 736 else
a344d6778a98e4 Johannes Berg 2014-06-12 737 memcpy(local->scan_addr, sdata->vif.addr, ETH_ALEN);
a344d6778a98e4 Johannes Berg 2014-06-12 738
e9da68ddea6030 Johannes Berg 2018-10-18 739 if (hw_scan) {
fbe9c429f19511 Helmut Schaa 2009-07-23 740 __set_bit(SCAN_HW_SCANNING, &local->scanning);
8a690674e0601e Ben Greear 2012-04-17 741 } else if ((req->n_channels == 1) &&
675a0b049abf6e Karl Beldan 2013-03-25 742 (req->channels[0] == local->_oper_chandef.chan)) {
9b8648704358e4 Johannes Berg 2012-07-26 743 /*
9b8648704358e4 Johannes Berg 2012-07-26 744 * If we are scanning only on the operating channel
9b8648704358e4 Johannes Berg 2012-07-26 745 * then we do not need to stop normal activities
8a690674e0601e Ben Greear 2012-04-17 746 */
8a690674e0601e Ben Greear 2012-04-17 747 unsigned long next_delay;
8a690674e0601e Ben Greear 2012-04-17 748
8a690674e0601e Ben Greear 2012-04-17 749 __set_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning);
8a690674e0601e Ben Greear 2012-04-17 750
8a690674e0601e Ben Greear 2012-04-17 751 ieee80211_recalc_idle(local);
8a690674e0601e Ben Greear 2012-04-17 752
8a690674e0601e Ben Greear 2012-04-17 753 /* Notify driver scan is starting, keep order of operations
8a690674e0601e Ben Greear 2012-04-17 754 * same as normal software scan, in case that matters. */
a344d6778a98e4 Johannes Berg 2014-06-12 755 drv_sw_scan_start(local, sdata, local->scan_addr);
8a690674e0601e Ben Greear 2012-04-17 756
8a690674e0601e Ben Greear 2012-04-17 757 ieee80211_configure_filter(local); /* accept probe-responses */
8a690674e0601e Ben Greear 2012-04-17 758
8a690674e0601e Ben Greear 2012-04-17 759 /* We need to ensure power level is at max for scanning. */
8a690674e0601e Ben Greear 2012-04-17 760 ieee80211_hw_config(local, 0);
8a690674e0601e Ben Greear 2012-04-17 761
4e39ccac0d678e Antonio Quartulli 2015-11-21 762 if ((req->channels[0]->flags & (IEEE80211_CHAN_NO_IR |
4e39ccac0d678e Antonio Quartulli 2015-11-21 763 IEEE80211_CHAN_RADAR)) ||
6ea0a69ca21bbd Johannes Berg 2014-11-19 764 !req->n_ssids) {
8a690674e0601e Ben Greear 2012-04-17 765 next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
8a690674e0601e Ben Greear 2012-04-17 766 } else {
8a690674e0601e Ben Greear 2012-04-17 767 ieee80211_scan_state_send_probe(local, &next_delay);
8a690674e0601e Ben Greear 2012-04-17 768 next_delay = IEEE80211_CHANNEL_TIME;
8a690674e0601e Ben Greear 2012-04-17 769 }
8a690674e0601e Ben Greear 2012-04-17 770
8a690674e0601e Ben Greear 2012-04-17 771 /* Now, just wait a bit and we are all done! */
8a690674e0601e Ben Greear 2012-04-17 772 ieee80211_queue_delayed_work(&local->hw, &local->scan_work,
8a690674e0601e Ben Greear 2012-04-17 773 next_delay);
8a690674e0601e Ben Greear 2012-04-17 774 return 0;
8a690674e0601e Ben Greear 2012-04-17 775 } else {
8a690674e0601e Ben Greear 2012-04-17 776 /* Do normal software scan */
fbe9c429f19511 Helmut Schaa 2009-07-23 777 __set_bit(SCAN_SW_SCANNING, &local->scanning);
8a690674e0601e Ben Greear 2012-04-17 778 }
6e7e6213e49568 John W. Linville 2010-02-08 779
5cff20e6c5a659 Johannes Berg 2009-04-29 780 ieee80211_recalc_idle(local);
f3b85252f08158 Johannes Berg 2009-04-23 781
e9da68ddea6030 Johannes Berg 2018-10-18 782 if (hw_scan) {
2ad2274c58ee2d Ilan Peer 2020-05-28 783 WARN_ON(!ieee80211_prep_hw_scan(sdata));
a060bbfe4ee95d Johannes Berg 2010-04-27 784 rc = drv_hw_scan(local, sdata, local->hw_scan_req);
a344d6778a98e4 Johannes Berg 2014-06-12 785 } else {
a344d6778a98e4 Johannes Berg 2014-06-12 786 rc = ieee80211_start_sw_scan(local, sdata);
a344d6778a98e4 Johannes Berg 2014-06-12 787 }
f3b85252f08158 Johannes Berg 2009-04-23 788
f3b85252f08158 Johannes Berg 2009-04-23 789 if (rc) {
4d36ec58239eec Johannes Berg 2009-10-27 790 kfree(local->hw_scan_req);
4d36ec58239eec Johannes Berg 2009-10-27 791 local->hw_scan_req = NULL;
fbe9c429f19511 Helmut Schaa 2009-07-23 792 local->scanning = 0;
f3b85252f08158 Johannes Berg 2009-04-23 793
5cff20e6c5a659 Johannes Berg 2009-04-29 794 ieee80211_recalc_idle(local);
5cff20e6c5a659 Johannes Berg 2009-04-29 795
f3b85252f08158 Johannes Berg 2009-04-23 796 local->scan_req = NULL;
0c2bef4621c5fe Monam Agarwal 2014-03-24 797 RCU_INIT_POINTER(local->scan_sdata, NULL);
f3b85252f08158 Johannes Berg 2009-04-23 798 }
f3b85252f08158 Johannes Berg 2009-04-23 799
e9da68ddea6030 Johannes Berg 2018-10-18 800 if (hw_scan && rc == 1) {
e9da68ddea6030 Johannes Berg 2018-10-18 801 /*
e9da68ddea6030 Johannes Berg 2018-10-18 802 * we can't fall back to software for P2P-GO
e9da68ddea6030 Johannes Berg 2018-10-18 803 * as it must update NoA etc.
e9da68ddea6030 Johannes Berg 2018-10-18 804 */
e9da68ddea6030 Johannes Berg 2018-10-18 805 if (ieee80211_vif_type_p2p(&sdata->vif) ==
e9da68ddea6030 Johannes Berg 2018-10-18 806 NL80211_IFTYPE_P2P_GO)
e9da68ddea6030 Johannes Berg 2018-10-18 807 return -EOPNOTSUPP;
e9da68ddea6030 Johannes Berg 2018-10-18 808 hw_scan = false;
e9da68ddea6030 Johannes Berg 2018-10-18 809 goto again;
e9da68ddea6030 Johannes Berg 2018-10-18 810 }
e9da68ddea6030 Johannes Berg 2018-10-18 811
f3b85252f08158 Johannes Berg 2009-04-23 812 return rc;
f3b85252f08158 Johannes Berg 2009-04-23 813 }
f3b85252f08158 Johannes Berg 2009-04-23 814

:::::: The code at line 653 was first introduced by commit
:::::: f3b85252f081581a8f257545ed748062dce7798b mac80211: fix scan races and rework scanning

:::::: TO: Johannes Berg <johannes@sipsolutions.net>
:::::: CC: John W. Linville <linville@tuxdriver.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-05-02 16:15    [W:0.174 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site