linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raja Mani <rmani@qca.qualcomm.com>
To: "Luis R. Rodriguez" <mcgrof@frijolero.org>
Cc: <linville@tuxdriver.com>, <johannes@sipsolutions.net>,
	<linux-wireless@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Youngsin Lee <youngsin@qualcomm.com>,
	Senthil Kumar Balasubramanian <senthilb@qca.qualcomm.com>,
	Vipin Mehta <vipimeht@qca.qualcomm.com>,
	<yahuan@qca.qualcomm.com>, <jjan@qca.qualcomm.com>,
	<vthiagar@qca.qualcomm.com>, <henrykim@qualcomm.com>,
	<jouni@qca.qualcomm.com>, <athiruve@qca.qualcomm.com>,
	<cjkim@qualcomm.com>, <philipk@qca.qualcomm.com>,
	<sunnykim@qualcomm.com>, <sskwak@qualcomm.com>,
	<kkim@qualcomm.com>, <mattbyun@qualcomm.com>,
	<ryanlee@qualcomm.com>, <simbap@qualcomm.com>,
	<krislee@qualcomm.com>, <conner@qualcomm.com>,
	<hojinkim@qualcomm.com>, <honglee@qualcomm.com>,
	<johnwkim@qualcomm.com>
Subject: Re: [PATCH v2] cfg80211: warn if db.txt is empty with CONFIG_CFG80211_INTERNAL_REGDB
Date: Wed, 21 Mar 2012 10:50:48 +0530	[thread overview]
Message-ID: <4F696530.9040304@qca.qualcomm.com> (raw)
In-Reply-To: <1332252225-17531-1-git-send-email-mcgrof@frijolero.org>

On Tuesday 20 March 2012 07:33 PM, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez"<mcgrof@frijolero.org>
>
> It has happened twice now where elaborate troubleshooting has
> undergone on systems where CONFIG_CFG80211_INTERNAL_REGDB [0]
> has been set but yet net/wireless/db.txt was not updated.
>
> Despite the documentation on this it seems system integrators could
> use some more help with this, so throw out a kernel warning at boot time
> when their database is empty.
>
> This does mean that the error-prone system integrator won't likely
> realize the issue until they boot the machine but -- it does not seem
> to make sense to enable a build bug breaking random build testing.
>
> [0] http://wireless.kernel.org/en/developers/Regulatory/CRDA#CONFIG_CFG80211_INTERNAL_REGDB
>
> Cc: Stephen Rothwell<sfr@canb.auug.org.au>
> Cc: Youngsin Lee<youngsin@qualcomm.com>
> Cc: Raja Mani<rmani@qca.qualcomm.com>
> Cc: Senthil Kumar Balasubramanian<senthilb@qca.qualcomm.com>
> Cc: Vipin Mehta<vipimeht@qca.qualcomm.com>
> Cc: yahuan@qca.qualcomm.com
> Cc: jjan@qca.qualcomm.com
> Cc: vthiagar@qca.qualcomm.com
> Cc: henrykim@qualcomm.com
> Cc: jouni@qca.qualcomm.com
> Cc: athiruve@qca.qualcomm.com
> Cc: cjkim@qualcomm.com
> Cc: philipk@qca.qualcomm.com
> Cc: sunnykim@qualcomm.com
> Cc: sskwak@qualcomm.com
> Cc: kkim@qualcomm.com
> Cc: mattbyun@qualcomm.com
> Cc: ryanlee@qualcomm.com
> Cc: simbap@qualcomm.com
> Cc: krislee@qualcomm.com
> Cc: conner@qualcomm.com
> Cc: hojinkim@qualcomm.com
> Cc: honglee@qualcomm.com
> Cc: johnwkim@qualcomm.com
> Signed-off-by: Luis R. Rodriguez<mcgrof@frijolero.org>
> ---
>   net/wireless/reg.c |    9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index e9a0ac8..7b613c4 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -388,7 +388,15 @@ static void reg_regdb_query(const char *alpha2)
>
>   	schedule_work(&reg_regdb_work);
>   }
> +
> +/* Feel free to add any other sanity checks here */
> +static void reg_regdb_size_check(void)
> +{
> +	/* We should ideally BUILD_BUG_ON() but then random builds would fail */
> +	WARN_ONCE(!reg_regdb_size, "db.txt is empty, you should update it...");
> +}
>   #else
> +static inline void reg_regdb_size_check(void) {}
>   static inline void reg_regdb_query(const char *alpha2) {}
>   #endif /* CONFIG_CFG80211_INTERNAL_REGDB */
>
> @@ -2367,6 +2375,7 @@ void /* __init_or_exit */ regulatory_exit(void)
>   	mutex_lock(&cfg80211_mutex);
>   	mutex_lock(&reg_mutex);
>
> +	reg_regdb_size_check();

Just curious question, Don't we have to check internal regdb size in
init time (i.e, regulatory_init()) instead of in regulatory_exit() ?

Because, we would get warning ONLY at exit time in this case.

>   	reset_regdomains(true);
>
>   	dev_set_uevent_suppress(&reg_pdev->dev, true);

      reply	other threads:[~2012-03-21  5:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 14:03 [PATCH v2] cfg80211: warn if db.txt is empty with CONFIG_CFG80211_INTERNAL_REGDB Luis R. Rodriguez
2012-03-21  5:20 ` Raja Mani [this message]

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=4F696530.9040304@qca.qualcomm.com \
    --to=rmani@qca.qualcomm.com \
    --cc=athiruve@qca.qualcomm.com \
    --cc=cjkim@qualcomm.com \
    --cc=conner@qualcomm.com \
    --cc=henrykim@qualcomm.com \
    --cc=hojinkim@qualcomm.com \
    --cc=honglee@qualcomm.com \
    --cc=jjan@qca.qualcomm.com \
    --cc=johannes@sipsolutions.net \
    --cc=johnwkim@qualcomm.com \
    --cc=jouni@qca.qualcomm.com \
    --cc=kkim@qualcomm.com \
    --cc=krislee@qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mattbyun@qualcomm.com \
    --cc=mcgrof@frijolero.org \
    --cc=philipk@qca.qualcomm.com \
    --cc=ryanlee@qualcomm.com \
    --cc=senthilb@qca.qualcomm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=simbap@qualcomm.com \
    --cc=sskwak@qualcomm.com \
    --cc=sunnykim@qualcomm.com \
    --cc=vipimeht@qca.qualcomm.com \
    --cc=vthiagar@qca.qualcomm.com \
    --cc=yahuan@qca.qualcomm.com \
    --cc=youngsin@qualcomm.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 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).