<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/ethernet/realtek, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-06-30T12:49:38Z</updated>
<entry>
<title>r8169: Avoid memcpy() over-reading of ETH_SS_STATS</title>
<updated>2021-06-30T12:49:38Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2021-06-16T19:53:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=da5b3a5d48ec2c2f63b7526fc989ce8736dd63b3'/>
<id>urn:sha1:da5b3a5d48ec2c2f63b7526fc989ce8736dd63b3</id>
<content type='text'>
[ Upstream commit da5ac772cfe2a03058b0accfac03fad60c46c24d ]

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally reading across neighboring array fields.

The memcpy() is copying the entire structure, not just the first array.
Adjust the source argument so the compiler can do appropriate bounds
checking.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>r8169: fix data corruption issue on RTL8402</title>
<updated>2020-10-29T08:03:00Z</updated>
<author>
<name>Heiner Kallweit</name>
</author>
<published>2020-10-01T07:23:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=607da73902fec453584baa24b4cd99ec17fa05d3'/>
<id>urn:sha1:607da73902fec453584baa24b4cd99ec17fa05d3</id>
<content type='text'>
[ Upstream commit ef9da46ddef071e1bbb943afbbe9b38771855554 ]

Petr reported that after resume from suspend RTL8402 partially
truncates incoming packets, and re-initializing register RxConfig
before the actual chip re-initialization sequence is needed to avoid
the issue.

Reported-by: Petr Tesarik &lt;ptesarik@suse.cz&gt;
Proposed-by: Petr Tesarik &lt;ptesarik@suse.cz&gt;
Tested-by: Petr Tesarik &lt;ptesarik@suse.cz&gt;
Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>r8169: Add support for new Realtek Ethernet</title>
<updated>2019-01-26T08:42:52Z</updated>
<author>
<name>Kai-Heng Feng</name>
</author>
<published>2019-01-02T06:45:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4193747a5ccbdbe3b00a6e8ec0316c9abab3911'/>
<id>urn:sha1:e4193747a5ccbdbe3b00a6e8ec0316c9abab3911</id>
<content type='text'>
[ Upstream commit 36352991835ce99e46b4441dd0eb6980f9a83e8f ]

There are two new Realtek Ethernet devices which are re-branded r8168h.
Add the IDs to to support them.

Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Reviewed-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: 8139cp: fix a BUG triggered by changing mtu with network traffic</title>
<updated>2018-12-17T20:55:08Z</updated>
<author>
<name>Su Yanjun</name>
</author>
<published>2018-12-03T07:33:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8832e33045b5219357fe7c859fda385902c1d052'/>
<id>urn:sha1:8832e33045b5219357fe7c859fda385902c1d052</id>
<content type='text'>
[ Upstream commit a5d4a89245ead1f37ed135213653c5beebea4237 ]

When changing mtu many times with traffic, a bug is triggered:

[ 1035.684037] kernel BUG at lib/dynamic_queue_limits.c:26!
[ 1035.684042] invalid opcode: 0000 [#1] SMP
[ 1035.684049] Modules linked in: loop binfmt_misc 8139cp(OE) macsec
tcp_diag udp_diag inet_diag unix_diag af_packet_diag netlink_diag tcp_lp
fuse uinput xt_CHECKSUM iptable_mangle ipt_MASQUERADE
nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4
nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 tun
bridge stp llc ebtable_filter ebtables ip6table_filter devlink
ip6_tables iptable_filter sunrpc snd_hda_codec_generic snd_hda_intel
snd_hda_codec snd_hda_core snd_hwdep ppdev snd_seq iosf_mbi crc32_pclmul
parport_pc snd_seq_device ghash_clmulni_intel parport snd_pcm
aesni_intel joydev lrw snd_timer virtio_balloon sg gf128mul glue_helper
ablk_helper cryptd snd soundcore i2c_piix4 pcspkr ip_tables xfs
libcrc32c sr_mod sd_mod cdrom crc_t10dif crct10dif_generic ata_generic
[ 1035.684102]  pata_acpi virtio_console qxl drm_kms_helper syscopyarea
sysfillrect sysimgblt floppy fb_sys_fops crct10dif_pclmul
crct10dif_common ttm crc32c_intel serio_raw ata_piix drm libata 8139too
virtio_pci drm_panel_orientation_quirks virtio_ring virtio mii dm_mirror
dm_region_hash dm_log dm_mod [last unloaded: 8139cp]
[ 1035.684132] CPU: 9 PID: 25140 Comm: if-mtu-change Kdump: loaded
Tainted: G           OE  ------------ T 3.10.0-957.el7.x86_64 #1
[ 1035.684134] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
[ 1035.684136] task: ffff8f59b1f5a080 ti: ffff8f5a2e32c000 task.ti:
ffff8f5a2e32c000
[ 1035.684149] RIP: 0010:[&lt;ffffffffba3a40d0&gt;]  [&lt;ffffffffba3a40d0&gt;]
dql_completed+0x180/0x190
[ 1035.684162] RSP: 0000:ffff8f5a75483e50  EFLAGS: 00010093
[ 1035.684162] RAX: 00000000000000c2 RBX: ffff8f5a6f91c000 RCX:
0000000000000000
[ 1035.684162] RDX: 0000000000000000 RSI: 0000000000000184 RDI:
ffff8f599fea3ec0
[ 1035.684162] RBP: ffff8f5a75483ea8 R08: 00000000000000c2 R09:
0000000000000000
[ 1035.684162] R10: 00000000000616ef R11: ffff8f5a75483b56 R12:
ffff8f599fea3e00
[ 1035.684162] R13: 0000000000000001 R14: 0000000000000000 R15:
0000000000000184
[ 1035.684162] FS:  00007fa8434de740(0000) GS:ffff8f5a75480000(0000)
knlGS:0000000000000000
[ 1035.684162] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1035.684162] CR2: 00000000004305d0 CR3: 000000024eb66000 CR4:
00000000001406e0
[ 1035.684162] Call Trace:
[ 1035.684162]  &lt;IRQ&gt;
[ 1035.684162]  [&lt;ffffffffc08cbaf8&gt;] ? cp_interrupt+0x478/0x580 [8139cp]
[ 1035.684162]  [&lt;ffffffffba14a294&gt;]
__handle_irq_event_percpu+0x44/0x1c0
[ 1035.684162]  [&lt;ffffffffba14a442&gt;] handle_irq_event_percpu+0x32/0x80
[ 1035.684162]  [&lt;ffffffffba14a4cc&gt;] handle_irq_event+0x3c/0x60
[ 1035.684162]  [&lt;ffffffffba14db29&gt;] handle_fasteoi_irq+0x59/0x110
[ 1035.684162]  [&lt;ffffffffba02e554&gt;] handle_irq+0xe4/0x1a0
[ 1035.684162]  [&lt;ffffffffba7795dd&gt;] do_IRQ+0x4d/0xf0
[ 1035.684162]  [&lt;ffffffffba76b362&gt;] common_interrupt+0x162/0x162
[ 1035.684162]  &lt;EOI&gt;
[ 1035.684162]  [&lt;ffffffffba0c2ae4&gt;] ? __wake_up_bit+0x24/0x70
[ 1035.684162]  [&lt;ffffffffba1e46f5&gt;] ? do_set_pte+0xd5/0x120
[ 1035.684162]  [&lt;ffffffffba1b64fb&gt;] unlock_page+0x2b/0x30
[ 1035.684162]  [&lt;ffffffffba1e4879&gt;] do_read_fault.isra.61+0x139/0x1b0
[ 1035.684162]  [&lt;ffffffffba1e9134&gt;] handle_pte_fault+0x2f4/0xd10
[ 1035.684162]  [&lt;ffffffffba1ebc6d&gt;] handle_mm_fault+0x39d/0x9b0
[ 1035.684162]  [&lt;ffffffffba76f5e3&gt;] __do_page_fault+0x203/0x500
[ 1035.684162]  [&lt;ffffffffba76f9c6&gt;] trace_do_page_fault+0x56/0x150
[ 1035.684162]  [&lt;ffffffffba76ef42&gt;] do_async_page_fault+0x22/0xf0
[ 1035.684162]  [&lt;ffffffffba76b788&gt;] async_page_fault+0x28/0x30
[ 1035.684162] Code: 54 c7 47 54 ff ff ff ff 44 0f 49 ce 48 8b 35 48 2f
9c 00 48 89 77 58 e9 fe fe ff ff 0f 1f 80 00 00 00 00 41 89 d1 e9 ef fe
ff ff &lt;0f&gt; 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 55 8d 42 ff 48
[ 1035.684162] RIP  [&lt;ffffffffba3a40d0&gt;] dql_completed+0x180/0x190
[ 1035.684162]  RSP &lt;ffff8f5a75483e50&gt;

It's not the same as in 7fe0ee09 patch described.
As 8139cp uses shared irq mode, other device irq will trigger
cp_interrupt to execute.

cp_change_mtu
 -&gt; cp_close
 -&gt; cp_open

In cp_close routine  just before free_irq(), some interrupt may occur.
In my environment, cp_interrupt exectutes and IntrStatus is 0x4,
exactly TxOk. That will cause cp_tx to wake device queue.

As device queue is started, cp_start_xmit and cp_open will run at same
time which will cause kernel BUG.

For example:
[#] for tx descriptor

At start:

[#][#][#]
num_queued=3

After cp_init_hw-&gt;cp_start_hw-&gt;netdev_reset_queue:

[#][#][#]
num_queued=0

When 8139cp starts to work then cp_tx will check
num_queued mismatchs the complete_bytes.

The patch will check IntrMask before check IntrStatus in cp_interrupt.
When 8139cp interrupt is disabled, just return.

Signed-off-by: Su Yanjun &lt;suyj.fnst@cn.fujitsu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>r8169: fix NAPI handling under high load</title>
<updated>2018-11-10T15:41:41Z</updated>
<author>
<name>Heiner Kallweit</name>
</author>
<published>2018-10-18T17:56:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=104ed9e3d12651ba6a95aad7f229c966386f2f83'/>
<id>urn:sha1:104ed9e3d12651ba6a95aad7f229c966386f2f83</id>
<content type='text'>
[ Upstream commit 6b839b6cf9eada30b086effb51e5d6076bafc761 ]

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 (work_done == budget) and it will schedule
subsequent calls to the poll callback.
rtl_ack_events() however resets the bits in the interrupt status
register, therefore subsequent calls to rtl8169_poll() won't call
rtl_rx() and rtl_tx() - chip interrupts are still disabled.

Fix this by calling rtl_rx() and rtl_tx() independent of the bits
set in the interrupt status register. Both functions will detect
if there's nothing to do for them.

Fixes: da78dbff2e05 ("r8169: remove work from irq handler.")
Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>r8169: Clear RTL_FLAG_TASK_*_PENDING when clearing RTL_FLAG_TASK_ENABLED</title>
<updated>2018-10-10T06:52:12Z</updated>
<author>
<name>Kai-Heng Feng</name>
</author>
<published>2018-09-10T17:51:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02975ee7377f64f24a94dde614dbe832b4078a9b'/>
<id>urn:sha1:02975ee7377f64f24a94dde614dbe832b4078a9b</id>
<content type='text'>
[ Upstream commit 6ad569019999300afd8e614d296fdc356550b77f ]

After system suspend, sometimes the r8169 doesn't work when ethernet
cable gets pluggued.

This issue happens because rtl_reset_work() doesn't get called from
rtl8169_runtime_resume(), after system suspend.

In rtl_task(), RTL_FLAG_TASK_* only gets cleared if this condition is
met:
if (!netif_running(dev) ||
    !test_bit(RTL_FLAG_TASK_ENABLED, tp-&gt;wk.flags))
    ...

If RTL_FLAG_TASK_ENABLED was cleared during system suspend while
RTL_FLAG_TASK_RESET_PENDING was set, the next rtl_schedule_task() won't
schedule task as the flag is still there.

So in addition to clearing RTL_FLAG_TASK_ENABLED, also clears other
flags.

Cc: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>r8169: fix powering up RTL8168h</title>
<updated>2018-05-26T06:48:47Z</updated>
<author>
<name>Heiner Kallweit</name>
</author>
<published>2018-05-07T19:11:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cd59b55080f5fa48a9cf7049dd3dcccb492a50d7'/>
<id>urn:sha1:cd59b55080f5fa48a9cf7049dd3dcccb492a50d7</id>
<content type='text'>
[ Upstream commit 3148dedfe79e422f448a10250d3e2cdf8b7ee617 ]

Since commit a92a08499b1f "r8169: improve runtime pm in general and
suspend unused ports" interfaces w/o link are runtime-suspended after
10s. On systems where drivers take longer to load this can lead to the
situation that the interface is runtime-suspended already when it's
initially brought up.
This shouldn't be a problem because rtl_open() resumes MAC/PHY.
However with at least one chip version the interface doesn't properly
come up, as reported here:
https://bugzilla.kernel.org/show_bug.cgi?id=199549

The vendor driver uses a delay to give certain chip versions some
time to resume before starting the PHY configuration. So let's do
the same. I don't know which chip versions may be affected,
therefore apply this delay always.

This patch was reported to fix the issue for RTL8168h.
I was able to reproduce the issue on an Asus H310I-Plus which also
uses a RTL8168h. Also in my case the patch fixed the issue.

Reported-by: Slava Kardakov &lt;ojab@ojab.ru&gt;
Tested-by: Slava Kardakov &lt;ojab@ojab.ru&gt;
Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>8139too: Use disable_irq_nosync() in rtl8139_poll_controller()</title>
<updated>2018-05-26T06:48:46Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2018-05-02T11:30:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a221a0c1db1e343ba64a41e21a39aea73d35ab7f'/>
<id>urn:sha1:a221a0c1db1e343ba64a41e21a39aea73d35ab7f</id>
<content type='text'>
[ Upstream commit af3e0fcf78879f718c5f73df0814951bd7057d34 ]

Use disable_irq_nosync() instead of disable_irq() as this might be
called in atomic context with netpoll.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>r8169: fix setting driver_data after register_netdev</title>
<updated>2018-04-13T17:50:27Z</updated>
<author>
<name>Heiner Kallweit</name>
</author>
<published>2018-03-26T17:19:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ce42e0de85a0dc4933016b2394c35872b8fd1f51'/>
<id>urn:sha1:ce42e0de85a0dc4933016b2394c35872b8fd1f51</id>
<content type='text'>
[ Upstream commit 19c9ea363a244f85f90a424f9936e6d56449e33c ]

pci_set_drvdata() is called only after registering the net_device,
therefore we could run into a NPE if one of the functions using
driver_data is called before it's set.

Fix this by calling pci_set_drvdata() before registering the
net_device.

This fix is a candidate for stable. As far as I can see the
bug has been there in kernel version 3.2 already, therefore
I can't provide a reference which commit is fixed by it.

The fix may need small adjustments per kernel version because
due to other changes the label which is jumped to if
register_netdev() fails has changed over time.

Reported-by: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>r8169: fix RTL8168EP take too long to complete driver initialization.</title>
<updated>2018-02-16T19:09:38Z</updated>
<author>
<name>Chunhao Lin</name>
</author>
<published>2018-01-30T17:32:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9a0ef3cc115962b73564615c8d70922f6f673d2a'/>
<id>urn:sha1:9a0ef3cc115962b73564615c8d70922f6f673d2a</id>
<content type='text'>
[ Upstream commit 086ca23d03c0d2f4088f472386778d293e15c5f6 ]

Driver check the wrong register bit in rtl_ocp_tx_cond() that keep driver
waiting until timeout.

Fix this by waiting for the right register bit.

Signed-off-by: Chunhao Lin &lt;hau@realtek.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
