Skip to content

Commit

Permalink
Merge branch 'rpi-5.4.y' of github.com:raspberrypi/linux into rpi-5.4.y
Browse files Browse the repository at this point in the history
  • Loading branch information
spockfish committed Sep 15, 2020
2 parents 4fcff9b + 1cbfe9e commit 039adaf
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 4
SUBLEVEL = 64
SUBLEVEL = 65
EXTRAVERSION =
NAME = Kleptomaniac Octopus

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/overlays/gpio-fan-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* - sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000"
* or
* - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Default\ndtoverlay=gpio-fan\n" >> /boot/config.txt'
* - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Custom\ntoverlay=gpio-fan,gpiopin=12,temp=45000\n" >> /boot/config.txt'
* - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Custom\ndtoverlay=gpio-fan,gpiopin=12,temp=45000\n" >> /boot/config.txt'
*
*/
/dts-v1/;
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/usb/dm9601.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,10 @@ static const struct usb_device_id products[] = {
USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */
.driver_info = (unsigned long)&dm9601_info,
},
{
USB_DEVICE(0x0586, 0x3427), /* ZyXEL Keenetic Plus DSL xDSL modem */
.driver_info = (unsigned long)&dm9601_info,
},
{}, // END
};

Expand Down
3 changes: 2 additions & 1 deletion net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6231,12 +6231,13 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
netdev_err_once(dev, "%s() called with weight %d\n", __func__,
weight);
napi->weight = weight;
list_add(&napi->dev_list, &dev->napi_list);
napi->dev = dev;
#ifdef CONFIG_NETPOLL
napi->poll_owner = -1;
#endif
set_bit(NAPI_STATE_SCHED, &napi->state);
set_bit(NAPI_STATE_NPSVC, &napi->state);
list_add_rcu(&napi->dev_list, &dev->napi_list);
napi_hash_add(napi);
}
EXPORT_SYMBOL(netif_napi_add);
Expand Down
2 changes: 1 addition & 1 deletion net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void poll_napi(struct net_device *dev)
struct napi_struct *napi;
int cpu = smp_processor_id();

list_for_each_entry(napi, &dev->napi_list, dev_list) {
list_for_each_entry_rcu(napi, &dev->napi_list, dev_list) {
if (cmpxchg(&napi->poll_owner, -1, cpu) == -1) {
poll_one_napi(napi);
smp_store_release(&napi->poll_owner, -1);
Expand Down
3 changes: 2 additions & 1 deletion net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,8 @@ void fib_info_notify_update(struct net *net, struct nl_info *info)
struct hlist_head *head = &net->ipv4.fib_table_hash[h];
struct fib_table *tb;

hlist_for_each_entry_rcu(tb, head, tb_hlist)
hlist_for_each_entry_rcu(tb, head, tb_hlist,
lockdep_rtnl_is_held())
__fib_info_notify_update(net, tb, info);
}
}
Expand Down
3 changes: 2 additions & 1 deletion net/ipv6/sysctl_net_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <net/calipso.h>
#endif

static int two = 2;
static int flowlabel_reflect_max = 0x7;
static int auto_flowlabels_min;
static int auto_flowlabels_max = IP6_AUTO_FLOW_LABEL_MAX;
Expand Down Expand Up @@ -151,7 +152,7 @@ static struct ctl_table ipv6_table_template[] = {
.mode = 0644,
.proc_handler = proc_rt6_multipath_hash_policy,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
.extra2 = &two,
},
{
.procname = "seg6_flowlabel",
Expand Down
59 changes: 30 additions & 29 deletions net/netlabel/netlabel_domainhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ static void netlbl_domhsh_free_entry(struct rcu_head *entry)
kfree(netlbl_domhsh_addr6_entry(iter6));
}
#endif /* IPv6 */
kfree(ptr->def.addrsel);
}
kfree(ptr->domain);
kfree(ptr);
Expand Down Expand Up @@ -536,6 +537,8 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry,
goto add_return;
}
#endif /* IPv6 */
/* cleanup the new entry since we've moved everything over */
netlbl_domhsh_free_entry(&entry->rcu);
} else
ret_val = -EINVAL;

Expand Down Expand Up @@ -579,6 +582,12 @@ int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry,
{
int ret_val = 0;
struct audit_buffer *audit_buf;
struct netlbl_af4list *iter4;
struct netlbl_domaddr4_map *map4;
#if IS_ENABLED(CONFIG_IPV6)
struct netlbl_af6list *iter6;
struct netlbl_domaddr6_map *map6;
#endif /* IPv6 */

if (entry == NULL)
return -ENOENT;
Expand All @@ -596,6 +605,9 @@ int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry,
ret_val = -ENOENT;
spin_unlock(&netlbl_domhsh_lock);

if (ret_val)
return ret_val;

audit_buf = netlbl_audit_start_common(AUDIT_MAC_MAP_DEL, audit_info);
if (audit_buf != NULL) {
audit_log_format(audit_buf,
Expand All @@ -605,40 +617,29 @@ int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry,
audit_log_end(audit_buf);
}

if (ret_val == 0) {
struct netlbl_af4list *iter4;
struct netlbl_domaddr4_map *map4;
#if IS_ENABLED(CONFIG_IPV6)
struct netlbl_af6list *iter6;
struct netlbl_domaddr6_map *map6;
#endif /* IPv6 */

switch (entry->def.type) {
case NETLBL_NLTYPE_ADDRSELECT:
netlbl_af4list_foreach_rcu(iter4,
&entry->def.addrsel->list4) {
map4 = netlbl_domhsh_addr4_entry(iter4);
cipso_v4_doi_putdef(map4->def.cipso);
}
switch (entry->def.type) {
case NETLBL_NLTYPE_ADDRSELECT:
netlbl_af4list_foreach_rcu(iter4, &entry->def.addrsel->list4) {
map4 = netlbl_domhsh_addr4_entry(iter4);
cipso_v4_doi_putdef(map4->def.cipso);
}
#if IS_ENABLED(CONFIG_IPV6)
netlbl_af6list_foreach_rcu(iter6,
&entry->def.addrsel->list6) {
map6 = netlbl_domhsh_addr6_entry(iter6);
calipso_doi_putdef(map6->def.calipso);
}
netlbl_af6list_foreach_rcu(iter6, &entry->def.addrsel->list6) {
map6 = netlbl_domhsh_addr6_entry(iter6);
calipso_doi_putdef(map6->def.calipso);
}
#endif /* IPv6 */
break;
case NETLBL_NLTYPE_CIPSOV4:
cipso_v4_doi_putdef(entry->def.cipso);
break;
break;
case NETLBL_NLTYPE_CIPSOV4:
cipso_v4_doi_putdef(entry->def.cipso);
break;
#if IS_ENABLED(CONFIG_IPV6)
case NETLBL_NLTYPE_CALIPSO:
calipso_doi_putdef(entry->def.calipso);
break;
case NETLBL_NLTYPE_CALIPSO:
calipso_doi_putdef(entry->def.calipso);
break;
#endif /* IPv6 */
}
call_rcu(&entry->rcu, netlbl_domhsh_free_entry);
}
call_rcu(&entry->rcu, netlbl_domhsh_free_entry);

return ret_val;
}
Expand Down
30 changes: 24 additions & 6 deletions net/sched/sch_taprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,9 +1177,27 @@ static void taprio_offload_config_changed(struct taprio_sched *q)
spin_unlock(&q->current_entry_lock);
}

static void taprio_sched_to_offload(struct taprio_sched *q,
static u32 tc_map_to_queue_mask(struct net_device *dev, u32 tc_mask)
{
u32 i, queue_mask = 0;

for (i = 0; i < dev->num_tc; i++) {
u32 offset, count;

if (!(tc_mask & BIT(i)))
continue;

offset = dev->tc_to_txq[i].offset;
count = dev->tc_to_txq[i].count;

queue_mask |= GENMASK(offset + count - 1, offset);
}

return queue_mask;
}

static void taprio_sched_to_offload(struct net_device *dev,
struct sched_gate_list *sched,
const struct tc_mqprio_qopt *mqprio,
struct tc_taprio_qopt_offload *offload)
{
struct sched_entry *entry;
Expand All @@ -1194,15 +1212,15 @@ static void taprio_sched_to_offload(struct taprio_sched *q,

e->command = entry->command;
e->interval = entry->interval;
e->gate_mask = entry->gate_mask;
e->gate_mask = tc_map_to_queue_mask(dev, entry->gate_mask);

i++;
}

offload->num_entries = i;
}

static int taprio_enable_offload(struct net_device *dev,
struct tc_mqprio_qopt *mqprio,
struct taprio_sched *q,
struct sched_gate_list *sched,
struct netlink_ext_ack *extack)
Expand All @@ -1224,7 +1242,7 @@ static int taprio_enable_offload(struct net_device *dev,
return -ENOMEM;
}
offload->enable = 1;
taprio_sched_to_offload(q, sched, mqprio, offload);
taprio_sched_to_offload(dev, sched, offload);

err = ops->ndo_setup_tc(dev, TC_SETUP_QDISC_TAPRIO, offload);
if (err < 0) {
Expand Down Expand Up @@ -1486,7 +1504,7 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
}

if (FULL_OFFLOAD_IS_ENABLED(q->flags))
err = taprio_enable_offload(dev, mqprio, q, new_admin, extack);
err = taprio_enable_offload(dev, q, new_admin, extack);
else
err = taprio_disable_offload(dev, q, extack);
if (err)
Expand Down
16 changes: 6 additions & 10 deletions net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -8176,8 +8176,6 @@ static int sctp_get_port_local(struct sock *sk, union sctp_addr *addr)

pr_debug("%s: begins, snum:%d\n", __func__, snum);

local_bh_disable();

if (snum == 0) {
/* Search for an available port. */
int low, high, remaining, index;
Expand All @@ -8196,20 +8194,21 @@ static int sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
continue;
index = sctp_phashfn(sock_net(sk), rover);
head = &sctp_port_hashtable[index];
spin_lock(&head->lock);
spin_lock_bh(&head->lock);
sctp_for_each_hentry(pp, &head->chain)
if ((pp->port == rover) &&
net_eq(sock_net(sk), pp->net))
goto next;
break;
next:
spin_unlock(&head->lock);
spin_unlock_bh(&head->lock);
cond_resched();
} while (--remaining > 0);

/* Exhausted local port range during search? */
ret = 1;
if (remaining <= 0)
goto fail;
return ret;

/* OK, here is the one we will use. HEAD (the port
* hash table list entry) is non-NULL and we hold it's
Expand All @@ -8224,7 +8223,7 @@ static int sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
* port iterator, pp being NULL.
*/
head = &sctp_port_hashtable[sctp_phashfn(sock_net(sk), snum)];
spin_lock(&head->lock);
spin_lock_bh(&head->lock);
sctp_for_each_hentry(pp, &head->chain) {
if ((pp->port == snum) && net_eq(pp->net, sock_net(sk)))
goto pp_found;
Expand Down Expand Up @@ -8324,10 +8323,7 @@ static int sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
ret = 0;

fail_unlock:
spin_unlock(&head->lock);

fail:
local_bh_enable();
spin_unlock_bh(&head->lock);
return ret;
}

Expand Down
9 changes: 6 additions & 3 deletions net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2616,18 +2616,21 @@ static int tipc_shutdown(struct socket *sock, int how)

trace_tipc_sk_shutdown(sk, NULL, TIPC_DUMP_ALL, " ");
__tipc_shutdown(sock, TIPC_CONN_SHUTDOWN);
sk->sk_shutdown = SEND_SHUTDOWN;
if (tipc_sk_type_connectionless(sk))
sk->sk_shutdown = SHUTDOWN_MASK;
else
sk->sk_shutdown = SEND_SHUTDOWN;

if (sk->sk_state == TIPC_DISCONNECTING) {
/* Discard any unreceived messages */
__skb_queue_purge(&sk->sk_receive_queue);

/* Wake up anyone sleeping in poll */
sk->sk_state_change(sk);
res = 0;
} else {
res = -ENOTCONN;
}
/* Wake up anyone sleeping in poll. */
sk->sk_state_change(sk);

release_sock(sk);
return res;
Expand Down

0 comments on commit 039adaf

Please sign in to comment.