devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
@ 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-20 15:07 ` [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant Rob Herring
  0 siblings, 2 replies; 12+ messages in thread
From: Sven Eckelmann @ 2017-03-10  8:06 UTC (permalink / raw)
  To: ath10k
  Cc: mark.rutland, devicetree, linux-wireless, robh+dt,
	Sven Eckelmann, ext.waldemar.rymarkiewicz, kvalo

The bus + bmi-chip-id + bmi-board-id is not enough to identify the correct
board data file on QCA4019 based devices. Multiple different boards share
the same values. Only the original reference designs can currently be
identified and loaded from the board-2.bin. But these will not result in
the correct calibration data when combined with the pre-calibration data
from the device.

An additional "variant" information has to be provided (via SMBIOS or DT)
to select the correct board data for a design which was modified by an ODM.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
---
Since RFC:

 - Split patch in DT doc and ath10k part (thanks Christian Lamparter)
 - Remove the words "bmi-chip-id" and "bmi-board-id" and replace them with
   more generic "device specific ids"
---
 Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
index 74d7f0af209c..3d2a031217da 100644
--- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
+++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
@@ -41,6 +41,9 @@ Optional properties:
 - qcom,msi_addr: MSI interrupt address.
 - qcom,msi_base: Base value to add before writing MSI data into
 		MSI address register.
+- qcom,ath10k-calibration-variant: string to search for in the board-2.bin
+				   variant list with the same bus and device
+				   specific ids
 - qcom,ath10k-calibration-data : calibration data + board specific data
 				 as an array, the length can vary between
 				 hw versions.
-- 
2.11.0

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

* [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant
  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
       [not found]   ` <20170310080615.22958-2-sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org>
  2017-03-20 15:07 ` [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant Rob Herring
  1 sibling, 1 reply; 12+ messages in thread
From: Sven Eckelmann @ 2017-03-10  8:06 UTC (permalink / raw)
  To: ath10k
  Cc: mark.rutland, devicetree, linux-wireless, robh+dt,
	Sven Eckelmann, ext.waldemar.rymarkiewicz, kvalo

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
---
 drivers/net/wireless/ath/ath10k/core.c | 37 +++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 0a8e29e9a0eb..e459e84afe9f 100644
--- 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));
+
+	return 0;
+}
+
 static int ath10k_download_and_run_otp(struct ath10k *ar)
 {
 	u32 result, address = ar->hw_params.patch_load_addr;
@@ -1145,19 +1164,19 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
 	/* strlen(',variant=') + strlen(ar->id.bdf_ext) */
 	char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
 
+	if (ar->id.bdf_ext[0] != '\0')
+		scnprintf(variant, sizeof(variant), ",variant=%s",
+			  ar->id.bdf_ext);
+
 	if (ar->id.bmi_ids_valid) {
 		scnprintf(name, name_len,
-			  "bus=%s,bmi-chip-id=%d,bmi-board-id=%d",
+			  "bus=%s,bmi-chip-id=%d,bmi-board-id=%d%s",
 			  ath10k_bus_str(ar->hif.bus),
 			  ar->id.bmi_chip_id,
-			  ar->id.bmi_board_id);
+			  ar->id.bmi_board_id, variant);
 		goto out;
 	}
 
-	if (ar->id.bdf_ext[0] != '\0')
-		scnprintf(variant, sizeof(variant), ",variant=%s",
-			  ar->id.bdf_ext);
-
 	scnprintf(name, name_len,
 		  "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
 		  ath10k_bus_str(ar->hif.bus),
@@ -2221,7 +2240,11 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
 
 	ret = ath10k_core_check_smbios(ar);
 	if (ret)
-		ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n");
+		ath10k_dbg(ar, ATH10K_DBG_BOOT, "SMBIOS bdf variant name not set.\n");
+
+	ret = ath10k_core_check_dt(ar);
+	if (ret)
+		ath10k_dbg(ar, ATH10K_DBG_BOOT, "DT bdf variant name not set.\n");
 
 	ret = ath10k_core_fetch_board_file(ar);
 	if (ret) {
-- 
2.11.0

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

* Re: [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
  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 ` [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant Sven Eckelmann
@ 2017-03-20 15:07 ` Rob Herring
  2017-03-20 16:28   ` Sven Eckelmann
  1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2017-03-20 15:07 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: mark.rutland, devicetree, linux-wireless, ath10k,
	ext.waldemar.rymarkiewicz, kvalo

On Fri, Mar 10, 2017 at 09:06:14AM +0100, Sven Eckelmann wrote:
> The bus + bmi-chip-id + bmi-board-id is not enough to identify the correct
> board data file on QCA4019 based devices. Multiple different boards share
> the same values. Only the original reference designs can currently be
> identified and loaded from the board-2.bin. But these will not result in
> the correct calibration data when combined with the pre-calibration data
> from the device.
> 
> An additional "variant" information has to be provided (via SMBIOS or DT)
> to select the correct board data for a design which was modified by an ODM.
> 
> Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
> ---
> Since RFC:
> 
>  - Split patch in DT doc and ath10k part (thanks Christian Lamparter)
>  - Remove the words "bmi-chip-id" and "bmi-board-id" and replace them with
>    more generic "device specific ids"
> ---
>  Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> index 74d7f0af209c..3d2a031217da 100644
> --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> @@ -41,6 +41,9 @@ Optional properties:
>  - qcom,msi_addr: MSI interrupt address.
>  - qcom,msi_base: Base value to add before writing MSI data into
>  		MSI address register.
> +- qcom,ath10k-calibration-variant: string to search for in the board-2.bin
> +				   variant list with the same bus and device
> +				   specific ids

Sounds like you should use a more specific compatible string.

>  - qcom,ath10k-calibration-data : calibration data + board specific data
>  				 as an array, the length can vary between
>  				 hw versions.
> -- 
> 2.11.0
> 

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

* Re: [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
  2017-03-20 15:07 ` [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant Rob Herring
@ 2017-03-20 16:28   ` Sven Eckelmann
  2017-03-20 16:42     ` Adrian Chadd
  2017-03-21 13:00     ` Rob Herring
  0 siblings, 2 replies; 12+ messages in thread
From: Sven Eckelmann @ 2017-03-20 16:28 UTC (permalink / raw)
  To: Rob Herring
  Cc: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, mark.rutland-5wv7dgnIgG8,
	ext.waldemar.rymarkiewicz-++hxYGjEMp0AvxtiuMwx3w,
	kvalo-sgV2jX0FEOL9JmXXK+q4OQ

[-- Attachment #1: Type: text/plain, Size: 2671 bytes --]

On Montag, 20. März 2017 10:07:33 CET Rob Herring wrote:
> On Fri, Mar 10, 2017 at 09:06:14AM +0100, Sven Eckelmann wrote:
> > The bus + bmi-chip-id + bmi-board-id is not enough to identify the correct
> > board data file on QCA4019 based devices. Multiple different boards share
> > the same values. Only the original reference designs can currently be
> > identified and loaded from the board-2.bin. But these will not result in
> > the correct calibration data when combined with the pre-calibration data
> > from the device.
> > 
> > An additional "variant" information has to be provided (via SMBIOS or DT)
> > to select the correct board data for a design which was modified by an ODM.
> > 
> > Signed-off-by: Sven Eckelmann <sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org>
> > ---
> > Since RFC:
> > 
> >  - Split patch in DT doc and ath10k part (thanks Christian Lamparter)
> >  - Remove the words "bmi-chip-id" and "bmi-board-id" and replace them with
> >    more generic "device specific ids"
> > ---
> >  Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> > index 74d7f0af209c..3d2a031217da 100644
> > --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> > +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
> > @@ -41,6 +41,9 @@ Optional properties:
> >  - qcom,msi_addr: MSI interrupt address.
> >  - qcom,msi_base: Base value to add before writing MSI data into
> >  		MSI address register.
> > +- qcom,ath10k-calibration-variant: string to search for in the board-2.bin
> > +				   variant list with the same bus and device
> > +				   specific ids
> 
> Sounds like you should use a more specific compatible string.

Hm, this would require that each calibration data has an own compatibility
string - which then has to be supported by ath10k, right? Doesn't sound like
it would work well when each vendor (with an own calibration variant) would
have to modify ath10k to get it working. This sounds especially odd because
nothing else in ath10k has to be changed. Only the board data files which will
be selected by ath10k are different on these devices.

It would then up with something like this as compatibility string:

 * qcom,ipq4019-wifi-asus-rt-ac58u
 * qcom,ipq4019-wifi-fritzbox-4040
 * qcom,ipq4019-wifi-netgear-whatever
 * qcom,ipq4019-wifi-openmesh-i-have-no-idea
 * ...

But maybe I misunderstood what you've said.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
  2017-03-20 16:28   ` Sven Eckelmann
@ 2017-03-20 16:42     ` Adrian Chadd
  2017-03-21  7:29       ` Sven Eckelmann
  2017-03-21 13:00     ` Rob Herring
  1 sibling, 1 reply; 12+ messages in thread
From: Adrian Chadd @ 2017-03-20 16:42 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: Mark Rutland, Rob Herring, devicetree, linux-wireless, ath10k,
	Waldemar Rymarkiewicz, Kalle Valo

Vendors using ath10k will like this. I mean, I'm using ath10k, and I
really like this moving forward. This will make life so much easier in
the long run.

Everyone else isn't using board-2.bin; they're just copying
calibration/board data files over so the reference driver can assemble
a board data file based on wifi0/wifi1/etc probe order, and use that.



-adrian


On 20 March 2017 at 09:28, Sven Eckelmann <sven.eckelmann@openmesh.com> wrote:
> On Montag, 20. März 2017 10:07:33 CET Rob Herring wrote:
>> On Fri, Mar 10, 2017 at 09:06:14AM +0100, Sven Eckelmann wrote:
>> > The bus + bmi-chip-id + bmi-board-id is not enough to identify the correct
>> > board data file on QCA4019 based devices. Multiple different boards share
>> > the same values. Only the original reference designs can currently be
>> > identified and loaded from the board-2.bin. But these will not result in
>> > the correct calibration data when combined with the pre-calibration data
>> > from the device.
>> >
>> > An additional "variant" information has to be provided (via SMBIOS or DT)
>> > to select the correct board data for a design which was modified by an ODM.
>> >
>> > Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
>> > ---
>> > Since RFC:
>> >
>> >  - Split patch in DT doc and ath10k part (thanks Christian Lamparter)
>> >  - Remove the words "bmi-chip-id" and "bmi-board-id" and replace them with
>> >    more generic "device specific ids"
>> > ---
>> >  Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt | 3 +++
>> >  1 file changed, 3 insertions(+)
>> >
>> > diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> > index 74d7f0af209c..3d2a031217da 100644
>> > --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> > +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> > @@ -41,6 +41,9 @@ Optional properties:
>> >  - qcom,msi_addr: MSI interrupt address.
>> >  - qcom,msi_base: Base value to add before writing MSI data into
>> >             MSI address register.
>> > +- qcom,ath10k-calibration-variant: string to search for in the board-2.bin
>> > +                              variant list with the same bus and device
>> > +                              specific ids
>>
>> Sounds like you should use a more specific compatible string.
>
> Hm, this would require that each calibration data has an own compatibility
> string - which then has to be supported by ath10k, right? Doesn't sound like
> it would work well when each vendor (with an own calibration variant) would
> have to modify ath10k to get it working. This sounds especially odd because
> nothing else in ath10k has to be changed. Only the board data files which will
> be selected by ath10k are different on these devices.
>
> It would then up with something like this as compatibility string:
>
>  * qcom,ipq4019-wifi-asus-rt-ac58u
>  * qcom,ipq4019-wifi-fritzbox-4040
>  * qcom,ipq4019-wifi-netgear-whatever
>  * qcom,ipq4019-wifi-openmesh-i-have-no-idea
>  * ...
>
> But maybe I misunderstood what you've said.
>
> Kind regards,
>         Sven

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

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

* Re: [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
  2017-03-20 16:42     ` Adrian Chadd
@ 2017-03-21  7:29       ` Sven Eckelmann
  0 siblings, 0 replies; 12+ messages in thread
From: Sven Eckelmann @ 2017-03-21  7:29 UTC (permalink / raw)
  To: Adrian Chadd
  Cc: Mark Rutland, Rob Herring, devicetree, linux-wireless, ath10k,
	Waldemar Rymarkiewicz, Kalle Valo


[-- Attachment #1.1: Type: text/plain, Size: 648 bytes --]

On Montag, 20. März 2017 09:42:05 CET Adrian Chadd wrote:
> Vendors using ath10k will like this. I mean, I'm using ath10k, and I
> really like this moving forward. This will make life so much easier in
> the long run.
> 
> Everyone else isn't using board-2.bin; they're just copying
> calibration/board data files over so the reference driver can assemble
> a board data file based on wifi0/wifi1/etc probe order, and use that.

Thanks for the feedback. But I am not sure what you mean by "this". Do you 
mean the "qcom,ath10k-calibration-variant" entry or the "qcom,ipq4019-
$vendorstring" compatiblity string?

Kind regards,
	Sven

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 146 bytes --]

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

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

* Re: [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
  2017-03-20 16:28   ` Sven Eckelmann
  2017-03-20 16:42     ` Adrian Chadd
@ 2017-03-21 13:00     ` Rob Herring
       [not found]       ` <CAL_Jsq+aEdjq9MR--Hyrw17KoKv=uZ7OBsAqX1_0+Djpw+QUCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2017-03-21 13:00 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-wireless,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Rutland,
	ext.waldemar.rymarkiewicz-++hxYGjEMp0AvxtiuMwx3w, Kalle Valo

On Mon, Mar 20, 2017 at 11:28 AM, Sven Eckelmann
<sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org> wrote:
> On Montag, 20. März 2017 10:07:33 CET Rob Herring wrote:
>> On Fri, Mar 10, 2017 at 09:06:14AM +0100, Sven Eckelmann wrote:
>> > The bus + bmi-chip-id + bmi-board-id is not enough to identify the correct
>> > board data file on QCA4019 based devices. Multiple different boards share
>> > the same values. Only the original reference designs can currently be
>> > identified and loaded from the board-2.bin. But these will not result in
>> > the correct calibration data when combined with the pre-calibration data
>> > from the device.
>> >
>> > An additional "variant" information has to be provided (via SMBIOS or DT)
>> > to select the correct board data for a design which was modified by an ODM.
>> >
>> > Signed-off-by: Sven Eckelmann <sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org>
>> > ---
>> > Since RFC:
>> >
>> >  - Split patch in DT doc and ath10k part (thanks Christian Lamparter)
>> >  - Remove the words "bmi-chip-id" and "bmi-board-id" and replace them with
>> >    more generic "device specific ids"
>> > ---
>> >  Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt | 3 +++
>> >  1 file changed, 3 insertions(+)
>> >
>> > diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> > index 74d7f0af209c..3d2a031217da 100644
>> > --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> > +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>> > @@ -41,6 +41,9 @@ Optional properties:
>> >  - qcom,msi_addr: MSI interrupt address.
>> >  - qcom,msi_base: Base value to add before writing MSI data into
>> >             MSI address register.
>> > +- qcom,ath10k-calibration-variant: string to search for in the board-2.bin
>> > +                              variant list with the same bus and device
>> > +                              specific ids
>>
>> Sounds like you should use a more specific compatible string.
>
> Hm, this would require that each calibration data has an own compatibility
> string - which then has to be supported by ath10k, right? Doesn't sound like
> it would work well when each vendor (with an own calibration variant) would
> have to modify ath10k to get it working. This sounds especially odd because
> nothing else in ath10k has to be changed. Only the board data files which will
> be selected by ath10k are different on these devices.
>
> It would then up with something like this as compatibility string:
>
>  * qcom,ipq4019-wifi-asus-rt-ac58u
>  * qcom,ipq4019-wifi-fritzbox-4040
>  * qcom,ipq4019-wifi-netgear-whatever
>  * qcom,ipq4019-wifi-openmesh-i-have-no-idea
>  * ...

Are these all the same board design or variations? In the latter case,
you should have specific compatibles anyway. Now if the variants are
the same hardware, but different configurations say for different
regions or something, then I'd say a separate property is fine.

We already have a "firmware-name" property. Would that work for you?

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
       [not found]       ` <CAL_Jsq+aEdjq9MR--Hyrw17KoKv=uZ7OBsAqX1_0+Djpw+QUCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-03-21 14:33         ` Sven Eckelmann
  2017-03-22  2:56           ` Rob Herring
  0 siblings, 1 reply; 12+ messages in thread
From: Sven Eckelmann @ 2017-03-21 14:33 UTC (permalink / raw)
  To: Rob Herring
  Cc: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-wireless,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Rutland,
	ext.waldemar.rymarkiewicz-++hxYGjEMp0AvxtiuMwx3w, Kalle Valo

[-- Attachment #1: Type: text/plain, Size: 7312 bytes --]

On Dienstag, 21. März 2017 08:00:34 CET Rob Herring wrote:
[...]
> > It would then up with something like this as compatibility string:
> >
> >  * qcom,ipq4019-wifi-asus-rt-ac58u
> >  * qcom,ipq4019-wifi-fritzbox-4040
> >  * qcom,ipq4019-wifi-netgear-whatever
> >  * qcom,ipq4019-wifi-openmesh-i-have-no-idea
> >  * ...
> 
> Are these all the same board design or variations? In the latter case,
> you should have specific compatibles anyway. Now if the variants are
> the same hardware, but different configurations say for different
> regions or something, then I'd say a separate property is fine.
> 
> We already have a "firmware-name" property. Would that work for you?

Hm, maybe we should specify some names better:

"qcom,ipq4019-wifi" == compatibility string for WiFi hardware inside the SoC. 
It is the one which ath10k supports on the Atheros Host Bus (ahb) of the 
QCA4019.

The ath10k driver will use the information from these nodes to initialize the 
device. It will basically:

1. load a firmware(-5).bin from /lib/firmware/ath10k/QCA4019/hw1.0/
2. load the pre-cal (aka first part of calibration) data from
   /lib/firmware/ath10k/pre-cal-*
3. do some firmware magic to identify the reference design
4. load board data "files" (BDF) for this reference design from
    /lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
5. send the BDF data to the firmware to let it compute the final calibration
   data
6. start the actual wifi stuff

The IPQ4018/4019 SoC doesn't contain the actual RF parts. There are a couple 
of reference designs (SoC+RF parts) from QCA which got official numbers. These 
numbers identify the BDFs inside the board-2.bin. And the board-2.bin is not 
the firmware - it is a container for multiple BDFs.


To summarize:

 * pre-cal is some data stored in a special partition of the devices and will
   not be overwritten on updates
 * board-2.bin are multiple BDF files containing the second part of the
   calibration data
 * pre-cal + BDF (+ some OTP stuff) are getting combined to form the complete
   calibration data

Asus RT-AC58U, Fritzbox 4040 and ZyXEL NBG6617 are products based on the same 
reference design. But of course, some (all?) fiddled around with the RF parts 
and therefore require special BDFs. They still use the same SoC and require 
that the closed source ath10k firmware behaves like on the official reference 
designs. Only the BDFs have to be different.

So you could say that the wifi-chip hardware (part of the QCA4018/4019 SoC) is 
the same between these different products. But the hardware around the SoC is 
different and therefore requires a different "configuration"/calibration for 
the surrounding RF hardware. It is not a perfect match for your "separate 
property is fine" compromise. Maybe you still meant this - I let you decide.


This is not only a problem on QCA4019 but also for other devices supported by 
ath10k. Waldemar Rymarkiewicz introduced the concept of BDF variants for
this [1] and implemented the support for SMBIOS. The variant string (generated 
from the SMBIOS data) is then used by ath10k when it searches for the correct 
BDFs in the board-2.bin. Kalle Valo suggested to use the same mechanism for 
QCA401X based boards (which don't use SMBIOS).

The "qcom,ath10k-calibration-variant" is now the (more or less) equivalent of 
the SMBIOS entry - but for device tree users. Let us assume that the variant 
string would be "RT-AC58U" for the Asus RT-AC58U and the first wifi device 
(bmi-board-id=16) gets initialized [2]. Then the step 4 would get splitted in 
following steps:

4.1. Get the the qcom,ath10k-calibration-variant content
4.2. jump to 4.5. when there is no qcom,ath10k-calibration-variant
4.3. calculate BDF search name with variant string
     "bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U"
4.4. load BDF and when found, jump to 5.
4.5. calculate BDF search name without variant string
     "bus=ahb,bmi-chip-id=0,bmi-board-id=16"
4.6. load the BDF


There would be no changes in ath10k when adding a new BDF calibration variant 
using qcom,ath10k-calibration-variant. Only the device tree node would have to 
be updated:

 * device tree (simplified):
    / {
      model = "ASUS RT-AC58U";
    
      soc {
        wifi@a000000 {
          compatible = "qcom,ipq4019-wifi";
          reg = <0xa000000 0x200000>;
          status = "okay";
          qcom,ath10k-calibration-variant = "RT-AC58U";
        };
    
        wifi@a800000 {
          compatible = "qcom,ipq4019-wifi";
          reg = <0xa800000 0x200000>;
          status = "okay";
          qcom,ath10k-calibration-variant = "RT-AC58U";
        };
      };
    };
 * ath10k + ath10k-firmware
   <no change>




This about how the calibration [insert swearword] works for
"qcom,ipq4019-wifi" and why the "qcom,ath10k-calibration-variant" was used in
my first implementation. But then you've suggested to "use a more specific
compatible string". This information was not enough for me to understand what
you've actually meant. I was therefore proposing some examples which show what
you maybe could have meant. These were following things:

> >  * qcom,ipq4019-wifi-asus-rt-ac58u
> >  * qcom,ipq4019-wifi-fritzbox-4040
> >  * qcom,ipq4019-wifi-netgear-whatever
> >  * qcom,ipq4019-wifi-openmesh-i-have-no-idea

They are basically "qcom,ipq4019-wifi" + a product specific string. The first 
part is therefore the string which identifies the wifi device(s) in the 
QCA4018/4019 SoC. The product specific string is simply the part (or a 
variation of it) which would been used before in
"qcom,ath10k-calibration-variant" - just to make it "use a more specific 
compatible string".

I have no idea if this is really what you meant. I just wanted to give you 
some examples and explanations why I don't feel that this a good idea. I 
thought that this would help you to point me in the right direction and 
explain better what you've meant.

Right now it looks to me like following must be done for your(?) proposal for 
each new board:

 * device tree (simplified):
    / {
      model = "ASUS RT-AC58U";
    
      soc {
        wifi@a000000 {
          compatible = "qcom,ipq4019-wifi-asus-rt-ac58u";
          reg = <0xa000000 0x200000>;
          status = "okay";
        };
    
        wifi@a800000 {
          compatible = "qcom,ipq4019-wifi-asus-rt-ac58u";
          reg = <0xa800000 0x200000>;
          status = "okay";
        };
      };
    };
 * ath10k + ath10k-firmware
   - add qcom,ipq4019-wifi-asus-rt-ac58u to
     Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
   - add qcom,ipq4019-wifi-asus-rt-ac58u to ath10k_ahb_of_match in
     drivers/net/wireless/ath/ath10k/ahb.c
   - add a mapping from qcom,ipq4019-wifi-asus-rt-ac58u to the RT-AC58U
     variant string somewhere in ath10k


I hope this is enough to understand it a little bit better.

Kind regards,
	Sven


[1] https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?id=1657b8f84ed9fc1d2a100671f1d42d6286f20073
[2] the second wifi device for this reference design would be 17. But there
    are a lot more for the other reference designs from QCA

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
  2017-03-21 14:33         ` Sven Eckelmann
@ 2017-03-22  2:56           ` Rob Herring
  2017-03-22  7:20             ` Sven Eckelmann
  0 siblings, 1 reply; 12+ messages in thread
From: Rob Herring @ 2017-03-22  2:56 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: Mark Rutland, devicetree, linux-wireless, ath10k,
	ext.waldemar.rymarkiewicz, Kalle Valo

On Tue, Mar 21, 2017 at 9:33 AM, Sven Eckelmann
<sven.eckelmann@openmesh.com> wrote:
> On Dienstag, 21. März 2017 08:00:34 CET Rob Herring wrote:
> [...]
>> > It would then up with something like this as compatibility string:
>> >
>> >  * qcom,ipq4019-wifi-asus-rt-ac58u
>> >  * qcom,ipq4019-wifi-fritzbox-4040
>> >  * qcom,ipq4019-wifi-netgear-whatever
>> >  * qcom,ipq4019-wifi-openmesh-i-have-no-idea
>> >  * ...
>>
>> Are these all the same board design or variations? In the latter case,
>> you should have specific compatibles anyway. Now if the variants are
>> the same hardware, but different configurations say for different
>> regions or something, then I'd say a separate property is fine.
>>
>> We already have a "firmware-name" property. Would that work for you?
>
> Hm, maybe we should specify some names better:
>
> "qcom,ipq4019-wifi" == compatibility string for WiFi hardware inside the SoC.
> It is the one which ath10k supports on the Atheros Host Bus (ahb) of the
> QCA4019.
>
> The ath10k driver will use the information from these nodes to initialize the
> device. It will basically:
>
> 1. load a firmware(-5).bin from /lib/firmware/ath10k/QCA4019/hw1.0/
> 2. load the pre-cal (aka first part of calibration) data from
>    /lib/firmware/ath10k/pre-cal-*
> 3. do some firmware magic to identify the reference design
> 4. load board data "files" (BDF) for this reference design from
>     /lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
> 5. send the BDF data to the firmware to let it compute the final calibration
>    data
> 6. start the actual wifi stuff
>
> The IPQ4018/4019 SoC doesn't contain the actual RF parts. There are a couple
> of reference designs (SoC+RF parts) from QCA which got official numbers. These
> numbers identify the BDFs inside the board-2.bin. And the board-2.bin is not
> the firmware - it is a container for multiple BDFs.
>
>
> To summarize:
>
>  * pre-cal is some data stored in a special partition of the devices and will
>    not be overwritten on updates
>  * board-2.bin are multiple BDF files containing the second part of the
>    calibration data
>  * pre-cal + BDF (+ some OTP stuff) are getting combined to form the complete
>    calibration data
>
> Asus RT-AC58U, Fritzbox 4040 and ZyXEL NBG6617 are products based on the same
> reference design. But of course, some (all?) fiddled around with the RF parts
> and therefore require special BDFs. They still use the same SoC and require
> that the closed source ath10k firmware behaves like on the official reference
> designs. Only the BDFs have to be different.

Is this always the case? There's never some variation beyond the
reference design that a BDF difference can't handle?

> So you could say that the wifi-chip hardware (part of the QCA4018/4019 SoC) is
> the same between these different products. But the hardware around the SoC is
> different and therefore requires a different "configuration"/calibration for
> the surrounding RF hardware. It is not a perfect match for your "separate
> property is fine" compromise. Maybe you still meant this - I let you decide.
>
>
> This is not only a problem on QCA4019 but also for other devices supported by
> ath10k. Waldemar Rymarkiewicz introduced the concept of BDF variants for
> this [1] and implemented the support for SMBIOS. The variant string (generated
> from the SMBIOS data) is then used by ath10k when it searches for the correct
> BDFs in the board-2.bin. Kalle Valo suggested to use the same mechanism for
> QCA401X based boards (which don't use SMBIOS).
>
> The "qcom,ath10k-calibration-variant" is now the (more or less) equivalent of
> the SMBIOS entry - but for device tree users. Let us assume that the variant
> string would be "RT-AC58U" for the Asus RT-AC58U and the first wifi device
> (bmi-board-id=16) gets initialized [2]. Then the step 4 would get splitted in
> following steps:
>
> 4.1. Get the the qcom,ath10k-calibration-variant content
> 4.2. jump to 4.5. when there is no qcom,ath10k-calibration-variant
> 4.3. calculate BDF search name with variant string
>      "bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U"
> 4.4. load BDF and when found, jump to 5.
> 4.5. calculate BDF search name without variant string
>      "bus=ahb,bmi-chip-id=0,bmi-board-id=16"
> 4.6. load the BDF
>
>
> There would be no changes in ath10k when adding a new BDF calibration variant
> using qcom,ath10k-calibration-variant. Only the device tree node would have to
> be updated:
>
>  * device tree (simplified):
>     / {
>       model = "ASUS RT-AC58U";
>
>       soc {
>         wifi@a000000 {
>           compatible = "qcom,ipq4019-wifi";
>           reg = <0xa000000 0x200000>;
>           status = "okay";
>           qcom,ath10k-calibration-variant = "RT-AC58U";
>         };
>
>         wifi@a800000 {
>           compatible = "qcom,ipq4019-wifi";
>           reg = <0xa800000 0x200000>;
>           status = "okay";
>           qcom,ath10k-calibration-variant = "RT-AC58U";
>         };
>       };
>     };
>  * ath10k + ath10k-firmware
>    <no change>
>
>
>
>
> This about how the calibration [insert swearword] works for
> "qcom,ipq4019-wifi" and why the "qcom,ath10k-calibration-variant" was used in
> my first implementation. But then you've suggested to "use a more specific
> compatible string". This information was not enough for me to understand what
> you've actually meant. I was therefore proposing some examples which show what
> you maybe could have meant. These were following things:
>
>> >  * qcom,ipq4019-wifi-asus-rt-ac58u
>> >  * qcom,ipq4019-wifi-fritzbox-4040
>> >  * qcom,ipq4019-wifi-netgear-whatever
>> >  * qcom,ipq4019-wifi-openmesh-i-have-no-idea
>
> They are basically "qcom,ipq4019-wifi" + a product specific string. The first
> part is therefore the string which identifies the wifi device(s) in the
> QCA4018/4019 SoC. The product specific string is simply the part (or a
> variation of it) which would been used before in
> "qcom,ath10k-calibration-variant" - just to make it "use a more specific
> compatible string".

It would probably be more like: "asus,rt-ac58u-wifi", "qcom,ipq4019-wifi"

A more specific compatible is insurance that at some later point in
time you can distinguish between 2 boards due to some difference even
if now you believe they are "the same".

> I have no idea if this is really what you meant. I just wanted to give you
> some examples and explanations why I don't feel that this a good idea. I
> thought that this would help you to point me in the right direction and
> explain better what you've meant.
>
> Right now it looks to me like following must be done for your(?) proposal for
> each new board:
>
>  * device tree (simplified):
>     / {
>       model = "ASUS RT-AC58U";
>
>       soc {
>         wifi@a000000 {
>           compatible = "qcom,ipq4019-wifi-asus-rt-ac58u";
>           reg = <0xa000000 0x200000>;
>           status = "okay";
>         };
>
>         wifi@a800000 {
>           compatible = "qcom,ipq4019-wifi-asus-rt-ac58u";
>           reg = <0xa800000 0x200000>;
>           status = "okay";
>         };
>       };
>     };
>  * ath10k + ath10k-firmware
>    - add qcom,ipq4019-wifi-asus-rt-ac58u to
>      Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt
>    - add qcom,ipq4019-wifi-asus-rt-ac58u to ath10k_ahb_of_match in
>      drivers/net/wireless/ath/ath10k/ahb.c
>    - add a mapping from qcom,ipq4019-wifi-asus-rt-ac58u to the RT-AC58U
>      variant string somewhere in ath10k
>
>
> I hope this is enough to understand it a little bit better.

I think the separate property is fine if this is the only one you
envision needing to add. If there's 10 more properties, then I'd feel
more strongly towards a board specific compatible string.

Rob

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

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

* Re: [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
  2017-03-22  2:56           ` Rob Herring
@ 2017-03-22  7:20             ` Sven Eckelmann
  2017-12-08  9:22               ` Kalle Valo
  0 siblings, 1 reply; 12+ messages in thread
From: Sven Eckelmann @ 2017-03-22  7:20 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mark Rutland, devicetree, linux-wireless, ath10k,
	ext.waldemar.rymarkiewicz, Kalle Valo


[-- Attachment #1.1: Type: text/plain, Size: 1367 bytes --]

On Dienstag, 21. März 2017 21:56:54 CET Rob Herring wrote:
[...]
> Is this always the case? There's never some variation beyond the
> reference design that a BDF difference can't handle?

I have no knowledge about anything which isn't handled directly by the BDF
variants. But maybe Kalle can correct me here.

[...]
> > They are basically "qcom,ipq4019-wifi" + a product specific string. The first
> > part is therefore the string which identifies the wifi device(s) in the
> > QCA4018/4019 SoC. The product specific string is simply the part (or a
> > variation of it) which would been used before in
> > "qcom,ath10k-calibration-variant" - just to make it "use a more specific
> > compatible string".
> 
> It would probably be more like: "asus,rt-ac58u-wifi", "qcom,ipq4019-wifi"
> 
> A more specific compatible is insurance that at some later point in
> time you can distinguish between 2 boards due to some difference even
> if now you believe they are "the same".
[...]
> I think the separate property is fine if this is the only one you
> envision needing to add. If there's 10 more properties, then I'd feel
> more strongly towards a board specific compatible string.

Thank you. Let's wait a little bit in case someone from QCA/Codeaurora
has some additional input.

But your comments were really helpful.

Kind regards,
	Sven

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 146 bytes --]

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

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

* Re: [PATCH 1/2] dt: bindings: add new dt entry for ath10k calibration variant
  2017-03-22  7:20             ` Sven Eckelmann
@ 2017-12-08  9:22               ` Kalle Valo
  0 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2017-12-08  9:22 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: Rob Herring, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless, ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	ext.waldemar.rymarkiewicz-++hxYGjEMp0AvxtiuMwx3w

Hi,

getting back to this old thread, here's the discussion:

https://patchwork.kernel.org/patch/9615183/

https://patchwork.kernel.org/patch/9615185/

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

> On Dienstag, 21. März 2017 21:56:54 CET Rob Herring wrote:
> [...]
>> Is this always the case? There's never some variation beyond the
>> reference design that a BDF difference can't handle?
>
> I have no knowledge about anything which isn't handled directly by the BDF
> variants. But maybe Kalle can correct me here.

Currently I'm not aware of any extra properties which we would need in
ath10k, having the custom board file seems to be the only requirement I
have seen.

>> > They are basically "qcom,ipq4019-wifi" + a product specific string. The first
>> > part is therefore the string which identifies the wifi device(s) in the
>> > QCA4018/4019 SoC. The product specific string is simply the part (or a
>> > variation of it) which would been used before in
>> > "qcom,ath10k-calibration-variant" - just to make it "use a more specific
>> > compatible string".
>> 
>> It would probably be more like: "asus,rt-ac58u-wifi", "qcom,ipq4019-wifi"
>> 
>> A more specific compatible is insurance that at some later point in
>> time you can distinguish between 2 boards due to some difference even
>> if now you believe they are "the same".
> [...]
>> I think the separate property is fine if this is the only one you
>> envision needing to add. If there's 10 more properties, then I'd feel
>> more strongly towards a board specific compatible string.
>
> Thank you. Let's wait a little bit in case someone from QCA/Codeaurora
> has some additional input.

I didn't see any comments from anyone else and I think Sven's approach
here is the best. Sven, can you submit v2 so that we get an ack from
device tree maintainers and I can apply these?

-- 
Kalle Valo

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

* Re: [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant
       [not found]   ` <20170310080615.22958-2-sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org>
@ 2017-12-08  9:27     ` Kalle Valo
  0 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2017-12-08  9:27 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	mark.rutland-5wv7dgnIgG8, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	ext.waldemar.rymarkiewicz-++hxYGjEMp0AvxtiuMwx3w

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

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

end of thread, other threads:[~2017-12-08  9:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/2] ath10k: search DT for qcom,ath10k-calibration-variant Sven Eckelmann
     [not found]   ` <20170310080615.22958-2-sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org>
2017-12-08  9:27     ` 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 16:28   ` Sven Eckelmann
2017-03-20 16:42     ` Adrian Chadd
2017-03-21  7:29       ` Sven Eckelmann
2017-03-21 13:00     ` Rob Herring
     [not found]       ` <CAL_Jsq+aEdjq9MR--Hyrw17KoKv=uZ7OBsAqX1_0+Djpw+QUCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-21 14:33         ` Sven Eckelmann
2017-03-22  2:56           ` Rob Herring
2017-03-22  7:20             ` Sven Eckelmann
2017-12-08  9:22               ` Kalle Valo

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).