* Re: [PATCH RFC] mac80211: Use IFF_ECHO to force delivery of tx_status frames
From: Julius Niedworok @ 2019-02-26 13:13 UTC (permalink / raw)
To: Oliver Hartkopp
Cc: linux-wireless, ga58taw, David Hildenbrand, nc, David S. Miller,
Johannes Berg, Edward Cree, Jiri Pirko, Ido Schimmel,
Petr Machata, Kirill Tkhai, Alexander Duyck, Amritha Nambiar,
Li RongQing, netdev, linux-kernel
In-Reply-To: <c522f2e0-1bef-8679-45f7-707854918820@hartkopp.net>
Hi Oliver,
> On 26.02.2019 12:04, Oliver Hartkopp wrote:
>
> Hi Julius,
>
(..)
>
> The reason for IFF_ECHO was, that the data frame which is sent onto the wire (by one application) is not visible to all the other applications on the same (local) host. Therefore a successful transmission on the wire triggers the 'echo' of the sent content into the local host.
>
Thank you for the explanation - I can adjust the comment, if you like to.
> So what are you getting back after you enabled IFF_ECHO on your mac80211 device?
>
> Is it just a 'status' about a sent packet, or is it the packet ('full content') itself?
We are actually getting back the full content of the packet. So it matches the behaviour of the 'echo' in CAN.
>
> Regards,
> Oliver
>
Many thanks,
Julius
^ permalink raw reply
* [PATCH 4/4] brcmfmac: reset PCIe bus on a firmware crash
From: Rafał Miłecki @ 2019-02-26 13:11 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, linux-wireless, brcm80211-dev-list.pdl,
brcm80211-dev-list, Rafał Miłecki
In-Reply-To: <20190226131119.7907-1-zajec5@gmail.com>
From: Rafał Miłecki <rafal@milecki.pl>
This includes bus reset & reloading a firmware. It should be sufficient
for a user space to (setup and) use a wireless device again.
Support for reset on USB & SDIO can be added later.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
.../broadcom/brcm80211/brcmfmac/bus.h | 10 ++++++
.../broadcom/brcm80211/brcmfmac/core.c | 12 +++++++
.../broadcom/brcm80211/brcmfmac/core.h | 2 ++
.../broadcom/brcm80211/brcmfmac/pcie.c | 35 +++++++++++++++++++
4 files changed, 59 insertions(+)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
index 801106583ae7..2fe167eae22c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
@@ -91,6 +91,7 @@ struct brcmf_bus_ops {
int (*get_fwname)(struct device *dev, const char *ext,
unsigned char *fw_name);
void (*debugfs_create)(struct device *dev);
+ int (*reset)(struct device *dev);
};
@@ -245,6 +246,15 @@ void brcmf_bus_debugfs_create(struct brcmf_bus *bus)
return bus->ops->debugfs_create(bus->dev);
}
+static inline
+int brcmf_bus_reset(struct brcmf_bus *bus)
+{
+ if (!bus->ops->reset)
+ return -EOPNOTSUPP;
+
+ return bus->ops->reset(bus->dev);
+}
+
/*
* interface functions from common layer
*/
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 7f4d9356b79e..5f3548b13639 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -1084,6 +1084,14 @@ static int brcmf_revinfo_read(struct seq_file *s, void *data)
return 0;
}
+static void brcmf_core_bus_reset(struct work_struct *work)
+{
+ struct brcmf_pub *drvr = container_of(work, struct brcmf_pub,
+ bus_reset);
+
+ brcmf_bus_reset(drvr->bus_if);
+}
+
static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops)
{
int ret = -1;
@@ -1155,6 +1163,8 @@ static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops)
#endif
#endif /* CONFIG_INET */
+ INIT_WORK(&drvr->bus_reset, brcmf_core_bus_reset);
+
/* populate debugfs */
brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
brcmf_feat_debugfs_create(drvr);
@@ -1281,6 +1291,8 @@ void brcmf_fw_crashed(struct device *dev)
bphy_err(drvr, "Firmware has halted or crashed\n");
brcmf_dev_coredump(dev);
+
+ schedule_work(&drvr->bus_reset);
}
void brcmf_detach(struct device *dev)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
index d8085ce579f4..9f09aa31eeda 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
@@ -143,6 +143,8 @@ struct brcmf_pub {
struct notifier_block inet6addr_notifier;
struct brcmf_mp_device *settings;
+ struct work_struct bus_reset;
+
u8 clmver[BRCMF_DCMD_SMLEN];
};
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index cfa34672315f..e941039ee1c3 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -345,6 +345,10 @@ static const u32 brcmf_ring_itemsize[BRCMF_NROF_COMMON_MSGRINGS] = {
BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE
};
+static void brcmf_pcie_setup(struct device *dev, int ret,
+ struct brcmf_fw_request *fwreq);
+static struct brcmf_fw_request *
+brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo);
static u32
brcmf_pcie_read_reg32(struct brcmf_pciedev_info *devinfo, u32 reg_offset)
@@ -1409,6 +1413,36 @@ int brcmf_pcie_get_fwname(struct device *dev, const char *ext, u8 *fw_name)
return 0;
}
+static int brcmf_pcie_reset(struct device *dev)
+{
+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
+ struct brcmf_pciedev *buspub = bus_if->bus_priv.pcie;
+ struct brcmf_pciedev_info *devinfo = buspub->devinfo;
+ struct brcmf_fw_request *fwreq;
+ int err;
+
+ brcmf_detach(dev);
+
+ brcmf_pcie_release_irq(devinfo);
+ brcmf_pcie_release_scratchbuffers(devinfo);
+ brcmf_pcie_release_ringbuffers(devinfo);
+ brcmf_pcie_reset_device(devinfo);
+
+ fwreq = brcmf_pcie_prepare_fw_request(devinfo);
+ if (!fwreq) {
+ dev_err(dev, "Failed to prepare FW request\n");
+ return -ENOMEM;
+ }
+
+ err = brcmf_fw_get_firmwares(dev, fwreq, brcmf_pcie_setup);
+ if (err) {
+ dev_err(dev, "Failed to prepare FW request\n");
+ kfree(fwreq);
+ }
+
+ return err;
+}
+
static const struct brcmf_bus_ops brcmf_pcie_bus_ops = {
.txdata = brcmf_pcie_tx,
.stop = brcmf_pcie_down,
@@ -1418,6 +1452,7 @@ static const struct brcmf_bus_ops brcmf_pcie_bus_ops = {
.get_ramsize = brcmf_pcie_get_ramsize,
.get_memdump = brcmf_pcie_get_memdump,
.get_fwname = brcmf_pcie_get_fwname,
+ .reset = brcmf_pcie_reset,
};
--
2.20.1
^ permalink raw reply related
* [PATCH 3/4] brcmfmac: add a function designated for handling firmware fails
From: Rafał Miłecki @ 2019-02-26 13:11 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, linux-wireless, brcm80211-dev-list.pdl,
brcm80211-dev-list, Rafał Miłecki
In-Reply-To: <20190226131119.7907-1-zajec5@gmail.com>
From: Rafał Miłecki <rafal@milecki.pl>
This improves handling PCIe firmware halts by printing a clear error
message and replaces a similar code in the SDIO bus support.
It will also allow further improvements like trying to recover from a
firmware crash.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 2 ++
.../net/wireless/broadcom/brcm80211/brcmfmac/core.c | 10 ++++++++++
.../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +-
.../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 ++--
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
index 3d441c5c745c..801106583ae7 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
@@ -262,6 +262,8 @@ void brcmf_detach(struct device *dev);
void brcmf_dev_reset(struct device *dev);
/* Request from bus module to initiate a coredump */
void brcmf_dev_coredump(struct device *dev);
+/* Indication that firmware has halted or crashed */
+void brcmf_fw_crashed(struct device *dev);
/* Configure the "global" bus state used by upper layers */
void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state);
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 4fbe8791f674..7f4d9356b79e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -1273,6 +1273,16 @@ void brcmf_dev_coredump(struct device *dev)
brcmf_dbg(TRACE, "failed to create coredump\n");
}
+void brcmf_fw_crashed(struct device *dev)
+{
+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
+ struct brcmf_pub *drvr = bus_if->drvr;
+
+ bphy_err(drvr, "Firmware has halted or crashed\n");
+
+ brcmf_dev_coredump(dev);
+}
+
void brcmf_detach(struct device *dev)
{
s32 i;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index 39f6421885f6..cfa34672315f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -730,7 +730,7 @@ static void brcmf_pcie_handle_mb_data(struct brcmf_pciedev_info *devinfo)
}
if (dtoh_mb_data & BRCMF_D2H_DEV_FWHALT) {
brcmf_dbg(PCIE, "D2H_MB_DATA: FW HALT\n");
- brcmf_dev_coredump(&devinfo->pdev->dev);
+ brcmf_fw_crashed(&devinfo->pdev->dev);
}
}
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 4d104ab80fd8..a06af0cd4a7f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -1090,8 +1090,8 @@ static u32 brcmf_sdio_hostmail(struct brcmf_sdio *bus)
/* dongle indicates the firmware has halted/crashed */
if (hmb_data & HMB_DATA_FWHALT) {
- brcmf_err("mailbox indicates firmware halted\n");
- brcmf_dev_coredump(&sdiod->func1->dev);
+ brcmf_dbg(SDIO, "mailbox indicates firmware halted\n");
+ brcmf_fw_crashed(&sdiod->func1->dev);
}
/* Dongle recomposed rx frames, accept them again */
--
2.20.1
^ permalink raw reply related
* [PATCH 2/4] brcmfmac: get RAM info right before downloading PCIe firmware
From: Rafał Miłecki @ 2019-02-26 13:11 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, linux-wireless, brcm80211-dev-list.pdl,
brcm80211-dev-list, Rafał Miłecki
In-Reply-To: <20190226131119.7907-1-zajec5@gmail.com>
From: Rafał Miłecki <rafal@milecki.pl>
It's important as brcmf_chip_get_raminfo() also makes sure that memory
is properly setup. Without it the firmware could report invalid RAM
address like 0x04000001.
During a normal brcmfmac lifetime brcmf_chip_get_raminfo() is called on
probe by the brcmf_chip_recognition(). This change allows implementing
further improvements like handling errors by resetting a device with
the brcmf_pcie_reset_device() and redownloading a firmware afterwards.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 6 ++++--
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h | 1 +
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 ++++++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
index 22534bf2a90c..fcaf19165891 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
@@ -707,8 +707,10 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)
return 0;
}
-static int brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci)
+int brcmf_chip_get_raminfo(struct brcmf_chip *pub)
{
+ struct brcmf_chip_priv *ci = container_of(pub, struct brcmf_chip_priv,
+ pub);
struct brcmf_core_priv *mem_core;
struct brcmf_core *mem;
@@ -990,7 +992,7 @@ static int brcmf_chip_recognition(struct brcmf_chip_priv *ci)
brcmf_chip_set_passive(&ci->pub);
}
- return brcmf_chip_get_raminfo(ci);
+ return brcmf_chip_get_raminfo(&ci->pub);
}
static void brcmf_chip_disable_arm(struct brcmf_chip_priv *chip, u16 id)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
index 0ae3b33bab62..4794cf38b4d3 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
@@ -80,6 +80,7 @@ struct brcmf_buscore_ops {
void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec);
};
+int brcmf_chip_get_raminfo(struct brcmf_chip *pub);
struct brcmf_chip *brcmf_chip_attach(void *ctx,
const struct brcmf_buscore_ops *ops);
void brcmf_chip_detach(struct brcmf_chip *chip);
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index 58a6bc379358..39f6421885f6 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -1727,6 +1727,12 @@ static void brcmf_pcie_setup(struct device *dev, int ret,
nvram_len = fwreq->items[BRCMF_PCIE_FW_NVRAM].nv_data.len;
kfree(fwreq);
+ ret = brcmf_chip_get_raminfo(devinfo->ci);
+ if (ret) {
+ brcmf_err(bus, "Failed to get RAM info\n");
+ goto fail;
+ }
+
/* Some of the firmwares have the size of the memory of the device
* defined inside the firmware. This is because part of the memory in
* the device is shared and the devision is determined by FW. Parse
--
2.20.1
^ permalink raw reply related
* [PATCH 1/4] brcmfmac: support repeated brcmf_fw_alloc_request() calls
From: Rafał Miłecki @ 2019-02-26 13:11 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, linux-wireless, brcm80211-dev-list.pdl,
brcm80211-dev-list, Rafał Miłecki
In-Reply-To: <20190226131119.7907-1-zajec5@gmail.com>
From: Rafał Miłecki <rafal@milecki.pl>
During a normal brcmfmac lifetime brcmf_fw_alloc_request() is called
once only during the probe. It's safe to assume provided array is clear.
Further brcmfmac improvements may require calling it multiple times
though. This patch allows it by fixing invalid firmware paths like:
brcm/brcmfmac4366c-pcie.binbrcm/brcmfmac4366c-pcie.bin
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
index 8209a42dea72..65098a02e1ad 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
@@ -743,6 +743,7 @@ brcmf_fw_alloc_request(u32 chip, u32 chiprev,
for (j = 0; j < n_fwnames; j++) {
fwreq->items[j].path = fwnames[j].path;
+ fwnames[j].path[0] = '\0';
/* check if firmware path is provided by module parameter */
if (brcmf_mp_global.firmware_path[0] != '\0') {
strlcpy(fwnames[j].path, mp_path,
--
2.20.1
^ permalink raw reply related
* [PATCH 0/4] brcmfmac: recover PCIe devices from firmware crashes
From: Rafał Miłecki @ 2019-02-26 13:11 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, linux-wireless, brcm80211-dev-list.pdl,
brcm80211-dev-list, Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
So far PCIe firmware halts / crashes were resulting in massive timeouts
and running out of resources (e.g. slots). There wasn't even a clear
message indicating the problem source.
This patches improves it by:
1) Printing an error
2) Reloading a firmware
After that user can setup interface(s) & use a wireless card again. It
should be much more convenient than reloading a module manually thanks
to:
1) Automation
2) Not affecting other (working) wireless cards
Rafał Miłecki (4):
brcmfmac: support multiple brcmf_fw_alloc_request() calls
brcmfmac: get RAM info right before downloading PCIe firmware
brcmfmac: add function designated for handling firmware failures
brcmfmac: reset PCIe bus on firmware crash
.../broadcom/brcm80211/brcmfmac/bus.h | 12 ++++++
.../broadcom/brcm80211/brcmfmac/chip.c | 6 ++-
.../broadcom/brcm80211/brcmfmac/chip.h | 1 +
.../broadcom/brcm80211/brcmfmac/core.c | 22 ++++++++++
.../broadcom/brcm80211/brcmfmac/core.h | 2 +
.../broadcom/brcm80211/brcmfmac/firmware.c | 1 +
.../broadcom/brcm80211/brcmfmac/pcie.c | 43 ++++++++++++++++++-
.../broadcom/brcm80211/brcmfmac/sdio.c | 4 +-
8 files changed, 86 insertions(+), 5 deletions(-)
--
2.20.1
^ permalink raw reply
* Re: [PATCH] ath9k: remove set but not used variable 'acq'
From: Kalle Valo @ 2019-02-26 13:09 UTC (permalink / raw)
To: YueHaibing
Cc: QCA ath9k Development, YueHaibing, linux-wireless, netdev,
kernel-janitors
In-Reply-To: <20190225033246.127410-1-yuehaibing@huawei.com>
YueHaibing <yuehaibing@huawei.com> wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/wireless/ath/ath9k/recv.c: In function 'ath_rx_count_airtime':
> drivers/net/wireless/ath/ath9k/recv.c:1010:18: warning:
> variable 'acq' set but not used [-Wunused-but-set-variable]
>
> It's not used after 89cea7493a34 ("ath9k: Switch to mac80211 TXQ scheduling
> and airtime APIs"). Also remove related variables.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
03af21d6ba35 ath9k: remove set but not used variable 'acq'
--
https://patchwork.kernel.org/patch/10828153/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH 2/2] ath9K: debugfs: Fix SPUR-DOWN field
From: Kalle Valo @ 2019-02-26 13:08 UTC (permalink / raw)
To: Andrea Greco
Cc: johannes.berg, Andrea Greco, QCA ath9k Development,
David S. Miller, linux-wireless, netdev, linux-kernel
In-Reply-To: <20190221231257.6221-1-andrea.greco.gapmilano@gmail.com>
Andrea Greco <a.greco@4sigma.it> wrote:
> SPUR DOWN field returns spurup instead of spurdown.
>
> Signed-off-by: Andrea Greco <a.greco@4sigma.it>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
d0480d4326e2 ath9k: debugfs: Fix SPUR-DOWN field
--
https://patchwork.kernel.org/patch/10824837/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] ath9k: Make sure to zero status.tx_time before reporting TX status
From: Kalle Valo @ 2019-02-26 13:07 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: make-wifi-fast, linux-wireless, Toke Høiland-Jørgensen
In-Reply-To: <20190215164855.30666-1-toke@redhat.com>
Toke Høiland-Jørgensen wrote:
> Since ath9k reports airtime usage directly using the
> ieee80211_report_airtime() callback, it shouldn't also report it using the
> tx_time in status. Make sure the field is zeroed before TX status is
> reported to avoid spurious airtime being accounted by bits being left over
> from earlier uses of the cb.
>
> Fixes: 89cea7493a34 ("ath9k: Switch to mac80211 TXQ scheduling and airtime APIs")
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
cc591d77aba1 ath9k: Make sure to zero status.tx_time before reporting TX status
--
https://patchwork.kernel.org/patch/10815445/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] ath10k: update the max num of peers supported for WCN3990
From: Kalle Valo @ 2019-02-26 13:07 UTC (permalink / raw)
To: Abhishek Ambure; +Cc: ath10k, linux-wireless, Abhishek Ambure
In-Reply-To: <1550570468-25869-1-git-send-email-aambure@codeaurora.org>
Abhishek Ambure <aambure@codeaurora.org> wrote:
> WCN3990 firmware versions WLAN.HL.2.0-01617-QCAHLSWMTPLZ-1 & onwards
> supports maximum 33 peers including self peer. To support maximum peers,
> send updated peer param to firmware during initialization.
>
> Tested HW: WCN3990
> Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
>
> Signed-off-by: Abhishek Ambure <aambure@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
15493239eacf ath10k: update the max num of peers supported for WCN3990
--
https://patchwork.kernel.org/patch/10819597/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] ath10k: remove the calibration data fetch for sdio
From: Kalle Valo @ 2019-02-26 13:06 UTC (permalink / raw)
To: Wen Gong; +Cc: ath10k, linux-wireless
In-Reply-To: <1550470471-28002-1-git-send-email-wgong@codeaurora.org>
Wen Gong <wgong@codeaurora.org> wrote:
> The calibration data fetch will trigger sdio error, then sdio will
> become fail untill reboot system.
>
> If happens when run ifconfig wlan down, then ifconfig wlan up will
> fail untill reboot system.Remove it fix the ifconfig wlan issue.
>
> Tested with QCA6174 SDIO with firmware
> WLAN.RMH.4.4.1-00005-QCARMSWP-1.
>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
6566abea0b97 ath10k: remove the calibration data fetch for sdio
--
https://patchwork.kernel.org/patch/10817363/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] ath10k: Fix length of wmi tlv command for protected mgmt frames
From: Kalle Valo @ 2019-02-26 13:04 UTC (permalink / raw)
To: Surabhi Vishnoi; +Cc: ath10k, linux-wireless, Surabhi Vishnoi
In-Reply-To: <1550243977-8612-1-git-send-email-svishnoi@codeaurora.org>
Surabhi Vishnoi <svishnoi@codeaurora.org> wrote:
> The length of wmi tlv command for management tx send is calculated
> incorrectly in case of protected management frames as there is addition
> of IEEE80211_CCMP_MIC_LEN twice. This leads to improper behaviour of
> firmware as the wmi tlv mgmt tx send command for protected mgmt frames
> is formed wrongly.
>
> Fix the length calculation of wmi tlv command for mgmt tx send in case
> of protected management frames by adding the IEEE80211_CCMP_MIC_LEN only
> once.
>
> Tested HW: WCN3990
> Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
>
> Fixes: 1807da49733e "ath10k: wmi: add management tx by reference support over wmi"
> Signed-off-by: Surabhi Vishnoi <svishnoi@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
761156ff573d ath10k: Fix length of wmi tlv command for protected mgmt frames
--
https://patchwork.kernel.org/patch/10815099/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH 1/4] ath10k: sdio: set hi_acs_flags
From: Kalle Valo @ 2019-02-26 13:02 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless, Alagu Sankar, Wen Gong
In-Reply-To: <1550766118-31703-2-git-send-email-kvalo@codeaurora.org>
Kalle Valo <kvalo@codeaurora.org> wrote:
> The SDIO firmware does not allow transmitting packets with the
> reduced tx completion HI_ACS option. SDIO firmware uses 1544 as
> alternate credit size, which is not big enough for the maximum sized
> mac80211 frames. Disable both these HI_ACS flags for SDIO.
>
> Co-developed-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Alagu Sankar <alagusankar@silex-india.com>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
4 patches applied to ath-next branch of ath.git, thanks.
bf1f0a1a4da1 ath10k: sdio: set hi_acs_flags
6cd70c65647b ath10k: sdio: disable fwlog prints
55545b087012 ath10k: sdio: reset chip on power_down()
7d4445223031 ath10k: don't report unset rssi values to mac80211
--
https://patchwork.kernel.org/patch/10824323/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] ath10k: correct the format of host memory chunks in wmi init command
From: Kalle Valo @ 2019-02-26 13:00 UTC (permalink / raw)
To: Yu Wang; +Cc: ath10k, linux-wireless, Yu Wang
In-Reply-To: <20190214031034.26969-1-yyuwang@codeaurora.org>
Yu Wang <yyuwang@codeaurora.org> wrote:
> This is a theoretical fix, the issue is found in code review.
> When adding the host memory chunks into wmi-tlv init command,
> there is no separate tlv header for each host memory chunk
> in the struct array, which breaches the convention between
> host and firmware, will result in mismatch between the two.
>
> To fix this issue, add separate tlv headers for the host
> memory chunks in wmi-tlv init command.
>
> Signed-off-by: Yu Wang <yyuwang@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
d961284df24b ath10k: correct the format of host memory chunks in wmi init command
--
https://patchwork.kernel.org/patch/10811667/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] ath10k: Enhance logging for vdev pdev & peer set param
From: Kalle Valo @ 2019-02-26 12:59 UTC (permalink / raw)
To: Rakesh Pillai; +Cc: ath10k, linux-wireless, Rakesh Pillai
In-Reply-To: <1550216886-23045-1-git-send-email-pillair@codeaurora.org>
Rakesh Pillai <pillair@codeaurora.org> wrote:
> Currently after enabling the WMI debug logging,
> there is no detail printed about the param id
> and the param value for the pdev, vdev and
> peer params which are set.
>
> Enhance the WMI logging to print the param id
> and the param value for pdev, vdev and peer set
> param wmi commands.
>
> Tested HW: WCN3990
> Tested FW: WLAN.HL.2.0-01387-QCAHLSWMTPLZ-1
> WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
>
> Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
1c136e41fb77 ath10k: enhance logging for vdev pdev & peer set param
--
https://patchwork.kernel.org/patch/10814285/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH v3 1/2] ath10k: Add support for ack rssi value of management tx packets
From: Kalle Valo @ 2019-02-26 12:58 UTC (permalink / raw)
To: Abhishek Ambure; +Cc: ath10k, linux-wireless, Abhishek Ambure
In-Reply-To: <1550055839-24454-2-git-send-email-aambure@codeaurora.org>
Abhishek Ambure <aambure@codeaurora.org> wrote:
> In WCN3990, WMI_TLV_SERVICE_TX_DATA_MGMT_ACK_RSSI service Indicates that
> the firmware has the capability to send the RSSI value of the ACK for all
> data and management packets transmitted.
>
> If WMI_RSRC_CFG_FLAG_TX_ACK_RSSI is set in host capability then firmware
> sends RSSI value in "management" tx completion event. Host extracts ack
> rssi values of management packets from their tx completion event.
>
> Tested HW: WCN3990
> Tested FW: WLAN.HL.2.0-01617-QCAHLSWMTPLZ-1
>
> Signed-off-by: Abhishek Ambure <aambure@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2 patches applied to ath-next branch of ath.git, thanks.
4b816f170b1f ath10k: add support for ack rssi value of management tx packets
6ddc3860a566 ath10k: add support for ack rssi value of data tx packets
--
https://patchwork.kernel.org/patch/10809625/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCH] ath10k: Fix descriptor size in ce tx completion for WCN3990
From: Kalle Valo @ 2019-02-26 12:56 UTC (permalink / raw)
To: Rakesh Pillai; +Cc: ath10k, linux-wireless, Rakesh Pillai
In-Reply-To: <1549952423-25096-1-git-send-email-pillair@codeaurora.org>
Rakesh Pillai <pillair@codeaurora.org> wrote:
> When the driver receives the tx completion of the
> descriptor over ce, it clears the nbytes configured
> for that particular descriptor. WCN3990 uses ce
> descriptors with 64-bit address.
>
> Currently during handling the tx completion of the
> descriptors, the nbytes are accessed from the descriptors
> using ce_desc for 32-bit targets. This will lead to clearing
> of memory at incorrect offset if DMA MASK is set to greater
> than 32 bits.
>
> Attach different ce tx copy completed handler for targets
> using address above 32-bit address.
>
> Tested HW: WCN3990
> Tested FW: WLAN.HL.2.0-01387-QCAHLSWMTPLZ-1
>
> Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
02f73d3a9bdb ath10k: fix descriptor size in ce tx completion for WCN3990
--
https://patchwork.kernel.org/patch/10807393/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: [PATCHv2 8/9] ath10k: Add new api to support TID specific configuration
From: Sergey Matyukevich @ 2019-02-26 12:31 UTC (permalink / raw)
To: Tamizh chelvam
Cc: johannes@sipsolutions.net, ath10k@lists.infradead.org,
linux-wireless@vger.kernel.org
In-Reply-To: <1550813554-11581-9-git-send-email-tamizhr@codeaurora.org>
Hello Tamizh,
> This patch add ops for set_tid_config to support TID
> specific configuration. STA information along with the
> TID config change mask to notify driver that which configuration
> needs to be applied for this current command.
> If the STA info not available in the command then the
> configuration will be applied for all connected stations
> in the vif. TID specific noack configuration requires
> aggregation disabled and rate for the data TID packets
> should be basic rates. So, if the TID already configured
> with noack policy then driver will ignore the aggregation
> or TX rate related configuration for the same data TID.
> In TX rate configuration should be applied with highest
> preamble configuration(HT rates should not be applied
> for the station which supports vht rates).
>
> Vif specific TID configuration will be applied for all
> the connected stations except for the station which
> already applied with the same configuration for the TID
> through station specific command. Newly connecting stations
> will be applied with vif TID configuration which will be stored
> in ieee80211_vif.
>
> Testing:
> * Tested HW: QCA9888
> * Tested FW: 10.4-3.5.1-00052
>
> Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
> ---
> drivers/net/wireless/ath/ath10k/core.h | 7 +
> drivers/net/wireless/ath/ath10k/mac.c | 602 ++++++++++++++++++++++++++++-----
> 2 files changed, 529 insertions(+), 80 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
> index 27ec555..c25c426 100644
> --- a/drivers/net/wireless/ath/ath10k/core.h
> +++ b/drivers/net/wireless/ath/ath10k/core.h
> @@ -82,6 +82,9 @@
> /* Default Airtime weight multipler (Tuned for multiclient performance) */
> #define ATH10K_AIRTIME_WEIGHT_MULTIPLIER 4
>
> +#define ATH10K_MAX_RETRY_COUNT 30
> +#define ATH10K_MAX_TIDS 8
Is there any reason why you don't use IEEE80211_TID_MAX here ?
Regards,
Sergey
^ permalink raw reply
* Re: [PATCHv2 1/9] nl80211: New netlink command for TID specific configuration
From: Sergey Matyukevich @ 2019-02-26 12:29 UTC (permalink / raw)
To: Tamizh chelvam
Cc: johannes@sipsolutions.net, ath10k@lists.infradead.org,
linux-wireless@vger.kernel.org
In-Reply-To: <1550813554-11581-2-git-send-email-tamizhr@codeaurora.org>
Hello Tamizh,
> Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
> ---
> include/net/cfg80211.h | 35 +++++++++++++++
> include/uapi/linux/nl80211.h | 51 ++++++++++++++++++++++
> net/wireless/nl80211.c | 102 +++++++++++++++++++++++++++++++++++++++++++
> net/wireless/rdev-ops.h | 11 +++++
> net/wireless/trace.h | 18 ++++++++
> 5 files changed, 217 insertions(+)
...
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 82d5e1e..352eb4a2 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -280,6 +280,13 @@ static int validate_ie_attr(const struct nlattr *attr,
> NLA_POLICY_NESTED_ARRAY(nl80211_psmr_peer_attr_policy),
> };
>
> +static const struct nla_policy
> +nl80211_attr_tid_config_policy[NL80211_ATTR_TID_CONFIG_MAX + 1] = {
> + [NL80211_ATTR_TID_CONFIG_TID] = NLA_POLICY_MAX(NLA_U8, 7),
Such a policy permits configuration of per-TID settings, either
for per-STA or for all the STAs. However it is not possible to
perform configuration for all TIDs at once, e.g. passing -1 value
to driver.
Maybe simplify policy and use .type = NLA_U8 ?
Sanity check, if needed, can be performed by driver or even by firmware.
> + [NL80211_ATTR_TID_CONFIG_NOACK] =
> + NLA_POLICY_MAX(NLA_U8, NL80211_TID_CONFIG_DISABLE),
> +};
> +
> const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
> [NL80211_ATTR_WIPHY] = { .type = NLA_U32 },
> [NL80211_ATTR_WIPHY_NAME] = { .type = NLA_NUL_STRING,
> @@ -541,6 +548,8 @@ static int validate_ie_attr(const struct nlattr *attr,
> [NL80211_ATTR_PEER_MEASUREMENTS] =
> NLA_POLICY_NESTED(nl80211_pmsr_attr_policy),
> [NL80211_ATTR_AIRTIME_WEIGHT] = NLA_POLICY_MIN(NLA_U16, 1),
> + [NL80211_ATTR_TID_CONFIG] =
> + NLA_POLICY_NESTED(nl80211_attr_tid_config_policy),
> };
...
> +static int nl80211_set_tid_config(struct sk_buff *skb,
> + struct genl_info *info)
> +{
> + struct cfg80211_registered_device *rdev = info->user_ptr[0];
> + struct nlattr *attrs[NL80211_ATTR_TID_CONFIG_MAX + 1];
> + struct net_device *dev = info->user_ptr[1];
> + struct ieee80211_tid_config *tid_conf;
> + struct nlattr *tid;
> + int conf_idx = 0, rem_conf;
> + u32 num_conf = 0, size_of_conf;
> + int ret = -EINVAL;
> +
> + if (!info->attrs[NL80211_ATTR_TID_CONFIG])
> + return -EINVAL;
> +
> + if (!rdev->ops->set_tid_config)
> + return -EOPNOTSUPP;
> +
> + nla_for_each_nested(tid, info->attrs[NL80211_ATTR_TID_CONFIG],
> + rem_conf)
> + num_conf++;
> +
> + size_of_conf = sizeof(struct ieee80211_tid_config) +
> + num_conf * sizeof(struct ieee80211_tid_cfg);
> +
> + tid_conf = kzalloc(size_of_conf, GFP_KERNEL);
> + if (!tid_conf)
> + return -ENOMEM;
> +
> + tid_conf->n_tid_conf = num_conf;
> +
> + if (info->attrs[NL80211_ATTR_MAC])
> + tid_conf->peer = nla_data(info->attrs[NL80211_ATTR_MAC]);
> + else
> + tid_conf->peer = NULL;
> +
> + nla_for_each_nested(tid, info->attrs[NL80211_ATTR_TID_CONFIG],
> + rem_conf) {
> + ret = nla_parse_nested(attrs, NL80211_ATTR_TID_CONFIG_MAX, tid,
> + NULL, NULL);
> +
> + if (ret)
> + return ret;
> +
> + if (!attrs[NL80211_ATTR_TID_CONFIG_TID])
> + return -EINVAL;
> +
> + ret = parse_tid_conf(rdev, attrs, &tid_conf->tid_conf[conf_idx],
> + tid_conf->peer);
> + if (ret)
> + goto bad_tid_conf;
> +
> + conf_idx++;
> + }
> +
> + return rdev_set_tid_config(rdev, dev, tid_conf);
What is the ownership rule for tid_conf ? In other words, who is
responsible for freeing this structure ?
Unless I am missing something, in the suggested patches there is no
kfree for this structure and all the nested structures (see Tx bitrate
patch), neither in cfg80211/mac80211 nor in ath10k.
As far as I understand, we have two options here. One option is to
explicitly specify that ownership is passed to the caller, similar
to nl80211_set_reg. Another option is to release memory in this
function after driver makes copies of all necessary fields,
e.g. see nl80211_set_mac_acl.
> +
> +bad_tid_conf:
> + kfree(tid_conf);
> + return ret;
> +}
Regards,
Sergey
^ permalink raw reply
* Re: [PATCH] ath10k: Fill rx duration for each peer in fw_stats for WCN3990
From: Kalle Valo @ 2019-02-26 12:09 UTC (permalink / raw)
To: Surabhi Vishnoi; +Cc: ath10k, linux-wireless
In-Reply-To: <558f033a71573862be59867f22c75294@codeaurora.org>
Surabhi Vishnoi <svishnoi@codeaurora.org> writes:
> I have uploaded the v2 patch which fixes the warning.
> https://patchwork.kernel.org/patch/10829811/
Thanks, but PLEASE do not top post. It's really annoying.
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#do_not_top_post_and_edit_your_quotes
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH] ath10k: Fill rx duration for each peer in fw_stats for WCN3990
From: Surabhi Vishnoi @ 2019-02-26 11:53 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <20190225171756.9632C609F3@smtp.codeaurora.org>
Hi Kalle,
I have uploaded the v2 patch which fixes the warning.
https://patchwork.kernel.org/patch/10829811/
Thanks,
Surabhi Vishnoi
On 2019-02-25 22:47, Kalle Valo wrote:
> Surabhi Vishnoi <svishnoi@codeaurora.org> wrote:
>
>> Currently, rx_duration for each peer is not getting populated in
>> fw_stats debugfs entry for WCN3990.
>>
>> WCN3990 firmware sends rx duration for each peer as part of
>> peer_extd_stats in WMI_UPDATE_STATS_EVENT. To enable peer_extd_stats,
>> firmware expects host to send fw_stats_req_mask with flag
>> WMI_TLV_PEER_STATS_EXTD set in WMI_REQUEST_STATS_CMD.
>>
>> Send fw_stats_req_mask with flag WMI_TLV_PEER_STATS_EXTD set in
>> WMI_REQUEST_STATS_CMD and parse the peer_extd_stats in
>> WMI_UPDATE_STATS_EVENT to populate the rx_duration of each peer
>> in fw_stats debugfs entry.
>>
>> Currently the driver handles 32-bit rx_duration, but the rx_duration
>> for WCN3990 can be upto 63 bit. The firmware sends rx_duration split
>> into two 32-bit fields, with the upper 32-bits being valid only if its
>> MSB is set. This change handles the 63-bit rx_duration obtained from
>> WCN3990 and maintain the backward compatibility.
>>
>> To get the rx_duration of each connected peer :
>> cat /sys/kernel/debug/ieee80211/phyX/ath10k/fw_stats
>>
>> Tested HW: WCN3990
>> Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
>>
>> Signed-off-by: Surabhi Vishnoi <svishnoi@codeaurora.org>
>> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
>
> Kbuild bot reported a warning:
>
> drivers/net/wireless/ath/ath10k/wmi-tlv.c: In function
> 'ath10k_wmi_tlv_op_pull_fw_stats':
>>> drivers/net/wireless/ath/ath10k/wmi-tlv.c:1423:42: warning: left
>>> shift count >= width of type [-Wshift-count-overflow]
> dst->rx_duration |= rx_duration_high <<
> ^~
^ permalink raw reply
* pull request: mt76 2019-02-26 v2
From: Felix Fietkau @ 2019-02-26 11:41 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
Hi Kalle,
here's another pull request for 5.1
v2: add two missing patches, fix bisect issues
- Felix
The following changes since commit bd16693f359bbab8776541c06a6df32f3996638e:
net: fix double-free in bpf_lwt_xmit_reroute (2019-02-24 22:24:50 -0800)
are available in the Git repository at:
https://github.com/nbd168/wireless tags/mt76-for-kvalo-2019-02-26
for you to fetch changes up to c8846e1015022d2531ac4c895783e400b3e5babe:
mt76: add driver for MT7603E and MT7628/7688 (2019-02-26 12:29:56 +0100)
----------------------------------------------------------------
mt76 patches for 5.1
* add driver for MT7603E/MT7628
* fix ED/CCA issues
* fix USB issues
* more code unification
* fix beacon timer issues
* fix recovery from MCU timeout issues
----------------------------------------------------------------
Felix Fietkau (11):
mt76: mt76x02: fix TSF sync mode
mt76: mt76x02: fix beacon timer drift adjustment
mt76: mt76x02: fix beacon timer issue
mt76: mt76x02: only reset beacon drift counter when enabling beacons
mt76: mt76x02: issue watchdog reset on MCU request timeout
mt76: mt76x02: fix ED/CCA enabling/disabling
mt76: mt76x2: unify mt76x2[u]_mac_resume
mt76: mt76x02: set MT_TXOP_HLDR_TX40M_BLK_EN for mt76x2
mt76: add driver callback for when a sta is associated
dt-bindings: net: mt76: update binding for mt7603 driver
mt76: add driver for MT7603E and MT7628/7688
Lorenzo Bianconi (6):
mt76: usb: fix warning in mt76u_buf_free
mt76: usb: introduce mt76u_fill_bulk_urb routine
mt76: usb: simplify rx buffer allocation
mt76: usb: simplify mt76u_tx_build_sg routine
mt76: usb: check urb->num_sgs limit in mt76u_process_rx_entry
mt76: remove no longer used routine declarations
Stanislaw Gruszka (3):
mt76usb: allow mt76u_bulk_msg be used for reads
mt76usb: use synchronous msg for mcu command responses
mt76usb: remove usb_mcu.c
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt | 19 +
drivers/net/wireless/mediatek/mt76/Kconfig | 1 +
drivers/net/wireless/mediatek/mt76/Makefile | 3 +-
drivers/net/wireless/mediatek/mt76/mac80211.c | 5 +
drivers/net/wireless/mediatek/mt76/mt76.h | 29 +-
drivers/net/wireless/mediatek/mt76/mt7603/Kconfig | 9 +
drivers/net/wireless/mediatek/mt76/mt7603/Makefile | 6 +
drivers/net/wireless/mediatek/mt76/mt7603/beacon.c | 186 +++++++++
drivers/net/wireless/mediatek/mt76/mt7603/core.c | 73 ++++
drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c | 56 +++
drivers/net/wireless/mediatek/mt76/mt7603/dma.c | 215 +++++++++++
drivers/net/wireless/mediatek/mt76/mt7603/eeprom.c | 168 ++++++++
drivers/net/wireless/mediatek/mt76/mt7603/eeprom.h | 86 +++++
drivers/net/wireless/mediatek/mt76/mt7603/init.c | 578 ++++++++++++++++++++++++++++
drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 1749 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/net/wireless/mediatek/mt76/mt7603/mac.h | 242 ++++++++++++
drivers/net/wireless/mediatek/mt76/mt7603/main.c | 709 ++++++++++++++++++++++++++++++++++
drivers/net/wireless/mediatek/mt76/mt7603/mcu.c | 483 +++++++++++++++++++++++
drivers/net/wireless/mediatek/mt76/mt7603/mcu.h | 110 ++++++
drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h | 253 +++++++++++++
drivers/net/wireless/mediatek/mt76/mt7603/pci.c | 80 ++++
drivers/net/wireless/mediatek/mt76/mt7603/regs.h | 774 +++++++++++++++++++++++++++++++++++++
drivers/net/wireless/mediatek/mt76/mt7603/soc.c | 85 +++++
drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 2 +
drivers/net/wireless/mediatek/mt76/mt76x0/main.c | 2 +
drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 6 +-
drivers/net/wireless/mediatek/mt76/mt76x0/usb.c | 16 -
drivers/net/wireless/mediatek/mt76/mt76x02.h | 1 +
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 9 +-
drivers/net/wireless/mediatek/mt76/mt76x02_mcu.c | 1 +
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 42 +-
drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c | 36 +-
drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 9 +-
drivers/net/wireless/mediatek/mt76/mt76x2/mac.c | 3 +
drivers/net/wireless/mediatek/mt76/mt76x2/mac.h | 8 +-
drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2u.h | 1 -
drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c | 7 -
drivers/net/wireless/mediatek/mt76/mt76x2/pci_phy.c | 7 +-
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c | 11 -
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | 5 -
drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c | 13 +-
drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c | 5 +-
drivers/net/wireless/mediatek/mt76/mt76x2/usb_phy.c | 3 +-
drivers/net/wireless/mediatek/mt76/usb.c | 154 +++-----
drivers/net/wireless/mediatek/mt76/usb_mcu.c | 57 ---
45 files changed, 6037 insertions(+), 280 deletions(-)
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/Kconfig
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/Makefile
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/beacon.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/core.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/dma.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/eeprom.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/eeprom.h
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/init.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/mac.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/mac.h
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/main.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/mcu.h
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/pci.c
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/regs.h
create mode 100644 drivers/net/wireless/mediatek/mt76/mt7603/soc.c
delete mode 100644 drivers/net/wireless/mediatek/mt76/usb_mcu.c
^ permalink raw reply
* Re: [PATCH] mt76: usb: check urb->num_sgs limit in mt76u_process_rx_entry
From: Felix Fietkau @ 2019-02-26 11:33 UTC (permalink / raw)
To: lorenzo; +Cc: linux-wireless, sgruszka, lorenzo.bianconi
In-Reply-To: <9111504273864ca3838481c57ad0f22dea74e303.1550654091.git.lorenzo@kernel.org>
On 2019-02-20 10:20, lorenzo@kernel.org wrote:
> From: Lorenzo Bianconi <lorenzo@kernel.org>
>
> check nsgs value is less than urb->num_sgs in mt76u_process_rx_entry
> in order to avoid an out-of-bound access of urb->sg array
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Applied, thanks.
- Felix
^ permalink raw reply
* Re: MT76x2U crashes XHCI driver on AMD Ryzen system
From: Stanislaw Gruszka @ 2019-02-26 11:24 UTC (permalink / raw)
To: Joerg Roedel
Cc: Lorenzo Bianconi, Rosen Penev, linux-wireless, Samuel Sieb,
Alexander Duyck, iommu, linux-kernel
In-Reply-To: <20190226104413.GH20740@8bytes.org>
On Tue, Feb 26, 2019 at 11:44:13AM +0100, Joerg Roedel wrote:
> On Tue, Feb 26, 2019 at 11:34:51AM +0100, Stanislaw Gruszka wrote:
> > On Tue, Feb 26, 2019 at 11:05:36AM +0100, Joerg Roedel wrote:
> > If sg->offset > PAGE_SIZE is fine then most likely we have problem with
> > alignment.
>
> The map_sg implementation in the AMD IOMMU driver uses sg_phys() which
> handles the sg->page + sg->offset calculation fine.
>
> > Note hat issue is with dma_map_sg(), switching to dma_map_single()
> > by using urb->transfer_buffer instead of urb->sg make things work
> > on AMD IOMMU.
>
> On the other hand this points to a bug in the driver, I'll look further
> if I can spot something there.
I think so too. And I have done some changes that avoid strange allocation
scheme and use usb synchronous messages instead of allocating buffers
with unaligned sizes. However things work ok on Intel IOMMU and
there is no documentation what are dma_map_sg() requirement versus
dma_map_single() which works. I think there are some unwritten
requirements and things can work on some platforms and fails on others
(different IOMMUs, no-IOMMU on some ARCHes)
Stanislaw
^ permalink raw reply
* [PATCH] mt76: remove no longer used routine declarations
From: Lorenzo Bianconi @ 2019-02-26 11:19 UTC (permalink / raw)
To: nbd; +Cc: linux-wireless, sgruszka, lorenzo.bianconi
In-Reply-To: <cover.1551179704.git.lorenzo@kernel.org>
Remove following routine declarations that are no longer used
after commit cfca5f693c5d ("mt76usb: remove usb_mcu.c"):
- mt76u_mcu_complete_urb
- mt76u_deinit
- mt76u_buf_free
- mt76u_submit_urb
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt76.h | 7 -------
drivers/net/wireless/mediatek/mt76/usb.c | 11 +++++------
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 3555ed931dd0..5dfb0601f101 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -753,11 +753,6 @@ int mt76u_vendor_request(struct mt76_dev *dev, u8 req,
void mt76u_single_wr(struct mt76_dev *dev, const u8 req,
const u16 offset, const u32 val);
int mt76u_init(struct mt76_dev *dev, struct usb_interface *intf);
-void mt76u_deinit(struct mt76_dev *dev);
-void mt76u_buf_free(struct mt76u_buf *buf);
-int mt76u_submit_buf(struct mt76_dev *dev, int dir, int index,
- struct mt76u_buf *buf, gfp_t gfp,
- usb_complete_t complete_fn, void *context);
int mt76u_submit_rx_buffers(struct mt76_dev *dev);
int mt76u_alloc_queues(struct mt76_dev *dev);
void mt76u_stop_queues(struct mt76_dev *dev);
@@ -771,6 +766,4 @@ void mt76_mcu_rx_event(struct mt76_dev *dev, struct sk_buff *skb);
struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev,
unsigned long expires);
-void mt76u_mcu_complete_urb(struct urb *urb);
-
#endif
diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
index 096bc99378f5..b587f0c34793 100644
--- a/drivers/net/wireless/mediatek/mt76/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
@@ -361,7 +361,7 @@ mt76u_buf_alloc(struct mt76_dev *dev, struct mt76u_buf *buf)
return mt76u_refill_rx(dev, q, buf, MT_SG_MAX_SIZE, GFP_KERNEL);
}
-void mt76u_buf_free(struct mt76u_buf *buf)
+static void mt76u_buf_free(struct mt76u_buf *buf)
{
struct urb *urb = buf->urb;
int i;
@@ -374,7 +374,6 @@ void mt76u_buf_free(struct mt76u_buf *buf)
usb_free_urb(buf->urb);
}
-EXPORT_SYMBOL_GPL(mt76u_buf_free);
static void
mt76u_fill_bulk_urb(struct mt76_dev *dev, int dir, int index,
@@ -395,9 +394,10 @@ mt76u_fill_bulk_urb(struct mt76_dev *dev, int dir, int index,
complete_fn, context);
}
-int mt76u_submit_buf(struct mt76_dev *dev, int dir, int index,
- struct mt76u_buf *buf, gfp_t gfp,
- usb_complete_t complete_fn, void *context)
+static int
+mt76u_submit_buf(struct mt76_dev *dev, int dir, int index,
+ struct mt76u_buf *buf, gfp_t gfp,
+ usb_complete_t complete_fn, void *context)
{
mt76u_fill_bulk_urb(dev, dir, index, buf, complete_fn,
context);
@@ -405,7 +405,6 @@ int mt76u_submit_buf(struct mt76_dev *dev, int dir, int index,
return usb_submit_urb(buf->urb, gfp);
}
-EXPORT_SYMBOL_GPL(mt76u_submit_buf);
static inline struct mt76u_buf
*mt76u_get_next_rx_entry(struct mt76_queue *q)
--
2.20.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox