Re: [PATCH 2/2] net: phy: ensure autoneg is configured when resuming a phydev

2018-12-03 Thread Heiner Kallweit
On 03.12.2018 11:43, Anssi Hannula wrote: > On 1.12.2018 0:16, Heiner Kallweit wrote: >> On 30.11.2018 19:45, Anssi Hannula wrote: >>> When a PHY_HALTED phydev is resumed by phy_start(), it is set to >>> PHY_RESUMING to wait for the link to come up. >>>

[PATCH net] net: phy: don't allow __set_phy_supported to add unsupported modes

2018-12-02 Thread Heiner Kallweit
is being fixed now. Fixes: f3a6bd393c2c ("phylib: Add phy_set_max_speed helper") Signed-off-by: Heiner Kallweit --- This will cause a merge conflict once net is merged into net-next. And the fix will need minor tweaking when being backported to older kernel versions. --- drivers/net/phy/ph

[PATCH net-next] net: phy: don't allow __set_phy_supported to add unsupported modes

2018-12-02 Thread Heiner Kallweit
Currently __set_phy_supported allows to add modes w/o checking whether the PHY supports them. This is wrong, it should never add modes but only remove modes we don't want to support. Signed-off-by: Heiner Kallweit --- I'll submit the same functionality for net, but it needs a different

Re: [PATCH 2/2] net: phy: ensure autoneg is configured when resuming a phydev

2018-11-30 Thread Heiner Kallweit
On 30.11.2018 19:45, Anssi Hannula wrote: > When a PHY_HALTED phydev is resumed by phy_start(), it is set to > PHY_RESUMING to wait for the link to come up. > > However, if the phydev was put to PHY_HALTED (by e.g. phy_stop()) before > autonegotiation was ever started by phy_state_machine(),

[PATCH net-next] net: phy: improve generic EEE ethtool functions

2018-11-27 Thread Heiner Kallweit
both functions shouldn't break any existing user. Once the changes have been applied, at least some users can be simplified. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/phy.c b/drive

[PATCH net-next] r8169: remove unneeded mmiowb barriers

2018-11-26 Thread Heiner Kallweit
writex() has implicit barriers, that's what makes it different from writex_relaxed(). Therefore these calls to mmiowb() can be removed. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net

Re: [PATCH net-next] net: phy: fix two issues with linkmode bitmaps

2018-11-25 Thread Heiner Kallweit
On 25.11.2018 17:45, Andrew Lunn wrote: > On Sun, Nov 25, 2018 at 03:23:42PM +0100, Heiner Kallweit wrote: >> I wondered why ethtool suddenly reports that link partner doesn't >> support aneg and GBit modes. It turned out that this is caused by two >> bugs in conversio

[PATCH net-next] net: phy: fix two issues with linkmode bitmaps

2018-11-25 Thread Heiner Kallweit
any longer. 2. In mii_lpa_to_linkmode_lpa_t the aneg bit was overwritten by the call to mii_adv_to_linkmode_adv_t. Fixes: c0ec3c273677 ("net: phy: Convert u32 phydev->lp_advertising to linkmode") Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy_device.c | 5 - include/linux/mi

[PATCH net-next v2 2/2] r8169: make use of xmit_more and __netdev_sent_queue

2018-11-25 Thread Heiner Kallweit
Make use of xmit_more and add the functionality introduced with 3e59020abf0f ("net: bql: add __netdev_tx_sent_queue()"). I used the mlx4 driver as template. Signed-off-by: Heiner Kallweit --- v2: - fix minor style issue --- drivers/net/ethernet/realtek/r8169.c | 19 +

[PATCH net-next v2 1/2] net: core: add __netdev_sent_queue as variant of __netdev_tx_sent_queue

2018-11-25 Thread Heiner Kallweit
Similar to netdev_sent_queue add helper __netdev_sent_queue as variant of __netdev_tx_sent_queue. Signed-off-by: Heiner Kallweit --- v2: - no changes --- include/linux/netdevice.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h

[PATCH net-next v2 0/2] r8169: make use of xmit_more and __netdev_sent_queue

2018-11-25 Thread Heiner Kallweit
This series adds helper __netdev_sent_queue to the core and makes use of it in the r8169 driver. Heiner Kallweit (2): net: core: add __netdev_sent_queue as variant of __netdev_tx_sent_queue r8169: make use of xmit_more and __netdev_sent_queue v2: - fix minor style issue drivers/net

[PATCH net-next 1/2] net: core: add __netdev_sent_queue as variant of __netdev_tx_sent_queue

2018-11-24 Thread Heiner Kallweit
Similar to netdev_sent_queue add helper __netdev_sent_queue as variant of __netdev_tx_sent_queue. Signed-off-by: Heiner Kallweit --- include/linux/netdevice.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1dcc0628b

[PATCH net-next 2/2] r8169: make use of xmit_more and __netdev_sent_queue

2018-11-24 Thread Heiner Kallweit
Make use of xmit_more and add the functionality introduced with 3e59020abf0f ("net: bql: add __netdev_tx_sent_queue()"). I used the mlx4 driver as template. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 19 +-- 1 file changed, 9 inserti

[PATCH net-next 0/2] r8169: make use of xmit_more and __netdev_sent_queue

2018-11-24 Thread Heiner Kallweit
This series adds helper __netdev_sent_queue to the core and makes use of it in the r8169 driver. Heiner Kallweit (2): net: core: add __netdev_sent_queue as variant of __netdev_tx_sent_queue r8169: make use of xmit_more and __netdev_sent_queue drivers/net/ethernet/realtek/r8169.c | 19

[PATCH net] net: phy: add workaround for issue where PHY driver doesn't bind to the device

2018-11-23 Thread Heiner Kallweit
. The issue itself may have been existing much longer and it may affect users of other network chips as well. Users typically will recognize this issue only if their PHY stops working when being used with the genphy driver. Fixes: f1e911d5d0df ("r8169: add basic phylib support") Signed-off-

[PATCH net-next 3/5] r8169: simplify detecting chip versions with same XID

2018-11-22 Thread Heiner Kallweit
For the GMII chip versions we set the version number which was set already. This can be simplified. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169

[PATCH net-next 4/5] r8169: use napi_consume_skb where possible

2018-11-22 Thread Heiner Kallweit
Use napi_consume_skb() where possible to profit from bulk free infrastructure. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek

[PATCH net-next 5/5] r8169: replace macro TX_FRAGS_READY_FOR with a function

2018-11-22 Thread Heiner Kallweit
Replace macro TX_FRAGS_READY_FOR with function rtl_tx_slots_avail to make code cleaner and type-safe. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet

[PATCH net-next 2/5] r8169: remove default chip versions

2018-11-22 Thread Heiner Kallweit
Even the chip versions within a family have so many differences that using a default chip version doesn't really make sense. Instead of leaving a best case flaky network connectivity, bail out and report the unknown chip version. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek

[PATCH net-next 1/5] r8169: remove ancient GCC bug workaround in a second place

2018-11-22 Thread Heiner Kallweit
Remove ancient GCC bug workaround in a second place and factor out rtl_8169_get_txd_opts1. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c

[PATCH net-next 0/5] r8169: some functional improvements

2018-11-22 Thread Heiner Kallweit
This series includes a few functional improvements. Heiner Kallweit (5): r8169: Remove ancient GCC bug workaround in a second place r8169: remove default chip versions r8169: simplify detecting chip versions with same XID r8169: use napi_consume_skb where possible r8169: replace macro

[PATCH net] MAINTAINERS: add myself as co-maintainer for r8169

2018-11-20 Thread Heiner Kallweit
Meanwhile I know the driver quite well and I refactored bigger parts of it. As a result people contact me already with r8169 questions. Therefore I'd volunteer to become co-maintainer of the driver also officially. Signed-off-by: Heiner Kallweit --- MAINTAINERS | 1 + 1 file changed, 1

[PATCH net-next 05/11] r8169: use PCI_VDEVICE macro

2018-11-19 Thread Heiner Kallweit
Using macro PCI_VDEVICE helps to simplify the PCI ID table. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet

[PATCH net-next 03/11] r8169: remove unused interrupt sources

2018-11-19 Thread Heiner Kallweit
Setting PCSTimeout interrupt source was copied from the vendor driver which uses the chip programmable timer interrupt. The mainline driver doesn't use this timer interrupt. SYSErr indicates a PCI error and isn't defined on the PCIe models. Signed-off-by: Heiner Kallweit --- drivers/net

[PATCH net-next 06/11] r8169: remove print_mac_version

2018-11-19 Thread Heiner Kallweit
The syslog message printed on driver load allows to easily identify the mac version number (based on chip name and XID). So we don't need this extra debug message which is wrong anyway because e.g. RTL_GIGA_MAC_VER_01 has value 0. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek

[PATCH net-next 04/11] r8169: replace event_slow with irq_mask

2018-11-19 Thread Heiner Kallweit
Recently the "slow event" handler was removed, therefore the member name isn't appropriate any longer. In addition store the full mask, including the RTL_EVENT_NAPI interrupt source bits. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 22 +++-

[PATCH net-next 11/11] r8169: improve chip version identification

2018-11-19 Thread Heiner Kallweit
Only the upper 12 bits are used for chip identification, this helps to reduce the size of array mac_info. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 119 +-- 1 file changed, 59 insertions(+), 60 deletions(-) diff --git a/drivers/net

[PATCH net-next 07/11] r8169: remove "not PCI Express" message

2018-11-19 Thread Heiner Kallweit
The ones who want to know can easily identify whether chip is PCI or PCIe based on the chip name. I doubt there's any benefit in this message, so remove it. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net

[PATCH net-next 09/11] r8169: remove workaround for ancient gcc bug

2018-11-19 Thread Heiner Kallweit
The kernel can't be built any longer with this ancient GCC version. Eventually it becomes clear what this statement actually does. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net

[PATCH net-next 10/11] r8169: simplify ocp functions

2018-11-19 Thread Heiner Kallweit
rtl8168_oob_notify is used in rtl8168dp_driver_start and rtl8168dp_driver_stop only, so we can rename it to r8168dp_oob_notify. The same applies to condition rtl_ocp_read_cond which can be renamed to rtl_dp_ocp_read_cond. This allows to simplify the code. Signed-off-by: Heiner Kallweit

[PATCH net-next 08/11] r8169: remove manual padding in struct ring_info

2018-11-19 Thread Heiner Kallweit
The compiler takes care of alignment and padding, I see no need to bother him with manual hints. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169

[PATCH net-next 02/11] r8169: use dev_get_drvdata where possible

2018-11-19 Thread Heiner Kallweit
Using dev_get_drvdata directly is simpler here. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index

[PATCH net-next 01/11] r8169: merge rtl_irq_enable and rtl_irq_enable_all

2018-11-19 Thread Heiner Kallweit
After the recent changes to the interrupt handler rtl_irq_enable and rtl_irq_enable_all can be merged. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c

[PATCH net-next 00/11] r8169: series with further smaller improvements

2018-11-19 Thread Heiner Kallweit
Again nothing exciting, just smaller improvements. Heiner Kallweit (11): r8169: merge rtl_irq_enable and rtl_irq_enable_all r8169: use dev_get_drvdata where possible r8169: remove unused interrupt sources r8169: replace event_slow with irq_mask r8169: use PCI_VDEVICE macro r8169

[PATCH net-next] MAINTAINERS: Add myself as third phylib maintainer

2018-11-18 Thread Heiner Kallweit
Add myself as third phylib maintainer. Signed-off-by: Heiner Kallweit --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7ff8865a9..2988ecbf6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5540,6 +5540,7 @@ F:net/bridge/ ETHERNET PHY

[PATCH net-next] net: phy: check for implementation of both callbacks in phy_drv_supports_irq

2018-11-12 Thread Heiner Kallweit
Now that the icplus driver has been fixed all PHY drivers supporting interrupts have both callbacks (config_intr and ack_interrupt) implemented - as it should be. Therefore phy_drv_supports_irq() can be changed now to check for both callbacks being implemented. Signed-off-by: Heiner Kallweit

[PATCH net-next] net: phy: switch to lockdep_assert_held in phylib

2018-11-11 Thread Heiner Kallweit
These checks are relevant during development / testing only, therefore switch to lockdep_assert_held and friends. Signed-off-by: Heiner Kallweit --- drivers/net/phy/mdio_bus.c | 4 ++-- drivers/net/phy/phy.c| 2 +- drivers/net/phy/phy_device.c | 2 +- 3 files changed, 4 insertions

[PATCH net-next] net: phy: icplus: add config_intr callback

2018-11-11 Thread Heiner Kallweit
interrupt mode if one of the two irq-related callbacks isn't defined. I don't own hardware with this PHY, and the change is based on the datasheet for IP101A LF (which is supposed to be register-compatible with IP101A/G). Change is compile-tested only. Signed-off-by: Heiner Kallweit --- drivers/net

[PATCH net-next v3] PCI: add USR vendor id and use it in r8169 and w6692 driver

2018-11-11 Thread Heiner Kallweit
The PCI vendor id of U.S. Robotics isn't defined in pci_ids.h so far, only ISDN driver w6692 has a private definition. Move the definition to pci_ids.h and use it in the r8169 driver too. Signed-off-by: Heiner Kallweit --- v2: - The original patch caused a build failure in w6692 driver because

[PATCH net-next v2] PCI: add USR vendor id and use it in r8169 and w6692 driver

2018-11-11 Thread Heiner Kallweit
The PCI vendor id of U.S. Robotics isn't defined in pci_ids.h so far, only ISDN driver w6692 has a private definition. Move the definition to pci_ids.h and use it also in the r8169 driver. Signed-off-by: Heiner Kallweit --- v2: - The original patch caused a build failure in w6692 driver because

[PATCH net-next 2/2] r8169: use proper constant for PCI vendor USR instead of numerical id

2018-11-10 Thread Heiner Kallweit
Use proper constant for PCI vendor USR instead of numerical id. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index

[PATCH net-next 1/2] PCI: add USR vendor id

2018-11-10 Thread Heiner Kallweit
Add U.S. Robotics (USR) PCI vendor id. Signed-off-by: Heiner Kallweit --- include/linux/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 69f0abe1b..144de2e89 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h

[PATCH net-next 0/2] r8169: add USR PCI vendor id

2018-11-10 Thread Heiner Kallweit
Add constant for U.S. Robotics (USR) PCI id and use it in the r8169 driver. Alternatively this change could go thorugh the PCI tree, up to Bjorn/David. Heiner Kallweit (2): PCI: add USR vendor id r8169: use proper constant for PCI vendor USR instead of id drivers/net/ethernet/realtek/r8169

[PATCH net-next] net: phy: remove states PHY_STARTING and PHY_PENDING

2018-11-10 Thread Heiner Kallweit
Both states aren't used. Most likely they result from an idea that never materialized. So remove them. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 7 --- include/linux/phy.h | 22 ++ 2 files changed, 2 insertions(+), 27 deletions(-) diff --git

[PATCH net-next 2/2] net: phy: realtek: use new PHYID matching macros

2018-11-09 Thread Heiner Kallweit
Use new macros for PHYID matching to avoid boilerplate code. Signed-off-by: Heiner Kallweit --- drivers/net/phy/realtek.c | 29 ++--- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index 0f8e5b1c9

[PATCH net-next 1/2] net: phy: add macros for PHYID matching

2018-11-09 Thread Heiner Kallweit
Add macros for PHYID matching to be used in PHY driver configs. By using these macros some boilerplate code can be avoided. Signed-off-by: Heiner Kallweit --- include/linux/phy.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/phy.h b/include/linux/phy.h index 17d1f6472

[PATCH net-next 0/2] net: phy: add macros for PHYID matching in PHY driver config

2018-11-09 Thread Heiner Kallweit
Add macros for PHYID matching to be used in PHY driver configs. By using these macros some boilerplate code can be avoided. Use them initially in the Realtek PHY drivers. Heiner Kallweit (2): net: phy: add macros for PHYID matching net: phy: realtek: use new PHYID matching macros drivers

[PATCH net-next 3/3] net: phy: improve and inline phy_change

2018-11-09 Thread Heiner Kallweit
including the call to phy_disable_interrupts() can be removed. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 47 ++- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index ce1e8130a

[PATCH net-next 2/3] net: phy: simplify phy_mac_interrupt and related functions

2018-11-09 Thread Heiner Kallweit
() from phy_mac_interrupt() directly and remove some now unneeded code. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c| 14 +- drivers/net/phy/phy_device.c | 1 - include/linux/phy.h | 3 --- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers

[PATCH net-next 1/3] net: phy: don't set state PHY_CHANGELINK in phy_change

2018-11-09 Thread Heiner Kallweit
by some event. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 8 include/linux/phy.h | 7 ++- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 8dac890f3..da41420df 100644 --- a/drivers/net/phy/phy.c +++ b

[PATCH net-next 0/3] net: phy: further phylib simplifications after recent changes to the state machine

2018-11-09 Thread Heiner Kallweit
After the recent changes to the state machine phylib can be further simplified (w/o having to make any assumptions). Heiner Kallweit (3): net: phy: don't set state PHY_CHANGELINK in phy_change net: phy: simplify phy_mac_interrupt and related functions net: phy: improve and inline phy_change

[PATCH v2 net-next] net: phy: improve struct phy_device member interrupts handling

2018-11-09 Thread Heiner Kallweit
. Signed-off-by: Heiner Kallweit --- v2: - use false/true instead of 0/1 for the constants Actually this member isn't needed at all and could be replaced with a parameter in phy_driver->config_intr. But this would mean an API change, maybe I come up with a proposal later. --- drivers/net/

Re: [PATCH net-next 1/2] net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt

2018-11-08 Thread Heiner Kallweit
On 08.11.2018 23:33, Florian Fainelli wrote: > On 11/8/18 1:55 PM, Heiner Kallweit wrote: >> Flag PHY_HAS_INTERRUPT is used only here for this small check. I think >> using interrupts isn't possible if a driver defines neither >> config_intr nor ack_interrupts callback. So we

Re: [PATCH net-next] net: phy: improve struct phy_device member interrupts handling

2018-11-08 Thread Heiner Kallweit
On 08.11.2018 23:24, Andrew Lunn wrote: > On Thu, Nov 08, 2018 at 10:36:33PM +0100, Heiner Kallweit wrote: >> As a heritage from the very early days of phylib member interrupts is >> defined as u32 even though it's just a flag whether interrupts are >> enabled. So we can ch

[PATCH net-next 2/2] net: phy: realtek: remove flag PHY_HAS_INTERRUPT from driver configs

2018-11-08 Thread Heiner Kallweit
Now that flag PHY_HAS_INTERRUPT has been replaced with a check for callbacks config_intr and ack_interrupt, we can remove setting this flag from driver configs. Signed-off-by: Heiner Kallweit --- drivers/net/phy/realtek.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/net/phy

[PATCH net-next 1/2] net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt

2018-11-08 Thread Heiner Kallweit
Flag PHY_HAS_INTERRUPT is used only here for this small check. I think using interrupts isn't possible if a driver defines neither config_intr nor ack_interrupts callback. So we can replace checking flag PHY_HAS_INTERRUPT with checking for these callbacks. Signed-off-by: Heiner Kallweit

[PATCH net-next 0/2] net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt

2018-11-08 Thread Heiner Kallweit
a lot of driver configs, let's start with the Realtek driver. Heiner Kallweit (2): net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt net: phy: realtek: remove flag PHY_HAS_INTERRUPT from driver configs drivers/net/phy/phy_device.c | 5 +++-- drivers/net/phy

[PATCH net-next] net: phy: improve struct phy_device member interrupts handling

2018-11-08 Thread Heiner Kallweit
. Signed-off-by: Heiner Kallweit --- Actually this member isn't needed at all and could be replaced with a parameter in phy_driver->config_intr. But this would mean an API change, maybe I come up with a proposal later. --- drivers/net/phy/phy.c | 2 +- include/linux/phy.h | 10 +-

Re: [PATCH net-next 1/2] net: phy: use phy_id_mask value zero for exact match

2018-11-08 Thread Heiner Kallweit
On 08.11.2018 20:44, Florian Fainelli wrote: > On 11/7/18 12:53 PM, Heiner Kallweit wrote: >> A phy_id_mask value zero means every PHYID matches, therefore >> value zero isn't used. So we can safely redefine the semantics >> of value zero to mean "exact match&q

Re: [PATCH net-next 2/2] net: phy: realtek: remove boilerplate code from driver configs

2018-11-08 Thread Heiner Kallweit
On 08.11.2018 19:37, Andrew Lunn wrote: >> { >> .phy_id = 0x8201, >> .name = "RTL8201CP Ethernet", >> -.phy_id_mask= 0x, >> .features = PHY_BASIC_FEATURES, >> .flags =

Re: [PATCH net-next 0/5] net: phy: improve and simplify phylib state machine

2018-11-07 Thread Heiner Kallweit
On 07.11.2018 21:45, Heiner Kallweit wrote: > On 07.11.2018 21:21, Andrew Lunn wrote: >> On Wed, Nov 07, 2018 at 09:05:49PM +0100, Heiner Kallweit wrote: >>> On 07.11.2018 20:48, Andrew Lunn wrote: >>>> On Wed, Nov 07, 2018 at 08:41:52PM +0100, Heiner Kallweit

[PATCH net-next 1/2] net: phy: use phy_id_mask value zero for exact match

2018-11-07 Thread Heiner Kallweit
A phy_id_mask value zero means every PHYID matches, therefore value zero isn't used. So we can safely redefine the semantics of value zero to mean "exact match". This allows to avoid some boilerplate code in PHY driver configs. Signed-off-by: Heiner Kallweit --- drivers/net/phy/ph

[PATCH net-next 2/2] net: phy: realtek: remove boilerplate code from driver configs

2018-11-07 Thread Heiner Kallweit
After a recent change phy_id_mask value 0 means "exact match". This allows to remove setting phy_id_mask values from the driver configs. Signed-off-by: Heiner Kallweit --- drivers/net/phy/realtek.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/net/phy/realtek.c

[PATCH net-next 0/2] net: phy: use phy_id_mask value zero for exact match

2018-11-07 Thread Heiner Kallweit
A phy_id_mask value zero means every PHYID matches, therefore value zero isn't used. So we can safely redefine the semantics of value zero to mean "exact match". This allows to avoid some boilerplate code in PHY driver configs. Realtek PHY driver is the first user of this change. Heine

Re: [PATCH net-next 0/5] net: phy: improve and simplify phylib state machine

2018-11-07 Thread Heiner Kallweit
On 07.11.2018 21:21, Andrew Lunn wrote: > On Wed, Nov 07, 2018 at 09:05:49PM +0100, Heiner Kallweit wrote: >> On 07.11.2018 20:48, Andrew Lunn wrote: >>> On Wed, Nov 07, 2018 at 08:41:52PM +0100, Heiner Kallweit wrote: >>>> This patch series is based on two axioms: &g

Re: [PATCH net-next 0/5] net: phy: improve and simplify phylib state machine

2018-11-07 Thread Heiner Kallweit
On 07.11.2018 20:48, Andrew Lunn wrote: > On Wed, Nov 07, 2018 at 08:41:52PM +0100, Heiner Kallweit wrote: >> This patch series is based on two axioms: >> >> - During autoneg a PHY always reports the link being down > > Hi Heiner > > I think that is a risky ass

[PATCH net-next 4/5] net: phy: remove state PHY_AN

2018-11-07 Thread Heiner Kallweit
After the recent changes in the state machine state PHY_AN isn't used any longer and can be removed. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 27 --- include/linux/phy.h | 19 +-- 2 files changed, 1 insertion(+), 45 deletions(-) diff

[PATCH net-next 2/5] net: phy: remove useless check in state machine case PHY_RESUMING

2018-11-07 Thread Heiner Kallweit
to PHY_RUNNING or PHY_NOLINK directly. In addition change the do_carrier parameter in phy_link_down() to true. If carrier was marked as up before (what should never be the case because PHY was in state PHY_HALTED before) then we should mark it as down now. Signed-off-by: Heiner Kallweit --- drivers/net

[PATCH net-next 3/5] net: phy: add phy_check_link_status

2018-11-07 Thread Heiner Kallweit
that we're using interrupts and aneg was finished already. Definition of phy_link_up and phy_link_down needs to be moved because they are called in the new function. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 70 --- 1 file changed, 40

[PATCH net-next 5/5] net: phy: use phy_check_link_status in more places in the state machine

2018-11-07 Thread Heiner Kallweit
Use phy_check_link_status in more places in the state machine. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 53 --- 1 file changed, 5 insertions(+), 48 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 226824804

[PATCH net-next 1/5] net: phy: remove useless check in state machine case PHY_NOLINK

2018-11-07 Thread Heiner Kallweit
If aneg is enabled and the PHY reports the link as up then definitely aneg finished successfully. Therefore this check is useless and can be removed. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/net/phy/phy.c b

[PATCH net-next 0/5] net: phy: improve and simplify phylib state machine

2018-11-07 Thread Heiner Kallweit
"link up" and "aneg finished" bits aren't set. One consequence is that having separate states PHY_NOLINK and PHY_AN isn't needed. By using these two axioms the state machine can be significantly simplified. Heiner Kallweit (5): net: phy: remove useless check in state mac

[PATCH net-next] net: phy: realtek: load driver for all PHYs with a Realtek OUI

2018-11-06 Thread Heiner Kallweit
bits a PHY from another vendor could have been matched Signed-off-by: Heiner Kallweit --- drivers/net/phy/realtek.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index 271e8adc3..7b1c89b38 100644 --- a/drivers

[PATCH net-next] net: phy: make phy_trigger_machine static

2018-11-06 Thread Heiner Kallweit
phy_trigger_machine() is used in phy.c only, so we can make it static. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 33 - include/linux/phy.h | 1 - 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers

[PATCH net] r8169: fix broken Wake-on-LAN from S5 (poweroff)

2018-10-25 Thread Heiner Kallweit
when powering down PHY and interface is down") Reported-by: Neil MacLeod Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r81

Re: [PATCH] r8169: Add new device ID support

2018-10-24 Thread Heiner Kallweit
On 24.10.2018 23:22, David Miller wrote: > From: Shawn Lin > Date: Wed, 24 Oct 2018 09:46:47 +0800 > >> It's found my r8169 ethernet card at hand has a device ID >> of 0x which wasn't on the list of rtl8169_pci_tbl. Add >> a new entry to make it work: >> >> [2.165785] r8169 Gigabit Ethernet

r8169: changed rx buffer alignment requirement

2018-10-21 Thread Heiner Kallweit
Hi Eric, when working on the r8169 driver I came across an old patch from you: 6f0333b8fde4 ("r8169: use 50% less ram for RX ring") As part of this patch the alignment requirement for rx buffers was silently changed from 8 to 16 bytes. Can you remember (well, after eight years) why you did this?

[PATCH net-next] r8169: add support for Byte Queue Limits

2018-10-20 Thread Heiner Kallweit
eset_queue was moved to rtl8169_tx_clear. The Tested-by refers to a system using the RTL8168evl chip version. Signed-off-by: Florian Westphal Signed-off-by: Heiner Kallweit Tested-by: Holger Hoffstätte --- drivers/net/ethernet/realtek/r8169.c | 18 +- 1 file changed, 13 insert

[PATCH net-next] r8169: handle all interrupt events in the hard irq handler

2018-10-18 Thread Heiner Kallweit
Having a separate "slow event" handler isn't needed because all interrupt events trigger asynchronous activity. And in case of SYSErr we have bigger problems than performance anyway. This patch also allows to get rid of acking interrupt events in the NAPI poll callback. Signed-off-

Re: [PATCH v2 net] r8169: fix NAPI handling under high load

2018-10-18 Thread Heiner Kallweit
On 18.10.2018 20:02, Eric Dumazet wrote: > > > On 10/18/2018 10:56 AM, Heiner Kallweit wrote: >> rtl_rx() and rtl_tx() are called only if the respective bits are set >> in the interrupt status register. Under high load NAPI may not be >> able to process al

[PATCH v2 net] r8169: fix NAPI handling under high load

2018-10-18 Thread Heiner Kallweit
. Fixes: da78dbff2e05 ("r8169: remove work from irq handler.") Signed-off-by: Heiner Kallweit --- v2: - added "Fixes" tag --- drivers/net/ethernet/realtek/r8169.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8

Re: [PATCH net] r8169: fix NAPI handling under high load

2018-10-18 Thread Heiner Kallweit
On 18.10.2018 07:58, Jonathan Woithe wrote: > On Thu, Oct 18, 2018 at 01:30:51AM +0200, Francois Romieu wrote: >> Holger Hoffstätte : >> [...] >>> I continued to use the BQL patch in my private tree after it was reverted >>> and also had occasional timeouts, but *only* after I started playing >>>

Re: [PATCH net] r8169: fix NAPI handling under high load

2018-10-17 Thread Heiner Kallweit
On 18.10.2018 07:21, David Miller wrote: > From: Francois Romieu > Date: Thu, 18 Oct 2018 01:30:45 +0200 > >> Heiner Kallweit : >> [...] >>> This issue has been there more or less forever (at least it exists in >>> 3.16 already), so I can't provide a "

Re: [PATCH net] r8169: fix NAPI handling under high load

2018-10-17 Thread Heiner Kallweit
On 17.10.2018 21:11, Holger Hoffstätte wrote: > On 10/17/18 20:12, Heiner Kallweit wrote: >> On 16.10.2018 23:17, Holger Hoffstätte wrote: >>> On 10/16/18 22:37, Heiner Kallweit wrote: >>>> rtl_rx() and rtl_tx() are called only if the respective bits are set >>

Fwd: Re: [PATCH net] r8169: fix NAPI handling under high load

2018-10-17 Thread Heiner Kallweit
or at least the old dmesg logs, I'd appreciate if you could let me know the quoted line from dmesg output. Thanks a lot, Heiner Forwarded Message Subject: Re: [PATCH net] r8169: fix NAPI handling under high load Date: Wed, 17 Oct 2018 20:12:48 +0200 From: Heiner Kallweit To: Holger

Re: [PATCH net] r8169: fix NAPI handling under high load

2018-10-17 Thread Heiner Kallweit
On 16.10.2018 23:17, Holger Hoffstätte wrote: > On 10/16/18 22:37, Heiner Kallweit wrote: >> rtl_rx() and rtl_tx() are called only if the respective bits are set >> in the interrupt status register. Under high load NAPI may not be >> able to process all data

[PATCH net] r8169: fix NAPI handling under high load

2018-10-16 Thread Heiner Kallweit
. This issue has been there more or less forever (at least it exists in 3.16 already), so I can't provide a "Fixes" tag. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/ne

[PATCH net] r8169: re-enable MSI-X on RTL8168g

2018-10-16 Thread Heiner Kallweit
L8168g"). So let's revert it. Fixes: 7c53a722459c ("r8169: don't use MSI-X on RTL8168g") Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r

[PATCH net-next] net: phy: merge phy_start_aneg and phy_start_aneg_priv

2018-10-15 Thread Heiner Kallweit
After commit 9f2959b6b52d ("net: phy: improve handling delayed work") the sync parameter isn't needed any longer in phy_start_aneg_priv(). This allows to merge phy_start_aneg() and phy_start_aneg_priv(). Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 21 +++

[PATCH net-next] r8169: remove unneeded call to netif_stop_queue in rtl8169_net_suspend

2018-10-12 Thread Heiner Kallweit
netif_device_detach() stops all tx queues already, so we don't need this call. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index e6e1790f4

[PATCH net-next] r8169: simplify rtl8169_set_magic_reg

2018-10-12 Thread Heiner Kallweit
Simplify this function, no functional change intended. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 32 +++- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek

[PATCH net-next 1/2] net: phy: improve handling of PHY_RUNNING in state machine

2018-10-11 Thread Heiner Kallweit
and call phy_read_status() again but can set status PHY_NOLINK directly. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 704428211..696955d38

[PATCH net-next 2/2] net: phy: simplify handling of PHY_RESUMING in state machine

2018-10-11 Thread Heiner Kallweit
Simplify code for handling state PHY_RESUMING, no functional change intended. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 43 ++- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c

[PATCH net-next 0/2] net: phy: improve and simplify state machine

2018-10-11 Thread Heiner Kallweit
Improve / simplify handling of states PHY_RUNNING and PHY_RESUMING in phylib state machine. Heiner Kallweit (2): net: phy: improve handling of PHY_RUNNING in state machine net: phy: simplify handling of PHY_RESUMING in state machine drivers/net/phy/phy.c | 72

[PATCH net-next] net: phy: trigger state machine immediately in phy_start_machine

2018-10-11 Thread Heiner Kallweit
When starting the state machine there may be work to be done immediately, e.g. if the initial state is PHY_UP then the state machine may trigger an autonegotiation. Having said that I see no need to wait a second until the state machine is run first time. Signed-off-by: Heiner Kallweit

Re: [PATCH net-next v2] net: core: change bool members of struct net_device to bitfield members

2018-10-09 Thread Heiner Kallweit
On 09.10.2018 17:20, David Ahern wrote: > On 10/8/18 2:17 PM, Heiner Kallweit wrote: >> bool is good as parameter type or function return type, but if used >> for struct members it consumes more memory than needed. >> Changing the bool members of struct net_device to bitfi

Re: [PATCH net-next] net: core: change bool members of struct net_device to bitfield members

2018-10-08 Thread Heiner Kallweit
On 08.10.2018 23:20, Stephen Hemminger wrote: > On Mon, 8 Oct 2018 22:00:51 +0200 > Heiner Kallweit wrote: > >> * >> + * @uc_promisc:Counter that indicates promiscuous mode >> + * has been enabled due to the need to listen to >> + *

[PATCH net-next v2] net: core: change bool members of struct net_device to bitfield members

2018-10-08 Thread Heiner Kallweit
bool is good as parameter type or function return type, but if used for struct members it consumes more memory than needed. Changing the bool members of struct net_device to bitfield members allows to decrease the memory footprint of this struct. Signed-off-by: Heiner Kallweit --- v2: - Change

Re: [PATCH net-next] net: core: change bool members of struct net_device to bitfield members

2018-10-08 Thread Heiner Kallweit
On 08.10.2018 22:07, Randy Dunlap wrote: > On 10/8/18 1:00 PM, Heiner Kallweit wrote: >> bool is good as parameter type or function return type, but if used >> for struct members it consumes more memory than needed. >> Changing the bool members of struct net_device to bitfi

[PATCH net-next] net: core: change bool members of struct net_device to bitfield members

2018-10-08 Thread Heiner Kallweit
bool is good as parameter type or function return type, but if used for struct members it consumes more memory than needed. Changing the bool members of struct net_device to bitfield members allows to decrease the memory footprint of this struct. Signed-off-by: Heiner Kallweit --- include/linux

  1   2   3   4   5   >