Skip to content

Commit e7e8db7

Browse files
authored
Merge pull request #44 from kitakar5525/mwifiex-split-patch/v5.6
mwifiex: split large commit into three commits
2 parents 9a9ecaa + cecd107 commit e7e8db7

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

drivers/net/wireless/marvell/mwifiex/pcie.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ static bool mwifiex_pcie_ok_to_access_hw(struct mwifiex_adapter *adapter)
146146
*
147147
* If already not suspended, this function allocates and sends a host
148148
* sleep activate request to the firmware and turns off the traffic.
149+
*
150+
* XXX: ignoring all the above comment and just removes the card to
151+
* fix S0ix and "AP scanning (sometimes) not working after suspend".
152+
* Required code is extracted from mwifiex_pcie_remove().
149153
*/
150154
static int mwifiex_pcie_suspend(struct device *dev)
151155
{
@@ -192,6 +196,9 @@ static int mwifiex_pcie_suspend(struct device *dev)
192196
*
193197
* If already not resumed, this function turns on the traffic and
194198
* sends a host sleep cancel request to the firmware.
199+
*
200+
* XXX: ignoring all the above comment and probes the card that was
201+
* removed on suspend. Required code is extracted from mwifiex_pcie_probe().
195202
*/
196203
static int mwifiex_pcie_resume(struct device *dev)
197204
{
@@ -233,8 +240,13 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
233240
const struct pci_device_id *ent)
234241
{
235242
struct pcie_service_card *card;
243+
struct pci_dev *parent_pdev = pci_upstream_bridge(pdev);
236244
int ret;
237245

246+
/* disable bridge_d3 to fix driver crashing after suspend on gen4+
247+
* Surface devices */
248+
parent_pdev->bridge_d3 = false;
249+
238250
pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n",
239251
pdev->vendor, pdev->device, pdev->revision);
240252

@@ -271,8 +283,6 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
271283
return -1;
272284
}
273285

274-
pdev->bus->self->bridge_d3 = false;
275-
276286
return 0;
277287
}
278288

drivers/net/wireless/marvell/mwifiex/sta_cmd.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,6 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
22542254
* - Function init (for first interface only)
22552255
* - Read MAC address (for first interface only)
22562256
* - Reconfigure Tx buffer size (for first interface only)
2257-
* - Enable auto deep sleep (for first interface only)
22582257
* - Get Tx rate
22592258
* - Get Tx power
22602259
* - Set IBSS coalescing status
@@ -2265,13 +2264,13 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
22652264
int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
22662265
{
22672266
struct mwifiex_adapter *adapter = priv->adapter;
2267+
int ret;
22682268
struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl;
22692269
enum state_11d_t state_11d;
22702270
struct mwifiex_ds_11n_tx_cfg tx_cfg;
22712271
u8 sdio_sp_rx_aggr_enable;
22722272
u16 packet_aggr_enable;
22732273
int data;
2274-
int ret;
22752274

22762275
if (first_sta) {
22772276
if (priv->adapter->iface_type == MWIFIEX_PCIE) {
@@ -2388,6 +2387,11 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
23882387
if (ret)
23892388
return -1;
23902389

2390+
/* Not enabling auto deep sleep (auto_ds) by default. Enabling
2391+
* this reportedly causes "suspend/resume fails when not connected
2392+
* to an Access Point." Therefore, the relevant code was removed
2393+
* from here. */
2394+
23912395
if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
23922396
/* Send cmd to FW to enable/disable 11D function */
23932397
state_11d = ENABLE_11D;

0 commit comments

Comments
 (0)