r8152: move calling r8153b_rx_agg_chg_indicate()
r8153b_rx_agg_chg_indicate() needs to be called after enabling TX/RX and before calling rxdy_gated_en(tp, false). Otherwise, the change of the settings of RX aggregation wouldn't work. Besides, adjust rtl8152_set_coalesce() for the same reason. If rx_coalesce_usecs is changed, restart TX/RX to let the setting work. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1e64d7cbfd
commit
9fae54186c
|
@ -2367,6 +2367,12 @@ static int rtl_stop_rx(struct r8152 *tp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void r8153b_rx_agg_chg_indicate(struct r8152 *tp)
|
||||||
|
{
|
||||||
|
ocp_write_byte(tp, MCU_TYPE_USB, USB_UPT_RXDMA_OWN,
|
||||||
|
OWN_UPDATE | OWN_CLEAR);
|
||||||
|
}
|
||||||
|
|
||||||
static int rtl_enable(struct r8152 *tp)
|
static int rtl_enable(struct r8152 *tp)
|
||||||
{
|
{
|
||||||
u32 ocp_data;
|
u32 ocp_data;
|
||||||
|
@ -2377,6 +2383,15 @@ static int rtl_enable(struct r8152 *tp)
|
||||||
ocp_data |= CR_RE | CR_TE;
|
ocp_data |= CR_RE | CR_TE;
|
||||||
ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, ocp_data);
|
ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, ocp_data);
|
||||||
|
|
||||||
|
switch (tp->version) {
|
||||||
|
case RTL_VER_08:
|
||||||
|
case RTL_VER_09:
|
||||||
|
r8153b_rx_agg_chg_indicate(tp);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
rxdy_gated_en(tp, false);
|
rxdy_gated_en(tp, false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2393,12 +2408,6 @@ static int rtl8152_enable(struct r8152 *tp)
|
||||||
return rtl_enable(tp);
|
return rtl_enable(tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void r8153b_rx_agg_chg_indicate(struct r8152 *tp)
|
|
||||||
{
|
|
||||||
ocp_write_byte(tp, MCU_TYPE_USB, USB_UPT_RXDMA_OWN,
|
|
||||||
OWN_UPDATE | OWN_CLEAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void r8153_set_rx_early_timeout(struct r8152 *tp)
|
static void r8153_set_rx_early_timeout(struct r8152 *tp)
|
||||||
{
|
{
|
||||||
u32 ocp_data = tp->coalesce / 8;
|
u32 ocp_data = tp->coalesce / 8;
|
||||||
|
@ -2421,7 +2430,6 @@ static void r8153_set_rx_early_timeout(struct r8152 *tp)
|
||||||
128 / 8);
|
128 / 8);
|
||||||
ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EXTRA_AGGR_TMR,
|
ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EXTRA_AGGR_TMR,
|
||||||
ocp_data);
|
ocp_data);
|
||||||
r8153b_rx_agg_chg_indicate(tp);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -2445,7 +2453,6 @@ static void r8153_set_rx_early_size(struct r8152 *tp)
|
||||||
case RTL_VER_09:
|
case RTL_VER_09:
|
||||||
ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EARLY_SIZE,
|
ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EARLY_SIZE,
|
||||||
ocp_data / 8);
|
ocp_data / 8);
|
||||||
r8153b_rx_agg_chg_indicate(tp);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WARN_ON_ONCE(1);
|
WARN_ON_ONCE(1);
|
||||||
|
@ -4919,8 +4926,17 @@ static int rtl8152_set_coalesce(struct net_device *netdev,
|
||||||
if (tp->coalesce != coalesce->rx_coalesce_usecs) {
|
if (tp->coalesce != coalesce->rx_coalesce_usecs) {
|
||||||
tp->coalesce = coalesce->rx_coalesce_usecs;
|
tp->coalesce = coalesce->rx_coalesce_usecs;
|
||||||
|
|
||||||
if (netif_running(tp->netdev) && netif_carrier_ok(netdev))
|
if (netif_running(netdev) && netif_carrier_ok(netdev)) {
|
||||||
r8153_set_rx_early_timeout(tp);
|
netif_stop_queue(netdev);
|
||||||
|
napi_disable(&tp->napi);
|
||||||
|
tp->rtl_ops.disable(tp);
|
||||||
|
tp->rtl_ops.enable(tp);
|
||||||
|
rtl_start_rx(tp);
|
||||||
|
clear_bit(RTL8152_SET_RX_MODE, &tp->flags);
|
||||||
|
_rtl8152_set_rx_mode(netdev);
|
||||||
|
napi_enable(&tp->napi);
|
||||||
|
netif_wake_queue(netdev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_unlock(&tp->control);
|
mutex_unlock(&tp->control);
|
||||||
|
|
Loading…
Reference in New Issue