summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* rtlwifi: use s8 instead of charArnd Bergmann2016-06-2936-129/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | Compiling the rtlwifi drivers for ARM with gcc -Wextra warns about lots of incorrect code that results from 'char' being unsigned here, e.g. realtek/rtlwifi/rc.c:113:18: error: comparison is always true due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8188ee/dm.c:1070:22: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192ce/trx.c:54:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192cu/mac.c:601:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192de/trx.c:53:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192ee/phy.c:1268:12: error: comparison is always true due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8192se/rf.c:150:20: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8723be/dm.c:877:29: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8723be/phy.c:386:16: error: comparison is always true due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8821ae/dm.c:1514:38: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8821ae/phy.c:1558:11: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8821ae/phy.c:386:24: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/rtl8821ae/trx.c:55:12: error: comparison is always false due to limited range of data type [-Werror=type-limits] realtek/rtlwifi/stats.c:31:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] This patch changes all uses of 'char' in this driver that refer to 8-bit integers to use 's8' instead, which is signed on all architectures. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* libertas: Add spinlock to avoid race conditionPavel Andrianov2016-06-291-0/+4
| | | | | | | | | | | | | | | | lbs_mac_event_disconnected may free priv->currenttxskb while lbs_hard_start_xmit accesses to it. The patch adds a spinlock for mutual exclusion. Tested on OLPC XO-1 (usb8388) and XO-1.5 (sd8686) with v4.7-rc3. Confirmed that lbs_mac_event_disconnected is being called on the station when hostapd on access point is given SIGHUP. Signed-off-by: Pavel <andrianov@ispras.ru> Tested-by: James Cameron <quozl@laptop.org> Acked-by: Vaishali Thakkar <vaishali.thakkar@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wlcore: sdio: Fix crash on wlcore_probe_of when failing to parse/map irqBruno Herrera2016-06-291-1/+0
| | | | | | | pdev_data pointer is being freed with kfree but the pointer is not dynamic allocated. Signed-off-by: Bruno Herrera <bruherrera@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: tuse %*ph to dump buffersAndy Shevchenko2016-06-293-21/+6
| | | | | | | | | Use %*ph specifier to dump small buffers in hex format instead of doing this byte-by-byte. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Add additional documentation for RX DMA registersJes Sorensen2016-06-291-3/+7
| | | | | | | This also renames REG_USB_AGG_{TO,TH} to REG_USB_AGG_{TIMEOUT,THRESH} Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Add bit definitions for REG_USB_SPECIAL_OPTIONJes Sorensen2016-06-291-0/+4
| | | | | | | | Documentation for enabling USB aggregation and whether to select interrupt or bulk delivery of interrupt events. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* libertas_tf: Remove create_workqueueBhaktipriya Shridhar2016-06-291-1/+1
| | | | | | | | | | | | | | | alloc_workqueue replaces deprecated create_workqueue(). A dedicated workqueue has been used since the workitem (viz &priv->cmd_work per priv, which maps to lbtf_cmd_work) is involved in actual command processing and may be used on a memory reclaim path. The workitems require forward progress under memory pressure and hence, WQ_MEM_RECLAIM has been set. Since there are only a fixed number of work items, explicit concurrency limit is unnecessary here. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* brcmfmac: slightly simplify building interface combinationsRafał Miłecki2016-06-291-21/+16
| | | | | | | | | | | | | | | | | This change reorders some operations in brcmf_setup_ifmodes in hope to make it simpler: 1) It allocates arrays right before filling them. This way it's easier to follow requested array length as it's immediately followed by code filling it. It's easier to check e.g. why we need 4 entries for P2P. Other than that it deduplicates some checks (e.g. for P2P). 2) It reorders code to first prepare limits and then define a new combo. Previously this was mixed (e.g. we were setting num of channels before preparing limits). 3) It modifies mbss code to use i variable just like other combos do. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* net: ethernet: ti: cpdma: switch to use genallocGrygorii Strashko2016-06-291-72/+59
| | | | | | | | | | | | | | | TI CPDMA currently uses a bitmap for tracking descriptors alloactions allocations, but The genalloc already handles the same and can be used as with special memory (SRAM) as with DMA cherent memory chank (dma_alloc_coherent()). Hence, switch to using genalloc and add desc_num property for each channel for limitation of max number of allowed descriptors for each CPDMA channel. This patch do not affect on net throuput. Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Tested-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Maxim/driver: Add driver for maxim ds26522Zhao Qiang2016-06-294-0/+401
| | | | | Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: dwc_eth_qos: use phy_ethtool_{get|set}_link_ksettingsPhilippe Reynes2016-06-281-24/+2
| | | | | | | | There are two generics functions phy_ethtool_{get|set}_link_ksettings, so we can use them instead of defining the same code in the driver. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: dwc_eth_qos: use phydev from struct net_devicePhilippe Reynes2016-06-281-24/+23
| | | | | | | | | | The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: sxgbe: use phy_ethtool_{get|set}_link_ksettingsPhilippe Reynes2016-06-281-19/+2
| | | | | | | | There are two generics functions phy_ethtool_{get|set}_link_ksettings, so we can use them instead of defining the same code in the driver. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: sxgbe: use phydev from struct net_devicePhilippe Reynes2016-06-283-29/+22
| | | | | | | | | | The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: r6040: use phy_ethtool_{get|set}_link_ksettingsPhilippe Reynes2016-06-281-12/+2
| | | | | | | | There are two generics functions phy_ethtool_{get|set}_link_ksettings, so we can use them instead of defining the same code in the driver. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: r6040: use phydev from struct net_devicePhilippe Reynes2016-06-281-15/+7
| | | | | | | | | | The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: hix5hd2: use phy_ethtool_{get|set}_link_ksettingsPhilippe Reynes2016-06-281-20/+2
| | | | | | | | There are two generics functions phy_ethtool_{get|set}_link_ksettings, so we can use them instead of defining the same code in the driver. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: hix5hd2: use phydev from struct net_devicePhilippe Reynes2016-06-281-17/+13
| | | | | | | | | | The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phy in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'cpsw-runtime-pm'David S. Miller2016-06-286-77/+182
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Grygorii Strashko says: ==================== drivers: net: cpsw: improve runtime pm This series intended to improve runtime PM and allow CPSW to be RPM suspended when all ethX netdevices are down. To achieve above goal it is required to relax runtime PM constraints for Davinci MDIO which blocks CPSW runtime PM now, because Davinci MDIO is always powered on during probe and powered off only when it's going to be removed. - Patches 6-11 implement PM runtime autosuspend for Davinci MDIO, but keep it disabled by default, because Davinci MDIO is integrated in big set of TI devices and not all of them verified to work correctly with RPM autosuspend enabled: expected to work on SoCs where MDIO is defined as part of CPSW in DT (cpsw.c DRA7/am57x, am437x, am335x) The CPSW need to be fixed before RPM suspended can be allowed: - Patches 1-5 ensure that CPSW will not cause L3 errors while it is in RPM suspended state. Davinci MDIO RPM autosuspend can be enabled through sysfs: echo 100 > /sys/devices/../48484000.ethernet/48485000.mdio/power/autosuspend_delay_ms Patches 12 - 15: introduce new compatible string "ti,cpsw-mdio" which is used then to enable RPM for am335x/am437x/dra7 SoCs. Tested on am335x, am437x, am572x and k2g (on k2g with RPM disabled for Davinci MDIO) These changes should not affect on errata i877 implementation on DRA7. Power measurement on am335x GP EVM: Without this series: 547.60 mW total SoC power With this series + "ifconfig eth0 down": 477.32 mW Total Soc Power Changes in v2: - CPSW ethtool interface updated to use .begin()/.complete() callbacks - kbuild failure fixed - davinci_mdio DT updated with proper description of allowed compatible strings combinations Link on v1: https://lkml.org/lkml/2016/6/15/362 ==================== Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ARM: dts: am335x/am437x/dra7: use new "ti, cpsw-mdio" compat stringGrygorii Strashko2016-06-283-3/+3
| | | | | | | | | | | | | | | | | | Add "ti,cpsw-mdio" for am335x/am437x/dra7 SoCs where MDIO is implemented as part of TI CPSW and, this way, enable PM runtime auto suspend for Davinci MDIO driver on these paltforms. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: davinci_mdio: enable pm runtime auto for ti cpsw-mdioGrygorii Strashko2016-06-281-11/+34
| | | | | | | | | | | | | | | | Use "ti,cpsw-mdio" to enable PM runtime auto-suspend on supported platforms, where MDIO is implemented as part of TI CPSW. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: davinci_mdio: introduce "ti,cpsw-mdio" compat stringGrygorii Strashko2016-06-281-0/+1
| | | | | | | | | | | | | | | | | | | | Introduce "ti,cpsw-mdio" compatible string for Davinci MDIO, because it's required to distinguish the case when MDIO is part of TI CPSW to enable features supported by TI CPSW (for example, enable PM management). Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: davinci_mdio: document missed "ti, am4372-mdio" compat stringGrygorii Strashko2016-06-281-1/+3
| | | | | | | | | | | | | | | | Document missed "ti,am4372-mdio" compat string used for TI am437x SoC (am4372.dtsi). Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: davinci_mdio: implement pm runtime auto modeGrygorii Strashko2016-06-281-9/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Davinci MDIO is always used as slave device which services read/write requests from MDIO/PHY core. It doesn't use IRQ also. As result, It's possible to relax PM runtime constraints for Davinci MDIO and enable it on demand, instead of powering it during probe and powering off during removal. Hence, implement PM runtime autosuspend for Davinci MDIO, but keep it disabled by default, because Davinci MDIO is integrated in big set of TI devices and not all of them expected to work corectly with RPM autosuspend enabled: - expected to work on SoCs where MDIO is part of TI CPSW (cpsw.c DRA7/am57x, am437x, am335x, dm814x) - not verified on Keystone 2 and other SoCs where MDIO is used with TI EMAC IP (davinci_emac.c: dm6467-emac, am3517-emac, dm816-emac). Davinci MDIO RPM autosuspend can be enabled through sysfs: echo 100 > /sys/devices/../48484000.ethernet/48485000.mdio/power/autosuspend_delay_ms Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: davinci_mdio: add pm runtime callbacksGrygorii Strashko2016-06-281-4/+27
| | | | | | | | | | | | | | | | | | | | | | Add PM runtime .runtime_suspend()/.runtime_resume() callbacks and perform Davinci MDIO enabling/disabling from these callbacks. This allows to reuse pm_runtime_force_suspend/resume() APIs during System suspend and required for further implementation of PM runtime autosuspend. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: davinci_mdio: split reset function on init_clk and enableGrygorii Strashko2016-06-281-7/+14
| | | | | | | | | | | | | | | | | | | | The Davinci MDIO MDIO_CONTROL.CLKDIV can be calculated only once during probe, hence split __davinci_mdio_reset() on davinci_mdio_init_clk() and davinci_mdio_enable(). Initialize and save CLKDIV in .probe(). Then just use saved value. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: davinci_mdio: drop suspended and lock fields from mdio_dataGrygorii Strashko2016-06-281-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not expected Davinci MDIO to be accessible after its suspend callbacks have been called: - all consumers of Davinci MDIO will stop/disconnect phys at Device suspend stage; - all phys are expected to be suspned already by PHY/MDIO core; - MDIO locking is done by MDIO Bus code. Hence, it's safe to drop "suspended" and "lock" fields from mdio_data. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: davinci_mdio: remove pm runtime calls from suspend callbacksGrygorii Strashko2016-06-281-3/+0
| | | | | | | | | | | | | | | | | | PM runtime is disabled when Davinci MDIO .suspend_late() and .resume_early() callbacks are called. As result, any PM runtime calls here will be just a nop and can be removed. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: davinci_mdio: do pm runtime initialization later in probeGrygorii Strashko2016-06-281-9/+6
| | | | | | | | | | | | | | | | Do PM runtime initialization later in probe - this allows to simplify error handling a bit. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: cpsw: ndev: fix accessing to suspended deviceGrygorii Strashko2016-06-281-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The CPSW might be suspended by RPM if all ethX interfaces are down, but it still could be accesible through net_device_ops interfce. In this case net_device_ops operations requiring registers access will cause L3 errors and CPSW crash. Hence, fix it by adding RPM get/put calls in net_device_ops callbacks which need to access CPSW registers: .ndo_set_mac_address(), .ndo_vlan_rx_add_vid(), .ndo_vlan_rx_kill_vid(). Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: cpsw: ethtool: fix accessing to suspended deviceGrygorii Strashko2016-06-281-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CPSW might be suspended by RPM if all ethX interfaces are down, but it still could be accesible through ethtool interfce. In this case ethtool operations, requiring registers access, will cause L3 errors and CPSW crash. ethtool callbcaks which need to access CPSW registers now: .set_coalesce(), .get_ethtool_stats(), .set_pauseparam(), .get_regs() Hence, fix it by adding .begin()/.complete() ethtool callbacks, which will be called before/after each ethtool operation runs, and do CPSW RPM handling in these callbacks. That way CPSW will be active while handling ethtool requests. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: cpsw: remove pm runtime calls from suspend callbacksGrygorii Strashko2016-06-281-4/+0
| | | | | | | | | | | | | | | | | | | | | | PM runtime is properly handled in cpsw_ndo_open/stop(), as result it isn't required to duplicate these calls in .suspend()/.resume() callbacks. Moreover, it might cause unnecessary RPM resume of CPSW during System suspend in the case it's already suspended because all ethX interfaces are down already, before System suspend started. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: cpsw: check return code from pm runtime callsGrygorii Strashko2016-06-281-2/+10
| | | | | | | | | | | | | | Add missed check of return code from PM runtime get() calls. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: cpsw: fix suspend when all ethX devices are downGrygorii Strashko2016-06-281-2/+1
|/ | | | | | | | | | | | | | | The cpsw_suspend() could trigger L3 error and CPSW will stop functioning if System enters suspend when all ethX net-devices are down - in this case CPSW could be already suspended by PM runtime, but cpsw_suspend() will try to call soft_reset_slave() unconditionally and access CPSW registers. Hence, fix it by moving soft_reset_slave() from cpsw_suspend() to cpsw_slave_stop(). This way slave ports will be reset when CPSW is active and will be in proper state during Suspend. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'stmmac-next'David S. Miller2016-06-2813-194/+474
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Giuseppe Cavallaro says: ==================== stmmac: rework and enhance the PCS support The 3.xx and 4.xx synopsys gmacs have a very similar PCS embedded module and they share almost the same registers; for example: AN_Control, AN_Status, AN_Advertisement, AN_Link_Partner_Ability, AN_Expansion, TBI_Extended_Status. Just the RGMII/SMII Control/Status register differs. So these patches aim to reorganize and enhance the PCS support; to do that, some small inline functions have been provided and also some rework to the PCS ISR part has been done. In the end, the SGMII for MAC2MAC connection has been introduced. All patches have been built on top of net-next git and, as for the previous version, not fully tested. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: stmmac: add port selection programmingGiuseppe CAVALLARO2016-06-288-2/+53
| | | | | | | | | | | | | | | | | | | | | | In case of SGMII more, for example when a MAC2MAC connection is needed, the port selection bits (inside the MAC configuration registers) have to be programmed according to the link selected. So the patch adds a new DT parameter to pass the port selection and to programmed related PCS and CORE to use it. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: stmmac: rework core ISR to better manage PCS and PMTGiuseppe CAVALLARO2016-06-288-35/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, all gmac cores disable the PCS block and always enable the PMT. Note that this is done in a different way by 3.x and 4.x cores. With this rework, PCS and PMT interrupt masks can be driven by parameters now moved inside the mac_device_info structure and the settings follow what the HW capability register reports. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * drivers: net: stmmac: reworking the PCS code.Giuseppe CAVALLARO2016-06-289-165/+350
|/ | | | | | | | | | | | | | | | | | | | The 3.xx and 4.xx synopsys gmacs have a very similar PCS embedded module and they share almost the same registers: for example: AN_Control, AN_Status, AN_Advertisement, AN_Link_Partner_Ability, AN_Expansion, TBI_Extended_Status. Just the RGMII/SMII Control/Status register differs. So This patch aims to reorganize and enhance the PCS support. It removes the existent support from the dwmac1000/dwmac4_core.c moving basic PCS functions inside a new file called: stmmac_pcs.h. The patch also reviews the available APIs to be better shared among different hardware and easily enhanced to support new features. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* of_mdio: select fixed phy support unconditionallyArnd Bergmann2016-06-283-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Calling the fixed-phy functions when CONFIG_FIXED_PHY=m as a previous change tried cannot work if the caller is in built-in code: drivers/of/built-in.o: In function `of_phy_register_fixed_link': of_reserved_mem.c:(.text+0x85e0): undefined reference to `fixed_phy_register' Making of_mdio depend on 'FIXED_PHY || !FIXED_PHY' would solve this dependency by enforcing that OF_MDIO itself becomes a loadable module when FIXED_PHY=y, but that creates a different dependency as it breaks any built-in ethernet driver that uses of_mdio. Making FIXED_PHY a bool option also cannot work, since it depends on PHYLIB, which again is tristate. This version now uses 'select FIXED_PHY' to ensure that the fixed-phy portion of of_mdio is not optional. The main downside of this is a small increase in code size for cases that do not need fixed phy support, but it should avoid all of the link-time problems. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: d1bd330a229f ("of_mdio: Enable fixed PHY support if driver is a module") Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* caif: Remove unneeded header fileAmitoj Kaur Chawla2016-06-281-1/+0
| | | | | | | | | | | | | | | | | | Drop redundant include of moduleparam.h The Coccinelle semantic patch used to make this change is as follows: @ includesmodule @ @@ #include <linux/module.h> @ depends on includesmodule @ @@ - #include <linux/moduleparam.h> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: diag: Add support to filter on device indexDavid Ahern2016-06-282-0/+26
| | | | | | | | | Add support to inet_diag facility to filter sockets based on device index. If an interface index is in the filter only sockets bound to that index (sk_bound_dev_if) are returned. Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: dnet: use phy_ethtool_{get|set}_link_ksettingsPhilippe Reynes2016-06-281-22/+2
| | | | | | | | There are two generics functions phy_ethtool_{get|set}_link_ksettings, so we can use them instead of defining the same code in the driver. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: dnet: use phydev from struct net_devicePhilippe Reynes2016-06-282-17/+12
| | | | | | | | | | The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'sfp-infra'David S. Miller2016-06-275-126/+222
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Russell King says: ==================== Initial SFP support patches Please review and merge this initial patch set, which is part of a larger set previously posted adding SFP support to phy and mvneta. This initial set are focused on cleaning up and reorganising the fixed-phy code to allow the core software-phy code to be re-used. These are based on net-next. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * phy: improve safety of fixed-phy MII register readingRussell King2016-06-271-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no prevention of a concurrent call to both fixed_mdio_read() and fixed_phy_update_state(), which can result in the state being modified while it's being inspected. Fix this by using a seqcount to detect modifications, and memcpy()ing the state. We remain slightly naughty here, calling link_update() and updating the link status within the read-side loop - which would need rework of the design to change. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
| * phy: generate swphy registers on the flyRussell King2016-06-273-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate software phy registers as and when requested, rather than duplicating the state in fixed_phy. This allows us to eliminate the duplicate storage of of the same data, which is only different in format. As fixed_phy_update_regs() no longer updates register state, rename it to fixed_phy_update(). Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
| * phy: separate swphy state validation from register generationRussell King2016-06-273-16/+35
| | | | | | | | | | | | | | | | | | | | Separate out the generation of MII registers from the state validation. This allows us to simplify the error handing in fixed_phy() by allowing earlier error detection. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
| * phy: convert swphy register generation to tabular formRussell King2016-06-271-65/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the swphy register generation to tabular form which allows us to eliminate multiple switch() statements. This results in a smaller object code size, more efficient, and easier to add support for faster speeds. Before: Idx Name Size VMA LMA File off Algn 0 .text 00000164 00000000 00000000 00000034 2**2 text data bss dec hex filename 388 0 0 388 184 swphy.o After: Idx Name Size VMA LMA File off Algn 0 .text 000000fc 00000000 00000000 00000034 2**2 5 .rodata 00000028 00000000 00000000 00000138 2**2 text data bss dec hex filename 324 0 0 324 144 swphy.o Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
| * phy: move fixed_phy MII register generation to a libraryRussell King2016-06-275-93/+143
|/ | | | | | | | | Move the fixed_phy MII register generation to a library to allow other software phy implementations to use this code. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge tag 'linux-can-next-for-4.8-20160623' of ↵David S. Miller2016-06-275-162/+328
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2016-06-17 this is a pull request of 4 patches for net-next/master. Arnd Bergmann's patch fixes a regresseion in af_can introduced in linux-can-next-for-4.8-20160617. There are two patches by Ramesh Shanmugasundaram, which add CAN-2.0 support to the rcar_canfd driver. And a patch by Ed Spiridonov that adds better error diagnoses messages to the Ed Spiridonov driver. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>