1. 27 6月, 2016 1 次提交
  2. 05 5月, 2016 1 次提交
  3. 21 3月, 2016 1 次提交
    • A
      net: smc911x: avoid unused variable warnings · abc34d75
      Arnd Bergmann 提交于
      The change to use the generic DMA engine API in the smc911x
      driver has led to a harmless warning about unused local variables:
      
      smsc/smc911x.c: In function 'smc911x_probe':
      smsc/smc911x.c:1796:20: error: unused variable 'param'
      smsc/smc911x.c:1795:17: error: unused variable 'mask'
      smsc/smc911x.c:1794:26: error: unused variable 'config'
      
      This puts the variable declarations inside of the same #ifdef
      that protects their use.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 79d3b59a ("net: smc911x: convert pxa dma to dmaengine")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      abc34d75
  4. 19 3月, 2016 1 次提交
  5. 15 3月, 2016 1 次提交
    • A
      smc91x: avoid self-comparison warning · e3ebd894
      Arnd Bergmann 提交于
      The smc91x driver defines a macro that compares its argument to
      itself, apparently to get a true result while using its argument
      to avoid a warning about unused local variables.
      
      Unfortunately, this triggers a warning with gcc-6, as the comparison
      is obviously useless:
      
      drivers/net/ethernet/smsc/smc91x.c: In function 'smc_hardware_send_pkt':
      drivers/net/ethernet/smsc/smc91x.c:563:14: error: self-comparison always evaluates to true [-Werror=tautological-compare]
        if (!smc_special_trylock(&lp->lock, flags)) {
      
      This replaces the macro with another one that behaves similarly,
      with a cast to (void) to ensure the argument is used, and using
      a literal 'true' as its value.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3ebd894
  6. 17 2月, 2016 1 次提交
  7. 16 1月, 2016 1 次提交
  8. 08 1月, 2016 5 次提交
  9. 17 11月, 2015 1 次提交
    • P
      net: smsc911x: Reset PHY during initialization · cd998ecd
      Pavel Fedin 提交于
      On certain hardware after software reboot the chip may get stuck and fail
      to reinitialize during reset. This can be fixed by ensuring that PHY is
      reset too.
      
      Old PHY resetting method required operational MDIO interface, therefore
      the chip should have been already set up. In order to be able to function
      during probe, it is changed to use PMT_CTRL register.
      
      The problem could be observed on SMDK5410 board.
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cd998ecd
  10. 02 11月, 2015 1 次提交
    • P
      net: smsc911x: Fix crash if loopback test fails · b43c142f
      Pavel Fedin 提交于
      On certain hardware in certain situations loopback test fails and the
      driver gets removed. During mdiobus_unregister() instance of PHY driver
      gets disposed. But by this time it has already been started using
      phy_connect_direct().
      
      PHY driver uses DELAYED_WORK in order to maintain its state. Attempting
      to dispose the driver without calling phy_disconnect() causes deallocation
      of DELAYED_WORK being active. This shortly causes a bad crash in timer
      code.
      
      The problem can be discovered by enabling CONFIG_DEBUG_OBJECTS_TIMERS and
      CONFIG_DEBUG_OBJECTS_FREE
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b43c142f
  11. 18 9月, 2015 1 次提交
  12. 30 8月, 2015 1 次提交
  13. 28 8月, 2015 2 次提交
  14. 21 8月, 2015 1 次提交
  15. 18 8月, 2015 1 次提交
    • G
      smsc911x: Fix crash seen if neither ACPI nor OF is configured or used · 62ee783b
      Guenter Roeck 提交于
      Commit 0b50dc4f ("Convert smsc911x to use ACPI as well as DT") makes
      the call to smsc911x_probe_config() unconditional, and no longer fails if
      there is no device node. device_get_phy_mode() is called unconditionally,
      and if there is no phy node configured returns an error code. This error
      code is assigned to phy_interface, and interpreted elsewhere in the code
      as valid phy mode. This in turn causes qemu to crash when running a
      variant of realview_pb_defconfig.
      
      	qemu: hardware error: lan9118_read: Bad reg 0x86
      
      Fixes: 0b50dc4f ("Convert smsc911x to use ACPI as well as DT")
      Cc: Jeremy Linton <jeremy.linton@arm.com>
      Cc Graeme Gregory <graeme.gregory@linaro.org>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62ee783b
  16. 14 8月, 2015 1 次提交
  17. 23 6月, 2015 1 次提交
    • P
      drivers/net: remove all references to obsolete Ethernet-HOWTO · 138b15ed
      Paul Gortmaker 提交于
      This howto made sense in the 1990s when users had to manually configure
      ISA cards with jumpers or vendor utilities, but with the implementation
      of PCI it became increasingly less and less relevant, to the point where
      it has been well over a decade since I last updated it.  And there is
      no value in anyone else taking over updating it either.
      
      However the references to it continue to spread as boiler plate text
      from one Kconfig file into the next.  We are not doing end users any
      favours by pointing them at this old document, so lets kill it with
      fire, once and for all, to hopefully stop any further spread.
      
      No code is changed in this commit, just Kconfig help text.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      138b15ed
  18. 05 5月, 2015 2 次提交
  19. 01 4月, 2015 1 次提交
  20. 30 3月, 2015 1 次提交
  21. 18 3月, 2015 1 次提交
    • R
      Revert "smc91x: retrieve IRQ and trigger flags in a modern way" · 8d7d9cca
      Robert Jarzmik 提交于
      The commit breaks the legacy platforms, ie. these not using device-tree,
      and setting up the interrupt resources with a flag to activate edge
      detection. The issue was found on the zylonite platform.
      
      The reason is that zylonite uses platform resources to pass the interrupt number
      and the irq flags (here IORESOURCE_IRQ_HIGHEDGE). It expects the driver to
      request the irq with these flags, which in turn setups the irq as high edge
      triggered.
      
      After the patch, this was supposed to be taken care of with :
        irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq));
      
      But irq_resflags is 0 for legacy platforms, while for example in
      arch/arm/mach-pxa/zylonite.c, in struct resource smc91x_resources[] the
      irq flag is specified. This breaks zylonite because the interrupt is not
      setup as triggered, and hardware doesn't provide interrupts.
      Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d7d9cca
  22. 05 3月, 2015 1 次提交
    • A
      ARM: fix typos in smc91x platform data · 04b91701
      Arnd Bergmann 提交于
      I recently did a rework of the smc91x driver and did some build-testing
      by compiling hundreds of randconfig kernels. Unfortunately, my script
      was wrong and did not actually test the configurations that mattered,
      so I introduced stupid typos in almost every file I touched.
      
      I fixed my script now, built all configurations that actually matter
      and fixed all the typos, this is the result.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: b70661c7 ("net: smc91x: use run-time configuration on all ARM machines")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      04b91701
  23. 04 3月, 2015 1 次提交
  24. 02 3月, 2015 1 次提交
  25. 01 3月, 2015 1 次提交
    • A
      net: smc91x: use run-time configuration on all ARM machines · b70661c7
      Arnd Bergmann 提交于
      The smc91x driver traditionally gets configured at compile-time
      for whichever hardware it runs on. This no longer works on
      ARM as we continue to move to building all-in-one kernels.
      
      Most ARM configurations with this driver already use run-time
      configuration through DT or through platform_data, but a
      few have not been converted yet.
      
      I've checked all ARM boards that use this driver in their
      legacy board files, and converted the ones that were using
      compile-time configuration in smc91x.h to behave like the
      other ones and provide the interrupt polarity along with
      the MMIO configuration (width, stride) at platform device
      creation time.
      
      In particular, these combinations were previously selectable
      in Kconfig but in fact broken:
      
      - sa1100 assabet plus pleb
      - msm combined with any other armv6/v7 platform
      - pxa-idp combined with any non-DMA pxa variant
      - LogicPD PXA270 combined with any other pxa
      - nomadik combined with any other armv4/v5 platform,
        e.g. versatile.
      
      None of these seem critical enough to warrant a backport
      to stable, but it would be nice to clean this up for good.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      ----
      I would like the patch to get merged through netdev, after
      Robert and/or Linus have verified it on at least some hardware.
      
      There are a few other non-ARM platforms using this driver,
      I could do the same patch for those if we want to take
      it further.
      
       arch/arm/mach-msm/board-halibut.c    |   8 ++++-
       arch/arm/mach-msm/board-qsd8x50.c    |   8 ++++-
       arch/arm/mach-pxa/idp.c              |   5 +++
       arch/arm/mach-pxa/lpd270.c           |   8 ++++-
       arch/arm/mach-realview/core.c        |   7 ++++
       arch/arm/mach-realview/realview_eb.c |   2 +-
       arch/arm/mach-sa1100/neponset.c      |   6 ++++
       arch/arm/mach-sa1100/pleb.c          |   7 ++++
       drivers/net/ethernet/smsc/smc91x.c   |   9 +++--
       drivers/net/ethernet/smsc/smc91x.h   | 114 ++----------------------------------------------------------
       10 files changed, 57 insertions(+), 117 deletions(-)
      Tested-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b70661c7
  26. 21 2月, 2015 1 次提交
    • A
      net: smc91x: improve neponset hack · 15added6
      Arnd Bergmann 提交于
      The smc91x driver tries to support multiple platforms at compile
      time, but they are mutually exclusive at runtime, and not clearly
      defined.
      
      Trying to build for CONFIG_SA1100_ASSABET without CONFIG_ASSABET_NEPONSET
      results in this link error:
      
      drivers/built-in.o: In function `smc_drv_probe':
      :(.text+0x33310c): undefined reference to `neponset_ncr_frob'
      
      since the neponset_ncr_set function is not defined otherwise.
      
      Similarly, building for both CONFIG_SA1100_ASSABET and CONFIG_SA1100_PLEB
      results in a different build error:
      
      smsc/smc91x.c: In function 'smc_drv_probe':
      smsc/smc91x.c:2299:2: error: implicit declaration of function 'neponset_ncr_set' [-Werror=implicit-function-declaration]
        neponset_ncr_set(NCR_ENET_OSC_EN);
        ^
      smsc/smc91x.c:2299:19: error: 'NCR_ENET_OSC_EN' undeclared (first use in this function)
        neponset_ncr_set(NCR_ENET_OSC_EN);
                         ^
      
      This is an attempt to fix the call site responsible for both
      errors, making sure we call the function exactly when the driver
      is actually trying to run on the assabet/neponset machine. With
      this patch, I no longer see randconfig build errors in this file.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      15added6
  27. 16 1月, 2015 1 次提交
  28. 16 12月, 2014 1 次提交
    • T
      net: smc91x: Fix build without gpiolib · 372a0730
      Tobias Klauser 提交于
      If GPIOLIB=n the following build errors occur:
      
      drivers/net/ethernet/smsc/smc91x.c: In function 'try_toggle_control_gpio':
      drivers/net/ethernet/smsc/smc91x.c:2204:2: error: implicit declaration of function 'devm_gpiod_get_index' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/smsc/smc91x.c:2204:7: warning: assignment makes pointer from integer without a cast [enabled by default]
      drivers/net/ethernet/smsc/smc91x.c:2213:2: error: implicit declaration of function 'gpiod_direction_output' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/smsc/smc91x.c:2216:3: error: implicit declaration of function 'devm_gpiod_put' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/smsc/smc91x.c:2222:2: error: implicit declaration of function 'gpiod_set_value_cansleep' [-Werror=implicit-function-declaration]
      
      Fix this by letting the driver depend on GPIOLIB if OF is selected.
      
      Fixes: 7d2911c4 ("net: smc91x: Fix gpios for device tree based booting")
      Cc: Tony Lindgren <tony@atomide.com>
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      372a0730
  29. 13 12月, 2014 1 次提交
  30. 25 11月, 2014 1 次提交
    • G
      net/smsc911x: Add minimal runtime PM support · 3a611e26
      Geert Uytterhoeven 提交于
      Add minimal runtime PM support (enable on probe, disable on remove), to
      ensure proper operation with a parent device that uses runtime PM.
      
      This is needed on systems where the external bus controller module of
      the SoC is contained in a PM domain and/or has a gateable functional
      clock. In such cases, before accessing any device connected to the
      external bus, the PM domain must be powered up, and/or the functional
      clock must be enabled, which is typically handled through runtime PM by
      the bus controller driver.
      
      An example of this is the kzm9g development board, where an smsc9220
      Ethernet controller is connected to the Bus State Controller (BSC) of a
      Renesas sh73a0 SoC.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a611e26
  31. 14 11月, 2014 3 次提交
    • E
      smsc911x: power-up phydev before doing a software reset. · ccf899a2
      Enric Balletbo i Serra 提交于
      With commit be9dad1f ("net: phy: suspend phydev when going
      to HALTED"), the PHY device will be put in a low-power mode using
      BMCR_PDOWN if the the interface is set down. The smsc911x driver does
      a software_reset opening the device driver (ndo_open). In such case,
      the PHY must be powered-up before access to any register and before
      calling the software_reset function. Otherwise, as the PHY is powered
      down the software reset fails and the interface can not be enabled
      again.
      
      This patch fixes this scenario that is easy to reproduce setting down
      the network interface and setting up again.
      
          $ ifconfig eth0 down
          $ ifconfig eth0 up
          ifconfig: SIOCSIFFLAGS: Input/output error
      Signed-off-by: NEnric Balletbo i Serra <eballetbo@iseebcn.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccf899a2
    • A
      net/smsc911x: Fix delays in the PHY enable/disable routines · 6ff53fd3
      Alexander Kochetkov 提交于
      Increased delay in the smsc911x_phy_disable_energy_detect (from 1ms to 2ms).
      Dropped delays in the smsc911x_phy_enable_energy_detect (100ms and 1ms).
      
      The patch affect SMSC LAN generation 4 chips with integrated PHY (LAN9221).
      
      I saw problems with soft reset due to wrong udelay timings.
      After I fixed udelay, I measured the time needed to bring integrated PHY
      from power-down to operational mode (the time beetween clearing EDPWRDOWN
      bit and soft reset complete event). I got 1ms (measured using ktime_get).
      The value is equal to the current value (1ms) used in the
      smsc911x_phy_disable_energy_detect. It is near the upper bound and in order
      to avoid rare soft reset faults it is doubled (2ms).
      
      I don't know official timing for bringing up integrated PHY as specs doesn't
      clarify this (or may be I didn't found).
      
      It looks safe to drop delays before and after setting EDPWRDOWN bit
      (enable PHY power-down mode). I didn't saw any regressions with the patch.
      
      The patch was reviewed by Steve Glendinning and Microchip Team.
      Signed-off-by: NAlexander Kochetkov <al.kochet@gmail.com>
      Acked-by: NSteve Glendinning <steve.glendinning@shawell.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6ff53fd3
    • A
      net/smsc911x: Fix rare soft reset timeout issue due to PHY power-down mode · 242bcd5b
      Alexander Kochetkov 提交于
      The patch affect SMSC LAN generation 4 chips with integrated PHY (LAN9221).
      
      It is possible that PHY could enter power-down mode (ENERGYON clear),
      between ENERGYON bit check in smsc911x_phy_disable_energy_detect and SRST
      bit set in smsc911x_soft_reset. This could happen, for example, if someone
      disconnect ethernet cable between the checks. The PHY in a power-down mode
      would prevent the MAC portion of chip to be software reseted.
      
      Initially found by code review, confirmed later using test case.
      
      This is low probability issue, and in order to reproduce it you have to
      run the script:
      
      while true; do
      	ifconfig eth0 down
      	ifconfig eth0 up || break
      done
      
      While the script is running you have to plug/unplug ethernet cable many
      times (using gpio controlled ethernet switch, for example) until get:
      
      [ 4516.477783] ADDRCONF(NETDEV_UP): eth0: link is not ready
      [ 4516.512207] smsc911x smsc911x.0: eth0: SMSC911x/921x identified at 0xce006000, IRQ: 336
      [ 4516.524658] ADDRCONF(NETDEV_UP): eth0: link is not ready
      [ 4516.559082] smsc911x smsc911x.0: eth0: SMSC911x/921x identified at 0xce006000, IRQ: 336
      [ 4516.571990] ADDRCONF(NETDEV_UP): eth0: link is not ready
      ifconfig: SIOCSIFFLAGS: Input/output error
      
      The patch was reviewed by Steve Glendinning and Microchip Team.
      Signed-off-by: NAlexander Kochetkov <al.kochet@gmail.com>
      Acked-by: NSteve Glendinning <steve.glendinning@shawell.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      242bcd5b
  32. 02 11月, 2014 1 次提交
    • L
      smc91x: retrieve IRQ and trigger flags in a modern way · d52fdbb7
      Linus Walleij 提交于
      The SMC91x is written to explicitly look up the IRQ resource
      from the platform device and extract the IRQ and flags, however
      the platform_get_irq() does additional things, like call
      of_irq_get() in the device tree case, which will translate
      the IRQ using the irqdomain and defer the probe if the
      IRQ host cannot be found.
      
      As we're not looking up the resource, this will not retrieve
      the IRQ flags, but that is better done using
      irqd_get_trigger_type(), as the trigger is what the driver
      wants to modify. We take care to preserve the semantics that
      will make the trigger type provided from the resource
      override any local specifier.
      
      Tested on the Nomadik NHK15 which has its SMC91x IRQ line
      connected to a STMPE2401 GPIO expander on I2C.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d52fdbb7