13 Dec, 2019

1 commit

  • This allows incrementing the correct timeout statistic without any mess.
    Down the road, devices can learn to reset just the specific queue.

    The patch was generated with the following script:

    use strict;
    use warnings;

    our $^I = '.bak';

    my @work = (
    ["arch/m68k/emu/nfeth.c", "nfeth_tx_timeout"],
    ["arch/um/drivers/net_kern.c", "uml_net_tx_timeout"],
    ["arch/um/drivers/vector_kern.c", "vector_net_tx_timeout"],
    ["arch/xtensa/platforms/iss/network.c", "iss_net_tx_timeout"],
    ["drivers/char/pcmcia/synclink_cs.c", "hdlcdev_tx_timeout"],
    ["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
    ["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
    ["drivers/message/fusion/mptlan.c", "mpt_lan_tx_timeout"],
    ["drivers/misc/sgi-xp/xpnet.c", "xpnet_dev_tx_timeout"],
    ["drivers/net/appletalk/cops.c", "cops_timeout"],
    ["drivers/net/arcnet/arcdevice.h", "arcnet_timeout"],
    ["drivers/net/arcnet/arcnet.c", "arcnet_timeout"],
    ["drivers/net/arcnet/com20020.c", "arcnet_timeout"],
    ["drivers/net/ethernet/3com/3c509.c", "el3_tx_timeout"],
    ["drivers/net/ethernet/3com/3c515.c", "corkscrew_timeout"],
    ["drivers/net/ethernet/3com/3c574_cs.c", "el3_tx_timeout"],
    ["drivers/net/ethernet/3com/3c589_cs.c", "el3_tx_timeout"],
    ["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
    ["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
    ["drivers/net/ethernet/3com/typhoon.c", "typhoon_tx_timeout"],
    ["drivers/net/ethernet/8390/8390.h", "ei_tx_timeout"],
    ["drivers/net/ethernet/8390/8390.h", "eip_tx_timeout"],
    ["drivers/net/ethernet/8390/8390.c", "ei_tx_timeout"],
    ["drivers/net/ethernet/8390/8390p.c", "eip_tx_timeout"],
    ["drivers/net/ethernet/8390/ax88796.c", "ax_ei_tx_timeout"],
    ["drivers/net/ethernet/8390/axnet_cs.c", "axnet_tx_timeout"],
    ["drivers/net/ethernet/8390/etherh.c", "__ei_tx_timeout"],
    ["drivers/net/ethernet/8390/hydra.c", "__ei_tx_timeout"],
    ["drivers/net/ethernet/8390/mac8390.c", "__ei_tx_timeout"],
    ["drivers/net/ethernet/8390/mcf8390.c", "__ei_tx_timeout"],
    ["drivers/net/ethernet/8390/lib8390.c", "__ei_tx_timeout"],
    ["drivers/net/ethernet/8390/ne2k-pci.c", "ei_tx_timeout"],
    ["drivers/net/ethernet/8390/pcnet_cs.c", "ei_tx_timeout"],
    ["drivers/net/ethernet/8390/smc-ultra.c", "ei_tx_timeout"],
    ["drivers/net/ethernet/8390/wd.c", "ei_tx_timeout"],
    ["drivers/net/ethernet/8390/zorro8390.c", "__ei_tx_timeout"],
    ["drivers/net/ethernet/adaptec/starfire.c", "tx_timeout"],
    ["drivers/net/ethernet/agere/et131x.c", "et131x_tx_timeout"],
    ["drivers/net/ethernet/allwinner/sun4i-emac.c", "emac_timeout"],
    ["drivers/net/ethernet/alteon/acenic.c", "ace_watchdog"],
    ["drivers/net/ethernet/amazon/ena/ena_netdev.c", "ena_tx_timeout"],
    ["drivers/net/ethernet/amd/7990.h", "lance_tx_timeout"],
    ["drivers/net/ethernet/amd/7990.c", "lance_tx_timeout"],
    ["drivers/net/ethernet/amd/a2065.c", "lance_tx_timeout"],
    ["drivers/net/ethernet/amd/am79c961a.c", "am79c961_timeout"],
    ["drivers/net/ethernet/amd/amd8111e.c", "amd8111e_tx_timeout"],
    ["drivers/net/ethernet/amd/ariadne.c", "ariadne_tx_timeout"],
    ["drivers/net/ethernet/amd/atarilance.c", "lance_tx_timeout"],
    ["drivers/net/ethernet/amd/au1000_eth.c", "au1000_tx_timeout"],
    ["drivers/net/ethernet/amd/declance.c", "lance_tx_timeout"],
    ["drivers/net/ethernet/amd/lance.c", "lance_tx_timeout"],
    ["drivers/net/ethernet/amd/mvme147.c", "lance_tx_timeout"],
    ["drivers/net/ethernet/amd/ni65.c", "ni65_timeout"],
    ["drivers/net/ethernet/amd/nmclan_cs.c", "mace_tx_timeout"],
    ["drivers/net/ethernet/amd/pcnet32.c", "pcnet32_tx_timeout"],
    ["drivers/net/ethernet/amd/sunlance.c", "lance_tx_timeout"],
    ["drivers/net/ethernet/amd/xgbe/xgbe-drv.c", "xgbe_tx_timeout"],
    ["drivers/net/ethernet/apm/xgene-v2/main.c", "xge_timeout"],
    ["drivers/net/ethernet/apm/xgene/xgene_enet_main.c", "xgene_enet_timeout"],
    ["drivers/net/ethernet/apple/macmace.c", "mace_tx_timeout"],
    ["drivers/net/ethernet/atheros/ag71xx.c", "ag71xx_tx_timeout"],
    ["drivers/net/ethernet/atheros/alx/main.c", "alx_tx_timeout"],
    ["drivers/net/ethernet/atheros/atl1c/atl1c_main.c", "atl1c_tx_timeout"],
    ["drivers/net/ethernet/atheros/atl1e/atl1e_main.c", "atl1e_tx_timeout"],
    ["drivers/net/ethernet/atheros/atlx/atl.c", "atlx_tx_timeout"],
    ["drivers/net/ethernet/atheros/atlx/atl1.c", "atlx_tx_timeout"],
    ["drivers/net/ethernet/atheros/atlx/atl2.c", "atl2_tx_timeout"],
    ["drivers/net/ethernet/broadcom/b44.c", "b44_tx_timeout"],
    ["drivers/net/ethernet/broadcom/bcmsysport.c", "bcm_sysport_tx_timeout"],
    ["drivers/net/ethernet/broadcom/bnx2.c", "bnx2_tx_timeout"],
    ["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h", "bnx2x_tx_timeout"],
    ["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", "bnx2x_tx_timeout"],
    ["drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", "bnx2x_tx_timeout"],
    ["drivers/net/ethernet/broadcom/bnxt/bnxt.c", "bnxt_tx_timeout"],
    ["drivers/net/ethernet/broadcom/genet/bcmgenet.c", "bcmgenet_timeout"],
    ["drivers/net/ethernet/broadcom/sb1250-mac.c", "sbmac_tx_timeout"],
    ["drivers/net/ethernet/broadcom/tg3.c", "tg3_tx_timeout"],
    ["drivers/net/ethernet/calxeda/xgmac.c", "xgmac_tx_timeout"],
    ["drivers/net/ethernet/cavium/liquidio/lio_main.c", "liquidio_tx_timeout"],
    ["drivers/net/ethernet/cavium/liquidio/lio_vf_main.c", "liquidio_tx_timeout"],
    ["drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c", "lio_vf_rep_tx_timeout"],
    ["drivers/net/ethernet/cavium/thunder/nicvf_main.c", "nicvf_tx_timeout"],
    ["drivers/net/ethernet/cirrus/cs89x0.c", "net_timeout"],
    ["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
    ["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
    ["drivers/net/ethernet/cortina/gemini.c", "gmac_tx_timeout"],
    ["drivers/net/ethernet/davicom/dm9000.c", "dm9000_timeout"],
    ["drivers/net/ethernet/dec/tulip/de2104x.c", "de_tx_timeout"],
    ["drivers/net/ethernet/dec/tulip/tulip_core.c", "tulip_tx_timeout"],
    ["drivers/net/ethernet/dec/tulip/winbond-840.c", "tx_timeout"],
    ["drivers/net/ethernet/dlink/dl2k.c", "rio_tx_timeout"],
    ["drivers/net/ethernet/dlink/sundance.c", "tx_timeout"],
    ["drivers/net/ethernet/emulex/benet/be_main.c", "be_tx_timeout"],
    ["drivers/net/ethernet/ethoc.c", "ethoc_tx_timeout"],
    ["drivers/net/ethernet/faraday/ftgmac100.c", "ftgmac100_tx_timeout"],
    ["drivers/net/ethernet/fealnx.c", "fealnx_tx_timeout"],
    ["drivers/net/ethernet/freescale/dpaa/dpaa_eth.c", "dpaa_tx_timeout"],
    ["drivers/net/ethernet/freescale/fec_main.c", "fec_timeout"],
    ["drivers/net/ethernet/freescale/fec_mpc52xx.c", "mpc52xx_fec_tx_timeout"],
    ["drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c", "fs_timeout"],
    ["drivers/net/ethernet/freescale/gianfar.c", "gfar_timeout"],
    ["drivers/net/ethernet/freescale/ucc_geth.c", "ucc_geth_timeout"],
    ["drivers/net/ethernet/fujitsu/fmvj18x_cs.c", "fjn_tx_timeout"],
    ["drivers/net/ethernet/google/gve/gve_main.c", "gve_tx_timeout"],
    ["drivers/net/ethernet/hisilicon/hip04_eth.c", "hip04_timeout"],
    ["drivers/net/ethernet/hisilicon/hix5hd2_gmac.c", "hix5hd2_net_timeout"],
    ["drivers/net/ethernet/hisilicon/hns/hns_enet.c", "hns_nic_net_timeout"],
    ["drivers/net/ethernet/hisilicon/hns3/hns3_enet.c", "hns3_nic_net_timeout"],
    ["drivers/net/ethernet/huawei/hinic/hinic_main.c", "hinic_tx_timeout"],
    ["drivers/net/ethernet/i825xx/82596.c", "i596_tx_timeout"],
    ["drivers/net/ethernet/i825xx/ether1.c", "ether1_timeout"],
    ["drivers/net/ethernet/i825xx/lib82596.c", "i596_tx_timeout"],
    ["drivers/net/ethernet/i825xx/sun3_82586.c", "sun3_82586_timeout"],
    ["drivers/net/ethernet/ibm/ehea/ehea_main.c", "ehea_tx_watchdog"],
    ["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
    ["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
    ["drivers/net/ethernet/ibm/ibmvnic.c", "ibmvnic_tx_timeout"],
    ["drivers/net/ethernet/intel/e100.c", "e100_tx_timeout"],
    ["drivers/net/ethernet/intel/e1000/e1000_main.c", "e1000_tx_timeout"],
    ["drivers/net/ethernet/intel/e1000e/netdev.c", "e1000_tx_timeout"],
    ["drivers/net/ethernet/intel/fm10k/fm10k_netdev.c", "fm10k_tx_timeout"],
    ["drivers/net/ethernet/intel/i40e/i40e_main.c", "i40e_tx_timeout"],
    ["drivers/net/ethernet/intel/iavf/iavf_main.c", "iavf_tx_timeout"],
    ["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
    ["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
    ["drivers/net/ethernet/intel/igb/igb_main.c", "igb_tx_timeout"],
    ["drivers/net/ethernet/intel/igbvf/netdev.c", "igbvf_tx_timeout"],
    ["drivers/net/ethernet/intel/ixgb/ixgb_main.c", "ixgb_tx_timeout"],
    ["drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c", "adapter->netdev->netdev_ops->ndo_tx_timeout(adapter->netdev);"],
    ["drivers/net/ethernet/intel/ixgbe/ixgbe_main.c", "ixgbe_tx_timeout"],
    ["drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c", "ixgbevf_tx_timeout"],
    ["drivers/net/ethernet/jme.c", "jme_tx_timeout"],
    ["drivers/net/ethernet/korina.c", "korina_tx_timeout"],
    ["drivers/net/ethernet/lantiq_etop.c", "ltq_etop_tx_timeout"],
    ["drivers/net/ethernet/marvell/mv643xx_eth.c", "mv643xx_eth_tx_timeout"],
    ["drivers/net/ethernet/marvell/pxa168_eth.c", "pxa168_eth_tx_timeout"],
    ["drivers/net/ethernet/marvell/skge.c", "skge_tx_timeout"],
    ["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
    ["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
    ["drivers/net/ethernet/mediatek/mtk_eth_soc.c", "mtk_tx_timeout"],
    ["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
    ["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
    ["drivers/net/ethernet/mellanox/mlx5/core/en_main.c", "mlx5e_tx_timeout"],
    ["drivers/net/ethernet/micrel/ks8842.c", "ks8842_tx_timeout"],
    ["drivers/net/ethernet/micrel/ksz884x.c", "netdev_tx_timeout"],
    ["drivers/net/ethernet/microchip/enc28j60.c", "enc28j60_tx_timeout"],
    ["drivers/net/ethernet/microchip/encx24j600.c", "encx24j600_tx_timeout"],
    ["drivers/net/ethernet/natsemi/sonic.h", "sonic_tx_timeout"],
    ["drivers/net/ethernet/natsemi/sonic.c", "sonic_tx_timeout"],
    ["drivers/net/ethernet/natsemi/jazzsonic.c", "sonic_tx_timeout"],
    ["drivers/net/ethernet/natsemi/macsonic.c", "sonic_tx_timeout"],
    ["drivers/net/ethernet/natsemi/natsemi.c", "ns_tx_timeout"],
    ["drivers/net/ethernet/natsemi/ns83820.c", "ns83820_tx_timeout"],
    ["drivers/net/ethernet/natsemi/xtsonic.c", "sonic_tx_timeout"],
    ["drivers/net/ethernet/neterion/s2io.h", "s2io_tx_watchdog"],
    ["drivers/net/ethernet/neterion/s2io.c", "s2io_tx_watchdog"],
    ["drivers/net/ethernet/neterion/vxge/vxge-main.c", "vxge_tx_watchdog"],
    ["drivers/net/ethernet/netronome/nfp/nfp_net_common.c", "nfp_net_tx_timeout"],
    ["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
    ["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
    ["drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c", "pch_gbe_tx_timeout"],
    ["drivers/net/ethernet/packetengines/hamachi.c", "hamachi_tx_timeout"],
    ["drivers/net/ethernet/packetengines/yellowfin.c", "yellowfin_tx_timeout"],
    ["drivers/net/ethernet/pensando/ionic/ionic_lif.c", "ionic_tx_timeout"],
    ["drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c", "netxen_tx_timeout"],
    ["drivers/net/ethernet/qlogic/qla3xxx.c", "ql3xxx_tx_timeout"],
    ["drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c", "qlcnic_tx_timeout"],
    ["drivers/net/ethernet/qualcomm/emac/emac.c", "emac_tx_timeout"],
    ["drivers/net/ethernet/qualcomm/qca_spi.c", "qcaspi_netdev_tx_timeout"],
    ["drivers/net/ethernet/qualcomm/qca_uart.c", "qcauart_netdev_tx_timeout"],
    ["drivers/net/ethernet/rdc/r6040.c", "r6040_tx_timeout"],
    ["drivers/net/ethernet/realtek/8139cp.c", "cp_tx_timeout"],
    ["drivers/net/ethernet/realtek/8139too.c", "rtl8139_tx_timeout"],
    ["drivers/net/ethernet/realtek/atp.c", "tx_timeout"],
    ["drivers/net/ethernet/realtek/r8169_main.c", "rtl8169_tx_timeout"],
    ["drivers/net/ethernet/renesas/ravb_main.c", "ravb_tx_timeout"],
    ["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
    ["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
    ["drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c", "sxgbe_tx_timeout"],
    ["drivers/net/ethernet/seeq/ether3.c", "ether3_timeout"],
    ["drivers/net/ethernet/seeq/sgiseeq.c", "timeout"],
    ["drivers/net/ethernet/sfc/efx.c", "efx_watchdog"],
    ["drivers/net/ethernet/sfc/falcon/efx.c", "ef4_watchdog"],
    ["drivers/net/ethernet/sgi/ioc3-eth.c", "ioc3_timeout"],
    ["drivers/net/ethernet/sgi/meth.c", "meth_tx_timeout"],
    ["drivers/net/ethernet/silan/sc92031.c", "sc92031_tx_timeout"],
    ["drivers/net/ethernet/sis/sis190.c", "sis190_tx_timeout"],
    ["drivers/net/ethernet/sis/sis900.c", "sis900_tx_timeout"],
    ["drivers/net/ethernet/smsc/epic100.c", "epic_tx_timeout"],
    ["drivers/net/ethernet/smsc/smc911x.c", "smc911x_timeout"],
    ["drivers/net/ethernet/smsc/smc9194.c", "smc_timeout"],
    ["drivers/net/ethernet/smsc/smc91c92_cs.c", "smc_tx_timeout"],
    ["drivers/net/ethernet/smsc/smc91x.c", "smc_timeout"],
    ["drivers/net/ethernet/stmicro/stmmac/stmmac_main.c", "stmmac_tx_timeout"],
    ["drivers/net/ethernet/sun/cassini.c", "cas_tx_timeout"],
    ["drivers/net/ethernet/sun/ldmvsw.c", "sunvnet_tx_timeout_common"],
    ["drivers/net/ethernet/sun/niu.c", "niu_tx_timeout"],
    ["drivers/net/ethernet/sun/sunbmac.c", "bigmac_tx_timeout"],
    ["drivers/net/ethernet/sun/sungem.c", "gem_tx_timeout"],
    ["drivers/net/ethernet/sun/sunhme.c", "happy_meal_tx_timeout"],
    ["drivers/net/ethernet/sun/sunqe.c", "qe_tx_timeout"],
    ["drivers/net/ethernet/sun/sunvnet.c", "sunvnet_tx_timeout_common"],
    ["drivers/net/ethernet/sun/sunvnet_common.c", "sunvnet_tx_timeout_common"],
    ["drivers/net/ethernet/sun/sunvnet_common.h", "sunvnet_tx_timeout_common"],
    ["drivers/net/ethernet/synopsys/dwc-xlgmac-net.c", "xlgmac_tx_timeout"],
    ["drivers/net/ethernet/ti/cpmac.c", "cpmac_tx_timeout"],
    ["drivers/net/ethernet/ti/cpsw.c", "cpsw_ndo_tx_timeout"],
    ["drivers/net/ethernet/ti/cpsw_priv.c", "cpsw_ndo_tx_timeout"],
    ["drivers/net/ethernet/ti/cpsw_priv.h", "cpsw_ndo_tx_timeout"],
    ["drivers/net/ethernet/ti/davinci_emac.c", "emac_dev_tx_timeout"],
    ["drivers/net/ethernet/ti/netcp_core.c", "netcp_ndo_tx_timeout"],
    ["drivers/net/ethernet/ti/tlan.c", "tlan_tx_timeout"],
    ["drivers/net/ethernet/toshiba/ps3_gelic_net.h", "gelic_net_tx_timeout"],
    ["drivers/net/ethernet/toshiba/ps3_gelic_net.c", "gelic_net_tx_timeout"],
    ["drivers/net/ethernet/toshiba/ps3_gelic_wireless.c", "gelic_net_tx_timeout"],
    ["drivers/net/ethernet/toshiba/spider_net.c", "spider_net_tx_timeout"],
    ["drivers/net/ethernet/toshiba/tc35815.c", "tc35815_tx_timeout"],
    ["drivers/net/ethernet/via/via-rhine.c", "rhine_tx_timeout"],
    ["drivers/net/ethernet/wiznet/w5100.c", "w5100_tx_timeout"],
    ["drivers/net/ethernet/wiznet/w5300.c", "w5300_tx_timeout"],
    ["drivers/net/ethernet/xilinx/xilinx_emaclite.c", "xemaclite_tx_timeout"],
    ["drivers/net/ethernet/xircom/xirc2ps_cs.c", "xirc_tx_timeout"],
    ["drivers/net/fjes/fjes_main.c", "fjes_tx_retry"],
    ["drivers/net/slip/slip.c", "sl_tx_timeout"],
    ["include/linux/usb/usbnet.h", "usbnet_tx_timeout"],
    ["drivers/net/usb/aqc111.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/ax88172a.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/ax88179_178a.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/catc.c", "catc_tx_timeout"],
    ["drivers/net/usb/cdc_mbim.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/cdc_ncm.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/dm9601.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/hso.c", "hso_net_tx_timeout"],
    ["drivers/net/usb/int51x1.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/ipheth.c", "ipheth_tx_timeout"],
    ["drivers/net/usb/kaweth.c", "kaweth_tx_timeout"],
    ["drivers/net/usb/lan78xx.c", "lan78xx_tx_timeout"],
    ["drivers/net/usb/mcs7830.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/pegasus.c", "pegasus_tx_timeout"],
    ["drivers/net/usb/qmi_wwan.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/r8152.c", "rtl8152_tx_timeout"],
    ["drivers/net/usb/rndis_host.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/rtl8150.c", "rtl8150_tx_timeout"],
    ["drivers/net/usb/sierra_net.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/smsc75xx.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/smsc95xx.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/sr9700.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/sr9800.c", "usbnet_tx_timeout"],
    ["drivers/net/usb/usbnet.c", "usbnet_tx_timeout"],
    ["drivers/net/vmxnet3/vmxnet3_drv.c", "vmxnet3_tx_timeout"],
    ["drivers/net/wan/cosa.c", "cosa_net_timeout"],
    ["drivers/net/wan/farsync.c", "fst_tx_timeout"],
    ["drivers/net/wan/fsl_ucc_hdlc.c", "uhdlc_tx_timeout"],
    ["drivers/net/wan/lmc/lmc_main.c", "lmc_driver_timeout"],
    ["drivers/net/wan/x25_asy.c", "x25_asy_timeout"],
    ["drivers/net/wimax/i2400m/netdev.c", "i2400m_tx_timeout"],
    ["drivers/net/wireless/intel/ipw2x00/ipw2100.c", "ipw2100_tx_timeout"],
    ["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
    ["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
    ["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
    ["drivers/net/wireless/intersil/orinoco/main.c", "orinoco_tx_timeout"],
    ["drivers/net/wireless/intersil/orinoco/orinoco_usb.c", "orinoco_tx_timeout"],
    ["drivers/net/wireless/intersil/orinoco/orinoco.h", "orinoco_tx_timeout"],
    ["drivers/net/wireless/intersil/prism54/islpci_dev.c", "islpci_eth_tx_timeout"],
    ["drivers/net/wireless/intersil/prism54/islpci_eth.c", "islpci_eth_tx_timeout"],
    ["drivers/net/wireless/intersil/prism54/islpci_eth.h", "islpci_eth_tx_timeout"],
    ["drivers/net/wireless/marvell/mwifiex/main.c", "mwifiex_tx_timeout"],
    ["drivers/net/wireless/quantenna/qtnfmac/core.c", "qtnf_netdev_tx_timeout"],
    ["drivers/net/wireless/quantenna/qtnfmac/core.h", "qtnf_netdev_tx_timeout"],
    ["drivers/net/wireless/rndis_wlan.c", "usbnet_tx_timeout"],
    ["drivers/net/wireless/wl3501_cs.c", "wl3501_tx_timeout"],
    ["drivers/net/wireless/zydas/zd1201.c", "zd1201_tx_timeout"],
    ["drivers/s390/net/qeth_core.h", "qeth_tx_timeout"],
    ["drivers/s390/net/qeth_core_main.c", "qeth_tx_timeout"],
    ["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
    ["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
    ["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
    ["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
    ["drivers/staging/ks7010/ks_wlan_net.c", "ks_wlan_tx_timeout"],
    ["drivers/staging/qlge/qlge_main.c", "qlge_tx_timeout"],
    ["drivers/staging/rtl8192e/rtl8192e/rtl_core.c", "_rtl92e_tx_timeout"],
    ["drivers/staging/rtl8192u/r8192U_core.c", "tx_timeout"],
    ["drivers/staging/unisys/visornic/visornic_main.c", "visornic_xmit_timeout"],
    ["drivers/staging/wlan-ng/p80211netdev.c", "p80211knetdev_tx_timeout"],
    ["drivers/tty/n_gsm.c", "gsm_mux_net_tx_timeout"],
    ["drivers/tty/synclink.c", "hdlcdev_tx_timeout"],
    ["drivers/tty/synclink_gt.c", "hdlcdev_tx_timeout"],
    ["drivers/tty/synclinkmp.c", "hdlcdev_tx_timeout"],
    ["net/atm/lec.c", "lec_tx_timeout"],
    ["net/bluetooth/bnep/netdev.c", "bnep_net_timeout"]
    );

    for my $p (@work) {
    my @pair = @$p;
    my $file = $pair[0];
    my $func = $pair[1];
    print STDERR $file , ": ", $func,"\n";
    our @ARGV = ($file);
    while () {
    if (m/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/) {
    print STDERR "found $1+$2 in $file\n";
    }
    if (s/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/$1, unsigned int txqueue$2/) {
    print STDERR "$func found in $file\n";
    }
    print;
    }
    }

    where the list of files and functions is simply from:

    git grep ndo_tx_timeout, with manual addition of headers
    in the rare cases where the function is from a header,
    then manually changing the few places which actually
    call ndo_tx_timeout.

    Signed-off-by: Michael S. Tsirkin
    Acked-by: Heiner Kallweit
    Acked-by: Jakub Kicinski
    Acked-by: Shannon Nelson
    Reviewed-by: Martin Habets

    changes from v9:
    fixup a forward declaration
    changes from v9:
    more leftovers from v3 change
    changes from v8:
    fix up a missing direct call to timeout
    rebased on net-next
    changes from v7:
    fixup leftovers from v3 change
    changes from v6:
    fix typo in rtl driver
    changes from v5:
    add missing files (allow any net device argument name)
    changes from v4:
    add a missing driver header
    changes from v3:
    change queue # to unsigned
    Changes from v2:
    added headers
    Changes from v1:
    Fix errors found by kbuild:
    generalize the pattern a bit, to pick up
    a couple of instances missed by the previous
    version.

    Signed-off-by: David S. Miller

    Michael S. Tsirkin
     

26 Sep, 2019

1 commit


24 Sep, 2019

1 commit

  • struct archdr is only big enough to hold the header of various types of
    arcnet packets. So to provide enough space to hold the data read from
    hardware provide a buffer large enough to hold a packet with maximal
    size.

    The problem was noticed by the stack protector which makes the kernel
    oops.

    Signed-off-by: Uwe Kleine-König
    Acked-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Uwe Kleine-König
     

31 Aug, 2019

1 commit


30 Jul, 2019

4 commits

  • Mark switch cases where we are expecting to fall through.

    This patch fixes the following warnings:

    drivers/net/arcnet/com20020-isa.c: warning: this statement may fall
    through [-Wimplicit-fallthrough=]: => 205:13, 203:10, 209:7, 201:11,
    207:8

    Reported-by: Geert Uytterhoeven
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Kees Cook
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     
  • Mark switch cases where we are expecting to fall through.

    This patch fixes the following warnings (Building: powerpc allyesconfig):

    drivers/net/arcnet/arc-rimi.c: In function 'arcrimi_setup':
    include/linux/printk.h:304:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
    printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/net/arcnet/arc-rimi.c:365:3: note: in expansion of macro 'pr_err'
    pr_err("Too many arguments\n");
    ^~~~~~
    drivers/net/arcnet/arc-rimi.c:366:2: note: here
    case 3: /* Node ID */
    ^~~~
    drivers/net/arcnet/arc-rimi.c:367:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
    node = ints[3];
    ~~~~~^~~~~~~~~
    drivers/net/arcnet/arc-rimi.c:368:2: note: here
    case 2: /* IRQ */
    ^~~~
    drivers/net/arcnet/arc-rimi.c:369:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    irq = ints[2];
    ~~~~^~~~~~~~~
    drivers/net/arcnet/arc-rimi.c:370:2: note: here
    case 1: /* IO address */
    ^~~~

    Reported-by: Stephen Rothwell
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Kees Cook
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     
  • Mark switch cases where we are expecting to fall through.

    This patch fixes the following warnings (Building: powerpc allyesconfig):

    drivers/net/arcnet/com90io.c: In function 'com90io_setup':
    include/linux/printk.h:304:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
    printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/net/arcnet/com90io.c:365:3: note: in expansion of macro 'pr_err'
    pr_err("Too many arguments\n");
    ^~~~~~
    drivers/net/arcnet/com90io.c:366:2: note: here
    case 2: /* IRQ */
    ^~~~
    drivers/net/arcnet/com90io.c:367:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    irq = ints[2];
    ~~~~^~~~~~~~~
    drivers/net/arcnet/com90io.c:368:2: note: here
    case 1: /* IO address */
    ^~~~

    Reported-by: Stephen Rothwell
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Kees Cook
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     
  • Mark switch cases where we are expecting to fall through.

    This patch fixes the following warnings (Building: powerpc allyesconfig):

    drivers/net/arcnet/com90xx.c: In function 'com90xx_setup':
    include/linux/printk.h:304:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
    printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/net/arcnet/com90xx.c:695:3: note: in expansion of macro 'pr_err'
    pr_err("Too many arguments\n");
    ^~~~~~
    drivers/net/arcnet/com90xx.c:696:2: note: here
    case 3: /* Mem address */
    ^~~~
    drivers/net/arcnet/com90xx.c:697:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
    shmem = ints[3];
    ~~~~~~^~~~~~~~~
    drivers/net/arcnet/com90xx.c:698:2: note: here
    case 2: /* IRQ */
    ^~~~
    drivers/net/arcnet/com90xx.c:699:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    irq = ints[2];
    ~~~~^~~~~~~~~
    drivers/net/arcnet/com90xx.c:700:2: note: here
    case 1: /* IO address */
    ^~~~

    Reported-by: Stephen Rothwell
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Kees Cook
    Signed-off-by: David S. Miller

    Gustavo A. R. Silva
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


31 Oct, 2018

1 commit

  • Move remaining definitions and declarations from include/linux/bootmem.h
    into include/linux/memblock.h and remove the redundant header.

    The includes were replaced with the semantic patch below and then
    semi-automated removal of duplicated '#include

    @@
    @@
    - #include
    + #include

    [sfr@canb.auug.org.au: dma-direct: fix up for the removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181002185342.133d1680@canb.auug.org.au
    [sfr@canb.auug.org.au: powerpc: fix up for removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181005161406.73ef8727@canb.auug.org.au
    [sfr@canb.auug.org.au: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal]
    Link: http://lkml.kernel.org/r/20181008190341.5e396491@canb.auug.org.au
    Link: http://lkml.kernel.org/r/1536927045-23536-30-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Stephen Rothwell
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

04 Nov, 2017

1 commit


02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

27 Oct, 2017

1 commit


22 Sep, 2017

1 commit


19 Jul, 2017

2 commits

  • attribute_group are not supposed to change at runtime. All functions
    working with attribute_group provided by work
    with const attribute_group. So mark the non-const structs as const.

    File size before:
    text data bss dec hex filename
    3409 948 28 4385 1121 drivers/net/arcnet/com20020-pci.o

    File size After adding 'const':
    text data bss dec hex filename
    3473 884 28 4385 1121 drivers/net/arcnet/com20020-pci.o

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller

    Arvind Yadav
     
  • these drivers use tasklets or irq apis, but don't include interrupt.h.
    Once flow cache is removed the implicit interrupt.h inclusion goes away
    which will break the build.

    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     

07 Jul, 2017

1 commit


01 Jul, 2017

1 commit


30 Jun, 2017

9 commits

  • We add support for the PCIFB2 card from EAE.

    Beside other cards, this card has the backplane mode enabled by default.

    Signed-off-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Michael Grzeschik
     
  • We read the backplane mode of each subcard from bits 2 and 3 of the misc
    register.

    Signed-off-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Michael Grzeschik
     
  • We add the sysfs interface the read back the backplane
    status of the interface.

    Signed-off-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Michael Grzeschik
     
  • We need to track the status of our queued packages. This way the driving
    process knows if failed packages need to be retransmitted. For this
    purpose we queue the transferred/failed packages back into the err_skb
    message queue added with some status information.

    Signed-off-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Michael Grzeschik
     
  • We add the pdev data to the pci devices netdev structure. This way
    the interface get consistent device names in the userspace (udev).

    Signed-off-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Michael Grzeschik
     
  • The dev_id was miscalculated. Only the two bits 4-5 are relevant for the
    MA1 card. PCIARC1 and PCIFB2 use the four bits 4-7 for id selection.

    Signed-off-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Michael Grzeschik
     
  • The assignment is superfluous.

    Signed-off-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Michael Grzeschik
     
  • Signed-off-by: Colin Ian King
    Signed-off-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Colin Ian King
     
  • This patch prevents the arcnet driver from the following deadlock.

    [ 41.273910] ======================================================
    [ 41.280397] [ INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected ]
    [ 41.287433] 4.4.0-00034-gc0ae784 #536 Not tainted
    [ 41.292366] ------------------------------------------------------
    [ 41.298863] arcecho/233 [HC0[0]:SC0[2]:HE0:SE0] is trying to acquire:
    [ 41.305628] (&(&lp->lock)->rlock){+.+...}, at: [] arcnet_send_packet+0x60/0x1c0 [arcnet]
    [ 41.315199]
    [ 41.315199] and this task is already holding:
    [ 41.321324] (_xmit_ARCNET#2){+.-...}, at: [] packet_direct_xmit+0xfc/0x1c8
    [ 41.329593] which would create a new lock dependency:
    [ 41.334893] (_xmit_ARCNET#2){+.-...} -> (&(&lp->lock)->rlock){+.+...}
    [ 41.341801]
    [ 41.341801] but this new dependency connects a SOFTIRQ-irq-safe lock:
    [ 41.350108] (_xmit_ARCNET#2){+.-...}
    ... which became SOFTIRQ-irq-safe at:
    [ 41.357539] [] _raw_spin_lock+0x30/0x40
    [ 41.362677] [] dev_watchdog+0x5c/0x264
    [ 41.367723] [] call_timer_fn+0x6c/0xf4
    [ 41.372759] [] run_timer_softirq+0x154/0x210
    [ 41.378340] [] __do_softirq+0x144/0x298
    [ 41.383469] [] irq_exit+0xcc/0x130
    [ 41.388138] [] __handle_domain_irq+0x60/0xb4
    [ 41.393728] [] __irq_svc+0x58/0x78
    [ 41.398402] [] arch_cpu_idle+0x24/0x3c
    [ 41.403443] [] cpu_startup_entry+0x1f8/0x25c
    [ 41.409029] [] start_kernel+0x3c0/0x3cc
    [ 41.414170]
    [ 41.414170] to a SOFTIRQ-irq-unsafe lock:
    [ 41.419931] (&(&lp->lock)->rlock){+.+...}
    ... which became SOFTIRQ-irq-unsafe at:
    [ 41.427996] ... [] _raw_spin_lock+0x30/0x40
    [ 41.433409] [] arcnet_interrupt+0x2c/0x800 [arcnet]
    [ 41.439646] [] handle_nested_irq+0x8c/0xec
    [ 41.445063] [] regmap_irq_thread+0x190/0x314
    [ 41.450661] [] irq_thread_fn+0x1c/0x34
    [ 41.455700] [] irq_thread+0x13c/0x1dc
    [ 41.460649] [] kthread+0xe4/0xf8
    [ 41.465158] [] ret_from_fork+0x14/0x24
    [ 41.470207]
    [ 41.470207] other info that might help us debug this:
    [ 41.470207]
    [ 41.478627] Possible interrupt unsafe locking scenario:
    [ 41.478627]
    [ 41.485763] CPU0 CPU1
    [ 41.490521] ---- ----
    [ 41.495279] lock(&(&lp->lock)->rlock);
    [ 41.499414] local_irq_disable();
    [ 41.505636] lock(_xmit_ARCNET#2);
    [ 41.511967] lock(&(&lp->lock)->rlock);
    [ 41.518741]
    [ 41.521490] lock(_xmit_ARCNET#2);
    [ 41.525356]
    [ 41.525356] *** DEADLOCK ***
    [ 41.525356]
    [ 41.531587] 1 lock held by arcecho/233:
    [ 41.535617] #0: (_xmit_ARCNET#2){+.-...}, at: [] packet_direct_xmit+0xfc/0x1c8
    [ 41.544355]
    the dependencies between SOFTIRQ-irq-safe lock and the holding lock:
    [ 41.552362] -> (_xmit_ARCNET#2){+.-...} ops: 27 {
    [ 41.557357] HARDIRQ-ON-W at:
    [ 41.560664] [] _raw_spin_lock+0x30/0x40
    [ 41.567445] [] dev_deactivate_many+0x114/0x304
    [ 41.574866] [] dev_deactivate+0x24/0x38
    [ 41.581646] [] linkwatch_do_dev+0x40/0x74
    [ 41.588613] [] __linkwatch_run_queue+0xec/0x140
    [ 41.596120] [] linkwatch_event+0x2c/0x34
    [ 41.602991] [] process_one_work+0x188/0x40c
    [ 41.610131] [] worker_thread+0x4c/0x480
    [ 41.616912] [] kthread+0xe4/0xf8
    [ 41.623048] [] ret_from_fork+0x14/0x24
    [ 41.629735] IN-SOFTIRQ-W at:
    [ 41.633039] [] _raw_spin_lock+0x30/0x40
    [ 41.639820] [] dev_watchdog+0x5c/0x264
    [ 41.646508] [] call_timer_fn+0x6c/0xf4
    [ 41.653190] [] run_timer_softirq+0x154/0x210
    [ 41.660425] [] __do_softirq+0x144/0x298
    [ 41.667201] [] irq_exit+0xcc/0x130
    [ 41.673518] [] __handle_domain_irq+0x60/0xb4
    [ 41.680754] [] __irq_svc+0x58/0x78
    [ 41.687077] [] arch_cpu_idle+0x24/0x3c
    [ 41.693769] [] cpu_startup_entry+0x1f8/0x25c
    [ 41.701006] [] start_kernel+0x3c0/0x3cc
    [ 41.707791] INITIAL USE at:
    [ 41.711003] [] _raw_spin_lock+0x30/0x40
    [ 41.717696] [] dev_deactivate_many+0x114/0x304
    [ 41.725026] [] dev_deactivate+0x24/0x38
    [ 41.731718] [] linkwatch_do_dev+0x40/0x74
    [ 41.738593] [] __linkwatch_run_queue+0xec/0x140
    [ 41.746011] [] linkwatch_event+0x2c/0x34
    [ 41.752789] [] process_one_work+0x188/0x40c
    [ 41.759847] [] worker_thread+0x4c/0x480
    [ 41.766541] [] kthread+0xe4/0xf8
    [ 41.772596] [] ret_from_fork+0x14/0x24
    [ 41.779198] }
    [ 41.780945] ... key at: [] netdev_xmit_lock_key+0x38/0x1c8
    [ 41.788192] ... acquired at:
    [ 41.791309] [] lock_acquire+0x70/0x90
    [ 41.796361] [] _raw_spin_lock_irqsave+0x40/0x54
    [ 41.802324] [] arcnet_send_packet+0x60/0x1c0 [arcnet]
    [ 41.808844] [] packet_direct_xmit+0x130/0x1c8
    [ 41.814622] [] packet_sendmsg+0x3b8/0x680
    [ 41.820034] [] sock_sendmsg+0x14/0x24
    [ 41.825091] [] SyS_sendto+0xb8/0xe0
    [ 41.829956] [] SyS_send+0x18/0x20
    [ 41.834638] [] ret_fast_syscall+0x0/0x1c
    [ 41.839954]
    [ 41.841514]
    the dependencies between the lock to be acquired and SOFTIRQ-irq-unsafe lock:
    [ 41.850302] -> (&(&lp->lock)->rlock){+.+...} ops: 5 {
    [ 41.855644] HARDIRQ-ON-W at:
    [ 41.858945] [] _raw_spin_lock+0x30/0x40
    [ 41.865726] [] arcnet_interrupt+0x2c/0x800 [arcnet]
    [ 41.873607] [] handle_nested_irq+0x8c/0xec
    [ 41.880666] [] regmap_irq_thread+0x190/0x314
    [ 41.887901] [] irq_thread_fn+0x1c/0x34
    [ 41.894593] [] irq_thread+0x13c/0x1dc
    [ 41.901195] [] kthread+0xe4/0xf8
    [ 41.907338] [] ret_from_fork+0x14/0x24
    [ 41.914025] SOFTIRQ-ON-W at:
    [ 41.917328] [] _raw_spin_lock+0x30/0x40
    [ 41.924106] [] arcnet_interrupt+0x2c/0x800 [arcnet]
    [ 41.931981] [] handle_nested_irq+0x8c/0xec
    [ 41.939028] [] regmap_irq_thread+0x190/0x314
    [ 41.946264] [] irq_thread_fn+0x1c/0x34
    [ 41.952954] [] irq_thread+0x13c/0x1dc
    [ 41.959548] [] kthread+0xe4/0xf8
    [ 41.965689] [] ret_from_fork+0x14/0x24
    [ 41.972379] INITIAL USE at:
    [ 41.975595] [] _raw_spin_lock+0x30/0x40
    [ 41.982283] [] arcnet_interrupt+0x2c/0x800 [arcnet]
    [ 41.990063] [] handle_nested_irq+0x8c/0xec
    [ 41.997027] [] regmap_irq_thread+0x190/0x314
    [ 42.004172] [] irq_thread_fn+0x1c/0x34
    [ 42.010766] [] irq_thread+0x13c/0x1dc
    [ 42.017267] [] kthread+0xe4/0xf8
    [ 42.023314] [] ret_from_fork+0x14/0x24
    [ 42.029903] }
    [ 42.031648] ... key at: [] __key.42091+0x0/0xfffff0f8 [arcnet]
    [ 42.039255] ... acquired at:
    [ 42.042372] [] lock_acquire+0x70/0x90
    [ 42.047413] [] _raw_spin_lock_irqsave+0x40/0x54
    [ 42.053364] [] arcnet_send_packet+0x60/0x1c0 [arcnet]
    [ 42.059872] [] packet_direct_xmit+0x130/0x1c8
    [ 42.065634] [] packet_sendmsg+0x3b8/0x680
    [ 42.071030] [] sock_sendmsg+0x14/0x24
    [ 42.076069] [] SyS_sendto+0xb8/0xe0
    [ 42.080926] [] SyS_send+0x18/0x20
    [ 42.085601] [] ret_fast_syscall+0x0/0x1c
    [ 42.090918]
    [ 42.092481]
    [ 42.092481] stack backtrace:
    [ 42.097065] CPU: 0 PID: 233 Comm: arcecho Not tainted 4.4.0-00034-gc0ae784 #536
    [ 42.104751] Hardware name: Generic AM33XX (Flattened Device Tree)
    [ 42.111183] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [ 42.119337] [] (show_stack) from [] (dump_stack+0x8c/0x9c)
    [ 42.126937] [] (dump_stack) from [] (check_usage+0x4bc/0x63c)
    [ 42.134815] [] (check_usage) from [] (check_irq_usage+0x58/0xb0)
    [ 42.142964] [] (check_irq_usage) from [] (__lock_acquire+0x1524/0x20b0)
    [ 42.151740] [] (__lock_acquire) from [] (lock_acquire+0x70/0x90)
    [ 42.159886] [] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x40/0x54)
    [ 42.168768] [] (_raw_spin_lock_irqsave) from [] (arcnet_send_packet+0x60/0x1c0 [arcnet])
    [ 42.179115] [] (arcnet_send_packet [arcnet]) from [] (packet_direct_xmit+0x130/0x1c8)
    [ 42.189182] [] (packet_direct_xmit) from [] (packet_sendmsg+0x3b8/0x680)
    [ 42.198059] [] (packet_sendmsg) from [] (sock_sendmsg+0x14/0x24)
    [ 42.206199] [] (sock_sendmsg) from [] (SyS_sendto+0xb8/0xe0)
    [ 42.213978] [] (SyS_sendto) from [] (SyS_send+0x18/0x20)
    [ 42.221388] [] (SyS_send) from [] (ret_fast_syscall+0x0/0x1c)

    Signed-off-by: Michael Grzeschik

    ---
    v1 -> v2: removed unneeded zero assignment of flags
    Signed-off-by: David S. Miller

    Michael Grzeschik
     

16 Jun, 2017

1 commit

  • It seems like a historic accident that these return unsigned char *,
    and in many places that means casts are required, more often than not.

    Make these functions return void * and remove all the casts across
    the tree, adding a (u8 *) cast only where the unsigned char pointer
    was used directly, all done with the following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    @@
    expression SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - fn(SKB, LEN)[0]
    + *(u8 *)fn(SKB, LEN)

    Note that the last part there converts from push(...)[0] to the
    more idiomatic *(u8 *)push(...).

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

20 Apr, 2017

1 commit

  • When the kernel is running in secure boot mode, we lock down the kernel to
    prevent userspace from modifying the running kernel image. Whilst this
    includes prohibiting access to things like /dev/mem, it must also prevent
    access by means of configuring driver modules in such a way as to cause a
    device to access or modify the kernel image.

    To this end, annotate module_param* statements that refer to hardware
    configuration and indicate for future reference what type of parameter they
    specify. The parameter parser in the core sees this information and can
    skip such parameters with an error message if the kernel is locked down.
    The module initialisation then runs as normal, but just sees whatever the
    default values for those parameters is.

    Note that we do still need to do the module initialisation because some
    drivers have viable defaults set in case parameters aren't specified and
    some drivers support automatic configuration (e.g. PNP or PCI) in addition
    to manually coded parameters.

    This patch annotates drivers in drivers/net/arcnet/.

    Suggested-by: Alan Cox
    Signed-off-by: David Howells
    cc: Michael Grzeschik
    cc: netdev@vger.kernel.org

    David Howells
     

28 Feb, 2017

1 commit

  • Now that %z is standartised in C99 there is no reason to support %Z.
    Unlike %L it doesn't even make format strings smaller.

    Use BUILD_BUG_ON in a couple ATM drivers.

    In case anyone didn't notice lib/vsprintf.o is about half of SLUB which
    is in my opinion is quite an achievement. Hopefully this patch inspires
    someone else to trim vsprintf.c more.

    Link: http://lkml.kernel.org/r/20170103230126.GA30170@avx2
    Signed-off-by: Alexey Dobriyan
    Cc: Andy Shevchenko
    Cc: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

20 Apr, 2016

1 commit

  • Add __init attribute on a function that is only called from other __init
    functions and that is not inlined, at least with gcc version 4.8.4 on an
    x86 machine with allyesconfig. Currently, the function is put in the
    .text.unlikely segment. Declaring it as __init will cause it to be put in
    the .init.text and to disappear after initialization.

    The result of objdump -x on the function before the change is as follows:

    0000000000000000 l F .text.unlikely 00000000000000bf check_mirror

    And after the change it is as follows:

    0000000000000000 l F .init.text 00000000000000ba check_mirror

    Done with the help of Coccinelle. The semantic patch checks for local
    static non-init functions that are called from an __init function and are
    not called from any other function.

    Signed-off-by: Julia Lawall
    Acked-by: Michael Grzeschik
    Signed-off-by: David S. Miller

    Julia Lawall
     

04 Nov, 2015

1 commit

  • The newly added led trigger support in the com20020-pci driver causes
    build errors when CONFIG_LEDS_CLASS is disabled:

    drivers/built-in.o: In function `com20020pci_probe':
    (.text+0x185dc4): undefined reference to `devm_led_classdev_register'
    (.text+0x185dd8): undefined reference to `devm_led_classdev_register'

    This adds a Kconfig dependency to prevent the invalid configurations.
    Other drivers appear to be split 50:50 between 'select' and 'depends on'
    for this symbol, I picked 'depends on' as I could not find a common
    policy and it generally causes fewer problems.

    Signed-off-by: Arnd Bergmann
    Fixes: 8890624a4e8c ("arcnet: com20020-pci: add led trigger support")
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

26 Oct, 2015

6 commits


27 Sep, 2015

1 commit