Netdev List
 help / color / mirror / Atom feed
* 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

* Re: [PATCH 1/4] arcnet: com20020: Add com20020 io mapped version
From: kbuild test robot @ 2018-05-20  2:13 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: 32183 bytes --]

Hi Andrea,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]
[also build test ERROR 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: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   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__);  \
                               ^~~~~~~~~~~
   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__);  \
                               ^~~~~~~~~~~
   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)
             ^
   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/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/com90xx.c:599:3: note: in expansion of macro 'arcnet_inb'
      arcnet_inb(ioaddr, COM9026_REG_R_RESET);
--
   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

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

^ permalink raw reply

* Re: INFO: task hung in tls_push_record
From: syzbot @ 2018-05-20  2:03 UTC (permalink / raw)
  To: aviadye, borisp, davejwatson, davem, linux-kernel, netdev,
	syzkaller-bugs
In-Reply-To: <00000000000042f064056b8d004d@google.com>

syzbot has found a reproducer for the following crash on:

HEAD commit:    eb38401c779d net: stmmac: Populate missing callbacks in HW..
git tree:       net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=16d0820f800000
kernel config:  https://syzkaller.appspot.com/x/.config?x=b632d8e2c2ab2c1
dashboard link: https://syzkaller.appspot.com/bug?extid=4006516aae0b06e7050f
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
syzkaller repro:https://syzkaller.appspot.com/x/repro.syz?x=10f6927b800000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15b7a20f800000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+4006516aae0b06e7050f@syzkaller.appspotmail.com

INFO: task syz-executor793:4489 blocked for more than 120 seconds.
       Not tainted 4.17.0-rc4+ #52
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor793 D23464  4489   4486 0x00000000
Call Trace:
  context_switch kernel/sched/core.c:2848 [inline]
  __schedule+0x801/0x1e30 kernel/sched/core.c:3490
  schedule+0xef/0x430 kernel/sched/core.c:3549
  schedule_timeout+0x1b5/0x240 kernel/time/timer.c:1777
  do_wait_for_common kernel/sched/completion.c:83 [inline]
  __wait_for_common kernel/sched/completion.c:104 [inline]
  wait_for_common kernel/sched/completion.c:115 [inline]
  wait_for_completion+0x3e7/0x870 kernel/sched/completion.c:136
  crypto_wait_req include/linux/crypto.h:512 [inline]
  tls_do_encryption net/tls/tls_sw.c:217 [inline]
  tls_push_record+0xedc/0x13e0 net/tls/tls_sw.c:248
  tls_sw_sendmsg+0x8d7/0x12b0 net/tls/tls_sw.c:440
  inet_sendmsg+0x19f/0x690 net/ipv4/af_inet.c:798
  sock_sendmsg_nosec net/socket.c:629 [inline]
  sock_sendmsg+0xd5/0x120 net/socket.c:639
  __sys_sendto+0x3d7/0x670 net/socket.c:1789
  __do_sys_sendto net/socket.c:1801 [inline]
  __se_sys_sendto net/socket.c:1797 [inline]
  __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1797
  do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4457d9
RSP: 002b:00007fa388d06da8 EFLAGS: 00000216 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00000000006dac24 RCX: 00000000004457d9
RDX: 00000000fffffdef RSI: 00000000200005c0 RDI: 0000000000000022
RBP: 00000000006dac20 R08: 0000000020000000 R09: 000000000000001c
R10: 0000000000000000 R11: 0000000000000216 R12: 0000000000000000
R13: 00007ffd5148ecaf R14: 00007fa388d079c0 R15: 0000000000000001

Showing all locks held in the system:
2 locks held by khungtaskd/892:
  #0: 000000009dfaae0c (rcu_read_lock){....}, at:  
check_hung_uninterruptible_tasks kernel/hung_task.c:175 [inline]
  #0: 000000009dfaae0c (rcu_read_lock){....}, at: watchdog+0x1ff/0xf60  
kernel/hung_task.c:249
  #1: 0000000058f79a8d (tasklist_lock){.+.+}, at:  
debug_show_all_locks+0xde/0x34a kernel/locking/lockdep.c:4470
1 lock held by rsyslogd/4370:
  #0: 0000000059c3c7ae (&f->f_pos_lock){+.+.}, at: __fdget_pos+0x1a9/0x1e0  
fs/file.c:766
2 locks held by getty/4460:
  #0: 00000000e25a52c3 (&tty->ldisc_sem){++++}, at:  
ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
  #1: 000000002caea50f (&ldata->atomic_read_lock){+.+.}, at:  
n_tty_read+0x321/0x1cc0 drivers/tty/n_tty.c:2131
2 locks held by getty/4461:
  #0: 00000000d38c9806 (&tty->ldisc_sem){++++}, at:  
ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
  #1: 00000000eaffe99d (&ldata->atomic_read_lock){+.+.}, at:  
n_tty_read+0x321/0x1cc0 drivers/tty/n_tty.c:2131
2 locks held by getty/4462:
  #0: 00000000cec6abe7 (&tty->ldisc_sem){++++}, at:  
ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
  #1: 0000000000afd91c (&ldata->atomic_read_lock){+.+.}, at:  
n_tty_read+0x321/0x1cc0 drivers/tty/n_tty.c:2131
2 locks held by getty/4463:
  #0: 000000003456fca5 (&tty->ldisc_sem){++++}, at:  
ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
  #1: 0000000038a65d91 (&ldata->atomic_read_lock){+.+.}, at:  
n_tty_read+0x321/0x1cc0 drivers/tty/n_tty.c:2131
2 locks held by getty/4464:
  #0: 0000000001e783b1 (&tty->ldisc_sem){++++}, at:  
ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
  #1: 000000003ecd2e34 (&ldata->atomic_read_lock){+.+.}, at:  
n_tty_read+0x321/0x1cc0 drivers/tty/n_tty.c:2131
2 locks held by getty/4465:
  #0: 000000007ef8b451 (&tty->ldisc_sem){++++}, at:  
ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
  #1: 000000006996c3ed (&ldata->atomic_read_lock){+.+.}, at:  
n_tty_read+0x321/0x1cc0 drivers/tty/n_tty.c:2131
2 locks held by getty/4466:
  #0: 00000000d15d9a92 (&tty->ldisc_sem){++++}, at:  
ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365
  #1: 00000000ee44bcf4 (&ldata->atomic_read_lock){+.+.}, at:  
n_tty_read+0x321/0x1cc0 drivers/tty/n_tty.c:2131
1 lock held by syz-executor793/4489:
  #0: 0000000008c84b0d (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 0000000008c84b0d (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4494:
  #0: 00000000f2de7555 (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 00000000f2de7555 (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4499:
  #0: 0000000058a54751 (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 0000000058a54751 (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4504:
  #0: 0000000045694cb9 (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 0000000045694cb9 (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4509:
  #0: 00000000b663e61f (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 00000000b663e61f (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4514:
  #0: 00000000603baf06 (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 00000000603baf06 (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4519:
  #0: 00000000344afb7e (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 00000000344afb7e (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4524:
  #0: 000000004aa3e1ce (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 000000004aa3e1ce (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4529:
  #0: 00000000b6c4b2ea (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 00000000b6c4b2ea (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4534:
  #0: 000000005bae881e (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 000000005bae881e (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4539:
  #0: 000000004b04f235 (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 000000004b04f235 (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4544:
  #0: 00000000b5888be7 (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 00000000b5888be7 (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4549:
  #0: 00000000e902c819 (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 00000000e902c819 (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4554:
  #0: 000000009cd1d95e (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 000000009cd1d95e (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4559:
  #0: 000000001f3edf17 (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 000000001f3edf17 (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384
1 lock held by syz-executor793/4563:
  #0: 00000000802085f8 (sk_lock-AF_INET6){+.+.}, at: lock_sock  
include/net/sock.h:1474 [inline]
  #0: 00000000802085f8 (sk_lock-AF_INET6){+.+.}, at:  
tls_sw_sendmsg+0x1b9/0x12b0 net/tls/tls_sw.c:384

=============================================

NMI backtrace for cpu 0
CPU: 0 PID: 892 Comm: khungtaskd Not tainted 4.17.0-rc4+ #52
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Call Trace:
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x1b9/0x294 lib/dump_stack.c:113
  nmi_cpu_backtrace.cold.4+0x19/0xce lib/nmi_backtrace.c:103
  nmi_trigger_cpumask_backtrace+0x151/0x192 lib/nmi_backtrace.c:62
  arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38
  trigger_all_cpu_backtrace include/linux/nmi.h:138 [inline]
  check_hung_task kernel/hung_task.c:132 [inline]
  check_hung_uninterruptible_tasks kernel/hung_task.c:190 [inline]
  watchdog+0xc10/0xf60 kernel/hung_task.c:249
  kthread+0x345/0x410 kernel/kthread.c:238
  ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 4486 Comm: sshd Not tainted 4.17.0-rc4+ #52
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:__debug_object_init+0x25/0x12c0 lib/debugobjects.c:371
RSP: 0018:ffff8801b30f73d0 EFLAGS: 00000a02
RAX: 1ffff1003661ee3d RBX: ffff8801b30f7440 RCX: ffffffff877175fb
RDX: 0000000000000001 RSI: ffffffff88d9a5e0 RDI: ffff8801b30f7440
RBP: ffff8801b30f73f0 R08: ffff8801b0a10740 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801b30f73c8
R13: dffffc0000000000 R14: ffff8801b30f74c0 R15: 0000000000000001
FS:  00007f15863b87c0(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f38c25af9ce CR3: 00000001d0b17000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  debug_object_init_on_stack+0x19/0x20 lib/debugobjects.c:444
  hrtimer_init_on_stack kernel/time/hrtimer.c:435 [inline]
  schedule_hrtimeout_range_clock+0xcc/0x470 kernel/time/hrtimer.c:1936
  schedule_hrtimeout_range+0x2a/0x40 kernel/time/hrtimer.c:1989
  poll_schedule_timeout+0x11a/0x200 fs/select.c:243
  do_select+0x1606/0x1ae0 fs/select.c:581
  core_sys_select+0x768/0xb60 fs/select.c:655
  kern_select+0x1b7/0x250 fs/select.c:696
  __do_sys_select fs/select.c:705 [inline]
  __se_sys_select fs/select.c:702 [inline]
  __x64_sys_select+0xbe/0x150 fs/select.c:702
  do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f1584758dd3
RSP: 002b:00007ffe596ca1f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000017
RAX: ffffffffffffffda RBX: 00007ffe596ca280 RCX: 00007f1584758dd3
RDX: 000055a15612aab0 RSI: 000055a15612aad0 RDI: 000000000000000c
RBP: 000055a1559bf8dc R08: 00007ffe596ca220 R09: 0101010101010101
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe596ca288
R13: 0000000000000000 R14: 00007ffe596ca278 R15: 00007ffe596ca27c
Code: 84 00 00 00 00 00 55 48 89 e5 41 57 41 56 48 8d 85 f8 fd ff ff 41 55  
48 c1 e8 03 49 bd 00 00 00 00 00 fc ff df 41 54 4c 8d 65 d8 <53> 48 89 fb  
48 81 ec 30 02 00 00 48 89 85 d8 fd ff ff 4c 01 e8

^ permalink raw reply

* Re: INFO: rcu detected stall in is_bpf_text_address
From: Marcelo Ricardo Leitner @ 2018-05-20  1:45 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: syzbot, ast, daniel, linux-kernel, netdev, syzkaller-bugs,
	Xin Long
In-Reply-To: <4b65142a-cf3b-05d7-d66b-018ff8da7ccc@gmail.com>

On Sat, May 19, 2018 at 08:57:19AM -0700, Eric Dumazet wrote:
> SCTP experts, please take a look.

Ugh, same sctp footprint as in the other reports.

>
> >  _sctp_make_chunk+0x58/0x280 net/sctp/sm_make_chunk.c:1417
> >  sctp_make_control net/sctp/sm_make_chunk.c:1464 [inline]
> >  sctp_make_heartbeat+0x8f/0x430 net/sctp/sm_make_chunk.c:1177
> >  sctp_sf_heartbeat.isra.23+0x26/0x180 net/sctp/sm_statefuns.c:1005
> >  sctp_sf_sendbeat_8_3+0x38e/0x550 net/sctp/sm_statefuns.c:1049
> >  sctp_do_sm+0x1ab/0x7160 net/sctp/sm_sideeffect.c:1188
> >  sctp_generate_heartbeat_event+0x218/0x450 net/sctp/sm_sideeffect.c:406
> >  call_timer_fn+0x230/0x940 kernel/time/timer.c:1326
> >  expire_timers kernel/time/timer.c:1363 [inline]
> >  __run_timers+0x79e/0xc50 kernel/time/timer.c:1666
> >  run_timer_softirq+0x4c/0x70 kernel/time/timer.c:1692

^ permalink raw reply

* Re: [PATCH net-next] net: dsa: b53: Extend platform data to include DSA ports
From: Andrew Lunn @ 2018-05-20  1:42 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, vivien.didelot, open list
In-Reply-To: <20180519225510.23820-1-f.fainelli@gmail.com>

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?

    Thanks
	Andrew
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  include/linux/platform_data/b53.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/platform_data/b53.h b/include/linux/platform_data/b53.h
> index 69d279c0da96..8eaef2f2b691 100644
> --- a/include/linux/platform_data/b53.h
> +++ b/include/linux/platform_data/b53.h
> @@ -20,8 +20,12 @@
>  #define __B53_H
>  
>  #include <linux/kernel.h>
> +#include <net/dsa.h>
>  
>  struct b53_platform_data {
> +	/* Must be first such that dsa_register_switch() can access it */
> +	struct dsa_chip_data cd;
> +
>  	u32 chip_id;
>  	u16 enabled_ports;
>  
> -- 
> 2.14.1
> 

^ permalink raw reply

* RE: [PATCH RFC net-next 1/1] tcp: close socket without reset on incoming data
From: Banerjee, Debabrata @ 2018-05-19 22:57 UTC (permalink / raw)
  To: 'David Miller'
  Cc: netdev@vger.kernel.org, kuznet@ms2.inr.ac.ru,
	yoshfuji@linux-ipv6.org
In-Reply-To: <20180519.170050.615996932572513152.davem@davemloft.net>

> From: David Miller [mailto:davem@davemloft.net]
> From: Debabrata Banerjee <dbanerje@akamai.com>
> 
> > When TCP_CLOSE_NORST is set before a close(), offload sinking of
> > unwanted data to the kernel with low resource usage, with a timeout of
> > TCP_LINGER2. The socket will transition to FIN_WAIT1 and then
> > FIN_WAIT2 where it will ack data until either the timeout is hit, or a
> > RST or FIN is received.
> >
> 
> This is a very serious protocol violation.

Actually I don't believe it violates the protocol. rfc1122 4.2.2.13 reads:

"A host MAY implement a "half-duplex" TCP close sequence, so
            that an application that has called CLOSE cannot continue to
            read data from the connection.  If such a host issues a
            CLOSE call while received data is still pending in TCP, or
            if new data is received after CLOSE is called, its TCP
            SHOULD send a RST to show that data was lost."

Keyword SHOULD according to rfc2119 means recommended but optional, versus MUST.

> You're telling the remote end that you received the data even though the
> socket was closed and nothing actually "sunk" the bytes.

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.

> This doesn't even go into the issues of sending cumulative ACKs in response
> to data which is arbitrarily out-of-order.

Not sure what issues we'd run into here, out of order and duplicate acks can happen normally.
 
> The whole problem is that the post data is sent before the client looks to see
> if the server is willing to accept the post data or not.
> 
> A: I'd like to send you 200MB of crap
>    [ 200MB of craaaa...
> B: Sorry I won't be accepting that, please don't send it.
> 
>    CLOSE, send reset since some of crap is queued up and
>    was never read
> 
> A: aaaaapp... received RESET
> A: Why didn't B accept my 200MB of crap?

That's correct. But it's not just limited to POST. Could be any data transfer over TCP sockets. Of course in the 200MB POST case, that's lots of resources and copying to userspace.

> Sorry, you'll need to deal with this issue in another way.

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.

^ permalink raw reply

* [PATCH net-next] net: dsa: b53: Extend platform data to include DSA ports
From: Florian Fainelli @ 2018-05-19 22:55 UTC (permalink / raw)
  To: netdev; +Cc: andrew, vivien.didelot, Florian Fainelli, open list

Provide a means for !OF platforms to supply their DSA platform data
configuration using the dsa_platform_data structure.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 include/linux/platform_data/b53.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/platform_data/b53.h b/include/linux/platform_data/b53.h
index 69d279c0da96..8eaef2f2b691 100644
--- a/include/linux/platform_data/b53.h
+++ b/include/linux/platform_data/b53.h
@@ -20,8 +20,12 @@
 #define __B53_H
 
 #include <linux/kernel.h>
+#include <net/dsa.h>
 
 struct b53_platform_data {
+	/* Must be first such that dsa_register_switch() can access it */
+	struct dsa_chip_data cd;
+
 	u32 chip_id;
 	u16 enabled_ports;
 
-- 
2.14.1

^ permalink raw reply related

* Re: [PATCH net-next 3/3] net: dsa: mv88e6xxx: Add support for EEPROM via platform data
From: Florian Fainelli @ 2018-05-19 22:52 UTC (permalink / raw)
  To: Andrew Lunn, David Miller; +Cc: Vivien Didelot, netdev
In-Reply-To: <1526761895-15839-4-git-send-email-andrew@lunn.ch>



On 05/19/2018 01:31 PM, Andrew Lunn wrote:
> Add the size of the EEPROM to the platform data, so it can also be
> instantiated by a platform device.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next 2/3] net: dsa: mv88e6xxx: Add minimal platform_data support
From: Florian Fainelli @ 2018-05-19 22:52 UTC (permalink / raw)
  To: Andrew Lunn, David Miller; +Cc: Vivien Didelot, netdev
In-Reply-To: <1526761895-15839-3-git-send-email-andrew@lunn.ch>



On 05/19/2018 01:31 PM, Andrew Lunn wrote:
> Not all the world uses device tree. Some parts of the world still use
> platform devices and platform data. Add basic support for probing a
> Marvell switch via platform data.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

There is a bit of overlap with your net_device structure and what
dsa_chip_data includes, but this is fine for now.
-- 
Florian

^ permalink raw reply

* Re: [PATCH net-next 1/3] net: dsa: mv88e6xxx: Remove OF check for IRQ domain
From: Florian Fainelli @ 2018-05-19 22:47 UTC (permalink / raw)
  To: Andrew Lunn, David Miller; +Cc: Vivien Didelot, netdev
In-Reply-To: <1526761895-15839-2-git-send-email-andrew@lunn.ch>



On 05/19/2018 01:31 PM, Andrew Lunn wrote:
> An IRQ domain will work without an OF node. It is not possible to
> reference interrupts via a phandle, but C code can still use
> irq_find_mapping() to get an interrupt from the domain.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply

* Re: [PATCH 14/14] net: sched: implement delete for all actions
From: Marcelo Ricardo Leitner @ 2018-05-19 22:45 UTC (permalink / raw)
  To: Vlad Buslov
  Cc: Jiri Pirko, netdev, davem, jhs, xiyou.wangcong, pablo, kadlec, fw,
	ast, daniel, edumazet, keescook, linux-kernel, netfilter-devel,
	coreteam, kliteyn
In-Reply-To: <vbf7eo32a7l.fsf@reg-r-vrt-018-180.mtr.labs.mlnx>

On Wed, May 16, 2018 at 12:58:38PM +0300, Vlad Buslov wrote:
>
> On Wed 16 May 2018 at 09:48, Jiri Pirko <jiri@resnulli.us> wrote:
> > Mon, May 14, 2018 at 04:27:15PM CEST, vladbu@mellanox.com wrote:
> >>Implement delete function that is required to delete actions without
> >>holding rtnl lock. Use action API function that atomically deletes action
> >>only if it is still in action idr. This implementation prevents concurrent
> >>threads from deleting same action twice.
> >>
> >>Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
> >>---
> >> net/sched/act_bpf.c        |  8 ++++++++
> >> net/sched/act_connmark.c   |  8 ++++++++
> >> net/sched/act_csum.c       |  8 ++++++++
> >> net/sched/act_gact.c       |  8 ++++++++
> >> net/sched/act_ife.c        |  8 ++++++++
> >> net/sched/act_ipt.c        | 16 ++++++++++++++++
> >> net/sched/act_mirred.c     |  8 ++++++++
> >> net/sched/act_nat.c        |  8 ++++++++
> >> net/sched/act_pedit.c      |  8 ++++++++
> >> net/sched/act_police.c     |  8 ++++++++
> >> net/sched/act_sample.c     |  8 ++++++++
> >> net/sched/act_simple.c     |  8 ++++++++
> >> net/sched/act_skbedit.c    |  8 ++++++++
> >> net/sched/act_skbmod.c     |  8 ++++++++
> >> net/sched/act_tunnel_key.c |  8 ++++++++
> >> net/sched/act_vlan.c       |  8 ++++++++
> >> 16 files changed, 136 insertions(+)
> >>
> >>diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c
> >>index 0bf4ecf..36f7f66 100644
> >>--- a/net/sched/act_bpf.c
> >>+++ b/net/sched/act_bpf.c
> >>@@ -394,6 +394,13 @@ static int tcf_bpf_search(struct net *net, struct tc_action **a, u32 index,
> >> 	return tcf_idr_search(tn, a, index);
> >> }
> >>
> >>+static int tcf_bpf_delete(struct net *net, u32 index)
> >>+{
> >>+	struct tc_action_net *tn = net_generic(net, bpf_net_id);
> >>+
> >>+	return tcf_idr_find_delete(tn, index);
> >>+}
> >>+
> >> static struct tc_action_ops act_bpf_ops __read_mostly = {
> >> 	.kind		=	"bpf",
> >> 	.type		=	TCA_ACT_BPF,
> >>@@ -404,6 +411,7 @@ static struct tc_action_ops act_bpf_ops __read_mostly = {
> >> 	.init		=	tcf_bpf_init,
> >> 	.walk		=	tcf_bpf_walker,
> >> 	.lookup		=	tcf_bpf_search,
> >>+	.delete		=	tcf_bpf_delete,
> >
> > I wonder, right before this patch, how the idr index got removed?
> > delete op is NULL and I didn't find anyone else to do it.

AFAICT this also means it is leaking idr's till this patch is applied.
Maybe I missed something.

> >
> > Also, after this patch, does it make sense to have following check in
> > tcf_action_del_1()?
> >
> >        if (ops->delete)
> > 	       err = ops->delete(net, index);
> >
> > Looks like ops->delete is non-null for all.
> >
> > Seems to me that you need to introduce this patch filling up the delete
> > op in all acts and only after that introduce a code that actually calls
> > it.
>
> Already moved this for V2 patchset to:
>   - Add delete callback to ops and implement it for all actions in single
>   patch.
>   - Move this patch before delete first use.
>
> Will now remove the conditional as well.
>
> >
> > [...]
>

^ permalink raw reply

* Re: [PATCH 12/14] net: sched: retry action check-insert on concurrent modification
From: Marcelo Ricardo Leitner @ 2018-05-19 22:35 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Vlad Buslov, netdev, davem, jhs, xiyou.wangcong, pablo, kadlec,
	fw, ast, daniel, edumazet, keescook, linux-kernel,
	netfilter-devel, coreteam, kliteyn
In-Reply-To: <20180516132135.GN1972@nanopsycho>

On Wed, May 16, 2018 at 03:21:35PM +0200, Jiri Pirko wrote:
...
> int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index,
> 			struct tc_action **a, int bind)

Considering we don't have any other variant of it, maybe just
"tcf_idr_alloc()" instead?

^ permalink raw reply

* Re: [PATCH 13/14] net: sched: use unique idr insert function in unlocked actions
From: Marcelo Ricardo Leitner @ 2018-05-19 22:20 UTC (permalink / raw)
  To: Vlad Buslov
  Cc: netdev, davem, jhs, xiyou.wangcong, jiri, pablo, kadlec, fw, ast,
	daniel, edumazet, keescook, linux-kernel, netfilter-devel,
	coreteam, kliteyn
In-Reply-To: <1526308035-12484-14-git-send-email-vladbu@mellanox.com>

On Mon, May 14, 2018 at 05:27:14PM +0300, Vlad Buslov wrote:
> Substitute calls to action insert function with calls to action insert
> unique function that warns if insertion overwrites index in idr.

I know this patch may be gone on V2, but a general comment, please use
the function names themselves instead of a textualized version. I.e.,
s/action insert unique/tcf_idr_insert_unique/

^ permalink raw reply

* Re: [PATCH 10/14] net: sched: extend act API for lockless actions
From: Marcelo Ricardo Leitner @ 2018-05-19 22:17 UTC (permalink / raw)
  To: Vlad Buslov
  Cc: netdev, davem, jhs, xiyou.wangcong, jiri, pablo, kadlec, fw, ast,
	daniel, edumazet, keescook, linux-kernel, netfilter-devel,
	coreteam, kliteyn
In-Reply-To: <1526308035-12484-11-git-send-email-vladbu@mellanox.com>

Please use a more meaningful patch summary. This one is too generic.

On Mon, May 14, 2018 at 05:27:11PM +0300, Vlad Buslov wrote:
...
> +int tcf_idr_find_delete(struct tc_action_net *tn, u32 index)

What about naming it tcf_idr_delete_index() instead?
The find operation is always implicit when you don't specify the
object itself directly, and then it describes which key will be used.

> +{
> +	struct tcf_idrinfo *idrinfo = tn->idrinfo;
> +	struct tc_action *p;
> +	int ret = 0;
> +
> +	spin_lock_bh(&idrinfo->lock);
> +	p = idr_find(&idrinfo->action_idr, index);
> +	if (!p) {
> +		spin_unlock(&idrinfo->lock);
> +		return -ENOENT;
> +	}
> +
> +	if (!atomic_read(&p->tcfa_bindcnt)) {
> +		if (refcount_dec_and_test(&p->tcfa_refcnt)) {
> +			struct module *owner = p->ops->owner;
> +
> +			WARN_ON(p != idr_remove(&idrinfo->action_idr,
> +						p->tcfa_index));
> +			spin_unlock_bh(&idrinfo->lock);
> +
> +			tcf_action_cleanup(p);
> +			module_put(owner);
> +			return 0;
> +		}
> +		ret = 0;
> +	} else {
> +		ret = -EPERM;
> +	}
> +
> +	spin_unlock_bh(&idrinfo->lock);
> +	return ret;
> +}
> +EXPORT_SYMBOL(tcf_idr_find_delete);
...

^ permalink raw reply

* Re: [PATCH 09/14] net: sched: don't release reference on action overwrite
From: Marcelo Ricardo Leitner @ 2018-05-19 21:52 UTC (permalink / raw)
  To: Vlad Buslov
  Cc: netdev, davem, jhs, xiyou.wangcong, jiri, pablo, kadlec, fw, ast,
	daniel, edumazet, keescook, linux-kernel, netfilter-devel,
	coreteam, kliteyn
In-Reply-To: <1526308035-12484-10-git-send-email-vladbu@mellanox.com>

On Mon, May 14, 2018 at 05:27:10PM +0300, Vlad Buslov wrote:
> Return from action init function with reference to action taken,
> even when overwriting existing action.

Isn't this patch necessary before patch 7, to not break things up?
AFAICU after patchset 7 it assumes the action init function is already
behaving like this.

^ permalink raw reply

* Re: [PATCH 06/14] net: sched: implement reference counted action release
From: Marcelo Ricardo Leitner @ 2018-05-19 21:43 UTC (permalink / raw)
  To: Vlad Buslov
  Cc: netdev, davem, jhs, xiyou.wangcong, jiri, pablo, kadlec, fw, ast,
	daniel, edumazet, keescook, linux-kernel, netfilter-devel,
	coreteam, kliteyn
In-Reply-To: <1526308035-12484-7-git-send-email-vladbu@mellanox.com>

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?

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 04/14] net: sched: implement unlocked action init API
From: Marcelo Ricardo Leitner @ 2018-05-19 21:11 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Vlad Buslov, netdev, davem, jhs, xiyou.wangcong, pablo, kadlec,
	fw, ast, daniel, edumazet, keescook, linux-kernel,
	netfilter-devel, coreteam, kliteyn
In-Reply-To: <20180514151641.GD1848@nanopsycho>

On Mon, May 14, 2018 at 05:16:41PM +0200, Jiri Pirko wrote:
> Mon, May 14, 2018 at 04:27:05PM CEST, vladbu@mellanox.com wrote:
> >Add additional 'unlocked' argument to act API init functions.
> >Argument is true when rtnl lock is not taken and false otherwise.
> >It is required to implement actions that need to release rtnl lock before
> >loading kernel module and reacquire if afterwards.
> >
> >Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
>
> [...]
>
>
> >@@ -721,9 +722,11 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
> > 	a_o = tc_lookup_action_n(act_name);
> > 	if (a_o == NULL) {
> > #ifdef CONFIG_MODULES
> >-		rtnl_unlock();
> >+		if (!unlocked)
> >+			rtnl_unlock();
> > 		request_module("act_%s", act_name);
> >-		rtnl_lock();
> >+		if (!unlocked)
> >+			rtnl_lock();
>
> Although I don't like this conditional locking scheme, I see no other
> way to solve this :/ But I think would be better perhaps to rename
> "unlocked" to something like "rtnl_held".

Agreed. "rtnl_held" also removes the double negation, "!un...".

^ 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