Pull to get the thermal netlink multicast group name fix, otherwise the assertion added in net-next to netlink to detect that kind of bug makes systems unbootable for some folks.
Unified · Split
| @@ -73,9 +73,11 @@ static struct usb_device_id ath3k_table[] = { · 72 unmodified lines | ||
| 73 | 73 | { USB_DEVICE(0x03F0, 0x311D) }, |
| 74 | 74 | |
| 75 | 75 | /* Atheros AR3012 with sflash firmware*/ |
| 76 | + { USB_DEVICE(0x0CF3, 0x0036) }, | |
| 76 | 77 | { USB_DEVICE(0x0CF3, 0x3004) }, |
| 77 | 78 | { USB_DEVICE(0x0CF3, 0x3008) }, |
| 78 | 79 | { USB_DEVICE(0x0CF3, 0x311D) }, |
| 80 | + { USB_DEVICE(0x0CF3, 0x817a) }, | |
| 79 | 81 | { USB_DEVICE(0x13d3, 0x3375) }, |
| 80 | 82 | { USB_DEVICE(0x04CA, 0x3004) }, |
| 81 | 83 | { USB_DEVICE(0x04CA, 0x3005) }, |
| @@ -107,9 +109,11 @@ MODULE_DEVICE_TABLE(usb, ath3k_table); · 25 unmodified lines | ||
| 107 | 109 | static struct usb_device_id ath3k_blist_tbl[] = { |
| 108 | 110 | |
| 109 | 111 | /* Atheros AR3012 with sflash firmware*/ |
| 112 | + { USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 }, | |
| 110 | 113 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, |
| 111 | 114 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, |
| 112 | 115 | { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, |
| 116 | + { USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 }, | |
| 113 | 117 | { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, |
| 114 | 118 | { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, |
| 115 | 119 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, |
| @@ -131,9 +131,11 @@ static struct usb_device_id blacklist_table[] = { · 130 unmodified lines | ||
| 131 | 131 | { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, |
| 132 | 132 | |
| 133 | 133 | /* Atheros 3012 with sflash firmware */ |
| 134 | + { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 }, | |
| 134 | 135 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, |
| 135 | 136 | { USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 }, |
| 136 | 137 | { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, |
| 138 | + { USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 }, | |
| 137 | 139 | { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, |
| 138 | 140 | { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, |
| 139 | 141 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, |
| @@ -128,6 +128,7 @@ void fec_ptp_start_cyclecounter(struct net_device *ndev) · 127 unmodified lines | ||
| 128 | 128 | |
| 129 | 129 | spin_unlock_irqrestore(&fep->tmreg_lock, flags); |
| 130 | 130 | } |
| 131 | +EXPORT_SYMBOL(fec_ptp_start_cyclecounter); | |
| 131 | 132 | |
| 132 | 133 | /** |
| 133 | 134 | * fec_ptp_adjfreq - adjust ptp cycle frequency |
| @@ -318,6 +319,7 @@ int fec_ptp_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) · 184 unmodified lines | ||
| 318 | 319 | return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? |
| 319 | 320 | -EFAULT : 0; |
| 320 | 321 | } |
| 322 | +EXPORT_SYMBOL(fec_ptp_ioctl); | |
| 321 | 323 | |
| 322 | 324 | /** |
| 323 | 325 | * fec_time_keep - call timecounter_read every second to avoid timer overrun |
| @@ -383,3 +385,4 @@ void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev) · 59 unmodified lines | ||
| 383 | 385 | pr_info("registered PHC device on %s\n", ndev->name); |
| 384 | 386 | } |
| 385 | 387 | } |
| 388 | +EXPORT_SYMBOL(fec_ptp_init); | |
| @@ -769,7 +769,7 @@ ltq_etop_probe(struct platform_device *pdev) · 768 unmodified lines | ||
| 769 | 769 | return 0; |
| 770 | 770 | |
| 771 | 771 | err_free: |
| 772 | − kfree(dev); | |
| 772 | + free_netdev(dev); | |
| 773 | 773 | err_out: |
| 774 | 774 | return err; |
| 775 | 775 | } |
| @@ -1637,6 +1637,17 @@ void mlx4_en_stop_port(struct net_device *dev, int detach) · 1636 unmodified lines | ||
| 1637 | 1637 | /* Flush multicast filter */ |
| 1638 | 1638 | mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 1, MLX4_MCAST_CONFIG); |
| 1639 | 1639 | |
| 1640 | + /* Remove flow steering rules for the port*/ | |
| 1641 | + if (mdev->dev->caps.steering_mode == | |
| 1642 | + MLX4_STEERING_MODE_DEVICE_MANAGED) { | |
| 1643 | + ASSERT_RTNL(); | |
| 1644 | + list_for_each_entry_safe(flow, tmp_flow, | |
| 1645 | + &priv->ethtool_list, list) { | |
| 1646 | + mlx4_flow_detach(mdev->dev, flow->id); | |
| 1647 | + list_del(&flow->list); | |
| 1648 | + } | |
| 1649 | + } | |
| 1650 | + | |
| 1640 | 1651 | mlx4_en_destroy_drop_qp(priv); |
| 1641 | 1652 | |
| 1642 | 1653 | /* Free TX Rings */ |
| @@ -1657,17 +1668,6 @@ void mlx4_en_stop_port(struct net_device *dev, int detach) · 14 unmodified lines | ||
| 1657 | 1668 | if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN)) |
| 1658 | 1669 | mdev->mac_removed[priv->port] = 1; |
| 1659 | 1670 | |
| 1660 | − /* Remove flow steering rules for the port*/ | |
| 1661 | − if (mdev->dev->caps.steering_mode == | |
| 1662 | − MLX4_STEERING_MODE_DEVICE_MANAGED) { | |
| 1663 | − ASSERT_RTNL(); | |
| 1664 | − list_for_each_entry_safe(flow, tmp_flow, | |
| 1665 | − &priv->ethtool_list, list) { | |
| 1666 | − mlx4_flow_detach(mdev->dev, flow->id); | |
| 1667 | − list_del(&flow->list); | |
| 1668 | − } | |
| 1669 | − } | |
| 1670 | − | |
| 1671 | 1671 | /* Free RX Rings */ |
| 1672 | 1672 | for (i = 0; i < priv->rx_ring_num; i++) { |
| 1673 | 1673 | mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[i]); |
| @@ -771,7 +771,7 @@ int mlx4_MAP_EQ_wrapper(struct mlx4_dev *dev, int slave, · 770 unmodified lines | ||
| 771 | 771 | struct mlx4_slave_event_eq_info *event_eq = |
| 772 | 772 | priv->mfunc.master.slave_state[slave].event_eq; |
| 773 | 773 | u32 in_modifier = vhcr->in_modifier; |
| 774 | − u32 eqn = in_modifier & 0x1FF; | |
| 774 | + u32 eqn = in_modifier & 0x3FF; | |
| 775 | 775 | u64 in_param = vhcr->in_param; |
| 776 | 776 | int err = 0; |
| 777 | 777 | int i; |
| @@ -99,6 +99,7 @@ struct res_qp { · 98 unmodified lines | ||
| 99 | 99 | struct list_head mcg_list; |
| 100 | 100 | spinlock_t mcg_spl; |
| 101 | 101 | int local_qpn; |
| 102 | + atomic_t ref_count; | |
| 102 | 103 | }; |
| 103 | 104 | |
| 104 | 105 | enum res_mtt_states { |
| @@ -197,6 +198,7 @@ enum res_fs_rule_states { · 92 unmodified lines | ||
| 197 | 198 | |
| 198 | 199 | struct res_fs_rule { |
| 199 | 200 | struct res_common com; |
| 201 | + int qpn; | |
| 200 | 202 | }; |
| 201 | 203 | |
| 202 | 204 | static void *res_tracker_lookup(struct rb_root *root, u64 res_id) |
| @@ -355,7 +357,7 @@ static int mpt_mask(struct mlx4_dev *dev) · 152 unmodified lines | ||
| 355 | 357 | return dev->caps.num_mpts - 1; |
| 356 | 358 | } |
| 357 | 359 | |
| 358 | −static void *find_res(struct mlx4_dev *dev, int res_id, | |
| 360 | +static void *find_res(struct mlx4_dev *dev, u64 res_id, | |
| 359 | 361 | enum mlx4_resource type) |
| 360 | 362 | { |
| 361 | 363 | struct mlx4_priv *priv = mlx4_priv(dev); |
| @@ -447,6 +449,7 @@ static struct res_common *alloc_qp_tr(int id) · 85 unmodified lines | ||
| 447 | 449 | ret->local_qpn = id; |
| 448 | 450 | INIT_LIST_HEAD(&ret->mcg_list); |
| 449 | 451 | spin_lock_init(&ret->mcg_spl); |
| 452 | + atomic_set(&ret->ref_count, 0); | |
| 450 | 453 | |
| 451 | 454 | return &ret->com; |
| 452 | 455 | } |
| @@ -554,7 +557,7 @@ static struct res_common *alloc_xrcdn_tr(int id) · 101 unmodified lines | ||
| 554 | 557 | return &ret->com; |
| 555 | 558 | } |
| 556 | 559 | |
| 557 | −static struct res_common *alloc_fs_rule_tr(u64 id) | |
| 560 | +static struct res_common *alloc_fs_rule_tr(u64 id, int qpn) | |
| 558 | 561 | { |
| 559 | 562 | struct res_fs_rule *ret; |
| 560 | 563 | |
| @@ -564,7 +567,7 @@ static struct res_common *alloc_fs_rule_tr(u64 id) · 3 unmodified lines | ||
| 564 | 567 | |
| 565 | 568 | ret->com.res_id = id; |
| 566 | 569 | ret->com.state = RES_FS_RULE_ALLOCATED; |
| 567 | − | |
| 570 | + ret->qpn = qpn; | |
| 568 | 571 | return &ret->com; |
| 569 | 572 | } |
| 570 | 573 | |
| @@ -602,7 +605,7 @@ static struct res_common *alloc_tr(u64 id, enum mlx4_resource type, int slave, · 31 unmodified lines | ||
| 602 | 605 | ret = alloc_xrcdn_tr(id); |
| 603 | 606 | break; |
| 604 | 607 | case RES_FS_RULE: |
| 605 | − ret = alloc_fs_rule_tr(id); | |
| 608 | + ret = alloc_fs_rule_tr(id, extra); | |
| 606 | 609 | break; |
| 607 | 610 | default: |
| 608 | 611 | return NULL; |
| @@ -671,10 +674,14 @@ undo: · 62 unmodified lines | ||
| 671 | 674 | |
| 672 | 675 | static int remove_qp_ok(struct res_qp *res) |
| 673 | 676 | { |
| 674 | − if (res->com.state == RES_QP_BUSY) | |
| 677 | + if (res->com.state == RES_QP_BUSY || atomic_read(&res->ref_count) || | |
| 678 | + !list_empty(&res->mcg_list)) { | |
| 679 | + pr_err("resource tracker: fail to remove qp, state %d, ref_count %d\n", | |
| 680 | + res->com.state, atomic_read(&res->ref_count)); | |
| 675 | 681 | return -EBUSY; |
| 676 | − else if (res->com.state != RES_QP_RESERVED) | |
| 682 | + } else if (res->com.state != RES_QP_RESERVED) { | |
| 677 | 683 | return -EPERM; |
| 684 | + } | |
| 678 | 685 | |
| 679 | 686 | return 0; |
| 680 | 687 | } |
| @@ -3124,6 +3131,7 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, · 2443 unmodified lines | ||
| 3124 | 3131 | struct list_head *rlist = &tracker->slave_list[slave].res_list[RES_MAC]; |
| 3125 | 3132 | int err; |
| 3126 | 3133 | int qpn; |
| 3134 | + struct res_qp *rqp; | |
| 3127 | 3135 | struct mlx4_net_trans_rule_hw_ctrl *ctrl; |
| 3128 | 3136 | struct _rule_hw *rule_header; |
| 3129 | 3137 | int header_id; |
| @@ -3134,7 +3142,7 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, · 4 unmodified lines | ||
| 3134 | 3142 | |
| 3135 | 3143 | ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)inbox->buf; |
| 3136 | 3144 | qpn = be32_to_cpu(ctrl->qpn) & 0xffffff; |
| 3137 | − err = get_res(dev, slave, qpn, RES_QP, NULL); | |
| 3145 | + err = get_res(dev, slave, qpn, RES_QP, &rqp); | |
| 3138 | 3146 | if (err) { |
| 3139 | 3147 | pr_err("Steering rule with qpn 0x%x rejected.\n", qpn); |
| 3140 | 3148 | return err; |
| @@ -3175,14 +3183,16 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave, · 34 unmodified lines | ||
| 3175 | 3183 | if (err) |
| 3176 | 3184 | goto err_put; |
| 3177 | 3185 | |
| 3178 | − err = add_res_range(dev, slave, vhcr->out_param, 1, RES_FS_RULE, 0); | |
| 3186 | + err = add_res_range(dev, slave, vhcr->out_param, 1, RES_FS_RULE, qpn); | |
| 3179 | 3187 | if (err) { |
| 3180 | 3188 | mlx4_err(dev, "Fail to add flow steering resources.\n "); |
| 3181 | 3189 | /* detach rule*/ |
| 3182 | 3190 | mlx4_cmd(dev, vhcr->out_param, 0, 0, |
| 3183 | 3191 | MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A, |
| 3184 | 3192 | MLX4_CMD_NATIVE); |
| 3193 | + goto err_put; | |
| 3185 | 3194 | } |
| 3195 | + atomic_inc(&rqp->ref_count); | |
| 3186 | 3196 | err_put: |
| 3187 | 3197 | put_res(dev, slave, qpn, RES_QP); |
| 3188 | 3198 | return err; |
| @@ -3195,20 +3205,35 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave, · 6 unmodified lines | ||
| 3195 | 3205 | struct mlx4_cmd_info *cmd) |
| 3196 | 3206 | { |
| 3197 | 3207 | int err; |
| 3208 | + struct res_qp *rqp; | |
| 3209 | + struct res_fs_rule *rrule; | |
| 3198 | 3210 | |
| 3199 | 3211 | if (dev->caps.steering_mode != |
| 3200 | 3212 | MLX4_STEERING_MODE_DEVICE_MANAGED) |
| 3201 | 3213 | return -EOPNOTSUPP; |
| 3202 | 3214 | |
| 3215 | + err = get_res(dev, slave, vhcr->in_param, RES_FS_RULE, &rrule); | |
| 3216 | + if (err) | |
| 3217 | + return err; | |
| 3218 | + /* Release the rule form busy state before removal */ | |
| 3219 | + put_res(dev, slave, vhcr->in_param, RES_FS_RULE); | |
| 3220 | + err = get_res(dev, slave, rrule->qpn, RES_QP, &rqp); | |
| 3221 | + if (err) | |
| 3222 | + return err; | |
| 3223 | + | |
| 3203 | 3224 | err = rem_res_range(dev, slave, vhcr->in_param, 1, RES_FS_RULE, 0); |
| 3204 | 3225 | if (err) { |
| 3205 | 3226 | mlx4_err(dev, "Fail to remove flow steering resources.\n "); |
| 3206 | − return err; | |
| 3227 | + goto out; | |
| 3207 | 3228 | } |
| 3208 | 3229 | |
| 3209 | 3230 | err = mlx4_cmd(dev, vhcr->in_param, 0, 0, |
| 3210 | 3231 | MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A, |
| 3211 | 3232 | MLX4_CMD_NATIVE); |
| 3233 | + if (!err) | |
| 3234 | + atomic_dec(&rqp->ref_count); | |
| 3235 | +out: | |
| 3236 | + put_res(dev, slave, rrule->qpn, RES_QP); | |
| 3212 | 3237 | return err; |
| 3213 | 3238 | } |
| 3214 | 3239 | |
| @@ -3806,6 +3831,7 @@ void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave) · 591 unmodified lines | ||
| 3806 | 3831 | mutex_lock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex); |
| 3807 | 3832 | /*VLAN*/ |
| 3808 | 3833 | rem_slave_macs(dev, slave); |
| 3834 | + rem_slave_fs_rule(dev, slave); | |
| 3809 | 3835 | rem_slave_qps(dev, slave); |
| 3810 | 3836 | rem_slave_srqs(dev, slave); |
| 3811 | 3837 | rem_slave_cqs(dev, slave); |
| @@ -3814,6 +3840,5 @@ void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave) · 2 unmodified lines | ||
| 3814 | 3840 | rem_slave_mtts(dev, slave); |
| 3815 | 3841 | rem_slave_counters(dev, slave); |
| 3816 | 3842 | rem_slave_xrcdns(dev, slave); |
| 3817 | − rem_slave_fs_rule(dev, slave); | |
| 3818 | 3843 | mutex_unlock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex); |
| 3819 | 3844 | } |
| @@ -1504,7 +1504,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, · 1503 unmodified lines | ||
| 1504 | 1504 | struct platform_device *mdio; |
| 1505 | 1505 | |
| 1506 | 1506 | parp = of_get_property(slave_node, "phy_id", &lenp); |
| 1507 | − if ((parp == NULL) && (lenp != (sizeof(void *) * 2))) { | |
| 1507 | + if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { | |
| 1508 | 1508 | pr_err("Missing slave[%d] phy_id property\n", i); |
| 1509 | 1509 | ret = -EINVAL; |
| 1510 | 1510 | goto error_ret; |
| @@ -1023,6 +1023,7 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah, · 1022 unmodified lines | ||
| 1023 | 1023 | AR_PHY_AGC_CONTROL_FLTR_CAL | |
| 1024 | 1024 | AR_PHY_AGC_CONTROL_PKDET_CAL; |
| 1025 | 1025 | |
| 1026 | + /* Use chip chainmask only for calibration */ | |
| 1026 | 1027 | ar9003_hw_set_chain_masks(ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask); |
| 1027 | 1028 | |
| 1028 | 1029 | if (rtt) { |
| @@ -1150,6 +1151,9 @@ skip_tx_iqcal: · 121 unmodified lines | ||
| 1150 | 1151 | ar9003_hw_rtt_disable(ah); |
| 1151 | 1152 | } |
| 1152 | 1153 | |
| 1154 | + /* Revert chainmask to runtime parameters */ | |
| 1155 | + ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); | |
| 1156 | + | |
| 1153 | 1157 | /* Initialize list pointers */ |
| 1154 | 1158 | ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL; |
| 1155 | 1159 | |
| @@ -28,21 +28,21 @@ void ath_tx_complete_poll_work(struct work_struct *work) · 27 unmodified lines | ||
| 28 | 28 | int i; |
| 29 | 29 | bool needreset = false; |
| 30 | 30 | |
| 31 | − for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) | |
| 32 | − if (ATH_TXQ_SETUP(sc, i)) { | |
| 33 | − txq = &sc->tx.txq[i]; | |
| 34 | − ath_txq_lock(sc, txq); | |
| 35 | − if (txq->axq_depth) { | |
| 36 | − if (txq->axq_tx_inprogress) { | |
| 37 | − needreset = true; | |
| 38 | − ath_txq_unlock(sc, txq); | |
| 39 | − break; | |
| 40 | − } else { | |
| 41 | − txq->axq_tx_inprogress = true; | |
| 42 | − } | |
| 31 | + for (i = 0; i < IEEE80211_NUM_ACS; i++) { | |
| 32 | + txq = sc->tx.txq_map[i]; | |
| 33 | + | |
| 34 | + ath_txq_lock(sc, txq); | |
| 35 | + if (txq->axq_depth) { | |
| 36 | + if (txq->axq_tx_inprogress) { | |
| 37 | + needreset = true; | |
| 38 | + ath_txq_unlock(sc, txq); | |
| 39 | + break; | |
| 40 | + } else { | |
| 41 | + txq->axq_tx_inprogress = true; | |
| 43 | 42 | } |
| 44 | − ath_txq_unlock_complete(sc, txq); | |
| 45 | 43 | } |
| 44 | + ath_txq_unlock_complete(sc, txq); | |
| 45 | + } | |
| 46 | 46 | |
| 47 | 47 | if (needreset) { |
| 48 | 48 | ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, |
| @@ -475,6 +475,7 @@ il3945_tx_skb(struct il_priv *il, · 474 unmodified lines | ||
| 475 | 475 | dma_addr_t txcmd_phys; |
| 476 | 476 | int txq_id = skb_get_queue_mapping(skb); |
| 477 | 477 | u16 len, idx, hdr_len; |
| 478 | + u16 firstlen, secondlen; | |
| 478 | 479 | u8 id; |
| 479 | 480 | u8 unicast; |
| 480 | 481 | u8 sta_id; |
| @@ -589,21 +590,22 @@ il3945_tx_skb(struct il_priv *il, · 108 unmodified lines | ||
| 589 | 590 | len = |
| 590 | 591 | sizeof(struct il3945_tx_cmd) + sizeof(struct il_cmd_header) + |
| 591 | 592 | hdr_len; |
| 592 | − len = (len + 3) & ~3; | |
| 593 | + firstlen = (len + 3) & ~3; | |
| 593 | 594 | |
| 594 | 595 | /* Physical address of this Tx command's header (not MAC header!), |
| 595 | 596 | * within command buffer array. */ |
| 596 | 597 | txcmd_phys = |
| 597 | − pci_map_single(il->pci_dev, &out_cmd->hdr, len, PCI_DMA_TODEVICE); | |
| 598 | + pci_map_single(il->pci_dev, &out_cmd->hdr, firstlen, | |
| 599 | + PCI_DMA_TODEVICE); | |
| 598 | 600 | if (unlikely(pci_dma_mapping_error(il->pci_dev, txcmd_phys))) |
| 599 | 601 | goto drop_unlock; |
| 600 | 602 | |
| 601 | 603 | /* Set up TFD's 2nd entry to point directly to remainder of skb, |
| 602 | 604 | * if any (802.11 null frames have no payload). */ |
| 603 | − len = skb->len - hdr_len; | |
| 604 | − if (len) { | |
| 605 | + secondlen = skb->len - hdr_len; | |
| 606 | + if (secondlen > 0) { | |
| 605 | 607 | phys_addr = |
| 606 | − pci_map_single(il->pci_dev, skb->data + hdr_len, len, | |
| 608 | + pci_map_single(il->pci_dev, skb->data + hdr_len, secondlen, | |
| 607 | 609 | PCI_DMA_TODEVICE); |
| 608 | 610 | if (unlikely(pci_dma_mapping_error(il->pci_dev, phys_addr))) |
| 609 | 611 | goto drop_unlock; |
| @@ -611,12 +613,12 @@ il3945_tx_skb(struct il_priv *il, · 1 unmodified line | ||
| 611 | 613 | |
| 612 | 614 | /* Add buffer containing Tx command and MAC(!) header to TFD's |
| 613 | 615 | * first entry */ |
| 614 | − il->ops->txq_attach_buf_to_tfd(il, txq, txcmd_phys, len, 1, 0); | |
| 616 | + il->ops->txq_attach_buf_to_tfd(il, txq, txcmd_phys, firstlen, 1, 0); | |
| 615 | 617 | dma_unmap_addr_set(out_meta, mapping, txcmd_phys); |
| 616 | − dma_unmap_len_set(out_meta, len, len); | |
| 617 | − if (len) | |
| 618 | − il->ops->txq_attach_buf_to_tfd(il, txq, phys_addr, len, 0, | |
| 619 | − U32_PAD(len)); | |
| 618 | + dma_unmap_len_set(out_meta, len, firstlen); | |
| 619 | + if (secondlen > 0) | |
| 620 | + il->ops->txq_attach_buf_to_tfd(il, txq, phys_addr, secondlen, 0, | |
| 621 | + U32_PAD(secondlen)); | |
| 620 | 622 | |
| 621 | 623 | if (!ieee80211_has_morefrags(hdr->frame_control)) { |
| 622 | 624 | txq->need_update = 1; |
| @@ -157,6 +157,20 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, · 156 unmodified lines | ||
| 157 | 157 | return -1; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | + cmd_code = le16_to_cpu(host_cmd->command); | |
| 161 | + cmd_size = le16_to_cpu(host_cmd->size); | |
| 162 | + | |
| 163 | + if (adapter->hw_status == MWIFIEX_HW_STATUS_RESET && | |
| 164 | + cmd_code != HostCmd_CMD_FUNC_SHUTDOWN && | |
| 165 | + cmd_code != HostCmd_CMD_FUNC_INIT) { | |
| 166 | + dev_err(adapter->dev, | |
| 167 | + "DNLD_CMD: FW in reset state, ignore cmd %#x\n", | |
| 168 | + cmd_code); | |
| 169 | + mwifiex_complete_cmd(adapter, cmd_node); | |
| 170 | + mwifiex_insert_cmd_to_free_q(adapter, cmd_node); | |
| 171 | + return -1; | |
| 172 | + } | |
| 173 | + | |
| 160 | 174 | /* Set command sequence number */ |
| 161 | 175 | adapter->seq_num++; |
| 162 | 176 | host_cmd->seq_num = cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO |
| @@ -168,9 +182,6 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, · 5 unmodified lines | ||
| 168 | 182 | adapter->curr_cmd = cmd_node; |
| 169 | 183 | spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); |
| 170 | 184 | |
| 171 | − cmd_code = le16_to_cpu(host_cmd->command); | |
| 172 | − cmd_size = le16_to_cpu(host_cmd->size); | |
| 173 | − | |
| 174 | 185 | /* Adjust skb length */ |
| 175 | 186 | if (cmd_node->cmd_skb->len > cmd_size) |
| 176 | 187 | /* |
| @@ -484,8 +495,6 @@ int mwifiex_send_cmd_sync(struct mwifiex_private *priv, uint16_t cmd_no, · 307 unmodified lines | ||
| 484 | 495 | |
| 485 | 496 | ret = mwifiex_send_cmd_async(priv, cmd_no, cmd_action, cmd_oid, |
| 486 | 497 | data_buf); |
| 487 | − if (!ret) | |
| 488 | − ret = mwifiex_wait_queue_complete(adapter); | |
| 489 | 498 | |
| 490 | 499 | return ret; |
| 491 | 500 | } |
| @@ -588,9 +597,10 @@ int mwifiex_send_cmd_async(struct mwifiex_private *priv, uint16_t cmd_no, · 96 unmodified lines | ||
| 588 | 597 | if (cmd_no == HostCmd_CMD_802_11_SCAN) { |
| 589 | 598 | mwifiex_queue_scan_cmd(priv, cmd_node); |
| 590 | 599 | } else { |
| 591 | − adapter->cmd_queued = cmd_node; | |
| 592 | 600 | mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, true); |
| 593 | 601 | queue_work(adapter->workqueue, &adapter->main_work); |
| 602 | + if (cmd_node->wait_q_enabled) | |
| 603 | + ret = mwifiex_wait_queue_complete(adapter, cmd_node); | |
| 594 | 604 | } |
| 595 | 605 | |
| 596 | 606 | return ret; |
| @@ -709,6 +709,14 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) · 708 unmodified lines | ||
| 709 | 709 | return ret; |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | + /* cancel current command */ | |
| 713 | + if (adapter->curr_cmd) { | |
| 714 | + dev_warn(adapter->dev, "curr_cmd is still in processing\n"); | |
| 715 | + del_timer(&adapter->cmd_timer); | |
| 716 | + mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd); | |
| 717 | + adapter->curr_cmd = NULL; | |
| 718 | + } | |
| 719 | + | |
| 712 | 720 | /* shut down mwifiex */ |
| 713 | 721 | dev_dbg(adapter->dev, "info: shutdown mwifiex...\n"); |
| 714 | 722 | |
| @@ -728,7 +728,6 @@ struct mwifiex_adapter { · 727 unmodified lines | ||
| 728 | 728 | u16 cmd_wait_q_required; |
| 729 | 729 | struct mwifiex_wait_queue cmd_wait_q; |
| 730 | 730 | u8 scan_wait_q_woken; |
| 731 | − struct cmd_ctrl_node *cmd_queued; | |
| 732 | 731 | spinlock_t queue_lock; /* lock for tx queues */ |
| 733 | 732 | struct completion fw_load; |
| 734 | 733 | u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; |
| @@ -1023,7 +1022,8 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv, · 288 unmodified lines | ||
| 1023 | 1022 | struct mwifiex_multicast_list *mcast_list); |
| 1024 | 1023 | int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, |
| 1025 | 1024 | struct net_device *dev); |
| 1026 | −int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter); | |
| 1025 | +int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter, | |
| 1026 | + struct cmd_ctrl_node *cmd_queued); | |
| 1027 | 1027 | int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, |
| 1028 | 1028 | struct cfg80211_ssid *req_ssid); |
| 1029 | 1029 | int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type); |
| @@ -1388,10 +1388,13 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, · 1387 unmodified lines | ||
| 1388 | 1388 | list_del(&cmd_node->list); |
| 1389 | 1389 | spin_unlock_irqrestore(&adapter->scan_pending_q_lock, |
| 1390 | 1390 | flags); |
| 1391 | − adapter->cmd_queued = cmd_node; | |
| 1392 | 1391 | mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, |
| 1393 | 1392 | true); |
| 1394 | 1393 | queue_work(adapter->workqueue, &adapter->main_work); |
| 1394 | + | |
| 1395 | + /* Perform internal scan synchronously */ | |
| 1396 | + if (!priv->scan_request) | |
| 1397 | + mwifiex_wait_queue_complete(adapter, cmd_node); | |
| 1395 | 1398 | } else { |
| 1396 | 1399 | spin_unlock_irqrestore(&adapter->scan_pending_q_lock, |
| 1397 | 1400 | flags); |
| @@ -1946,9 +1949,6 @@ int mwifiex_request_scan(struct mwifiex_private *priv, · 548 unmodified lines | ||
| 1946 | 1949 | /* Normal scan */ |
| 1947 | 1950 | ret = mwifiex_scan_networks(priv, NULL); |
| 1948 | 1951 | |
| 1949 | − if (!ret) | |
| 1950 | − ret = mwifiex_wait_queue_complete(priv->adapter); | |
| 1951 | − | |
| 1952 | 1952 | up(&priv->async_sem); |
| 1953 | 1953 | |
| 1954 | 1954 | return ret; |
| @@ -54,16 +54,10 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, · 53 unmodified lines | ||
| 54 | 54 | * This function waits on a cmd wait queue. It also cancels the pending |
| 55 | 55 | * request after waking up, in case of errors. |
| 56 | 56 | */ |
| 57 | −int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) | |
| 57 | +int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter, | |
| 58 | + struct cmd_ctrl_node *cmd_queued) | |
| 58 | 59 | { |
| 59 | 60 | int status; |
| 60 | − struct cmd_ctrl_node *cmd_queued; | |
| 61 | − | |
| 62 | − if (!adapter->cmd_queued) | |
| 63 | − return 0; | |
| 64 | − | |
| 65 | − cmd_queued = adapter->cmd_queued; | |
| 66 | − adapter->cmd_queued = NULL; | |
| 67 | 61 | |
| 68 | 62 | dev_dbg(adapter->dev, "cmd pending\n"); |
| 69 | 63 | atomic_inc(&adapter->cmd_pending); |
| @@ -850,6 +850,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb, · 849 unmodified lines | ||
| 850 | 850 | if (unlikely(!_urb)) { |
| 851 | 851 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
| 852 | 852 | "Can't allocate urb. Drop skb!\n"); |
| 853 | + kfree_skb(skb); | |
| 853 | 854 | return; |
| 854 | 855 | } |
| 855 | 856 | _rtl_submit_tx_urb(hw, _urb); |
| @@ -44,7 +44,7 @@ · 43 unmodified lines | ||
| 44 | 44 | /* Adding event notification support elements */ |
| 45 | 45 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" |
| 46 | 46 | #define THERMAL_GENL_VERSION 0x01 |
| 47 | −#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" | |
| 47 | +#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_grp" | |
| 48 | 48 | |
| 49 | 49 | /* Default Thermal Governor */ |
| 50 | 50 | #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) |
| @@ -33,9 +33,11 @@ enum { · 32 unmodified lines | ||
| 33 | 33 | PACKET_DIAG_TX_RING, |
| 34 | 34 | PACKET_DIAG_FANOUT, |
| 35 | 35 | |
| 36 | − PACKET_DIAG_MAX, | |
| 36 | + __PACKET_DIAG_MAX, | |
| 37 | 37 | }; |
| 38 | 38 | |
| 39 | +#define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1) | |
| 40 | + | |
| 39 | 41 | struct packet_diag_info { |
| 40 | 42 | __u32 pdi_index; |
| 41 | 43 | __u32 pdi_version; |
| @@ -39,9 +39,11 @@ enum { · 38 unmodified lines | ||
| 39 | 39 | UNIX_DIAG_MEMINFO, |
| 40 | 40 | UNIX_DIAG_SHUTDOWN, |
| 41 | 41 | |
| 42 | − UNIX_DIAG_MAX, | |
| 42 | + __UNIX_DIAG_MAX, | |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | +#define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1) | |
| 46 | + | |
| 45 | 47 | struct unix_diag_vfs { |
| 46 | 48 | __u32 udiag_vfs_ino; |
| 47 | 49 | __u32 udiag_vfs_dev; |
| @@ -359,6 +359,7 @@ static void __sco_sock_close(struct sock *sk) · 358 unmodified lines | ||
| 359 | 359 | sco_chan_del(sk, ECONNRESET); |
| 360 | 360 | break; |
| 361 | 361 | |
| 362 | + case BT_CONNECT2: | |
| 362 | 363 | case BT_CONNECT: |
| 363 | 364 | case BT_DISCONN: |
| 364 | 365 | sco_chan_del(sk, ECONNRESET); |
| @@ -1640,8 +1640,11 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) · 1639 unmodified lines | ||
| 1640 | 1640 | goto send_now; |
| 1641 | 1641 | } |
| 1642 | 1642 | |
| 1643 | − /* Ok, it looks like it is advisable to defer. */ | |
| 1644 | − tp->tso_deferred = 1 | (jiffies << 1); | |
| 1643 | + /* Ok, it looks like it is advisable to defer. | |
| 1644 | + * Do not rearm the timer if already set to not break TCP ACK clocking. | |
| 1645 | + */ | |
| 1646 | + if (!tp->tso_deferred) | |
| 1647 | + tp->tso_deferred = 1 | (jiffies << 1); | |
| 1645 | 1648 | |
| 1646 | 1649 | return true; |
| 1647 | 1650 | |