<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/drivers/net/can/rx-offload.c, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2021-01-13T08:42:58+00:00</updated>
<entry>
<title>can: dev: move driver related infrastructure into separate subdir</title>
<updated>2021-01-13T08:42:58+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2021-01-11T14:19:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3e77f70e734584e0ad1038e459ed3fd2400f873a'/>
<id>urn:sha1:3e77f70e734584e0ad1038e459ed3fd2400f873a</id>
<content type='text'>
This patch moves the CAN driver related infrastructure into a separate subdir.
It will be split into more files in the coming patches.

Reviewed-by: Vincent Mailhol &lt;mailhol.vincent@wanadoo.fr&gt;
Link: https://lore.kernel.org/r/20210111141930.693847-3-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: rx-offload: can_rx_offload_offload_one(): avoid double unlikely() notation when using IS_ERR()</title>
<updated>2020-12-10T09:10:43+00:00</updated>
<author>
<name>Antonio Quartulli</name>
<email>a@unstable.cc</email>
</author>
<published>2020-12-10T08:53:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ecbaf5e13f45d8eebd3b772ba0032afcec1e519a'/>
<id>urn:sha1:ecbaf5e13f45d8eebd3b772ba0032afcec1e519a</id>
<content type='text'>
The definition of IS_ERR() already applies the unlikely() notation when
checking the error status of the passed pointer. For this reason there is no
need to have the same notation outside of IS_ERR() itself.

Clean up code by removing redundant notation.

Signed-off-by: Antonio Quartulli &lt;a@unstable.cc&gt;
Link: https://lore.kernel.org/r/20201210085321.18693-1-a@unstable.cc
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: replace can_dlc as variable/element for payload length</title>
<updated>2020-11-20T11:04:12+00:00</updated>
<author>
<name>Oliver Hartkopp</name>
<email>socketcan@hartkopp.net</email>
</author>
<published>2020-11-20T10:04:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c7b74967799b1af52b3045d69d4c26836b2d41de'/>
<id>urn:sha1:c7b74967799b1af52b3045d69d4c26836b2d41de</id>
<content type='text'>
The naming of can_dlc as element of struct can_frame and also as variable
name is misleading as it claims to be a 'data length CODE' but in reality
it always was a plain data length.

With the indroduction of a new 'len' element in struct can_frame we can now
remove can_dlc as name and make clear which of the former uses was a plain
length (-&gt; 'len') or a data length code (-&gt; 'dlc') value.

Signed-off-by: Oliver Hartkopp &lt;socketcan@hartkopp.net&gt;
Link: https://lore.kernel.org/r/20201120100444.3199-1-socketcan@hartkopp.net
[mkl: gs_usb: keep struct gs_host_frame::can_dlc as is]
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: rx-offload: don't call kfree_skb() from IRQ context</title>
<updated>2020-11-03T21:24:19+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2020-06-18T10:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2ddd6bfe7bdbb6c661835c3ff9cab8e0769940a6'/>
<id>urn:sha1:2ddd6bfe7bdbb6c661835c3ff9cab8e0769940a6</id>
<content type='text'>
A CAN driver, using the rx-offload infrastructure, is reading CAN frames
(usually in IRQ context) from the hardware and placing it into the rx-offload
queue to be delivered to the networking stack via NAPI.

In case the rx-offload queue is full, trying to add more skbs results in the
skbs being dropped using kfree_skb(). If done from hard-IRQ context this
results in the following warning:

[  682.552693] ------------[ cut here ]------------
[  682.557360] WARNING: CPU: 0 PID: 3057 at net/core/skbuff.c:650 skb_release_head_state+0x74/0x84
[  682.566075] Modules linked in: can_raw can coda_vpu flexcan dw_hdmi_ahb_audio v4l2_jpeg imx_vdoa can_dev
[  682.575597] CPU: 0 PID: 3057 Comm: cansend Tainted: G        W         5.7.0+ #18
[  682.583098] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[  682.589657] [&lt;c0112628&gt;] (unwind_backtrace) from [&lt;c010c1c4&gt;] (show_stack+0x10/0x14)
[  682.597423] [&lt;c010c1c4&gt;] (show_stack) from [&lt;c06c481c&gt;] (dump_stack+0xe0/0x114)
[  682.604759] [&lt;c06c481c&gt;] (dump_stack) from [&lt;c0128f10&gt;] (__warn+0xc0/0x10c)
[  682.611742] [&lt;c0128f10&gt;] (__warn) from [&lt;c0129314&gt;] (warn_slowpath_fmt+0x5c/0xc0)
[  682.619248] [&lt;c0129314&gt;] (warn_slowpath_fmt) from [&lt;c0b95dec&gt;] (skb_release_head_state+0x74/0x84)
[  682.628143] [&lt;c0b95dec&gt;] (skb_release_head_state) from [&lt;c0b95e08&gt;] (skb_release_all+0xc/0x24)
[  682.636774] [&lt;c0b95e08&gt;] (skb_release_all) from [&lt;c0b95eac&gt;] (kfree_skb+0x74/0x1c8)
[  682.644479] [&lt;c0b95eac&gt;] (kfree_skb) from [&lt;bf001d1c&gt;] (can_rx_offload_queue_sorted+0xe0/0xe8 [can_dev])
[  682.654051] [&lt;bf001d1c&gt;] (can_rx_offload_queue_sorted [can_dev]) from [&lt;bf001d6c&gt;] (can_rx_offload_get_echo_skb+0x48/0x94 [can_dev])
[  682.666007] [&lt;bf001d6c&gt;] (can_rx_offload_get_echo_skb [can_dev]) from [&lt;bf01efe4&gt;] (flexcan_irq+0x194/0x5dc [flexcan])
[  682.676734] [&lt;bf01efe4&gt;] (flexcan_irq [flexcan]) from [&lt;c019c1ec&gt;] (__handle_irq_event_percpu+0x4c/0x3ec)
[  682.686322] [&lt;c019c1ec&gt;] (__handle_irq_event_percpu) from [&lt;c019c5b8&gt;] (handle_irq_event_percpu+0x2c/0x88)
[  682.695993] [&lt;c019c5b8&gt;] (handle_irq_event_percpu) from [&lt;c019c64c&gt;] (handle_irq_event+0x38/0x5c)
[  682.704887] [&lt;c019c64c&gt;] (handle_irq_event) from [&lt;c01a1058&gt;] (handle_fasteoi_irq+0xc8/0x180)
[  682.713432] [&lt;c01a1058&gt;] (handle_fasteoi_irq) from [&lt;c019b2c0&gt;] (generic_handle_irq+0x30/0x44)
[  682.722063] [&lt;c019b2c0&gt;] (generic_handle_irq) from [&lt;c019b8f8&gt;] (__handle_domain_irq+0x64/0xdc)
[  682.730783] [&lt;c019b8f8&gt;] (__handle_domain_irq) from [&lt;c06df4a4&gt;] (gic_handle_irq+0x48/0x9c)
[  682.739158] [&lt;c06df4a4&gt;] (gic_handle_irq) from [&lt;c0100b30&gt;] (__irq_svc+0x70/0x98)
[  682.746656] Exception stack(0xe80e9dd8 to 0xe80e9e20)
[  682.751725] 9dc0:                                                       00000001 e80e8000
[  682.759922] 9de0: e820cf80 00000000 ffffe000 00000000 eaf08fe4 00000000 600d0013 00000000
[  682.768117] 9e00: c1732e3c c16093a8 e820d4c0 e80e9e28 c018a57c c018b870 600d0013 ffffffff
[  682.776315] [&lt;c0100b30&gt;] (__irq_svc) from [&lt;c018b870&gt;] (lock_acquire+0x108/0x4e8)
[  682.783821] [&lt;c018b870&gt;] (lock_acquire) from [&lt;c0e938e4&gt;] (down_write+0x48/0xa8)
[  682.791242] [&lt;c0e938e4&gt;] (down_write) from [&lt;c02818dc&gt;] (unlink_file_vma+0x24/0x40)
[  682.798922] [&lt;c02818dc&gt;] (unlink_file_vma) from [&lt;c027a258&gt;] (free_pgtables+0x34/0xb8)
[  682.806858] [&lt;c027a258&gt;] (free_pgtables) from [&lt;c02835a4&gt;] (exit_mmap+0xe4/0x170)
[  682.814361] [&lt;c02835a4&gt;] (exit_mmap) from [&lt;c01248e0&gt;] (mmput+0x5c/0x110)
[  682.821171] [&lt;c01248e0&gt;] (mmput) from [&lt;c012e910&gt;] (do_exit+0x374/0xbe4)
[  682.827892] [&lt;c012e910&gt;] (do_exit) from [&lt;c0130888&gt;] (do_group_exit+0x38/0xb4)
[  682.835132] [&lt;c0130888&gt;] (do_group_exit) from [&lt;c0130914&gt;] (__wake_up_parent+0x0/0x14)
[  682.843063] irq event stamp: 1936
[  682.846399] hardirqs last  enabled at (1935): [&lt;c02938b0&gt;] rmqueue+0xf4/0xc64
[  682.853553] hardirqs last disabled at (1936): [&lt;c0100b20&gt;] __irq_svc+0x60/0x98
[  682.860799] softirqs last  enabled at (1878): [&lt;bf04cdcc&gt;] raw_release+0x108/0x1f0 [can_raw]
[  682.869256] softirqs last disabled at (1876): [&lt;c0b8f478&gt;] release_sock+0x18/0x98
[  682.876753] ---[ end trace 7bca4751ce44c444 ]---

This patch fixes the problem by replacing the kfree_skb() by
dev_kfree_skb_any(), as rx-offload might be called from threaded IRQ handlers
as well.

Fixes: ca913f1ac024 ("can: rx-offload: can_rx_offload_queue_sorted(): fix error handling, avoid skb mem leak")
Fixes: 6caf8a6d6586 ("can: rx-offload: can_rx_offload_queue_tail(): fix error handling, avoid skb mem leak")
Link: http://lore.kernel.org/r/20201019190524.1285319-3-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: rx-offload: can_rx_offload_add_manual(): add new initialization function</title>
<updated>2020-09-21T08:13:19+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2020-09-15T22:35:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=728fc9ff73d3f25220f6b8a52aaf063ec51ef294'/>
<id>urn:sha1:728fc9ff73d3f25220f6b8a52aaf063ec51ef294</id>
<content type='text'>
This patch adds a new initialization function:
can_rx_offload_add_manual()

It should be used to add support rx-offload to a driver, if the callback
mechanism should not be used. Use e.g. can_rx_offload_queue_sorted() to queue
skbs into rx-offload.

Link: https://lore.kernel.org/r/20200915223527.1417033-33-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: rx-offload: Prepare for CAN FD support</title>
<updated>2019-11-11T20:58:10+00:00</updated>
<author>
<name>Joakim Zhang</name>
<email>qiangqing.zhang@nxp.com</email>
</author>
<published>2019-07-12T08:02:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4e9c9484b085dbba60b299182dd490eaeb84d18a'/>
<id>urn:sha1:4e9c9484b085dbba60b299182dd490eaeb84d18a</id>
<content type='text'>
The skbs for classic CAN and CAN FD frames are allocated with seperate
functions: alloc_can_skb() and alloc_canfd_skb().

In order to support CAN FD frames via the rx-offload helper, the driver
itself has to allocate the skb (depending whether it received a classic
CAN or CAN FD frame), as the rx-offload helper cannot know which kind of
CAN frame the driver has received.

This patch moves the allocation of the skb into the struct
can_rx_offload::mailbox_read callbacks of the the flexcan and ti_hecc
driver and adjusts the rx-offload helper accordingly.

Signed-off-by: Joakim Zhang &lt;qiangqing.zhang@nxp.com&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: rx-offload: can_rx_offload_reset(): remove no-op function</title>
<updated>2019-11-11T20:58:10+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2019-10-07T11:36:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=61d2350615c2c42f7af65d9a575f5dbf9738a10e'/>
<id>urn:sha1:61d2350615c2c42f7af65d9a575f5dbf9738a10e</id>
<content type='text'>
This patch removes the function can_rx_offload_reset(), as it does
nothing. If we ever need this function, add it back again.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: rx-offload: can_rx_offload_irq_offload_timestamp(): don't use assignment in if condition</title>
<updated>2019-11-11T20:58:10+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2019-10-07T08:00:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f1242cd981e36385169281bf7b978e2bfa942eb5'/>
<id>urn:sha1:f1242cd981e36385169281bf7b978e2bfa942eb5</id>
<content type='text'>
This patch moves the assignment of queue_len out of the if condition.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: rx-offload: can_rx_offload_compare(): fix typo</title>
<updated>2019-11-11T20:58:10+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2019-10-07T08:00:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a7b70e2d62d86fcb3f665d325dbc6f0303ee3c51'/>
<id>urn:sha1:a7b70e2d62d86fcb3f665d325dbc6f0303ee3c51</id>
<content type='text'>
This patch fixes a typo found by checkpatch.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>can: rx-offload: fix long lines</title>
<updated>2019-11-11T20:58:10+00:00</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2019-10-07T07:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=54dd0b8904ac4c70df7616d39b80390835fede80'/>
<id>urn:sha1:54dd0b8904ac4c70df7616d39b80390835fede80</id>
<content type='text'>
This patch fixes the checkpatch warnings about too long lines.

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
</feed>
