All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Sven Eckelmann <sven.eckelmann@openmesh.com>
Cc: "ath10k@lists.infradead.org" <ath10k@lists.infradead.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"ext.waldemar.rymarkiewicz@tieto.com"
	<ext.waldemar.rymarkiewicz@tieto.com>
Subject: Re: [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant
Date: Fri, 8 Dec 2017 09:27:52 +0000	[thread overview]
Message-ID: <87fu8ltvqg.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20170310080615.22958-2-sven.eckelmann@openmesh.com> (Sven Eckelmann's message of "Fri, 10 Mar 2017 09:06:15 +0100")

Sven Eckelmann <sven.eckelmann@openmesh.com> writes:

> Board Data File (BDF) is loaded upon driver boot-up procedure. The right
> board data file is identified on QCA4019 using bus, bmi-chip-id and
> bmi-board-id.
>
> The problem, however, can occur when the (default) board data file cannot
> fulfill with the vendor requirements and it is necessary to use a differe=
nt
> board data file.
>
> This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
> Something similar has to be provided for systems without SMBIOS but with
> device trees. No solution was specified by QCA and therefore a new one ha=
s
> to be found for ath10k.
>
> The device tree requires addition strings to define the variant name
>
>     wifi@a000000 {
>     	status =3D "okay";
>     	qcom,ath10k-calibration-variant =3D "RT-AC58U";
>     };
>
>     wifi@a800000 {
>     	status =3D "okay";
>     	qcom,ath10k-calibration-variant =3D "RT-AC58U";
>     };
>
> This would create the boarddata identifiers for the board-2.bin search
>
>  *  bus=3Dahb,bmi-chip-id=3D0,bmi-board-id=3D16,variant=3DRT-AC58U
>  *  bus=3Dahb,bmi-chip-id=3D0,bmi-board-id=3D17,variant=3DRT-AC58U
>
> Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
> ---
> Since RFC:
>
>  - initialize variant pointer to have it initialized to NULL when
>    of_property_read_string fails (thanks Christian Lamparter)
>  - Only print warning that DT doesn't contain string ones (thanks Christi=
an
>    Lamparter)
>  - Split patch in DT doc and ath10k part (thanks Christian Lamparter)
>  - Allow to overwrite the variant string via DT and ignore that SMBIOS ha=
d
>    written anything to it

[...]

> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -779,6 +779,25 @@ static int ath10k_core_check_smbios(struct ath10k *a=
r)
>  	return 0;
>  }
> =20
> +static int ath10k_core_check_dt(struct ath10k *ar)
> +{
> +	struct device_node *node;
> +	const char *variant =3D NULL;
> +
> +	node =3D ar->dev->of_node;
> +	if (!node)
> +		return -ENOENT;
> +
> +	of_property_read_string(node, "qcom,ath10k-calibration-variant",
> +				&variant);
> +	if (!variant)
> +		return -ENODATA;
> +
> +	strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext));

Kbuild bot found a warning here:

   drivers/net/wireless/ath/ath10k/core.c: In function 'ath10k_core_check_d=
t':
>> drivers/net/wireless/ath/ath10k/core.c:877:2: warning: ignoring return v=
alue of 'strscpy', declared with attribute warn_unused_result [-Wunused-res=
ult]
     strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I guess warn_unused_result in strscpy() is a recent addition and that's
why you didn't see it.

--=20
Kalle Valo=

WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org>
To: Sven Eckelmann <sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org>
Cc: "ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"mark.rutland-5wv7dgnIgG8@public.gmane.org"
	<mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"ext.waldemar.rymarkiewicz-++hxYGjEMp0AvxtiuMwx3w@public.gmane.org"
	<ext.waldemar.rymarkiewicz-++hxYGjEMp0AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant
Date: Fri, 8 Dec 2017 09:27:52 +0000	[thread overview]
Message-ID: <87fu8ltvqg.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20170310080615.22958-2-sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org> (Sven Eckelmann's message of "Fri, 10 Mar 2017 09:06:15 +0100")

Sven Eckelmann <sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org> writes:

> Board Data File (BDF) is loaded upon driver boot-up procedure. The right
> board data file is identified on QCA4019 using bus, bmi-chip-id and
> bmi-board-id.
>
> The problem, however, can occur when the (default) board data file cannot
> fulfill with the vendor requirements and it is necessary to use a different
> board data file.
>
> This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
> Something similar has to be provided for systems without SMBIOS but with
> device trees. No solution was specified by QCA and therefore a new one has
> to be found for ath10k.
>
> The device tree requires addition strings to define the variant name
>
>     wifi@a000000 {
>     	status = "okay";
>     	qcom,ath10k-calibration-variant = "RT-AC58U";
>     };
>
>     wifi@a800000 {
>     	status = "okay";
>     	qcom,ath10k-calibration-variant = "RT-AC58U";
>     };
>
> This would create the boarddata identifiers for the board-2.bin search
>
>  *  bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
>  *  bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U
>
> Signed-off-by: Sven Eckelmann <sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org>
> ---
> Since RFC:
>
>  - initialize variant pointer to have it initialized to NULL when
>    of_property_read_string fails (thanks Christian Lamparter)
>  - Only print warning that DT doesn't contain string ones (thanks Christian
>    Lamparter)
>  - Split patch in DT doc and ath10k part (thanks Christian Lamparter)
>  - Allow to overwrite the variant string via DT and ignore that SMBIOS had
>    written anything to it

[...]

> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -779,6 +779,25 @@ static int ath10k_core_check_smbios(struct ath10k *ar)
>  	return 0;
>  }
>  
> +static int ath10k_core_check_dt(struct ath10k *ar)
> +{
> +	struct device_node *node;
> +	const char *variant = NULL;
> +
> +	node = ar->dev->of_node;
> +	if (!node)
> +		return -ENOENT;
> +
> +	of_property_read_string(node, "qcom,ath10k-calibration-variant",
> +				&variant);
> +	if (!variant)
> +		return -ENODATA;
> +
> +	strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext));

Kbuild bot found a warning here:

   drivers/net/wireless/ath/ath10k/core.c: In function 'ath10k_core_check_dt':
>> drivers/net/wireless/ath/ath10k/core.c:877:2: warning: ignoring return value of 'strscpy', declared with attribute warn_unused_result [-Wunused-result]
     strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I guess warn_unused_result in strscpy() is a recent addition and that's
why you didn't see it.

-- 
Kalle Valo

WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Sven Eckelmann <sven.eckelmann@openmesh.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"ext.waldemar.rymarkiewicz@tieto.com"
	<ext.waldemar.rymarkiewicz@tieto.com>
Subject: Re: [PATCH 2/2] ath10k: search DT for qcom, ath10k-calibration-variant
Date: Fri, 8 Dec 2017 09:27:52 +0000	[thread overview]
Message-ID: <87fu8ltvqg.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20170310080615.22958-2-sven.eckelmann@openmesh.com> (Sven Eckelmann's message of "Fri, 10 Mar 2017 09:06:15 +0100")

Sven Eckelmann <sven.eckelmann@openmesh.com> writes:

> Board Data File (BDF) is loaded upon driver boot-up procedure. The right
> board data file is identified on QCA4019 using bus, bmi-chip-id and
> bmi-board-id.
>
> The problem, however, can occur when the (default) board data file cannot
> fulfill with the vendor requirements and it is necessary to use a different
> board data file.
>
> This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
> Something similar has to be provided for systems without SMBIOS but with
> device trees. No solution was specified by QCA and therefore a new one has
> to be found for ath10k.
>
> The device tree requires addition strings to define the variant name
>
>     wifi@a000000 {
>     	status = "okay";
>     	qcom,ath10k-calibration-variant = "RT-AC58U";
>     };
>
>     wifi@a800000 {
>     	status = "okay";
>     	qcom,ath10k-calibration-variant = "RT-AC58U";
>     };
>
> This would create the boarddata identifiers for the board-2.bin search
>
>  *  bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
>  *  bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U
>
> Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
> ---
> Since RFC:
>
>  - initialize variant pointer to have it initialized to NULL when
>    of_property_read_string fails (thanks Christian Lamparter)
>  - Only print warning that DT doesn't contain string ones (thanks Christian
>    Lamparter)
>  - Split patch in DT doc and ath10k part (thanks Christian Lamparter)
>  - Allow to overwrite the variant string via DT and ignore that SMBIOS had
>    written anything to it

[...]

> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -779,6 +779,25 @@ static int ath10k_core_check_smbios(struct ath10k *ar)
>  	return 0;
>  }
>  
> +static int ath10k_core_check_dt(struct ath10k *ar)
> +{
> +	struct device_node *node;
> +	const char *variant = NULL;
> +
> +	node = ar->dev->of_node;
> +	if (!node)
> +		return -ENOENT;
> +
> +	of_property_read_string(node, "qcom,ath10k-calibration-variant",
> +				&variant);
> +	if (!variant)
> +		return -ENODATA;
> +
> +	strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext));

Kbuild bot found a warning here:

   drivers/net/wireless/ath/ath10k/core.c: In function 'ath10k_core_check_dt':
>> drivers/net/wireless/ath/ath10k/core.c:877:2: warning: ignoring return value of 'strscpy', declared with attribute warn_unused_result [-Wunused-result]
     strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I guess warn_unused_result in strscpy() is a recent addition and that's
why you didn't see it.

-- 
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  parent reply	other threads:[~2017-12-08  9:27 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  8:06 [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant Sven Eckelmann
2017-03-10  8:06 ` Sven Eckelmann
2017-03-10  8:06 ` Sven Eckelmann
2017-03-10  8:06 ` [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant Sven Eckelmann
2017-03-10  8:06   ` Sven Eckelmann
2017-03-10  8:06   ` Sven Eckelmann
2017-03-10 18:20   ` Christian Lamparter
2017-03-10 18:20     ` [PATCH 2/2] ath10k: search DT for qcom, ath10k-calibration-variant Christian Lamparter
2017-03-15  8:04     ` [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant Sven Eckelmann
2017-03-15  8:04       ` [PATCH 2/2] ath10k: search DT for qcom, ath10k-calibration-variant Sven Eckelmann
2017-08-21  7:11     ` [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant Sven Eckelmann
2017-08-21  7:11       ` [PATCH 2/2] ath10k: search DT for qcom, ath10k-calibration-variant Sven Eckelmann
2017-10-27  9:34       ` Kalle Valo
2017-10-27  9:34         ` Kalle Valo
2017-12-08  9:50     ` Kalle Valo
2017-12-08  9:50       ` Kalle Valo
2018-01-29 20:09       ` Asus RT-AC58U boardfile (was Re: [PATCH 2/2] ath10k: search DT for qcom, ath10k-calibration-variant) Christian Lamparter
2018-01-29 20:09         ` Christian Lamparter
2018-10-08  8:21         ` Kalle Valo
2018-10-08  8:21           ` Kalle Valo
2018-04-19 14:56     ` [PATCH 2/2] ath10k: search DT for qcom, ath10k-calibration-variant Kalle Valo
2018-04-19 14:56       ` Kalle Valo
2018-04-20 19:50       ` Christian Lamparter
2018-04-20 19:50         ` Christian Lamparter
2017-12-08  9:27   ` Kalle Valo [this message]
2017-12-08  9:27     ` Kalle Valo
2017-12-08  9:27     ` [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant Kalle Valo
2017-03-20 15:07 ` [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant Rob Herring
2017-03-20 15:07   ` Rob Herring
2017-03-20 15:07   ` Rob Herring
2017-03-20 16:28   ` Sven Eckelmann
2017-03-20 16:28     ` Sven Eckelmann
2017-03-20 16:28     ` Sven Eckelmann
2017-03-20 16:42     ` Adrian Chadd
2017-03-20 16:42       ` Adrian Chadd
2017-03-21  7:29       ` Sven Eckelmann
2017-03-21  7:29         ` Sven Eckelmann
2017-03-21 13:00     ` Rob Herring
2017-03-21 13:00       ` Rob Herring
2017-03-21 13:00       ` Rob Herring
2017-03-21 14:33       ` Sven Eckelmann
2017-03-21 14:33         ` Sven Eckelmann
2017-03-21 14:33         ` Sven Eckelmann
2017-03-22  2:56         ` Rob Herring
2017-03-22  2:56           ` Rob Herring
2017-03-22  7:20           ` Sven Eckelmann
2017-03-22  7:20             ` Sven Eckelmann
2017-12-08  9:22             ` Kalle Valo
2017-12-08  9:22               ` Kalle Valo
2017-12-08  9:22               ` Kalle Valo

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=87fu8ltvqg.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath10k@lists.infradead.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ext.waldemar.rymarkiewicz@tieto.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sven.eckelmann@openmesh.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.