2017-03-30 09:19:42

by Xinming Hu

[permalink] [raw]
Subject: [PATCH 1/3] mwifiex: remove unnecessary wakeup interrupt number sanity check

From: Xinming Hu <[email protected]>

Sanity check of interrupt number in interrupt handler is unnecessary and
confusion, remove it.

Signed-off-by: Xinming Hu <[email protected]>
Signed-off-by: Amitkumar Karwar <[email protected]>
---
drivers/net/wireless/marvell/mwifiex/main.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 30f4994..5e82602 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -1503,11 +1503,9 @@ static irqreturn_t mwifiex_irq_wakeup_handler(int irq, void *priv)
{
struct mwifiex_adapter *adapter = priv;

- if (adapter->irq_wakeup >= 0) {
- dev_dbg(adapter->dev, "%s: wake by wifi", __func__);
- adapter->wake_by_wifi = true;
- disable_irq_nosync(irq);
- }
+ dev_dbg(adapter->dev, "%s: wake by wifi", __func__);
+ adapter->wake_by_wifi = true;
+ disable_irq_nosync(irq);

/* Notify PM core we are wakeup source */
pm_wakeup_event(adapter->dev, 0);
--
1.8.1.4


2017-03-30 09:19:57

by Xinming Hu

[permalink] [raw]
Subject: [PATCH 3/3] mwifiex: pcie: avoid hardcode wifi-only firmware name

From: Xinming Hu <[email protected]>

Wifi-only firmware name should be chipset specific.

Signed-off-by: Xinming Hu <[email protected]>
Signed-off-by: Amitkumar Karwar <[email protected]>
---
drivers/net/wireless/marvell/mwifiex/pcie.c | 8 +++++++-
drivers/net/wireless/marvell/mwifiex/pcie.h | 6 ++++++
2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index 59cb01a..282aa9a 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -351,6 +351,12 @@ static void mwifiex_pcie_reset_notify(struct pci_dev *pdev, bool prepare)
struct pcie_service_card *card = pci_get_drvdata(pdev);
struct mwifiex_adapter *adapter = card->adapter;

+ if (!card->pcie.flr_support) {
+ pr_err("%s: FLR disabled in current chipset\n", __func__);
+ return;
+ }
+
+ adapter = card->adapter;
if (!adapter) {
dev_err(&pdev->dev, "%s: adapter structure is not valid\n",
__func__);
@@ -3047,7 +3053,7 @@ static void mwifiex_pcie_up_dev(struct mwifiex_adapter *adapter)
* during pcie FLR, so that bluetooth part of firmware which is
* already running doesn't get affected.
*/
- strcpy(adapter->fw_name, PCIE8997_DEFAULT_WIFIFW_NAME);
+ strcpy(adapter->fw_name, card->pcie.wifi_fw_name);

/* tx_buf_size might be changed to 3584 by firmware during
* data transfer, we should reset it to default size.
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.h b/drivers/net/wireless/marvell/mwifiex/pcie.h
index 00e8ee5..d6c8526 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.h
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.h
@@ -285,6 +285,8 @@ struct mwifiex_pcie_device {
struct memory_type_mapping *mem_type_mapping_tbl;
u8 num_mem_types;
bool can_ext_scan;
+ u8 flr_support;
+ char *wifi_fw_name;
};

static const struct mwifiex_pcie_device mwifiex_pcie8766 = {
@@ -293,6 +295,7 @@ struct mwifiex_pcie_device {
.tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
.can_dump_fw = false,
.can_ext_scan = true,
+ .flr_support = 0,
};

static const struct mwifiex_pcie_device mwifiex_pcie8897 = {
@@ -303,6 +306,7 @@ struct mwifiex_pcie_device {
.mem_type_mapping_tbl = mem_type_mapping_tbl_w8897,
.num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl_w8897),
.can_ext_scan = true,
+ .flr_support = 0,
};

static const struct mwifiex_pcie_device mwifiex_pcie8997 = {
@@ -313,6 +317,8 @@ struct mwifiex_pcie_device {
.mem_type_mapping_tbl = mem_type_mapping_tbl_w8997,
.num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl_w8997),
.can_ext_scan = true,
+ .flr_support = 1,
+ .wifi_fw_name = "mrvl/pcie8997_wlan_v4.bin",
};

struct mwifiex_evt_buf_desc {
--
1.8.1.4

2017-03-30 09:19:44

by Xinming Hu

[permalink] [raw]
Subject: [PATCH 2/3] mwifiex: using general print function during device intialization

From: Xinming Hu <[email protected]>

adapter->dev is initialized after mwifiex_register done, before that
print message by general pr_* function

Signed-off-by: Xinming Hu <[email protected]>
Signed-off-by: Amitkumar Karwar <[email protected]>
---
drivers/net/wireless/marvell/mwifiex/pcie.c | 78 ++++++++++++-----------------
drivers/net/wireless/marvell/mwifiex/sdio.c | 3 +-
2 files changed, 34 insertions(+), 47 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index e381def..59cb01a 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -60,7 +60,7 @@ static int mwifiex_pcie_probe_of(struct device *dev)

mapping.addr = pci_map_single(card->dev, skb->data, size, flags);
if (pci_dma_mapping_error(card->dev, mapping.addr)) {
- mwifiex_dbg(adapter, ERROR, "failed to map pci memory!\n");
+ pr_err("failed to map pci memory!\n");
return -1;
}
mapping.len = size;
@@ -594,7 +594,7 @@ static int mwifiex_init_rxq_ring(struct mwifiex_adapter *adapter)
skb = mwifiex_alloc_dma_align_buf(MWIFIEX_RX_DATA_BUF_SIZE,
GFP_KERNEL);
if (!skb) {
- mwifiex_dbg(adapter, ERROR,
+ pr_err(
"Unable to allocate skb for RX ring.\n");
kfree(card->rxbd_ring_vbase);
return -ENOMEM;
@@ -651,8 +651,7 @@ static int mwifiex_pcie_init_evt_ring(struct mwifiex_adapter *adapter)
/* Allocate skb here so that firmware can DMA data from it */
skb = dev_alloc_skb(MAX_EVENT_SIZE);
if (!skb) {
- mwifiex_dbg(adapter, ERROR,
- "Unable to allocate skb for EVENT buf.\n");
+ pr_err("Unable to allocate skb for EVENT buf.\n");
kfree(card->evtbd_ring_vbase);
return -ENOMEM;
}
@@ -818,16 +817,14 @@ static int mwifiex_pcie_create_txbd_ring(struct mwifiex_adapter *adapter)
card->txbd_ring_size,
&card->txbd_ring_pbase);
if (!card->txbd_ring_vbase) {
- mwifiex_dbg(adapter, ERROR,
- "allocate consistent memory (%d bytes) failed!\n",
- card->txbd_ring_size);
+ pr_err("allocate consistent memory (%d bytes) failed!\n",
+ card->txbd_ring_size);
return -ENOMEM;
}
- mwifiex_dbg(adapter, DATA,
- "info: txbd_ring - base: %p, pbase: %#x:%x, len: %x\n",
- card->txbd_ring_vbase, (unsigned int)card->txbd_ring_pbase,
- (u32)((u64)card->txbd_ring_pbase >> 32),
- card->txbd_ring_size);
+ pr_notice("info: txbd_ring - base: %p, pbase: %#x:%x, len: %x\n",
+ card->txbd_ring_vbase, (unsigned int)card->txbd_ring_pbase,
+ (u32)((u64)card->txbd_ring_pbase >> 32),
+ card->txbd_ring_size);

return mwifiex_init_txq_ring(adapter);
}
@@ -875,24 +872,21 @@ static int mwifiex_pcie_create_rxbd_ring(struct mwifiex_adapter *adapter)
card->rxbd_ring_size = sizeof(struct mwifiex_pcie_buf_desc) *
MWIFIEX_MAX_TXRX_BD;

- mwifiex_dbg(adapter, INFO,
- "info: rxbd_ring: Allocating %d bytes\n",
- card->rxbd_ring_size);
+ pr_info("info: rxbd_ring: Allocating %d bytes\n",
+ card->rxbd_ring_size);
card->rxbd_ring_vbase = pci_alloc_consistent(card->dev,
card->rxbd_ring_size,
&card->rxbd_ring_pbase);
if (!card->rxbd_ring_vbase) {
- mwifiex_dbg(adapter, ERROR,
- "allocate consistent memory (%d bytes) failed!\n",
- card->rxbd_ring_size);
+ pr_err("allocate consistent memory (%d bytes) failed!\n",
+ card->rxbd_ring_size);
return -ENOMEM;
}

- mwifiex_dbg(adapter, DATA,
- "info: rxbd_ring - base: %p, pbase: %#x:%x, len: %#x\n",
- card->rxbd_ring_vbase, (u32)card->rxbd_ring_pbase,
- (u32)((u64)card->rxbd_ring_pbase >> 32),
- card->rxbd_ring_size);
+ pr_notice("info: rxbd_ring - base: %p, pbase: %#x:%x, len: %#x\n",
+ card->rxbd_ring_vbase, (u32)card->rxbd_ring_pbase,
+ (u32)((u64)card->rxbd_ring_pbase >> 32),
+ card->rxbd_ring_size);

return mwifiex_init_rxq_ring(adapter);
}
@@ -939,24 +933,21 @@ static int mwifiex_pcie_create_evtbd_ring(struct mwifiex_adapter *adapter)
card->evtbd_ring_size = sizeof(struct mwifiex_evt_buf_desc) *
MWIFIEX_MAX_EVT_BD;

- mwifiex_dbg(adapter, INFO,
- "info: evtbd_ring: Allocating %d bytes\n",
+ pr_info("info: evtbd_ring: Allocating %d bytes\n",
card->evtbd_ring_size);
card->evtbd_ring_vbase = pci_alloc_consistent(card->dev,
card->evtbd_ring_size,
&card->evtbd_ring_pbase);
if (!card->evtbd_ring_vbase) {
- mwifiex_dbg(adapter, ERROR,
- "allocate consistent memory (%d bytes) failed!\n",
- card->evtbd_ring_size);
+ pr_err("allocate consistent memory (%d bytes) failed!\n",
+ card->evtbd_ring_size);
return -ENOMEM;
}

- mwifiex_dbg(adapter, EVENT,
- "info: CMDRSP/EVT bd_ring - base: %p pbase: %#x:%x len: %#x\n",
- card->evtbd_ring_vbase, (u32)card->evtbd_ring_pbase,
- (u32)((u64)card->evtbd_ring_pbase >> 32),
- card->evtbd_ring_size);
+ pr_notice("info: CMDRSP/EVT bd_ring - base: %p pbase: %#x:%x len: %#x\n",
+ card->evtbd_ring_vbase, (u32)card->evtbd_ring_pbase,
+ (u32)((u64)card->evtbd_ring_pbase >> 32),
+ card->evtbd_ring_size);

return mwifiex_pcie_init_evt_ring(adapter);
}
@@ -995,8 +986,7 @@ static int mwifiex_pcie_alloc_cmdrsp_buf(struct mwifiex_adapter *adapter)
/* Allocate memory for receiving command response data */
skb = dev_alloc_skb(MWIFIEX_UPLD_SIZE);
if (!skb) {
- mwifiex_dbg(adapter, ERROR,
- "Unable to allocate skb for command response data.\n");
+ pr_err("Unable to allocate skb for command response data.\n");
return -ENOMEM;
}
skb_put(skb, MWIFIEX_UPLD_SIZE);
@@ -1045,17 +1035,15 @@ static int mwifiex_pcie_alloc_sleep_cookie_buf(struct mwifiex_adapter *adapter)
card->sleep_cookie_vbase = pci_alloc_consistent(card->dev, sizeof(u32),
&card->sleep_cookie_pbase);
if (!card->sleep_cookie_vbase) {
- mwifiex_dbg(adapter, ERROR,
- "pci_alloc_consistent failed!\n");
+ pr_err("pci_alloc_consistent failed!\n");
return -ENOMEM;
}
/* Init val of Sleep Cookie */
tmp = FW_AWAKE_COOKIE;
put_unaligned(tmp, card->sleep_cookie_vbase);

- mwifiex_dbg(adapter, INFO,
- "alloc_scook: sleep cookie=0x%x\n",
- get_unaligned(card->sleep_cookie_vbase));
+ pr_info("alloc_scook: sleep cookie=0x%x\n",
+ get_unaligned(card->sleep_cookie_vbase));

return 0;
}
@@ -3069,32 +3057,32 @@ static void mwifiex_pcie_up_dev(struct mwifiex_adapter *adapter)
card->cmdrsp_buf = NULL;
ret = mwifiex_pcie_create_txbd_ring(adapter);
if (ret) {
- mwifiex_dbg(adapter, ERROR, "Failed to create txbd ring\n");
+ pr_err("Failed to create txbd ring\n");
goto err_cre_txbd;
}

ret = mwifiex_pcie_create_rxbd_ring(adapter);
if (ret) {
- mwifiex_dbg(adapter, ERROR, "Failed to create rxbd ring\n");
+ pr_err("Failed to create rxbd ring\n");
goto err_cre_rxbd;
}

ret = mwifiex_pcie_create_evtbd_ring(adapter);
if (ret) {
- mwifiex_dbg(adapter, ERROR, "Failed to create evtbd ring\n");
+ pr_err("Failed to create evtbd ring\n");
goto err_cre_evtbd;
}

ret = mwifiex_pcie_alloc_cmdrsp_buf(adapter);
if (ret) {
- mwifiex_dbg(adapter, ERROR, "Failed to allocate cmdbuf buffer\n");
+ pr_err("Failed to allocate cmdbuf buffer\n");
goto err_alloc_cmdbuf;
}

if (reg->sleep_cookie) {
ret = mwifiex_pcie_alloc_sleep_cookie_buf(adapter);
if (ret) {
- mwifiex_dbg(adapter, ERROR, "Failed to allocate sleep_cookie buffer\n");
+ pr_err("Failed to allocate sleep_cookie buffer\n");
goto err_alloc_cookie;
}
} else {
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 58d3da0..596282e 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -631,8 +631,7 @@ static int mwifiex_init_sdio_ioport(struct mwifiex_adapter *adapter)
else
return -1;
cont:
- mwifiex_dbg(adapter, INFO,
- "info: SDIO FUNC1 IO port: %#x\n", adapter->ioport);
+ pr_info("info: SDIO FUNC1 IO port: %#x\n", adapter->ioport);

/* Set Host interrupt reset to read to clear */
if (!mwifiex_read_reg(adapter, card->reg->host_int_rsr_reg, &reg))
--
1.8.1.4

2017-03-31 22:37:04

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 1/3] mwifiex: remove unnecessary wakeup interrupt number sanity check

On Thu, Mar 30, 2017 at 2:19 AM, Xinming Hu <[email protected]> wrote:
> From: Xinming Hu <[email protected]>
>
> Sanity check of interrupt number in interrupt handler is unnecessary and
> confusion, remove it.

I'd reworded the explanation a bit: "If wakeup interrupt handler is
called, we know that the wakeup interrupt number is valid, there is no
need to check it."

Otherwise:

Reviewed-by: Dmitry Torokhov <[email protected]>

>
> Signed-off-by: Xinming Hu <[email protected]>
> Signed-off-by: Amitkumar Karwar <[email protected]>
> ---
> drivers/net/wireless/marvell/mwifiex/main.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
> index 30f4994..5e82602 100644
> --- a/drivers/net/wireless/marvell/mwifiex/main.c
> +++ b/drivers/net/wireless/marvell/mwifiex/main.c
> @@ -1503,11 +1503,9 @@ static irqreturn_t mwifiex_irq_wakeup_handler(int irq, void *priv)
> {
> struct mwifiex_adapter *adapter = priv;
>
> - if (adapter->irq_wakeup >= 0) {
> - dev_dbg(adapter->dev, "%s: wake by wifi", __func__);
> - adapter->wake_by_wifi = true;
> - disable_irq_nosync(irq);
> - }
> + dev_dbg(adapter->dev, "%s: wake by wifi", __func__);
> + adapter->wake_by_wifi = true;
> + disable_irq_nosync(irq);
>
> /* Notify PM core we are wakeup source */
> pm_wakeup_event(adapter->dev, 0);
> --
> 1.8.1.4
>

2017-04-05 05:17:02

by Xinming Hu

[permalink] [raw]
Subject: RE: [EXT] Re: [PATCH 1/3] mwifiex: remove unnecessary wakeup interrupt number sanity check

SGkgRG1pdHJ5LA0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IERtaXRy
eSBUb3Jva2hvdiBbbWFpbHRvOmR0b3JAY2hyb21pdW0ub3JnXQ0KPiBTZW50OiAyMDE35bm0NOac
iDHml6UgNjozNw0KPiBUbzogWGlubWluZyBIdQ0KPiBDYzogTGludXggV2lyZWxlc3M7IEthbGxl
IFZhbG87IEJyaWFuIE5vcnJpczsgUmFqYXQgSmFpbjsgQW1pdGt1bWFyIEthcndhcjsNCj4gQ2F0
aHkgTHVvOyBYaW5taW5nIEh1DQo+IFN1YmplY3Q6IFtFWFRdIFJlOiBbUEFUQ0ggMS8zXSBtd2lm
aWV4OiByZW1vdmUgdW5uZWNlc3Nhcnkgd2FrZXVwIGludGVycnVwdA0KPiBudW1iZXIgc2FuaXR5
IGNoZWNrDQo+IA0KPiBFeHRlcm5hbCBFbWFpbA0KPiANCj4gLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KPiBPbiBU
aHUsIE1hciAzMCwgMjAxNyBhdCAyO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HdlIGFyZSB3YWtldXAgc291cmNlICovDQo+ID4gICAgICAgICBwbV93
YWtldXBfZXZlbnQoYWRhcHRlci0+ZGV2LCAwKTsNCj4gPiAtLQ0KPiA+IDEuOC4xLjQNCj4gPg0K

2017-03-31 22:46:59

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 2/3] mwifiex: using general print function during device intialization

On Thu, Mar 30, 2017 at 2:19 AM, Xinming Hu <[email protected]> wrote:
> From: Xinming Hu <[email protected]>
>
> adapter->dev is initialized after mwifiex_register done, before that
> print message by general pr_* function

No, we should move away from naked pr_*() as much as possible. Please
change mwifiex_register() to accept "dev" parameter and assign
adapter->dev early enough so that the standard mwifiex_err() calls are
usable.

Also consider changing _mwifiex_dbg() to handle cases when
adapter->dev is NULL and fall back to pr_<level>.

>
> Signed-off-by: Xinming Hu <[email protected]>
> Signed-off-by: Amitkumar Karwar <[email protected]>
> ---
> drivers/net/wireless/marvell/mwifiex/pcie.c | 78 ++++++++++++-----------------
> drivers/net/wireless/marvell/mwifiex/sdio.c | 3 +-
> 2 files changed, 34 insertions(+), 47 deletions(-)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
> index e381def..59cb01a 100644
> --- a/drivers/net/wireless/marvell/mwifiex/pcie.c
> +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
> @@ -60,7 +60,7 @@ static int mwifiex_pcie_probe_of(struct device *dev)
>
> mapping.addr = pci_map_single(card->dev, skb->data, size, flags);
> if (pci_dma_mapping_error(card->dev, mapping.addr)) {
> - mwifiex_dbg(adapter, ERROR, "failed to map pci memory!\n");
> + pr_err("failed to map pci memory!\n");
> return -1;
> }
> mapping.len = size;
> @@ -594,7 +594,7 @@ static int mwifiex_init_rxq_ring(struct mwifiex_adapter *adapter)
> skb = mwifiex_alloc_dma_align_buf(MWIFIEX_RX_DATA_BUF_SIZE,
> GFP_KERNEL);
> if (!skb) {
> - mwifiex_dbg(adapter, ERROR,
> + pr_err(
> "Unable to allocate skb for RX ring.\n");
> kfree(card->rxbd_ring_vbase);
> return -ENOMEM;
> @@ -651,8 +651,7 @@ static int mwifiex_pcie_init_evt_ring(struct mwifiex_adapter *adapter)
> /* Allocate skb here so that firmware can DMA data from it */
> skb = dev_alloc_skb(MAX_EVENT_SIZE);
> if (!skb) {
> - mwifiex_dbg(adapter, ERROR,
> - "Unable to allocate skb for EVENT buf.\n");
> + pr_err("Unable to allocate skb for EVENT buf.\n");
> kfree(card->evtbd_ring_vbase);
> return -ENOMEM;
> }
> @@ -818,16 +817,14 @@ static int mwifiex_pcie_create_txbd_ring(struct mwifiex_adapter *adapter)
> card->txbd_ring_size,
> &card->txbd_ring_pbase);
> if (!card->txbd_ring_vbase) {
> - mwifiex_dbg(adapter, ERROR,
> - "allocate consistent memory (%d bytes) failed!\n",
> - card->txbd_ring_size);
> + pr_err("allocate consistent memory (%d bytes) failed!\n",
> + card->txbd_ring_size);
> return -ENOMEM;
> }
> - mwifiex_dbg(adapter, DATA,
> - "info: txbd_ring - base: %p, pbase: %#x:%x, len: %x\n",
> - card->txbd_ring_vbase, (unsigned int)card->txbd_ring_pbase,
> - (u32)((u64)card->txbd_ring_pbase >> 32),
> - card->txbd_ring_size);
> + pr_notice("info: txbd_ring - base: %p, pbase: %#x:%x, len: %x\n",
> + card->txbd_ring_vbase, (unsigned int)card->txbd_ring_pbase,
> + (u32)((u64)card->txbd_ring_pbase >> 32),
> + card->txbd_ring_size);
>
> return mwifiex_init_txq_ring(adapter);
> }
> @@ -875,24 +872,21 @@ static int mwifiex_pcie_create_rxbd_ring(struct mwifiex_adapter *adapter)
> card->rxbd_ring_size = sizeof(struct mwifiex_pcie_buf_desc) *
> MWIFIEX_MAX_TXRX_BD;
>
> - mwifiex_dbg(adapter, INFO,
> - "info: rxbd_ring: Allocating %d bytes\n",
> - card->rxbd_ring_size);
> + pr_info("info: rxbd_ring: Allocating %d bytes\n",
> + card->rxbd_ring_size);
> card->rxbd_ring_vbase = pci_alloc_consistent(card->dev,
> card->rxbd_ring_size,
> &card->rxbd_ring_pbase);
> if (!card->rxbd_ring_vbase) {
> - mwifiex_dbg(adapter, ERROR,
> - "allocate consistent memory (%d bytes) failed!\n",
> - card->rxbd_ring_size);
> + pr_err("allocate consistent memory (%d bytes) failed!\n",
> + card->rxbd_ring_size);
> return -ENOMEM;
> }
>
> - mwifiex_dbg(adapter, DATA,
> - "info: rxbd_ring - base: %p, pbase: %#x:%x, len: %#x\n",
> - card->rxbd_ring_vbase, (u32)card->rxbd_ring_pbase,
> - (u32)((u64)card->rxbd_ring_pbase >> 32),
> - card->rxbd_ring_size);
> + pr_notice("info: rxbd_ring - base: %p, pbase: %#x:%x, len: %#x\n",
> + card->rxbd_ring_vbase, (u32)card->rxbd_ring_pbase,
> + (u32)((u64)card->rxbd_ring_pbase >> 32),
> + card->rxbd_ring_size);
>
> return mwifiex_init_rxq_ring(adapter);
> }
> @@ -939,24 +933,21 @@ static int mwifiex_pcie_create_evtbd_ring(struct mwifiex_adapter *adapter)
> card->evtbd_ring_size = sizeof(struct mwifiex_evt_buf_desc) *
> MWIFIEX_MAX_EVT_BD;
>
> - mwifiex_dbg(adapter, INFO,
> - "info: evtbd_ring: Allocating %d bytes\n",
> + pr_info("info: evtbd_ring: Allocating %d bytes\n",
> card->evtbd_ring_size);
> card->evtbd_ring_vbase = pci_alloc_consistent(card->dev,
> card->evtbd_ring_size,
> &card->evtbd_ring_pbase);
> if (!card->evtbd_ring_vbase) {
> - mwifiex_dbg(adapter, ERROR,
> - "allocate consistent memory (%d bytes) failed!\n",
> - card->evtbd_ring_size);
> + pr_err("allocate consistent memory (%d bytes) failed!\n",
> + card->evtbd_ring_size);
> return -ENOMEM;
> }
>
> - mwifiex_dbg(adapter, EVENT,
> - "info: CMDRSP/EVT bd_ring - base: %p pbase: %#x:%x len: %#x\n",
> - card->evtbd_ring_vbase, (u32)card->evtbd_ring_pbase,
> - (u32)((u64)card->evtbd_ring_pbase >> 32),
> - card->evtbd_ring_size);
> + pr_notice("info: CMDRSP/EVT bd_ring - base: %p pbase: %#x:%x len: %#x\n",
> + card->evtbd_ring_vbase, (u32)card->evtbd_ring_pbase,
> + (u32)((u64)card->evtbd_ring_pbase >> 32),
> + card->evtbd_ring_size);
>
> return mwifiex_pcie_init_evt_ring(adapter);
> }
> @@ -995,8 +986,7 @@ static int mwifiex_pcie_alloc_cmdrsp_buf(struct mwifiex_adapter *adapter)
> /* Allocate memory for receiving command response data */
> skb = dev_alloc_skb(MWIFIEX_UPLD_SIZE);
> if (!skb) {
> - mwifiex_dbg(adapter, ERROR,
> - "Unable to allocate skb for command response data.\n");
> + pr_err("Unable to allocate skb for command response data.\n");
> return -ENOMEM;
> }
> skb_put(skb, MWIFIEX_UPLD_SIZE);
> @@ -1045,17 +1035,15 @@ static int mwifiex_pcie_alloc_sleep_cookie_buf(struct mwifiex_adapter *adapter)
> card->sleep_cookie_vbase = pci_alloc_consistent(card->dev, sizeof(u32),
> &card->sleep_cookie_pbase);
> if (!card->sleep_cookie_vbase) {
> - mwifiex_dbg(adapter, ERROR,
> - "pci_alloc_consistent failed!\n");
> + pr_err("pci_alloc_consistent failed!\n");
> return -ENOMEM;
> }
> /* Init val of Sleep Cookie */
> tmp = FW_AWAKE_COOKIE;
> put_unaligned(tmp, card->sleep_cookie_vbase);
>
> - mwifiex_dbg(adapter, INFO,
> - "alloc_scook: sleep cookie=0x%x\n",
> - get_unaligned(card->sleep_cookie_vbase));
> + pr_info("alloc_scook: sleep cookie=0x%x\n",
> + get_unaligned(card->sleep_cookie_vbase));
>
> return 0;
> }
> @@ -3069,32 +3057,32 @@ static void mwifiex_pcie_up_dev(struct mwifiex_adapter *adapter)
> card->cmdrsp_buf = NULL;
> ret = mwifiex_pcie_create_txbd_ring(adapter);
> if (ret) {
> - mwifiex_dbg(adapter, ERROR, "Failed to create txbd ring\n");
> + pr_err("Failed to create txbd ring\n");
> goto err_cre_txbd;
> }
>
> ret = mwifiex_pcie_create_rxbd_ring(adapter);
> if (ret) {
> - mwifiex_dbg(adapter, ERROR, "Failed to create rxbd ring\n");
> + pr_err("Failed to create rxbd ring\n");
> goto err_cre_rxbd;
> }
>
> ret = mwifiex_pcie_create_evtbd_ring(adapter);
> if (ret) {
> - mwifiex_dbg(adapter, ERROR, "Failed to create evtbd ring\n");
> + pr_err("Failed to create evtbd ring\n");
> goto err_cre_evtbd;
> }
>
> ret = mwifiex_pcie_alloc_cmdrsp_buf(adapter);
> if (ret) {
> - mwifiex_dbg(adapter, ERROR, "Failed to allocate cmdbuf buffer\n");
> + pr_err("Failed to allocate cmdbuf buffer\n");
> goto err_alloc_cmdbuf;
> }
>
> if (reg->sleep_cookie) {
> ret = mwifiex_pcie_alloc_sleep_cookie_buf(adapter);
> if (ret) {
> - mwifiex_dbg(adapter, ERROR, "Failed to allocate sleep_cookie buffer\n");
> + pr_err("Failed to allocate sleep_cookie buffer\n");
> goto err_alloc_cookie;
> }
> } else {
> diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> index 58d3da0..596282e 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
> @@ -631,8 +631,7 @@ static int mwifiex_init_sdio_ioport(struct mwifiex_adapter *adapter)
> else
> return -1;
> cont:
> - mwifiex_dbg(adapter, INFO,
> - "info: SDIO FUNC1 IO port: %#x\n", adapter->ioport);
> + pr_info("info: SDIO FUNC1 IO port: %#x\n", adapter->ioport);
>
> /* Set Host interrupt reset to read to clear */
> if (!mwifiex_read_reg(adapter, card->reg->host_int_rsr_reg, &reg))
> --
> 1.8.1.4
>

2017-04-03 18:33:51

by Brian Norris

[permalink] [raw]
Subject: Re: [PATCH 1/3] mwifiex: remove unnecessary wakeup interrupt number sanity check

On Fri, Mar 31, 2017 at 03:37:01PM -0700, Dmitry Torokhov wrote:
> On Thu, Mar 30, 2017 at 2:19 AM, Xinming Hu <[email protected]> wrote:
> > From: Xinming Hu <[email protected]>
> >
> > Sanity check of interrupt number in interrupt handler is unnecessary and
> > confusion, remove it.
>
> I'd reworded the explanation a bit: "If wakeup interrupt handler is
> called, we know that the wakeup interrupt number is valid, there is no
> need to check it."

Either way works for me (modulo grammar), though Dmitry's is more
informative. So +1.

> Otherwise:
>
> Reviewed-by: Dmitry Torokhov <[email protected]>

Ooh, me too!

Reviewed-by: Brian Norris <[email protected]>

I believe this same pattern occurs in btmrvl_sdio. Possibly others.

> > Signed-off-by: Xinming Hu <[email protected]>
> > Signed-off-by: Amitkumar Karwar <[email protected]>
> > ---
> > drivers/net/wireless/marvell/mwifiex/main.c | 8 +++-----
> > 1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
> > index 30f4994..5e82602 100644
> > --- a/drivers/net/wireless/marvell/mwifiex/main.c
> > +++ b/drivers/net/wireless/marvell/mwifiex/main.c
> > @@ -1503,11 +1503,9 @@ static irqreturn_t mwifiex_irq_wakeup_handler(int irq, void *priv)
> > {
> > struct mwifiex_adapter *adapter = priv;
> >
> > - if (adapter->irq_wakeup >= 0) {
> > - dev_dbg(adapter->dev, "%s: wake by wifi", __func__);
> > - adapter->wake_by_wifi = true;
> > - disable_irq_nosync(irq);
> > - }
> > + dev_dbg(adapter->dev, "%s: wake by wifi", __func__);
> > + adapter->wake_by_wifi = true;
> > + disable_irq_nosync(irq);
> >
> > /* Notify PM core we are wakeup source */
> > pm_wakeup_event(adapter->dev, 0);
> > --
> > 1.8.1.4
> >

2017-04-05 06:42:09

by Xinming Hu

[permalink] [raw]
Subject: Re: [PATCH 2/3] mwifiex: using general print function during device intialization

DQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IEJyaWFuIE5vcnJpcyBbbWFp
bHRvOmJyaWFubm9ycmlzQGNocm9taXVtLm9yZ10NCj4gU2VudDogMj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iBCcmlhbg0KPiANCj4gPiA+IFNpZ25lZC1vZmYtYnk6IFhpbm1pbmcgSHUg
PGh1eG1AbWFydmVsbC5jb20+DQo+ID4gPiBTaWduZWQtb2ZmLWJ5OiBBbWl0a3VtYXIgS2Fyd2Fy
IDxha2Fyd2FyQG1hcnZlbGwuY29tPg0KPiA+ID4gLS0tDQo+ID4gPiAgZHJpdmVycy9uZXQvd2ly
ZWxlc3MvbWFydmVsbC9td2lmaWV4L3BjaWUuYyB8IDc4DQo+ID4gPiArKysrKysrKysrKystLS0t
LS0tLS0tLS0tLS0tLQ0KPiA+ID4gZHJpdmVycy9uZXQvd2lyZWxlc3MvbWFydmVsbC9td2lmaWV4
L3NkaW8uYyB8ICAzICstDQo+ID4gPiAgMiBmaWxlcyBjaGFuZ2VkLCAzNCBpbnNlcnRpb25zKCsp
LCA0NyBkZWxldGlvbnMoLSkNCj4gDQo+IFsuLi5dDQo=

2017-04-03 18:42:12

by Brian Norris

[permalink] [raw]
Subject: Re: [PATCH 2/3] mwifiex: using general print function during device intialization

On Fri, Mar 31, 2017 at 03:46:58PM -0700, Dmitry Torokhov wrote:
> On Thu, Mar 30, 2017 at 2:19 AM, Xinming Hu <[email protected]> wrote:
> > From: Xinming Hu <[email protected]>
> >
> > adapter->dev is initialized after mwifiex_register done, before that
> > print message by general pr_* function
>
> No, we should move away from naked pr_*() as much as possible. Please
> change mwifiex_register() to accept "dev" parameter and assign
> adapter->dev early enough so that the standard mwifiex_err() calls are
> usable.

Agreed. You mean like I did here? :)

ba1c7e45ec22 mwifiex: set adapter->dev before starting to use mwifiex_dbg()

That's in v4.11-rc4, partly as a bugfix to this:

2e02b5814217 ("mwifiex: Allow mwifiex early access to device structure")

> Also consider changing _mwifiex_dbg() to handle cases when
> adapter->dev is NULL and fall back to pr_<level>.

That'd be nice. It would have mitigated the problems of commit
2e02b5814217 too.

Brian

> > Signed-off-by: Xinming Hu <[email protected]>
> > Signed-off-by: Amitkumar Karwar <[email protected]>
> > ---
> > drivers/net/wireless/marvell/mwifiex/pcie.c | 78 ++++++++++++-----------------
> > drivers/net/wireless/marvell/mwifiex/sdio.c | 3 +-
> > 2 files changed, 34 insertions(+), 47 deletions(-)

[...]

2017-04-05 10:47:11

by Kalle Valo

[permalink] [raw]
Subject: Re: [3/3] mwifiex: pcie: avoid hardcode wifi-only firmware name

Xinming Hu <[email protected]> wrote:
> From: Xinming Hu <[email protected]>
>
> Wifi-only firmware name should be chipset specific.
>
> Signed-off-by: Xinming Hu <[email protected]>
> Signed-off-by: Amitkumar Karwar <[email protected]>

The commit log is not telling anything. Why are you changing this? And how does
the functionality change from user space point of view?

--
https://patchwork.kernel.org/patch/9653387/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2017-04-06 08:05:41

by Xinming Hu

[permalink] [raw]
Subject: RE: Re: [PATCH 3/3] mwifiex: pcie: avoid hardcode wifi-only firmware name

SGkgRG1pdHJ5LA0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IERtaXRy
eSBUb3Jva2hvdiBbbWFpbHRvOmR0b3JAZ29vZ2xlLmNvbV0NCj4gU2VudDogMjAxN+W5tDTmnIgx
5pelIDY6NTANCj4gVG86IFhpbm1pbmcgSHUNCj4gQ2M6IExpbnV4IFdpcmVsZXNzOyBLYWxsZSBW
YWxvOyBCcmlhbiBOb3JyaXM7IFJhamF0IEphaW47IEFtaXRrdW1hciBLYXJ3YXI7DQo+IENhdGh5
IEx1bzsgWGlubWluZyBIdQ0KPiBTdWJqZWN0OiBbRVhUXSBSZTogW1BBVENIIDMvM10gbXdpZmll
eDogcGNpZTogYXZvaWQgaGFyZGNvZGUgd2lmaS1vbmx5DQo+IGZpcm13YXJlIG5hbWUNCj4gDQo+
IEV4dGVybmFsIEVtYWlsDQo+IA0KPiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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Agc3Ry
dWN0IG13aWZpZXhfZXZ0X2J1Zl9kZXNjIHsNCj4gPiAtLQ0KPiA+IDEuOC4xLjQNCj4gPg0KPiAN
Cj4gVGhhbmtzLg0KPiANCj4gLS0NCj4gRG1pdHJ5DQo=

2017-04-03 18:49:00

by Brian Norris

[permalink] [raw]
Subject: Re: [PATCH 3/3] mwifiex: pcie: avoid hardcode wifi-only firmware name

On Fri, Mar 31, 2017 at 03:50:27PM -0700, Dmitry Torokhov wrote:
> That said, I consider the whole wifi-only firmware business is quite
> fragile. Can we have unified firmware and have driver figure out what
> part shoudl be [re]loaded?

+1. I think we should really give a stab at this first, and *then* see
how we want to patch up the flagging of support on a per-chipset basis.
As-is, you're wasting filesystem space on a duplicate firmware blob,
that we have to make sure gets updated in sync with the combined
firmware every time there's an update.

Proof of the duplicate blob -- the latter portion of the combined FW is
identical to the WLAN-only:

$ cmp mrvl/pcie{usb8997_combo,8997_wlan}_v4.bin $((0x2919c)); echo $?
0

Brian

2017-04-06 08:09:06

by Xinming Hu

[permalink] [raw]
Subject: RE: [EXT] Re: [PATCH 3/3] mwifiex: pcie: avoid hardcode wifi-only firmware name

SGkgQnJhaW4sDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogQnJpYW4g
Tm9ycmlzIFttYWlsdG86YnJpYW5ub3JyaXNAY2hyb21pdW0ub3JnXQ0KPiBTZW50OiAyMDE3xOo0
1MI0yNUgMjo0OQ0KPiBUbzogRG1pdHJ5IFRvcm9raG92DQo+IENjOiBYaW5taW5nIEh1OyBMaW51
eCBXaXJlbGVzczsgS2FsbGUgVmFsbzsgUmFqYXQgSmFpbjsgQW1pdGt1bWFyIEthcndhcjsgQ2F0
aHkNCj4gTHVvOyBYaW5taW5nIEh1DQo+IFN1YmplY3Q6IFtFWFRdIFJlOiBbUEFUQ0ggMy8zXSBt
d2lmaWV4OiBwY2llOiBhdm9pZCBoYXJkY29kZSB3aWZpLW9ubHkNCj4gZm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Y29tYmluZWQgRlcgaXMgaWRlbnRpY2FsDQo+IHRvIHRoZSBXTEFOLW9ubHk6DQo+IA0K
PiAgICQgY21wIG1ydmwvcGNpZXt1c2I4OTk3X2NvbWJvLDg5OTdfd2xhbn1fdjQuYmluICQoKDB4
MjkxOWMpKTsgZWNobyAkPw0KPiAgIDANCg0KVGhhbmtzIGZvciB0aGUgcmV2aWV3LCB3ZSBoYXZl
IGEgbmV3IHNvbHV0aW9uIGZvciBleHRyYWN0aW5nIHdpZmktb25seSBwYXJ0IGZyb20gY29tYm8g
ZmlybXdhcmUsIHdpbGwgc2VuZCBpdCBpbiB2Mi4NCg0KVGhhbmtzDQpTaW1vbg0KPiANCj4gQnJp
YW4NCg==

2017-03-31 22:50:28

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 3/3] mwifiex: pcie: avoid hardcode wifi-only firmware name

On Thu, Mar 30, 2017 at 2:19 AM, Xinming Hu <[email protected]> wrote:
> From: Xinming Hu <[email protected]>
>
> Wifi-only firmware name should be chipset specific.
>
> Signed-off-by: Xinming Hu <[email protected]>
> Signed-off-by: Amitkumar Karwar <[email protected]>
> ---
> drivers/net/wireless/marvell/mwifiex/pcie.c | 8 +++++++-
> drivers/net/wireless/marvell/mwifiex/pcie.h | 6 ++++++
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
> index 59cb01a..282aa9a 100644
> --- a/drivers/net/wireless/marvell/mwifiex/pcie.c
> +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
> @@ -351,6 +351,12 @@ static void mwifiex_pcie_reset_notify(struct pci_dev *pdev, bool prepare)
> struct pcie_service_card *card = pci_get_drvdata(pdev);
> struct mwifiex_adapter *adapter = card->adapter;
>
> + if (!card->pcie.flr_support) {
> + pr_err("%s: FLR disabled in current chipset\n", __func__);
> + return;
> + }
> +
> + adapter = card->adapter;
> if (!adapter) {
> dev_err(&pdev->dev, "%s: adapter structure is not valid\n",
> __func__);
> @@ -3047,7 +3053,7 @@ static void mwifiex_pcie_up_dev(struct mwifiex_adapter *adapter)
> * during pcie FLR, so that bluetooth part of firmware which is
> * already running doesn't get affected.
> */
> - strcpy(adapter->fw_name, PCIE8997_DEFAULT_WIFIFW_NAME);
> + strcpy(adapter->fw_name, card->pcie.wifi_fw_name);
>
> /* tx_buf_size might be changed to 3584 by firmware during
> * data transfer, we should reset it to default size.
> diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.h b/drivers/net/wireless/marvell/mwifiex/pcie.h
> index 00e8ee5..d6c8526 100644
> --- a/drivers/net/wireless/marvell/mwifiex/pcie.h
> +++ b/drivers/net/wireless/marvell/mwifiex/pcie.h
> @@ -285,6 +285,8 @@ struct mwifiex_pcie_device {
> struct memory_type_mapping *mem_type_mapping_tbl;
> u8 num_mem_types;
> bool can_ext_scan;
> + u8 flr_support;

This sounds like a boolean, but given that you can key off
wifi_fw_name being NULL I am not sure it is needed.

> + char *wifi_fw_name;

const char *.

That said, I consider the whole wifi-only firmware business is quite
fragile. Can we have unified firmware and have driver figure out what
part shoudl be [re]loaded?

> };
>
> static const struct mwifiex_pcie_device mwifiex_pcie8766 = {
> @@ -293,6 +295,7 @@ struct mwifiex_pcie_device {
> .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
> .can_dump_fw = false,
> .can_ext_scan = true,
> + .flr_support = 0,
> };
>
> static const struct mwifiex_pcie_device mwifiex_pcie8897 = {
> @@ -303,6 +306,7 @@ struct mwifiex_pcie_device {
> .mem_type_mapping_tbl = mem_type_mapping_tbl_w8897,
> .num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl_w8897),
> .can_ext_scan = true,
> + .flr_support = 0,
> };
>
> static const struct mwifiex_pcie_device mwifiex_pcie8997 = {
> @@ -313,6 +317,8 @@ struct mwifiex_pcie_device {
> .mem_type_mapping_tbl = mem_type_mapping_tbl_w8997,
> .num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl_w8997),
> .can_ext_scan = true,
> + .flr_support = 1,
> + .wifi_fw_name = "mrvl/pcie8997_wlan_v4.bin",
> };
>
> struct mwifiex_evt_buf_desc {
> --
> 1.8.1.4
>

Thanks.

--
Dmitry

2017-04-05 05:23:22

by Xinming Hu

[permalink] [raw]
Subject: RE: Re: [PATCH 1/3] mwifiex: remove unnecessary wakeup interrupt number sanity check

SGkgQnJhaW4sDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogQnJpYW4g
Tm9ycmlzIFttYWlsdG86YnJpYW5ub3JyaXNAY2hyb21pdW0ub3JnXQ0KPiBTZW50OiAyMDE3xOo0
1MI0yNUgMjozNA0KPiBUbzogRG1pdHJ5IFRvcm9raG92DQo+IENjOiBYaW5taW5nIEh1OyBMaW51
eCBXaXJlbGVzczsgS2FsbGUgVmFsbzsgUmFqYXQgSmFpbjsgQW1pdGt1bWFyIEthcndhcjsgQ2F0
aHkNCj4gTHVvOyBYaW5taW5nIEh1DQo+IFN1YmplY3Q6IFtFWFRdIFJlOiBbUEFUQ0ggMS8zXSBt
d2lmaWV4OiByZW1vdmUgdW5uZWNlc3Nhcnkgd2FrZXVwIGludGVycnVwdA0KPiBudW1iZXIgc2Fu
aXR5IGNoZWNrDQo+IA0KPiBFeHRlcm5hbCBFbWFpbA0KPiANCj4gLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KPiBP
biBGcmksIE1hciAzMSwgMjAxNyBhdCAwMzozNzowMVBNIC0wNzAwLCBEbWl0cnkgVG9yb2tob3Yg
d3JvdGU6DQo+ID4gT24gVGh1LCBNYXIgMzAsIDIwMTcgYXQgMjoxOSBBTSwgWGlubWluZyBIdSA8
aHV4aW5taW5nODIwQGdtYWlsLmNvbT4NCj4gd3JvdGU6DQo+ID4gPiBGcm9tOiBY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