1. 15 Nov, 2019 1 commit
  2. 30 May, 2019 1 commit
  3. 29 Apr, 2019 1 commit
  4. 22 Sep, 2018 1 commit
  5. 05 Jun, 2017 1 commit
  6. 05 Feb, 2017 1 commit
  7. 18 Dec, 2016 1 commit
  8. 05 Dec, 2016 1 commit
    • Florian Fainelli's avatar
      net: ep93xx_eth: Do not crash unloading module · c823abac
      Florian Fainelli authored
      When we unload the ep93xx_eth, whether we have opened the network
      interface or not, we will either hit a kernel paging request error, or a
      simple NULL pointer de-reference because:
      - if ep93xx_open has been called, we have created a valid DMA mapping
        for ep->descs, when we call ep93xx_stop, we also call
        ep93xx_free_buffers, ep->descs now has a stale value
      - if ep93xx_open has not been called, we have a NULL pointer for
        ep->descs, so performing any operation against that address just won't
      Fix this by adding a NULL pointer check for ep->descs which means that
      ep93xx_free_buffers() was able to successfully tear down the descriptors
      and free the DMA cookie as well.
      Fixes: 1d22e05d
       ("[PATCH] Cirrus Logic ep93xx ethernet driver")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  9. 13 Oct, 2016 1 commit
    • Jarod Wilson's avatar
      net: deprecate eth_change_mtu, remove usage · a52ad514
      Jarod Wilson authored
      With centralized MTU checking, there's nothing productive done by
      eth_change_mtu that isn't already done in dev_set_mtu, so mark it as
      deprecated and remove all usage of it in the kernel. All callers have been
      audited for calls to alloc_etherdev* or ether_setup directly, which means
      they all have a valid dev->min_mtu and dev->max_mtu. Now eth_change_mtu
      prints out a netdev_warn about being deprecated, for the benefit of
      out-of-tree drivers that might be utilizing it.
      Of note, dvb_net.c actually had dev->mtu = 4096, while using
      eth_change_mtu, meaning that if you ever tried changing it's mtu, you
      couldn't set it above 1500 anymore. It's now getting dev->max_mtu also set
      to 4096 to remedy that.
      v2: fix up lantiq_etop, missed breakage due to drive not compiling on x86
      CC: netdev@vger.kernel.org
      Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  10. 05 Feb, 2015 1 commit
  11. 20 Oct, 2014 1 commit
  12. 16 Jan, 2014 1 commit
  13. 30 Aug, 2013 1 commit
  14. 28 May, 2013 1 commit
  15. 18 Mar, 2013 1 commit
  16. 07 Jan, 2013 1 commit
  17. 15 Feb, 2012 1 commit
  18. 06 Feb, 2012 1 commit
  19. 12 Aug, 2011 1 commit
  20. 11 Jun, 2011 4 commits
    • Mika Westerberg's avatar
      net: ep93xx_eth: fix DMA API violations · f1c089e3
      Mika Westerberg authored
      Russell King said:
      > So, to summarize what its doing:
      > 1. It allocates buffers for rx and tx.
      > 2. It maps them with dma_map_single().
      >       This transfers ownership of the buffer to the DMA device.
      > 3. In ep93xx_xmit,
      > 3a. It copies the data into the buffer with skb_copy_and_csum_dev()
      >       This violates the DMA buffer ownership rules - the CPU should
      >       not be writing to this buffer while it is (in principle) owned
      >       by the DMA device.
      > 3b. It then calls dma_sync_single_for_cpu() for the buffer.
      >       This transfers ownership of the buffer to the CPU, which surely
      >       is the wrong direction.
      > 4. In ep93xx_rx,
      > 4a. It calls dma_sync_single_for_cpu() for the buffer.
      >       This at least transfers the DMA buffer ownership to the CPU
      >       before the CPU reads the buffer
      > 4b. It then uses skb_copy_to_linear_data() to copy the data out.
      >       At no point does it transfer ownership back to the DMA device.
      > 5. When the driver is removed, it dma_unmap_single()'s the buffer.
      >       This transfers ownership of the buffer to the CPU.
      > 6. It frees the buffer.
      > While it may work on ep93xx, it's not respecting the DMA API rules,
      > and with DMA debugging enabled it will probably encounter quite a few
      > warnings.
      This patch fixes these violations.
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@iki.fi>
      Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Tested-by: default avatarPetr Stetiar <ynezz@true.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Mika Westerberg's avatar
      net: ep93xx_eth: drop GFP_DMA from call to dma_alloc_coherent() · 1f758a43
      Mika Westerberg authored
      Commit a197b59a
       (mm: fail GFP_DMA allocations when ZONE_DMA is not
      configured) made page allocator to return NULL if GFP_DMA is set but
      CONFIG_ZONE_DMA is disabled.
      This causes ep93xx_eth to fail:
       WARNING: at mm/page_alloc.c:2251 __alloc_pages_nodemask+0x11c/0x638()
       Modules linked in:
       [<c0035498>] (unwind_backtrace+0x0/0xf4) from [<c0043da4>] (warn_slowpath_common+0x48/0x60)
       [<c0043da4>] (warn_slowpath_common+0x48/0x60) from [<c0043dd8>] (warn_slowpath_null+0x1c/0x24)
       [<c0043dd8>] (warn_slowpath_null+0x1c/0x24) from [<c0083b6c>] (__alloc_pages_nodemask+0x11c/0x638)
       [<c0083b6c>] (__alloc_pages_nodemask+0x11c/0x638) from [<c00366fc>] (__dma_alloc+0x8c/0x3ec)
       [<c00366fc>] (__dma_alloc+0x8c/0x3ec) from [<c0036adc>] (dma_alloc_coherent+0x54/0x60)
       [<c0036adc>] (dma_alloc_coherent+0x54/0x60) from [<c0227808>] (ep93xx_open+0x20/0x864)
       [<c0227808>] (ep93xx_open+0x20/0x864) from [<c0283144>] (__dev_open+0xb8/0x108)
       [<c0283144>] (__dev_open+0xb8/0x108) from [<c0280528>] (__dev_change_flags+0x70/0x128)
       [<c0280528>] (__dev_change_flags+0x70/0x128) from [<c0283054>] (dev_change_flags+0x10/0x48)
       [<c0283054>] (dev_change_flags+0x10/0x48) from [<c001a720>] (ip_auto_config+0x190/0xf68)
       [<c001a720>] (ip_auto_config+0x190/0xf68) from [<c00233b0>] (do_one_initcall+0x34/0x18c)
       [<c00233b0>] (do_one_initcall+0x34/0x18c) from [<c0008400>] (kernel_init+0x94/0x134)
       [<c0008400>] (kernel_init+0x94/0x134) from [<c0030858>] (kernel_thread_exit+0x0/0x8)
      Since there is no restrictions for DMA on ep93xx, we can fix this by just
      removing the GFP_DMA flag from the call.
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@iki.fi>
      Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Tested-by: default avatarPetr Stetiar <ynezz@true.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Mika Westerberg's avatar
      net: ep93xx_eth: allocate buffers using kmalloc() · 3247a1fc
      Mika Westerberg authored
      We can use simply kmalloc() to allocate the buffers. This also simplifies the
      code and allows us to perform DMA sync operations more easily.
      Memory is allocated with only GFP_KERNEL since there are no DMA allocation
      restrictions on this platform.
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@iki.fi>
      Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Tested-by: default avatarPetr Stetiar <ynezz@true.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Mika Westerberg's avatar
      net: ep93xx_eth: pass struct device to DMA API functions · fc9b4910
      Mika Westerberg authored
      We shouldn't use NULL for any DMA API functions, unless we are dealing with
      ISA or EISA device. So pass correct struct dev pointer to these functions.
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@iki.fi>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  21. 07 Jun, 2011 1 commit
  22. 20 Aug, 2010 1 commit
  23. 10 May, 2010 1 commit
  24. 04 May, 2010 1 commit
  25. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      The script does the followings.
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
      The conversion was done in the following steps.
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
      6. percpu.h was updated not to include slab.h.
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
  26. 08 Jan, 2010 1 commit
    • H Hartley Sweeten's avatar
      ep93xx_eth.c general cleanup · df2f7ec8
      H Hartley Sweeten authored
      General cleanup of the ep93xx_eth driver.
      1) Use pr_fmt() to prefix the module name and __func__ to the error 
      2) <linux/io.h> instead of <asm/io.h>
      3) <mach/hardware.h> instead of <mach/ep93xx-regs.h> and <mach/platform.h>
      4) Move the ep93xx_mdio_read (and ep93xx_mdio_write) function to eliminate
         the function prototype.
      5) Change all the printk(<level> messages to pr_<level> and remove the 
         __func__ argument.
      6) Use platform_get_{resource/irq} to get the platform resources and add
         an error check.
      7) Use resource_size() for request_mem_region() and ioremap().
      8) Use %pM to print the MAC address at the end of the probe.
      9) Use dev->dev_addr not data->dev_addr for the MAC argument because a
         random address could be used if the platform does not supply one.
      The message at the end of the probe is left as a printk since it displays
      cleaner without the function name that would be displayed with pr_info().
      Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Acked-by: default avatarLennert Buytenhek <kernel@wantstofly.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  27. 30 Nov, 2009 1 commit
  28. 02 Sep, 2009 1 commit
  29. 29 May, 2009 1 commit
  30. 16 Apr, 2009 1 commit
  31. 11 Apr, 2009 1 commit
  32. 21 Jan, 2009 1 commit
  33. 30 Dec, 2008 1 commit
    • Kamalesh Babulal's avatar
      net: Fix more NAPI interface netdev argument drop fallout. · 2d0658d4
      Kamalesh Babulal authored
      I hit similar build failure due to the change in the netif_rx_reschedule()
      drivers/net/ehea/ehea_main.c: In function 'ehea_poll':
      drivers/net/ehea/ehea_main.c:844: warning: passing argument 1 of 'netif_rx_reschedule' from incompatible pointer type
      drivers/net/ehea/ehea_main.c:844: error: too many arguments to function 'netif_rx_reschedule'
      make[3]: *** [drivers/net/ehea/ehea_main.o] Error 1
      greping through the sources for the changes missed out, we have
      ./drivers/net/arm/ixp4xx_eth.c:507:							netif_rx_reschedule(dev, napi)) {
      ./drivers/net/arm/ep93xx_eth.c:310:             if (more && netif_rx_reschedule(dev, napi))
      ./drivers/net/wan/ixp4xx_hss.c:657:							netif_rx_reschedule(dev, napi)) {
      Signed-off-by: default avatarKamalesh Babulal <kamalesh@linux.vnet.ibm.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  34. 23 Dec, 2008 1 commit
  35. 04 Nov, 2008 1 commit
  36. 07 Aug, 2008 1 commit
  37. 26 Jul, 2008 1 commit
    • FUJITA Tomonori's avatar
      dma-mapping: add the device argument to dma_mapping_error() · 8d8bb39b
      FUJITA Tomonori authored
      Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER
      architecture does:
      This enables us to cleanly fix the Calgary IOMMU issue that some devices
      are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423
      I think that per-device dma_mapping_ops support would be also helpful for
      KVM people to support PCI passthrough but Andi thinks that this makes it
      difficult to support the PCI passthrough (see the above thread).  So I
      CC'ed this to KVM camp.  Comments are appreciated.
      A pointer to dma_mapping_ops to struct dev_archdata is added.  If the
      pointer is non NULL, DMA operations in asm/dma-mapping.h use it.  If it's
      NULL, the system-wide dma_ops pointer is used as before.
      If it's useful for KVM people, I plan to implement a mechanism to register
      a hook called when a new pci (or dma capable) device is created (it works
      with hot plugging).  It enables IOMMUs to set up an appropriate
      dma_mapping_ops per device.
      The major obstacle is that dma_mapping_error doesn't take a pointer to the
      device unlike other DMA operations.  So x86 can't have dma_mapping_ops per
      device.  Note all the POWER IOMMUs use the same dma_mapping_error function
      so this is not a problem for POWER but x86 IOMMUs use different
      dma_mapping_error functions.
      The first patch adds the device argument to dma_mapping_error.  The patch
      is trivial but large since it touches lots of drivers and dma-mapping.h in
      all the architecture.
      This patch:
      dma_mapping_error() doesn't take a pointer to the device unlike other DMA
      operations.  So we can't have dma_mapping_ops per device.
      Note that POWER already has dma_mapping_ops per device but all the POWER
      IOMMUs use the same dma_mapping_error function.  x86 IOMMUs use device
      [akpm@linux-foundation.org: fix sge]
      [akpm@linux-foundation.org: fix svc_rdma]
      [akpm@linux-foundation.org: build fix]
      [akpm@linux-foundation.org: fix bnx2x]
      [akpm@linux-foundation.org: fix s2io]
      [akpm@linux-foundation.org: fix pasemi_mac]
      [akpm@linux-foundation.org: fix sdhci]
      [akpm@linux-foundation.org: build fix]
      [akpm@linux-foundation.org: fix sparc]
      [akpm@linux-foundation.org: fix ibmvscsi]
      Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Muli Ben-Yehuda <muli@il.ibm.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Avi Kivity <avi@qumranet.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>