Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 02/14] net: sched: change type of reference and bind counters
From: Vlad Buslov @ 2018-05-20 10:55 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner
  Cc: netdev, davem, jhs, xiyou.wangcong, jiri, pablo, kadlec, fw, ast,
	daniel, edumazet, keescook, linux-kernel, netfilter-devel,
	coreteam, kliteyn
In-Reply-To: <20180519210442.GA5488@localhost.localdomain>


On Sat 19 May 2018 at 21:04, Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> wrote:
> On Mon, May 14, 2018 at 05:27:03PM +0300, Vlad Buslov wrote:
>> Change type of action reference counter to refcount_t.
>>
>> Change type of action bind counter to atomic_t.
>> This type is used to allow decrementing bind counter without testing
>> for 0 result.
>
> ... and in what does not testing for 0 result helps?
>
>   Marcelo

Atomic operations don't WARN in this case.

^ permalink raw reply

* [PATCH net] sctp: fix the issue that flags are ignored when using kernel_connect
From: Xin Long @ 2018-05-20  8:39 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: davem, Marcelo Ricardo Leitner, Neil Horman, mkubecek

Now sctp uses inet_dgram_connect as its proto_ops .connect, and the flags
param can't be passed into its proto .connect where this flags is really
needed.

sctp works around it by getting flags from socket file in __sctp_connect.
It works for connecting from userspace, as inherently the user sock has
socket file and it passes f_flags as the flags param into the proto_ops
.connect.

However, the sock created by sock_create_kern doesn't have a socket file,
and it passes the flags (like O_NONBLOCK) by using the flags param in
kernel_connect, which calls proto_ops .connect later.

So to fix it, this patch defines a new proto_ops .connect for sctp,
sctp_inet_connect, which calls __sctp_connect() directly with this
flags param. After this, the sctp's proto .connect can be removed.

Note that sctp_inet_connect doesn't need to do some checks that are not
needed for sctp, which makes thing better than with inet_dgram_connect.

Suggested-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 include/net/sctp/sctp.h |  2 ++
 net/sctp/ipv6.c         |  2 +-
 net/sctp/protocol.c     |  2 +-
 net/sctp/socket.c       | 51 +++++++++++++++++++++++++++++++++----------------
 4 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 28b996d..35498e6 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -103,6 +103,8 @@ void sctp_addr_wq_mgmt(struct net *, struct sctp_sockaddr_entry *, int);
 /*
  * sctp/socket.c
  */
+int sctp_inet_connect(struct socket *sock, struct sockaddr *uaddr,
+		      int addr_len, int flags);
 int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
 int sctp_inet_listen(struct socket *sock, int backlog);
 void sctp_write_space(struct sock *sk);
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 4224711..0cd2e76 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -1006,7 +1006,7 @@ static const struct proto_ops inet6_seqpacket_ops = {
 	.owner		   = THIS_MODULE,
 	.release	   = inet6_release,
 	.bind		   = inet6_bind,
-	.connect	   = inet_dgram_connect,
+	.connect	   = sctp_inet_connect,
 	.socketpair	   = sock_no_socketpair,
 	.accept		   = inet_accept,
 	.getname	   = sctp_getname,
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index d685f84..6bf0a99 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1012,7 +1012,7 @@ static const struct proto_ops inet_seqpacket_ops = {
 	.owner		   = THIS_MODULE,
 	.release	   = inet_release,	/* Needs to be wrapped... */
 	.bind		   = inet_bind,
-	.connect	   = inet_dgram_connect,
+	.connect	   = sctp_inet_connect,
 	.socketpair	   = sock_no_socketpair,
 	.accept		   = inet_accept,
 	.getname	   = inet_getname,	/* Semantics are different.  */
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 80835ac..ae7e7c6 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1086,7 +1086,7 @@ static int sctp_setsockopt_bindx(struct sock *sk,
  */
 static int __sctp_connect(struct sock *sk,
 			  struct sockaddr *kaddrs,
-			  int addrs_size,
+			  int addrs_size, int flags,
 			  sctp_assoc_t *assoc_id)
 {
 	struct net *net = sock_net(sk);
@@ -1104,7 +1104,6 @@ static int __sctp_connect(struct sock *sk,
 	union sctp_addr *sa_addr = NULL;
 	void *addr_buf;
 	unsigned short port;
-	unsigned int f_flags = 0;
 
 	sp = sctp_sk(sk);
 	ep = sp->ep;
@@ -1254,13 +1253,7 @@ static int __sctp_connect(struct sock *sk,
 	sp->pf->to_sk_daddr(sa_addr, sk);
 	sk->sk_err = 0;
 
-	/* in-kernel sockets don't generally have a file allocated to them
-	 * if all they do is call sock_create_kern().
-	 */
-	if (sk->sk_socket->file)
-		f_flags = sk->sk_socket->file->f_flags;
-
-	timeo = sock_sndtimeo(sk, f_flags & O_NONBLOCK);
+	timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
 
 	if (assoc_id)
 		*assoc_id = asoc->assoc_id;
@@ -1348,7 +1341,7 @@ static int __sctp_setsockopt_connectx(struct sock *sk,
 				      sctp_assoc_t *assoc_id)
 {
 	struct sockaddr *kaddrs;
-	int err = 0;
+	int err = 0, flags = 0;
 
 	pr_debug("%s: sk:%p addrs:%p addrs_size:%d\n",
 		 __func__, sk, addrs, addrs_size);
@@ -1367,7 +1360,13 @@ static int __sctp_setsockopt_connectx(struct sock *sk,
 	if (err)
 		goto out_free;
 
-	err = __sctp_connect(sk, kaddrs, addrs_size, assoc_id);
+	/* in-kernel sockets don't generally have a file allocated to them
+	 * if all they do is call sock_create_kern().
+	 */
+	if (sk->sk_socket->file)
+		flags = sk->sk_socket->file->f_flags;
+
+	err = __sctp_connect(sk, kaddrs, addrs_size, flags, assoc_id);
 
 out_free:
 	kvfree(kaddrs);
@@ -4397,16 +4396,26 @@ static int sctp_setsockopt(struct sock *sk, int level, int optname,
  * len: the size of the address.
  */
 static int sctp_connect(struct sock *sk, struct sockaddr *addr,
-			int addr_len)
+			int addr_len, int flags)
 {
-	int err = 0;
+	struct inet_sock *inet = inet_sk(sk);
 	struct sctp_af *af;
+	int err = 0;
 
 	lock_sock(sk);
 
 	pr_debug("%s: sk:%p, sockaddr:%p, addr_len:%d\n", __func__, sk,
 		 addr, addr_len);
 
+	/* We may need to bind the socket. */
+	if (!inet->inet_num) {
+		if (sk->sk_prot->get_port(sk, 0)) {
+			release_sock(sk);
+			return -EAGAIN;
+		}
+		inet->inet_sport = htons(inet->inet_num);
+	}
+
 	/* Validate addr_len before calling common connect/connectx routine. */
 	af = sctp_get_af_specific(addr->sa_family);
 	if (!af || addr_len < af->sockaddr_len) {
@@ -4415,13 +4424,25 @@ static int sctp_connect(struct sock *sk, struct sockaddr *addr,
 		/* Pass correct addr len to common routine (so it knows there
 		 * is only one address being passed.
 		 */
-		err = __sctp_connect(sk, addr, af->sockaddr_len, NULL);
+		err = __sctp_connect(sk, addr, af->sockaddr_len, flags, NULL);
 	}
 
 	release_sock(sk);
 	return err;
 }
 
+int sctp_inet_connect(struct socket *sock, struct sockaddr *uaddr,
+		      int addr_len, int flags)
+{
+	if (addr_len < sizeof(uaddr->sa_family))
+		return -EINVAL;
+
+	if (uaddr->sa_family == AF_UNSPEC)
+		return -EOPNOTSUPP;
+
+	return sctp_connect(sock->sk, uaddr, addr_len, flags);
+}
+
 /* FIXME: Write comments. */
 static int sctp_disconnect(struct sock *sk, int flags)
 {
@@ -8724,7 +8745,6 @@ struct proto sctp_prot = {
 	.name        =	"SCTP",
 	.owner       =	THIS_MODULE,
 	.close       =	sctp_close,
-	.connect     =	sctp_connect,
 	.disconnect  =	sctp_disconnect,
 	.accept      =	sctp_accept,
 	.ioctl       =	sctp_ioctl,
@@ -8767,7 +8787,6 @@ struct proto sctpv6_prot = {
 	.name		= "SCTPv6",
 	.owner		= THIS_MODULE,
 	.close		= sctp_close,
-	.connect	= sctp_connect,
 	.disconnect	= sctp_disconnect,
 	.accept		= sctp_accept,
 	.ioctl		= sctp_ioctl,
-- 
2.1.0

^ permalink raw reply related

* Re: INFO: rcu detected stall in is_bpf_text_address
From: Xin Long @ 2018-05-20  8:26 UTC (permalink / raw)
  To: Eric Dumazet, Marcelo Ricardo Leitner
  Cc: syzbot, ast, Daniel Borkmann, LKML, network dev, syzkaller-bugs
In-Reply-To: <4b65142a-cf3b-05d7-d66b-018ff8da7ccc@gmail.com>

On Sat, May 19, 2018 at 11:57 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> SCTP experts, please take a look.
>
> On 05/19/2018 08:55 AM, syzbot wrote:
>> Hello,
>>
>> syzbot found the following crash on:
>>
>> HEAD commit:    73fcb1a370c7 Merge branch 'akpm' (patches from Andrew)
>> git tree:       upstream
>> console output: https://syzkaller.appspot.com/x/log.txt?x=1462ec0f800000
>> kernel config:  https://syzkaller.appspot.com/x/.config?x=f3b4e30da84ec1ed
>> dashboard link: https://syzkaller.appspot.com/bug?extid=3dcd59a1f907245f891f
>> compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
>> syzkaller repro:https://syzkaller.appspot.com/x/repro.syz?x=1079cf8f800000
Thank you.
The Reproducer is more than helpful.

setsockopt$inet_sctp6_SCTP_RTOINFO(r0, 0x84, 0x0,
&(0x7f0000000140)={0x0, 0x6, 0x7, 0x4}, 0x10)

It set rto_min=6 and rto_max=7, these are too small values.
t3_rtx timer works fine with it. But hb_timer will get stuck there, as
in its timer handler it starts this timer again with this value, then
it goes to the timer handler again...

HB has to repeat this and the hb timer's expire may also have to use
'trans->rto >> 1 ...' stuff. But we can limit the RTO's min value, like
HZ/20, which is 'Try again later.' number used when sock lock is
owned by others in all timer handlers.

^ permalink raw reply

* [patch iproute2/net-next 2/2] devlink: introduce support for showing port number and split subport number
From: Jiri Pirko @ 2018-05-20  8:15 UTC (permalink / raw)
  To: netdev
  Cc: dsahern, idosch, jakub.kicinski, mlxsw, andrew, vivien.didelot,
	f.fainelli, michael.chan, ganeshgr, saeedm, simon.horman,
	pieter.jansenvanvuuren, john.hurley, dirk.vandermerwe,
	alexander.h.duyck, ogerlitz, vijaya.guvva, satananda.burla,
	raghu.vatsavayi, felix.manlunas, gospo, sathya.perla,
	vasundhara-v.volam, tariqt, eranbe, jeffrey.t.kirsher, roopa
In-Reply-To: <20180520081539.1372-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@mellanox.com>

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 devlink/devlink.c            | 6 ++++++
 include/uapi/linux/devlink.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index df2c66dac1c7..b0ae17767dab 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -1737,9 +1737,15 @@ static void pr_out_port(struct dl *dl, struct nlattr **tb)
 
 		pr_out_str(dl, "flavour", port_flavour_name(port_flavour));
 	}
+	if (tb[DEVLINK_ATTR_PORT_NUMBER])
+		pr_out_uint(dl, "number",
+			    mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_NUMBER]));
 	if (tb[DEVLINK_ATTR_PORT_SPLIT_GROUP])
 		pr_out_uint(dl, "split_group",
 			    mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_SPLIT_GROUP]));
+	if (tb[DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER])
+		pr_out_uint(dl, "subport",
+			    mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER]));
 	pr_out_port_handle_end(dl);
 }
 
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index 23a3af6284b4..493f71fef7ee 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -235,6 +235,8 @@ enum devlink_attr {
 	DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNITS,/* u64 */
 
 	DEVLINK_ATTR_PORT_FLAVOUR,		/* u16 */
+	DEVLINK_ATTR_PORT_NUMBER,		/* u32 */
+	DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER,	/* u32 */
 
 	/* add new attributes above here, update the policy in devlink.c */
 
-- 
2.14.3

^ permalink raw reply related

* [patch iproute2/net-next 1/2] devlink: introduce support for showing port flavours
From: Jiri Pirko @ 2018-05-20  8:15 UTC (permalink / raw)
  To: netdev
  Cc: dsahern, idosch, jakub.kicinski, mlxsw, andrew, vivien.didelot,
	f.fainelli, michael.chan, ganeshgr, saeedm, simon.horman,
	pieter.jansenvanvuuren, john.hurley, dirk.vandermerwe,
	alexander.h.duyck, ogerlitz, vijaya.guvva, satananda.burla,
	raghu.vatsavayi, felix.manlunas, gospo, sathya.perla,
	vasundhara-v.volam, tariqt, eranbe, jeffrey.t.kirsher, roopa
In-Reply-To: <20180520081539.1372-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@mellanox.com>

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 devlink/devlink.c            | 20 ++++++++++++++++++++
 include/uapi/linux/devlink.h | 12 ++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index fa33684cb20a..df2c66dac1c7 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -1693,6 +1693,20 @@ static const char *port_type_name(uint32_t type)
 	}
 }
 
+static const char *port_flavour_name(uint16_t flavour)
+{
+	switch (flavour) {
+	case DEVLINK_PORT_FLAVOUR_PHYSICAL:
+		return "physical";
+	case DEVLINK_PORT_FLAVOUR_CPU:
+		return "cpu";
+	case DEVLINK_PORT_FLAVOUR_DSA:
+		return "dsa";
+	default:
+		return "<unknown flavour>";
+	}
+}
+
 static void pr_out_port(struct dl *dl, struct nlattr **tb)
 {
 	struct nlattr *pt_attr = tb[DEVLINK_ATTR_PORT_TYPE];
@@ -1717,6 +1731,12 @@ static void pr_out_port(struct dl *dl, struct nlattr **tb)
 	if (tb[DEVLINK_ATTR_PORT_IBDEV_NAME])
 		pr_out_str(dl, "ibdev",
 			   mnl_attr_get_str(tb[DEVLINK_ATTR_PORT_IBDEV_NAME]));
+	if (tb[DEVLINK_ATTR_PORT_FLAVOUR]) {
+		uint16_t port_flavour =
+				mnl_attr_get_u16(tb[DEVLINK_ATTR_PORT_FLAVOUR]);
+
+		pr_out_str(dl, "flavour", port_flavour_name(port_flavour));
+	}
 	if (tb[DEVLINK_ATTR_PORT_SPLIT_GROUP])
 		pr_out_uint(dl, "split_group",
 			    mnl_attr_get_u32(tb[DEVLINK_ATTR_PORT_SPLIT_GROUP]));
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index 9f17286ec89f..23a3af6284b4 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -132,6 +132,16 @@ enum devlink_eswitch_encap_mode {
 	DEVLINK_ESWITCH_ENCAP_MODE_BASIC,
 };
 
+enum devlink_port_flavour {
+	DEVLINK_PORT_FLAVOUR_PHYSICAL, /* Any kind of a port physically
+					* facing the user.
+					*/
+	DEVLINK_PORT_FLAVOUR_CPU, /* CPU port */
+	DEVLINK_PORT_FLAVOUR_DSA, /* Distributed switch architecture
+				   * interconnect port.
+				   */
+};
+
 enum devlink_attr {
 	/* don't change the order or add anything between, this is ABI! */
 	DEVLINK_ATTR_UNSPEC,
@@ -224,6 +234,8 @@ enum devlink_attr {
 	DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID,	/* u64 */
 	DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNITS,/* u64 */
 
+	DEVLINK_ATTR_PORT_FLAVOUR,		/* u16 */
+
 	/* add new attributes above here, update the policy in devlink.c */
 
 	__DEVLINK_ATTR_MAX,
-- 
2.14.3

^ permalink raw reply related

* [patch iproute2/net-next 0/2] devlink: add port flavours/number/split_subport
From: Jiri Pirko @ 2018-05-20  8:15 UTC (permalink / raw)
  To: netdev
  Cc: dsahern, idosch, jakub.kicinski, mlxsw, andrew, vivien.didelot,
	f.fainelli, michael.chan, ganeshgr, saeedm, simon.horman,
	pieter.jansenvanvuuren, john.hurley, dirk.vandermerwe,
	alexander.h.duyck, ogerlitz, vijaya.guvva, satananda.burla,
	raghu.vatsavayi, felix.manlunas, gospo, sathya.perla,
	vasundhara-v.volam, tariqt, eranbe, jeffrey.t.kirsher, roopa

From: Jiri Pirko <jiri@mellanox.com>

Jiri Pirko (2):
  devlink: introduce support for showing port flavours
  devlink: introduce support for showing port number and split subport
    number

 devlink/devlink.c            | 26 ++++++++++++++++++++++++++
 include/uapi/linux/devlink.h | 14 ++++++++++++++
 2 files changed, 40 insertions(+)

-- 
2.14.3

^ permalink raw reply

* Wohltätigkeitsspende in Höhe von € 2.000.000,00
From: vicente.ortiz @ 2018-05-20  3:07 UTC (permalink / raw)
  To: Recipients

Lieber Freund,
 
Ich bin Herr Richard Wahl der Mega-Gewinner von $ 533M In Mega Millions Jackpot spende ich an 5 zufällige Personen, wenn Sie diese E-Mail erhalten, dann wurde Ihre E-Mail nach einem Spinball ausgewählt. Ich habe den größten Teil meines Vermögens auf eine Reihe von Wohltätigkeitsorganisationen und Organisationen verteilt. Ich habe mich freiwillig dazu entschieden, Ihnen den Betrag von € 2.000.000,00 EUR zu spenden
eine der ausgewählten 5, um meine Gewinne zu überprüfen, finden Sie auf meiner You Tube Seite unten.
 
UHR MICH HIER: https://www.youtube.com/watch?v=tne02ExNDrw
 
Das ist dein Spendencode: [DF00430342018]
 
Antworten Sie mit dem Spendencode auf diese E-Mail: richardwahlfunds@workmail.com
 
Ich hoffe, Sie und Ihre Familie glücklich zu machen.
 
Grüße
Herr Richard Wahl

^ permalink raw reply

* Re: [PATCH 10/32] aio: implement IOCB_CMD_POLL
From: Al Viro @ 2018-05-20  7:33 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
	linux-kernel
In-Reply-To: <20180520053219.GZ30522@ZenIV.linux.org.uk>

On Sun, May 20, 2018 at 06:32:25AM +0100, Al Viro wrote:
> > +	spin_lock_irqsave(&ctx->ctx_lock, flags);
> > +	list_add_tail(&aiocb->ki_list, &ctx->delayed_cancel_reqs);
> > +	spin_unlock(&ctx->ctx_lock);
> 
> ... and io_cancel(2) comes, finds it and inhume^Wcompletes it, leaving us to...
> 
> > +	spin_lock(&req->head->lock);
> 
> ... get buggered on attempt to dereference a pointer fetched from freed and
> reused object.

FWIW, how painful would it be to pull the following trick:
	* insert into wait queue under ->ctx_lock
	* have wakeup do schedule_work() with aio_complete() done from that
	* have ->ki_cancel() grab queue lock, remove from queue and use
the same schedule_work()

That way you'd get ->ki_cancel() with the same semantics as originally for
everything - "ask politely to finish ASAP", and called in the same locking
environment for everyone - under ->ctx_lock, that is.  queue lock nests
inside ->ctx_lock; no magical flags, etc.

The cost is schedule_work() for each async poll-related completion as you
have for fsync.  I don't know whether that's too costly or not; it certainly
simplifies the things, but whether it's OK performance-wise...

Comments?

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

^ permalink raw reply

* Re: [PATCH bpf-next 3/3] bpf: Add mtu checking to FIB forwarding helper
From: kbuild test robot @ 2018-05-20  6:41 UTC (permalink / raw)
  To: David Ahern; +Cc: kbuild-all, netdev, borkmann, ast, davem, David Ahern
In-Reply-To: <20180517160930.25076-4-dsahern@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

Hi David,

I love your patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/David-Ahern/bpf-Add-MTU-check-to-fib-lookup-helper/20180520-103417
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

All errors (new ones prefixed by >>):

   net/core/filter.o: In function `bpf_ipv6_fib_lookup':
>> filter.c:(.text+0x12072): undefined reference to `ip6_mtu_from_fib6'

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 49919 bytes --]

^ permalink raw reply

* Re: [PATCH 06/14] net: sched: implement reference counted action release
From: Jiri Pirko @ 2018-05-20  6:22 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner
  Cc: Vlad Buslov, netdev, davem, jhs, xiyou.wangcong, pablo, kadlec,
	fw, ast, daniel, edumazet, keescook, linux-kernel,
	netfilter-devel, coreteam, kliteyn
In-Reply-To: <20180519214327.GC5488@localhost.localdomain>

Sat, May 19, 2018 at 11:43:27PM CEST, marcelo.leitner@gmail.com wrote:
>On Mon, May 14, 2018 at 05:27:07PM +0300, Vlad Buslov wrote:
>...
>> @@ -1052,6 +1088,36 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
>>  	return err;
>>  }
>>
>> +static int tcf_action_delete(struct net *net, struct list_head *actions,
>> +			     struct netlink_ext_ack *extack)
>> +{
>> +	int ret;
>
>Reverse christmass tree.. this line should be the last in variable
>declarations.
>
>> +	struct tc_action *a, *tmp;
>> +	char kind[IFNAMSIZ];
>> +	u32 act_index;
>> +
>> +	list_for_each_entry_safe(a, tmp, actions, list) {
>> +		const struct tc_action_ops *ops = a->ops;
>> +
>> +		/* Actions can be deleted concurrently
>> +		 * so we must save their type and id to search again
>> +		 * after reference is released.
>> +		 */
>> +		strncpy(kind, a->ops->kind, sizeof(kind) - 1);
>
>This may be problematic. Why strncpy here?

This is not necessary if Vlad is going to hold module referece, ops
cannot disappear.


>
>a->ops->kind is also of size IFNAMSIZ. If a->ops->kind is actually
>IFNAMSIZ-1 long, kind here won't be NULL terminated, as kind is not
>initialized and strncpy won't add the NULL.
>
>> +		act_index = a->tcfa_index;
>> +
>> +		list_del(&a->list);
>> +		if (tcf_action_put(a))
>> +			module_put(ops->owner);
>> +
>> +		/* now do the delete */
>> +		ret = tcf_action_del_1(net, kind, act_index, extack);
>> +		if (ret < 0)
>> +			return ret;
>> +	}
>> +	return 0;
>> +}

^ permalink raw reply

* Re: [PATCH 03/17] batman-adv: Add network_coding and mcast sysfs files to README
From: Jiri Pirko @ 2018-05-20  6:19 UTC (permalink / raw)
  To: Linus Lüssing
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	The list for a Better Approach To Mobile Ad-hoc Networking,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q
In-Reply-To: <20180327154307.GA2052@otheros>

Tue, Mar 27, 2018 at 05:43:08PM CEST, linus.luessing-djzkFPsfvsizQB+pC5nmwQ@public.gmane.org wrote:
>On Sat, Oct 29, 2016 at 12:56:28PM +0200, Jiri Pirko wrote:
>> >> I strongly believe it is a huge mistake to use sysfs for things like
>> >> this. This should be done via generic netlink api.
>> >
>> >This doesn't change the problem that it is already that way. This patch
>> >only adds the list of available files to the README.
>> 
>> Sure. Just found out you did it like that. Therefore I commented. I
>> suggest to rework the api to use genl entirely.
>
>Hi Jiri,
>
>Thanks for sharing your thoughts!
>
>Could you explain a bit more on which disadvantages you see in
>the usage of sysfs here?

There are 2 major disadvantages.
1) You don't have any events on a change. An app has to poll in order to
   know what changed in kernel. Netlink handles this by sending
   multicast messages on a specific socket while whoever is interested
   gets the messages.
2) In sysfs, everything is string. There are even mixed values like
   "1 (means something)". There are no well defined values. Every driver
   can expose same things differently. In Netlink, you have well-defined
   attributes, with typed values. You can pass multiple attributes for
   the same value if needed.

In general, usage of sysfs in netdev subsystem is frowned upon. I would
suggest to convert your iface to Generic Netlink API and let the
existing sysfs API to rot.


>
>Regards, Linus

^ permalink raw reply

* Re: [PATCH 10/32] aio: implement IOCB_CMD_POLL
From: Al Viro @ 2018-05-20  5:32 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
	linux-kernel
In-Reply-To: <20180515194833.6906-11-hch@lst.de>

On Tue, May 15, 2018 at 09:48:11PM +0200, Christoph Hellwig wrote:
> +static ssize_t aio_poll(struct aio_kiocb *aiocb, struct iocb *iocb)
> +{
> +	struct kioctx *ctx = aiocb->ki_ctx;
> +	struct poll_iocb *req = &aiocb->poll;
> +	unsigned long flags;
> +	__poll_t mask;
> +
> +	/* reject any unknown events outside the normal event mask. */
> +	if ((u16)iocb->aio_buf != iocb->aio_buf)
> +		return -EINVAL;
> +	/* reject fields that are not defined for poll */
> +	if (iocb->aio_offset || iocb->aio_nbytes || iocb->aio_rw_flags)
> +		return -EINVAL;
> +
> +	req->events = demangle_poll(iocb->aio_buf) | POLLERR | POLLHUP;
> +	req->file = fget(iocb->aio_fildes);
> +	if (unlikely(!req->file))
> +		return -EBADF;
> +	if (!file_has_poll_mask(req->file))
> +		goto out_fail;
> +
> +	req->head = req->file->f_op->get_poll_head(req->file, req->events);
> +	if (!req->head)
> +		goto out_fail;
> +	if (IS_ERR(req->head)) {
> +		mask = EPOLLERR;
> +		goto done;
> +	}
> +
> +	init_waitqueue_func_entry(&req->wait, aio_poll_wake);
> +	aiocb->ki_cancel = aio_poll_cancel;
> +
> +	spin_lock_irqsave(&ctx->ctx_lock, flags);
> +	list_add_tail(&aiocb->ki_list, &ctx->delayed_cancel_reqs);
> +	spin_unlock(&ctx->ctx_lock);

... and io_cancel(2) comes, finds it and inhume^Wcompletes it, leaving us to...

> +	spin_lock(&req->head->lock);

... get buggered on attempt to dereference a pointer fetched from freed and
reused object.

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

^ permalink raw reply

* Re: [PATCH 08/32] aio: replace kiocb_set_cancel_fn with a cancel_kiocb file operation
From: Al Viro @ 2018-05-20  5:27 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Avi Kivity, linux-aio, linux-fsdevel, netdev, linux-api,
	linux-kernel
In-Reply-To: <20180515194833.6906-9-hch@lst.de>

On Tue, May 15, 2018 at 09:48:09PM +0200, Christoph Hellwig wrote:

>  	case -EIOCBQUEUED:
> +		if (req->ki_filp->f_op->cancel_kiocb) {
> +			struct aio_kiocb *iocb =
> +				container_of(req, struct aio_kiocb, rw);
> +			struct kioctx *ctx = iocb->ki_ctx;
> +			unsigned long flags;
> +
> +			spin_lock_irqsave(&ctx->ctx_lock, flags);
> +			list_add_tail(&iocb->ki_list, &ctx->active_reqs);

Use after free - that list insertion used to be done by drivers and doing
so before any ->ki_complete() calls might've happened used to be their
responsibility.  Now you've taken that to the point after ->read_iter()
(or ->write_iter()) return, so there's no way in hell to guarantee it's
not been completed (and freed) by that point.

Incidentally, none of the callers gives a damn about the difference between
0 and -EIOCBQUEUED now, so aio_rw_ret() might as well had been made void...

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

^ permalink raw reply

* Re: [PATCH 03/17] batman-adv: Add network_coding and mcast sysfs files to README
From: Sven Eckelmann @ 2018-05-20  4:37 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	The list for a Better Approach To Mobile Ad-hoc Networking,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q
In-Reply-To: <2078208.hARaRF5Zct@bentobox>

[-- Attachment #1: Type: text/plain, Size: 1172 bytes --]

Hi Jiri,

seems like you still haven't answered Linus' question.

On Montag, 7. Mai 2018 08:34:16 CEST Sven Eckelmann wrote:
> On Dienstag, 27. März 2018 17:43:08 CEST Linus Lüssing wrote:
> > On Sat, Oct 29, 2016 at 12:56:28PM +0200, Jiri Pirko wrote:
> > > >> I strongly believe it is a huge mistake to use sysfs for things like
> > > >> this. This should be done via generic netlink api.
> > > >
> > > >This doesn't change the problem that it is already that way. This patch
> > > >only adds the list of available files to the README.
> > > 
> > > Sure. Just found out you did it like that. Therefore I commented. I
> > > suggest to rework the api to use genl entirely.
> > 
> > Hi Jiri,
> > 
> > Thanks for sharing your thoughts!
> > 
> > Could you explain a bit more on which disadvantages you see in
> > the usage of sysfs here?
> 
> Linus is asking because of following patch: 
> https://patchwork.open-mesh.org/patch/17340/

The next patch with a similar problem would be 
https://patchwork.open-mesh.org/patch/17372/. It is rather important that you 
are discussing this with Linus Luessing and Marek Lindner.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH net] net: ip6_gre: fix tunnel metadata device sharing.
From: David Miller @ 2018-05-20  3:33 UTC (permalink / raw)
  To: u9012063; +Cc: netdev, petrm
In-Reply-To: <1526696548-8323-1-git-send-email-u9012063@gmail.com>

From: William Tu <u9012063@gmail.com>
Date: Fri, 18 May 2018 19:22:28 -0700

> Currently ip6gre and ip6erspan share single metadata mode device,
> using 'collect_md_tun'.  Thus, when doing:
>   ip link add dev ip6gre11 type ip6gretap external
>   ip link add dev ip6erspan12 type ip6erspan external
>   RTNETLINK answers: File exists
> simply fails due to the 2nd tries to create the same collect_md_tun.
> 
> The patch fixes it by adding a separate collect md tunnel device
> for the ip6erspan, 'collect_md_tun_erspan'.  As a result, a couple
> of places need to refactor/split up in order to distinguish ip6gre
> and ip6erspan.
> 
> First, move the collect_md check at ip6gre_tunnel_{unlink,link} and
> create separate function {ip6gre,ip6ersapn}_tunnel_{link_md,unlink_md}.
> Then before link/unlink, make sure the link_md/unlink_md is called.
> Finally, a separate ndo_uninit is created for ip6erspan.  Tested it
> using the samples/bpf/test_tunnel_bpf.sh.
> 
> Fixes: ef7baf5e083c ("ip6_gre: add ip6 erspan collect_md mode")
> Signed-off-by: William Tu <u9012063@gmail.com>

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH 1/4] arcnet: com20020: Add com20020 io mapped version
From: kbuild test robot @ 2018-05-20  3:31 UTC (permalink / raw)
  To: Andrea Greco
  Cc: kbuild-all, tobin, andrea.greco.gapmilano, Andrea Greco,
	Michael Grzeschik, linux-kernel, netdev
In-Reply-To: <20180517130529.2684-1-andrea.greco.gapmilano@gmail.com>

Hi Andrea,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]
[also build test WARNING on v4.17-rc5 next-20180517]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Andrea-Greco/arcnet-com20020-Add-com20020-io-mapped-version/20180520-083936
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   drivers/net/arcnet/com90xx.c:484:13: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/com90xx.c:534:28: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/com90xx.c:613:13: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/com90xx.c:233:21: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/com90xx.c:234:25: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/com90xx.c:247:17: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/com90xx.c:248:21: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/com90xx.c:391:29: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/com90xx.c:405:33: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/com90xx.c:428:17: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/com90xx.c:446:21: sparse: undefined identifier 'arcnet_readb'
>> drivers/net/arcnet/com90xx.c:233:33: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:234:25: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:247:30: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:248:33: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:391:41: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:405:33: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:428:30: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:446:33: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:484:25: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:485:25: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:486:25: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:534:40: sparse: call with no type!
   drivers/net/arcnet/com90xx.c:613:25: sparse: call with no type!
>> drivers/net/arcnet/com90xx.c:615:25: sparse: unknown expression (4 0)
>> drivers/net/arcnet/com90xx.c:615:25: sparse: unknown expression (4 0)
>> drivers/net/arcnet/com90xx.c:615:25: sparse: unknown expression (4 0)
>> drivers/net/arcnet/com90xx.c:615:25: sparse: unknown expression (4 0)
   In file included from drivers/net/arcnet/com90xx.c:40:0:
   drivers/net/arcnet/com90xx.c: In function 'com90xx_probe':
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/com90xx.c:161:7: note: in expansion of macro 'arcnet_inb'
      if (arcnet_inb(ioaddr, COM9026_REG_R_STATUS) == 0xFF) {
          ^~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/com90xx.c:171:3: note: in expansion of macro 'arcnet_inb'
      arcnet_inb(ioaddr, COM9026_REG_R_RESET);
      ^~~~~~~~~~
   drivers/net/arcnet/com90xx.c:233:7: error: implicit declaration of function 'arcnet_readb'; did you mean 'arcnet_outsb'? [-Werror=implicit-function-declaration]
      if (arcnet_readb(base, COM9026_REG_R_STATUS) != TESTvalue) {
          ^~~~~~~~~~~~
          arcnet_outsb
   drivers/net/arcnet/com90xx.c:247:3: error: implicit declaration of function 'arcnet_writeb'; did you mean 'arcnet_outsb'? [-Werror=implicit-function-declaration]
      arcnet_writeb(0x42, base, COM9026_REG_W_INTMASK);
      ^~~~~~~~~~~~~
      arcnet_outsb
   In file included from drivers/net/arcnet/com90xx.c:40:0:
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/com90xx.c:312:12: note: in expansion of macro 'arcnet_inb'
      status = arcnet_inb(ioaddr, COM9026_REG_R_STATUS);
               ^~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com90xx.c:324:3: note: in expansion of macro 'arcnet_outb'
      arcnet_outb(CFLAGScmd | RESETclear | CONFIGclear,
      ^~~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/com90xx.c:326:12: note: in expansion of macro 'arcnet_inb'
      status = arcnet_inb(ioaddr, COM9026_REG_R_STATUS);
               ^~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com90xx.c:346:4: note: in expansion of macro 'arcnet_outb'
       arcnet_outb(NORXflag, ioaddr, COM9026_REG_W_INTMASK);
       ^~~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com90xx.c:348:4: note: in expansion of macro 'arcnet_outb'
       arcnet_outb(0, ioaddr, COM9026_REG_W_INTMASK);
       ^~~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/com90xx.c:383:3: note: in expansion of macro 'arcnet_inb'
      arcnet_inb(ioaddr, COM9026_REG_R_RESET);
      ^~~~~~~~~~
   drivers/net/arcnet/com90xx.c: In function 'com90xx_command':
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com90xx.c:565:2: note: in expansion of macro 'arcnet_outb'
     arcnet_outb(cmd, ioaddr, COM9026_REG_W_COMMAND);
     ^~~~~~~~~~~
   drivers/net/arcnet/com90xx.c: In function 'com90xx_status':
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/com90xx.c:572:9: note: in expansion of macro 'arcnet_inb'
     return arcnet_inb(ioaddr, COM9026_REG_R_STATUS);
            ^~~~~~~~~~
   drivers/net/arcnet/com90xx.c: In function 'com90xx_setmask':
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com90xx.c:579:2: note: in expansion of macro 'arcnet_outb'
     arcnet_outb(mask, ioaddr, COM9026_REG_W_INTMASK);
     ^~~~~~~~~~~
   drivers/net/arcnet/com90xx.c: In function 'com90xx_reset':
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/arcdevice.h:88:28: note: in expansion of macro 'arcnet_inb'
       netdev_warn(dev, fmt, ##__VA_ARGS__);  115-                            ^~~~~~~~~~~
   drivers/net/arcnet/com90xx.c:594:2: note: in expansion of macro 'arc_printk'
     arc_printk(D_INIT, dev, "Resetting (status=%02Xh)n",
     ^~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/arcdevice.h:90:28: note: in expansion of macro 'arcnet_inb'
       netdev_info(dev, fmt, ##__VA_ARGS__);  124-                            ^~~~~~~~~~~
   drivers/net/arcnet/com90xx.c:594:2: note: in expansion of macro 'arc_printk'
     arc_printk(D_INIT, dev, "Resetting (status=%02Xh)n",
     ^~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
--
   drivers/net/arcnet/arc-rimi.c:147:9: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/arc-rimi.c:148:9: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/arc-rimi.c:158:13: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/arc-rimi.c:210:28: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/arc-rimi.c:284:9: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/arc-rimi.c:276:16: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/arc-rimi.c:268:9: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/arc-rimi.c:245:9: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/arc-rimi.c:245:9: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/arc-rimi.c:245:9: sparse: undefined identifier 'arcnet_readb'
   drivers/net/arcnet/arc-rimi.c:249:17: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/arc-rimi.c:253:9: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/arc-rimi.c:254:9: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/arc-rimi.c:257:9: sparse: undefined identifier 'arcnet_writeb'
   drivers/net/arcnet/arc-rimi.c:109:21: sparse: undefined identifier 'arcnet_readb'
>> drivers/net/arcnet/arc-rimi.c:109:33: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:147:22: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:148:22: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:158:25: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:159:25: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:160:25: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:210:40: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:245:9: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:245:9: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:245:9: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:249:30: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:253:22: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:254:22: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:257:22: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:268:22: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:276:28: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c:284:22: sparse: call with no type!
   drivers/net/arcnet/arc-rimi.c: In function 'check_mirror':
   drivers/net/arcnet/arc-rimi.c:109:7: error: implicit declaration of function 'arcnet_readb'; did you mean 'arcnet_outsb'? [-Werror=implicit-function-declaration]
      if (arcnet_readb(p, COM9026_REG_R_STATUS) == TESTvalue)
          ^~~~~~~~~~~~
          arcnet_outsb
   drivers/net/arcnet/arc-rimi.c: In function 'arcrimi_found':
   drivers/net/arcnet/arc-rimi.c:147:2: error: implicit declaration of function 'arcnet_writeb'; did you mean 'arcnet_outsb'? [-Werror=implicit-function-declaration]
     arcnet_writeb(TESTvalue, p, COM9026_REG_W_INTMASK);
     ^~~~~~~~~~~~~
     arcnet_outsb
   cc1: some warnings being treated as errors

vim +233 drivers/net/arcnet/com90xx.c

^1da177e4 Linus Torvalds 2005-04-16   95  
^1da177e4 Linus Torvalds 2005-04-16   96  static void __init com90xx_probe(void)
^1da177e4 Linus Torvalds 2005-04-16   97  {
^1da177e4 Linus Torvalds 2005-04-16   98  	int count, status, ioaddr, numprint, airq, openparen = 0;
^1da177e4 Linus Torvalds 2005-04-16   99  	unsigned long airqmask;
7f5e760c1 Joe Perches    2015-05-05  100  	int ports[(0x3f0 - 0x200) / 16 + 1] = {	0 };
d0f6ecad3 Al Viro        2005-12-02  101  	unsigned long *shmems;
d0f6ecad3 Al Viro        2005-12-02  102  	void __iomem **iomem;
^1da177e4 Linus Torvalds 2005-04-16  103  	int numports, numshmems, *port;
^1da177e4 Linus Torvalds 2005-04-16  104  	u_long *p;
d0f6ecad3 Al Viro        2005-12-02  105  	int index;
^1da177e4 Linus Torvalds 2005-04-16  106  
^1da177e4 Linus Torvalds 2005-04-16  107  	if (!io && !irq && !shmem && !*device && com90xx_skip_probe)
^1da177e4 Linus Torvalds 2005-04-16  108  		return;
^1da177e4 Linus Torvalds 2005-04-16  109  
15901dc93 Andrew Morton  2006-04-01  110  	shmems = kzalloc(((0x100000 - 0xa0000) / 0x800) * sizeof(unsigned long),
d0f6ecad3 Al Viro        2005-12-02  111  			 GFP_KERNEL);
d0f6ecad3 Al Viro        2005-12-02  112  	if (!shmems)
d0f6ecad3 Al Viro        2005-12-02  113  		return;
15901dc93 Andrew Morton  2006-04-01  114  	iomem = kzalloc(((0x100000 - 0xa0000) / 0x800) * sizeof(void __iomem *),
d0f6ecad3 Al Viro        2005-12-02  115  			GFP_KERNEL);
d0f6ecad3 Al Viro        2005-12-02  116  	if (!iomem) {
d0f6ecad3 Al Viro        2005-12-02  117  		kfree(shmems);
d0f6ecad3 Al Viro        2005-12-02  118  		return;
d0f6ecad3 Al Viro        2005-12-02  119  	}
d0f6ecad3 Al Viro        2005-12-02  120  
72aeea484 Joe Perches    2015-05-05  121  	if (BUGLVL(D_NORMAL))
05a24b234 Joe Perches    2015-05-05  122  		pr_info("%s\n", "COM90xx chipset support");
^1da177e4 Linus Torvalds 2005-04-16  123  
^1da177e4 Linus Torvalds 2005-04-16  124  	/* set up the arrays where we'll store the possible probe addresses */
^1da177e4 Linus Torvalds 2005-04-16  125  	numports = numshmems = 0;
^1da177e4 Linus Torvalds 2005-04-16  126  	if (io)
^1da177e4 Linus Torvalds 2005-04-16  127  		ports[numports++] = io;
^1da177e4 Linus Torvalds 2005-04-16  128  	else
^1da177e4 Linus Torvalds 2005-04-16  129  		for (count = 0x200; count <= 0x3f0; count += 16)
^1da177e4 Linus Torvalds 2005-04-16  130  			ports[numports++] = count;
^1da177e4 Linus Torvalds 2005-04-16  131  	if (shmem)
^1da177e4 Linus Torvalds 2005-04-16  132  		shmems[numshmems++] = shmem;
^1da177e4 Linus Torvalds 2005-04-16  133  	else
^1da177e4 Linus Torvalds 2005-04-16  134  		for (count = 0xA0000; count <= 0xFF800; count += 2048)
^1da177e4 Linus Torvalds 2005-04-16  135  			shmems[numshmems++] = count;
^1da177e4 Linus Torvalds 2005-04-16  136  
^1da177e4 Linus Torvalds 2005-04-16  137  	/* Stage 1: abandon any reserved ports, or ones with status==0xFF
^1da177e4 Linus Torvalds 2005-04-16  138  	 * (empty), and reset any others by reading the reset port.
^1da177e4 Linus Torvalds 2005-04-16  139  	 */
^1da177e4 Linus Torvalds 2005-04-16  140  	numprint = -1;
^1da177e4 Linus Torvalds 2005-04-16  141  	for (port = &ports[0]; port - ports < numports; port++) {
^1da177e4 Linus Torvalds 2005-04-16  142  		numprint++;
^1da177e4 Linus Torvalds 2005-04-16  143  		numprint %= 8;
^1da177e4 Linus Torvalds 2005-04-16  144  		if (!numprint) {
a34c0932c Joe Perches    2015-05-05  145  			arc_cont(D_INIT, "\n");
a34c0932c Joe Perches    2015-05-05  146  			arc_cont(D_INIT, "S1: ");
^1da177e4 Linus Torvalds 2005-04-16  147  		}
a34c0932c Joe Perches    2015-05-05  148  		arc_cont(D_INIT, "%Xh ", *port);
^1da177e4 Linus Torvalds 2005-04-16  149  
^1da177e4 Linus Torvalds 2005-04-16  150  		ioaddr = *port;
^1da177e4 Linus Torvalds 2005-04-16  151  
d6d7d3ed5 Joe Perches    2015-05-05  152  		if (!request_region(*port, ARCNET_TOTAL_SIZE,
d6d7d3ed5 Joe Perches    2015-05-05  153  				    "arcnet (90xx)")) {
a34c0932c Joe Perches    2015-05-05  154  			arc_cont(D_INIT_REASONS, "(request_region)\n");
a34c0932c Joe Perches    2015-05-05  155  			arc_cont(D_INIT_REASONS, "S1: ");
72aeea484 Joe Perches    2015-05-05  156  			if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  157  				numprint = 0;
^1da177e4 Linus Torvalds 2005-04-16  158  			*port-- = ports[--numports];
^1da177e4 Linus Torvalds 2005-04-16  159  			continue;
^1da177e4 Linus Torvalds 2005-04-16  160  		}
09dfbcd5d Joe Perches    2015-05-05  161  		if (arcnet_inb(ioaddr, COM9026_REG_R_STATUS) == 0xFF) {
a34c0932c Joe Perches    2015-05-05  162  			arc_cont(D_INIT_REASONS, "(empty)\n");
a34c0932c Joe Perches    2015-05-05  163  			arc_cont(D_INIT_REASONS, "S1: ");
72aeea484 Joe Perches    2015-05-05  164  			if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  165  				numprint = 0;
^1da177e4 Linus Torvalds 2005-04-16  166  			release_region(*port, ARCNET_TOTAL_SIZE);
^1da177e4 Linus Torvalds 2005-04-16  167  			*port-- = ports[--numports];
^1da177e4 Linus Torvalds 2005-04-16  168  			continue;
^1da177e4 Linus Torvalds 2005-04-16  169  		}
09dfbcd5d Joe Perches    2015-05-05  170  		/* begin resetting card */
09dfbcd5d Joe Perches    2015-05-05  171  		arcnet_inb(ioaddr, COM9026_REG_R_RESET);
^1da177e4 Linus Torvalds 2005-04-16  172  
a34c0932c Joe Perches    2015-05-05  173  		arc_cont(D_INIT_REASONS, "\n");
a34c0932c Joe Perches    2015-05-05  174  		arc_cont(D_INIT_REASONS, "S1: ");
72aeea484 Joe Perches    2015-05-05  175  		if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  176  			numprint = 0;
^1da177e4 Linus Torvalds 2005-04-16  177  	}
a34c0932c Joe Perches    2015-05-05  178  	arc_cont(D_INIT, "\n");
^1da177e4 Linus Torvalds 2005-04-16  179  
^1da177e4 Linus Torvalds 2005-04-16  180  	if (!numports) {
a34c0932c Joe Perches    2015-05-05  181  		arc_cont(D_NORMAL, "S1: No ARCnet cards found.\n");
d0f6ecad3 Al Viro        2005-12-02  182  		kfree(shmems);
d0f6ecad3 Al Viro        2005-12-02  183  		kfree(iomem);
^1da177e4 Linus Torvalds 2005-04-16  184  		return;
^1da177e4 Linus Torvalds 2005-04-16  185  	}
^1da177e4 Linus Torvalds 2005-04-16  186  	/* Stage 2: we have now reset any possible ARCnet cards, so we can't
^1da177e4 Linus Torvalds 2005-04-16  187  	 * do anything until they finish.  If D_INIT, print the list of
^1da177e4 Linus Torvalds 2005-04-16  188  	 * cards that are left.
^1da177e4 Linus Torvalds 2005-04-16  189  	 */
^1da177e4 Linus Torvalds 2005-04-16  190  	numprint = -1;
^1da177e4 Linus Torvalds 2005-04-16  191  	for (port = &ports[0]; port < ports + numports; port++) {
^1da177e4 Linus Torvalds 2005-04-16  192  		numprint++;
^1da177e4 Linus Torvalds 2005-04-16  193  		numprint %= 8;
^1da177e4 Linus Torvalds 2005-04-16  194  		if (!numprint) {
a34c0932c Joe Perches    2015-05-05  195  			arc_cont(D_INIT, "\n");
a34c0932c Joe Perches    2015-05-05  196  			arc_cont(D_INIT, "S2: ");
^1da177e4 Linus Torvalds 2005-04-16  197  		}
a34c0932c Joe Perches    2015-05-05  198  		arc_cont(D_INIT, "%Xh ", *port);
^1da177e4 Linus Torvalds 2005-04-16  199  	}
a34c0932c Joe Perches    2015-05-05  200  	arc_cont(D_INIT, "\n");
^1da177e4 Linus Torvalds 2005-04-16  201  	mdelay(RESETtime);
^1da177e4 Linus Torvalds 2005-04-16  202  
^1da177e4 Linus Torvalds 2005-04-16  203  	/* Stage 3: abandon any shmem addresses that don't have the signature
^1da177e4 Linus Torvalds 2005-04-16  204  	 * 0xD1 byte in the right place, or are read-only.
^1da177e4 Linus Torvalds 2005-04-16  205  	 */
^1da177e4 Linus Torvalds 2005-04-16  206  	numprint = -1;
d0f6ecad3 Al Viro        2005-12-02  207  	for (index = 0, p = &shmems[0]; index < numshmems; p++, index++) {
d0f6ecad3 Al Viro        2005-12-02  208  		void __iomem *base;
^1da177e4 Linus Torvalds 2005-04-16  209  
^1da177e4 Linus Torvalds 2005-04-16  210  		numprint++;
^1da177e4 Linus Torvalds 2005-04-16  211  		numprint %= 8;
^1da177e4 Linus Torvalds 2005-04-16  212  		if (!numprint) {
a34c0932c Joe Perches    2015-05-05  213  			arc_cont(D_INIT, "\n");
a34c0932c Joe Perches    2015-05-05  214  			arc_cont(D_INIT, "S3: ");
^1da177e4 Linus Torvalds 2005-04-16  215  		}
a34c0932c Joe Perches    2015-05-05  216  		arc_cont(D_INIT, "%lXh ", *p);
^1da177e4 Linus Torvalds 2005-04-16  217  
d0f6ecad3 Al Viro        2005-12-02  218  		if (!request_mem_region(*p, MIRROR_SIZE, "arcnet (90xx)")) {
a34c0932c Joe Perches    2015-05-05  219  			arc_cont(D_INIT_REASONS, "(request_mem_region)\n");
a34c0932c Joe Perches    2015-05-05  220  			arc_cont(D_INIT_REASONS, "Stage 3: ");
72aeea484 Joe Perches    2015-05-05  221  			if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  222  				numprint = 0;
d0f6ecad3 Al Viro        2005-12-02  223  			goto out;
d0f6ecad3 Al Viro        2005-12-02  224  		}
d0f6ecad3 Al Viro        2005-12-02  225  		base = ioremap(*p, MIRROR_SIZE);
d0f6ecad3 Al Viro        2005-12-02  226  		if (!base) {
a34c0932c Joe Perches    2015-05-05  227  			arc_cont(D_INIT_REASONS, "(ioremap)\n");
a34c0932c Joe Perches    2015-05-05  228  			arc_cont(D_INIT_REASONS, "Stage 3: ");
72aeea484 Joe Perches    2015-05-05  229  			if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  230  				numprint = 0;
d0f6ecad3 Al Viro        2005-12-02  231  			goto out1;
^1da177e4 Linus Torvalds 2005-04-16  232  		}
a11a5442d Joe Perches    2015-05-05 @233  		if (arcnet_readb(base, COM9026_REG_R_STATUS) != TESTvalue) {
a34c0932c Joe Perches    2015-05-05  234  			arc_cont(D_INIT_REASONS, "(%02Xh != %02Xh)\n",
a11a5442d Joe Perches    2015-05-05  235  				 arcnet_readb(base, COM9026_REG_R_STATUS),
a11a5442d Joe Perches    2015-05-05  236  				 TESTvalue);
a34c0932c Joe Perches    2015-05-05  237  			arc_cont(D_INIT_REASONS, "S3: ");
72aeea484 Joe Perches    2015-05-05  238  			if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  239  				numprint = 0;
d0f6ecad3 Al Viro        2005-12-02  240  			goto out2;
^1da177e4 Linus Torvalds 2005-04-16  241  		}
^1da177e4 Linus Torvalds 2005-04-16  242  		/* By writing 0x42 to the TESTvalue location, we also make
^1da177e4 Linus Torvalds 2005-04-16  243  		 * sure no "mirror" shmem areas show up - if they occur
^1da177e4 Linus Torvalds 2005-04-16  244  		 * in another pass through this loop, they will be discarded
^1da177e4 Linus Torvalds 2005-04-16  245  		 * because *cptr != TESTvalue.
^1da177e4 Linus Torvalds 2005-04-16  246  		 */
a11a5442d Joe Perches    2015-05-05  247  		arcnet_writeb(0x42, base, COM9026_REG_W_INTMASK);
a11a5442d Joe Perches    2015-05-05  248  		if (arcnet_readb(base, COM9026_REG_R_STATUS) != 0x42) {
a34c0932c Joe Perches    2015-05-05  249  			arc_cont(D_INIT_REASONS, "(read only)\n");
a34c0932c Joe Perches    2015-05-05  250  			arc_cont(D_INIT_REASONS, "S3: ");
d0f6ecad3 Al Viro        2005-12-02  251  			goto out2;
^1da177e4 Linus Torvalds 2005-04-16  252  		}
a34c0932c Joe Perches    2015-05-05  253  		arc_cont(D_INIT_REASONS, "\n");
a34c0932c Joe Perches    2015-05-05  254  		arc_cont(D_INIT_REASONS, "S3: ");
72aeea484 Joe Perches    2015-05-05  255  		if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  256  			numprint = 0;
d0f6ecad3 Al Viro        2005-12-02  257  		iomem[index] = base;
d0f6ecad3 Al Viro        2005-12-02  258  		continue;
d0f6ecad3 Al Viro        2005-12-02  259  	out2:
d0f6ecad3 Al Viro        2005-12-02  260  		iounmap(base);
d0f6ecad3 Al Viro        2005-12-02  261  	out1:
d0f6ecad3 Al Viro        2005-12-02  262  		release_mem_region(*p, MIRROR_SIZE);
d0f6ecad3 Al Viro        2005-12-02  263  	out:
d0f6ecad3 Al Viro        2005-12-02  264  		*p-- = shmems[--numshmems];
d0f6ecad3 Al Viro        2005-12-02  265  		index--;
^1da177e4 Linus Torvalds 2005-04-16  266  	}
a34c0932c Joe Perches    2015-05-05  267  	arc_cont(D_INIT, "\n");
^1da177e4 Linus Torvalds 2005-04-16  268  
^1da177e4 Linus Torvalds 2005-04-16  269  	if (!numshmems) {
a34c0932c Joe Perches    2015-05-05  270  		arc_cont(D_NORMAL, "S3: No ARCnet cards found.\n");
^1da177e4 Linus Torvalds 2005-04-16  271  		for (port = &ports[0]; port < ports + numports; port++)
^1da177e4 Linus Torvalds 2005-04-16  272  			release_region(*port, ARCNET_TOTAL_SIZE);
d0f6ecad3 Al Viro        2005-12-02  273  		kfree(shmems);
d0f6ecad3 Al Viro        2005-12-02  274  		kfree(iomem);
^1da177e4 Linus Torvalds 2005-04-16  275  		return;
^1da177e4 Linus Torvalds 2005-04-16  276  	}
^1da177e4 Linus Torvalds 2005-04-16  277  	/* Stage 4: something of a dummy, to report the shmems that are
^1da177e4 Linus Torvalds 2005-04-16  278  	 * still possible after stage 3.
^1da177e4 Linus Torvalds 2005-04-16  279  	 */
^1da177e4 Linus Torvalds 2005-04-16  280  	numprint = -1;
^1da177e4 Linus Torvalds 2005-04-16  281  	for (p = &shmems[0]; p < shmems + numshmems; p++) {
^1da177e4 Linus Torvalds 2005-04-16  282  		numprint++;
^1da177e4 Linus Torvalds 2005-04-16  283  		numprint %= 8;
^1da177e4 Linus Torvalds 2005-04-16  284  		if (!numprint) {
a34c0932c Joe Perches    2015-05-05  285  			arc_cont(D_INIT, "\n");
a34c0932c Joe Perches    2015-05-05  286  			arc_cont(D_INIT, "S4: ");
^1da177e4 Linus Torvalds 2005-04-16  287  		}
a34c0932c Joe Perches    2015-05-05  288  		arc_cont(D_INIT, "%lXh ", *p);
^1da177e4 Linus Torvalds 2005-04-16  289  	}
a34c0932c Joe Perches    2015-05-05  290  	arc_cont(D_INIT, "\n");
^1da177e4 Linus Torvalds 2005-04-16  291  
^1da177e4 Linus Torvalds 2005-04-16  292  	/* Stage 5: for any ports that have the correct status, can disable
^1da177e4 Linus Torvalds 2005-04-16  293  	 * the RESET flag, and (if no irq is given) generate an autoirq,
^1da177e4 Linus Torvalds 2005-04-16  294  	 * register an ARCnet device.
^1da177e4 Linus Torvalds 2005-04-16  295  	 *
^1da177e4 Linus Torvalds 2005-04-16  296  	 * Currently, we can only register one device per probe, so quit
^1da177e4 Linus Torvalds 2005-04-16  297  	 * after the first one is found.
^1da177e4 Linus Torvalds 2005-04-16  298  	 */
^1da177e4 Linus Torvalds 2005-04-16  299  	numprint = -1;
^1da177e4 Linus Torvalds 2005-04-16  300  	for (port = &ports[0]; port < ports + numports; port++) {
^1da177e4 Linus Torvalds 2005-04-16  301  		int found = 0;
01a1d5ac4 Joe Perches    2015-05-05  302  
^1da177e4 Linus Torvalds 2005-04-16  303  		numprint++;
^1da177e4 Linus Torvalds 2005-04-16  304  		numprint %= 8;
^1da177e4 Linus Torvalds 2005-04-16  305  		if (!numprint) {
a34c0932c Joe Perches    2015-05-05  306  			arc_cont(D_INIT, "\n");
a34c0932c Joe Perches    2015-05-05  307  			arc_cont(D_INIT, "S5: ");
^1da177e4 Linus Torvalds 2005-04-16  308  		}
a34c0932c Joe Perches    2015-05-05  309  		arc_cont(D_INIT, "%Xh ", *port);
^1da177e4 Linus Torvalds 2005-04-16  310  
^1da177e4 Linus Torvalds 2005-04-16  311  		ioaddr = *port;
09dfbcd5d Joe Perches    2015-05-05  312  		status = arcnet_inb(ioaddr, COM9026_REG_R_STATUS);
^1da177e4 Linus Torvalds 2005-04-16  313  
^1da177e4 Linus Torvalds 2005-04-16  314  		if ((status & 0x9D)
^1da177e4 Linus Torvalds 2005-04-16  315  		    != (NORXflag | RECONflag | TXFREEflag | RESETflag)) {
a34c0932c Joe Perches    2015-05-05  316  			arc_cont(D_INIT_REASONS, "(status=%Xh)\n", status);
a34c0932c Joe Perches    2015-05-05  317  			arc_cont(D_INIT_REASONS, "S5: ");
72aeea484 Joe Perches    2015-05-05  318  			if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  319  				numprint = 0;
^1da177e4 Linus Torvalds 2005-04-16  320  			release_region(*port, ARCNET_TOTAL_SIZE);
^1da177e4 Linus Torvalds 2005-04-16  321  			*port-- = ports[--numports];
^1da177e4 Linus Torvalds 2005-04-16  322  			continue;
^1da177e4 Linus Torvalds 2005-04-16  323  		}
09dfbcd5d Joe Perches    2015-05-05  324  		arcnet_outb(CFLAGScmd | RESETclear | CONFIGclear,
09dfbcd5d Joe Perches    2015-05-05  325  			    ioaddr, COM9026_REG_W_COMMAND);
09dfbcd5d Joe Perches    2015-05-05  326  		status = arcnet_inb(ioaddr, COM9026_REG_R_STATUS);
^1da177e4 Linus Torvalds 2005-04-16  327  		if (status & RESETflag) {
a34c0932c Joe Perches    2015-05-05  328  			arc_cont(D_INIT_REASONS, " (eternal reset, status=%Xh)\n",
^1da177e4 Linus Torvalds 2005-04-16  329  				 status);
a34c0932c Joe Perches    2015-05-05  330  			arc_cont(D_INIT_REASONS, "S5: ");
72aeea484 Joe Perches    2015-05-05  331  			if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  332  				numprint = 0;
^1da177e4 Linus Torvalds 2005-04-16  333  			release_region(*port, ARCNET_TOTAL_SIZE);
^1da177e4 Linus Torvalds 2005-04-16  334  			*port-- = ports[--numports];
^1da177e4 Linus Torvalds 2005-04-16  335  			continue;
^1da177e4 Linus Torvalds 2005-04-16  336  		}
^1da177e4 Linus Torvalds 2005-04-16  337  		/* skip this completely if an IRQ was given, because maybe
^1da177e4 Linus Torvalds 2005-04-16  338  		 * we're on a machine that locks during autoirq!
^1da177e4 Linus Torvalds 2005-04-16  339  		 */
^1da177e4 Linus Torvalds 2005-04-16  340  		if (!irq) {
^1da177e4 Linus Torvalds 2005-04-16  341  			/* if we do this, we're sure to get an IRQ since the
^1da177e4 Linus Torvalds 2005-04-16  342  			 * card has just reset and the NORXflag is on until
^1da177e4 Linus Torvalds 2005-04-16  343  			 * we tell it to start receiving.
^1da177e4 Linus Torvalds 2005-04-16  344  			 */
^1da177e4 Linus Torvalds 2005-04-16  345  			airqmask = probe_irq_on();
09dfbcd5d Joe Perches    2015-05-05  346  			arcnet_outb(NORXflag, ioaddr, COM9026_REG_W_INTMASK);
^1da177e4 Linus Torvalds 2005-04-16  347  			udelay(1);
09dfbcd5d Joe Perches    2015-05-05  348  			arcnet_outb(0, ioaddr, COM9026_REG_W_INTMASK);
^1da177e4 Linus Torvalds 2005-04-16  349  			airq = probe_irq_off(airqmask);
^1da177e4 Linus Torvalds 2005-04-16  350  
^1da177e4 Linus Torvalds 2005-04-16  351  			if (airq <= 0) {
a34c0932c Joe Perches    2015-05-05  352  				arc_cont(D_INIT_REASONS, "(airq=%d)\n", airq);
a34c0932c Joe Perches    2015-05-05  353  				arc_cont(D_INIT_REASONS, "S5: ");
72aeea484 Joe Perches    2015-05-05  354  				if (BUGLVL(D_INIT_REASONS))
72aeea484 Joe Perches    2015-05-05  355  					numprint = 0;
^1da177e4 Linus Torvalds 2005-04-16  356  				release_region(*port, ARCNET_TOTAL_SIZE);
^1da177e4 Linus Torvalds 2005-04-16  357  				*port-- = ports[--numports];
^1da177e4 Linus Torvalds 2005-04-16  358  				continue;
^1da177e4 Linus Torvalds 2005-04-16  359  			}
^1da177e4 Linus Torvalds 2005-04-16  360  		} else {
^1da177e4 Linus Torvalds 2005-04-16  361  			airq = irq;
^1da177e4 Linus Torvalds 2005-04-16  362  		}
^1da177e4 Linus Torvalds 2005-04-16  363  
a34c0932c Joe Perches    2015-05-05  364  		arc_cont(D_INIT, "(%d,", airq);
^1da177e4 Linus Torvalds 2005-04-16  365  		openparen = 1;
^1da177e4 Linus Torvalds 2005-04-16  366  
^1da177e4 Linus Torvalds 2005-04-16  367  		/* Everything seems okay.  But which shmem, if any, puts
^1da177e4 Linus Torvalds 2005-04-16  368  		 * back its signature byte when the card is reset?
^1da177e4 Linus Torvalds 2005-04-16  369  		 *
^1da177e4 Linus Torvalds 2005-04-16  370  		 * If there are multiple cards installed, there might be
^1da177e4 Linus Torvalds 2005-04-16  371  		 * multiple shmems still in the list.
^1da177e4 Linus Torvalds 2005-04-16  372  		 */
^1da177e4 Linus Torvalds 2005-04-16  373  #ifdef FAST_PROBE
^1da177e4 Linus Torvalds 2005-04-16  374  		if (numports > 1 || numshmems > 1) {
09dfbcd5d Joe Perches    2015-05-05  375  			arcnet_inb(ioaddr, COM9026_REG_R_RESET);
^1da177e4 Linus Torvalds 2005-04-16  376  			mdelay(RESETtime);
^1da177e4 Linus Torvalds 2005-04-16  377  		} else {
^1da177e4 Linus Torvalds 2005-04-16  378  			/* just one shmem and port, assume they match */
a11a5442d Joe Perches    2015-05-05  379  			arcnet_writeb(TESTvalue, iomem[0],
a11a5442d Joe Perches    2015-05-05  380  				      COM9026_REG_W_INTMASK);
^1da177e4 Linus Torvalds 2005-04-16  381  		}
^1da177e4 Linus Torvalds 2005-04-16  382  #else
09dfbcd5d Joe Perches    2015-05-05  383  		arcnet_inb(ioaddr, COM9026_REG_R_RESET);
^1da177e4 Linus Torvalds 2005-04-16  384  		mdelay(RESETtime);
^1da177e4 Linus Torvalds 2005-04-16  385  #endif
^1da177e4 Linus Torvalds 2005-04-16  386  
d0f6ecad3 Al Viro        2005-12-02  387  		for (index = 0; index < numshmems; index++) {
d0f6ecad3 Al Viro        2005-12-02  388  			u_long ptr = shmems[index];
d0f6ecad3 Al Viro        2005-12-02  389  			void __iomem *base = iomem[index];
^1da177e4 Linus Torvalds 2005-04-16  390  
a11a5442d Joe Perches    2015-05-05 @391  			if (arcnet_readb(base, COM9026_REG_R_STATUS) == TESTvalue) {	/* found one */
a34c0932c Joe Perches    2015-05-05  392  				arc_cont(D_INIT, "%lXh)\n", *p);
^1da177e4 Linus Torvalds 2005-04-16  393  				openparen = 0;
^1da177e4 Linus Torvalds 2005-04-16  394  
^1da177e4 Linus Torvalds 2005-04-16  395  				/* register the card */
d0f6ecad3 Al Viro        2005-12-02  396  				if (com90xx_found(*port, airq, ptr, base) == 0)
^1da177e4 Linus Torvalds 2005-04-16  397  					found = 1;
^1da177e4 Linus Torvalds 2005-04-16  398  				numprint = -1;
^1da177e4 Linus Torvalds 2005-04-16  399  
^1da177e4 Linus Torvalds 2005-04-16  400  				/* remove shmem from the list */
d0f6ecad3 Al Viro        2005-12-02  401  				shmems[index] = shmems[--numshmems];
d0f6ecad3 Al Viro        2005-12-02  402  				iomem[index] = iomem[numshmems];
^1da177e4 Linus Torvalds 2005-04-16  403  				break;	/* go to the next I/O port */
^1da177e4 Linus Torvalds 2005-04-16  404  			} else {
a11a5442d Joe Perches    2015-05-05  405  				arc_cont(D_INIT_REASONS, "%Xh-",
a11a5442d Joe Perches    2015-05-05  406  					 arcnet_readb(base, COM9026_REG_R_STATUS));
^1da177e4 Linus Torvalds 2005-04-16  407  			}
^1da177e4 Linus Torvalds 2005-04-16  408  		}
^1da177e4 Linus Torvalds 2005-04-16  409  
^1da177e4 Linus Torvalds 2005-04-16  410  		if (openparen) {
72aeea484 Joe Perches    2015-05-05  411  			if (BUGLVL(D_INIT))
05a24b234 Joe Perches    2015-05-05  412  				pr_cont("no matching shmem)\n");
72aeea484 Joe Perches    2015-05-05  413  			if (BUGLVL(D_INIT_REASONS)) {
05a24b234 Joe Perches    2015-05-05  414  				pr_cont("S5: ");
72aeea484 Joe Perches    2015-05-05  415  				numprint = 0;
72aeea484 Joe Perches    2015-05-05  416  			}
^1da177e4 Linus Torvalds 2005-04-16  417  		}
^1da177e4 Linus Torvalds 2005-04-16  418  		if (!found)
^1da177e4 Linus Torvalds 2005-04-16  419  			release_region(*port, ARCNET_TOTAL_SIZE);
^1da177e4 Linus Torvalds 2005-04-16  420  		*port-- = ports[--numports];
^1da177e4 Linus Torvalds 2005-04-16  421  	}
^1da177e4 Linus Torvalds 2005-04-16  422  
72aeea484 Joe Perches    2015-05-05  423  	if (BUGLVL(D_INIT_REASONS))
05a24b234 Joe Perches    2015-05-05  424  		pr_cont("\n");
^1da177e4 Linus Torvalds 2005-04-16  425  
^1da177e4 Linus Torvalds 2005-04-16  426  	/* Now put back TESTvalue on all leftover shmems. */
d0f6ecad3 Al Viro        2005-12-02  427  	for (index = 0; index < numshmems; index++) {
a11a5442d Joe Perches    2015-05-05  428  		arcnet_writeb(TESTvalue, iomem[index], COM9026_REG_W_INTMASK);
d0f6ecad3 Al Viro        2005-12-02  429  		iounmap(iomem[index]);
d0f6ecad3 Al Viro        2005-12-02  430  		release_mem_region(shmems[index], MIRROR_SIZE);
^1da177e4 Linus Torvalds 2005-04-16  431  	}
d0f6ecad3 Al Viro        2005-12-02  432  	kfree(shmems);
d0f6ecad3 Al Viro        2005-12-02  433  	kfree(iomem);
^1da177e4 Linus Torvalds 2005-04-16  434  }
^1da177e4 Linus Torvalds 2005-04-16  435  

:::::: The code at line 233 was first introduced by commit
:::::: a11a5442d108357d44d34407ce2ed9d77ab424a0 arcnet: com90xx: Use arcnet_readb/writeb routines

:::::: TO: Joe Perches <joe@perches.com>
:::::: CC: Michael Grzeschik <m.grzeschik@pengutronix.de>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply

* Re: [PATCH v2 0/3] Add Renesas R8A77980 GEther support
From: David Miller @ 2018-05-20  3:25 UTC (permalink / raw)
  To: sergei.shtylyov
  Cc: netdev, devicetree, robh+dt, mark.rutland, linux-renesas-soc
In-Reply-To: <f30c98ff-f6da-9e7f-c637-49076a428885@cogentembedded.com>

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 18 May 2018 21:28:29 +0300

> Here's a set of 3 patches against DaveM's 'net-next.git' repo. They (gradually)
> add R8A77980 GEther support to the 'sh_eth' driver, starting with couple new
> register bits/values introduced with this chip, and ending with adding a new
> 'struct sh_eth_cpu_data' instance connected to the new DT "compatible" prop
> value...

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] net: dsa: b53: Extend platform data to include DSA ports
From: Florian Fainelli @ 2018-05-20  3:14 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, vivien.didelot, open list
In-Reply-To: <20180520014250.GB14906@lunn.ch>

On May 19, 2018 6:42:50 PM PDT, Andrew Lunn <andrew@lunn.ch> wrote:
>On Sat, May 19, 2018 at 03:55:10PM -0700, Florian Fainelli wrote:
>> Provide a means for !OF platforms to supply their DSA platform data
>> configuration using the dsa_platform_data structure.
>
>Hi Florian
>
>It seems a bit odd adding the header file, but no code. Yes, this will
>help simplify the merge dependencies for the ZII boards next cycle,
>but can we have the actual code as well?

The existing b53_common.c file already makes use of platform data the only thing that was missing was a dsa_chip_data structure correctly placed for the core DSA layer to obtain port information. This was present from day one in the b53 driver because it is also the mechanism used by the bus specific drivers to pass information to the core b53 driver file.
Hi Andrew,
-- 
Florian

^ permalink raw reply

* Re: [net-next 0/2][pull request] 40GbE Intel Wired LAN Driver Updates 2018-05-18
From: David Miller @ 2018-05-20  3:04 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
In-Reply-To: <20180518165947.20948-1-jeffrey.t.kirsher@intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 18 May 2018 09:59:45 -0700

> Mitch shortens the ethtool link settings API function names to help
> reduce the amount of line wrapping done in the drivers, and also to make
> the ethtool link settings API functions less windows like (i.e. function
> names that are full sentences).  Since we do not have all the hardware
> available from all the other vendors, we did only compile testing for
> most of the non-Intel drivers.

This is so much churn, which is going to cause -stable backport pains.

The time to bike shed interface names is not after hundreds of drivers
have been converted to use them, but rather beforehand.

Sorry, I'm very much not inclined to apply this.

Thanks.

^ permalink raw reply

* Re: [PATCH] net: sched: don't disable bh when accessing action idr
From: David Miller @ 2018-05-20  3:02 UTC (permalink / raw)
  To: vladbu; +Cc: xiyou.wangcong, netdev, jhs, jiri, linux-kernel
In-Reply-To: <vbflgcgnece.fsf@reg-r-vrt-018-180.mtr.labs.mlnx>

From: Vlad Buslov <vladbu@mellanox.com>
Date: Sat, 19 May 2018 13:12:49 +0300

> 
> On Sat 19 May 2018 at 02:59, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> On Fri, May 18, 2018 at 8:45 AM, Vlad Buslov <vladbu@mellanox.com> wrote:
>>> Underlying implementation of action map has changed and doesn't require
>>> disabling bh anymore. Replace all action idr spinlock usage with regular
>>> calls that do not disable bh.
>>
>> Please explain explicitly why it is not required, don't let people
>> dig, this would save everyone's time.
> 
> Underlying implementation of actions lookup has changed from hashtable
> to idr. Every current action implementation just calls act_api lookup
> function instead of implementing its own lookup. I asked author of idr
> change if there is a reason to continue to use _bh versions and he
> replied that he just left them as-is.

A detailed analysis of the locking requirements both before and
after the IDR changes needs to be in you commit message.

Nobody who reads this from scratch understands all of this background
material, so how can anyone reading your patch review it properly and
understand it?

^ permalink raw reply

* Re: [PATCH net-next] tipc: eliminate complaint of KMSAN uninit-value in tipc_conn_rcv_sub
From: David Miller @ 2018-05-20  3:00 UTC (permalink / raw)
  To: ying.xue; +Cc: netdev, jon.maloy, syzkaller-bugs, tipc-discussion
In-Reply-To: <1526644255-9182-1-git-send-email-ying.xue@windriver.com>

From: Ying Xue <ying.xue@windriver.com>
Date: Fri, 18 May 2018 19:50:55 +0800

> As variable s of struct tipc_subscr type is not initialized
> in tipc_conn_rcv_from_sock() before it is used in tipc_conn_rcv_sub(),
> KMSAN reported the following uninit-value type complaint:

I agree with others that the short read is the bug.

You need to decide what should happen if not a full tipc_subscr object
is obtained from the sock_recvmsg() call.

Proceeding to pass it on to tipc_conn_rcv_sub() cannot possibly be
correct.

You're not getting what you are expecting from the peer, the memset()
you are adding doesn't change that.

And once you get this badly sized read, what does that do to
the stream of subsequent recvmsg calls here?

^ permalink raw reply

* Re: [PATCH 1/4] arcnet: com20020: Add com20020 io mapped version
From: kbuild test robot @ 2018-05-20  2:59 UTC (permalink / raw)
  To: Andrea Greco
  Cc: kbuild-all, tobin, andrea.greco.gapmilano, Andrea Greco,
	Michael Grzeschik, linux-kernel, netdev
In-Reply-To: <20180517130529.2684-1-andrea.greco.gapmilano@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 11468 bytes --]

Hi Andrea,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]
[also build test WARNING on v4.17-rc5 next-20180517]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Andrea-Greco/arcnet-com20020-Add-com20020-io-mapped-version/20180520-083936
config: alpha-allmodconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=alpha 

All warnings (new ones prefixed by >>):

   In file included from drivers/net/arcnet/com20020-isa.c:44:0:
   drivers/net/arcnet/com20020.h: In function 'com20020_set_subaddress':
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com20020.h:126:3: note: in expansion of macro 'arcnet_outb'
      arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG);
      ^~~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com20020.h:128:3: note: in expansion of macro 'arcnet_outb'
      arcnet_outb(val, ioaddr, COM20020_REG_W_SUBADR);
      ^~~~~~~~~~~
   drivers/net/arcnet/com20020-isa.c: In function 'com20020isa_probe':
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
>> drivers/net/arcnet/com20020-isa.c:70:6: note: in expansion of macro 'arcnet_inb'
     if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) {
         ^~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/arcdevice.h:88:28: note: in expansion of macro 'arcnet_inb'
       netdev_warn(dev, fmt, ##__VA_ARGS__);  \
                               ^~~~~~~~~~~
>> drivers/net/arcnet/com20020-isa.c:85:3: note: in expansion of macro 'arc_printk'
      arc_printk(D_INIT_REASONS, dev, "intmask was %02Xh\n",
      ^~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   drivers/net/arcnet/arcdevice.h:90:28: note: in expansion of macro 'arcnet_inb'
       netdev_info(dev, fmt, ##__VA_ARGS__);  \
                               ^~~~~~~~~~~
>> drivers/net/arcnet/com20020-isa.c:85:3: note: in expansion of macro 'arc_printk'
      arc_printk(D_INIT_REASONS, dev, "intmask was %02Xh\n",
      ^~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:376:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     ioread8((void __iomem *)(addr) + BUS_ALIGN * offset)
             ^
   include/linux/dynamic_debug.h:144:12: note: in expansion of macro 'arcnet_inb'
             ##__VA_ARGS__);  \
               ^~~~~~~~~~~
   include/linux/netdevice.h:4419:2: note: in expansion of macro 'dynamic_netdev_dbg'
     dynamic_netdev_dbg(__dev, format, ##args);  \
     ^~~~~~~~~~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:92:4: note: in expansion of macro 'netdev_dbg'
       netdev_dbg(dev, fmt, ##__VA_ARGS__);  \
       ^~~~~~~~~~
>> drivers/net/arcnet/com20020-isa.c:85:3: note: in expansion of macro 'arc_printk'
      arc_printk(D_INIT_REASONS, dev, "intmask was %02Xh\n",
      ^~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
>> drivers/net/arcnet/com20020-isa.c:87:3: note: in expansion of macro 'arcnet_outb'
      arcnet_outb(0, ioaddr, COM20020_REG_W_INTMASK);
      ^~~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com20020-isa.c:89:3: note: in expansion of macro 'arcnet_outb'
      arcnet_outb(NORXflag, ioaddr, COM20020_REG_W_INTMASK);
      ^~~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com20020-isa.c:91:3: note: in expansion of macro 'arcnet_outb'
      arcnet_outb(0, ioaddr, COM20020_REG_W_INTMASK);
      ^~~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com20020-isa.c:97:4: note: in expansion of macro 'arcnet_outb'
       arcnet_outb(NORXflag, ioaddr, COM20020_REG_W_INTMASK);
       ^~~~~~~~~~~
   drivers/net/arcnet/arcdevice.h:379:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     iowrite8(value, (void __iomem *)addr + BUS_ALIGN * offset)
                     ^
   drivers/net/arcnet/com20020-isa.c:99:4: note: in expansion of macro 'arcnet_outb'
       arcnet_outb(0, ioaddr, COM20020_REG_W_INTMASK);
       ^~~~~~~~~~~

vim +/arcnet_inb +70 drivers/net/arcnet/com20020-isa.c

26c6d281 Joe Perches    2015-05-05   46  
f2f0a16b Joe Perches    2015-05-05   47  /* We cannot (yet) probe for an IO mapped card, although we can check that
^1da177e Linus Torvalds 2005-04-16   48   * it's where we were told it was, and even do autoirq.
^1da177e Linus Torvalds 2005-04-16   49   */
^1da177e Linus Torvalds 2005-04-16   50  static int __init com20020isa_probe(struct net_device *dev)
^1da177e Linus Torvalds 2005-04-16   51  {
^1da177e Linus Torvalds 2005-04-16   52  	int ioaddr;
^1da177e Linus Torvalds 2005-04-16   53  	unsigned long airqmask;
454d7c9b Wang Chen      2008-11-12   54  	struct arcnet_local *lp = netdev_priv(dev);
^1da177e Linus Torvalds 2005-04-16   55  	int err;
^1da177e Linus Torvalds 2005-04-16   56  
72aeea48 Joe Perches    2015-05-05   57  	if (BUGLVL(D_NORMAL))
05a24b23 Joe Perches    2015-05-05   58  		pr_info("%s\n", "COM20020 ISA support (by David Woodhouse et al.)");
^1da177e Linus Torvalds 2005-04-16   59  
^1da177e Linus Torvalds 2005-04-16   60  	ioaddr = dev->base_addr;
^1da177e Linus Torvalds 2005-04-16   61  	if (!ioaddr) {
a34c0932 Joe Perches    2015-05-05   62  		arc_printk(D_NORMAL, dev, "No autoprobe (yet) for IO mapped cards; you must specify the base address!\n");
^1da177e Linus Torvalds 2005-04-16   63  		return -ENODEV;
^1da177e Linus Torvalds 2005-04-16   64  	}
^1da177e Linus Torvalds 2005-04-16   65  	if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "arcnet (COM20020)")) {
a34c0932 Joe Perches    2015-05-05   66  		arc_printk(D_NORMAL, dev, "IO region %xh-%xh already allocated.\n",
^1da177e Linus Torvalds 2005-04-16   67  			   ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1);
^1da177e Linus Torvalds 2005-04-16   68  		return -ENXIO;
^1da177e Linus Torvalds 2005-04-16   69  	}
0fec6513 Joe Perches    2015-05-05  @70  	if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) {
a34c0932 Joe Perches    2015-05-05   71  		arc_printk(D_NORMAL, dev, "IO address %x empty\n", ioaddr);
^1da177e Linus Torvalds 2005-04-16   72  		err = -ENODEV;
^1da177e Linus Torvalds 2005-04-16   73  		goto out;
^1da177e Linus Torvalds 2005-04-16   74  	}
^1da177e Linus Torvalds 2005-04-16   75  	if (com20020_check(dev)) {
^1da177e Linus Torvalds 2005-04-16   76  		err = -ENODEV;
^1da177e Linus Torvalds 2005-04-16   77  		goto out;
^1da177e Linus Torvalds 2005-04-16   78  	}
^1da177e Linus Torvalds 2005-04-16   79  
^1da177e Linus Torvalds 2005-04-16   80  	if (!dev->irq) {
^1da177e Linus Torvalds 2005-04-16   81  		/* if we do this, we're sure to get an IRQ since the
^1da177e Linus Torvalds 2005-04-16   82  		 * card has just reset and the NORXflag is on until
^1da177e Linus Torvalds 2005-04-16   83  		 * we tell it to start receiving.
^1da177e Linus Torvalds 2005-04-16   84  		 */
a34c0932 Joe Perches    2015-05-05  @85  		arc_printk(D_INIT_REASONS, dev, "intmask was %02Xh\n",
0fec6513 Joe Perches    2015-05-05   86  			   arcnet_inb(ioaddr, COM20020_REG_R_STATUS));
0fec6513 Joe Perches    2015-05-05  @87  		arcnet_outb(0, ioaddr, COM20020_REG_W_INTMASK);
^1da177e Linus Torvalds 2005-04-16   88  		airqmask = probe_irq_on();
0fec6513 Joe Perches    2015-05-05   89  		arcnet_outb(NORXflag, ioaddr, COM20020_REG_W_INTMASK);
^1da177e Linus Torvalds 2005-04-16   90  		udelay(1);
0fec6513 Joe Perches    2015-05-05   91  		arcnet_outb(0, ioaddr, COM20020_REG_W_INTMASK);
^1da177e Linus Torvalds 2005-04-16   92  		dev->irq = probe_irq_off(airqmask);
^1da177e Linus Torvalds 2005-04-16   93  
0a6efc78 Dan Carpenter  2010-07-17   94  		if ((int)dev->irq <= 0) {
a34c0932 Joe Perches    2015-05-05   95  			arc_printk(D_INIT_REASONS, dev, "Autoprobe IRQ failed first time\n");
^1da177e Linus Torvalds 2005-04-16   96  			airqmask = probe_irq_on();
0fec6513 Joe Perches    2015-05-05   97  			arcnet_outb(NORXflag, ioaddr, COM20020_REG_W_INTMASK);
^1da177e Linus Torvalds 2005-04-16   98  			udelay(5);
0fec6513 Joe Perches    2015-05-05   99  			arcnet_outb(0, ioaddr, COM20020_REG_W_INTMASK);
^1da177e Linus Torvalds 2005-04-16  100  			dev->irq = probe_irq_off(airqmask);
0a6efc78 Dan Carpenter  2010-07-17  101  			if ((int)dev->irq <= 0) {
a34c0932 Joe Perches    2015-05-05  102  				arc_printk(D_NORMAL, dev, "Autoprobe IRQ failed.\n");
^1da177e Linus Torvalds 2005-04-16  103  				err = -ENODEV;
^1da177e Linus Torvalds 2005-04-16  104  				goto out;
^1da177e Linus Torvalds 2005-04-16  105  			}
^1da177e Linus Torvalds 2005-04-16  106  		}
^1da177e Linus Torvalds 2005-04-16  107  	}
^1da177e Linus Torvalds 2005-04-16  108  
^1da177e Linus Torvalds 2005-04-16  109  	lp->card_name = "ISA COM20020";
97464edd Joe Perches    2015-05-05  110  
97464edd Joe Perches    2015-05-05  111  	err = com20020_found(dev, 0);
97464edd Joe Perches    2015-05-05  112  	if (err != 0)
^1da177e Linus Torvalds 2005-04-16  113  		goto out;
^1da177e Linus Torvalds 2005-04-16  114  
^1da177e Linus Torvalds 2005-04-16  115  	return 0;
^1da177e Linus Torvalds 2005-04-16  116  
^1da177e Linus Torvalds 2005-04-16  117  out:
^1da177e Linus Torvalds 2005-04-16  118  	release_region(ioaddr, ARCNET_TOTAL_SIZE);
^1da177e Linus Torvalds 2005-04-16  119  	return err;
^1da177e Linus Torvalds 2005-04-16  120  }
^1da177e Linus Torvalds 2005-04-16  121  

:::::: The code at line 70 was first introduced by commit
:::::: 0fec65130b9f11a73d74f47025491f97f82ba070 arcnet: com20020: Use arcnet_<I/O> routines

:::::: TO: Joe Perches <joe@perches.com>
:::::: CC: Michael Grzeschik <m.grzeschik@pengutronix.de>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 52431 bytes --]

^ permalink raw reply

* Re: [PATCH net-next] net: mvpp2: Add missing VLAN tag detection
From: David Miller @ 2018-05-20  2:55 UTC (permalink / raw)
  To: maxime.chevallier
  Cc: netdev, linux-kernel, antoine.tenart, thomas.petazzoni,
	gregory.clement, miquel.raynal, nadavh, stefanc, ymarkman, mw
In-Reply-To: <20180518073339.5353-1-maxime.chevallier@bootlin.com>

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Fri, 18 May 2018 09:33:39 +0200

> Marvell PPv2 Header Parser sets some bits in the 'result_info' field in
> each lookup iteration, to identify different packet attributes such as
> DSA / VLAN tag, protocol infos, etc. This is used in further
> classification stages in the controller.
> 
> It's the DSA tag detection entry that is in charge of detecting when there
> is a single VLAN tag.
> 
> This commits adds the missing update of the result_info in this case.
> 
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH RFC net-next 1/1] tcp: close socket without reset on incoming data
From: David Miller @ 2018-05-20  2:52 UTC (permalink / raw)
  To: dbanerje; +Cc: netdev, kuznet, yoshfuji
In-Reply-To: <81782a41a6ed449286225d97f43c6298@ustx2ex-dag1mb2.msg.corp.akamai.com>

From: "Banerjee, Debabrata" <dbanerje@akamai.com>
Date: Sat, 19 May 2018 22:57:48 +0000

> It does the same thing the application would do, but with much less
> overhead. The application called close() because it no longer cares
> about new data, but it still expected send() prior to close() to
> actually send.

It's not the same.

If you just sink the data in the protocol stack, the sender has no
way whatsoever to know that the application did not see the data.

The sender must have a way to know that the application at the other
end received the data, whether they used it or not.  And what breaks
the ambiguity is that reset.

This is critcially important.

> Well if the intersection with the definition of the close() spooks
> you something similar could be implemented as a
> setsockopt(TCP_SINK_DATA) around shutdown(), to instruct the socket
> to immediately dump data, but with higher resource usage. However as
> above, I don't currently believe this patch violates the protocol.

The SHOULD you quoted in RFC 1122 is explicitly listed in a another
RFC as an explicitly recommended behavior.  I know, because that text
is what led me to implement the current behavior.

Please see RFC 2525, section 2.16: Failure to send a RST after Half
Duplex Close.

^ permalink raw reply

* hello from laminata
From: Laminata @ 2018-05-20  2:51 UTC (permalink / raw)


Hello, Happy weekend,
Please contact me on my direct email, laminatasufuk@gmail.com, i have
something important to discuss with you,
Hope to read from you soonest,
Yours beloved Laminata

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox