Re: [patch 1/1] genirq: Disable interrupts for force threaded handlers

2021-03-18 Thread Sebastian Andrzej Siewior
On 2021-03-17 17:23:39 [+0100], Johan Hovold wrote: > > > thread(irq_A) > > > irq_handler(A) > > > spin_lock(&foo->lock); > > > > > > interrupt(irq_B) > > > irq_handler(B) > > > spin_lock(&foo->lock); > > > > It will not because both threads will wake_up(thread). > > Note that the ab

Re: [patch 1/1] genirq: Disable interrupts for force threaded handlers

2021-03-17 Thread Sebastian Andrzej Siewior
; For not RT this is not changing much, except that during the execution of > the threaded handler interrupts are delayed until the handler > returns. Vs. scheduling and softirq processing there is no difference. > > For RT kernels there is no issue. Acked-by: Sebastian Andrzej Siewio

Re: [patch 07/14] tasklets: Prevent tasklet_unlock_spin_wait() deadlock on RT

2021-03-09 Thread Sebastian Andrzej Siewior
On 2021-03-09 16:00:37 [+0100], To Thomas Gleixner wrote: > diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h > index 07c7329d21aa7..1c14ccd351091 100644 > --- a/include/linux/interrupt.h > +++ b/include/linux/interrupt.h > @@ -663,15 +663,6 @@ static inline int tasklet_trylock(str

Re: [patch 07/14] tasklets: Prevent tasklet_unlock_spin_wait() deadlock on RT

2021-03-09 Thread Sebastian Andrzej Siewior
On 2021-03-09 09:42:10 [+0100], Thomas Gleixner wrote: > tasklet_unlock_spin_wait() spin waits for the TASKLET_STATE_SCHED bit in > the tasklet state to be cleared. This works on !RT nicely because the … Could you please fold this: diff --git a/include/linux/interrupt.h b/include/linux/interrupt.

[PATCH] kcov: Remove kcov include from sched.h and move it to its users.

2021-02-18 Thread Sebastian Andrzej Siewior
the kconv header file. Move the include of the kconv.h header from sched.h it its users. Additionally include sched.h from kconv.h to ensure that everything task_struct related is available. Signed-off-by: Sebastian Andrzej Siewior --- include/linux/kcov.h | 1 + include/linux/sched.h | 1

[PATCH net-next] net: caif: Use netif_rx_any_context().

2021-02-13 Thread Sebastian Andrzej Siewior
this driver and because the call chains are hard to follow. As a stop gap use netif_rx_any_context() which invokes the correct code path depending on context and confines the in_interrupt() usage to core code. Signed-off-by: Sebastian Andrzej Siewior --- net/caif/chnl_net.c | 5 + 1 file

Re: [PATCH 0/2] chelsio: cxgb: Use threaded interrupts for deferred work

2021-02-03 Thread Sebastian Andrzej Siewior
On 2021-02-02 17:31:23 [-0800], Jesse Brandeburg wrote: > Sebastian Andrzej Siewior wrote: > > > Patch #2 fixes an issue in which del_timer_sync() and tasklet_kill() is > > invoked from the interrupt handler. This is probably a rare error case > > since it disables inter

[PATCH 0/2] chelsio: cxgb: Use threaded interrupts for deferred work

2021-02-02 Thread Sebastian Andrzej Siewior
Patch #2 fixes an issue in which del_timer_sync() and tasklet_kill() is invoked from the interrupt handler. This is probably a rare error case since it disables interrupts / the card in that case. Patch #1 converts a worker to use a threaded interrupt which is then also used in patch #2 instead add

[PATCH 1/2] chelsio: cxgb: Replace the workqueue with threaded interrupt

2021-02-02 Thread Sebastian Andrzej Siewior
F_PL_INTR_EXT as interrupt source like it is used before the worker is scheduled. Enable the interrupt again once t1_elmer0_ext_intr_handler() is done. Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/chelsio/cxgb/common.h | 5 +-- drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 44

[PATCH 2/2] chelsio: cxgb: Disable the card on error in threaded interrupt

2021-02-02 Thread Sebastian Andrzej Siewior
. In case of a fatal error, use t1_interrupts_disable() to disable all interrupt sources and then wake the interrupt thread with F_PL_INTR_SGE_ERR as pending flag. The threaded-interrupt will stop the card via t1_sge_stop() and not re-enable the interrupts again. Signed-off-by: Sebastian Andrzej

[PATCH] net: arcnet: Fix RESET flag handling

2021-01-28 Thread Sebastian Andrzej Siewior
en() and arcnet_close() accordingly. Check drivers/net/arcnet/com20020.c. Run the device RESET sequence from a scheduled workqueue instead. Signed-off-by: Ahmed S. Darwish Signed-off-by: Sebastian Andrzej Siewior --- Repost as non-RFC. No hardware around, just review. drivers/net/arcnet/arc-r

Re: [PATCH] rtlwifi: Assign boolean values to a bool variable

2021-01-20 Thread Sebastian Andrzej Siewior
On 2021-01-20 15:27:08 [+0800], Jiapeng Zhong wrote: > diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c > b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c > index be4c0e6..c198222 100644 > --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c

[PATCH 2/3] atm: nicstar: Replace in_interrupt() usage

2020-11-16 Thread Sebastian Andrzej Siewior
illiams <3ch...@gmail.com> CC: Jakub Kicinski Signed-off-by: Sebastian Andrzej Siewior --- drivers/atm/nicstar.c | 24 ++-- include/linux/atmdev.h | 1 + net/atm/raw.c | 12 ++-- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/drivers/atm/n

[PATCH 3/3] atm: lanai: Remove in_interrupt() usage

2020-11-16 Thread Sebastian Andrzej Siewior
which will trigger a warning if used in bad context. Remove in_interrupt(). Cc: Chas Williams <3ch...@gmail.com> Cc: netdev@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- drivers/atm/lanai.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/atm/lan

[PATCH 0/3] atm: Replace in_interrupt usage

2020-11-16 Thread Sebastian Andrzej Siewior
Folks, this mini series contains the removal of in_interrupt() in drivers/atm and a tiny bugfix while staring into code. Sebastian

[PATCH 1/3] atm: nicstar: Unmap DMA on send error

2020-11-16 Thread Sebastian Andrzej Siewior
ve virt_to_bus() and support 64-bit platforms") Cc: Chas Williams <3ch...@gmail.com> Signed-off-by: Sebastian Andrzej Siewior --- drivers/atm/nicstar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 7af74fb450a0d..09ad733

[PATCH v2 net-next 1/3] soc/fsl/qbman: Add an argument to signal if NAPI processing is required.

2020-11-01 Thread Sebastian Andrzej Siewior
he value to the caller including `qman_cb_dqrr' typedef which is used by the dpaa and the crypto driver. Signed-off-by: Sebastian Andrzej Siewior Cc: "Horia Geantă" Cc: Aymen Sghaier Cc: Herbert XS Cc: "David S. Miller" Cc: Madalin Bucur Cc: Jakub Kicinski

[PATCH v2 net-next 2/3] net: dpaa: Replace in_irq() usage.

2020-11-01 Thread Sebastian Andrzej Siewior
conveyed in an argument passed by the caller, which usually knows the context. Use the `sched_napi' argument passed by the callback. It is set true if called from the interrupt handler and NAPI should be scheduled. Signed-off-by: Sebastian Andrzej Siewior Cc: "Horia Geantă" Cc: Ay

[PATCH v2 net-next 0/3] fsl/qbman: in_interrupt() cleanup.

2020-11-01 Thread Sebastian Andrzej Siewior
This is the in_interrupt() clean for FSL DPAA framework and the two users. The `napi' parameter has been renamed to `sched_napi', the other parts are same as in the previous post [0]. [0] https://lkml.kernel.org/r/20201027225454.3492351-1-bige...@linutronix.de Sebastian

[PATCH v2 net-next 3/3] crypto: caam: Replace in_irq() usage.

2020-11-01 Thread Sebastian Andrzej Siewior
conveyed in an argument passed by the caller, which usually knows the context. Use the `sched_napi' argument passed by the callback. It is set true if called from the interrupt handler and NAPI should be scheduled. Signed-off-by: Sebastian Andrzej Siewior Cc: "Horia Geantă" Cc: Ay

Re: [PATCH net-next 14/15] net: dpaa: Replace in_irq() usage.

2020-11-01 Thread Sebastian Andrzej Siewior
On 2020-10-31 10:12:15 [-0700], Jakub Kicinski wrote: > Nit: some networking drivers have a bool napi which means "are we > running in napi context", the semantics here feel a little backwards, > at least to me. But if I'm the only one thinking this, so be it. I renamed it to `sched_napi'. Sebast

[PATCH net-next 04/15] net: mlx5: Replace in_irq() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
Andrzej Siewior Cc: Saeed Mahameed Cc: Leon Romanovsky Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-r...@vger.kernel.org --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mel

[PATCH net-next 14/15] net: dpaa: Replace in_irq() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
conveyed in an argument passed by the caller, which usually knows the context. Use the `napi' argument passed by the callback. It is set true if called from the interrupt handler and NAPI should be scheduled. Signed-off-by: Sebastian Andrzej Siewior Cc: "Horia Geantă" Cc: Aymen Sghaier

[PATCH net-next 10/15] net: zd1211rw: Remove in_atomic() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
Andrzej Siewior Cc: Daniel Drake Cc: Ulrich Kunitz Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wirel...@vger.kernel.org Cc: netdev@vger.kernel.org --- drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 15 --- 1 file changed, 15 deletions(-) diff --git

[PATCH net-next 12/15] net: rtlwifi: Remove in_interrupt() usage in halbtc_send_bt_mp_operation()

2020-10-27 Thread Sebastian Andrzej Siewior
t_coex_supported_feature() None of these have a caller. Welcome to the wonderful world of HALs and onion layers. Remove in_interrupt() check. Signed-off-by: Sebastian Andrzej Siewior Cc: Ping-Ke Shih Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wirel...@vger.ker

[PATCH net-next 11/15] net: rtlwifi: Remove in_interrupt() usage in is_any_client_connect_to_ap().

2020-10-27 Thread Sebastian Andrzej Siewior
code further use list_empty() instead of walking the list and counting the entries just to check the count for > 0 at the end. Signed-off-by: Sebastian Andrzej Siewior Cc: Ping-Ke Shih Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wirel...@vger.kernel.o

[PATCH net-next 15/15] crypto: caam: Replace in_irq() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
conveyed in an argument passed by the caller, which usually knows the context. Use the `napi' argument passed by the callback. It is set true if called from the interrupt handler and NAPI should be scheduled. Signed-off-by: Sebastian Andrzej Siewior Cc: "Horia Geantă" Cc: Aymen Sghaier

[PATCH net-next 13/15] soc/fsl/qbman: Add an argument to signal if NAPI processing is required.

2020-10-27 Thread Sebastian Andrzej Siewior
he value to the caller including `qman_cb_dqrr' typedef which is used by the dpaa and the crypto driver. Signed-off-by: Sebastian Andrzej Siewior Cc: "Horia Geantă" Cc: Aymen Sghaier Cc: Herbert Xu Cc: "David S. Miller" Cc: Madalin Bucur Cc: Jakub Kicinski

[PATCH net-next 06/15] net: airo: Invoke airo_read_wireless_stats() directly

2020-10-27 Thread Sebastian Andrzej Siewior
y. Invoke airo_read_wireless_stats() directly from the callback and remove the now unused JOB_WSTATS handling. Signed-off-by: Sebastian Andrzej Siewior Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wirel...@vger.kernel.org Cc: netdev@vger.kernel.org --- driver

[PATCH net-next 09/15] net: hostap: Remove in_atomic() check.

2020-10-27 Thread Sebastian Andrzej Siewior
Sebastian Andrzej Siewior Cc: Jouni Malinen Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wirel...@vger.kernel.org Cc: netdev@vger.kernel.org --- drivers/net/wireless/intersil/hostap/hostap_ioctl.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-)

[PATCH net-next 08/15] net: airo: Replace in_atomic() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
x27;s pointless to invoke schedule() if there is no request to reschedule. Pass the may_sleep condition through the various call chains leading to issuecommand(). Signed-off-by: Sebastian Andrzej Siewior Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wirel...@vge

[PATCH net-next 07/15] net: airo: Always use JOB_STATS and JOB_EVENT

2020-10-27 Thread Sebastian Andrzej Siewior
context through a quite large amount of functions. As this is ancient hardware, avoid the churn and enforce the invocation of those functions through the JOB machinery. Signed-off-by: Sebastian Andrzej Siewior Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: l

[PATCH net-next 00/15] in_interrupt() cleanup, part 2

2020-10-27 Thread Sebastian Andrzej Siewior
Folks, in the discussion about preempt count consistency across kernel configurations: https://lore.kernel.org/r/20200914204209.256266...@linutronix.de/ Linus clearly requested that code in drivers and libraries which changes behaviour based on execution context should either be split up so th

[PATCH net-next 01/15] net: orinoco: Remove BUG_ON(in_interrupt/irq())

2020-10-27 Thread Sebastian Andrzej Siewior
n the invoked functions (always enabled or debug option dependent) cover these conditions already, so the BUG_ON()'s do not really provide additional value. Just remove them. Signed-off-by: Sebastian Andrzej Siewior Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicin

[PATCH net-next 05/15] net: tlan: Replace in_irq() usage

2020-10-27 Thread Sebastian Andrzej Siewior
(), tlan_mii_write_reg() and tlan_phy_print() are invoked from interrupt and other contexts. Split out the actual function body into helper variants which are called from interrupt context and make the original functions wrappers which acquire tlan_priv::lock unconditionally. Signed-off-by: Sebastian Andrzej Siewior

[PATCH net-next 03/15] net: forcedeth: Replace context and lock check with a lockdep_assert()

2020-10-27 Thread Sebastian Andrzej Siewior
replace the warning and the lock assert with lockdep_assert_held(). Signed-off-by: Sebastian Andrzej Siewior Cc: Rain River Cc: Zhu Yanjun Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org --- drivers/net/ethernet/nvidia/forcedeth.c | 6 +- 1 file changed, 1

[PATCH net-next 02/15] net: neterion: s2io: Replace in_interrupt() for context detection

2020-10-27 Thread Sebastian Andrzej Siewior
et_rx_mode() s2io_set_multicast() s2io_txpic_intr_handle() s2io_link() init_tti() Add a may_sleep argument to wait_for_cmd_complete(), s2io_set_multicast() and init_tti() and hand the context information in from the call sites. Signed-off-by: Sebastian Andrzej Siewior Cc: Jon

Re: [PATCH net v2] net: openvswitch: fix to make sure flow_lookup() is not preempted

2020-10-15 Thread Sebastian Andrzej Siewior
On 2020-10-15 11:46:53 [+0200], Eelco Chaudron wrote: > The flow_lookup() function uses per CPU variables, which must not be > preempted. However, this is fine in the general napi use case where > the local BH is disabled. But, it's also called in the netlink > context, which is preemptible. The be

Re: [PATCH net-next] net: openvswitch: fix to make sure flow_lookup() is not preempted

2020-10-15 Thread Sebastian Andrzej Siewior
On 2020-10-15 10:11:31 [+0200], Eelco Chaudron wrote: > Thanks for your reply! Yes I had it replaced with local_bh_disable() in my > v2, as I noticed the hard IRQ to softirq part earlier. Okay. Resend the complete thing once you ready and I take a look. > Thanks, > > Eelco Sebastian

Re: [PATCH net-next] net: openvswitch: fix to make sure flow_lookup() is not preempted

2020-10-15 Thread Sebastian Andrzej Siewior
On 2020-10-14 12:44:23 [+0200], Eelco Chaudron wrote: > Let me know your thoughts. better. If your seccount is per-CPU then you get away without explicit writer locking if you rely on global per-CPU locking. You can't do preempt_disable() because this section can be interrupt by softirq. You need

Re: [PATCH net-next] net: openvswitch: fix to make sure flow_lookup() is not preempted

2020-10-13 Thread Sebastian Andrzej Siewior
On 2020-10-13 14:44:19 [+0200], Eelco Chaudron wrote: > The flow_lookup() function uses per CPU variables, which must not be > preempted. However, this is fine in the general napi use case where > the local BH is disabled. But, it's also called in the netlink > context, which is preemptible. The be

Re: [RFC] Status of orinoco_usb

2020-10-02 Thread Sebastian Andrzej Siewior
On 2020-10-02 13:37:25 [+0200], Greg Kroah-Hartman wrote: > > Is it possible to end up here in softirq context or is this a relic? > > I think it's a relic of where USB host controllers completed their urbs > in hard-irq mode. The BH/tasklet change is a pretty recent change. But the BH thingy fo

[RFC] Status of orinoco_usb

2020-10-02 Thread Sebastian Andrzej Siewior
I was trying to get rid of the in in_softirq() in ezusb_req_ctx_wait() within the orinoco usb driver, drivers/net/wireless/intersil/orinoco/orinoco_usb.c. A small snippet: | static void ezusb_req_ctx_wait(struct ezusb_priv *upriv, |struct request_context *ctx) … |

[PATCH NET] net: atlantic: Use readx_poll_timeout() for large timeout

2020-08-18 Thread Sebastian Andrzej Siewior
ode, the context appears to be preemptible so using usleep() should work and avoid busy spinning. Use readx_poll_timeout() in the poll loop. Cc: Mark Starovoytov Cc: Igor Russkikh Signed-off-by: Sebastian Andrzej Siewior --- Could someone with hardware please verify it? It compiles, yes. driv

Re: [PATCH net-next 2/2] enetc: use napi_schedule to be compatible with PREEMPT_RT

2020-08-12 Thread Sebastian Andrzej Siewior
On 2020-08-12 17:34:30 [+0300], Vladimir Oltean wrote: > I expect the driver maintainers to have something to say about this. I > didn't test on stable kernels, and at least for dpaa2-eth, the change > would need to go pretty deep down the stable line. Yes, each affected and maintained stable kern

Re: [PATCH net-next 2/2] enetc: use napi_schedule to be compatible with PREEMPT_RT

2020-08-12 Thread Sebastian Andrzej Siewior
On 2020-08-03 18:21:45 [-0700], David Miller wrote: > From: Vladimir Oltean > > The driver calls napi_schedule_irqoff() from a context where, in RT, > > hardirqs are not disabled, since the IRQ handler is force-threaded. … > > > > Signed-off-by: Jiafei Pan > > Signed-off-by: Vladimir Oltean >

[PATCH net] net/mlx5e: Do not include rwlock.h directly

2020-07-03 Thread Sebastian Andrzej Siewior
rwlock.h should not be included directly. Instead linux/splinlock.h should be included. Including it directly will break the RT build. Fixes: 549c243e4e010 ("net/mlx5e: Extract neigh-specific code from en_rep.c to rep/neigh.c") Signed-off-by: Sebastian Andrzej Siewior --- It would

[PATCH v3 5/7] connector/cn_proc: Protect send_msg() with a local lock

2020-05-27 Thread Sebastian Andrzej Siewior
f-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- drivers/connector/cn_proc.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index d58ce664da843..646ad385e4904 100644 --- a/drivers

Re: [PATCH v2 5/7] connector/cn_proc: Protect send_msg() with a local lock

2020-05-25 Thread Sebastian Andrzej Siewior
On 2020-05-25 09:18:19 [+0200], Ingo Molnar wrote: > > +static DEFINE_PER_CPU(struct local_evt, local_evt) = { > > + .counts = 0, > > I don't think zero initializations need to be written out explicitly. yes. > > + .lock = INIT_LOCAL_LOCK(lock), > > +}; > > > > static inline void send_msg(

[PATCH v2 5/7] connector/cn_proc: Protect send_msg() with a local lock

2020-05-24 Thread Sebastian Andrzej Siewior
f-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- drivers/connector/cn_proc.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index d58ce664da843..d424d1f469136 100644 --- a/drivers

[PATCH 6/8] connector/cn_proc: Protect send_msg() with a local lock

2020-05-19 Thread Sebastian Andrzej Siewior
f-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior --- drivers/connector/cn_proc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index d58ce664da843..055b0c86a0693 100644 --- a/drivers/connector/cn_pr

Re: [PATCH][next] rtw88: fix spelling mistake "fimrware" -> "firmware"

2020-04-30 Thread Sebastian Andrzej Siewior
On 2020-04-24 09:47:33 [+0100], Colin King wrote: > From: Colin Ian King > > There are spelling mistakes in two rtw_err error messages. Fix them. > > Signed-off-by: Colin Ian King Acked-by: Sebastian Andrzej Siewior Sebastian

Re: [PATCH net-next v2] net: sched: Avoid using yield() in a busy waiting loop

2019-10-16 Thread Sebastian Andrzej Siewior
On 2019-10-16 10:28:04 [-0700], Cong Wang wrote: > > Link: > > https://lkml.kernel.org/r/1393976987-23555-1-git-send-email-...@pengutronix.de > > BTW, this link doesn't work, 404 is returned. here it returns 200: |$ wget https://lkml.kernel.org/r/1393976987-23555-1-git-send-email-...@pengutron

[PATCH net-next v2] net: sched: Avoid using yield() in a busy waiting loop

2019-10-16 Thread Sebastian Andrzej Siewior
: Rewrite commit message, add comment, use schedule_timeout_uninterruptible()] Signed-off-by: Sebastian Andrzej Siewior --- v1…v2: Typo fixes, noticed by Sergei Shtylyov. net/sched/sch_generic.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/sched

[PATCH net-next] net: sched: Avoid using yield() in a busy waiting loop

2019-10-11 Thread Sebastian Andrzej Siewior
[bigeasy: Rewrite commit message, add comment, use schedule_timeout_uninterruptible()] Signed-off-by: Sebastian Andrzej Siewior --- The old thread also pointed anoth yield() loop which was resolved by commit 845704a535e9b ("tcp: avoid looping in tcp_send_fin()")

[PATCH net-next] net/mvpp2: Replace tasklet with softirq hrtimer

2019-08-13 Thread Sebastian Andrzej Siewior
From: Thomas Gleixner The tx_done_tasklet tasklet is used in invoke the hrtimer (mvpp2_hr_timer_cb) in softirq context. This can be also achieved without the tasklet but with HRTIMER_MODE_SOFT as hrtimer mode. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior

[PATCH v2 net-next 6/7] tg3: Use napi_alloc_frag()

2019-06-07 Thread Sebastian Andrzej Siewior
ned-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/broadcom/tg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 6d1f9c822548e..4c404d2213f98 100644 --- a/drivers/net/ethernet/broadcom/tg

[PATCH v2 net-next 4/7] dpaa2-eth: Use napi_alloc_frag()

2019-06-07 Thread Sebastian Andrzej Siewior
ian Andrzej Siewior --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index bcd3ceb5f9dc4..becce4e89ea3b 100644 --- a/drivers/

[PATCH v2 net-next 3/7] dpaa2-eth: Remove preempt_disable() from seed_pool()

2019-06-07 Thread Sebastian Andrzej Siewior
d the no longer required preempt_disable(). Cc: Ioana Radulescu Acked-by: Ioana Radulescu Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

[PATCH v2 net-next 2/7] net: Don't disable interrupts in __netdev_alloc_skb()

2019-06-07 Thread Sebastian Andrzej Siewior
alloc_cache.page'. The IRQ check is cheaper compared to disabling & enabling interrupts and memory allocation with disabled interrupts does not work on -RT. Signed-off-by: Sebastian Andrzej Siewior --- net/core/skbuff.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(

[PATCH v2 net-next 7/7] net: hwbm: Make the hwbm_pool lock a mutex

2019-06-07 Thread Sebastian Andrzej Siewior
longer invokes hwbm_pool_refill() in an atomic context so we can pass GFP_KERNEL to hwbm_pool_refill() and remove the `gfp' argument from hwbm_pool_add(). Cc: Thomas Petazzoni Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/marvell/mvneta.c| 2 +- drivers/net/ethernet/

[PATCH v2 net-next 1/7] net: Don't disable interrupts in napi_alloc_frag()

2019-06-07 Thread Sebastian Andrzej Siewior
c_frag() for the allocation. The IRQ check is cheaper compared to disabling & enabling interrupts and memory allocation with disabled interrupts does not work on -RT. Signed-off-by: Sebastian Andrzej Siewior --- net/core/skbuff.c | 53 ++- 1 file ch

[PATCH v2 net-next 5/7] bnx2x: Use napi_alloc_frag()

2019-06-07 Thread Sebastian Andrzej Siewior
...@marvell.com Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 008ad0ca89ba0

[PATCH v2 net-next 0/7] Avoid local_irq_save() and use napi_alloc_frag() where possible

2019-06-07 Thread Sebastian Andrzej Siewior
The first two patches remove local_irq_save() around `netdev_alloc_cache' which does not work on -RT. Besides helping -RT it whould benefit the users of the function since they can avoid disabling interrupts and save a few cycles. The remaining patches are from a time when I tried to remove `netdev

Re: [PATCH net-next 1/7] net: Don't disable interrupts in napi_alloc_frag()

2019-05-31 Thread Sebastian Andrzej Siewior
On 2019-05-29 15:48:51 [-0700], Eric Dumazet wrote: > > + > > + fragsz = SKB_DATA_ALIGN(fragsz); > > + if (irqs_disabled()) { > > > What is the difference between this prior test, and the following ? > > if (in_irq() || irqs_disabled()) > > I am asking because I see the latter being used in

[PATCH net-next 5/7] bnx2x: Use napi_alloc_frag()

2019-05-29 Thread Sebastian Andrzej Siewior
...@marvell.com Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 008ad0ca89ba0

[PATCH net-next 0/7] Avoid local_irq_save() and use napi_alloc_frag() where possible

2019-05-29 Thread Sebastian Andrzej Siewior
The first two patches remove local_irq_save() around `netdev_alloc_cache' which does not work on -RT. Besides helping -RT it whould benefit the users of the function since they can avoid disabling interrupts and save a few cycles. The remaining patches are from a time when I tried to remove `netdev

[PATCH net-next 3/7] dpaa2-eth: Remove preempt_disable() from seed_pool()

2019-05-29 Thread Sebastian Andrzej Siewior
d the no longer required preempt_disable(). Cc: Ioana Radulescu Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freesc

[PATCH net-next 1/7] net: Don't disable interrupts in napi_alloc_frag()

2019-05-29 Thread Sebastian Andrzej Siewior
c_frag() for the allocation. The IRQ check is cheaper compared to disabling & enabling interrupts and memory allocation with disabled interrupts does not work on -RT. Signed-off-by: Sebastian Andrzej Siewior --- net/core/skbuff.c | 53 ++- 1 file ch

[PATCH net-next 6/7] tg3: Use napi_alloc_frag()

2019-05-29 Thread Sebastian Andrzej Siewior
han Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/broadcom/tg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 6d1f9c822548e..4c404d2213f98 100644 --- a/drivers/net/ether

[PATCH net-next 4/7] dpaa2-eth: Use napi_alloc_frag()

2019-05-29 Thread Sebastian Andrzej Siewior
The driver is using netdev_alloc_frag() for allocation in the ->ndo_start_xmit() path. That one is always invoked in a BH disabled region so we could also use napi_alloc_frag(). Use napi_alloc_frag() for skb allocation. Cc: Ioana Radulescu Signed-off-by: Sebastian Andrzej Siewior --- driv

[PATCH net-next 7/7] net: hwbm: Make the hwbm_pool lock a mutex

2019-05-29 Thread Sebastian Andrzej Siewior
longer invokes hwbm_pool_refill() in an atomic context so we can pass GFP_KERNEL to hwbm_pool_refill() and remove the `gfp' argument from hwbm_pool_add(). Cc: Thomas Petazzoni Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/marvell/mvneta.c| 2 +- drivers/net/ethernet/

[PATCH net-next 2/7] net: Don't disable interrupts in __netdev_alloc_skb()

2019-05-29 Thread Sebastian Andrzej Siewior
alloc_cache.page'. The IRQ check is cheaper compared to disabling & enabling interrupts and memory allocation with disabled interrupts does not work on -RT. Signed-off-by: Sebastian Andrzej Siewior --- net/core/skbuff.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(

Re: Remove tasklet_hrtimer

2019-03-20 Thread Sebastian Andrzej Siewior
On 2019-03-20 10:45:41 [-0700], David Miller wrote: > > tglx can take them, feel free to add my: > > Acked-by: David S. Miller Thank you. Sebastian

Re: Remove tasklet_hrtimer

2019-03-20 Thread Sebastian Andrzej Siewior
On 2019-03-01 23:48:18 [+0100], To netdev@vger.kernel.org wrote: > I just noticed that we still have the tasklet_hrtimer infastructure in tree. A > while ago we tried to remove it. > I digged the old patches up and it seems they did not apply and nobody > followed > up. So here they are again. Las

[PATCH 1/3] mac80211_hwsim: Replace hrtimer tasklet with softirq hrtimer

2019-03-01 Thread Sebastian Andrzej Siewior
Berg Cc: Kalle Valo Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/wireless/mac80211_hwsim.c | 46 --- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index

[PATCH 2/3] xfrm: Replace hrtimer tasklet with softirq hrtimer

2019-03-01 Thread Sebastian Andrzej Siewior
vid S. Miller" Signed-off-by: Sebastian Andrzej Siewior --- include/net/xfrm.h| 2 +- net/xfrm/xfrm_state.c | 30 ++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 85386becbaea2..bbcf0b650b81e 10

Remove tasklet_hrtimer

2019-03-01 Thread Sebastian Andrzej Siewior
I just noticed that we still have the tasklet_hrtimer infastructure in tree. A while ago we tried to remove it. I digged the old patches up and it seems they did not apply and nobody followed up. So here they are again. Last two user. Sebastian

[PATCH 3/3] softirq: Remove tasklet_hrtimer

2019-03-01 Thread Sebastian Andrzej Siewior
From: Thomas Gleixner There are no more tasklet_hrtimer users of this interface. Remove it. Signed-off-by: Thomas Gleixner Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/interrupt.h | 25 --- kernel/softirq.c | 51

[PATCH net v3] net: dp83640: expire old TX-skb

2019-02-04 Thread Sebastian Andrzej Siewior
iconductor PHYTER.") Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Kurt Kanzenbach Acked-by: Richard Cochran --- v2…v3: - added a Fixes: tag, Richard's Acked-by and `net' after PATCH. RFC … v2: - reverse xmas tree - stable tag drivers/net/phy/dp836

[PATCH v2] net: dp83640: expire old TX-skb

2019-02-01 Thread Sebastian Andrzej Siewior
inuxptp/ptp4l usually closes the socket and opens a new one (in such a timeout case) so those "stale" replies never get there. However it does not resume normal operation anymore. Purge old skbs in decode_txts(). Cc: sta...@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Revie

Re: [RFC] net: dp83640: expire old TX-skb

2019-02-01 Thread Sebastian Andrzej Siewior
On 2019-01-30 20:26:06 [-0800], Richard Cochran wrote: > Thanks for the detailed explanation. This sounds like a really rare > bug, but maybe you guys were able to trigger it reliably? More or less reliably, yes. I had two switches (for the uplink of the PHY) and a third for my regular network du

[RFC] net: dp83640: expire old TX-skb

2019-01-28 Thread Sebastian Andrzej Siewior
inuxptp/ptp4l usually closes the socket and opens a new one (in such a timeout case) so those "stale" replies never get there. However it does not resume normal operation anymore. Purge old skbs in decode_txts(). Reviewed-by: Kurt Kanzenbach Signed-off-by: Sebastian Andrzej Siewio

Re: [PATCH v2] USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data

2018-12-10 Thread Sebastian Andrzej Siewior
d update hso_probe to bail on error. > This issue has been assigned CVE-2018-19985. > > Reported-by: Hui Peng > Reported-by: Mathias Payer > Signed-off-by: Hui Peng > Signed-off-by: Mathias Payer > Signed-off-by: Greg Kroah-Hartman Reviewed-by: Sebastian Andrzej Siewior Sebastian

Re: WARN_ON() in netconsole with PREEMPT_RT

2018-11-30 Thread Sebastian Andrzej Siewior
On 2018-11-11 21:01:05 [-0500], Steven Rostedt wrote: > On Sun, 11 Nov 2018 21:16:00 +0100 > Oleksandr Natalenko wrote: > > Oh, I see that write_msg() calls netpoll_send_udp() under > > spin_lock_irqsave(), but in PREEMPT_RT this, AFAIK, does not disable > > interrupts. > > > > So, the real que

[PATCH] net: phy: sfp: remove sfp_mutex's definition

2018-10-11 Thread Sebastian Andrzej Siewior
The sfp_mutex variable is defined but never used in this file. Not even in the commit that introduced that variable. Remove sfp_mutex, it has no purpose. Cc: Andrew Lunn Cc: Florian Fainelli Cc: "David S. Miller" Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/phy/sfp.c

locking in wimax/i2400m

2018-06-11 Thread Sebastian Andrzej Siewior
I tried to figure out if the URB-completion handler uses any locking and stumbled here. i2400m_pm_notifier() is called from process context. This function invokes i2400m_fw_cache() + i2400m_fw_uncache(). Both functions do spin_lock(&i2400m->rx_lock); while in other places (say i2400mu_rxd

Re: [RFC PATCH 2/2] net: mac808211: mac802154: use lockdep_assert_in_softirq() instead own warning

2018-05-04 Thread Sebastian Andrzej Siewior
On 2018-05-04 20:51:32 [+0200], Peter Zijlstra wrote: > On Fri, May 04, 2018 at 08:45:39PM +0200, Sebastian Andrzej Siewior wrote: > > On 2018-05-04 20:32:49 [+0200], Peter Zijlstra wrote: > > > On Fri, May 04, 2018 at 07:51:44PM +0200, Sebastian Andrzej Siewior wrote: > &

Re: [RFC PATCH 2/2] net: mac808211: mac802154: use lockdep_assert_in_softirq() instead own warning

2018-05-04 Thread Sebastian Andrzej Siewior
On 2018-05-04 20:32:49 [+0200], Peter Zijlstra wrote: > On Fri, May 04, 2018 at 07:51:44PM +0200, Sebastian Andrzej Siewior wrote: > > From: Anna-Maria Gleixner > > > > The warning in ieee802154_rx() and ieee80211_rx_napi() is there to ensure > > the softirq

[RFC PATCH 2/2] net: mac808211: mac802154: use lockdep_assert_in_softirq() instead own warning

2018-05-04 Thread Sebastian Andrzej Siewior
. Use the lockdep variant for softirq context check. While at it, add a lockdep based check for irq enabled as mentioned in the comment above netif_receive_skb(). Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- net/core/dev.c | 3 +++ net/mac80211/rx.c | 2

[RFC PATCH 0/2] Introduce assert_in_softirq()

2018-05-04 Thread Sebastian Andrzej Siewior
ieee80211_rx_napi() has a check to ensure that it is invoked in softirq context / with BH disabled. It is there because it invokes netif_receive_skb() which has this requirement. On -RT this check does not work as expected so there is always this warning. Tree wide there are two users of this check

[RFC PATCH 1/2] lockdep: Add a assert_in_softirq()

2018-05-04 Thread Sebastian Andrzej Siewior
From: Anna-Maria Gleixner Instead of directly warn on wrong context, check if softirq context is set. This check could be a nop on RT. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/lockdep.h | 6 ++ 1 file changed, 6 insertions(+) diff

Re: [PATCH 2/4] net: 3com: 3c59x: Move boomerang/vortex conditional into function

2018-05-04 Thread Sebastian Andrzej Siewior
On 2018-05-04 17:17:47 [+0200], To netdev@vger.kernel.org wrote: > From: Anna-Maria Gleixner > > If vp->full_bus_master_tx is set, vp->full_bus_master_rx is set as well > (see vortex_probe1()). Therefore the conditionals for the decision if > boomerang or vortex ISR is executed have the same resu

[PATCH 1/4] net: u64_stats_sync: Remove functions without user

2018-05-04 Thread Sebastian Andrzej Siewior
Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/u64_stats_sync.h | 14 -- 1 file changed, 14 deletions(-) diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h index 07ee0f84a46c..a27604f99ed0 100644 --- a/include/linux/u64_stats_sy

[PATCH 4/4] net: 3com: 3c59x: irq save variant of ISR

2018-05-04 Thread Sebastian Andrzej Siewior
interrupt handler is minimal, but converting it removes all the extra code for callers which come not from interrupt context. Cc: Steffen Klassert Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/3com/3c59x.c | 18 -- 1 file changed

[PATCH 3/4] net: 3com: 3c59x: Pull locking out of ISR

2018-05-04 Thread Sebastian Andrzej Siewior
-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/3com/3c59x.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c index 0cfdb07f3e59..fdafe25da153 100644 --- a/drivers/net/ethernet

[PATCH 2/4] net: 3com: 3c59x: Move boomerang/vortex conditional into function

2018-05-04 Thread Sebastian Andrzej Siewior
of the boomerang/vortex ISR, move it into an own function. No functional change. Cc: Steffen Klassert Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/3com/3c59x.c | 34 ++- 1 file changed, 20 insertions(+), 14 del

3c59x patches and the removal of an unused function

2018-05-04 Thread Sebastian Andrzej Siewior
The first patch removes an unused function. The goal of remaining three patches is to get rid of the local_irq_save() usage in the driver which benefits -RT. Sebastian

[PATCH REPOST] xen/9pfs: don't inclide rwlock.h directly.

2018-05-04 Thread Sebastian Andrzej Siewior
Signed-off-by: Sebastian Andrzej Siewior --- net/9p/trans_xen.c |1 - 1 file changed, 1 deletion(-) --- a/net/9p/trans_xen.c +++ b/net/9p/trans_xen.c @@ -38,7 +38,6 @@ #include #include -#include #include #include #include

[PATCH] 8139too: Use disable_irq_nosync() in rtl8139_poll_controller()

2018-05-02 Thread Sebastian Andrzej Siewior
From: Ingo Molnar Use disable_irq_nosync() instead of disable_irq() as this might be called in atomic context with netpoll. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- drivers/net/ethernet/realtek/8139too.c | 2 +- 1 file changed, 1

  1   2   >