Updated from Linux LTS 3.10.19 to 3.10.20

This commit is contained in:
Nathan 2025-04-07 01:57:49 -05:00
parent f44b345fa9
commit d67348cc45
32 changed files with 417 additions and 100 deletions

View File

@ -1,6 +1,6 @@
VERSION = 3 VERSION = 3
PATCHLEVEL = 10 PATCHLEVEL = 10
SUBLEVEL = 19 SUBLEVEL = 20
EXTRAVERSION = EXTRAVERSION =
NAME = TOSSUG Baby Fish NAME = TOSSUG Baby Fish

View File

@ -776,7 +776,7 @@ static int sh_vou_try_fmt_vid_out(struct file *file, void *priv,
v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1, v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1,
&pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0); &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0);
for (i = 0; ARRAY_SIZE(vou_fmt); i++) for (i = 0; i < ARRAY_SIZE(vou_fmt); i++)
if (vou_fmt[i].pfmt == pix->pixelformat) if (vou_fmt[i].pfmt == pix->pixelformat)
return 0; return 0;

View File

@ -90,8 +90,10 @@ int pwm_channel_alloc(int index, struct pwm_channel *ch)
unsigned long flags; unsigned long flags;
int status = 0; int status = 0;
/* insist on PWM init, with this signal pinned out */ if (!pwm)
if (!pwm || !(pwm->mask & 1 << index)) return -EPROBE_DEFER;
if (!(pwm->mask & 1 << index))
return -ENODEV; return -ENODEV;
if (index < 0 || index >= PWM_NCHAN || !ch) if (index < 0 || index >= PWM_NCHAN || !ch)

View File

@ -1600,7 +1600,8 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb,
flits = skb_transport_offset(skb) / 8; flits = skb_transport_offset(skb) / 8;
sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl; sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb), sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb),
skb->tail - skb->transport_header, skb_tail_pointer(skb) -
skb_transport_header(skb),
adap->pdev); adap->pdev);
if (need_skb_unmap()) { if (need_skb_unmap()) {
setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits); setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits);

View File

@ -1544,7 +1544,7 @@ static void mlx4_master_deactivate_admin_state(struct mlx4_priv *priv, int slave
vp_oper->vlan_idx = NO_INDX; vp_oper->vlan_idx = NO_INDX;
} }
if (NO_INDX != vp_oper->mac_idx) { if (NO_INDX != vp_oper->mac_idx) {
__mlx4_unregister_mac(&priv->dev, port, vp_oper->mac_idx); __mlx4_unregister_mac(&priv->dev, port, vp_oper->state.mac);
vp_oper->mac_idx = NO_INDX; vp_oper->mac_idx = NO_INDX;
} }
} }

View File

@ -1096,11 +1096,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
{ {
struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb); struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb);
mutex_lock(&vi->config_lock);
if (!vi->config_enable)
goto done;
switch(action & ~CPU_TASKS_FROZEN) { switch(action & ~CPU_TASKS_FROZEN) {
case CPU_ONLINE: case CPU_ONLINE:
case CPU_DOWN_FAILED: case CPU_DOWN_FAILED:
@ -1114,8 +1109,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
break; break;
} }
done:
mutex_unlock(&vi->config_lock);
return NOTIFY_OK; return NOTIFY_OK;
} }
@ -1672,6 +1665,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
struct virtnet_info *vi = vdev->priv; struct virtnet_info *vi = vdev->priv;
int i; int i;
unregister_hotcpu_notifier(&vi->nb);
/* Prevent config work handler from accessing the device */ /* Prevent config work handler from accessing the device */
mutex_lock(&vi->config_lock); mutex_lock(&vi->config_lock);
vi->config_enable = false; vi->config_enable = false;
@ -1720,6 +1715,10 @@ static int virtnet_restore(struct virtio_device *vdev)
virtnet_set_queues(vi, vi->curr_queue_pairs); virtnet_set_queues(vi, vi->curr_queue_pairs);
rtnl_unlock(); rtnl_unlock();
err = register_hotcpu_notifier(&vi->nb);
if (err)
return err;
return 0; return 0;
} }
#endif #endif

View File

@ -125,7 +125,7 @@ static const struct iwl_ht_params iwl7000_ht_params = {
const struct iwl_cfg iwl7260_2ac_cfg = { const struct iwl_cfg iwl7260_2ac_cfg = {
.name = "Intel(R) Dual Band Wireless AC7260", .name = "Intel(R) Dual Band Wireless AC 7260",
.fw_name_pre = IWL7260_FW_PRE, .fw_name_pre = IWL7260_FW_PRE,
IWL_DEVICE_7000, IWL_DEVICE_7000,
.ht_params = &iwl7000_ht_params, .ht_params = &iwl7000_ht_params,
@ -133,8 +133,44 @@ const struct iwl_cfg iwl7260_2ac_cfg = {
.nvm_calib_ver = IWL7260_TX_POWER_VERSION, .nvm_calib_ver = IWL7260_TX_POWER_VERSION,
}; };
const struct iwl_cfg iwl3160_ac_cfg = { const struct iwl_cfg iwl7260_2n_cfg = {
.name = "Intel(R) Dual Band Wireless AC3160", .name = "Intel(R) Dual Band Wireless N 7260",
.fw_name_pre = IWL7260_FW_PRE,
IWL_DEVICE_7000,
.ht_params = &iwl7000_ht_params,
.nvm_ver = IWL7260_NVM_VERSION,
.nvm_calib_ver = IWL7260_TX_POWER_VERSION,
};
const struct iwl_cfg iwl7260_n_cfg = {
.name = "Intel(R) Wireless N 7260",
.fw_name_pre = IWL7260_FW_PRE,
IWL_DEVICE_7000,
.ht_params = &iwl7000_ht_params,
.nvm_ver = IWL7260_NVM_VERSION,
.nvm_calib_ver = IWL7260_TX_POWER_VERSION,
};
const struct iwl_cfg iwl3160_2ac_cfg = {
.name = "Intel(R) Dual Band Wireless AC 3160",
.fw_name_pre = IWL3160_FW_PRE,
IWL_DEVICE_7000,
.ht_params = &iwl7000_ht_params,
.nvm_ver = IWL3160_NVM_VERSION,
.nvm_calib_ver = IWL3160_TX_POWER_VERSION,
};
const struct iwl_cfg iwl3160_2n_cfg = {
.name = "Intel(R) Dual Band Wireless N 3160",
.fw_name_pre = IWL3160_FW_PRE,
IWL_DEVICE_7000,
.ht_params = &iwl7000_ht_params,
.nvm_ver = IWL3160_NVM_VERSION,
.nvm_calib_ver = IWL3160_TX_POWER_VERSION,
};
const struct iwl_cfg iwl3160_n_cfg = {
.name = "Intel(R) Wireless N 3160",
.fw_name_pre = IWL3160_FW_PRE, .fw_name_pre = IWL3160_FW_PRE,
IWL_DEVICE_7000, IWL_DEVICE_7000,
.ht_params = &iwl7000_ht_params, .ht_params = &iwl7000_ht_params,

View File

@ -321,6 +321,10 @@ extern const struct iwl_cfg iwl105_bgn_cfg;
extern const struct iwl_cfg iwl105_bgn_d_cfg; extern const struct iwl_cfg iwl105_bgn_d_cfg;
extern const struct iwl_cfg iwl135_bgn_cfg; extern const struct iwl_cfg iwl135_bgn_cfg;
extern const struct iwl_cfg iwl7260_2ac_cfg; extern const struct iwl_cfg iwl7260_2ac_cfg;
extern const struct iwl_cfg iwl3160_ac_cfg; extern const struct iwl_cfg iwl7260_2n_cfg;
extern const struct iwl_cfg iwl7260_n_cfg;
extern const struct iwl_cfg iwl3160_2ac_cfg;
extern const struct iwl_cfg iwl3160_2n_cfg;
extern const struct iwl_cfg iwl3160_n_cfg;
#endif /* __IWL_CONFIG_H__ */ #endif /* __IWL_CONFIG_H__ */

View File

@ -267,10 +267,83 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
/* 7000 Series */ /* 7000 Series */
{IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)}, {IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_2ac_cfg)}, {IWL_PCI_DEVICE(0x08B1, 0x4072, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4170, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4060, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x406A, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4160, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4162, iwl7260_n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0x4270, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0x4272, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0x4260, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0x426A, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0x4262, iwl7260_n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4470, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4472, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4460, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x446A, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4462, iwl7260_n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4870, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x486E, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4570, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4560, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0x4370, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0x4360, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x5070, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4020, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x402A, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0x4220, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0x4420, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)}, {IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_ac_cfg)}, {IWL_PCI_DEVICE(0x08B1, 0xC072, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_ac_cfg)}, {IWL_PCI_DEVICE(0x08B1, 0xC170, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC060, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC06A, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC160, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC062, iwl7260_n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC162, iwl7260_n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC770, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC760, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0xC270, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0xC272, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0xC260, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0xC26A, iwl7260_n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0xC262, iwl7260_n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC470, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC472, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC460, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC462, iwl7260_n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC570, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC560, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0xC370, iwl7260_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC360, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC020, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC02A, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B2, 0xC220, iwl7260_2n_cfg)},
{IWL_PCI_DEVICE(0x08B1, 0xC420, iwl7260_2n_cfg)},
/* 3160 Series */
{IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x0072, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x0170, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x0172, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x0060, iwl3160_2n_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x0062, iwl3160_n_cfg)},
{IWL_PCI_DEVICE(0x08B4, 0x0270, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B4, 0x0272, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x0470, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x0472, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B4, 0x0370, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x8072, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x8170, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x8172, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)},
{IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)},
{IWL_PCI_DEVICE(0x08B3, 0x8570, iwl3160_2ac_cfg)},
{0} {0}
}; };

View File

@ -88,6 +88,7 @@ struct xenvif {
unsigned long credit_usec; unsigned long credit_usec;
unsigned long remaining_credit; unsigned long remaining_credit;
struct timer_list credit_timeout; struct timer_list credit_timeout;
u64 credit_window_start;
/* Statistics */ /* Statistics */
unsigned long rx_gso_checksum_fixup; unsigned long rx_gso_checksum_fixup;

View File

@ -275,8 +275,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
vif->credit_bytes = vif->remaining_credit = ~0UL; vif->credit_bytes = vif->remaining_credit = ~0UL;
vif->credit_usec = 0UL; vif->credit_usec = 0UL;
init_timer(&vif->credit_timeout); init_timer(&vif->credit_timeout);
/* Initialize 'expires' now: it's used to track the credit window. */ vif->credit_window_start = get_jiffies_64();
vif->credit_timeout.expires = jiffies;
dev->netdev_ops = &xenvif_netdev_ops; dev->netdev_ops = &xenvif_netdev_ops;
dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;

View File

@ -1423,9 +1423,8 @@ out:
static bool tx_credit_exceeded(struct xenvif *vif, unsigned size) static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
{ {
unsigned long now = jiffies; u64 now = get_jiffies_64();
unsigned long next_credit = u64 next_credit = vif->credit_window_start +
vif->credit_timeout.expires +
msecs_to_jiffies(vif->credit_usec / 1000); msecs_to_jiffies(vif->credit_usec / 1000);
/* Timer could already be pending in rare cases. */ /* Timer could already be pending in rare cases. */
@ -1433,8 +1432,8 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
return true; return true;
/* Passed the point where we can replenish credit? */ /* Passed the point where we can replenish credit? */
if (time_after_eq(now, next_credit)) { if (time_after_eq64(now, next_credit)) {
vif->credit_timeout.expires = now; vif->credit_window_start = now;
tx_add_credit(vif); tx_add_credit(vif);
} }
@ -1446,6 +1445,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
tx_credit_callback; tx_credit_callback;
mod_timer(&vif->credit_timeout, mod_timer(&vif->credit_timeout,
next_credit); next_credit);
vif->credit_window_start = next_credit;
return true; return true;
} }

View File

@ -24,6 +24,12 @@
struct backend_info { struct backend_info {
struct xenbus_device *dev; struct xenbus_device *dev;
struct xenvif *vif; struct xenvif *vif;
/* This is the state that will be reflected in xenstore when any
* active hotplug script completes.
*/
enum xenbus_state state;
enum xenbus_state frontend_state; enum xenbus_state frontend_state;
struct xenbus_watch hotplug_status_watch; struct xenbus_watch hotplug_status_watch;
u8 have_hotplug_status_watch:1; u8 have_hotplug_status_watch:1;
@ -33,11 +39,15 @@ static int connect_rings(struct backend_info *);
static void connect(struct backend_info *); static void connect(struct backend_info *);
static void backend_create_xenvif(struct backend_info *be); static void backend_create_xenvif(struct backend_info *be);
static void unregister_hotplug_status_watch(struct backend_info *be); static void unregister_hotplug_status_watch(struct backend_info *be);
static void set_backend_state(struct backend_info *be,
enum xenbus_state state);
static int netback_remove(struct xenbus_device *dev) static int netback_remove(struct xenbus_device *dev)
{ {
struct backend_info *be = dev_get_drvdata(&dev->dev); struct backend_info *be = dev_get_drvdata(&dev->dev);
set_backend_state(be, XenbusStateClosed);
unregister_hotplug_status_watch(be); unregister_hotplug_status_watch(be);
if (be->vif) { if (be->vif) {
kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
@ -126,6 +136,8 @@ static int netback_probe(struct xenbus_device *dev,
if (err) if (err)
goto fail; goto fail;
be->state = XenbusStateInitWait;
/* This kicks hotplug scripts, so do it immediately. */ /* This kicks hotplug scripts, so do it immediately. */
backend_create_xenvif(be); backend_create_xenvif(be);
@ -198,24 +210,113 @@ static void backend_create_xenvif(struct backend_info *be)
kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE); kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
} }
static void backend_disconnect(struct backend_info *be)
static void disconnect_backend(struct xenbus_device *dev)
{ {
struct backend_info *be = dev_get_drvdata(&dev->dev);
if (be->vif) if (be->vif)
xenvif_disconnect(be->vif); xenvif_disconnect(be->vif);
} }
static void destroy_backend(struct xenbus_device *dev) static void backend_connect(struct backend_info *be)
{ {
struct backend_info *be = dev_get_drvdata(&dev->dev); if (be->vif)
connect(be);
}
if (be->vif) { static inline void backend_switch_state(struct backend_info *be,
kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); enum xenbus_state state)
xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); {
xenvif_free(be->vif); struct xenbus_device *dev = be->dev;
be->vif = NULL;
pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
be->state = state;
/* If we are waiting for a hotplug script then defer the
* actual xenbus state change.
*/
if (!be->have_hotplug_status_watch)
xenbus_switch_state(dev, state);
}
/* Handle backend state transitions:
*
* The backend state starts in InitWait and the following transitions are
* allowed.
*
* InitWait -> Connected
*
* ^ \ |
* | \ |
* | \ |
* | \ |
* | \ |
* | \ |
* | V V
*
* Closed <-> Closing
*
* The state argument specifies the eventual state of the backend and the
* function transitions to that state via the shortest path.
*/
static void set_backend_state(struct backend_info *be,
enum xenbus_state state)
{
while (be->state != state) {
switch (be->state) {
case XenbusStateClosed:
switch (state) {
case XenbusStateInitWait:
case XenbusStateConnected:
pr_info("%s: prepare for reconnect\n",
be->dev->nodename);
backend_switch_state(be, XenbusStateInitWait);
break;
case XenbusStateClosing:
backend_switch_state(be, XenbusStateClosing);
break;
default:
BUG();
}
break;
case XenbusStateInitWait:
switch (state) {
case XenbusStateConnected:
backend_connect(be);
backend_switch_state(be, XenbusStateConnected);
break;
case XenbusStateClosing:
case XenbusStateClosed:
backend_switch_state(be, XenbusStateClosing);
break;
default:
BUG();
}
break;
case XenbusStateConnected:
switch (state) {
case XenbusStateInitWait:
case XenbusStateClosing:
case XenbusStateClosed:
backend_disconnect(be);
backend_switch_state(be, XenbusStateClosing);
break;
default:
BUG();
}
break;
case XenbusStateClosing:
switch (state) {
case XenbusStateInitWait:
case XenbusStateConnected:
case XenbusStateClosed:
backend_switch_state(be, XenbusStateClosed);
break;
default:
BUG();
}
break;
default:
BUG();
}
} }
} }
@ -227,41 +328,33 @@ static void frontend_changed(struct xenbus_device *dev,
{ {
struct backend_info *be = dev_get_drvdata(&dev->dev); struct backend_info *be = dev_get_drvdata(&dev->dev);
pr_debug("frontend state %s", xenbus_strstate(frontend_state)); pr_debug("%s -> %s\n", dev->otherend, xenbus_strstate(frontend_state));
be->frontend_state = frontend_state; be->frontend_state = frontend_state;
switch (frontend_state) { switch (frontend_state) {
case XenbusStateInitialising: case XenbusStateInitialising:
if (dev->state == XenbusStateClosed) { set_backend_state(be, XenbusStateInitWait);
printk(KERN_INFO "%s: %s: prepare for reconnect\n",
__func__, dev->nodename);
xenbus_switch_state(dev, XenbusStateInitWait);
}
break; break;
case XenbusStateInitialised: case XenbusStateInitialised:
break; break;
case XenbusStateConnected: case XenbusStateConnected:
if (dev->state == XenbusStateConnected) set_backend_state(be, XenbusStateConnected);
break;
if (be->vif)
connect(be);
break; break;
case XenbusStateClosing: case XenbusStateClosing:
disconnect_backend(dev); set_backend_state(be, XenbusStateClosing);
xenbus_switch_state(dev, XenbusStateClosing);
break; break;
case XenbusStateClosed: case XenbusStateClosed:
xenbus_switch_state(dev, XenbusStateClosed); set_backend_state(be, XenbusStateClosed);
if (xenbus_dev_is_online(dev)) if (xenbus_dev_is_online(dev))
break; break;
destroy_backend(dev);
/* fall through if not online */ /* fall through if not online */
case XenbusStateUnknown: case XenbusStateUnknown:
set_backend_state(be, XenbusStateClosed);
device_unregister(&dev->dev); device_unregister(&dev->dev);
break; break;
@ -354,7 +447,9 @@ static void hotplug_status_changed(struct xenbus_watch *watch,
if (IS_ERR(str)) if (IS_ERR(str))
return; return;
if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) { if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) {
xenbus_switch_state(be->dev, XenbusStateConnected); /* Complete any pending state change */
xenbus_switch_state(be->dev, be->state);
/* Not interested in this watch anymore. */ /* Not interested in this watch anymore. */
unregister_hotplug_status_watch(be); unregister_hotplug_status_watch(be);
} }
@ -384,12 +479,8 @@ static void connect(struct backend_info *be)
err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
hotplug_status_changed, hotplug_status_changed,
"%s/%s", dev->nodename, "hotplug-status"); "%s/%s", dev->nodename, "hotplug-status");
if (err) { if (!err)
/* Switch now, since we can't do a watch. */
xenbus_switch_state(dev, XenbusStateConnected);
} else {
be->have_hotplug_status_watch = 1; be->have_hotplug_status_watch = 1;
}
netif_wake_queue(be->vif->dev); netif_wake_queue(be->vif->dev);
} }

View File

@ -1011,6 +1011,7 @@ static int register_root_hub(struct usb_hcd *hcd)
dev_name(&usb_dev->dev), retval); dev_name(&usb_dev->dev), retval);
return retval; return retval;
} }
usb_dev->lpm_capable = usb_device_supports_lpm(usb_dev);
} }
retval = usb_new_device (usb_dev); retval = usb_new_device (usb_dev);

View File

@ -152,7 +152,7 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev)
return usb_get_intfdata(hdev->actconfig->interface[0]); return usb_get_intfdata(hdev->actconfig->interface[0]);
} }
static int usb_device_supports_lpm(struct usb_device *udev) int usb_device_supports_lpm(struct usb_device *udev)
{ {
/* USB 2.1 (and greater) devices indicate LPM support through /* USB 2.1 (and greater) devices indicate LPM support through
* their USB 2.0 Extended Capabilities BOS descriptor. * their USB 2.0 Extended Capabilities BOS descriptor.
@ -173,6 +173,11 @@ static int usb_device_supports_lpm(struct usb_device *udev)
"Power management will be impacted.\n"); "Power management will be impacted.\n");
return 0; return 0;
} }
/* udev is root hub */
if (!udev->parent)
return 1;
if (udev->parent->lpm_capable) if (udev->parent->lpm_capable)
return 1; return 1;

View File

@ -35,6 +35,7 @@ extern int usb_get_device_descriptor(struct usb_device *dev,
unsigned int size); unsigned int size);
extern int usb_get_bos_descriptor(struct usb_device *dev); extern int usb_get_bos_descriptor(struct usb_device *dev);
extern void usb_release_bos_descriptor(struct usb_device *dev); extern void usb_release_bos_descriptor(struct usb_device *dev);
extern int usb_device_supports_lpm(struct usb_device *udev);
extern char *usb_cache_string(struct usb_device *udev, int index); extern char *usb_cache_string(struct usb_device *udev, int index);
extern int usb_set_configuration(struct usb_device *dev, int configuration); extern int usb_set_configuration(struct usb_device *dev, int configuration);
extern int usb_choose_configuration(struct usb_device *udev); extern int usb_choose_configuration(struct usb_device *udev);

View File

@ -1379,6 +1379,23 @@ static const struct usb_device_id option_ids[] = {
.driver_info = (kernel_ulong_t)&net_intf2_blacklist }, .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff), /* ZTE MF91 */ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff), /* ZTE MF91 */
.driver_info = (kernel_ulong_t)&net_intf2_blacklist }, .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1545, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1546, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1547, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1565, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1566, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1567, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1589, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1590, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1591, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1592, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1594, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1596, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1598, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1600, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist }, 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },

View File

@ -118,7 +118,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = {
.update_status = atmel_pwm_bl_set_intensity, .update_status = atmel_pwm_bl_set_intensity,
}; };
static int __init atmel_pwm_bl_probe(struct platform_device *pdev) static int atmel_pwm_bl_probe(struct platform_device *pdev)
{ {
struct backlight_properties props; struct backlight_properties props;
const struct atmel_pwm_bl_platform_data *pdata; const struct atmel_pwm_bl_platform_data *pdata;
@ -203,7 +203,7 @@ err_free_mem:
return retval; return retval;
} }
static int __exit atmel_pwm_bl_remove(struct platform_device *pdev) static int atmel_pwm_bl_remove(struct platform_device *pdev)
{ {
struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev); struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev);
@ -222,10 +222,11 @@ static struct platform_driver atmel_pwm_bl_driver = {
.name = "atmel-pwm-bl", .name = "atmel-pwm-bl",
}, },
/* REVISIT add suspend() and resume() */ /* REVISIT add suspend() and resume() */
.remove = __exit_p(atmel_pwm_bl_remove), .probe = atmel_pwm_bl_probe,
.remove = atmel_pwm_bl_remove,
}; };
module_platform_driver_probe(atmel_pwm_bl_driver, atmel_pwm_bl_probe); module_platform_driver(atmel_pwm_bl_driver);
MODULE_AUTHOR("Hans-Christian egtvedt <hans-christian.egtvedt@atmel.com>"); MODULE_AUTHOR("Hans-Christian egtvedt <hans-christian.egtvedt@atmel.com>");
MODULE_DESCRIPTION("Atmel PWM backlight driver"); MODULE_DESCRIPTION("Atmel PWM backlight driver");

View File

@ -795,12 +795,21 @@ static int hvfb_remove(struct hv_device *hdev)
} }
static DEFINE_PCI_DEVICE_TABLE(pci_stub_id_table) = {
{
.vendor = PCI_VENDOR_ID_MICROSOFT,
.device = PCI_DEVICE_ID_HYPERV_VIDEO,
},
{ /* end of list */ }
};
static const struct hv_vmbus_device_id id_table[] = { static const struct hv_vmbus_device_id id_table[] = {
/* Synthetic Video Device GUID */ /* Synthetic Video Device GUID */
{HV_SYNTHVID_GUID}, {HV_SYNTHVID_GUID},
{} {}
}; };
MODULE_DEVICE_TABLE(pci, pci_stub_id_table);
MODULE_DEVICE_TABLE(vmbus, id_table); MODULE_DEVICE_TABLE(vmbus, id_table);
static struct hv_driver hvfb_drv = { static struct hv_driver hvfb_drv = {
@ -810,14 +819,43 @@ static struct hv_driver hvfb_drv = {
.remove = hvfb_remove, .remove = hvfb_remove,
}; };
static int hvfb_pci_stub_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
return 0;
}
static void hvfb_pci_stub_remove(struct pci_dev *pdev)
{
}
static struct pci_driver hvfb_pci_stub_driver = {
.name = KBUILD_MODNAME,
.id_table = pci_stub_id_table,
.probe = hvfb_pci_stub_probe,
.remove = hvfb_pci_stub_remove,
};
static int __init hvfb_drv_init(void) static int __init hvfb_drv_init(void)
{ {
return vmbus_driver_register(&hvfb_drv); int ret;
ret = vmbus_driver_register(&hvfb_drv);
if (ret != 0)
return ret;
ret = pci_register_driver(&hvfb_pci_stub_driver);
if (ret != 0) {
vmbus_driver_unregister(&hvfb_drv);
return ret;
}
return 0;
} }
static void __exit hvfb_drv_exit(void) static void __exit hvfb_drv_exit(void)
{ {
pci_unregister_driver(&hvfb_pci_stub_driver);
vmbus_driver_unregister(&hvfb_drv); vmbus_driver_unregister(&hvfb_drv);
} }

View File

@ -165,6 +165,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
static inline void rt6_clean_expires(struct rt6_info *rt) static inline void rt6_clean_expires(struct rt6_info *rt)
{ {
rt->rt6i_flags &= ~RTF_EXPIRES; rt->rt6i_flags &= ~RTF_EXPIRES;
rt->dst.expires = 0;
} }
static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires) static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)

View File

@ -113,7 +113,7 @@ struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
__be32 key); __be32 key);
int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
const struct tnl_ptk_info *tpi, bool log_ecn_error); const struct tnl_ptk_info *tpi, int hdr_len, bool log_ecn_error);
int ip_tunnel_changelink(struct net_device *dev, struct nlattr *tb[], int ip_tunnel_changelink(struct net_device *dev, struct nlattr *tb[],
struct ip_tunnel_parm *p); struct ip_tunnel_parm *p);
int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[], int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],

View File

@ -425,13 +425,15 @@ struct perf_event_mmap_page {
/* /*
* Control data for the mmap() data buffer. * Control data for the mmap() data buffer.
* *
* User-space reading the @data_head value should issue an rmb(), on * User-space reading the @data_head value should issue an smp_rmb(),
* SMP capable platforms, after reading this value -- see * after reading this value.
* perf_event_wakeup().
* *
* When the mapping is PROT_WRITE the @data_tail value should be * When the mapping is PROT_WRITE the @data_tail value should be
* written by userspace to reflect the last read data. In this case * written by userspace to reflect the last read data, after issueing
* the kernel will not over-write unread data. * an smp_mb() to separate the data read from the ->data_tail store.
* In this case the kernel will not over-write unread data.
*
* See perf_output_put_handle() for the data ordering.
*/ */
__u64 data_head; /* head in the data section */ __u64 data_head; /* head in the data section */
__u64 data_tail; /* user-space written tail */ __u64 data_tail; /* user-space written tail */

View File

@ -87,10 +87,31 @@ again:
goto out; goto out;
/* /*
* Publish the known good head. Rely on the full barrier implied * Since the mmap() consumer (userspace) can run on a different CPU:
* by atomic_dec_and_test() order the rb->head read and this *
* write. * kernel user
*
* READ ->data_tail READ ->data_head
* smp_mb() (A) smp_rmb() (C)
* WRITE $data READ $data
* smp_wmb() (B) smp_mb() (D)
* STORE ->data_head WRITE ->data_tail
*
* Where A pairs with D, and B pairs with C.
*
* I don't think A needs to be a full barrier because we won't in fact
* write data until we see the store from userspace. So we simply don't
* issue the data WRITE until we observe it. Be conservative for now.
*
* OTOH, D needs to be a full barrier since it separates the data READ
* from the tail WRITE.
*
* For B a WMB is sufficient since it separates two WRITEs, and for C
* an RMB is sufficient since it separates two READs.
*
* See perf_output_begin().
*/ */
smp_wmb();
rb->user_page->data_head = head; rb->user_page->data_head = head;
/* /*
@ -154,9 +175,11 @@ int perf_output_begin(struct perf_output_handle *handle,
* Userspace could choose to issue a mb() before updating the * Userspace could choose to issue a mb() before updating the
* tail pointer. So that all reads will be completed before the * tail pointer. So that all reads will be completed before the
* write is issued. * write is issued.
*
* See perf_output_put_handle().
*/ */
tail = ACCESS_ONCE(rb->user_page->data_tail); tail = ACCESS_ONCE(rb->user_page->data_tail);
smp_rmb(); smp_mb();
offset = head = local_read(&rb->head); offset = head = local_read(&rb->head);
head += size; head += size;
if (unlikely(!perf_output_space(rb, tail, offset, head))) if (unlikely(!perf_output_space(rb, tail, offset, head)))

View File

@ -859,9 +859,12 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
if (isspace(ch)) { if (isspace(ch)) {
parser->buffer[parser->idx] = 0; parser->buffer[parser->idx] = 0;
parser->cont = false; parser->cont = false;
} else { } else if (parser->idx < parser->size - 1) {
parser->cont = true; parser->cont = true;
parser->buffer[parser->idx++] = ch; parser->buffer[parser->idx++] = ch;
} else {
ret = -EINVAL;
goto out;
} }
*ppos += read; *ppos += read;

View File

@ -61,6 +61,7 @@ static int __init batadv_init(void)
batadv_recv_handler_init(); batadv_recv_handler_init();
batadv_iv_init(); batadv_iv_init();
batadv_nc_init();
batadv_event_workqueue = create_singlethread_workqueue("bat_events"); batadv_event_workqueue = create_singlethread_workqueue("bat_events");
@ -138,7 +139,7 @@ int batadv_mesh_init(struct net_device *soft_iface)
if (ret < 0) if (ret < 0)
goto err; goto err;
ret = batadv_nc_init(bat_priv); ret = batadv_nc_mesh_init(bat_priv);
if (ret < 0) if (ret < 0)
goto err; goto err;
@ -163,7 +164,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
batadv_vis_quit(bat_priv); batadv_vis_quit(bat_priv);
batadv_gw_node_purge(bat_priv); batadv_gw_node_purge(bat_priv);
batadv_nc_free(bat_priv); batadv_nc_mesh_free(bat_priv);
batadv_dat_free(bat_priv); batadv_dat_free(bat_priv);
batadv_bla_free(bat_priv); batadv_bla_free(bat_priv);

View File

@ -34,6 +34,20 @@ static void batadv_nc_worker(struct work_struct *work);
static int batadv_nc_recv_coded_packet(struct sk_buff *skb, static int batadv_nc_recv_coded_packet(struct sk_buff *skb,
struct batadv_hard_iface *recv_if); struct batadv_hard_iface *recv_if);
/**
* batadv_nc_init - one-time initialization for network coding
*/
int __init batadv_nc_init(void)
{
int ret;
/* Register our packet type */
ret = batadv_recv_handler_register(BATADV_CODED,
batadv_nc_recv_coded_packet);
return ret;
}
/** /**
* batadv_nc_start_timer - initialise the nc periodic worker * batadv_nc_start_timer - initialise the nc periodic worker
* @bat_priv: the bat priv with all the soft interface information * @bat_priv: the bat priv with all the soft interface information
@ -45,10 +59,10 @@ static void batadv_nc_start_timer(struct batadv_priv *bat_priv)
} }
/** /**
* batadv_nc_init - initialise coding hash table and start house keeping * batadv_nc_mesh_init - initialise coding hash table and start house keeping
* @bat_priv: the bat priv with all the soft interface information * @bat_priv: the bat priv with all the soft interface information
*/ */
int batadv_nc_init(struct batadv_priv *bat_priv) int batadv_nc_mesh_init(struct batadv_priv *bat_priv)
{ {
bat_priv->nc.timestamp_fwd_flush = jiffies; bat_priv->nc.timestamp_fwd_flush = jiffies;
bat_priv->nc.timestamp_sniffed_purge = jiffies; bat_priv->nc.timestamp_sniffed_purge = jiffies;
@ -70,11 +84,6 @@ int batadv_nc_init(struct batadv_priv *bat_priv)
batadv_hash_set_lock_class(bat_priv->nc.coding_hash, batadv_hash_set_lock_class(bat_priv->nc.coding_hash,
&batadv_nc_decoding_hash_lock_class_key); &batadv_nc_decoding_hash_lock_class_key);
/* Register our packet type */
if (batadv_recv_handler_register(BATADV_CODED,
batadv_nc_recv_coded_packet) < 0)
goto err;
INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker);
batadv_nc_start_timer(bat_priv); batadv_nc_start_timer(bat_priv);
@ -1722,12 +1731,11 @@ free_nc_packet:
} }
/** /**
* batadv_nc_free - clean up network coding memory * batadv_nc_mesh_free - clean up network coding memory
* @bat_priv: the bat priv with all the soft interface information * @bat_priv: the bat priv with all the soft interface information
*/ */
void batadv_nc_free(struct batadv_priv *bat_priv) void batadv_nc_mesh_free(struct batadv_priv *bat_priv)
{ {
batadv_recv_handler_unregister(BATADV_CODED);
cancel_delayed_work_sync(&bat_priv->nc.work); cancel_delayed_work_sync(&bat_priv->nc.work);
batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash, NULL); batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash, NULL);

View File

@ -22,8 +22,9 @@
#ifdef CONFIG_BATMAN_ADV_NC #ifdef CONFIG_BATMAN_ADV_NC
int batadv_nc_init(struct batadv_priv *bat_priv); int batadv_nc_init(void);
void batadv_nc_free(struct batadv_priv *bat_priv); int batadv_nc_mesh_init(struct batadv_priv *bat_priv);
void batadv_nc_mesh_free(struct batadv_priv *bat_priv);
void batadv_nc_update_nc_node(struct batadv_priv *bat_priv, void batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
struct batadv_orig_node *orig_node, struct batadv_orig_node *orig_node,
struct batadv_orig_node *orig_neigh_node, struct batadv_orig_node *orig_neigh_node,
@ -47,12 +48,17 @@ int batadv_nc_init_debugfs(struct batadv_priv *bat_priv);
#else /* ifdef CONFIG_BATMAN_ADV_NC */ #else /* ifdef CONFIG_BATMAN_ADV_NC */
static inline int batadv_nc_init(struct batadv_priv *bat_priv) static inline int batadv_nc_init(void)
{ {
return 0; return 0;
} }
static inline void batadv_nc_free(struct batadv_priv *bat_priv) static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv)
{
return 0;
}
static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv)
{ {
return; return;
} }

View File

@ -335,7 +335,7 @@ static int ipgre_rcv(struct sk_buff *skb)
iph->saddr, iph->daddr, tpi.key); iph->saddr, iph->daddr, tpi.key);
if (tunnel) { if (tunnel) {
ip_tunnel_rcv(tunnel, skb, &tpi, log_ecn_error); ip_tunnel_rcv(tunnel, skb, &tpi, hdr_len, log_ecn_error);
return 0; return 0;
} }
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);

View File

@ -402,7 +402,7 @@ static struct ip_tunnel *ip_tunnel_create(struct net *net,
} }
int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
const struct tnl_ptk_info *tpi, bool log_ecn_error) const struct tnl_ptk_info *tpi, int hdr_len, bool log_ecn_error)
{ {
struct pcpu_tstats *tstats; struct pcpu_tstats *tstats;
const struct iphdr *iph = ip_hdr(skb); const struct iphdr *iph = ip_hdr(skb);
@ -413,7 +413,7 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
skb->protocol = tpi->proto; skb->protocol = tpi->proto;
skb->mac_header = skb->network_header; skb->mac_header = skb->network_header;
__pskb_pull(skb, tunnel->hlen); __pskb_pull(skb, hdr_len);
skb_postpull_rcsum(skb, skb_transport_header(skb), tunnel->hlen); skb_postpull_rcsum(skb, skb_transport_header(skb), tunnel->hlen);
#ifdef CONFIG_NET_IPGRE_BROADCAST #ifdef CONFIG_NET_IPGRE_BROADCAST
if (ipv4_is_multicast(iph->daddr)) { if (ipv4_is_multicast(iph->daddr)) {

View File

@ -195,7 +195,7 @@ static int ipip_rcv(struct sk_buff *skb)
if (tunnel) { if (tunnel) {
if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb))
goto drop; goto drop;
return ip_tunnel_rcv(tunnel, skb, &tpi, log_ecn_error); return ip_tunnel_rcv(tunnel, skb, &tpi, 0, log_ecn_error);
} }
return -1; return -1;

View File

@ -1084,10 +1084,13 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
if (rt->rt6i_genid != rt_genid(dev_net(rt->dst.dev))) if (rt->rt6i_genid != rt_genid(dev_net(rt->dst.dev)))
return NULL; return NULL;
if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie))
return dst; return NULL;
return NULL; if (rt6_check_expired(rt))
return NULL;
return dst;
} }
static struct dst_entry *ip6_negative_advice(struct dst_entry *dst) static struct dst_entry *ip6_negative_advice(struct dst_entry *dst)

View File

@ -816,9 +816,10 @@ static int hdmi_manual_setup_channel_mapping(struct hda_codec *codec,
static void hdmi_setup_fake_chmap(unsigned char *map, int ca) static void hdmi_setup_fake_chmap(unsigned char *map, int ca)
{ {
int i; int i;
int ordered_ca = get_channel_allocation_order(ca);
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if (i < channel_allocations[ca].channels) if (i < channel_allocations[ordered_ca].channels)
map[i] = from_cea_slot((hdmi_channel_mapping[ca][i] >> 4) & 0x0f); map[i] = from_cea_slot(hdmi_channel_mapping[ca][i] & 0x0f);
else else
map[i] = 0; map[i] = 0;
} }