* [PATCH] restore behaviour of CAP_SYS_ADMIN allowing the loading of net bpf program
From: Maciej Żenczykowski @ 2020-06-18 19:59 UTC (permalink / raw)
To: Maciej Żenczykowski, Alexei Starovoitov, Daniel Borkmann
Cc: Linux Network Development Mailing List, Linux Kernel Mailing List,
BPF Mailing List, David S . Miller
In-Reply-To: <CAHo-OoyU5OHQuqpTEo-uAQcwcLpzkXezFY6Re-Hv6jGM9aSFSA@mail.gmail.com>
From: Maciej Żenczykowski <maze@google.com>
This is a 5.8-rc1 regression.
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF")
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
kernel/bpf/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 8da159936bab..7d946435587d 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2121,7 +2121,7 @@ static int bpf_prog_load(union bpf_attr *attr, union bpf_attr __user *uattr)
!bpf_capable())
return -EPERM;
- if (is_net_admin_prog_type(type) && !capable(CAP_NET_ADMIN))
+ if (is_net_admin_prog_type(type) && !capable(CAP_NET_ADMIN) && !capable(CAP_SYS_ADMIN))
return -EPERM;
if (is_perfmon_prog_type(type) && !perfmon_capable())
return -EPERM;
--
2.27.0.290.gba653c62da-goog
^ permalink raw reply related
* Re: [PATCH v4 02/11] fs: Move __scm_install_fd() to __fd_install_received()
From: Kees Cook @ 2020-06-18 20:05 UTC (permalink / raw)
To: Christian Brauner
Cc: linux-kernel, Sargun Dhillon, Christian Brauner, David S. Miller,
Christoph Hellwig, Tycho Andersen, Jakub Kicinski, Alexander Viro,
Aleksa Sarai, Matt Denton, Jann Horn, Chris Palmer, Robert Sesek,
Giuseppe Scrivano, Greg Kroah-Hartman, Andy Lutomirski,
Will Drewry, Shuah Khan, netdev, containers, linux-api,
linux-fsdevel, linux-kselftest
In-Reply-To: <20200618085614.fw3ynalpcipbplf3@wittgenstein>
On Thu, Jun 18, 2020 at 10:56:14AM +0200, Christian Brauner wrote:
> On Mon, Jun 15, 2020 at 08:25:15PM -0700, Kees Cook wrote:
> > In preparation for users of the "install a received file" logic outside
> > of net/ (pidfd and seccomp), relocate and rename __scm_install_fd() from
> > net/core/scm.c to __fd_install_received() in fs/file.c, and provide a
> > wrapper named fd_install_received_user(), as future patches will change
> > the interface to __fd_install_received().
> >
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> > fs/file.c | 47 ++++++++++++++++++++++++++++++++++++++++++++
> > include/linux/file.h | 8 ++++++++
> > include/net/scm.h | 1 -
> > net/compat.c | 2 +-
> > net/core/scm.c | 32 +-----------------------------
> > 5 files changed, 57 insertions(+), 33 deletions(-)
> >
> > diff --git a/fs/file.c b/fs/file.c
> > index abb8b7081d7a..fcfddae0d252 100644
> > --- a/fs/file.c
> > +++ b/fs/file.c
> > @@ -11,6 +11,7 @@
> > #include <linux/export.h>
> > #include <linux/fs.h>
> > #include <linux/mm.h>
> > +#include <linux/net.h>
> > #include <linux/sched/signal.h>
> > #include <linux/slab.h>
> > #include <linux/file.h>
> > @@ -18,6 +19,8 @@
> > #include <linux/bitops.h>
> > #include <linux/spinlock.h>
> > #include <linux/rcupdate.h>
> > +#include <net/cls_cgroup.h>
> > +#include <net/netprio_cgroup.h>
> >
> > unsigned int sysctl_nr_open __read_mostly = 1024*1024;
> > unsigned int sysctl_nr_open_min = BITS_PER_LONG;
> > @@ -931,6 +934,50 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags)
> > return err;
> > }
> >
> > +/**
> > + * __fd_install_received() - Install received file into file descriptor table
> > + *
> > + * @fd: fd to install into (if negative, a new fd will be allocated)
> > + * @file: struct file that was received from another process
> > + * @ufd_required: true to use @ufd for writing fd number to userspace
> > + * @ufd: __user pointer to write new fd number to
> > + * @o_flags: the O_* flags to apply to the new fd entry
> > + *
> > + * Installs a received file into the file descriptor table, with appropriate
> > + * checks and count updates. Optionally writes the fd number to userspace.
> > + *
> > + * Returns -ve on error.
> > + */
> > +int __fd_install_received(struct file *file, int __user *ufd, unsigned int o_flags)
> > +{
> > + struct socket *sock;
> > + int new_fd;
> > + int error;
> > +
> > + error = security_file_receive(file);
> > + if (error)
> > + return error;
> > +
> > + new_fd = get_unused_fd_flags(o_flags);
> > + if (new_fd < 0)
> > + return new_fd;
> > +
> > + error = put_user(new_fd, ufd);
> > + if (error) {
> > + put_unused_fd(new_fd);
> > + return error;
> > + }
> > +
> > + /* Bump the usage count and install the file. */
> > + sock = sock_from_file(file, &error);
> > + if (sock) {
> > + sock_update_netprioidx(&sock->sk->sk_cgrp_data);
> > + sock_update_classid(&sock->sk->sk_cgrp_data);
> > + }
> > + fd_install(new_fd, get_file(file));
> > + return 0;
> > +}
> > +
> > static int ksys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
> > {
> > int err = -EBADF;
> > diff --git a/include/linux/file.h b/include/linux/file.h
> > index 122f80084a3e..fe18a1a0d555 100644
> > --- a/include/linux/file.h
> > +++ b/include/linux/file.h
> > @@ -91,6 +91,14 @@ extern void put_unused_fd(unsigned int fd);
> >
> > extern void fd_install(unsigned int fd, struct file *file);
> >
> > +extern int __fd_install_received(struct file *file, int __user *ufd,
> > + unsigned int o_flags);
> > +static inline int fd_install_received_user(struct file *file, int __user *ufd,
> > + unsigned int o_flags)
> > +{
> > + return __fd_install_received(file, ufd, o_flags);
> > +}
>
> Shouldn't this be the other way around such that
> fd_install_received_user() is the workhorse that has a "ufd" argument
> and fd_install_received() is the static inline function that doesn't?
>
> extern int fd_install_received_user(struct file *file, int __user *ufd, unsigned int o_flags)
> static inline int fd_install_received(struct file *file, unsigned int o_flags)
> {
> return fd_install_received_user(file, NULL, o_flags);
> }
So, I think it's all worked out in v5[1], so the helper argument handling
is better for the ufd case, as David pointed out earlier. (As in,
I think you're reacting to the same general problem here.)
> (So I'm on vacation this week some my reviews are selective and spotty
> but I promise to be back next week. :))
No worries!
-Kees
[1] https://lore.kernel.org/lkml/20200617220327.3731559-1-keescook@chromium.org/
--
Kees Cook
^ permalink raw reply
* Re: [Patch net] net: change addr_list_lock back to static key
From: Cong Wang @ 2020-06-18 20:06 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, syzbot+f3a0e80c34b3fc28ac5e, Taehee Yoo, Dmitry Vyukov
In-Reply-To: <CAM_iQpW-5WpaSvSmJgoqEbcjtrjvaZY3ngKzVy2S-v81MdK4iQ@mail.gmail.com>
On Thu, Jun 18, 2020 at 12:56 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
>
> On Thu, Jun 18, 2020 at 12:40 PM Vladimir Oltean <olteanv@gmail.com> wrote:
> >
> > It's me with the stacked DSA devices again:
>
> It looks like DSA never uses netdev API to link master
> device with slave devices? If so, their dev->lower_level
> are always 1, therefore triggers this warning.
>
> I think it should call one of these netdev_upper_dev_link()
> API's when creating a slave device.
>
I don't know whether DSA is too special to use the API, but
something like this should work:
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 4c7f086a047b..f7a2a281e7f0 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1807,6 +1807,11 @@ int dsa_slave_create(struct dsa_port *port)
ret, slave_dev->name);
goto out_phy;
}
+ ret = netdev_upper_dev_link(slave_dev, master, NULL);
+ if (ret) {
+ unregister_netdevice(slave_dev);
+ goto out_phy;
+ }
return 0;
@@ -1832,6 +1837,7 @@ void dsa_slave_destroy(struct net_device *slave_dev)
netif_carrier_off(slave_dev);
rtnl_lock();
phylink_disconnect_phy(dp->pl);
+ netdev_upper_dev_unlink(slave_dev, dp->master);
rtnl_unlock();
dsa_slave_notify(slave_dev, DSA_PORT_UNREGISTER);
^ permalink raw reply related
* Re: [PATCH v5 3/7] fs: Add fd_install_received() wrapper for __fd_install_received()
From: Kees Cook @ 2020-06-18 20:13 UTC (permalink / raw)
To: Sargun Dhillon
Cc: linux-kernel, Christian Brauner, Tycho Andersen, David Laight,
Christoph Hellwig, David S. Miller, Jakub Kicinski,
Alexander Viro, Aleksa Sarai, Matt Denton, Jann Horn,
Chris Palmer, Robert Sesek, Giuseppe Scrivano, Greg Kroah-Hartman,
Andy Lutomirski, Will Drewry, Shuah Khan, netdev, containers,
linux-api, linux-fsdevel, linux-kselftest
In-Reply-To: <20200618054918.GB18669@ircssh-2.c.rugged-nimbus-611.internal>
On Thu, Jun 18, 2020 at 05:49:19AM +0000, Sargun Dhillon wrote:
> On Wed, Jun 17, 2020 at 03:03:23PM -0700, Kees Cook wrote:
> > [...]
> > static inline int fd_install_received_user(struct file *file, int __user *ufd,
> > unsigned int o_flags)
> > {
> > + if (ufd == NULL)
> > + return -EFAULT;
> Isn't this *technically* a behvaiour change? Nonetheless, I think this is a much better
> approach than forcing everyone to do null checking, and avoids at least one error case
> where the kernel installs FDs for SCM_RIGHTS, and they're not actualy usable.
So, the only behavior change I see is that the order of sanity checks is
changed.
The loop in scm_detach_fds() is:
for (i = 0; i < fdmax; i++) {
err = __scm_install_fd(scm->fp->fp[i], cmsg_data + i, o_flags);
if (err < 0)
break;
}
Before, __scm_install_fd() does:
error = security_file_receive(file);
if (error)
return error;
new_fd = get_unused_fd_flags(o_flags);
if (new_fd < 0)
return new_fd;
error = put_user(new_fd, ufd);
if (error) {
put_unused_fd(new_fd);
return error;
}
...
After, fd_install_received_user() and __fd_install_received() does:
if (ufd == NULL)
return -EFAULT;
...
error = security_file_receive(file);
if (error)
return error;
...
new_fd = get_unused_fd_flags(o_flags);
if (new_fd < 0)
return new_fd;
...
error = put_user(new_fd, ufd);
if (error) {
put_unused_fd(new_fd);
return error;
}
i.e. if a caller attempts a receive that is rejected by LSM *and*
includes a NULL userpointer destination, they will get an EFAULT now
instead of an EPERM.
I struggle to imagine a situation where this could possible matter
(both fail, neither installs files). It is only the error code that
is different. I am comfortable making this change and seeing if anyone
screams. If they do, I can restore the v4 "ufd_required" way of doing it.
> Reviewed-by: Sargun Dhillon <sargun@sargun.me>
Thanks!
--
Kees Cook
^ permalink raw reply
* Re: [RFC PATCH 06/21] mlx5: add header_split flag
From: Michal Kubecek @ 2020-06-18 20:25 UTC (permalink / raw)
To: Eric Dumazet
Cc: Jonathan Lemon, netdev, kernel-team, axboe,
Govindarajulu Varadarajan
In-Reply-To: <4b0e0916-2910-373c-82cf-d912a82502a4@gmail.com>
On Thu, Jun 18, 2020 at 11:12:57AM -0700, Eric Dumazet wrote:
> On 6/18/20 9:09 AM, Jonathan Lemon wrote:
> > Adds a "rx_hd_split" private flag parameter to ethtool.
> >
> > This enables header splitting, and sets up the fragment mappings.
> > The feature is currently only enabled for netgpu channels.
>
> We are using a similar idea (pseudo header split) to implement 4096+(headers) MTU at Google,
> to enable TCP RX zerocopy on x86.
>
> Patch for mlx4 has not been sent upstream yet.
>
> For mlx4, we are using a single buffer of 128*(number_of_slots_per_RX_RING),
> and 86 bytes for the first frag, so that the payload exactly fits a 4096 bytes page.
>
> (In our case, most of our data TCP packets only have 12 bytes of TCP options)
>
> I suggest that instead of a flag, you use a tunable, that can be set by ethtool,
> so that the exact number of bytes can be tuned, instead of hard coded in the driver.
I fully agree that such generic parameter would be a better solution
than a private flag. But I have my doubts about adding more tunables.
The point is that the concept of tunables looks like a workaround for
the lack of extensibility of the ioctl interface where the space for
adding new parameters to existing subcommands was limited (or none).
With netlink, adding new parameters is much easier and as only three
tunables were added in 6 years (or four with your proposal), we don't
have to worry about having too many different attributes (current code
isn't even designed to scale well to many tunables).
This new header split parameter could IMHO be naturally put together
with rx-copybreak and tx-copybreak and possibly any future parameters
to control how packet contents is passed between NIC/driver and
networking stack.
> (Patch for the counter part of [1] was resent 10 days ago on netdev@ by Govindarajulu Varadarajan)
> (Not sure if this has been merged yet)
Not yet, I want to take another look in the rest of this week.
Michal
> [1]
>
> commit f0db9b073415848709dd59a6394969882f517da9
> Author: Govindarajulu Varadarajan <_govind@gmx.com>
> Date: Wed Sep 3 03:17:20 2014 +0530
>
> ethtool: Add generic options for tunables
>
> This patch adds new ethtool cmd, ETHTOOL_GTUNABLE & ETHTOOL_STUNABLE for getting
> tunable values from driver.
>
> Add get_tunable and set_tunable to ethtool_ops. Driver implements these
> functions for getting/setting tunable value.
>
> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [Patch net] net: change addr_list_lock back to static key
From: Vladimir Oltean @ 2020-06-18 20:33 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, syzbot+f3a0e80c34b3fc28ac5e, Taehee Yoo, Dmitry Vyukov
In-Reply-To: <CAM_iQpUBuk1D4JYZtPQ_yodkLJwAyExvGG5vSOazed2QN7NESw@mail.gmail.com>
On Thu, 18 Jun 2020 at 23:06, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>
> On Thu, Jun 18, 2020 at 12:56 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
> >
> > On Thu, Jun 18, 2020 at 12:40 PM Vladimir Oltean <olteanv@gmail.com> wrote:
> > >
> > > It's me with the stacked DSA devices again:
> >
> > It looks like DSA never uses netdev API to link master
> > device with slave devices? If so, their dev->lower_level
> > are always 1, therefore triggers this warning.
> >
> > I think it should call one of these netdev_upper_dev_link()
> > API's when creating a slave device.
> >
>
> I don't know whether DSA is too special to use the API, but
> something like this should work:
>
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 4c7f086a047b..f7a2a281e7f0 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -1807,6 +1807,11 @@ int dsa_slave_create(struct dsa_port *port)
> ret, slave_dev->name);
> goto out_phy;
> }
> + ret = netdev_upper_dev_link(slave_dev, master, NULL);
> + if (ret) {
> + unregister_netdevice(slave_dev);
> + goto out_phy;
> + }
>
> return 0;
>
> @@ -1832,6 +1837,7 @@ void dsa_slave_destroy(struct net_device *slave_dev)
> netif_carrier_off(slave_dev);
> rtnl_lock();
> phylink_disconnect_phy(dp->pl);
> + netdev_upper_dev_unlink(slave_dev, dp->master);
> rtnl_unlock();
>
> dsa_slave_notify(slave_dev, DSA_PORT_UNREGISTER);
Thanks. This is a good approximation of what needed to be done:
- netdev_upper_dev_link needs to be under rtnl,
- "dp->master" should be "dsa_slave_to_master(slave_dev)" since it's
actually a union if you look at struct dsa_port).
- And, most importantly, I think the hierarchy should be reversed: a
(virtual) DSA switch port net device (slave) should be an upper of the
(real) DSA master (the host port). Think of it like this: a DSA switch
is a sort of port multiplier for a host port, based on a frame header.
But, it works!
Do you mind if I submit your modified patch to "net"? What would be an
adequate Fixes: tag?
Cheers,
-Vladimir
^ permalink raw reply
* [PATCH] [net/sched]: Remove redundant condition in qdisc_graft
From: Gaurav Singh @ 2020-06-18 20:36 UTC (permalink / raw)
To: gaurav1086, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
David S. Miller, Jakub Kicinski, open list:TC subsystem,
open list
In-Reply-To: <20200618040056.30792-1-gaurav1086@gmail.com>
parent cannot be NULL here since its in the else part
of the if (parent == NULL) condition. Remove the extra
check on parent pointer.
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
---
net/sched/sch_api.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 9a3449b56bd6..11ebba60da3b 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1093,8 +1093,7 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
int err;
/* Only support running class lockless if parent is lockless */
- if (new && (new->flags & TCQ_F_NOLOCK) &&
- parent && !(parent->flags & TCQ_F_NOLOCK))
+ if (new && (new->flags & TCQ_F_NOLOCK) && !(parent->flags & TCQ_F_NOLOCK))
qdisc_clear_nolock(new);
if (!cops || !cops->graft)
--
2.17.1
^ permalink raw reply related
* RE: [PATCH 02/11] bpf: Compile btfid tool at kernel compilation start
From: John Fastabend @ 2020-06-18 20:40 UTC (permalink / raw)
To: Jiri Olsa, Alexei Starovoitov, Daniel Borkmann
Cc: netdev, bpf, Song Liu, Yonghong Song, Martin KaFai Lau,
David Miller, John Fastabend, Wenbo Zhang, KP Singh,
Andrii Nakryiko, Brendan Gregg, Florent Revest, Al Viro
In-Reply-To: <20200616100512.2168860-3-jolsa@kernel.org>
Jiri Olsa wrote:
> The btfid tool will be used during the vmlinux linking,
> so it's necessary it's ready for it.
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
> Makefile | 22 ++++++++++++++++++----
> tools/Makefile | 3 +++
> tools/bpf/Makefile | 5 ++++-
> 3 files changed, 25 insertions(+), 5 deletions(-)
This breaks the build for me. I fixed it with this but then I get warnings,
diff --git a/tools/bpf/btfid/btfid.c b/tools/bpf/btfid/btfid.c
index 7cdf39bfb150..3697e8ae9efa 100644
--- a/tools/bpf/btfid/btfid.c
+++ b/tools/bpf/btfid/btfid.c
@@ -48,7 +48,7 @@
#include <errno.h>
#include <linux/rbtree.h>
#include <linux/zalloc.h>
-#include <btf.h>
+#include <linux/btf.h>
#include <libbpf.h>
#include <parse-options.h>
Here is the error. Is it something about my setup? bpftool/btf.c uses
<btf.h>. Because this in top-level Makefile we probably don't want to
push extra setup onto folks.
In file included from btfid.c:51:
/home/john/git/bpf-next/tools/lib/bpf/btf.h: In function ‘btf_is_var’:
/home/john/git/bpf-next/tools/lib/bpf/btf.h:254:24: error: ‘BTF_KIND_VAR’ undeclared (first use in this function); did you mean ‘BTF_KIND_PTR’?
return btf_kind(t) == BTF_KIND_VAR;
^~~~~~~~~~~~
BTF_KIND_PTR
/home/john/git/bpf-next/tools/lib/bpf/btf.h:254:24: note: each undeclared identifier is reported only once for each function it appears in
/home/john/git/bpf-next/tools/lib/bpf/btf.h: In function ‘btf_is_datasec’:
/home/john/git/bpf-next/tools/lib/bpf/btf.h:259:24: error: ‘BTF_KIND_DATASEC’ undeclared (first use in this function); did you mean ‘BTF_KIND_PTR’?
return btf_kind(t) == BTF_KIND_DATASEC;
^~~~~~~~~~~~~~~~
BTF_KIND_PTR
mv: cannot stat '/home/john/git/bpf-next/tools/bpf/btfid/.btfid.o.tmp': No such file or directory
make[3]: *** [/home/john/git/bpf-next/tools/build/Makefile.build:97: /home/john/git/bpf-next/tools/bpf/btfid/btfid.o] Error 1
make[2]: *** [Makefile:59: /home/john/git/bpf-next/tools/bpf/btfid/btfid-in.o] Error 2
make[1]: *** [Makefile:71: bpf/btfid] Error 2
make: *** [Makefile:1894: tools/bpf/btfid] Error 2
^ permalink raw reply related
* Re: qmi_wwan not using netif_carrier_*()
From: Dan Williams @ 2020-06-18 20:49 UTC (permalink / raw)
To: Tanjeff-Nicolai Moos, Andrew Lunn; +Cc: netdev
In-Reply-To: <20200618120826.3d271e67@pm-tm-ubuntu>
On Thu, 2020-06-18 at 12:08 +0200, Tanjeff-Nicolai Moos wrote:
>
> On Wed, 17 Jun 2020 19:24:34 +0200
> Andrew Lunn <andrew@lunn.ch> wrote:
>
> > On Wed, Jun 17, 2020 at 11:59:33AM -0500, Dan Williams wrote:
> > > On Wed, 2020-06-17 at 18:48 +0200, Andrew Lunn wrote:
> > > > On Wed, Jun 17, 2020 at 03:21:53PM +0200, Tanjeff-Nicolai Moos
> > > > wrote:
> > > > > Hi netdevs,
> > > > >
> > > > > Kernel version:
> > > > >
> > > > > I'm working with kernel 4.14.137 (OpenWRT project). But I
> > > > > looked
> > > > > at
> > > > > the source of kernel 5.7 and found the same situation.
> > > > >
> > > > > Problem:
> > > > >
> > > > > I'm using the qmi_wwan driver for a Sierra Wireless EM7455
> > > > > LTE
> > > > > modem. This driver does not use
> > > > > netif_carrier_on()/netif_carrier_off() to update its link
> > > > > status.
> > > > > This confuses ledtrig_netdev which uses netif_carrier_ok()
> > > > > to
> > > > > obtain
> > > > > the link status.
> > > > >
> > > > > My solution:
> > > > >
> > > > > As a solution (or workaround?) I would try:
> > > > >
> > > > > 1) In drivers/net/usb/qmi_wwan.c, lines 904/913: Add the
> > > > > flag
> > > > > FLAG_LINK_INTR.
> > > > >
> > > > > 2) In drivers/net/usb/usbnet.c, functions usbnet_open() and
> > > > > usbnet_stop(): Add a call to netif_carrier_*(),
> > > > > but only if FLAG_LINK_INTR is set.
> > > > >
> > > > > Question:
> > > > >
> > > > > Is this the intended way to use FLAG_LINK_INTR and
> > > > > netif_carrier_*()?
> > > > > Or is there another recommended way to obtain the link
> > > > > status of
> > > > > network devices (I could change ledtrig_netdev)?
> > > >
> > > > Hi Tanjeff
> > > >
> > > > With Ethernet, having a carrier means there is a link partner,
> > > > the
> > > > layer 2 of the OSI 7 layer stack model is working. If the
> > > > interface
> > > > is
> > > > not open()ed, it clearly should not have carrier. However, just
> > > > because it is open, does not mean it has carrier. The cable
> > > > could be
> > > > unplugged, etc.
> > > >
> > > > This is an LTE modem. What does carrier mean here? I don't know
> > > > if it
> > > > is well defined, but i would guess it is connected to a base
> > > > station
> > > > which is offering service. I'm assuming you are interested in
> > > > data
> > > > here, not wanting to make a 911/999/112/$EMERGENCY_SERVICE call
> > > > which
> > > > in theory all base stations should accept.
> > > >
> > > > Is there a way to get this state information from the hardware?
> > > > That
> > > > would be the correct way to set the carrier.
> > >
> > > There isn't. All the setup that would result in IFF_LOWER_UP (eg
> > > ability to pass packets to the cellular network) happens over
> > > channels
> > > *other* than the ethernet one. eg CDC-WDM, CDC-ACM, CDC-MBIM, AT
> > > commands, QMI commands, MBIM commands, etc.
> > >
> > > Something in userspace handles the actual IP-level connection
> > > setup and
> > > once that's done, only then do you really have IFF_LOWER_UP. One
> > > way to
> > > solve this could be to require userspace connection managers to
> > > manage
> > > the carrier state of the device, which is possible for some
> > > drivers
> > > already IIRC.
> >
> > So Tanjeff, what is you real use case here? I assume you want to
> > control an LED so it is on when the LTE modem is connected? Could
> > you
> > export the LED to user space and have a dhclient-enter/exit script
> > change
> > the state of the LED?
> The LED should show whether the link is up (data transfer is
> possible),
> and it should blink when data is being transferred. This
> functionality
> is provided by the ledtrig_netdev driver. The blinking works already,
> but the indicated link state is wrong, because the netif_carrier_ok()
> function /always/ reports true.
>
> When I control the LED by userspace software, it would probably not
> blink during xfer. Therefore I would prefer to stick with
> ledtrig_netdev (also, it will give me the same behavior as for WLAN,
> where I also use ledtrig_netdev).
>
> I observed that sierra.c does call netif_carrier_off(). Since I'm
> using
> a Sierra modem, maybe I'm actually using this driver (sorry for my
> limited knowledge), and things should already work? Then I would have
> some misconfiguration...
The Sierra driver is only for their very old (2000s and early 2010s)
devices that use DirectIP mode. It's very unlikely you're using it.
I don't think you're going to get qmi_wwan to set the carrier state
like you expect. That would require qmi_wwan to snoop on the QMI
control messages passed back and forth from the modem to userspace, and
have some knowledge of the data sessions. That's not something qmi_wwan
should be doing.
Instead, you can have a script that looks for an IP address assigned to
the interface and if so, check its packet counters and if they change,
blink the LED. Doesn't need to be done from kernel space.
Dan
> I also observed that "ip address" shows the flags "UP" and "LOWER_UP"
> when the interface is up. The kernel seems to know whether "the link"
> is up, although I don't know which link is considered. Maybe it is
> possible to get that knowledge from within qmi_wwan or usbnet and to
> set the carrier accordingly.
>
> Kind regards, tanjeff
>
>
> --
>
> Tanjeff-Nicolai Moos
> Dipl.-Inf. (FH)
> Senior Software Engineer
>
> ELTEC Elektronik AG, Mainz
> _________________________
>
> Fon +49 6131 918 342
> Fax +49 6131 918 195
> Email tmoos@eltec.de
> Web www.eltec.de
>
> ________________________________
>
>
> *********************************************************
> ELTEC Elektronik AG
> Galileo-Galilei-Straße 11
> D-55129 Mainz
>
> Vorstand: Peter Albert
> Aufsichtsratsvorsitzender: Andreas Kochhäuser
>
> Registergericht: Amtsgericht Mainz
> Registernummer: HRB 7038
> Ust-ID: DE 149 049 790
> *********************************************************
> Wichtiger Hinweis:
> Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige
> vertrauliche Informationen enthalten. Sollten Sie diese E-Mail
> irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts,
> eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich
> untersagt.
> Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-
> Mail. Evtl. Anhänge dieser Nachricht wurden auf Viren überprüft!
> Jede Form von Vervielfältigung, Abänderung, Verbreitung oder
> Veröffentlichung dieser E-Mail Nachricht ist untersagt! Das Verwenden
> von Informationen aus dieser Nachricht für irgendwelche Zwecke ist
> strengstens untersagt.
> Es gelten unsere Allgemeinen Geschäftsbedingungen, zu finden unter
> www.eltec.de.
>
^ permalink raw reply
* Re: [PATCH net] ibmveth: Fix max MTU limit
From: Thomas Falcon @ 2020-06-18 20:51 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: netdev, linuxppc-dev
In-Reply-To: <20200618085722.110f3702@kicinski-fedora-PC1C0HJN>
On 6/18/20 10:57 AM, Jakub Kicinski wrote:
> On Thu, 18 Jun 2020 10:43:46 -0500 Thomas Falcon wrote:
>> The max MTU limit defined for ibmveth is not accounting for
>> virtual ethernet buffer overhead, which is twenty-two additional
>> bytes set aside for the ethernet header and eight additional bytes
>> of an opaque handle reserved for use by the hypervisor. Update the
>> max MTU to reflect this overhead.
>>
>> Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
> How about
>
> Fixes: d894be57ca92 ("ethernet: use net core MTU range checking in more drivers")
> Fixes: 110447f8269a ("ethernet: fix min/max MTU typos")
>
> ?
Thanks, do you need me to send a v2 with those tags?
Tom
^ permalink raw reply
* INFO: trying to register non-static key in ath9k_htc_rxep
From: syzbot @ 2020-06-18 20:57 UTC (permalink / raw)
To: andreyknvl, ath9k-devel, davem, kuba, kvalo, linux-kernel,
linux-usb, linux-wireless, netdev, syzkaller-bugs
Hello,
syzbot found the following crash on:
HEAD commit: b791d1bd Merge tag 'locking-kcsan-2020-06-11' of git://git..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
console output: https://syzkaller.appspot.com/x/log.txt?x=1522cc25100000
kernel config: https://syzkaller.appspot.com/x/.config?x=16c2467d4b6dbee2
dashboard link: https://syzkaller.appspot.com/bug?extid=4d2d56175b934b9a7bf9
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
Unfortunately, I don't have any reproducer for this crash yet.
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+4d2d56175b934b9a7bf9@syzkaller.appspotmail.com
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 0 PID: 355 Comm: syz-executor.2 Not tainted 5.7.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0xf6/0x16e lib/dump_stack.c:118
assign_lock_key kernel/locking/lockdep.c:894 [inline]
register_lock_class+0x1442/0x17e0 kernel/locking/lockdep.c:1206
__lock_acquire+0x101/0x6270 kernel/locking/lockdep.c:4259
lock_acquire+0x18b/0x7c0 kernel/locking/lockdep.c:4959
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x32/0x50 kernel/locking/spinlock.c:159
ath9k_htc_rxep+0x31/0x210 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c:1128
ath9k_htc_rx_msg+0x2d9/0xb00 drivers/net/wireless/ath/ath9k/htc_hst.c:459
ath9k_hif_usb_rx_stream drivers/net/wireless/ath/ath9k/hif_usb.c:638 [inline]
ath9k_hif_usb_rx_cb+0xc76/0x1050 drivers/net/wireless/ath/ath9k/hif_usb.c:671
__usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
dummy_timer+0x125e/0x32b4 drivers/usb/gadget/udc/dummy_hcd.c:1967
call_timer_fn+0x1ac/0x6e0 kernel/time/timer.c:1404
expire_timers kernel/time/timer.c:1449 [inline]
__run_timers kernel/time/timer.c:1773 [inline]
__run_timers kernel/time/timer.c:1740 [inline]
run_timer_softirq+0x5e5/0x14c0 kernel/time/timer.c:1786
__do_softirq+0x21e/0x996 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x178/0x1a0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:546 [inline]
smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1107
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
</IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline]
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x3b/0x40 kernel/locking/spinlock.c:191
Code: e8 1a 69 8d fb 48 89 ef e8 42 5d 8e fb f6 c7 02 75 11 53 9d e8 26 e6 ab fb 65 ff 0d 57 e4 68 7a 5b 5d c3 e8 e7 de ab fb 53 9d <eb> ed 0f 1f 00 55 48 89 fd 65 ff 05 3d e4 68 7a 45 31 c9 41 b8 01
RSP: 0018:ffff8881ae06fba0 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000000 RBX: 0000000000000246 RCX: 1ffffffff0fd4d4a
RDX: 1ffff11039bbe747 RSI: 0000000000000000 RDI: ffff8881cddf3a38
RBP: ffff8881db228400 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffff8881db228480 R14: ffff8881ae06fdf8 R15: ffff8881db228400
unlock_hrtimer_base kernel/time/hrtimer.c:898 [inline]
hrtimer_start_range_ns+0x5cd/0xb50 kernel/time/hrtimer.c:1136
hrtimer_start_expires include/linux/hrtimer.h:435 [inline]
hrtimer_sleeper_start_expires kernel/time/hrtimer.c:1800 [inline]
do_nanosleep+0x1b9/0x650 kernel/time/hrtimer.c:1876
hrtimer_nanosleep+0x1df/0x3a0 kernel/time/hrtimer.c:1932
__do_sys_nanosleep kernel/time/hrtimer.c:1966 [inline]
__se_sys_nanosleep kernel/time/hrtimer.c:1953 [inline]
__x64_sys_nanosleep+0x1dc/0x260 kernel/time/hrtimer.c:1953
do_syscall_64+0xb6/0x5a0 arch/x86/entry/common.c:295
entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x45af70
Code: Bad RIP value.
RSP: 002b:00007fff27bba8e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000023
RAX: ffffffffffffffda RBX: 000000000009722e RCX: 000000000045af70
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007fff27bba8f0
RBP: 00000000000001de R08: 0000000000000001 R09: 0000000001410940
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff27bba940 R14: 000000000009722e R15: 00007fff27bba950
BUG: unable to handle page fault for address: ffffffffffffffc8
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 7026067 P4D 7026067 PUD 7028067 PMD 0
Oops: 0000 [#1] SMP KASAN
CPU: 0 PID: 355 Comm: syz-executor.2 Not tainted 5.7.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:ath9k_htc_rxep+0xb5/0x210 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c:1130
Code: 8b 43 38 48 8d 58 c8 49 39 c4 0f 84 ee 00 00 00 e8 90 fd 61 fe 48 89 d8 48 c1 e8 03 0f b6 04 28 84 c0 74 06 0f 8e 0a 01 00 00 <44> 0f b6 3b 31 ff 44 89 fe e8 cd fe 61 fe 45 84 ff 75 a8 e8 63 fd
RSP: 0018:ffff8881db209870 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffffffffffffffc8 RCX: ffffc900004a7000
RDX: 0000000000040000 RSI: ffffffff82ddb320 RDI: ffff8881db2097e0
RBP: dffffc0000000000 R08: 0000000000000004 R09: ffffed103b6412fd
R10: 0000000000000003 R11: ffffed103b6412fc R12: ffff8881ac34b4d8
R13: ffff8881ac34b0a0 R14: ffff8881ac34b4e8 R15: ffffed10392efc10
FS: 0000000001410940(0000) GS:ffff8881db200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffc8 CR3: 00000001ae02b000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<IRQ>
ath9k_htc_rx_msg+0x2d9/0xb00 drivers/net/wireless/ath/ath9k/htc_hst.c:459
ath9k_hif_usb_rx_stream drivers/net/wireless/ath/ath9k/hif_usb.c:638 [inline]
ath9k_hif_usb_rx_cb+0xc76/0x1050 drivers/net/wireless/ath/ath9k/hif_usb.c:671
__usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650
usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716
dummy_timer+0x125e/0x32b4 drivers/usb/gadget/udc/dummy_hcd.c:1967
call_timer_fn+0x1ac/0x6e0 kernel/time/timer.c:1404
expire_timers kernel/time/timer.c:1449 [inline]
__run_timers kernel/time/timer.c:1773 [inline]
__run_timers kernel/time/timer.c:1740 [inline]
run_timer_softirq+0x5e5/0x14c0 kernel/time/timer.c:1786
__do_softirq+0x21e/0x996 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x178/0x1a0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:546 [inline]
smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1107
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
</IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline]
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x3b/0x40 kernel/locking/spinlock.c:191
Code: e8 1a 69 8d fb 48 89 ef e8 42 5d 8e fb f6 c7 02 75 11 53 9d e8 26 e6 ab fb 65 ff 0d 57 e4 68 7a 5b 5d c3 e8 e7 de ab fb 53 9d <eb> ed 0f 1f 00 55 48 89 fd 65 ff 05 3d e4 68 7a 45 31 c9 41 b8 01
RSP: 0018:ffff8881ae06fba0 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000000 RBX: 0000000000000246 RCX: 1ffffffff0fd4d4a
RDX: 1ffff11039bbe747 RSI: 0000000000000000 RDI: ffff8881cddf3a38
RBP: ffff8881db228400 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffff8881db228480 R14: ffff8881ae06fdf8 R15: ffff8881db228400
unlock_hrtimer_base kernel/time/hrtimer.c:898 [inline]
hrtimer_start_range_ns+0x5cd/0xb50 kernel/time/hrtimer.c:1136
hrtimer_start_expires include/linux/hrtimer.h:435 [inline]
hrtimer_sleeper_start_expires kernel/time/hrtimer.c:1800 [inline]
do_nanosleep+0x1b9/0x650 kernel/time/hrtimer.c:1876
hrtimer_nanosleep+0x1df/0x3a0 kernel/time/hrtimer.c:1932
__do_sys_nanosleep kernel/time/hrtimer.c:1966 [inline]
__se_sys_nanosleep kernel/time/hrtimer.c:1953 [inline]
__x64_sys_nanosleep+0x1dc/0x260 kernel/time/hrtimer.c:1953
do_syscall_64+0xb6/0x5a0 arch/x86/entry/common.c:295
entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x45af70
Code: Bad RIP value.
RSP: 002b:00007fff27bba8e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000023
RAX: ffffffffffffffda RBX: 000000000009722e RCX: 000000000045af70
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007fff27bba8f0
RBP: 00000000000001de R08: 0000000000000001 R09: 0000000001410940
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff27bba940 R14: 000000000009722e R15: 00007fff27bba950
Modules linked in:
CR2: ffffffffffffffc8
---[ end trace 4488f3a2c836a427 ]---
RIP: 0010:ath9k_htc_rxep+0xb5/0x210 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c:1130
Code: 8b 43 38 48 8d 58 c8 49 39 c4 0f 84 ee 00 00 00 e8 90 fd 61 fe 48 89 d8 48 c1 e8 03 0f b6 04 28 84 c0 74 06 0f 8e 0a 01 00 00 <44> 0f b6 3b 31 ff 44 89 fe e8 cd fe 61 fe 45 84 ff 75 a8 e8 63 fd
RSP: 0018:ffff8881db209870 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffffffffffffffc8 RCX: ffffc900004a7000
RDX: 0000000000040000 RSI: ffffffff82ddb320 RDI: ffff8881db2097e0
RBP: dffffc0000000000 R08: 0000000000000004 R09: ffffed103b6412fd
R10: 0000000000000003 R11: ffffed103b6412fc R12: ffff8881ac34b4d8
R13: ffff8881ac34b0a0 R14: ffff8881ac34b4e8 R15: ffffed10392efc10
FS: 0000000001410940(0000) GS:ffff8881db200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffc8 CR3: 00000001ae02b000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
^ permalink raw reply
* RE: [PATCHv3 0/9] bpf: Add d_path helper
From: John Fastabend @ 2020-06-18 20:57 UTC (permalink / raw)
To: Jiri Olsa, Alexei Starovoitov, Daniel Borkmann
Cc: netdev, bpf, Song Liu, Yonghong Song, Martin KaFai Lau,
David Miller, John Fastabend, Wenbo Zhang, KP Singh,
Andrii Nakryiko, Brendan Gregg, Florent Revest, Al Viro
In-Reply-To: <20200616100512.2168860-1-jolsa@kernel.org>
Jiri Olsa wrote:
> hi,
> adding d_path helper to return full path for 'path' object.
>
> I originally added and used 'file_path' helper, which did the same,
> but used 'struct file' object. Then realized that file_path is just
> a wrapper for d_path, so we'd cover more calling sites if we add
> d_path helper and allowed resolving BTF object within another object,
> so we could call d_path also with file pointer, like:
>
> bpf_d_path(&file->f_path, buf, size);
>
> This feature is mainly to be able to add dpath (filepath originally)
> function to bpftrace:
>
> # bpftrace -e 'kfunc:vfs_open { printf("%s\n", dpath(args->path)); }'
>
> v3 changes:
> - changed tests to use seleton and vmlinux.h [Andrii]
> - refactored to define ID lists in C object [Andrii]
> - changed btf_struct_access for nested ID check,
> instead of adding new function for that [Andrii]
> - fail build with CONFIG_DEBUG_INFO_BTF if libelf is not detected [Andrii]
>
> Also available at:
> https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
> bpf/d_path
>
> thanks,
> jirka
Hi Jira, Apologize for waiting until v3 to look at this series, but a
couple general requests as I review this.
In the cover letter can we get some more details. The above is really
terse/cryptic in my opinion. The bpftrace example gives good motiviation,
but nothing above mentions a new .BTF_ids section and the flow to create
and use this section.
Also if we add a BTF_ids section adding documentation in btf.rst should
happen as well. I would like to see something in the ELF File Format
Interface section and BTF Generation sections.
I'm not going to nitpick if its in this series or a stand-alone patch
but do want to see it. So far the Documentation on BTF is fairly
good and I want to avoid these kind of gaps.
Thanks!
John
^ permalink raw reply
* Re: [Patch net] net: change addr_list_lock back to static key
From: Cong Wang @ 2020-06-18 20:59 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, syzbot+f3a0e80c34b3fc28ac5e, Taehee Yoo, Dmitry Vyukov
In-Reply-To: <CA+h21hpjsth_1t1ZaBcTd1i3RPXZGqzSyegSSPS2Ns=uq5-HJw@mail.gmail.com>
On Thu, Jun 18, 2020 at 1:33 PM Vladimir Oltean <olteanv@gmail.com> wrote:
>
> On Thu, 18 Jun 2020 at 23:06, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> >
> > On Thu, Jun 18, 2020 at 12:56 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
> > >
> > > On Thu, Jun 18, 2020 at 12:40 PM Vladimir Oltean <olteanv@gmail.com> wrote:
> > > >
> > > > It's me with the stacked DSA devices again:
> > >
> > > It looks like DSA never uses netdev API to link master
> > > device with slave devices? If so, their dev->lower_level
> > > are always 1, therefore triggers this warning.
> > >
> > > I think it should call one of these netdev_upper_dev_link()
> > > API's when creating a slave device.
> > >
> >
> > I don't know whether DSA is too special to use the API, but
> > something like this should work:
> >
> > diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> > index 4c7f086a047b..f7a2a281e7f0 100644
> > --- a/net/dsa/slave.c
> > +++ b/net/dsa/slave.c
> > @@ -1807,6 +1807,11 @@ int dsa_slave_create(struct dsa_port *port)
> > ret, slave_dev->name);
> > goto out_phy;
> > }
> > + ret = netdev_upper_dev_link(slave_dev, master, NULL);
> > + if (ret) {
> > + unregister_netdevice(slave_dev);
> > + goto out_phy;
> > + }
> >
> > return 0;
> >
> > @@ -1832,6 +1837,7 @@ void dsa_slave_destroy(struct net_device *slave_dev)
> > netif_carrier_off(slave_dev);
> > rtnl_lock();
> > phylink_disconnect_phy(dp->pl);
> > + netdev_upper_dev_unlink(slave_dev, dp->master);
> > rtnl_unlock();
> >
> > dsa_slave_notify(slave_dev, DSA_PORT_UNREGISTER);
>
> Thanks. This is a good approximation of what needed to be done:
> - netdev_upper_dev_link needs to be under rtnl,
> - "dp->master" should be "dsa_slave_to_master(slave_dev)" since it's
> actually a union if you look at struct dsa_port).
> - And, most importantly, I think the hierarchy should be reversed: a
> (virtual) DSA switch port net device (slave) should be an upper of the
> (real) DSA master (the host port). Think of it like this: a DSA switch
> is a sort of port multiplier for a host port, based on a frame header.
> But, it works!
Please feel free to make any changes you need and submit it
by yourself, as you know DSA better than me and I do not even
have a DSA testing environment.
>
> Do you mind if I submit your modified patch to "net"? What would be an
> adequate Fixes: tag?
If it is merely to fix the lockdep warning, my commit 845e0ebb4408d447
is the right one to blame.
Thanks.
^ permalink raw reply
* Re: [PATCH] restore behaviour of CAP_SYS_ADMIN allowing the loading of net bpf program
From: Alexei Starovoitov @ 2020-06-18 21:02 UTC (permalink / raw)
To: Maciej Żenczykowski
Cc: Maciej Żenczykowski, Alexei Starovoitov, Daniel Borkmann,
Linux Network Development Mailing List, Linux Kernel Mailing List,
BPF Mailing List, David S . Miller
In-Reply-To: <20200618195956.73967-1-zenczykowski@gmail.com>
On Thu, Jun 18, 2020 at 1:00 PM Maciej Żenczykowski
<zenczykowski@gmail.com> wrote:
>
> From: Maciej Żenczykowski <maze@google.com>
>
> This is a 5.8-rc1 regression.
Please add full explanation here.
Also use [PATCH bpf] in the subject for future submission.
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF")
Reported-by: John
is missing?
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
> ---
> kernel/bpf/syscall.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index 8da159936bab..7d946435587d 100644
> --- a/kernel/bpf/syscall.c
> +++ b/kernel/bpf/syscall.c
> @@ -2121,7 +2121,7 @@ static int bpf_prog_load(union bpf_attr *attr, union bpf_attr __user *uattr)
> !bpf_capable())
> return -EPERM;
>
> - if (is_net_admin_prog_type(type) && !capable(CAP_NET_ADMIN))
> + if (is_net_admin_prog_type(type) && !capable(CAP_NET_ADMIN) && !capable(CAP_SYS_ADMIN))
> return -EPERM;
> if (is_perfmon_prog_type(type) && !perfmon_capable())
> return -EPERM;
> --
> 2.27.0.290.gba653c62da-goog
>
^ permalink raw reply
* [PATCH] nbd: allocate sufficient space for NBD_CMD_STATUS
From: Thadeu Lima de Souza Cascardo @ 2020-06-18 21:02 UTC (permalink / raw)
To: Josef Bacik; +Cc: Jens Axboe, linux-block, nbd, linux-kernel, netdev, cascardo
The nest attribute NBD_ATTR_DEVICE_LIST was not accounted for when
allocating the message, resulting in -EMSGSIZE.
As __alloc_skb aligns size requests to SMP_CACHE_BYTES and SLUB will end up
allocating more than requested, this can hardly be reproduced on most
setups.
However, I managed to test this on a 32-bit x86 with 15 entries, by loading
with nbds_max=15. It failed with -EMSGSIZE, while it worked with 14 or 16
entries.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
drivers/block/nbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 43cff01a5a67..19551d8ca355 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -2265,6 +2265,7 @@ static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info)
msg_size = nla_total_size(nla_attr_size(sizeof(u32)) +
nla_attr_size(sizeof(u8)));
msg_size *= (index == -1) ? nbd_total_devices : 1;
+ msg_size += nla_total_size(0); /* for NBD_ATTR_DEVICE_LIST */
reply = genlmsg_new(msg_size, GFP_KERNEL);
if (!reply)
--
2.25.1
^ permalink raw reply related
* [PATCH] nbd: allocate sufficient space for NBD_CMD_STATUS
From: Thadeu Lima de Souza Cascardo @ 2020-06-18 21:02 UTC (permalink / raw)
To: Josef Bacik; +Cc: Jens Axboe, linux-block, nbd, linux-kernel, netdev, cascardo
In-Reply-To: <20200618210240.157566-1-cascardo@canonical.com>
The nest attribute NBD_ATTR_DEVICE_LIST was not accounted for when
allocating the message, resulting in -EMSGSIZE.
As __alloc_skb aligns size requests to SMP_CACHE_BYTES and SLUB will end up
allocating more than requested, this can hardly be reproduced on most
setups.
However, I managed to test this on a 32-bit x86 with 15 entries, by loading
with nbds_max=15. It failed with -EMSGSIZE, while it worked with 14 or 16
entries.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
drivers/block/nbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 43cff01a5a67..19551d8ca355 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -2265,6 +2265,7 @@ static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info)
msg_size = nla_total_size(nla_attr_size(sizeof(u32)) +
nla_attr_size(sizeof(u8)));
msg_size *= (index == -1) ? nbd_total_devices : 1;
+ msg_size += nla_total_size(0); /* for NBD_ATTR_DEVICE_LIST */
reply = genlmsg_new(msg_size, GFP_KERNEL);
if (!reply)
--
2.25.1
^ permalink raw reply related
* [PATCH] linux++, this: rename "struct notifier_block *this"
From: Alexey Dobriyan @ 2020-06-18 21:06 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, netdev, linux-arch, netfilter-devel
Rename
struct notifier_block *this
to
struct notifier_block *nb
"nb" is arguably a better name for notifier block.
Someone used "this" back in the days and everyone else copied.
In nearly 100% of cases it is unused with notable exception of
net/x25/af_ax25.c
Both gcc and g++ accept new name. It would make my adventure of carrying
linux++ patchset slightly less miserable.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
arch/alpha/kernel/setup.c | 2 +-
arch/mips/kernel/pm-cps.c | 2 +-
arch/mips/sgi-ip22/ip22-reset.c | 2 +-
arch/mips/sgi-ip32/ip32-reset.c | 2 +-
arch/mips/txx9/generic/setup_tx4939.c | 2 +-
arch/parisc/kernel/pdc_chassis.c | 4 ++--
arch/powerpc/kernel/setup-common.c | 2 +-
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 2 +-
arch/powerpc/sysdev/fsl_soc.c | 2 +-
arch/um/drivers/net_kern.c | 2 +-
arch/um/drivers/vector_kern.c | 2 +-
arch/x86/xen/enlighten.c | 2 +-
arch/xtensa/platforms/iss/setup.c | 2 +-
crypto/algboss.c | 2 +-
drivers/acpi/apei/ghes.c | 2 +-
drivers/acpi/sleep.c | 2 +-
drivers/auxdisplay/charlcd.c | 2 +-
drivers/char/ipmi/ipmi_msghandler.c | 2 +-
drivers/char/ipmi/ipmi_watchdog.c | 2 +-
drivers/clk/clk-nomadik.c | 2 +-
drivers/clk/rockchip/clk.c | 2 +-
drivers/clk/samsung/clk-s3c2412.c | 2 +-
drivers/clk/samsung/clk-s3c2443.c | 2 +-
drivers/cpufreq/s3c2416-cpufreq.c | 2 +-
drivers/cpufreq/s5pv210-cpufreq.c | 2 +-
drivers/crypto/chelsio/chtls/chtls_main.c | 2 +-
drivers/edac/altera_edac.c | 4 ++--
drivers/edac/octeon_edac-pc.c | 4 ++--
drivers/edac/sifive_edac.c | 4 ++--
drivers/gpu/drm/i915/display/intel_dp.c | 4 ++--
drivers/hwmon/w83793.c | 2 +-
drivers/infiniband/core/roce_gid_mgmt.c | 12 ++++++------
drivers/infiniband/hw/mlx4/main.c | 4 ++--
drivers/infiniband/hw/mlx5/main.c | 4 ++--
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +-
drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +-
drivers/macintosh/adbhid.c | 2 +-
drivers/md/md.c | 2 +-
drivers/mfd/rn5t618.c | 2 +-
drivers/misc/mic/cosm_client/cosm_scif_client.c | 2 +-
drivers/mmc/core/pwrseq_emmc.c | 4 ++--
drivers/net/bonding/bond_main.c | 2 +-
drivers/net/ethernet/broadcom/cnic.c | 2 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 ++--
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 ++--
drivers/net/ethernet/mellanox/mlx5/core/lag.c | 4 ++--
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 4 ++--
drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 ++--
drivers/net/ethernet/sfc/efx.c | 2 +-
drivers/net/ethernet/sfc/falcon/efx.c | 2 +-
drivers/net/hamradio/bpqether.c | 2 +-
drivers/net/hyperv/netvsc_drv.c | 2 +-
drivers/net/macsec.c | 2 +-
drivers/net/netconsole.c | 2 +-
drivers/net/ppp/pppoe.c | 2 +-
drivers/net/wan/hdlc.c | 2 +-
drivers/net/wan/lapbether.c | 2 +-
drivers/net/wireless/virt_wifi.c | 2 +-
drivers/parisc/power.c | 2 +-
drivers/platform/x86/intel_telemetry_debugfs.c | 2 +-
drivers/power/reset/arm-versatile-reboot.c | 2 +-
drivers/power/reset/at91-reset.c | 4 ++--
drivers/power/reset/axxia-reset.c | 2 +-
drivers/power/reset/brcm-kona-reset.c | 2 +-
drivers/power/reset/brcmstb-reboot.c | 2 +-
drivers/power/reset/gpio-restart.c | 4 ++--
drivers/power/reset/hisi-reboot.c | 2 +-
drivers/power/reset/keystone-reset.c | 2 +-
drivers/power/reset/ocelot-reset.c | 4 ++--
drivers/power/reset/oxnas-restart.c | 4 ++--
drivers/power/reset/reboot-mode.c | 4 ++--
drivers/power/reset/rmobile-reset.c | 2 +-
drivers/power/reset/st-poweroff.c | 2 +-
drivers/power/reset/syscon-reboot.c | 4 ++--
drivers/power/reset/vexpress-poweroff.c | 2 +-
drivers/power/reset/xgene-reboot.c | 4 ++--
drivers/power/reset/zx-reboot.c | 2 +-
drivers/rtc/rtc-ds1374.c | 2 +-
drivers/rtc/rtc-m41t80.c | 4 ++--
drivers/s390/char/sclp.c | 2 +-
drivers/s390/cio/css.c | 4 ++--
drivers/s390/net/qeth_l3_main.c | 4 ++--
drivers/soc/tegra/pmc.c | 2 +-
drivers/spi/spi-sprd-adi.c | 4 ++--
drivers/watchdog/alim1535_wdt.c | 2 +-
drivers/watchdog/alim7101_wdt.c | 4 ++--
drivers/watchdog/at91rm9200_wdt.c | 2 +-
drivers/watchdog/diag288_wdt.c | 2 +-
drivers/watchdog/eurotechwdt.c | 4 ++--
drivers/watchdog/f71808e_wdt.c | 2 +-
drivers/watchdog/indydog.c | 2 +-
drivers/watchdog/intel_scu_watchdog.c | 2 +-
drivers/watchdog/it8712f_wdt.c | 2 +-
drivers/watchdog/machzwd.c | 2 +-
drivers/watchdog/pc87413_wdt.c | 4 ++--
drivers/watchdog/pcwd_pci.c | 2 +-
drivers/watchdog/pcwd_usb.c | 2 +-
drivers/watchdog/pnx833x_wdt.c | 2 +-
drivers/watchdog/sb_wdog.c | 2 +-
drivers/watchdog/sbc60xxwdt.c | 2 +-
drivers/watchdog/sbc7240_wdt.c | 2 +-
drivers/watchdog/sbc8360.c | 2 +-
drivers/watchdog/sbc_epx_c3.c | 2 +-
drivers/watchdog/sc1200wdt.c | 2 +-
drivers/watchdog/sc520_wdt.c | 2 +-
drivers/watchdog/scx200_wdt.c | 2 +-
drivers/watchdog/smsc37b787_wdt.c | 2 +-
drivers/watchdog/w83877f_wdt.c | 2 +-
drivers/watchdog/w83977f_wdt.c | 2 +-
drivers/watchdog/wafer5823wdt.c | 2 +-
drivers/watchdog/wdrtas.c | 2 +-
drivers/watchdog/wdt.c | 4 ++--
drivers/watchdog/wdt977.c | 2 +-
drivers/watchdog/wdt_pci.c | 4 ++--
fs/lockd/svc.c | 4 ++--
fs/nfsd/nfssvc.c | 4 ++--
kernel/debug/debug_core.c | 2 +-
kernel/hung_task.c | 2 +-
kernel/rcu/tree_stall.h | 2 +-
kernel/trace/trace.c | 2 +-
net/appletalk/aarp.c | 2 +-
net/appletalk/ddp.c | 2 +-
net/atm/br2684.c | 2 +-
net/atm/clip.c | 6 +++---
net/ax25/af_ax25.c | 2 +-
net/batman-adv/hard-interface.c | 2 +-
net/core/failover.c | 2 +-
net/core/fib_rules.c | 2 +-
net/core/rtnetlink.c | 2 +-
net/decnet/af_decnet.c | 2 +-
net/decnet/dn_fib.c | 2 +-
net/ethtool/netlink.c | 2 +-
net/ipv4/arp.c | 2 +-
net/ipv4/devinet.c | 2 +-
net/ipv4/fib_frontend.c | 4 ++--
net/ipv4/igmp.c | 2 +-
net/ipv4/ipmr.c | 2 +-
net/ipv4/netfilter/ipt_CLUSTERIP.c | 2 +-
net/ipv4/nexthop.c | 2 +-
net/ipv6/addrconf.c | 2 +-
net/ipv6/ip6mr.c | 2 +-
net/ipv6/mcast.c | 2 +-
net/ipv6/ndisc.c | 2 +-
net/ipv6/route.c | 2 +-
net/iucv/af_iucv.c | 2 +-
net/iucv/iucv.c | 2 +-
net/mpls/af_mpls.c | 2 +-
net/netfilter/ipvs/ip_vs_ctl.c | 2 +-
net/netfilter/nf_nat_masquerade.c | 6 +++---
net/netfilter/nf_tables_api.c | 2 +-
net/netfilter/nf_tables_offload.c | 2 +-
net/netfilter/nfnetlink_log.c | 2 +-
net/netfilter/nfnetlink_queue.c | 4 ++--
net/netfilter/nft_chain_filter.c | 2 +-
net/netfilter/nft_flow_offload.c | 2 +-
net/netfilter/xt_TEE.c | 2 +-
net/netlabel/netlabel_unlabeled.c | 4 ++--
net/netrom/af_netrom.c | 2 +-
net/nfc/netlink.c | 2 +-
net/packet/af_packet.c | 2 +-
net/rose/af_rose.c | 2 +-
net/sctp/ipv6.c | 2 +-
net/sctp/protocol.c | 2 +-
net/smc/smc_core.c | 2 +-
net/smc/smc_pnet.c | 2 +-
net/tls/tls_device.c | 2 +-
net/x25/af_x25.c | 12 ++++++------
net/xdp/xsk.c | 2 +-
net/xfrm/xfrm_device.c | 2 +-
security/selinux/netif.c | 2 +-
173 files changed, 221 insertions(+), 221 deletions(-)
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -1443,7 +1443,7 @@ const struct seq_operations cpuinfo_op = {
static int
-alpha_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
+alpha_panic_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
#if 1
/* FIXME FIXME FIXME */
--- a/arch/mips/kernel/pm-cps.c
+++ b/arch/mips/kernel/pm-cps.c
@@ -667,7 +667,7 @@ static int cps_pm_online_cpu(unsigned int cpu)
return 0;
}
-static int cps_pm_power_notifier(struct notifier_block *this,
+static int cps_pm_power_notifier(struct notifier_block *nb,
unsigned long event, void *ptr)
{
unsigned int stat;
--- a/arch/mips/sgi-ip22/ip22-reset.c
+++ b/arch/mips/sgi-ip22/ip22-reset.c
@@ -163,7 +163,7 @@ static irqreturn_t panel_int(int irq, void *dev_id)
return IRQ_HANDLED;
}
-static int panic_event(struct notifier_block *this, unsigned long event,
+static int panic_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
if (machine_state & MACHINE_PANICED)
--- a/arch/mips/sgi-ip32/ip32-reset.c
+++ b/arch/mips/sgi-ip32/ip32-reset.c
@@ -108,7 +108,7 @@ void ip32_prepare_poweroff(void)
add_timer(&power_timer);
}
-static int panic_event(struct notifier_block *this, unsigned long event,
+static int panic_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
unsigned long led;
--- a/arch/mips/txx9/generic/setup_tx4939.c
+++ b/arch/mips/txx9/generic/setup_tx4939.c
@@ -328,7 +328,7 @@ static u32 tx4939_get_eth_speed(struct net_device *dev)
return cmd.base.speed;
}
-static int tx4939_netdev_event(struct notifier_block *this,
+static int tx4939_netdev_event(struct notifier_block *nb,
unsigned long event,
void *ptr)
{
--- a/arch/parisc/kernel/pdc_chassis.c
+++ b/arch/parisc/kernel/pdc_chassis.c
@@ -83,7 +83,7 @@ static void __init pdc_chassis_checkold(void)
* As soon as a panic occurs, we should inform the PDC.
*/
-static int pdc_chassis_panic_event(struct notifier_block *this,
+static int pdc_chassis_panic_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC);
@@ -103,7 +103,7 @@ static struct notifier_block pdc_chassis_panic_block = {
* As soon as a reboot occurs, we should inform the PDC.
*/
-static int pdc_chassis_reboot_event(struct notifier_block *this,
+static int pdc_chassis_reboot_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
pdc_chassis_send_status(PDC_CHASSIS_DIRECT_SHUTDOWN);
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -687,7 +687,7 @@ int check_legacy_ioport(unsigned long base_port)
}
EXPORT_SYMBOL(check_legacy_ioport);
-static int ppc_panic_event(struct notifier_block *this,
+static int ppc_panic_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
/*
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -79,7 +79,7 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
return PCIBIOS_SUCCESSFUL;
}
-static int mpc85xx_cds_restart(struct notifier_block *this,
+static int mpc85xx_cds_restart(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
struct pci_dev *dev;
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -155,7 +155,7 @@ EXPORT_SYMBOL(get_baudrate);
#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
static __be32 __iomem *rstcr;
-static int fsl_rstcr_restart(struct notifier_block *this,
+static int fsl_rstcr_restart(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
local_irq_disable();
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -721,7 +721,7 @@ static struct mc_device net_mc = {
};
#ifdef CONFIG_INET
-static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
+static int uml_inetaddr_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct in_ifaddr *ifa = ptr;
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1732,7 +1732,7 @@ static struct mc_device vector_mc = {
#ifdef CONFIG_INET
static int vector_inetaddr_event(
- struct notifier_block *this,
+ struct notifier_block *nb,
unsigned long event,
void *ptr)
{
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -277,7 +277,7 @@ void xen_emergency_restart(void)
}
static int
-xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
+xen_panic_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
if (!kexec_crash_loaded()) {
if (xen_legacy_crash)
--- a/arch/xtensa/platforms/iss/setup.c
+++ b/arch/xtensa/platforms/iss/setup.c
@@ -44,7 +44,7 @@ void platform_restart(void)
}
static int
-iss_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
+iss_panic_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
simc_exit(1);
return NOTIFY_DONE;
--- a/crypto/algboss.c
+++ b/crypto/algboss.c
@@ -251,7 +251,7 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg)
return NOTIFY_OK;
}
-static int cryptomgr_notify(struct notifier_block *this, unsigned long msg,
+static int cryptomgr_notify(struct notifier_block *nb, unsigned long msg,
void *data)
{
switch (msg) {
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -808,7 +808,7 @@ static irqreturn_t ghes_irq_func(int irq, void *data)
return IRQ_HANDLED;
}
-static int ghes_notify_hed(struct notifier_block *this, unsigned long event,
+static int ghes_notify_hed(struct notifier_block *nb, unsigned long event,
void *data)
{
struct ghes *ghes;
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -45,7 +45,7 @@ static void acpi_sleep_tts_switch(u32 acpi_state)
}
}
-static int tts_notify_reboot(struct notifier_block *this,
+static int tts_notify_reboot(struct notifier_block *nb,
unsigned long code, void *x)
{
acpi_sleep_tts_switch(ACPI_STATE_S5);
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -811,7 +811,7 @@ void charlcd_free(struct charlcd *lcd)
}
EXPORT_SYMBOL_GPL(charlcd_free);
-static int panel_notify_sys(struct notifier_block *this, unsigned long code,
+static int panel_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
struct charlcd *lcd = the_charlcd;
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -5050,7 +5050,7 @@ static void send_panic_events(struct ipmi_smi *intf, char *str)
static int has_panicked;
-static int panic_event(struct notifier_block *this,
+static int panic_event(struct notifier_block *nb,
unsigned long event,
void *ptr)
{
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -1134,7 +1134,7 @@ ipmi_nmi(unsigned int val, struct pt_regs *regs)
}
#endif
-static int wdog_reboot_handler(struct notifier_block *this,
+static int wdog_reboot_handler(struct notifier_block *nb,
unsigned long code,
void *unused)
{
--- a/drivers/clk/clk-nomadik.c
+++ b/drivers/clk/clk-nomadik.c
@@ -61,7 +61,7 @@ static DEFINE_SPINLOCK(src_lock);
/* Base address of the SRC */
static void __iomem *src_base;
-static int nomadik_clk_reboot_handler(struct notifier_block *this,
+static int nomadik_clk_reboot_handler(struct notifier_block *nb,
unsigned long code,
void *unused)
{
--- a/drivers/clk/rockchip/clk.c
+++ b/drivers/clk/rockchip/clk.c
@@ -606,7 +606,7 @@ void __init rockchip_clk_protect_critical(const char *const clocks[],
static void __iomem *rst_base;
static unsigned int reg_restart;
static void (*cb_restart)(void);
-static int rockchip_restart_notify(struct notifier_block *this,
+static int rockchip_restart_notify(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
if (cb_restart)
--- a/drivers/clk/samsung/clk-s3c2412.c
+++ b/drivers/clk/samsung/clk-s3c2412.c
@@ -155,7 +155,7 @@ static struct samsung_clock_alias s3c2412_aliases[] __initdata = {
ALIAS(MSYSCLK, NULL, "fclk"),
};
-static int s3c2412_restart(struct notifier_block *this,
+static int s3c2412_restart(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
/* errata "Watch-dog/Software Reset Problem" specifies that
--- a/drivers/clk/samsung/clk-s3c2443.c
+++ b/drivers/clk/samsung/clk-s3c2443.c
@@ -307,7 +307,7 @@ static struct samsung_clock_alias s3c2450_aliases[] __initdata = {
ALIAS(PCLK_I2C1, "s3c2410-i2c.1", "i2c"),
};
-static int s3c2443_restart(struct notifier_block *this,
+static int s3c2443_restart(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
__raw_writel(0x533c2443, reg_base + SWRST);
--- a/drivers/cpufreq/s3c2416-cpufreq.c
+++ b/drivers/cpufreq/s3c2416-cpufreq.c
@@ -299,7 +299,7 @@ static void s3c2416_cpufreq_cfg_regulator(struct s3c2416_data *s3c_freq)
}
#endif
-static int s3c2416_cpufreq_reboot_notifier_evt(struct notifier_block *this,
+static int s3c2416_cpufreq_reboot_notifier_evt(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct s3c2416_data *s3c_freq = &s3c2416_cpufreq;
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -551,7 +551,7 @@ static int s5pv210_cpu_init(struct cpufreq_policy *policy)
return ret;
}
-static int s5pv210_cpufreq_reboot_notifier_event(struct notifier_block *this,
+static int s5pv210_cpufreq_reboot_notifier_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
int ret;
--- a/drivers/crypto/chelsio/chtls/chtls_main.c
+++ b/drivers/crypto/chelsio/chtls/chtls_main.c
@@ -50,7 +50,7 @@ static void unregister_listen_notifier(struct notifier_block *nb)
mutex_unlock(¬ify_mutex);
}
-static int listen_notify_handler(struct notifier_block *this,
+static int listen_notify_handler(struct notifier_block *nb,
unsigned long event, void *data)
{
struct chtls_listen *clisten;
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -2024,10 +2024,10 @@ extern int panic_timeout;
* The double bit error is handled through SError which is fatal. This is
* called as a panic notifier to printout ECC error info as part of the panic.
*/
-static int s10_edac_dberr_handler(struct notifier_block *this,
+static int s10_edac_dberr_handler(struct notifier_block *nb,
unsigned long event, void *ptr)
{
- struct altr_arria10_edac *edac = to_a10edac(this, panic_notifier);
+ struct altr_arria10_edac *edac = to_a10edac(nb, panic_notifier);
int err_addr, dberror;
regmap_read(edac->ecc_mgr_map, S10_SYSMGR_ECC_INTSTAT_DERR_OFST,
--- a/drivers/edac/octeon_edac-pc.c
+++ b/drivers/edac/octeon_edac-pc.c
@@ -35,10 +35,10 @@ struct co_cache_error {
*
* @event: non-zero if unrecoverable.
*/
-static int co_cache_error_event(struct notifier_block *this,
+static int co_cache_error_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
- struct co_cache_error *p = container_of(this, struct co_cache_error,
+ struct co_cache_error *p = container_of(nb, struct co_cache_error,
notifier);
unsigned int core = cvmx_get_core_num();
--- a/drivers/edac/sifive_edac.c
+++ b/drivers/edac/sifive_edac.c
@@ -25,12 +25,12 @@ struct sifive_edac_priv {
* @event: non-zero if unrecoverable.
*/
static
-int ecc_err_event(struct notifier_block *this, unsigned long event, void *ptr)
+int ecc_err_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
const char *msg = (char *)ptr;
struct sifive_edac_priv *p;
- p = container_of(this, struct sifive_edac_priv, notifier);
+ p = container_of(nb, struct sifive_edac_priv, notifier);
if (event == SIFIVE_L2_ERR_TYPE_UE)
edac_device_handle_ue(p->dci, 0, 0, msg);
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1125,10 +1125,10 @@ _pp_stat_reg(struct intel_dp *intel_dp)
/* Reboot notifier handler to shutdown panel power to guarantee T12 timing
This function only applicable when panel PM state is not to be tracked */
-static int edp_notify_handler(struct notifier_block *this, unsigned long code,
+static int edp_notify_handler(struct notifier_block *nb, unsigned long code,
void *unused)
{
- struct intel_dp *intel_dp = container_of(this, typeof(* intel_dp),
+ struct intel_dp *intel_dp = container_of(nb, typeof(* intel_dp),
edp_notifier);
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
intel_wakeref_t wakeref;
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -1465,7 +1465,7 @@ static const struct file_operations watchdog_fops = {
* Notifier for system down
*/
-static int watchdog_notify_sys(struct notifier_block *this, unsigned long code,
+static int watchdog_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
struct w83793_data *data = NULL;
--- a/drivers/infiniband/core/roce_gid_mgmt.c
+++ b/drivers/infiniband/core/roce_gid_mgmt.c
@@ -731,7 +731,7 @@ static const struct netdev_event_work_cmd add_default_gid_cmd = {
.filter = is_ndev_for_default_gid_filter,
};
-static int netdevice_event(struct notifier_block *this, unsigned long event,
+static int netdevice_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
static const struct netdev_event_work_cmd del_cmd = {
@@ -811,7 +811,7 @@ static void update_gid_event_work_handler(struct work_struct *_work)
kfree(work);
}
-static int addr_event(struct notifier_block *this, unsigned long event,
+static int addr_event(struct notifier_block *nb, unsigned long event,
struct sockaddr *sa, struct net_device *ndev)
{
struct update_gid_event_work *work;
@@ -851,7 +851,7 @@ static int addr_event(struct notifier_block *this, unsigned long event,
return NOTIFY_DONE;
}
-static int inetaddr_event(struct notifier_block *this, unsigned long event,
+static int inetaddr_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct sockaddr_in in;
@@ -862,10 +862,10 @@ static int inetaddr_event(struct notifier_block *this, unsigned long event,
in.sin_addr.s_addr = ifa->ifa_address;
ndev = ifa->ifa_dev->dev;
- return addr_event(this, event, (struct sockaddr *)&in, ndev);
+ return addr_event(nb, event, (struct sockaddr *)&in, ndev);
}
-static int inet6addr_event(struct notifier_block *this, unsigned long event,
+static int inet6addr_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct sockaddr_in6 in6;
@@ -876,7 +876,7 @@ static int inet6addr_event(struct notifier_block *this, unsigned long event,
in6.sin6_addr = ifa6->addr;
ndev = ifa6->idev->dev;
- return addr_event(this, event, (struct sockaddr *)&in6, ndev);
+ return addr_event(nb, event, (struct sockaddr *)&in6, ndev);
}
static struct notifier_block nb_netdevice = {
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -2389,7 +2389,7 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev,
mlx4_ib_update_qps(ibdev, dev, update_qps_port);
}
-static int mlx4_ib_netdev_event(struct notifier_block *this,
+static int mlx4_ib_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
@@ -2398,7 +2398,7 @@ static int mlx4_ib_netdev_event(struct notifier_block *this,
if (!net_eq(dev_net(dev), &init_net))
return NOTIFY_DONE;
- ibdev = container_of(this, struct mlx4_ib_dev, iboe.nb);
+ ibdev = container_of(nb, struct mlx4_ib_dev, iboe.nb);
mlx4_ib_scan_netdevs(ibdev, dev, event);
return NOTIFY_DONE;
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -179,10 +179,10 @@ static struct mlx5_roce *mlx5_get_rep_roce(struct mlx5_ib_dev *dev,
return NULL;
}
-static int mlx5_netdev_event(struct notifier_block *this,
+static int mlx5_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
- struct mlx5_roce *roce = container_of(this, struct mlx5_roce, nb);
+ struct mlx5_roce *roce = container_of(nb, struct mlx5_roce, nb);
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
u8 port_num = roce->native_port_num;
struct mlx5_core_dev *mdev;
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
@@ -758,7 +758,7 @@ static void pvrdma_netdevice_event_work(struct work_struct *work)
kfree(netdev_work);
}
-static int pvrdma_netdevice_event(struct notifier_block *this,
+static int pvrdma_netdevice_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *event_netdev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -105,7 +105,7 @@ static struct ib_client ipoib_client = {
};
#ifdef CONFIG_INFINIBAND_IPOIB_DEBUG
-static int ipoib_netdev_event(struct notifier_block *this,
+static int ipoib_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct netdev_notifier_info *ni = ptr;
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -714,7 +714,7 @@ adbhid_kbd_capslock_remember(void)
}
static int
-adb_message_handler(struct notifier_block *this, unsigned long code, void *x)
+adb_message_handler(struct notifier_block *nb, unsigned long code, void *x)
{
switch (code) {
case ADB_MSG_PRE_RESET:
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -9433,7 +9433,7 @@ int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
}
EXPORT_SYMBOL_GPL(rdev_clear_badblocks);
-static int md_notify_reboot(struct notifier_block *this,
+static int md_notify_reboot(struct notifier_block *nb,
unsigned long code, void *x)
{
struct list_head *tmp;
--- a/drivers/mfd/rn5t618.c
+++ b/drivers/mfd/rn5t618.c
@@ -124,7 +124,7 @@ static void rn5t618_power_off(void)
rn5t618_trigger_poweroff_sequence(false);
}
-static int rn5t618_restart(struct notifier_block *this,
+static int rn5t618_restart(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
rn5t618_trigger_poweroff_sequence(true);
--- a/drivers/misc/mic/cosm_client/cosm_scif_client.c
+++ b/drivers/misc/mic/cosm_client/cosm_scif_client.c
@@ -25,7 +25,7 @@ static struct scif_peer_dev *client_spdev;
* Reboot notifier: receives shutdown status from the OS and communicates it
* back to the COSM process on the host
*/
-static int cosm_reboot_event(struct notifier_block *this, unsigned long event,
+static int cosm_reboot_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct cosm_msg msg = { .id = COSM_MSG_SHUTDOWN_STATUS };
--- a/drivers/mmc/core/pwrseq_emmc.c
+++ b/drivers/mmc/core/pwrseq_emmc.c
@@ -39,10 +39,10 @@ static void mmc_pwrseq_emmc_reset(struct mmc_host *host)
udelay(200);
}
-static int mmc_pwrseq_emmc_reset_nb(struct notifier_block *this,
+static int mmc_pwrseq_emmc_reset_nb(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
- struct mmc_pwrseq_emmc *pwrseq = container_of(this,
+ struct mmc_pwrseq_emmc *pwrseq = container_of(nb,
struct mmc_pwrseq_emmc, reset_nb);
gpiod_set_value(pwrseq->reset_gpio, 1);
udelay(1);
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3254,7 +3254,7 @@ static int bond_slave_netdev_event(unsigned long event,
* locks for us to safely manipulate the slave devices (RTNL lock,
* dev_probe_lock).
*/
-static int bond_netdev_event(struct notifier_block *this,
+static int bond_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -5678,7 +5678,7 @@ static void cnic_rcv_netevent(struct cnic_local *cp, unsigned long event,
}
/* netdev event handler */
-static int cnic_netdev_event(struct notifier_block *this, unsigned long event,
+static int cnic_netdev_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -2371,7 +2371,7 @@ static void notify_ulds(struct adapter *adap, enum cxgb4_state new_state)
}
#if IS_ENABLED(CONFIG_IPV6)
-static int cxgb4_inet6addr_handler(struct notifier_block *this,
+static int cxgb4_inet6addr_handler(struct notifier_block *nb,
unsigned long event, void *data)
{
struct inet6_ifaddr *ifa = data;
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -3012,7 +3012,7 @@ static int mlx4_en_queue_bond_work(struct mlx4_en_priv *priv, int is_bonded,
return 0;
}
-int mlx4_en_netdev_event(struct notifier_block *this,
+int mlx4_en_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
@@ -3028,7 +3028,7 @@ int mlx4_en_netdev_event(struct notifier_block *this,
if (!net_eq(dev_net(ndev), &init_net))
return NOTIFY_DONE;
- mdev = container_of(this, struct mlx4_en_dev, nb);
+ mdev = container_of(nb, struct mlx4_en_dev, nb);
dev = mdev->dev;
/* Go into this mode only when two network devices set on two ports
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -794,7 +794,7 @@ void mlx4_en_update_pfc_stats_bitmap(struct mlx4_dev *dev,
struct mlx4_en_stats_bitmap *stats_bitmap,
u8 rx_ppp, u8 rx_pause,
u8 tx_ppp, u8 tx_pause);
-int mlx4_en_netdev_event(struct notifier_block *this,
+int mlx4_en_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr);
/*
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -4979,7 +4979,7 @@ static void mlx5e_tc_hairpin_update_dead_peer(struct mlx5e_priv *priv,
}
}
-static int mlx5e_tc_netdev_event(struct notifier_block *this,
+static int mlx5e_tc_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
@@ -4993,7 +4993,7 @@ static int mlx5e_tc_netdev_event(struct notifier_block *this,
ndev->reg_state == NETREG_REGISTERED)
return NOTIFY_DONE;
- tc = container_of(this, struct mlx5e_tc_table, netdevice_nb);
+ tc = container_of(nb, struct mlx5e_tc_table, netdevice_nb);
fs = container_of(tc, struct mlx5e_flow_steering, tc);
priv = container_of(fs, struct mlx5e_priv, fs);
peer_priv = netdev_priv(ndev);
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag.c
@@ -433,7 +433,7 @@ static int mlx5_handle_changelowerstate_event(struct mlx5_lag *ldev,
return 1;
}
-static int mlx5_lag_netdev_event(struct notifier_block *this,
+static int mlx5_lag_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
@@ -444,7 +444,7 @@ static int mlx5_lag_netdev_event(struct notifier_block *this,
if ((event != NETDEV_CHANGEUPPER) && (event != NETDEV_CHANGELOWERSTATE))
return NOTIFY_DONE;
- ldev = container_of(this, struct mlx5_lag, nb);
+ ldev = container_of(nb, struct mlx5_lag, nb);
tracker = ldev->tracker;
switch (event) {
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -3344,7 +3344,7 @@ static void netxen_config_master(struct net_device *dev, unsigned long event)
netxen_free_ip_list(adapter, true);
}
-static int netxen_netdev_event(struct notifier_block *this,
+static int netxen_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct netxen_adapter *adapter;
@@ -3387,7 +3387,7 @@ static int netxen_netdev_event(struct notifier_block *this,
}
static int
-netxen_inetaddr_event(struct notifier_block *this,
+netxen_inetaddr_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct netxen_adapter *adapter;
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -240,7 +240,7 @@ static struct qed_eth_cb_ops qede_ll_ops = {
.ports_update = qede_udp_ports_update,
};
-static int qede_netdev_event(struct notifier_block *this, unsigned long event,
+static int qede_netdev_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -4162,7 +4162,7 @@ void qlcnic_restore_indev_addr(struct net_device *netdev, unsigned long event)
rcu_read_unlock();
}
-static int qlcnic_netdev_event(struct notifier_block *this,
+static int qlcnic_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct qlcnic_adapter *adapter;
@@ -4194,7 +4194,7 @@ static int qlcnic_netdev_event(struct notifier_block *this,
}
static int
-qlcnic_inetaddr_event(struct notifier_block *this,
+qlcnic_inetaddr_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct qlcnic_adapter *adapter;
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -881,7 +881,7 @@ static void efx_update_name(struct efx_nic *efx)
efx_set_channel_names(efx);
}
-static int efx_netdev_event(struct notifier_block *this,
+static int efx_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -2237,7 +2237,7 @@ static void ef4_update_name(struct ef4_nic *efx)
ef4_set_channel_names(efx);
}
-static int ef4_netdev_event(struct notifier_block *this,
+static int ef4_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -525,7 +525,7 @@ static void bpq_free_device(struct net_device *ndev)
/*
* Handle device status changes.
*/
-static int bpq_device_event(struct notifier_block *this,
+static int bpq_device_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -2622,7 +2622,7 @@ static struct hv_driver netvsc_drv = {
* to the guest. When the corresponding VF instance is registered,
* we will take care of switching the data path.
*/
-static int netvsc_netdev_event(struct notifier_block *this,
+static int netvsc_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -4282,7 +4282,7 @@ static bool is_macsec_master(struct net_device *dev)
return rcu_access_pointer(dev->rx_handler) == macsec_handle_frame;
}
-static int macsec_notify(struct notifier_block *this, unsigned long event,
+static int macsec_notify(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *real_dev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -688,7 +688,7 @@ static struct configfs_subsystem netconsole_subsys = {
#endif /* CONFIG_NETCONSOLE_DYNAMIC */
/* Handle network interface device notifications */
-static int netconsole_netdev_event(struct notifier_block *this,
+static int netconsole_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
unsigned long flags;
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -327,7 +327,7 @@ static void pppoe_flush_dev(struct net_device *dev)
write_unlock_bh(&pn->hash_lock);
}
-static int pppoe_device_event(struct notifier_block *this,
+static int pppoe_device_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/wan/hdlc.c
+++ b/drivers/net/wan/hdlc.c
@@ -85,7 +85,7 @@ static inline void hdlc_proto_stop(struct net_device *dev)
-static int hdlc_device_event(struct notifier_block *this, unsigned long event,
+static int hdlc_device_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -359,7 +359,7 @@ static void lapbeth_free_device(struct lapbethdev *lapbeth)
*
* Called from notifier with RTNL held.
*/
-static int lapbeth_device_event(struct notifier_block *this,
+static int lapbeth_device_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct lapbethdev *lapbeth;
--- a/drivers/net/wireless/virt_wifi.c
+++ b/drivers/net/wireless/virt_wifi.c
@@ -605,7 +605,7 @@ static bool netif_is_virt_wifi_dev(const struct net_device *dev)
return rcu_access_pointer(dev->rx_handler) == virt_wifi_rx_handler;
}
-static int virt_wifi_event(struct notifier_block *this, unsigned long event,
+static int virt_wifi_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *lower_dev = netdev_notifier_info_to_dev(ptr);
--- a/drivers/parisc/power.c
+++ b/drivers/parisc/power.c
@@ -179,7 +179,7 @@ static void powerfail_interrupt(int code, void *x)
* executed any longer. This function then re-enables the
* soft-power switch and allows the user to switch off the system
*/
-static int parisc_panic_event(struct notifier_block *this,
+static int parisc_panic_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
/* re-enable the soft-power switch */
--- a/drivers/platform/x86/intel_telemetry_debugfs.c
+++ b/drivers/platform/x86/intel_telemetry_debugfs.c
@@ -884,7 +884,7 @@ static int pm_suspend_exit_cb(void)
return NOTIFY_OK;
}
-static int pm_notification(struct notifier_block *this,
+static int pm_notification(struct notifier_block *nb,
unsigned long event, void *ptr)
{
switch (event) {
--- a/drivers/power/reset/arm-versatile-reboot.c
+++ b/drivers/power/reset/arm-versatile-reboot.c
@@ -69,7 +69,7 @@ static const struct of_device_id versatile_reboot_of_match[] = {
{},
};
-static int versatile_reboot(struct notifier_block *this, unsigned long mode,
+static int versatile_reboot(struct notifier_block *nb, unsigned long mode,
void *cmd)
{
/* Unlock the reset register */
--- a/drivers/power/reset/at91-reset.c
+++ b/drivers/power/reset/at91-reset.c
@@ -64,10 +64,10 @@ struct at91_reset {
* reset register it can be left driving the data bus and
* killing the chance of a subsequent boot from NAND
*/
-static int at91_reset(struct notifier_block *this, unsigned long mode,
+static int at91_reset(struct notifier_block *nb, unsigned long mode,
void *cmd)
{
- struct at91_reset *reset = container_of(this, struct at91_reset, nb);
+ struct at91_reset *reset = container_of(nb, struct at91_reset, nb);
asm volatile(
/* Align to cache lines */
--- a/drivers/power/reset/axxia-reset.c
+++ b/drivers/power/reset/axxia-reset.c
@@ -28,7 +28,7 @@
static struct regmap *syscon;
-static int axxia_restart_handler(struct notifier_block *this,
+static int axxia_restart_handler(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
/* Access Key (0xab) */
--- a/drivers/power/reset/brcm-kona-reset.c
+++ b/drivers/power/reset/brcm-kona-reset.c
@@ -25,7 +25,7 @@
static void __iomem *kona_reset_base;
-static int kona_reset_handler(struct notifier_block *this,
+static int kona_reset_handler(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
/*
--- a/drivers/power/reset/brcmstb-reboot.c
+++ b/drivers/power/reset/brcmstb-reboot.c
@@ -42,7 +42,7 @@ struct reset_reg_mask {
static const struct reset_reg_mask *reset_masks;
-static int brcmstb_restart_handler(struct notifier_block *this,
+static int brcmstb_restart_handler(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
int rc;
--- a/drivers/power/reset/gpio-restart.c
+++ b/drivers/power/reset/gpio-restart.c
@@ -23,11 +23,11 @@ struct gpio_restart {
u32 wait_delay_ms;
};
-static int gpio_restart_notify(struct notifier_block *this,
+static int gpio_restart_notify(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
struct gpio_restart *gpio_restart =
- container_of(this, struct gpio_restart, restart_handler);
+ container_of(nb, struct gpio_restart, restart_handler);
/* drive it active, also inactive->active edge */
gpiod_direction_output(gpio_restart->reset_gpio, 1);
--- a/drivers/power/reset/hisi-reboot.c
+++ b/drivers/power/reset/hisi-reboot.c
@@ -21,7 +21,7 @@
static void __iomem *base;
static u32 reboot_offset;
-static int hisi_restart_handler(struct notifier_block *this,
+static int hisi_restart_handler(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
writel_relaxed(0xdeadbeef, base + reboot_offset);
--- a/drivers/power/reset/keystone-reset.c
+++ b/drivers/power/reset/keystone-reset.c
@@ -49,7 +49,7 @@ static inline int rsctrl_enable_rspll_write(void)
RSCTRL_KEY_MASK, RSCTRL_KEY);
}
-static int rsctrl_restart_handler(struct notifier_block *this,
+static int rsctrl_restart_handler(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
/* enable write access to RSTCTRL */
--- a/drivers/power/reset/ocelot-reset.c
+++ b/drivers/power/reset/ocelot-reset.c
@@ -33,10 +33,10 @@ struct ocelot_reset_context {
#define IF_SI_OWNER_SIMC 2
#define IF_SI_OWNER_OFFSET 4
-static int ocelot_restart_handle(struct notifier_block *this,
+static int ocelot_restart_handle(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
- struct ocelot_reset_context *ctx = container_of(this, struct
+ struct ocelot_reset_context *ctx = container_of(nb, struct
ocelot_reset_context,
restart_handler);
--- a/drivers/power/reset/oxnas-restart.c
+++ b/drivers/power/reset/oxnas-restart.c
@@ -96,10 +96,10 @@ struct oxnas_restart_context {
struct notifier_block restart_handler;
};
-static int ox820_restart_handle(struct notifier_block *this,
+static int ox820_restart_handle(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
- struct oxnas_restart_context *ctx = container_of(this, struct
+ struct oxnas_restart_context *ctx = container_of(nb, struct
oxnas_restart_context,
restart_handler);
u32 value;
--- a/drivers/power/reset/reboot-mode.c
+++ b/drivers/power/reset/reboot-mode.c
@@ -39,13 +39,13 @@ static unsigned int get_reboot_mode_magic(struct reboot_mode_driver *reboot,
return magic;
}
-static int reboot_mode_notify(struct notifier_block *this,
+static int reboot_mode_notify(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
struct reboot_mode_driver *reboot;
unsigned int magic;
- reboot = container_of(this, struct reboot_mode_driver, reboot_notifier);
+ reboot = container_of(nb, struct reboot_mode_driver, reboot_notifier);
magic = get_reboot_mode_magic(reboot, cmd);
if (magic)
reboot->write(reboot, magic);
--- a/drivers/power/reset/rmobile-reset.c
+++ b/drivers/power/reset/rmobile-reset.c
@@ -21,7 +21,7 @@
static void __iomem *sysc_base2;
-static int rmobile_reset_handler(struct notifier_block *this,
+static int rmobile_reset_handler(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
pr_debug("%s %lu\n", __func__, mode);
--- a/drivers/power/reset/st-poweroff.c
+++ b/drivers/power/reset/st-poweroff.c
@@ -39,7 +39,7 @@ static struct reset_syscfg stih407_reset = {
static struct reset_syscfg *st_restart_syscfg;
-static int st_restart(struct notifier_block *this, unsigned long mode,
+static int st_restart(struct notifier_block *nb, unsigned long mode,
void *cmd)
{
/* reset syscfg updated */
--- a/drivers/power/reset/syscon-reboot.c
+++ b/drivers/power/reset/syscon-reboot.c
@@ -23,11 +23,11 @@ struct syscon_reboot_context {
struct notifier_block restart_handler;
};
-static int syscon_restart_handle(struct notifier_block *this,
+static int syscon_restart_handle(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
struct syscon_reboot_context *ctx =
- container_of(this, struct syscon_reboot_context,
+ container_of(nb, struct syscon_reboot_context,
restart_handler);
/* Issue the reboot */
--- a/drivers/power/reset/vexpress-poweroff.c
+++ b/drivers/power/reset/vexpress-poweroff.c
@@ -37,7 +37,7 @@ static void vexpress_power_off(void)
static struct device *vexpress_restart_device;
-static int vexpress_restart(struct notifier_block *this, unsigned long mode,
+static int vexpress_restart(struct notifier_block *nb, unsigned long mode,
void *cmd)
{
vexpress_reset_do(vexpress_restart_device, "restart");
--- a/drivers/power/reset/xgene-reboot.c
+++ b/drivers/power/reset/xgene-reboot.c
@@ -27,11 +27,11 @@ struct xgene_reboot_context {
struct notifier_block restart_handler;
};
-static int xgene_restart_handler(struct notifier_block *this,
+static int xgene_restart_handler(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
struct xgene_reboot_context *ctx =
- container_of(this, struct xgene_reboot_context,
+ container_of(nb, struct xgene_reboot_context,
restart_handler);
/* Issue the reboot */
--- a/drivers/power/reset/zx-reboot.c
+++ b/drivers/power/reset/zx-reboot.c
@@ -18,7 +18,7 @@
static void __iomem *base;
static void __iomem *pcu_base;
-static int zx_restart_handler(struct notifier_block *this,
+static int zx_restart_handler(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
writel_relaxed(1, base + 0xb0);
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -571,7 +571,7 @@ static long ds1374_wdt_unlocked_ioctl(struct file *file, unsigned int cmd,
return ret;
}
-static int ds1374_wdt_notify_sys(struct notifier_block *this,
+static int ds1374_wdt_notify_sys(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -814,7 +814,7 @@ static int wdt_release(struct inode *inode, struct file *file)
/**
* notify_sys:
- * @this: our notifier block
+ * @nb: our notifier block
* @code: the event being reported
* @unused: unused
*
@@ -823,7 +823,7 @@ static int wdt_release(struct inode *inode, struct file *file)
* test or worse yet during the following fsck. This would suck, in fact
* trust me - if it happens it does suck.
*/
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+static int wdt_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -1000,7 +1000,7 @@ sclp_check_interface(void)
/* Reboot event handler. Reset send and receive mask to prevent pending SCLP
* events from interfering with rebooted system. */
static int
-sclp_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
+sclp_reboot_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
sclp_deactivate();
return NOTIFY_DONE;
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -1011,7 +1011,7 @@ static int __init setup_css(int nr)
return ret;
}
-static int css_reboot_event(struct notifier_block *this,
+static int css_reboot_event(struct notifier_block *nb,
unsigned long event,
void *ptr)
{
@@ -1040,7 +1040,7 @@ static struct notifier_block css_reboot_notifier = {
* path measurements via the normal suspend/resume callbacks, but have
* to use notifiers.
*/
-static int css_power_event(struct notifier_block *this, unsigned long event,
+static int css_power_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct channel_subsystem *css;
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -2179,7 +2179,7 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev)
return NULL;
}
-static int qeth_l3_ip_event(struct notifier_block *this,
+static int qeth_l3_ip_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
@@ -2205,7 +2205,7 @@ static struct notifier_block qeth_l3_ip_notifier = {
NULL,
};
-static int qeth_l3_ip6_event(struct notifier_block *this,
+static int qeth_l3_ip6_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -944,7 +944,7 @@ int tegra_pmc_cpu_remove_clamping(unsigned int cpuid)
return tegra_powergate_remove_clamping(id);
}
-static int tegra_pmc_restart_notify(struct notifier_block *this,
+static int tegra_pmc_restart_notify(struct notifier_block *nb,
unsigned long action, void *data)
{
const char *cmd = data;
--- a/drivers/spi/spi-sprd-adi.c
+++ b/drivers/spi/spi-sprd-adi.c
@@ -329,10 +329,10 @@ static void sprd_adi_set_wdt_rst_mode(struct sprd_adi *sadi)
#endif
}
-static int sprd_adi_restart_handler(struct notifier_block *this,
+static int sprd_adi_restart_handler(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
- struct sprd_adi *sadi = container_of(this, struct sprd_adi,
+ struct sprd_adi *sadi = container_of(nb, struct sprd_adi,
restart_handler);
u32 val, reboot_mode = 0;
--- a/drivers/watchdog/alim1535_wdt.c
+++ b/drivers/watchdog/alim1535_wdt.c
@@ -280,7 +280,7 @@ static int ali_release(struct inode *inode, struct file *file)
*/
-static int ali_notify_sys(struct notifier_block *this,
+static int ali_notify_sys(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/alim7101_wdt.c
+++ b/drivers/watchdog/alim7101_wdt.c
@@ -303,7 +303,7 @@ static struct miscdevice wdt_miscdev = {
.fops = &wdt_fops,
};
-static int wdt_restart_handle(struct notifier_block *this, unsigned long mode,
+static int wdt_restart_handle(struct notifier_block *nb, unsigned long mode,
void *cmd)
{
/*
@@ -329,7 +329,7 @@ static struct notifier_block wdt_restart_handler = {
* Notifier for system down
*/
-static int wdt_notify_sys(struct notifier_block *this,
+static int wdt_notify_sys(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/at91rm9200_wdt.c
+++ b/drivers/watchdog/at91rm9200_wdt.c
@@ -52,7 +52,7 @@ static unsigned long at91wdt_busy;
/* ......................................................................... */
-static int at91rm9200_restart(struct notifier_block *this,
+static int at91rm9200_restart(struct notifier_block *nb,
unsigned long mode, void *cmd)
{
/*
--- a/drivers/watchdog/diag288_wdt.c
+++ b/drivers/watchdog/diag288_wdt.c
@@ -247,7 +247,7 @@ static int wdt_resume(void)
return NOTIFY_DONE;
}
-static int wdt_power_event(struct notifier_block *this, unsigned long event,
+static int wdt_power_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
switch (event) {
--- a/drivers/watchdog/eurotechwdt.c
+++ b/drivers/watchdog/eurotechwdt.c
@@ -342,7 +342,7 @@ static int eurwdt_release(struct inode *inode, struct file *file)
/**
* eurwdt_notify_sys:
- * @this: our notifier block
+ * @nb: our notifier block
* @code: the event being reported
* @unused: unused
*
@@ -352,7 +352,7 @@ static int eurwdt_release(struct inode *inode, struct file *file)
* trust me - if it happens it does suck.
*/
-static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code,
+static int eurwdt_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/f71808e_wdt.c
+++ b/drivers/watchdog/f71808e_wdt.c
@@ -654,7 +654,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
}
}
-static int watchdog_notify_sys(struct notifier_block *this, unsigned long code,
+static int watchdog_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/indydog.c
+++ b/drivers/watchdog/indydog.c
@@ -138,7 +138,7 @@ static long indydog_ioctl(struct file *file, unsigned int cmd,
}
}
-static int indydog_notify_sys(struct notifier_block *this,
+static int indydog_notify_sys(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/intel_scu_watchdog.c
+++ b/drivers/watchdog/intel_scu_watchdog.c
@@ -394,7 +394,7 @@ static long intel_scu_ioctl(struct file *file,
/*
* Notifier for system down
*/
-static int intel_scu_notify_sys(struct notifier_block *this,
+static int intel_scu_notify_sys(struct notifier_block *nb,
unsigned long code,
void *another_unused)
{
--- a/drivers/watchdog/it8712f_wdt.c
+++ b/drivers/watchdog/it8712f_wdt.c
@@ -215,7 +215,7 @@ static int it8712f_wdt_disable(void)
return 0;
}
-static int it8712f_wdt_notify(struct notifier_block *this,
+static int it8712f_wdt_notify(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_HALT || code == SYS_POWER_OFF)
--- a/drivers/watchdog/machzwd.c
+++ b/drivers/watchdog/machzwd.c
@@ -348,7 +348,7 @@ static int zf_close(struct inode *inode, struct file *file)
* Notifier for system down
*/
-static int zf_notify_sys(struct notifier_block *this, unsigned long code,
+static int zf_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/pc87413_wdt.c
+++ b/drivers/watchdog/pc87413_wdt.c
@@ -446,7 +446,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd,
/**
* notify_sys:
- * @this: our notifier block
+ * @nb: our notifier block
* @code: the event being reported
* @unused: unused
*
@@ -456,7 +456,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd,
* trust me - if it happens it does suck.
*/
-static int pc87413_notify_sys(struct notifier_block *this,
+static int pc87413_notify_sys(struct notifier_block *nb,
unsigned long code,
void *unused)
{
--- a/drivers/watchdog/pcwd_pci.c
+++ b/drivers/watchdog/pcwd_pci.c
@@ -628,7 +628,7 @@ static int pcipcwd_temp_release(struct inode *inode, struct file *file)
* Notify system
*/
-static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code,
+static int pcipcwd_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -532,7 +532,7 @@ static int usb_pcwd_temperature_release(struct inode *inode, struct file *file)
* Notify system
*/
-static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code,
+static int usb_pcwd_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/pnx833x_wdt.c
+++ b/drivers/watchdog/pnx833x_wdt.c
@@ -201,7 +201,7 @@ static long pnx833x_wdt_ioctl(struct file *file, unsigned int cmd,
}
}
-static int pnx833x_wdt_notify_sys(struct notifier_block *this,
+static int pnx833x_wdt_notify_sys(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/sb_wdog.c
+++ b/drivers/watchdog/sb_wdog.c
@@ -218,7 +218,7 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd,
/*
* Notifier for system down
*/
-static int sbwdog_notify_sys(struct notifier_block *this, unsigned long code,
+static int sbwdog_notify_sys(struct notifier_block *nb, unsigned long code,
void *erf)
{
if (code == SYS_DOWN || code == SYS_HALT) {
--- a/drivers/watchdog/sbc60xxwdt.c
+++ b/drivers/watchdog/sbc60xxwdt.c
@@ -293,7 +293,7 @@ static struct miscdevice wdt_miscdev = {
* Notifier for system down
*/
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+static int wdt_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/sbc7240_wdt.c
+++ b/drivers/watchdog/sbc7240_wdt.c
@@ -223,7 +223,7 @@ static struct miscdevice wdt_miscdev = {
* Notifier for system down
*/
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+static int wdt_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/sbc8360.c
+++ b/drivers/watchdog/sbc8360.c
@@ -286,7 +286,7 @@ static int sbc8360_close(struct inode *inode, struct file *file)
* Notifier for system down
*/
-static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code,
+static int sbc8360_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/sbc_epx_c3.c
+++ b/drivers/watchdog/sbc_epx_c3.c
@@ -142,7 +142,7 @@ static long epx_c3_ioctl(struct file *file, unsigned int cmd,
}
}
-static int epx_c3_notify_sys(struct notifier_block *this, unsigned long code,
+static int epx_c3_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/sc1200wdt.c
+++ b/drivers/watchdog/sc1200wdt.c
@@ -288,7 +288,7 @@ static ssize_t sc1200wdt_write(struct file *file, const char __user *data,
}
-static int sc1200wdt_notify_sys(struct notifier_block *this,
+static int sc1200wdt_notify_sys(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/sc520_wdt.c
+++ b/drivers/watchdog/sc520_wdt.c
@@ -349,7 +349,7 @@ static struct miscdevice wdt_miscdev = {
* Notifier for system down
*/
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+static int wdt_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/scx200_wdt.c
+++ b/drivers/watchdog/scx200_wdt.c
@@ -114,7 +114,7 @@ static int scx200_wdt_release(struct inode *inode, struct file *file)
return 0;
}
-static int scx200_wdt_notify_sys(struct notifier_block *this,
+static int scx200_wdt_notify_sys(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_HALT || code == SYS_POWER_OFF)
--- a/drivers/watchdog/smsc37b787_wdt.c
+++ b/drivers/watchdog/smsc37b787_wdt.c
@@ -487,7 +487,7 @@ static long wb_smsc_wdt_ioctl(struct file *file,
/* -- Notifier funtions -----------------------------------------*/
-static int wb_smsc_wdt_notify_sys(struct notifier_block *this,
+static int wb_smsc_wdt_notify_sys(struct notifier_block *nb,
unsigned long code, void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT) {
--- a/drivers/watchdog/w83877f_wdt.c
+++ b/drivers/watchdog/w83877f_wdt.c
@@ -317,7 +317,7 @@ static struct miscdevice wdt_miscdev = {
* Notifier for system down
*/
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+static int wdt_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/w83977f_wdt.c
+++ b/drivers/watchdog/w83977f_wdt.c
@@ -433,7 +433,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
}
}
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+static int wdt_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/wafer5823wdt.c
+++ b/drivers/watchdog/wafer5823wdt.c
@@ -213,7 +213,7 @@ static int wafwdt_close(struct inode *inode, struct file *file)
* Notifier for system down
*/
-static int wafwdt_notify_sys(struct notifier_block *this, unsigned long code,
+static int wafwdt_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/wdrtas.c
+++ b/drivers/watchdog/wdrtas.c
@@ -456,7 +456,7 @@ static int wdrtas_temp_close(struct inode *inode, struct file *file)
*
* wdrtas_reboot stops the watchdog in case of a reboot
*/
-static int wdrtas_reboot(struct notifier_block *this,
+static int wdrtas_reboot(struct notifier_block *nb,
unsigned long code, void *ptr)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/wdt.c
+++ b/drivers/watchdog/wdt.c
@@ -495,7 +495,7 @@ static int wdt_temp_release(struct inode *inode, struct file *file)
/**
* notify_sys:
- * @this: our notifier block
+ * @nb: our notifier block
* @code: the event being reported
* @unused: unused
*
@@ -505,7 +505,7 @@ static int wdt_temp_release(struct inode *inode, struct file *file)
* trust me - if it happens it does suck.
*/
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+static int wdt_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/wdt977.c
+++ b/drivers/watchdog/wdt977.c
@@ -409,7 +409,7 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd,
}
}
-static int wdt977_notify_sys(struct notifier_block *this, unsigned long code,
+static int wdt977_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/drivers/watchdog/wdt_pci.c
+++ b/drivers/watchdog/wdt_pci.c
@@ -538,7 +538,7 @@ static int wdtpci_temp_release(struct inode *inode, struct file *file)
/**
* notify_sys:
- * @this: our notifier block
+ * @nb: our notifier block
* @code: the event being reported
* @unused: unused
*
@@ -548,7 +548,7 @@ static int wdtpci_temp_release(struct inode *inode, struct file *file)
* trust me - if it happens it does suck.
*/
-static int wdtpci_notify_sys(struct notifier_block *this, unsigned long code,
+static int wdtpci_notify_sys(struct notifier_block *nb, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT)
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -296,7 +296,7 @@ static void lockd_down_net(struct svc_serv *serv, struct net *net)
}
}
-static int lockd_inetaddr_event(struct notifier_block *this,
+static int lockd_inetaddr_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
@@ -326,7 +326,7 @@ static struct notifier_block lockd_inetaddr_notifier = {
};
#if IS_ENABLED(CONFIG_IPV6)
-static int lockd_inet6addr_event(struct notifier_block *this,
+static int lockd_inet6addr_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -436,7 +436,7 @@ static void nfsd_shutdown_net(struct net *net)
nfsd_shutdown_generic();
}
-static int nfsd_inetaddr_event(struct notifier_block *this, unsigned long event,
+static int nfsd_inetaddr_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
@@ -467,7 +467,7 @@ static struct notifier_block nfsd_inetaddr_notifier = {
};
#if IS_ENABLED(CONFIG_IPV6)
-static int nfsd_inet6addr_event(struct notifier_block *this,
+static int nfsd_inet6addr_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -985,7 +985,7 @@ void __init dbg_late_init(void)
}
static int
-dbg_notify_reboot(struct notifier_block *this, unsigned long code, void *x)
+dbg_notify_reboot(struct notifier_block *nb, unsigned long code, void *x)
{
/*
* Take the following action on reboot notify depending on value:
--- a/kernel/hung_task.c
+++ b/kernel/hung_task.c
@@ -73,7 +73,7 @@ unsigned int __read_mostly sysctl_hung_task_panic =
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE;
static int
-hung_task_panic(struct notifier_block *this, unsigned long event, void *ptr)
+hung_task_panic(struct notifier_block *nb, unsigned long event, void *ptr)
{
did_panic = 1;
--- a/kernel/rcu/tree_stall.h
+++ b/kernel/rcu/tree_stall.h
@@ -86,7 +86,7 @@ void rcu_sysrq_end(void)
}
/* Don't print RCU CPU stall warnings during a kernel panic. */
-static int rcu_panic(struct notifier_block *this, unsigned long ev, void *ptr)
+static int rcu_panic(struct notifier_block *nb, unsigned long ev, void *ptr)
{
rcu_cpu_stall_suppress = 1;
return NOTIFY_DONE;
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9095,7 +9095,7 @@ static __init int tracer_init_tracefs(void)
return 0;
}
-static int trace_panic_handler(struct notifier_block *this,
+static int trace_panic_handler(struct notifier_block *nb,
unsigned long event, void *unused)
{
if (ftrace_dump_on_oops)
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -324,7 +324,7 @@ static void aarp_expire_timeout(struct timer_list *unused)
}
/* Network device notifier chain handler. */
-static int aarp_device_event(struct notifier_block *this, unsigned long event,
+static int aarp_device_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -636,7 +636,7 @@ static inline void atalk_dev_down(struct net_device *dev)
* A device event has occurred. Watch for devices going down and
* delete our use of them (iface and route).
*/
-static int ddp_device_event(struct notifier_block *this, unsigned long event,
+static int ddp_device_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -144,7 +144,7 @@ static struct net_device *br2684_find_dev(const struct br2684_if_spec *s)
return NULL;
}
-static int atm_dev_event(struct notifier_block *this, unsigned long event,
+static int atm_dev_event(struct notifier_block *nb, unsigned long event,
void *arg)
{
struct atm_dev *atm_dev = arg;
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -542,7 +542,7 @@ static int clip_create(int number)
return number;
}
-static int clip_device_event(struct notifier_block *this, unsigned long event,
+static int clip_device_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
@@ -575,7 +575,7 @@ static int clip_device_event(struct notifier_block *this, unsigned long event,
return NOTIFY_DONE;
}
-static int clip_inet_event(struct notifier_block *this, unsigned long event,
+static int clip_inet_event(struct notifier_block *nb, unsigned long event,
void *ifa)
{
struct in_device *in_dev;
@@ -589,7 +589,7 @@ static int clip_inet_event(struct notifier_block *this, unsigned long event,
if (event != NETDEV_UP)
return NOTIFY_DONE;
netdev_notifier_info_init(&info, in_dev->dev);
- return clip_device_event(this, NETDEV_CHANGE, &info);
+ return clip_device_event(nb, NETDEV_CHANGE, &info);
}
static struct notifier_block clip_dev_notifier = {
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -106,7 +106,7 @@ static void ax25_kill_by_device(struct net_device *dev)
/*
* Handle device status changes.
*/
-static int ax25_device_event(struct notifier_block *this, unsigned long event,
+static int ax25_device_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -1017,7 +1017,7 @@ static int batadv_hard_if_event_softif(unsigned long event,
return NOTIFY_DONE;
}
-static int batadv_hard_if_event(struct notifier_block *this,
+static int batadv_hard_if_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);
--- a/net/core/failover.c
+++ b/net/core/failover.c
@@ -183,7 +183,7 @@ static int failover_slave_name_change(struct net_device *slave_dev)
}
static int
-failover_event(struct notifier_block *this, unsigned long event, void *ptr)
+failover_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -1194,7 +1194,7 @@ static void detach_rules(struct list_head *rules, struct net_device *dev)
}
-static int fib_rules_event(struct notifier_block *this, unsigned long event,
+static int fib_rules_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -5490,7 +5490,7 @@ static int rtnetlink_bind(struct net *net, int group)
return 0;
}
-static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int rtnetlink_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -2076,7 +2076,7 @@ static int dn_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
return err;
}
-static int dn_device_event(struct notifier_block *this, unsigned long event,
+static int dn_device_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -672,7 +672,7 @@ static void dn_fib_disable_addr(struct net_device *dev, int force)
neigh_ifdown(&dn_neigh_table, dev);
}
-static int dn_fib_dnaddr_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int dn_fib_dnaddr_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
struct dn_ifaddr *ifa = (struct dn_ifaddr *)ptr;
--- a/net/ethtool/netlink.c
+++ b/net/ethtool/netlink.c
@@ -666,7 +666,7 @@ static void ethnl_notify_features(struct netdev_notifier_info *info)
ethtool_notify(dev, ETHTOOL_MSG_FEATURES_NTF, NULL);
}
-static int ethnl_netdev_event(struct notifier_block *this, unsigned long event,
+static int ethnl_netdev_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
switch (event) {
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1236,7 +1236,7 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg)
return err;
}
-static int arp_netdev_event(struct notifier_block *this, unsigned long event,
+static int arp_netdev_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1518,7 +1518,7 @@ static void inetdev_send_gratuitous_arp(struct net_device *dev,
/* Called only under RTNL semaphore */
-static int inetdev_event(struct notifier_block *this, unsigned long event,
+static int inetdev_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1408,7 +1408,7 @@ static void fib_disable_ip(struct net_device *dev, unsigned long event,
arp_ifdown(dev);
}
-static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int fib_inetaddr_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
struct net_device *dev = ifa->ifa_dev->dev;
@@ -1439,7 +1439,7 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
return NOTIFY_DONE;
}
-static int fib_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int fib_netdev_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct netdev_notifier_changeupper_info *upper_info = ptr;
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -3034,7 +3034,7 @@ static struct pernet_operations igmp_net_ops = {
};
#endif
-static int igmp_netdev_event(struct notifier_block *this,
+static int igmp_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1709,7 +1709,7 @@ int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
}
#endif
-static int ipmr_device_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int ipmr_device_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct net *net = dev_net(dev);
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -185,7 +185,7 @@ clusterip_config_init_nodelist(struct clusterip_config *c,
}
static int
-clusterip_netdev_event(struct notifier_block *this, unsigned long event,
+clusterip_netdev_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/ipv4/nexthop.c
+++ b/net/ipv4/nexthop.c
@@ -1891,7 +1891,7 @@ static void nexthop_sync_mtu(struct net_device *dev, u32 orig_mtu)
}
/* rtnl */
-static int nh_netdev_event(struct notifier_block *this,
+static int nh_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3445,7 +3445,7 @@ static void addrconf_permanent_addr(struct net *net, struct net_device *dev)
write_unlock_bh(&idev->lock);
}
-static int addrconf_notify(struct notifier_block *this, unsigned long event,
+static int addrconf_notify(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1230,7 +1230,7 @@ static int ip6mr_mfc_delete(struct mr_table *mrt, struct mf6cctl *mfc,
return 0;
}
-static int ip6mr_device_event(struct notifier_block *this,
+static int ip6mr_device_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2637,7 +2637,7 @@ static void ipv6_mc_rejoin_groups(struct inet6_dev *idev)
mld_send_report(idev, NULL);
}
-static int ipv6_mc_netdev_event(struct notifier_block *this,
+static int ipv6_mc_netdev_event(struct notifier_block *nb,
unsigned long event,
void *ptr)
{
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1772,7 +1772,7 @@ int ndisc_rcv(struct sk_buff *skb)
return 0;
}
-static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int ndisc_netdev_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct netdev_notifier_change_info *change_info;
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -6058,7 +6058,7 @@ void fib6_rt_update(struct net *net, struct fib6_info *rt,
rtnl_set_sk_err(net, RTNLGRP_IPV6_ROUTE, err);
}
-static int ip6_route_dev_notify(struct notifier_block *this,
+static int ip6_route_dev_notify(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -2203,7 +2203,7 @@ static void afiucv_hs_callback_txnotify(struct sk_buff *skb,
/*
* afiucv_netdev_event: handle netdev notifier chain events
*/
-static int afiucv_netdev_event(struct notifier_block *this,
+static int afiucv_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -776,7 +776,7 @@ void iucv_unregister(struct iucv_handler *handler, int smp)
}
EXPORT_SYMBOL(iucv_unregister);
-static int iucv_reboot_event(struct notifier_block *this,
+static int iucv_reboot_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
int i;
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -1576,7 +1576,7 @@ static void mpls_ifup(struct net_device *dev, unsigned int flags)
}
}
-static int mpls_dev_notify(struct notifier_block *this, unsigned long event,
+static int mpls_dev_notify(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1647,7 +1647,7 @@ ip_vs_forget_dev(struct ip_vs_dest *dest, struct net_device *dev)
/* Netdev event receiver
* Currently only NETDEV_DOWN is handled to release refs to cached dsts
*/
-static int ip_vs_dst_event(struct notifier_block *this, unsigned long event,
+static int ip_vs_dst_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/netfilter/nf_nat_masquerade.c
+++ b/net/netfilter/nf_nat_masquerade.c
@@ -72,7 +72,7 @@ static int device_cmp(struct nf_conn *i, void *ifindex)
return nat->masq_index == (int)(long)ifindex;
}
-static int masq_device_event(struct notifier_block *this,
+static int masq_device_event(struct notifier_block *nb,
unsigned long event,
void *ptr)
{
@@ -106,7 +106,7 @@ static int inet_cmp(struct nf_conn *ct, void *ptr)
return ifa->ifa_address == tuple->dst.u3.ip;
}
-static int masq_inet_event(struct notifier_block *this,
+static int masq_inet_event(struct notifier_block *nb,
unsigned long event,
void *ptr)
{
@@ -228,7 +228,7 @@ static void iterate_cleanup_work(struct work_struct *work)
* As we can have 'a lot' of inet_events (depending on amount of ipv6
* addresses being deleted), we also need to limit work item queue.
*/
-static int masq_inet6_event(struct notifier_block *this,
+static int masq_inet6_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct inet6_ifaddr *ifa = ptr;
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -6960,7 +6960,7 @@ static void nft_flowtable_event(unsigned long event, struct net_device *dev,
}
}
-static int nf_tables_flowtable_event(struct notifier_block *this,
+static int nf_tables_flowtable_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/netfilter/nf_tables_offload.c
+++ b/net/netfilter/nf_tables_offload.c
@@ -556,7 +556,7 @@ static struct nft_chain *__nft_offload_get_chain(struct net_device *dev)
return NULL;
}
-static int nft_offload_netdev_event(struct notifier_block *this,
+static int nft_offload_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -815,7 +815,7 @@ nfulnl_log_packet(struct net *net,
}
static int
-nfulnl_rcv_nl_event(struct notifier_block *this,
+nfulnl_rcv_nl_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct netlink_notify *n = ptr;
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -933,7 +933,7 @@ nfqnl_dev_drop(struct net *net, int ifindex)
}
static int
-nfqnl_rcv_dev_event(struct notifier_block *this,
+nfqnl_rcv_dev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
@@ -963,7 +963,7 @@ static void nfqnl_nf_hook_drop(struct net *net)
}
static int
-nfqnl_rcv_nl_event(struct notifier_block *this,
+nfqnl_rcv_nl_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct netlink_notify *n = ptr;
--- a/net/netfilter/nft_chain_filter.c
+++ b/net/netfilter/nft_chain_filter.c
@@ -318,7 +318,7 @@ static void nft_netdev_event(unsigned long event, struct net_device *dev,
__nft_release_basechain(ctx);
}
-static int nf_tables_netdev_event(struct notifier_block *this,
+static int nf_tables_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/netfilter/nft_flow_offload.c
+++ b/net/netfilter/nft_flow_offload.c
@@ -237,7 +237,7 @@ static struct nft_expr_type nft_flow_offload_type __read_mostly = {
.owner = THIS_MODULE,
};
-static int flow_offload_netdev_event(struct notifier_block *this,
+static int flow_offload_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/netfilter/xt_TEE.c
+++ b/net/netfilter/xt_TEE.c
@@ -57,7 +57,7 @@ tee_tg6(struct sk_buff *skb, const struct xt_action_param *par)
}
#endif
-static int tee_netdev_event(struct notifier_block *this, unsigned long event,
+static int tee_netdev_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -686,7 +686,7 @@ int netlbl_unlhsh_remove(struct net *net,
/**
* netlbl_unlhsh_netdev_handler - Network device notification handler
- * @this: notifier block
+ * @nb: notifier block
* @event: the event
* @ptr: the netdevice notifier info (cast to void)
*
@@ -696,7 +696,7 @@ int netlbl_unlhsh_remove(struct net *net,
* related entries from the unlabeled connection hash table.
*
*/
-static int netlbl_unlhsh_netdev_handler(struct notifier_block *this,
+static int netlbl_unlhsh_netdev_handler(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -112,7 +112,7 @@ static void nr_kill_by_device(struct net_device *dev)
/*
* Handle device status changes.
*/
-static int nr_device_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int nr_device_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -1806,7 +1806,7 @@ static void nfc_urelease_event_work(struct work_struct *work)
kfree(w);
}
-static int nfc_genl_rcv_nl_event(struct notifier_block *this,
+static int nfc_genl_rcv_nl_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct netlink_notify *n = ptr;
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4062,7 +4062,7 @@ static int compat_packet_setsockopt(struct socket *sock, int level, int optname,
}
#endif
-static int packet_notifier(struct notifier_block *this,
+static int packet_notifier(struct notifier_block *nb,
unsigned long msg, void *ptr)
{
struct sock *sk;
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -200,7 +200,7 @@ static void rose_kill_by_device(struct net_device *dev)
/*
* Handle device status changes.
*/
-static int rose_device_event(struct notifier_block *this,
+static int rose_device_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -71,7 +71,7 @@ static int sctp_v6_cmp_addr(const union sctp_addr *addr1,
* time and thus corrupt the list.
* The reader side is protected with RCU.
*/
-static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
+static int sctp_inet6addr_event(struct notifier_block *nb, unsigned long ev,
void *ptr)
{
struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -766,7 +766,7 @@ void sctp_addr_wq_mgmt(struct net *net, struct sctp_sockaddr_entry *addr, int cm
* time and thus corrupt the list.
* The reader side is protected with RCU.
*/
-static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
+static int sctp_inetaddr_event(struct notifier_block *nb, unsigned long ev,
void *ptr)
{
struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -1986,7 +1986,7 @@ static void smc_lgrs_shutdown(void)
spin_unlock(&smcd_dev_list.lock);
}
-static int smc_core_reboot_event(struct notifier_block *this,
+static int smc_core_reboot_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
smc_lgrs_shutdown();
--- a/net/smc/smc_pnet.c
+++ b/net/smc/smc_pnet.c
@@ -707,7 +707,7 @@ static struct genl_family smc_pnet_nl_family __ro_after_init = {
.n_ops = ARRAY_SIZE(smc_pnet_ops)
};
-static int smc_pnet_netdev_event(struct notifier_block *this,
+static int smc_pnet_netdev_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -1245,7 +1245,7 @@ static int tls_device_down(struct net_device *netdev)
return NOTIFY_DONE;
}
-static int tls_dev_event(struct notifier_block *this, unsigned long event,
+static int tls_dev_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -218,11 +218,11 @@ static void x25_kill_by_device(struct net_device *dev)
/*
* Handle device status changes.
*/
-static int x25_device_event(struct notifier_block *this, unsigned long event,
+static int x25_device_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
- struct x25_neigh *nb;
+ struct x25_neigh *neigh;
if (!net_eq(dev_net(dev), &init_net))
return NOTIFY_DONE;
@@ -237,10 +237,10 @@ static int x25_device_event(struct notifier_block *this, unsigned long event,
x25_link_device_up(dev);
break;
case NETDEV_GOING_DOWN:
- nb = x25_get_neigh(dev);
- if (nb) {
- x25_terminate_link(nb);
- x25_neigh_put(nb);
+ neigh = x25_get_neigh(dev);
+ if (neigh) {
+ x25_terminate_link(neigh);
+ x25_neigh_put(neigh);
}
break;
case NETDEV_DOWN:
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -972,7 +972,7 @@ static int xsk_mmap(struct file *file, struct socket *sock,
size, vma->vm_page_prot);
}
-static int xsk_notifier(struct notifier_block *this,
+static int xsk_notifier(struct notifier_block *nb,
unsigned long msg, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -395,7 +395,7 @@ static int xfrm_dev_down(struct net_device *dev)
return NOTIFY_DONE;
}
-static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
+static int xfrm_dev_event(struct notifier_block *nb, unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--- a/security/selinux/netif.c
+++ b/security/selinux/netif.c
@@ -247,7 +247,7 @@ void sel_netif_flush(void)
spin_unlock_bh(&sel_netif_lock);
}
-static int sel_netif_netdev_notifier_handler(struct notifier_block *this,
+static int sel_netif_netdev_notifier_handler(struct notifier_block *nb,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
^ permalink raw reply
* Re: [Patch net] cgroup: fix cgroup_sk_alloc() for sk_clone_lock()
From: Cong Wang @ 2020-06-18 21:09 UTC (permalink / raw)
To: Roman Gushchin
Cc: Zefan Li, Linux Kernel Network Developers, Cameron Berkenpas,
Peter Geis, Lu Fengqi, Daniël Sonck, Daniel Borkmann,
Tejun Heo
In-Reply-To: <20200618193611.GE24694@carbon.DHCP.thefacebook.com>
On Thu, Jun 18, 2020 at 12:36 PM Roman Gushchin <guro@fb.com> wrote:
>
> On Thu, Jun 18, 2020 at 12:19:13PM -0700, Cong Wang wrote:
> > On Wed, Jun 17, 2020 at 6:44 PM Zefan Li <lizefan@huawei.com> wrote:
> > >
> > > Cc: Roman Gushchin <guro@fb.com>
> > >
> > > Thanks for fixing this.
> > >
> > > On 2020/6/17 2:03, Cong Wang wrote:
> > > > When we clone a socket in sk_clone_lock(), its sk_cgrp_data is
> > > > copied, so the cgroup refcnt must be taken too. And, unlike the
> > > > sk_alloc() path, sock_update_netprioidx() is not called here.
> > > > Therefore, it is safe and necessary to grab the cgroup refcnt
> > > > even when cgroup_sk_alloc is disabled.
> > > >
> > > > sk_clone_lock() is in BH context anyway, the in_interrupt()
> > > > would terminate this function if called there. And for sk_alloc()
> > > > skcd->val is always zero. So it's safe to factor out the code
> > > > to make it more readable.
> > > >
> > > > Fixes: 090e28b229af92dc5b ("netprio_cgroup: Fix unlimited memory leak of v2 cgroups")
> > >
> > > but I don't think the bug was introduced by this commit, because there
> > > are already calls to cgroup_sk_alloc_disable() in write_priomap() and
> > > write_classid(), which can be triggered by writing to ifpriomap or
> > > classid in cgroupfs. This commit just made it much easier to happen
> > > with systemd invovled.
> > >
> > > I think it's 4bfc0bb2c60e2f4c ("bpf: decouple the lifetime of cgroup_bpf from cgroup itself"),
> > > which added cgroup_bpf_get() in cgroup_sk_alloc().
> >
> > Good point.
> >
> > I take a deeper look, it looks like commit d979a39d7242e06
> > is the one to blame, because it is the first commit that began to
> > hold cgroup refcnt in cgroup_sk_alloc().
>
> I agree, ut seems that the issue is not related to bpf and probably
> can be reproduced without CONFIG_CGROUP_BPF. d979a39d7242e06 indeed
> seems closer to the origin.
Yeah, I will update the Fixes tag and send V2.
>
> Btw, based on the number of reported-by tags it seems that there was
> a real issue which the patch is fixing. Maybe you'll a couple of words
> about how it reveals itself in the real life?
I still have no idea how exactly this is triggered. According to the
people who reported this bug, they just need to wait for some hours
to trigger. So I am not sure what to add here, just the stack trace?
Thanks.
^ permalink raw reply
* [PATCH net-next v8 0/5] RGMII Internal delay common property
From: Dan Murphy @ 2020-06-18 21:10 UTC (permalink / raw)
To: andrew, f.fainelli, hkallweit1, davem, robh
Cc: netdev, linux-kernel, devicetree, Dan Murphy
Hello
The RGMII internal delay is a common setting found in most RGMII capable PHY
devices. It was found that many vendor specific device tree properties exist
to do the same function. This creates a common property to be used for PHY's
that have internal delays for the Rx and Tx paths.
If the internal delay is tunable then the caller needs to pass the internal
delay array and the return will be the index in the array that was found in
the firmware node.
If the internal delay is fixed then the caller only needs to indicate which
delay to return. There is no need for a fixed delay to add device properties
since the value is not configurable. Per the ethernet-controller.yaml the
interface type indicates that the PHY should provide the delay.
This series contains examples of both a configurable delay and a fixed delay.
Dan Murphy (5):
dt-bindings: net: Add tx and rx internal delays
net: phy: Add a helper to return the index for of the internal delay
dt-bindings: net: Add RGMII internal delay for DP83869
net: dp83869: Add RGMII internal delay configuration
net: phy: DP83822: Add setting the fixed internal delay
.../devicetree/bindings/net/ethernet-phy.yaml | 13 +++
.../devicetree/bindings/net/ti,dp83869.yaml | 16 ++-
drivers/net/phy/dp83822.c | 78 ++++++++++++--
drivers/net/phy/dp83869.c | 53 +++++++++-
drivers/net/phy/phy_device.c | 100 ++++++++++++++++++
include/linux/phy.h | 4 +
6 files changed, 250 insertions(+), 14 deletions(-)
--
2.26.2
^ permalink raw reply
* [PATCH net-next v8 1/5] dt-bindings: net: Add tx and rx internal delays
From: Dan Murphy @ 2020-06-18 21:10 UTC (permalink / raw)
To: andrew, f.fainelli, hkallweit1, davem, robh
Cc: netdev, linux-kernel, devicetree, Dan Murphy
In-Reply-To: <20200618211011.28837-1-dmurphy@ti.com>
tx-internal-delays and rx-internal-delays are a common setting for RGMII
capable devices.
These properties are used when the phy-mode or phy-controller is set to
rgmii-id, rgmii-rxid or rgmii-txid. These modes indicate to the
controller that the PHY will add the internal delay for the connection.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
.../devicetree/bindings/net/ethernet-phy.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
index 9b1f1147ca36..7d8265eb49d6 100644
--- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
@@ -162,6 +162,19 @@ properties:
description:
Specifies a reference to a node representing a SFP cage.
+
+ rx-internal-delay-ps:
+ description: |
+ RGMII Receive PHY Clock Delay defined in pico seconds. This is used for
+ PHY's that have configurable RX internal delays. If this property is
+ present then the PHY applies the RX delay.
+
+ tx-internal-delay-ps:
+ description: |
+ RGMII Transmit PHY Clock Delay defined in pico seconds. This is used for
+ PHY's that have configurable TX internal delays. If this property is
+ present then the PHY applies the TX delay.
+
required:
- reg
--
2.26.2
^ permalink raw reply related
* [PATCH net-next v8 2/5] net: phy: Add a helper to return the index for of the internal delay
From: Dan Murphy @ 2020-06-18 21:10 UTC (permalink / raw)
To: andrew, f.fainelli, hkallweit1, davem, robh
Cc: netdev, linux-kernel, devicetree, Dan Murphy
In-Reply-To: <20200618211011.28837-1-dmurphy@ti.com>
Add a helper function that will return the index in the array for the
passed in internal delay value. The helper requires the array, size and
delay value.
The helper will then return the index for the exact match or return the
index for the index to the closest smaller value.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
v8 - I did a considerable amount of rework on this patch. First the device_property
calls needed to be wrapped in IS_ENABLED (CONFIG_OF_MDIO). Next if the PHY has
a fixed delay like the DP83822 with a bit to turn the delay on and off then
having a device tree property was a bit to much. The device property should be
used for configurable delays. If the PHY had a fixed delay then the PHY
interface type was good enough to tell the PHY to turn on the delay for the path.
This helper was tested on both the DP83869 and DP83822 devices.
drivers/net/phy/phy_device.c | 100 +++++++++++++++++++++++++++++++++++
include/linux/phy.h | 4 ++
2 files changed, 104 insertions(+)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 04946de74fa0..55f9953bcd1d 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -31,6 +31,7 @@
#include <linux/mdio.h>
#include <linux/io.h>
#include <linux/uaccess.h>
+#include <linux/property.h>
MODULE_DESCRIPTION("PHY library");
MODULE_AUTHOR("Andy Fleming");
@@ -2657,6 +2658,105 @@ void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause)
}
EXPORT_SYMBOL(phy_get_pause);
+#if IS_ENABLED(CONFIG_OF_MDIO)
+static int phy_get_int_delay_property(struct device *dev, const char *name)
+{
+ s32 int_delay;
+ int ret;
+
+ ret = device_property_read_u32(dev, name, &int_delay);
+ if (ret)
+ return ret;
+
+ return int_delay;
+}
+#else
+static inline int phy_get_int_delay_property(struct device *dev,
+ const char *name)
+{
+ return -EINVAL
+}
+#endif
+
+/**
+ * phy_get_delay_index - returns the index of the internal delay
+ * @phydev: phy_device struct
+ * @dev: pointer to the devices device struct
+ * @delay_values: array of delays the PHY supports
+ * @size: the size of the delay array
+ * @is_rx: boolean to indicate to get the rx internal delay
+ *
+ * Returns the index within the array of internal delay passed in.
+ * If the device property is not present then the interface type is checked
+ * if the interface defines use of internal delay then a 1 is returned otherwise
+ * a 0 is returned.
+ * The array must be in ascending order. If PHY does not have an ascending order
+ * array then size = 0 and the value of the delay property is returned.
+ * Return -EINVAL if the delay is invalid or cannot be found.
+ */
+s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,
+ const int *delay_values, int size, bool is_rx)
+{
+ int i;
+ s32 delay;
+
+ if (is_rx) {
+ delay = phy_get_int_delay_property(dev, "rx-internal-delay-ps");
+ if (delay < 0 && size == 0) {
+ if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
+ phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
+ return 1;
+ else
+ return 0;
+ }
+
+ } else {
+ delay = phy_get_int_delay_property(dev, "tx-internal-delay-ps");
+ if (delay < 0 && size == 0) {
+ if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
+ phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
+ return 1;
+ else
+ return 0;
+ }
+ }
+
+ if (delay < 0)
+ return delay;
+
+ if (delay && size == 0)
+ return delay;
+
+ if (delay < delay_values[0] || delay > delay_values[size - 1]) {
+ phydev_err(phydev, "Delay %d is out of range\n", delay);
+ return -EINVAL;
+ }
+
+ if (delay == delay_values[0])
+ return 0;
+
+ for (i = 1; i < size; i++) {
+ if (delay == delay_values[i])
+ return i;
+
+ /* Find an approximate index by looking up the table */
+ if (delay > delay_values[i - 1] &&
+ delay < delay_values[i]) {
+ if (delay - delay_values[i - 1] <
+ delay_values[i] - delay)
+ return i - 1;
+ else
+ return i;
+ }
+ }
+
+ phydev_err(phydev, "error finding internal delay index for %d\n",
+ delay);
+
+ return -EINVAL;
+}
+EXPORT_SYMBOL(phy_get_internal_delay);
+
static bool phy_drv_supports_irq(struct phy_driver *phydrv)
{
return phydrv->config_intr && phydrv->ack_interrupt;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 8c05d0fb5c00..917bfd422e06 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1430,6 +1430,10 @@ void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx);
bool phy_validate_pause(struct phy_device *phydev,
struct ethtool_pauseparam *pp);
void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause);
+
+s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,
+ const int *delay_values, int size, bool is_rx);
+
void phy_resolve_pause(unsigned long *local_adv, unsigned long *partner_adv,
bool *tx_pause, bool *rx_pause);
--
2.26.2
^ permalink raw reply related
* [PATCH net-next v8 3/5] dt-bindings: net: Add RGMII internal delay for DP83869
From: Dan Murphy @ 2020-06-18 21:10 UTC (permalink / raw)
To: andrew, f.fainelli, hkallweit1, davem, robh
Cc: netdev, linux-kernel, devicetree, Dan Murphy
In-Reply-To: <20200618211011.28837-1-dmurphy@ti.com>
Add the internal delay values into the header and update the binding
with the internal delay properties.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
.../devicetree/bindings/net/ti,dp83869.yaml | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/ti,dp83869.yaml b/Documentation/devicetree/bindings/net/ti,dp83869.yaml
index 5b69ef03bbf7..71e90a3e4652 100644
--- a/Documentation/devicetree/bindings/net/ti,dp83869.yaml
+++ b/Documentation/devicetree/bindings/net/ti,dp83869.yaml
@@ -8,7 +8,7 @@ $schema: "http://devicetree.org/meta-schemas/core.yaml#"
title: TI DP83869 ethernet PHY
allOf:
- - $ref: "ethernet-controller.yaml#"
+ - $ref: "ethernet-phy.yaml#"
maintainers:
- Dan Murphy <dmurphy@ti.com>
@@ -64,6 +64,18 @@ properties:
Operational mode for the PHY. If this is not set then the operational
mode is set by the straps. see dt-bindings/net/ti-dp83869.h for values
+ rx-internal-delay-ps:
+ description: Delay is in pico seconds
+ enum: [ 250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000,
+ 3250, 3500, 3750, 4000 ]
+ default: 2000
+
+ tx-internal-delay-ps:
+ description: Delay is in pico seconds
+ enum: [ 250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000,
+ 3250, 3500, 3750, 4000 ]
+ default: 2000
+
required:
- reg
@@ -80,5 +92,7 @@ examples:
ti,op-mode = <DP83869_RGMII_COPPER_ETHERNET>;
ti,max-output-impedance = "true";
ti,clk-output-sel = <DP83869_CLK_O_SEL_CHN_A_RCLK>;
+ rx-internal-delay-ps = <2000>;
+ tx-internal-delay-ps = <2000>;
};
};
--
2.26.2
^ permalink raw reply related
* [PATCH net-next v8 4/5] net: dp83869: Add RGMII internal delay configuration
From: Dan Murphy @ 2020-06-18 21:10 UTC (permalink / raw)
To: andrew, f.fainelli, hkallweit1, davem, robh
Cc: netdev, linux-kernel, devicetree, Dan Murphy
In-Reply-To: <20200618211011.28837-1-dmurphy@ti.com>
Add RGMII internal delay configuration for Rx and Tx.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
drivers/net/phy/dp83869.c | 53 ++++++++++++++++++++++++++++++++++++---
1 file changed, 50 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
index 53ed3abc26c9..21b7d3de14a9 100644
--- a/drivers/net/phy/dp83869.c
+++ b/drivers/net/phy/dp83869.c
@@ -64,6 +64,10 @@
#define DP83869_RGMII_TX_CLK_DELAY_EN BIT(1)
#define DP83869_RGMII_RX_CLK_DELAY_EN BIT(0)
+/* RGMIIDCTL */
+#define DP83869_RGMII_CLK_DELAY_SHIFT 4
+#define DP83869_CLK_DELAY_DEF 7
+
/* STRAP_STS1 bits */
#define DP83869_STRAP_OP_MODE_MASK GENMASK(2, 0)
#define DP83869_STRAP_STS1_RESERVED BIT(11)
@@ -78,9 +82,6 @@
#define DP83869_PHYCR_FIFO_DEPTH_MASK GENMASK(15, 12)
#define DP83869_PHYCR_RESERVED_MASK BIT(11)
-/* RGMIIDCTL bits */
-#define DP83869_RGMII_TX_CLK_DELAY_SHIFT 4
-
/* IO_MUX_CFG bits */
#define DP83869_IO_MUX_CFG_IO_IMPEDANCE_CTRL 0x1f
@@ -99,6 +100,10 @@
#define DP83869_OP_MODE_MII BIT(5)
#define DP83869_SGMII_RGMII_BRIDGE BIT(6)
+static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500,
+ 1750, 2000, 2250, 2500, 2750, 3000,
+ 3250, 3500, 3750, 4000};
+
enum {
DP83869_PORT_MIRRORING_KEEP,
DP83869_PORT_MIRRORING_EN,
@@ -108,6 +113,8 @@ enum {
struct dp83869_private {
int tx_fifo_depth;
int rx_fifo_depth;
+ s32 rx_int_delay;
+ s32 tx_int_delay;
int io_impedance;
int port_mirroring;
bool rxctrl_strap_quirk;
@@ -182,6 +189,7 @@ static int dp83869_of_init(struct phy_device *phydev)
struct dp83869_private *dp83869 = phydev->priv;
struct device *dev = &phydev->mdio.dev;
struct device_node *of_node = dev->of_node;
+ int delay_size = ARRAY_SIZE(dp83869_internal_delay);
int ret;
if (!of_node)
@@ -235,6 +243,20 @@ static int dp83869_of_init(struct phy_device *phydev)
&dp83869->tx_fifo_depth))
dp83869->tx_fifo_depth = DP83869_PHYCR_FIFO_DEPTH_4_B_NIB;
+ dp83869->rx_int_delay = phy_get_internal_delay(phydev, dev,
+ &dp83869_internal_delay[0],
+ delay_size, true);
+ if (dp83869->rx_int_delay < 0)
+ dp83869->rx_int_delay =
+ dp83869_internal_delay[DP83869_CLK_DELAY_DEF];
+
+ dp83869->tx_int_delay = phy_get_internal_delay(phydev, dev,
+ &dp83869_internal_delay[0],
+ delay_size, false);
+ if (dp83869->tx_int_delay < 0)
+ dp83869->tx_int_delay =
+ dp83869_internal_delay[DP83869_CLK_DELAY_DEF];
+
return ret;
}
#else
@@ -397,6 +419,31 @@ static int dp83869_config_init(struct phy_device *phydev)
dp83869->clk_output_sel <<
DP83869_IO_MUX_CFG_CLK_O_SEL_SHIFT);
+ if (phy_interface_is_rgmii(phydev)) {
+ ret = phy_write_mmd(phydev, DP83869_DEVADDR, DP83869_RGMIIDCTL,
+ dp83869->rx_int_delay |
+ dp83869->tx_int_delay << DP83869_RGMII_CLK_DELAY_SHIFT);
+ if (ret)
+ return ret;
+
+ val = phy_read_mmd(phydev, DP83869_DEVADDR, DP83869_RGMIICTL);
+ val &= ~(DP83869_RGMII_TX_CLK_DELAY_EN |
+ DP83869_RGMII_RX_CLK_DELAY_EN);
+
+ if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+ val |= (DP83869_RGMII_TX_CLK_DELAY_EN |
+ DP83869_RGMII_RX_CLK_DELAY_EN);
+
+ if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
+ val |= DP83869_RGMII_TX_CLK_DELAY_EN;
+
+ if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
+ val |= DP83869_RGMII_RX_CLK_DELAY_EN;
+
+ ret = phy_write_mmd(phydev, DP83869_DEVADDR, DP83869_RGMIICTL,
+ val);
+ }
+
return ret;
}
--
2.26.2
^ permalink raw reply related
* [PATCH net-next v8 5/5] net: phy: DP83822: Add setting the fixed internal delay
From: Dan Murphy @ 2020-06-18 21:10 UTC (permalink / raw)
To: andrew, f.fainelli, hkallweit1, davem, robh
Cc: netdev, linux-kernel, devicetree, Dan Murphy
In-Reply-To: <20200618211011.28837-1-dmurphy@ti.com>
The DP83822 can be configured to use the RGMII interface. There are
independent fixed 3.5ns clock shift (aka internal delay) for the TX and RX
paths. This allow either one to be set if the MII interface is RGMII and
the value is set in the firmware node.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
drivers/net/phy/dp83822.c | 78 ++++++++++++++++++++++++++++++++++-----
1 file changed, 68 insertions(+), 10 deletions(-)
diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c
index 1dd19d0cb269..0fe91119d57f 100644
--- a/drivers/net/phy/dp83822.c
+++ b/drivers/net/phy/dp83822.c
@@ -26,7 +26,9 @@
#define MII_DP83822_PHYSCR 0x11
#define MII_DP83822_MISR1 0x12
#define MII_DP83822_MISR2 0x13
+#define MII_DP83822_RCSR 0x17
#define MII_DP83822_RESET_CTRL 0x1f
+#define MII_DP83822_GENCFG 0x465
#define DP83822_HW_RESET BIT(15)
#define DP83822_SW_RESET BIT(14)
@@ -77,6 +79,10 @@
#define DP83822_WOL_INDICATION_SEL BIT(8)
#define DP83822_WOL_CLR_INDICATION BIT(11)
+/* RSCR bits */
+#define DP83822_RX_CLK_SHIFT BIT(12)
+#define DP83822_TX_CLK_SHIFT BIT(11)
+
static int dp83822_ack_interrupt(struct phy_device *phydev)
{
int err;
@@ -255,7 +261,7 @@ static int dp83822_config_intr(struct phy_device *phydev)
return phy_write(phydev, MII_DP83822_PHYSCR, physcr_status);
}
-static int dp83822_config_init(struct phy_device *phydev)
+static int dp8382x_disable_wol(struct phy_device *phydev)
{
int value = DP83822_WOL_EN | DP83822_WOL_MAGIC_EN |
DP83822_WOL_SECURE_ON;
@@ -264,6 +270,45 @@ static int dp83822_config_init(struct phy_device *phydev)
MII_DP83822_WOL_CFG, value);
}
+static int dp83822_config_init(struct phy_device *phydev)
+{
+ struct device *dev = &phydev->mdio.dev;
+ int rgmii_delay;
+ s32 rx_int_delay;
+ s32 tx_int_delay;
+ int err = 0;
+
+ if (phy_interface_is_rgmii(phydev)) {
+ rx_int_delay = phy_get_internal_delay(phydev, dev, NULL, 0,
+ true);
+ if (rx_int_delay <= 0)
+ rx_int_delay = 0;
+ else
+ rgmii_delay = DP83822_RX_CLK_SHIFT;
+
+ tx_int_delay = phy_get_internal_delay(phydev, dev, NULL, 0,
+ false);
+ if (tx_int_delay <= 0)
+ tx_int_delay = 0;
+ else
+ rgmii_delay |= DP83822_TX_CLK_SHIFT;
+
+ if (rgmii_delay) {
+ err = phy_set_bits_mmd(phydev, DP83822_DEVADDR,
+ MII_DP83822_RCSR, rgmii_delay);
+ if (err)
+ return err;
+ }
+ }
+
+ return dp8382x_disable_wol(phydev);
+}
+
+static int dp8382x_config_init(struct phy_device *phydev)
+{
+ return dp8382x_disable_wol(phydev);
+}
+
static int dp83822_phy_reset(struct phy_device *phydev)
{
int err;
@@ -272,9 +317,7 @@ static int dp83822_phy_reset(struct phy_device *phydev)
if (err < 0)
return err;
- dp83822_config_init(phydev);
-
- return 0;
+ return phydev->drv->config_init(phydev);
}
static int dp83822_suspend(struct phy_device *phydev)
@@ -318,14 +361,29 @@ static int dp83822_resume(struct phy_device *phydev)
.resume = dp83822_resume, \
}
+#define DP8382X_PHY_DRIVER(_id, _name) \
+ { \
+ PHY_ID_MATCH_MODEL(_id), \
+ .name = (_name), \
+ /* PHY_BASIC_FEATURES */ \
+ .soft_reset = dp83822_phy_reset, \
+ .config_init = dp8382x_config_init, \
+ .get_wol = dp83822_get_wol, \
+ .set_wol = dp83822_set_wol, \
+ .ack_interrupt = dp83822_ack_interrupt, \
+ .config_intr = dp83822_config_intr, \
+ .suspend = dp83822_suspend, \
+ .resume = dp83822_resume, \
+ }
+
static struct phy_driver dp83822_driver[] = {
DP83822_PHY_DRIVER(DP83822_PHY_ID, "TI DP83822"),
- DP83822_PHY_DRIVER(DP83825I_PHY_ID, "TI DP83825I"),
- DP83822_PHY_DRIVER(DP83826C_PHY_ID, "TI DP83826C"),
- DP83822_PHY_DRIVER(DP83826NC_PHY_ID, "TI DP83826NC"),
- DP83822_PHY_DRIVER(DP83825S_PHY_ID, "TI DP83825S"),
- DP83822_PHY_DRIVER(DP83825CM_PHY_ID, "TI DP83825M"),
- DP83822_PHY_DRIVER(DP83825CS_PHY_ID, "TI DP83825CS"),
+ DP8382X_PHY_DRIVER(DP83825I_PHY_ID, "TI DP83825I"),
+ DP8382X_PHY_DRIVER(DP83826C_PHY_ID, "TI DP83826C"),
+ DP8382X_PHY_DRIVER(DP83826NC_PHY_ID, "TI DP83826NC"),
+ DP8382X_PHY_DRIVER(DP83825S_PHY_ID, "TI DP83825S"),
+ DP8382X_PHY_DRIVER(DP83825CM_PHY_ID, "TI DP83825M"),
+ DP8382X_PHY_DRIVER(DP83825CS_PHY_ID, "TI DP83825CS"),
};
module_phy_driver(dp83822_driver);
--
2.26.2
^ permalink raw reply related
* Re: [net-next 13/15] iecm: Add ethtool
From: Michal Kubecek @ 2020-06-18 21:17 UTC (permalink / raw)
To: netdev
Cc: Jeff Kirsher, davem, Alice Michael, nhorman, sassmann, Alan Brady,
Phani Burra, Joshua Hay, Madhu Chittim, Pavan Kumar Linga,
Donald Skidmore, Jesse Brandeburg, Sridhar Samudrala
In-Reply-To: <20200618051344.516587-14-jeffrey.t.kirsher@intel.com>
On Wed, Jun 17, 2020 at 10:13:42PM -0700, Jeff Kirsher wrote:
> From: Alice Michael <alice.michael@intel.com>
>
> Implement ethtool interface for the common module.
>
> Signed-off-by: Alice Michael <alice.michael@intel.com>
> Signed-off-by: Alan Brady <alan.brady@intel.com>
> Signed-off-by: Phani Burra <phani.r.burra@intel.com>
> Signed-off-by: Joshua Hay <joshua.a.hay@intel.com>
> Signed-off-by: Madhu Chittim <madhu.chittim@intel.com>
> Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
> Reviewed-by: Donald Skidmore <donald.c.skidmore@intel.com>
> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
[...]
> +static int iecm_set_channels(struct net_device *netdev,
> + struct ethtool_channels *ch)
> +{
> + struct iecm_vport *vport = iecm_netdev_to_vport(netdev);
> + int num_req_q = ch->combined_count;
> +
> + if (num_req_q == max(vport->num_txq, vport->num_rxq))
> + return 0;
> +
> + /* All of these should have already been checked by ethtool before this
> + * even gets to us, but just to be sure.
> + */
> + if (num_req_q <= 0 || num_req_q > IECM_MAX_Q)
> + return -EINVAL;
> +
> + if (ch->rx_count || ch->tx_count || ch->other_count != IECM_MAX_NONQ)
> + return -EINVAL;
I don't see much sense in duplicating the checks. Having the checks in
common code allows us to simplify driver callbacks.
> + vport->adapter->config_data.num_req_qs = num_req_q;
> +
> + return iecm_initiate_soft_reset(vport, __IECM_SR_Q_CHANGE);
> +}
[...]
> +static int iecm_set_ringparam(struct net_device *netdev,
> + struct ethtool_ringparam *ring)
> +{
> + struct iecm_vport *vport = iecm_netdev_to_vport(netdev);
> + u32 new_rx_count, new_tx_count;
> +
> + if (ring->rx_mini_pending || ring->rx_jumbo_pending)
> + return -EINVAL;
> +
> + new_tx_count = clamp_t(u32, ring->tx_pending,
> + IECM_MIN_TXQ_DESC,
> + IECM_MAX_TXQ_DESC);
> + new_tx_count = ALIGN(new_tx_count, IECM_REQ_DESC_MULTIPLE);
> +
> + new_rx_count = clamp_t(u32, ring->rx_pending,
> + IECM_MIN_RXQ_DESC,
> + IECM_MAX_RXQ_DESC);
> + new_rx_count = ALIGN(new_rx_count, IECM_REQ_DESC_MULTIPLE);
Same here. This is actually a bit misleading as it seems that count
exceeding maximum would be silently clamped to it but such value would
be rejected by common code.
> + /* if nothing to do return success */
> + if (new_tx_count == vport->txq_desc_count &&
> + new_rx_count == vport->rxq_desc_count)
> + return 0;
> +
> + vport->adapter->config_data.num_req_txq_desc = new_tx_count;
> + vport->adapter->config_data.num_req_rxq_desc = new_rx_count;
> +
> + return iecm_initiate_soft_reset(vport, __IECM_SR_Q_DESC_CHANGE);
> +}
[...]
> +/* For now we have one and only one private flag and it is only defined
> + * when we have support for the SKIP_CPU_SYNC DMA attribute. Instead
> + * of leaving all this code sitting around empty we will strip it unless
> + * our one private flag is actually available.
> + */
The code below will always return 1 for ETH_SS_PRIV_FLAGS in
iecm_get_sset_count() and an array of one string in iecm_get_strings().
This would e.g. result in "ethtool -i" saying "supports-priv-flags: yes"
but then "ethtool --show-priv-flags" failing with -EOPNOTSUPP. IMHO you
should not return bogus string set if private flags are not implemented.
Michal
> +struct iecm_priv_flags {
> + char flag_string[ETH_GSTRING_LEN];
> + bool read_only;
> + u32 flag;
> +};
> +
> +#define IECM_PRIV_FLAG(_name, _flag, _read_only) { \
> + .read_only = _read_only, \
> + .flag_string = _name, \
> + .flag = _flag, \
> +}
> +
> +static const struct iecm_priv_flags iecm_gstrings_priv_flags[] = {
> + IECM_PRIV_FLAG("", 0, 0),
> +};
> +
> +#define IECM_PRIV_FLAGS_STR_LEN ARRAY_SIZE(iecm_gstrings_priv_flags)
[...]
> +static void iecm_get_priv_flag_strings(struct net_device *netdev, u8 *data)
> +{
> + unsigned int i;
> +
> + for (i = 0; i < IECM_PRIV_FLAGS_STR_LEN; i++) {
> + snprintf((char *)data, ETH_GSTRING_LEN, "%s",
> + iecm_gstrings_priv_flags[i].flag_string);
> + data += ETH_GSTRING_LEN;
> + }
> +}
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox