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

2018-05-02 Thread Heiner Kallweit
I thought I'm more or less done with the basic refactoring. But again I stumbled across things that can be improved / simplified. Heiner Kallweit (10): r8169: remove unneeded check in r8168_pll_power_down r8169: remove 810x_phy_power_up/down r8169: merge r810x_pll_power_down/up

[PATCH net-next 03/10] r8169: merge r810x_pll_power_down/up into r8168_pll_power_down/up

2018-05-02 Thread Heiner Kallweit
r810x_pll_power_down/up and r8168_pll_power_down/up have a lot in common, so we can simplify the code by merging the former into the latter. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 61 1 file chang

[PATCH net-next 07/10] r8169: drop rtl_generic_op

2018-05-02 Thread Heiner Kallweit
Only two places are left where rtl_generic_op() is used, so we can inline it and simplify the code a little. This change also avoids the overhead of unlocking/locking in case the respective operation isn't set. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/et

[PATCH net-next 09/10] r8169: avoid potentially misaligned access when getting mac address

2018-05-02 Thread Heiner Kallweit
Interpreting a member of an u16 array as u32 may result in a misaligned access. Also it's not really intuitive to define a mac address variable as array of three u16 words. Therefore use an array of six bytes that is properly aligned for 32 bit access. Signed-off-by: Heiner Kallweit <hkal

[PATCH net-next 08/10] r8169: improve PCI config space access

2018-05-02 Thread Heiner Kallweit
we may introduce a whitelist for chips where ASPM is known to work, therefore let's keep this code. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 132 ++- 1 file changed, 29 insertions(+), 103 deletions(-) diff --git

[PATCH net-next 04/10] r8169: drop member pll_power_ops from struct rtl8169_private

2018-05-02 Thread Heiner Kallweit
After merging r810x_pll_power_down/up and r8168_pll_power_down/up we don't need member pll_power_ops any longer and can drop it, thus simplifying the code. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 76

[PATCH net-next 02/10] r8169: remove 810x_phy_power_up/down

2018-05-02 Thread Heiner Kallweit
The functionality of 810x_phy_power_up/down is covered by the default clause in 8168_phy_power_up/down. Therefore we don't need these functions. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 98 1 file chang

[PATCH net-next 10/10] r8169: replace get_protocol with vlan_get_protocol

2018-05-02 Thread Heiner Kallweit
This patch is basically the same as 6e74d1749a33 ("r8152: replace get_protocol with vlan_get_protocol"). Use vlan_get_protocol instead of duplicating the functionality. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 16 ++--

[PATCH net-next 05/10] r8169: simplify code by using ranges in switch clauses

2018-05-02 Thread Heiner Kallweit
Several switch statements can be significantly simplified by using case ranges. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 193 +++ 1 file changed, 19 insertions(+), 174 deletions(-) diff --git a/drivers/net/et

[PATCH net-next 01/10] r8169: remove unneeded check in r8168_pll_power_down

2018-05-02 Thread Heiner Kallweit
RTL_GIGA_MAC_VER_23/24 are configured by rtl_hw_start_8168cp_2() and rtl_hw_start_8168cp_3() respectively which both apply CPCMD_QUIRK_MASK, thus clearing bit ASF. Bit ASF isn't set at any other place in the driver, therefore this check can be removed. Signed-off-by: Heiner Kallweit <hkal

[PATCH net-next 06/10] r8169: replace longer if statements with switch statements

2018-05-02 Thread Heiner Kallweit
Some longer if statements can be simplified by using switch statements instead. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 54 +--- 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/drivers/net/et

[PATCH net-next 0/8] r8169: further improvements w/o functional change

2018-04-28 Thread Heiner Kallweit
This series aims at further improving and simplifying the code w/o any intended functional changes. Series was tested on: RTL8169sb, RTL8168d, RTL8168e-vl Heiner Kallweit (8): r8169: remove unneeded call to __rtl8169_set_features in rtl_open r8169: improve rtl8169_set_features r8169

[PATCH net-next 4/8] r8169: improve CPlusCmd handling

2018-04-28 Thread Heiner Kallweit
ize tp->cmd with the register value. - In rtl_hw_start_8169 remove one setting of PCIMulRW because it's set unconditionally anyway a few lines later. - In rtl_hw_start_8168 properly mask out the INTT bits before setting INTT_1. So far we rely on both bits being zero. Signed-off-by: Heiner

[PATCH net-next 8/8] r8169: move common initializations to tp->hw_start

2018-04-28 Thread Heiner Kallweit
ned-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 74 +++- 1 file changed, 19 insertions(+), 55 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index c7b9301a..66f10d

[PATCH net-next 5/8] r8169: improve handling of CPCMD quirk mask

2018-04-28 Thread Heiner Kallweit
Both quirk masks are the same, so we can merge them. The quirk mask includes most bits so it's actually easier to define a mask with the bits to keep. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 35 ++-- 1 file c

[PATCH net-next 3/8] r8169: replace magic number for INTT mask with a constant

2018-04-28 Thread Heiner Kallweit
Use a proper constant for INTT bit mask. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c

[PATCH net-next 7/8] r8169: remove calls to rtl_set_rx_mode

2018-04-28 Thread Heiner Kallweit
__dev_open() calls the ndo_set_rx_mode callback anyway, so we don't have to do it here too. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drive

[PATCH net-next 2/8] r8169: improve rtl8169_set_features

2018-04-28 Thread Heiner Kallweit
fit in it. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index d2656224..411d12

[PATCH net-next 1/8] r8169: remove unneeded call to __rtl8169_set_features in rtl_open

2018-04-28 Thread Heiner Kallweit
off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index a5d00ee9..d2656224 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++

[PATCH net-next 6/8] r8169: simplify rtl_hw_start_8169

2018-04-28 Thread Heiner Kallweit
-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index cf7a7db5..8c816f6c 100644 --- a/drive

[PATCH net] net: phy: fix flag masking in __set_phy_supported

2018-07-03 Thread Heiner Kallweit
nly the values we're going to change. In addition remove the misleading comment, job of this small function is just to adjust the supported and advertised speeds. Fixes: f3a6bd393c2c ("phylib: Add phy_set_max_speed helper") Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy_device.c |

Re: Issue with commit fea23fb591cc "net: phy: convert read-modify-write to phy_modify()"

2018-01-04 Thread Heiner Kallweit
Am 04.01.2018 um 12:44 schrieb Russell King - ARM Linux: > On Thu, Jan 04, 2018 at 08:00:53AM +0100, Heiner Kallweit wrote: >> Parameter mask of phy_modify() holds the bits to be cleared. >> In the mentioned commit parameter mask seems to be inverted in >> few cases, what IMO

[PATCH net-next 0/3] r8169: improve runtime pm

2018-01-08 Thread Heiner Kallweit
). Heiner Kallweit (3): r8169: remove unneeded rpm ops in rtl_shutdown r8169: improve runtime pm in rtl8169_check_link_status r8169: improve runtime pm in general and suspend unused ports drivers/net/ethernet/realtek/r8169.c | 44 ++-- 1 file changed, 17 insertions

[PATCH net-next 1/3] r8169: remove unneeded rpm ops in rtl_shutdown

2018-01-08 Thread Heiner Kallweit
This patch reverts commit 2a15cd2ff488 "r8169: runtime resume before shutdown" from 2012. Few months after this change the underlying issue was solved in the PCI core with commit 3ff2de9ba1a2 "PCI/PM: Resume device before shutdown". Signed-off-by: Heiner Kallweit &

[PATCH net-next 2/3] r8169: improve runtime pm in rtl8169_check_link_status

2018-01-08 Thread Heiner Kallweit
any longer. On my system aneg takes almost 3s, to be on the safe side let's increase the suspend delay to 10s. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --g

[PATCH net-next 3/3] r8169: improve runtime pm in general and suspend unused ports

2018-01-08 Thread Heiner Kallweit
rtl8169_runtime_suspend to power down the chip if the interface is down. Successfully tested on a RTL8168evl (mac version 34). Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff

[PATCH net-next 1/2] net: phy: remove parameter new_link from phy_mac_interrupt()

2018-01-10 Thread Heiner Kallweit
. phy_mac_interrupt is used in interrupt context and getting the link state may sleep (at least when having to access the PHY registers via MDIO bus). So let's remove it. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/phy/phy.c | 10 +++--- include/linux/phy.h | 2

[PATCH net-next 2/2] net: bcmgenet: remove parameter new_link from phy_mac_interrupt()

2018-01-10 Thread Heiner Kallweit
Reflect a phylib API change and remove second parameter from call to phy_mac_interrupt(). Keep the current logic and set phydev->link, although this may not be needed. However I don't have the hardware and can't test this. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- dr

[PATCH net-next 0/2] net: phy: remove parameter new_link from phy_mac_interrupt()

2018-01-10 Thread Heiner Kallweit
. phy_mac_interrupt is used in interrupt context and getting the link state may sleep (at least when having to access the PHY registers via MDIO bus). bcmgenet driver so far is the only user, therefore changing the API has minimal impact. Heiner Kallweit (2): net: phy: remove parameter new_link from

[PATCH net-next v2] net: phy: remove parameter new_link from phy_mac_interrupt()

2018-01-10 Thread Heiner Kallweit
. phy_mac_interrupt is used in interrupt context and getting the link state may sleep (at least when having to access the PHY registers via MDIO bus). So let's remove it. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- v2: - combine both patches to avoid a build failure --- drive

Re: ipv6_addrconf: WARNING about suspicious RCU usage

2018-01-20 Thread Heiner Kallweit
Am 20.01.2018 um 20:19 schrieb Ido Schimmel: > On Sat, Jan 20, 2018 at 10:49:03AM -0800, Eric Dumazet wrote: >> On Sat, 2018-01-20 at 15:37 +0200, Ido Schimmel wrote: >>> On Sat, Jan 20, 2018 at 12:57:01PM +0100, Heiner Kallweit wrote: >>>> Since some tim

[PATCH] r8169: improve multicast hash filter handling

2018-01-21 Thread Heiner Kallweit
The multicast hash filter is a 64 bit value and the code can be simplified by using a u64 variable. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff

Re: ipv6_addrconf: WARNING about suspicious RCU usage

2018-01-21 Thread Heiner Kallweit
Am 20.01.2018 um 20:19 schrieb Ido Schimmel: > On Sat, Jan 20, 2018 at 10:49:03AM -0800, Eric Dumazet wrote: >> On Sat, 2018-01-20 at 15:37 +0200, Ido Schimmel wrote: >>> On Sat, Jan 20, 2018 at 12:57:01PM +0100, Heiner Kallweit wrote: >>>> Since some tim

Re: ipv6_addrconf: WARNING about suspicious RCU usage

2018-01-26 Thread Heiner Kallweit
Am 23.01.2018 um 19:01 schrieb Ido Schimmel: > On Sun, Jan 21, 2018 at 10:22:16PM +0100, Heiner Kallweit wrote: >> So far everything looks good with Eric's patch. The warning didn't show up >> again. > > Eric, can you please submit your patch? > . > Soon the merge w

[PATCH] phy: realtek: use new helpers for paged register access

2018-01-12 Thread Heiner Kallweit
Make use of the new helpers for paged register access. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/phy/realtek.c | 59 +++ 1 file changed, 14 insertions(+), 45 deletions(-) diff --git a/drivers/net/phy/realtek.c b/drive

[PATCH net-next 0/2] phy: add helpers for setting/clearing bits in PHY registers

2018-01-12 Thread Heiner Kallweit
Based on the recent introduction of phy_modify add helpers for setting and clearing bits in PHY registers. First user is phylib. Heiner Kallweit (2): phy: add helpers for setting/clearing bits in PHY registers phy: use new helpers phy_set_bits/phy_clear_bits in phylib drivers/net/phy

[PATCH net-next 1/2] phy: add helpers for setting/clearing bits in PHY registers

2018-01-12 Thread Heiner Kallweit
Based on the recent introduction of phy_modify add helpers for setting and clearing bits in PHY registers. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- include/linux/phy.h | 49 + 1 file changed, 49 insertions(+) diff --git a/i

[PATCH net-next 2/2] phy: use new helpers phy_set_bits/phy_clear_bits in phylib

2018-01-12 Thread Heiner Kallweit
Use new helpers phy_set_bits / phy_clear_bits in phylib. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/phy/phy_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 6bd

Re: [PATCH] phy: realtek: use new helpers for paged register access

2018-01-12 Thread Heiner Kallweit
Am 12.01.2018 um 22:01 schrieb Andrew Lunn: > On Fri, Jan 12, 2018 at 09:30:08PM +0100, Heiner Kallweit wrote: >> Make use of the new helpers for paged register access. >> >> Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> >> --- &

[PATCH v2] phy: realtek: use new helpers for paged register access

2018-01-12 Thread Heiner Kallweit
Make use of the new helpers for paged register access. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- v2: - use accessor versions w/o locking in the read/write_page callbacks --- drivers/net/phy/realtek.c | 59 +++ 1 file chang

Potential issue with f5e64032a799 "net: phy: fix resume handling"

2018-02-03 Thread Heiner Kallweit
This commit forces callers of phy_resume() and phy_suspend() to hold mutex phydev->lock. This was done for calls to phy_resume() and phy_suspend() in phylib, however there are more callers in network drivers. I'd assume that these other calls issue a warning now because of the lock not being held.

Regression in 39461af74125 "bitmap: replace bitmap_{from,to}_u32array"

2018-02-04 Thread Heiner Kallweit
Recently ethtool started to give incomplete values for supported and advertised modes. There seems to be a regression in this commit: The bit number parameter in the calls to bitmap_to_arr32() in store_link_ksettings_for_user() should be __ETHTOOL_LINK_MODE_MASK_NBITS instead of

Re: [PATCH net] net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT

2018-02-07 Thread Heiner Kallweit
Am 07.02.2018 um 20:34 schrieb Florian Fainelli: > > > On 02/07/2018 11:26 AM, Heiner Kallweit wrote: >> Am 07.02.2018 um 20:06 schrieb Florian Fainelli: >>> >>> >>> On 02/07/2018 10:44 AM, Heiner Kallweit wrote: >>>> This condition wa

[PATCH net v2] net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT

2018-02-07 Thread Heiner Kallweit
This condition wasn't adjusted when PHY_IGNORE_INTERRUPT (-2) was added long ago. In case of PHY_IGNORE_INTERRUPT the MAC interrupt indicates also PHY state changes and we should do what the symbol says. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- v2: - use phy_interrupt_is

[PATCH net] net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT

2018-02-07 Thread Heiner Kallweit
This condition wasn't adjusted when PHY_IGNORE_INTERRUPT (-2) was added long ago. In case of PHY_IGNORE_INTERRUPT the MAC interrupt indicates also PHY state changes and we should do what the symbol says. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/phy/phy.c | 2

Re: [PATCH net] net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT

2018-02-07 Thread Heiner Kallweit
Am 07.02.2018 um 20:06 schrieb Florian Fainelli: > > > On 02/07/2018 10:44 AM, Heiner Kallweit wrote: >> This condition wasn't adjusted when PHY_IGNORE_INTERRUPT (-2) was added >> long ago. In case of PHY_IGNORE_INTERRUPT the MAC interrupt indicates >> also PHY sta

[PATCH net v3] net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT

2018-02-08 Thread Heiner Kallweit
Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- v2: - use phy_interrupt_is_valid() instead of checking for irq > 0 v3: - added "Fixes" tag - fix is a candidate for stable, v4.9+ --- drivers/net/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

Re: handling of phy_stop() and phy_stop_machine() in phylib

2018-02-07 Thread Heiner Kallweit
Am 04.02.2018 um 03:48 schrieb Florian Fainelli: > > > On 02/03/2018 03:58 PM, Heiner Kallweit wrote: >> Am 03.02.2018 um 21:17 schrieb Andrew Lunn: >>> On Sat, Feb 03, 2018 at 05:41:54PM +0100, Heiner Kallweit wrote: >>>> This commit forces callers of ph

Re: [PATCH net v2] net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT

2018-02-07 Thread Heiner Kallweit
Am 08.02.2018 um 00:00 schrieb Florian Fainelli: > On 02/07/2018 11:44 AM, Heiner Kallweit wrote: >> This condition wasn't adjusted when PHY_IGNORE_INTERRUPT (-2) was added >> long ago. In case of PHY_IGNORE_INTERRUPT the MAC interrupt indicates >> also PHY state changes

Re: Potential issue with f5e64032a799 "net: phy: fix resume handling"

2018-02-03 Thread Heiner Kallweit
Am 03.02.2018 um 21:17 schrieb Andrew Lunn: > On Sat, Feb 03, 2018 at 05:41:54PM +0100, Heiner Kallweit wrote: >> This commit forces callers of phy_resume() and phy_suspend() to hold >> mutex phydev->lock. This was done for calls to phy_resume() and >> phy_susp

Re: Potential issue with f5e64032a799 "net: phy: fix resume handling"

2018-02-05 Thread Heiner Kallweit
Am 04.02.2018 um 03:48 schrieb Florian Fainelli: > > > On 02/03/2018 03:58 PM, Heiner Kallweit wrote: >> Am 03.02.2018 um 21:17 schrieb Andrew Lunn: >>> On Sat, Feb 03, 2018 at 05:41:54PM +0100, Heiner Kallweit wrote: >>>> This commit forces callers of ph

[PATCH net-next] r8169: remove some WOL-related dead code

2018-02-19 Thread Heiner Kallweit
Commit bde135a672bf "r8169: only enable PCI wakeups when WOL is active" removed the only user of flag RTL_FEATURE_WOL. So let's remove some now dead code. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 39 ++-

[PATCH net-next] r8169: remove not needed PHY soft reset in rtl8168e_2_hw_phy_config

2018-02-19 Thread Heiner Kallweit
rtl8169_init_phy() resets the PHY anyway after applying the chip-specific PHY configuration. So we don't need to soft-reset the PHY as part of the chip-specific configuration. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 2 -- 1 file chan

Re: [PATCH net-next] r8169: remove not needed PHY soft reset in rtl8168e_2_hw_phy_config

2018-02-20 Thread Heiner Kallweit
Am 21.02.2018 um 05:27 schrieb David Miller: > From: Heiner Kallweit <hkallwe...@gmail.com> > Date: Tue, 20 Feb 2018 07:30:16 +0100 > >> rtl8169_init_phy() resets the PHY anyway after applying the chip-specific >> PHY configuration. So we don't need to soft-reset the

[PATCH net-next] r8169: disable WOL per default

2018-02-22 Thread Heiner Kallweit
doesn't use WOL even if the BIOS enables it in the chip. And having WOL being active keeps the PHY(s) from powering down if being idle. If somebody needs WOL, he can enable it during boot, e.g. by configuring systemd.link/WakeOnLan. Therefore, to make WOL consistent again, disable it per default. Signed-off

[PATCH net-next] r8169: simplify and improve check for dash

2018-02-22 Thread Heiner Kallweit
r8168_check_dash() returns false anyway for all chip versions not supporting dash. So we can simplify the check conditions. In addition change the check functions to return bool instead of int, because they actually return a bool value. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.

[PATCH net-next v2] r8169: improve interrupt handling

2018-02-24 Thread Heiner Kallweit
, intentionally disabling (unreliable) MSI being partially available on old PCI chips. The patch works fine on a RTL8168evl (chip version 34) and on a RTL8169SB (chip version 04). Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- v2: - disable MSI on old PCI chips even if they partially s

Re: [PATCH net-next] r8169: improve interrupt handling

2018-02-24 Thread Heiner Kallweit
Am 24.02.2018 um 02:35 schrieb Francois Romieu: > Heiner Kallweit <hkallwe...@gmail.com> : > [...] >> Last but not least it enables a feature which was (I presume accidently) >> disabled before. There are members of the RTL8169 family supporting MSI >> (e.g. RTL

[PATCH net-next] r8169: improve interrupt handling

2018-02-23 Thread Heiner Kallweit
orting MSI isn't tested. The RTL8169SB (chip version 04) I have at least still works in a PCI slot w/o MSI. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8169.c | 44 1 file changed, 20 insertions(+), 24 deletions

Re: [PATCH RFC 09/18] r8168: use genphy_soft_reset instead of open coding the soft reset

2017-12-22 Thread Heiner Kallweit
Am 22.12.2017 um 10:57 schrieb Andrew Lunn: > On Thu, Dec 21, 2017 at 09:50:28PM +0100, Heiner Kallweit wrote: >> Use genphy_soft_reset instead of open coding the soft reset. > > Hi Heiner > > At this point, you have swapped over the phylib. Does one of the > drivers in

Re: [PATCH RFC 00/18] r8169: separate r8168 driver and add experimental phylib support

2017-12-21 Thread Heiner Kallweit
Am 21.12.2017 um 22:16 schrieb David Miller: > From: Heiner Kallweit <hkallwe...@gmail.com> > Date: Thu, 21 Dec 2017 21:38:11 +0100 > >> This experimental series separates drivers for PCI / PCIE NIC's and >> adds initial phylib support to the separated r8168 driv

Re: [PATCH RFC 12/18] r8168: switch to phy_mii_ioctl

2017-12-22 Thread Heiner Kallweit
Am 22.12.2017 um 11:00 schrieb Andrew Lunn: >> static int rtl8168_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) >> { >> -struct rtl8168_private *tp = netdev_priv(dev); >> -struct mii_ioctl_data *data = if_mii(ifr); >> +if (!netif_running(dev)) >> +return

Re: [PATCH RFC 13/18] r8168: replace speed_down with genphy_restart_aneg

2017-12-22 Thread Heiner Kallweit
Am 22.12.2017 um 11:14 schrieb Andrew Lunn: > On Thu, Dec 21, 2017 at 09:50:39PM +0100, Heiner Kallweit wrote: >> Dealing with link partner abilities is handled by phylib, so let's >> just trigger autonegotiation here. >> >> Signed-off-by: Heiner Kallweit <hkallwe...

[PATCH RFC 00/18] r8169: separate r8168 driver and add experimental phylib support

2017-12-21 Thread Heiner Kallweit
l identifies as RTL8211E and has certain support already (w/o firmware). Heiner Kallweit (18): r8169: split driver to one for the non-PCIE cards (r8169) and one for the PCIE cards (r8168) r8168: remove code specific to MAC version 01 - 06 r8168: remove magic register handling used on MA

[PATCH RFC 02/18] r8168: remove code specific to MAC version 01 - 06

2017-12-21 Thread Heiner Kallweit
Remove code which is specific to MAC version 01 - 06. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 302 +-- 1 file changed, 5 insertions(+), 297 deletions(-) diff --git a/drivers/net/ethernet/realtek/r816

[PATCH RFC 14/18] r8168: remove rtl8168_set_speed

2017-12-21 Thread Heiner Kallweit
All these PHY basics are handled by phylib, so let's remove this code. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 92 1 file changed, 92 deletions(-) diff --git a/drivers/net/ethernet/realtek/r816

[PATCH RFC 04/18] r8168: remove TBI mode support needed for MAC version 01 only

2017-12-21 Thread Heiner Kallweit
Remove TBI mode support needed for MAC version 01 only. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 123 ++- 1 file changed, 6 insertions(+), 117 deletions(-) diff --git a/drivers/net/ethernet/realtek/r

[PATCH RFC 13/18] r8168: replace speed_down with genphy_restart_aneg

2017-12-21 Thread Heiner Kallweit
Dealing with link partner abilities is handled by phylib, so let's just trigger autonegotiation here. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 26 +- 1 file changed, 1 insertion(+), 25 deletions(-) diff

[PATCH RFC 11/18] r8168: switch to phy_ethtool_nway_reset

2017-12-21 Thread Heiner Kallweit
Switch to phy_ethtool_nway_reset. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/Kconfig | 1 - drivers/net/ethernet/realtek/r8168.c | 9 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/net/ethernet/realtek/Kcon

[PATCH RFC 12/18] r8168: switch to phy_mii_ioctl

2017-12-21 Thread Heiner Kallweit
Use phy_mii_ioctl for handling the ioctl's. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 25 +++-- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c b/drivers/net/et

[PATCH RFC 18/18] r8168: use link speed information as maintained by phylib

2017-12-21 Thread Heiner Kallweit
Let's use the speed information as maintained by phylib instead of reading it directly from a register. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/d

[PATCH RFC 15/18] r8168: remove rtl_phy_work and rtl8168_phy_timer

2017-12-21 Thread Heiner Kallweit
Remove further code which is replaced by phylib. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 60 1 file changed, 60 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c b/drivers/net/et

[PATCH RFC 16/18] r8168: use phy_read/write in rtl_readphy/writephy helpers

2017-12-21 Thread Heiner Kallweit
Instead of accessing mdio_ops directly use phy_read/write in these helpers. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c b/drive

[PATCH RFC 09/18] r8168: use genphy_soft_reset instead of open coding the soft reset

2017-12-21 Thread Heiner Kallweit
Use genphy_soft_reset instead of open coding the soft reset. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c b/drive

[PATCH RFC 03/18] r8168: remove magic register handling used on MAC version 05 and 06 only

2017-12-21 Thread Heiner Kallweit
Remove magic register handling used on MAC version 05 and 06 only. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 27 --- 1 file changed, 27 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c b/drive

[PATCH RFC 10/18] r8168: switch to phy_ethtool_get/set_link_ksettings

2017-12-21 Thread Heiner Kallweit
Use phy_ethtool_get/set_link_ksettings instead of open coding these ethtool ops. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 50 +++- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/drive

[PATCH RFC 17/18] r8168: remove use of struct mii_if_info

2017-12-21 Thread Heiner Kallweit
After switching to phylib we don't need most elements of struct mii_if_info any longer. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 37 +++- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/d

[PATCH RFC 06/18] r8168: remove function rtl8169_rx_missed() being specific to MAC version 01 - 06

2017-12-21 Thread Heiner Kallweit
Function rtl8169_rx_missed() does nothing on MAC versions > 06, therefore remove it. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/drivers/net/ethernet/realtek/r

[PATCH RFC 05/18] r8168: remove unneeded callbacks from struct rtl8169_private

2017-12-21 Thread Heiner Kallweit
All supported chips provide a MII interface, therefore some callbacks can be removed from struct rtl8169_private. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 46 +--- 1 file changed, 16 insertions(

[PATCH RFC 08/18] r8168: add basic phylib support

2017-12-21 Thread Heiner Kallweit
All PHY's of the supported chips are MII-compatible, therefore let phylib do the work. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/Kconfig | 1 + drivers/net/ethernet/realtek/r8168.c | 152 +++ 2 files change

[PATCH RFC 07/18] r8168: replace 8169 with 8168 in all relevant symbols

2017-12-21 Thread Heiner Kallweit
After separation from the r8169 driver, replace 8169 with 8168 in all relevant symbols. Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- drivers/net/ethernet/realtek/r8168.c | 1066 +- 1 file changed, 533 insertions(+), 533 deletions(-) diff

Issue with commit fea23fb591cc "net: phy: convert read-modify-write to phy_modify()"

2018-01-03 Thread Heiner Kallweit
Parameter mask of phy_modify() holds the bits to be cleared. In the mentioned commit parameter mask seems to be inverted in few cases, what IMO is wrong (see example). Maybe I miss something, could you please check? And somehow related: When adding such helpers, wouldn't it make sense to add

Re: [PATCH net-next v2] r8169: improve interrupt handling

2018-02-26 Thread Heiner Kallweit
Am 26.02.2018 um 19:56 schrieb David Miller: > From: Heiner Kallweit <hkallwe...@gmail.com> > Date: Sat, 24 Feb 2018 16:53:23 +0100 > >> @@ -736,8 +736,7 @@ struct ring_info { >> }; >> >> enum features { >> -RTL_FEATURE_MSI = (1 <

Re: Potential issue with f5e64032a799 "net: phy: fix resume handling"

2018-02-25 Thread Heiner Kallweit
Am 03.02.2018 um 21:17 schrieb Andrew Lunn: > On Sat, Feb 03, 2018 at 05:41:54PM +0100, Heiner Kallweit wrote: >> This commit forces callers of phy_resume() and phy_suspend() to hold >> mutex phydev->lock. This was done for calls to phy_resume() and >> phy_susp

[PATCH net-next 4/4] r8169: don't configure max jumbo frame size per chip version

2018-08-10 Thread Heiner Kallweit
We don't have to configure the max jumbo frame size per chip (sub-)version. It can be easily determined based on the chip family. And new members of the RTL8168 family (if there are any) should be automatically covered. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c

[PATCH net-next 2/4] r8169: simplify interrupt handler

2018-08-10 Thread Heiner Kallweit
Simplify the interrupt handler a little and make it better readable. 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.c b/drivers/net/ethernet

[PATCH net-next 3/4] r8169: don't configure csum function per chip version

2018-08-10 Thread Heiner Kallweit
We don't have to configure the csum function per chip (sub-)version. The distinction is simple, versions RTL8102e and from RTL8168c onwards support csum_v2. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 134 +-- 1 file changed, 67 insertions

[PATCH net-next 1/4] r8169: don't include asm headers directly

2018-08-10 Thread Heiner Kallweit
The asm headers shouldn't be included directly. asm/irq.h is implicitly included by linux/interrupt.h, and instead of asm/io.h include linux/io.h. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git

[PATCH net-next] r8169: remove version info

2018-08-10 Thread Heiner Kallweit
The version number hasn't changed for ages and in general I doubt it provides any benefit. The message in rtl_init_one() may even be misleading because it's printed also if something fails in probe. Therefore let's remove the version information. Signed-off-by: Heiner Kallweit --- drivers/net

[PATCH net-next 0/4] r8169: smaller improvements

2018-08-10 Thread Heiner Kallweit
This series includes smaller improvements, no functional change intended. Heiner Kallweit (4): r8169: don't include asm headers directly r8169: simplify interrupt handler r8169: don't configure csum function per chip version r8169: don't configure max jumbo frame size per chip version

[PATCH net] r8169: don't use MSI-X on RTL8168g

2018-08-12 Thread Heiner Kallweit
is to blame, let's disable MSI-X for this version. Reported-by: Steve Dodd Reported-by: Lou Reed Tested-by: Steve Dodd Tested-by: Lou Reed Fixes: 6c6aa15fdea5 ("r8169: improve interrupt handling") Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 5 +++

Re: [PATCH] r8169: don't use MSI-X on RTL8106e

2018-08-16 Thread Heiner Kallweit
On 16.08.2018 20:59, Heiner Kallweit wrote: >> From: Jian-Hong Pan >> >> Found the ethernet network on ASUS X441UAR doesn't come back on resume >> from suspend when using MSI-X. The chip is RTL8106e - version 39. >> > The patch itself looks good, just the commi

Re: phylib: Any PHY which reports link up during autoneg ?

2018-08-16 Thread Heiner Kallweit
On 16.08.2018 21:21, Florian Fainelli wrote: > On 08/16/2018 12:15 PM, Heiner Kallweit wrote: >> When reading through the state machine code in phy.c I wondered whether >> there is any PHY which reports the link as up during autonegotiation. >> (It's about handling PHY_AN

Re: [PATCH] r8169: don't use MSI-X on RTL8106e

2018-08-16 Thread Heiner Kallweit
> From: Jian-Hong Pan > > Found the ethernet network on ASUS X441UAR doesn't come back on resume > from suspend when using MSI-X. The chip is RTL8106e - version 39. > The patch itself looks good, just the commit message is wrong in one place and a little bit long. > asus@endless:~$ dmesg |

phylib: Any PHY which reports link up during autoneg ?

2018-08-16 Thread Heiner Kallweit
When reading through the state machine code in phy.c I wondered whether there is any PHY which reports the link as up during autonegotiation. (It's about handling PHY_AN in the state machine, once we know the link is up we still check whether aneg was completed. Is this needed?) At least the

Re: r8169 needs CONFIG_REALTEK_PHY

2018-08-20 Thread Heiner Kallweit
On 20.08.2018 21:44, Marc Dionne wrote: > The r8169 adapter in one of my machines was not working after updating > to a current kernel from the merge window, which was fixed by enabling > CONFIG_REALTEK_PHY. > > So in addition to "select PHYLIB", should CONFIG_R8169 not also be > doing "select

[PATCH net-next] r8169: add missing Kconfig dependency

2018-08-17 Thread Heiner Kallweit
Now that we switched the r8169 driver to use phylib, there's a dependency on the Realtek PHY drivers. This dependency was missing in Kconfig. Reported-by: Jouni Mettälä Fixes: f1e911d5d0df ("r8169: add basic phylib support") Signed-off-by: Heiner Kallweit --- drivers/net/ethern

Re: [regression] r8169 without realtek_phy

2018-08-17 Thread Heiner Kallweit
On 17.08.2018 19:39, Florian Fainelli wrote: > +Heiner, > > On 08/17/2018 01:33 AM, Jouni Mettälä wrote: >> There is network regression for me. 4.18 was good. 4.18+ is bad. There >> was some phy changes in r8169 driver. Fortunately adding >> CONFIG_REALTEK_PHY=m to kernel config fixed the

Re: Experimental fix for MSI-X issue on r8169

2018-08-22 Thread Heiner Kallweit
On 22.08.2018 06:24, David Miller wrote: > From: Jian-Hong Pan > Date: Wed, 22 Aug 2018 11:01:02 +0800 > > ... >> [ 56.462464] r8169 :02:00.0: MSI-X entry: context resume: >> > ... >> uh! The MSI-X entry seems missed after resume on this laptop! > >

Re: Experimental fix for MSI-X issue on r8169

2018-08-21 Thread Heiner Kallweit
On 20.08.2018 05:47, Jian-Hong Pan wrote: > 2018-08-20 4:34 GMT+08:00 Heiner Kallweit : >> The three of you reported an MSI-X-related error when the system >> resumes from suspend. This has been fixed for now by disabling MSI-X >> on certain chip versions. However more ver

<    1   2   3   4   5   >