2018-02-15 08:47:44

by Govind Singh

[permalink] [raw]
Subject: [PATCH 01/13] ath10k: platform driver for WCN3990 SNOC WLAN module

WCN3990 is integrated 802.11ac chipset with SNOC
bus interface. Add snoc layer driver registration
and associated ops.

WCN3990 support is not yet complete as cold-boot
handshake is done using qmi(Qualcomm-MSM-Interface)
and qmi client support will be added once qmi framework
is available.

Signed-off-by: Govind Singh <[email protected]>
---
drivers/net/wireless/ath/ath10k/Kconfig | 8 ++
drivers/net/wireless/ath/ath10k/Makefile | 4 +
drivers/net/wireless/ath/ath10k/snoc.c | 153 +++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/snoc.h | 76 +++++++++++++++
4 files changed, 241 insertions(+)
create mode 100644 drivers/net/wireless/ath/ath10k/snoc.c
create mode 100644 drivers/net/wireless/ath/ath10k/snoc.h

diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig
index deb5ae2..1b317eb 100644
--- a/drivers/net/wireless/ath/ath10k/Kconfig
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
@@ -36,6 +36,14 @@ config ATH10K_USB
This module adds experimental support for USB bus. Currently
work in progress and will not fully work.

+config ATH10K_SNOC
+ tristate "Qualcomm ath10k SNOC support (EXPERIMENTAL)"
+ depends on ATH10K && ARCH_QCOM
+ ---help---
+ This module adds support for integrated WCN3990 chip connected
+ to system NOC(SNOC). Currently work in progress and will not
+ fully work.
+
config ATH10K_DEBUG
bool "Atheros ath10k debugging"
depends on ATH10K
diff --git a/drivers/net/wireless/ath/ath10k/Makefile b/drivers/net/wireless/ath/ath10k/Makefile
index 6739ac2..390fde0 100644
--- a/drivers/net/wireless/ath/ath10k/Makefile
+++ b/drivers/net/wireless/ath/ath10k/Makefile
@@ -35,5 +35,9 @@ ath10k_sdio-y += sdio.o
obj-$(CONFIG_ATH10K_USB) += ath10k_usb.o
ath10k_usb-y += usb.o

+obj-$(CONFIG_ATH10K_SNOC) += ath10k_snoc.o
+ath10k_snoc-y += snoc.o \
+ ce.o
+
# for tracing framework to find trace.h
CFLAGS_trace.o := -I$(src)
diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c
new file mode 100644
index 0000000..30354a6
--- /dev/null
+++ b/drivers/net/wireless/ath/ath10k/snoc.c
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include "debug.h"
+#include "hif.h"
+#include "htc.h"
+#include "ce.h"
+#include "snoc.h"
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+
+static const struct ath10k_snoc_drv_priv drv_priv = {
+ .hw_rev = ATH10K_HW_WCN3990,
+ .dma_mask = DMA_BIT_MASK(37),
+};
+
+void ath10k_snoc_write32(struct ath10k *ar, u32 offset, u32 value)
+{
+ struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
+
+ iowrite32(value, ar_snoc->mem + offset);
+}
+
+u32 ath10k_snoc_read32(struct ath10k *ar, u32 offset)
+{
+ struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
+ u32 val;
+
+ val = ioread32(ar_snoc->mem + offset);
+
+ return val;
+}
+
+static const struct ath10k_hif_ops ath10k_snoc_hif_ops = {
+ .read32 = ath10k_snoc_read32,
+ .write32 = ath10k_snoc_write32,
+};
+
+static const struct ath10k_bus_ops ath10k_snoc_bus_ops = {
+ .read32 = ath10k_snoc_read32,
+ .write32 = ath10k_snoc_write32,
+};
+
+static const struct of_device_id ath10k_snoc_dt_match[] = {
+ { .compatible = "qcom,wcn3990-wifi",
+ .data = &drv_priv,
+ },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ath10k_snoc_dt_match);
+
+static int ath10k_snoc_probe(struct platform_device *pdev)
+{
+ const struct ath10k_snoc_drv_priv *drv_data;
+ const struct of_device_id *of_id;
+ struct ath10k_snoc *ar_snoc;
+ struct device *dev;
+ struct ath10k *ar;
+ int ret;
+
+ of_id = of_match_device(ath10k_snoc_dt_match, &pdev->dev);
+ if (!of_id) {
+ dev_err(&pdev->dev, "failed to find matching device tree id\n");
+ return -EINVAL;
+ }
+
+ drv_data = of_id->data;
+ dev = &pdev->dev;
+
+ ret = dma_set_mask_and_coherent(dev, drv_data->dma_mask);
+ if (ret) {
+ dev_err(dev, "failed to set dma mask: %d", ret);
+ return ret;
+ }
+
+ ar = ath10k_core_create(sizeof(*ar_snoc), dev, ATH10K_BUS_SNOC,
+ drv_data->hw_rev, &ath10k_snoc_hif_ops);
+ if (!ar) {
+ dev_err(dev, "failed to allocate core\n");
+ return -ENOMEM;
+ }
+
+ ar_snoc = ath10k_snoc_priv(ar);
+ ar_snoc->dev = pdev;
+ platform_set_drvdata(pdev, ar);
+ ar_snoc->ar = ar;
+ ar_snoc->ce.bus_ops = &ath10k_snoc_bus_ops;
+ ar->ce_priv = &ar_snoc->ce;
+
+ ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc probe\n");
+ ath10k_warn(ar, "Warning: SNOC support is still work-in-progress, it will not work properly!");
+
+ return ret;
+}
+
+static int ath10k_snoc_remove(struct platform_device *pdev)
+{
+ struct ath10k *ar = platform_get_drvdata(pdev);
+
+ ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n");
+ ath10k_core_destroy(ar);
+
+ return 0;
+}
+
+static struct platform_driver ath10k_snoc_driver = {
+ .probe = ath10k_snoc_probe,
+ .remove = ath10k_snoc_remove,
+ .driver = {
+ .name = "ath10k_snoc",
+ .owner = THIS_MODULE,
+ .of_match_table = ath10k_snoc_dt_match,
+ },
+};
+
+static int __init ath10k_snoc_init(void)
+{
+ int ret;
+
+ ret = platform_driver_register(&ath10k_snoc_driver);
+ if (ret)
+ pr_err("failed to register ath10k snoc driver: %d\n",
+ ret);
+
+ return ret;
+}
+module_init(ath10k_snoc_init);
+
+static void __exit ath10k_snoc_exit(void)
+{
+ platform_driver_unregister(&ath10k_snoc_driver);
+}
+module_exit(ath10k_snoc_exit);
+
+MODULE_AUTHOR("Qualcomm");
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_DESCRIPTION("Driver support for Atheros WCN3990 SNOC devices");
diff --git a/drivers/net/wireless/ath/ath10k/snoc.h b/drivers/net/wireless/ath/ath10k/snoc.h
new file mode 100644
index 0000000..cf65b01
--- /dev/null
+++ b/drivers/net/wireless/ath/ath10k/snoc.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _SNOC_H_
+#define _SNOC_H_
+
+#include "hw.h"
+#include "ce.h"
+#include "pci.h"
+
+struct ath10k_snoc_drv_priv {
+ enum ath10k_hw_rev hw_rev;
+ u64 dma_mask;
+};
+
+struct snoc_state {
+ u32 pipe_cfg_addr;
+ u32 svc_to_pipe_map;
+};
+
+struct ath10k_snoc_pipe {
+ struct ath10k_ce_pipe *ce_hdl;
+ u8 pipe_num;
+ struct ath10k *hif_ce_state;
+ size_t buf_sz;
+ /* protect ce info */
+ spinlock_t pipe_lock;
+ struct ath10k_snoc *ar_snoc;
+};
+
+struct ath10k_snoc_target_info {
+ u32 target_version;
+ u32 target_type;
+ u32 target_revision;
+ u32 soc_version;
+};
+
+struct ath10k_snoc_ce_irq {
+ u32 irq_line;
+};
+
+struct ath10k_snoc {
+ struct platform_device *dev;
+ struct ath10k *ar;
+ void __iomem *mem;
+ dma_addr_t mem_pa;
+ struct ath10k_snoc_target_info target_info;
+ size_t mem_len;
+ struct ath10k_snoc_pipe pipe_info[CE_COUNT_MAX];
+ struct ath10k_snoc_ce_irq ce_irqs[CE_COUNT_MAX];
+ struct ath10k_ce ce;
+ struct timer_list rx_post_retry;
+};
+
+static inline struct ath10k_snoc *ath10k_snoc_priv(struct ath10k *ar)
+{
+ return (struct ath10k_snoc *)ar->drv_priv;
+}
+
+void ath10k_snoc_write32(struct ath10k *ar, u32 offset, u32 value);
+u32 ath10k_snoc_read32(struct ath10k *ar, u32 offset);
+
+#endif /* _SNOC_H_ */
--
1.9.1


2018-03-01 10:06:45

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 01/13] ath10k: platform driver for WCN3990 SNOC WLAN module

Govind Singh <[email protected]> writes:

> WCN3990 is integrated 802.11ac chipset with SNOC
> bus interface. Add snoc layer driver registration
> and associated ops.
>
> WCN3990 support is not yet complete as cold-boot
> handshake is done using qmi(Qualcomm-MSM-Interface)
> and qmi client support will be added once qmi framework
> is available.
>
> Signed-off-by: Govind Singh <[email protected]>

Kbuild bot found an odd problem with this patch:

include/linux/dynamic_debug.h:77:14: error: 'KBUILD_MODNAME'
undeclared (first use in this function); did you mean
'KBUILD_BASENAME'?

Full report:

http://lists.infradead.org/pipermail/ath10k/2018-February/010907.html

Any ideas? Is this is some unrelated issue or what? This patch is not
even touching hif.h or ce.c.

--
Kalle Valo

2018-03-06 12:41:32

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 01/13] ath10k: platform driver for WCN3990 SNOC WLAN module

(Fixed Govind's top posting and adding Masahiro)

>>> WCN3990 is integrated 802.11ac chipset with SNOC bus interface. Add
>>> snoc layer driver registration and associated ops.
>>>
>>> WCN3990 support is not yet complete as cold-boot handshake is done
>>> using qmi(Qualcomm-MSM-Interface) and qmi client support will be added
>>> once qmi framework is available.
>>>
>>> Signed-off-by: Govind Singh <[email protected]>
>>
>> Kbuild bot found an odd problem with this patch:
>>
>> include/linux/dynamic_debug.h:77:14: error: 'KBUILD_MODNAME'
>> undeclared (first use in this function); did you mean 'KBUILD_BASENAME'?
>>
>> Full report:
>>
>> http://lists.infradead.org/pipermail/ath10k/2018-February/010907.html
>>
>> Any ideas? Is this is some unrelated issue or what? This patch is not
>> even touching hif.h or ce.c.
>
> I didn't encountered this issue as in my defconfig only
> CONFIG_ATH10K_SNOC was defined. This problem is coming when we define
> CONFIG_ATH10K_SNOC and CONFIG_ATH10K_PCI simultaneously in defconfig
> and this is known issue when multiple modules share objects(in this
> case ce.o). I saw similar reported problem and found
> https://patchwork.kernel.org/patch/10060825/.
>
> After picking the below change issue is not seen.

Let's ask the kbuild maintainer. Masahiro, any chances of getting this
patch applied anytime soon:

kbuild: define KBUILD_MODNAME even if multiple modules share objects

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

In ath10k we would need it as otherwise we are not able to link ce.o
both to ath10k_pci.ko and ath10k_snoc.ko. What do you think?

Full discussion and the ath10k patch here:

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

--
Kalle Valo

2018-03-08 00:25:40

by Masahiro Yamada

[permalink] [raw]
Subject: RE: [PATCH 01/13] ath10k: platform driver for WCN3990 SNOC WLAN module

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogS2FsbGUgVmFsbyBbbWFp
bHRvOmt2YWxvQGNvZGVhdXJvcmEub3JnXQ0KPiBTZW50OiBUdWVzZGF5LCBNYXJjaCAwNiwgMjAx
OCA5OjQxIFBNDQo+IFRvOiBHb3ZpbmQgU2luZ2ggPGdvdmluZHNAY29kZWF1cm9yYS5vcmc+OyBZ
YW1hZGEsIE1hc2FoaXJvLxskQjszRUQbKEIgGyRCPz85MBsoQg0KPiA8eWFtYWRhLm1hc2FoaXJv
QHNvY2lvbmV4dC5jb20+DQo+IENjOiBsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmc7IGF0
aDEwa0BsaXN0cy5pbmZyYWRlYWQub3JnDQo+IFN1YmplY3Q6IFJlOiBbUEFUQ0ggMDEvMTNdIGF0
aDEwazogcGxhdGZvcm0gZHJpdmVyIGZvciBXQ04zOTkwIFNOT0MgV0xBTg0KPiBtb2R1bGUNCj4g
DQo+IChGaXhlZCBHb3ZpbmQncyB0b3AgcG9zdGluZyBhbmQgYWRkaW5nIE1hc2FoaXJvKQ0KPiAN
Cj4gPj4+IFdDTjM5OTAgaXMgaW50ZWdyYXRlZCA4MDIuMTFhYyBjaGlwc2V0IHdpdGggU05PQyBi
dXMgaW50ZXJmYWNlLiBBZGQNCj4gPj4+IHNub2MgbGF5ZXIgZHJpdmVyIHJlZ2lzdHJhdGlvbiBh
bmQgYXNzb2NpYXRlZCBvcHMuDQo+ID4+Pg0KPiA+Pj4gV0NOMzk5MCBzdXBwb3J0IGlzIG5vdCB5
ZXQgY29tcGxldGUgYXMgY29sZC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zOi8vcGF0Y2h3b3JrLmtlcm5lbC5vcmcvcGF0
Y2gvMTAyMjA2NTcvDQo+IA0KDQpJIHBsYW4gdG8gc3VibWl0IHYyLCBidXQgZXZlbiBpZiB0aGUg
dW5kZWZpbmVkIEtCVUlMRF9NT0ROQU1FIGlzIGZpeGVkLA0KSSBleHBlY3QgYW5vdGhlciBwcm9i
bGVtIGZyb20gdGhpcyBwYXRjaC4NCg0KSWYgYm90aCBDT05GSUdfQVRIMTBLX1BDSSBhbmQgQ09O
RklHX0FUSDEwX1NOT0MgYXJlICd5Jw0KdHdvIGluc3RhbmNlcyBvZiBjZS5vIHdvdWxkIGJlIGxp
bmtlZCBpbnRvIHZtbGl1eCwNCnRoZW4gY2F1c2VzIG11bHRpcGxlIGRlZmluaXRpb24gZXJyb3Iu
DQoNCg==

2018-03-23 11:54:56

by Govind Singh

[permalink] [raw]
Subject: Re: [PATCH 01/13] ath10k: platform driver for WCN3990 SNOC WLAN module

On 2018-03-10 14:41, Kalle Valo wrote:
> <[email protected]> writes:
>
>>> >> Kbuild bot found an odd problem with this patch:
>>> >>
>>> >> include/linux/dynamic_debug.h:77:14: error: 'KBUILD_MODNAME'
>>> >> undeclared (first use in this function); did you mean
>>> 'KBUILD_BASENAME'?
>>> >>
>>> >> Full report:
>>> >>
>>> >>
>>> http://lists.infradead.org/pipermail/ath10k/2018-February/010907.html
>>> >>
>>> >> Any ideas? Is this is some unrelated issue or what? This patch is not
>>> >> even touching hif.h or ce.c.
>>> >
>>> > I didn't encountered this issue as in my defconfig only
>>> > CONFIG_ATH10K_SNOC was defined. This problem is coming when we define
>>> > CONFIG_ATH10K_SNOC and CONFIG_ATH10K_PCI simultaneously in defconfig
>>> > and this is known issue when multiple modules share objects(in this
>>> > case ce.o). I saw similar reported problem and found
>>> > https://patchwork.kernel.org/patch/10060825/.
>>> >
>>> > After picking the below change issue is not seen.
>>>
>>> Let's ask the kbuild maintainer. Masahiro, any chances of getting
>>> this
>>> patch applied anytime soon:
>>>
>>> kbuild: define KBUILD_MODNAME even if multiple modules share objects
>>>
>>> https://patchwork.kernel.org/patch/10060825/
>>>
>>> In ath10k we would need it as otherwise we are not able to link ce.o
>>> both to ath10k_pci.ko and ath10k_snoc.ko. What do you think?
>>>
>>> Full discussion and the ath10k patch here:
>>>
>>> https://patchwork.kernel.org/patch/10220657/
>>>
>>
>> I plan to submit v2, but even if the undefined KBUILD_MODNAME is
>> fixed,
>> I expect another problem from this patch.
>>
>> If both CONFIG_ATH10K_PCI and CONFIG_ATH10_SNOC are 'y'
>> two instances of ce.o would be linked into vmliux,
>> then causes multiple definition error.
>
> Oh, I didn't realise this. Thanks for pointing it out. Govind is
> looking
> at other ways to fix this.

https://patchwork.kernel.org/patch/10298659/ is raised to address this
problem.

Thanks,
Govind

2018-03-01 10:13:43

by Govind Singh

[permalink] [raw]
Subject: RE: [PATCH 01/13] ath10k: platform driver for WCN3990 SNOC WLAN module

Hi Kalle,

I didn't encountered this issue as in my defconfig only CONFIG_ATH10K_SNOC =
was defined.
This problem is coming when we define CONFIG_ATH10K_SNOC and CONFIG_ATH10K_=
PCI simultaneously in defconfig and this is=20
known issue when multiple modules share objects(in this case ce.o). I saw s=
imilar reported problem and found https://patchwork.kernel.org/patch/100608=
25/.

After picking the below change issue is not seen.

BR,
Govind

-----Original Message-----
From: ath10k [mailto:[email protected]] On Behalf Of Kalle=
Valo
Sent: Thursday, March 1, 2018 3:37 PM
To: Govind Singh <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 01/13] ath10k: platform driver for WCN3990 SNOC WLAN mo=
dule

Govind Singh <[email protected]> writes:

> WCN3990 is integrated 802.11ac chipset with SNOC bus interface. Add=20
> snoc layer driver registration and associated ops.
>
> WCN3990 support is not yet complete as cold-boot handshake is done=20
> using qmi(Qualcomm-MSM-Interface) and qmi client support will be added=20
> once qmi framework is available.
>
> Signed-off-by: Govind Singh <[email protected]>

Kbuild bot found an odd problem with this patch:

include/linux/dynamic_debug.h:77:14: error: 'KBUILD_MODNAME'
undeclared (first use in this function); did you mean 'KBUILD_BASENAME'?

Full report:

http://lists.infradead.org/pipermail/ath10k/2018-February/010907.html

Any ideas? Is this is some unrelated issue or what? This patch is not even =
touching hif.h or ce.c.

--
Kalle Valo

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

2018-03-10 09:11:36

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 01/13] ath10k: platform driver for WCN3990 SNOC WLAN module

<[email protected]> writes:

>> >> Kbuild bot found an odd problem with this patch:
>> >>
>> >> include/linux/dynamic_debug.h:77:14: error: 'KBUILD_MODNAME'
>> >> undeclared (first use in this function); did you mean
>> 'KBUILD_BASENAME'?
>> >>
>> >> Full report:
>> >>
>> >>
>> http://lists.infradead.org/pipermail/ath10k/2018-February/010907.html
>> >>
>> >> Any ideas? Is this is some unrelated issue or what? This patch is not
>> >> even touching hif.h or ce.c.
>> >
>> > I didn't encountered this issue as in my defconfig only
>> > CONFIG_ATH10K_SNOC was defined. This problem is coming when we define
>> > CONFIG_ATH10K_SNOC and CONFIG_ATH10K_PCI simultaneously in defconfig
>> > and this is known issue when multiple modules share objects(in this
>> > case ce.o). I saw similar reported problem and found
>> > https://patchwork.kernel.org/patch/10060825/.
>> >
>> > After picking the below change issue is not seen.
>>
>> Let's ask the kbuild maintainer. Masahiro, any chances of getting this
>> patch applied anytime soon:
>>
>> kbuild: define KBUILD_MODNAME even if multiple modules share objects
>>
>> https://patchwork.kernel.org/patch/10060825/
>>
>> In ath10k we would need it as otherwise we are not able to link ce.o
>> both to ath10k_pci.ko and ath10k_snoc.ko. What do you think?
>>
>> Full discussion and the ath10k patch here:
>>
>> https://patchwork.kernel.org/patch/10220657/
>>
>
> I plan to submit v2, but even if the undefined KBUILD_MODNAME is fixed,
> I expect another problem from this patch.
>
> If both CONFIG_ATH10K_PCI and CONFIG_ATH10_SNOC are 'y'
> two instances of ce.o would be linked into vmliux,
> then causes multiple definition error.

Oh, I didn't realise this. Thanks for pointing it out. Govind is looking
at other ways to fix this.

--
Kalle Valo

2018-04-04 01:56:15

by Masahiro Yamada

[permalink] [raw]
Subject: RE: [PATCH 01/13] ath10k: platform driver for WCN3990 SNOC WLAN module

SGkuDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogZ292aW5kc0Bjb2Rl
YXVyb3JhLm9yZyBbbWFpbHRvOmdvdmluZHNAY29kZWF1cm9yYS5vcmddDQo+IFNlbnQ6IEZyaWRh
eSwgTWFyY2ggMjMsIDIwMTggODo1NSBQTQ0KPiBUbzogS2FsbGUgVmFsbyA8a3ZhbG9AY29kZWF1
cm9yYS5vcmc+DQo+IENjOiBZYW1hZGEsIE1hc2FoaXJvLxskQjszRUQbKEIgGyRCPz85MBsoQiA8
eWFtYWRhLm1hc2FoaXJvQHNvY2lvbmV4dC5jb20+Ow0KPiBsaW51eC13aXJlbGVzc0B2Z2VyLmtl
cm5lbC5vcmc7IGF0aDEwa0BsaXN0cy5pbmZyYWRlYWQub3JnDQo+IFN1YmplY3Q6IFJlOiBbUEFU
Q0ggMDEvMTNdIGF0aDEwazogcGxhdGZvcm0gZHJpdmVyIGZvciBXQ04zOTkwIFNOT0MgV0xBTg0K
PiBtb2R1bGUNCj4gDQo+IE9uIDIwMTgtMDMtMTAgMTQ6NDEsIEthbGxlIFZhbG8gd3JvdGU6DQo+
ID4gPHlhbWFkYS5tYXNhaGlyb0Bzb2Npb25leHQuY29tPiB3cml0ZXM6DQo+ID4NCj4gPj4+ID4+
IEtidWlsZCBib3QgZm91bmQgYW4gb2RkIHByb2JsZW0gd2l0aCB0aGlzIHBhdGNoOg0KPiA+Pj4g
Pj4NCj4gPj4+ID4+ICBpbmNsdWRlL2xpbnV4L2R5bmFtaWNfZGVidWcuaDo3NzoxNDogZXJyb3I6
ICdLQlVJTERfTU9ETkFNRScNCj4gPj4+ID4+ICB1bmRlY2xhcmVkIChmaXJzdCB1c2UgaW4gdGhp
c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