Skip to content

Commit

Permalink
ath10k-ct: Add Petr Stetiar's splat-fixing patch.
Browse files Browse the repository at this point in the history
And for 5.4, add tx-queue-wake throttling patch.
  • Loading branch information
greearb committed Apr 29, 2020
1 parent ae600d6 commit 3637be6
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 7 deletions.
1 change: 1 addition & 0 deletions ath10k-4.19/core.h
Expand Up @@ -54,6 +54,7 @@
/* Antenna noise floor */
#define ATH10K_DEFAULT_NOISE_FLOOR -95

#define ATH10K_CT_TX_BEACON_INVALID_RATE_CODE 0xff
#define ATH10K_INVALID_RSSI 128

/* This used to be 128, but klukonin reports increasing this helps in at least
Expand Down
18 changes: 18 additions & 0 deletions ath10k-4.19/htt_rx.c
Expand Up @@ -2068,6 +2068,12 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
tx_done.mpdus_tried,
tx_done.mpdus_failed);*/

/* workaround for possibly firmware bug */
if (unlikely(tx_done.tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "htt tx, wave-1-ct: fixing invalid VHT TX rate code 0xff\n");
tx_done.tx_rate_code = 0;
}

/* kfifo_put: In practice firmware shouldn't fire off per-CE
* interrupt and main interrupt (MSI/-X range case) for the same
* HTC service so it should be safe to use kfifo_put w/o lock.
Expand Down Expand Up @@ -2156,6 +2162,12 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
if (unlikely(tx_done.status != HTT_TX_COMPL_STATE_ACK))
tx_done.ack_rssi = 0;

/* workaround for possibly firmware bug */
if (unlikely(tx_done.tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "htt tx, ack-rssi-filled: fixing invalid VHT TX rate code 0xff\n");
tx_done.tx_rate_code = 0;
}

ath10k_txrx_tx_unref(htt, &tx_done);
}
} else {
Expand All @@ -2167,6 +2179,12 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
msdu_id = resp->data_tx_completion.msdus[i];
tx_done.msdu_id = __le16_to_cpu(msdu_id);

/* workaround for possibly firmware bug */
if (unlikely(tx_done.tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "htt tx ct: fixing invalid VHT TX rate code 0xff\n");
tx_done.tx_rate_code = 0;
}

/* kfifo_put: In practice firmware shouldn't fire off per-CE
* interrupt and main interrupt (MSI/-X range case) for the same
* HTC service so it should be safe to use kfifo_put w/o lock.
Expand Down
8 changes: 7 additions & 1 deletion ath10k-4.19/wmi.c
Expand Up @@ -6000,7 +6000,7 @@ static void ath10k_wmi_generic_buffer_eventid(struct ath10k *ar, struct sk_buff
static void ath10k_wmi_event_beacon_tx(struct ath10k *ar, struct sk_buff *skb)
{
struct ath10k_vif *arvif;
const struct wmi_beacon_tx_event *ev;
struct wmi_beacon_tx_event *ev;
u32 vdev_id;
u32 status;

Expand All @@ -6020,6 +6020,12 @@ static void ath10k_wmi_event_beacon_tx(struct ath10k *ar, struct sk_buff *skb)
status == 0 ? "OK" : (status == 1 ? "XRETRY" : (status == 2 ? "DROP" : "UNKNOWN")),
ev->mpdus_tried, ev->mpdus_failed, ev->tx_rate_code, ev->tx_rate_flags, ev->tsFlags);

/* workaround for possibly firmware bug */
if (unlikely(ev->tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "wmi: fixing invalid VHT TX rate code 0xff\n");
ev->tx_rate_code = 0;
}

arvif = ath10k_get_arvif(ar, vdev_id);
if (!arvif) {
ath10k_warn(ar, "wmi-event-beacon-tx, could not find vdev for id: %u\n",
Expand Down
1 change: 1 addition & 0 deletions ath10k-4.20/core.h
Expand Up @@ -54,6 +54,7 @@
/* Antenna noise floor */
#define ATH10K_DEFAULT_NOISE_FLOOR -95

#define ATH10K_CT_TX_BEACON_INVALID_RATE_CODE 0xff
#define ATH10K_INVALID_RSSI 128

/* This used to be 128, but klukonin reports increasing this helps in at least
Expand Down
12 changes: 12 additions & 0 deletions ath10k-4.20/htt_rx.c
Expand Up @@ -2210,6 +2210,12 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
tx_done.mpdus_tried,
tx_done.mpdus_failed);

/* workaround for possibly firmware bug */
if (unlikely(tx_done.tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "htt tx ct: fixing invalid VHT TX rate code 0xff\n");
tx_done.tx_rate_code = 0;
}

/* kfifo_put: In practice firmware shouldn't fire off per-CE
* interrupt and main interrupt (MSI/-X range case) for the same
* HTC service so it should be safe to use kfifo_put w/o lock.
Expand Down Expand Up @@ -2298,6 +2304,12 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
if (unlikely(tx_done.status != HTT_TX_COMPL_STATE_ACK))
tx_done.ack_rssi = 0;

/* workaround for possibly firmware bug */
if (unlikely(tx_done.tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "htt tx: fixing invalid VHT TX rate code 0xff\n");
tx_done.tx_rate_code = 0;
}

ath10k_txrx_tx_unref(htt, &tx_done);
}
} else {
Expand Down
8 changes: 7 additions & 1 deletion ath10k-4.20/wmi.c
Expand Up @@ -6085,7 +6085,7 @@ static void ath10k_wmi_generic_buffer_eventid(struct ath10k *ar, struct sk_buff
static void ath10k_wmi_event_beacon_tx(struct ath10k *ar, struct sk_buff *skb)
{
struct ath10k_vif *arvif;
const struct wmi_beacon_tx_event *ev;
struct wmi_beacon_tx_event *ev;
u32 vdev_id;
u32 status;

Expand All @@ -6105,6 +6105,12 @@ static void ath10k_wmi_event_beacon_tx(struct ath10k *ar, struct sk_buff *skb)
status == 0 ? "OK" : (status == 1 ? "XRETRY" : (status == 2 ? "DROP" : "UNKNOWN")),
ev->mpdus_tried, ev->mpdus_failed, ev->tx_rate_code, ev->tx_rate_flags, ev->tsFlags);

/* workaround for possibly firmware bug */
if (unlikely(ev->tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "wmi: fixing invalid VHT TX rate code 0xff\n");
ev->tx_rate_code = 0;
}

arvif = ath10k_get_arvif(ar, vdev_id);
if (!arvif) {
ath10k_warn(ar, "wmi-event-beacon-tx, could not find vdev for id: %u\n",
Expand Down
1 change: 1 addition & 0 deletions ath10k-5.2/core.h
Expand Up @@ -43,6 +43,7 @@
/* Antenna noise floor */
#define ATH10K_DEFAULT_NOISE_FLOOR -95

#define ATH10K_CT_TX_BEACON_INVALID_RATE_CODE 0xff
#define ATH10K_INVALID_RSSI 128

/* This used to be 128, but klukonin reports increasing this helps in at least
Expand Down
1 change: 1 addition & 0 deletions ath10k-5.2/htt.h
Expand Up @@ -1903,6 +1903,7 @@ struct ath10k_htt {

u8 target_version_major;
u8 target_version_minor;
bool needs_unlock;
struct completion target_version_received;
u8 max_num_amsdu;
u8 max_num_ampdu;
Expand Down
12 changes: 12 additions & 0 deletions ath10k-5.2/htt_rx.c
Expand Up @@ -2408,6 +2408,12 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
tx_done.mpdus_tried,
tx_done.mpdus_failed);

/* workaround for possibly firmware bug */
if (unlikely(tx_done.tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "htt tx ct: fixing invalid VHT TX rate code 0xff\n");
tx_done.tx_rate_code = 0;
}

/* kfifo_put: In practice firmware shouldn't fire off per-CE
* interrupt and main interrupt (MSI/-X range case) for the same
* HTC service so it should be safe to use kfifo_put w/o lock.
Expand Down Expand Up @@ -2496,6 +2502,12 @@ static void ath10k_htt_rx_tx_compl_ind(struct ath10k *ar,
if (unlikely(tx_done.status != HTT_TX_COMPL_STATE_ACK))
tx_done.ack_rssi = 0;

/* workaround for possibly firmware bug */
if (unlikely(tx_done.tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "htt tx: fixing invalid VHT TX rate code 0xff\n");
tx_done.tx_rate_code = 0;
}

ath10k_txrx_tx_unref(htt, &tx_done);
}
} else {
Expand Down
8 changes: 6 additions & 2 deletions ath10k-5.2/htt_tx.c
Expand Up @@ -145,8 +145,10 @@ void ath10k_htt_tx_dec_pending(struct ath10k_htt *htt)
lockdep_assert_held(&htt->tx_lock);

htt->num_pending_tx--;
if (htt->num_pending_tx == htt->max_num_pending_tx - 1)
if ((htt->num_pending_tx <= (htt->max_num_pending_tx / 4)) && htt->needs_unlock) {
htt->needs_unlock = false;
ath10k_mac_tx_unlock(htt->ar, ATH10K_TX_PAUSE_Q_FULL);
}
}

int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt)
Expand All @@ -157,8 +159,10 @@ int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt)
return -EBUSY;

htt->num_pending_tx++;
if (htt->num_pending_tx == htt->max_num_pending_tx)
if (htt->num_pending_tx == htt->max_num_pending_tx) {
htt->needs_unlock = true;
ath10k_mac_tx_lock(htt->ar, ATH10K_TX_PAUSE_Q_FULL);
}

return 0;
}
Expand Down
8 changes: 7 additions & 1 deletion ath10k-5.2/wmi.c
Expand Up @@ -6201,7 +6201,7 @@ static void ath10k_wmi_generic_buffer_eventid(struct ath10k *ar, struct sk_buff
static void ath10k_wmi_event_beacon_tx(struct ath10k *ar, struct sk_buff *skb)
{
struct ath10k_vif *arvif;
const struct wmi_beacon_tx_event *ev;
struct wmi_beacon_tx_event *ev;
u32 vdev_id;
u32 status;

Expand All @@ -6221,6 +6221,12 @@ static void ath10k_wmi_event_beacon_tx(struct ath10k *ar, struct sk_buff *skb)
status == 0 ? "OK" : (status == 1 ? "XRETRY" : (status == 2 ? "DROP" : "UNKNOWN")),
ev->mpdus_tried, ev->mpdus_failed, ev->tx_rate_code, ev->tx_rate_flags, ev->tsFlags);

/* workaround for possibly firmware bug */
if (unlikely(ev->tx_rate_code == ATH10K_CT_TX_BEACON_INVALID_RATE_CODE)) {
dev_warn_once(ar->dev, "wmi: fixing invalid VHT TX rate code 0xff\n");
ev->tx_rate_code = 0;
}

arvif = ath10k_get_arvif(ar, vdev_id);
if (!arvif) {
ath10k_warn(ar, "wmi-event-beacon-tx, could not find vdev for id: %u\n",
Expand Down
1 change: 1 addition & 0 deletions ath10k-5.4/htt.h
Expand Up @@ -1941,6 +1941,7 @@ struct ath10k_htt {

u8 target_version_major;
u8 target_version_minor;
bool needs_unlock;
struct completion target_version_received;
u8 max_num_amsdu;
u8 max_num_ampdu;
Expand Down
8 changes: 6 additions & 2 deletions ath10k-5.4/htt_tx.c
Expand Up @@ -145,8 +145,10 @@ void ath10k_htt_tx_dec_pending(struct ath10k_htt *htt)
lockdep_assert_held(&htt->tx_lock);

htt->num_pending_tx--;
if (htt->num_pending_tx == htt->max_num_pending_tx - 1)
if ((htt->num_pending_tx <= (htt->max_num_pending_tx / 4)) && htt->needs_unlock) {
htt->needs_unlock = false;
ath10k_mac_tx_unlock(htt->ar, ATH10K_TX_PAUSE_Q_FULL);
}
}

int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt)
Expand All @@ -157,8 +159,10 @@ int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt)
return -EBUSY;

htt->num_pending_tx++;
if (htt->num_pending_tx == htt->max_num_pending_tx)
if (htt->num_pending_tx == htt->max_num_pending_tx) {
htt->needs_unlock = true;
ath10k_mac_tx_lock(htt->ar, ATH10K_TX_PAUSE_Q_FULL);
}

return 0;
}
Expand Down

0 comments on commit 3637be6

Please sign in to comment.