Re: [PATCH v10 1/9] drm/panic: Add drm panic locking

2024-03-15 Thread John Ogness
s it as an argument in both variants. Just a suggestion. John Ogness

Re: [PATCH v9 1/9] drm/panic: Add drm panic locking

2024-03-07 Thread John Ogness
e->planes[i].state = old_plane_state; > plane->state = new_plane_state; > } > + drm_panic_unlock(state->dev); Is there a reason irqsave/irqrestore variants are not used? Maybe this code path is too hot? By leaving interrupts enabled, there is the risk that a panic from within any interrupt handler may block the drm panic handler. John Ogness

Re: [RFC] drm/panic: Add drm panic locking

2024-03-05 Thread John Ogness
e/irqrestore variants? By leaving interrupts enabled, there is the risk that a panic from any interrupt handler may block the drm panic handler. John Ogness

Re: [RFC] How to test panic handlers, without crashing the kernel

2024-03-04 Thread John Ogness
in NMI > context, but I don't know how to simulate that. The goal would be to > find early if a panic notifier tries to sleep, or do other things that > are not allowed in a panic context. Maybe with a new boot argument "unknown_nmi_fake_panic" that triggers the fake panic instea

[PATCH v3] drm/nouveau: fix incorrect conversion to dma_resv_wait_timeout()

2023-04-14 Thread John Ogness
tps://lore.kernel.org/lkml/20230119225351.71657-1-0070472...@gmail.com Signed-off-by: John Ogness --- I just realized that the nouveau driver style prefers to scope variables used only in loops. v3: Define @lret within the for-loop. drivers/gpu/drm/nouveau/nouveau_gem.c | 18 -- 1 file ch

[PATCH v2] drm/nouveau: fix incorrect conversion to dma_resv_wait_timeout()

2023-04-14 Thread John Ogness
tps://lore.kernel.org/lkml/20230119225351.71657-1-0070472...@gmail.com Signed-off-by: John Ogness --- The original report was actually a patch that needed fixing. Since nobody has stepped up to fix this regression correctly, I'm posting the v2. This is a real regression introduced in 6.3-rc1. drivers/gpu

Re: [PATCH] drm/nouveau: Fix bug in buffer relocs for Nouveau

2023-03-27 Thread John Ogness
being translated. Or perhaps a new variable should be introduced to separate the return value of dma_resv_wait_timeout() from the return value of this function. Either way, this is an important fix for 6.3-rc! John Ogness

[PATCH printk v5 32/40] printk, xen: fbfront: create/use safe function for forcing preferred

2022-11-16 Thread John Ogness
ty console, it is assumed the pointer is still valid after releasing the console_sem. This assumption is incorrect and unsafe. Make the hack safe by introducing a new function console_force_preferred_locked() and perform the full operation under the console_list_lock. Signed-off-by: John Ogness Reviewe

[PATCH printk v5 00/40] reduce console_lock scope

2022-11-16 Thread John Ogness
the console the head of the console list. John Ogness [0] https://lore.kernel.org/lkml/20221114162932.141883-1-john.ogn...@linutronix.de [1] https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/log/?h=srcunmisafe.2022.11.09a John Ogness (38): printk: Prepare for SRCU

Re: [PATCH printk v4 31/39] printk, xen: fbfront: create/use safe function for forcing preferred

2022-11-14 Thread John Ogness
Hi, After more detailed runtime testing I discovered that I didn't re-insert the console to the correct place in the list. More below... On 2022-11-14, John Ogness wrote: > diff --git a/include/linux/console.h b/include/linux/console.h > index f716e1dd9eaf..9cea254b34b8 100644 > ---

[PATCH printk v4 31/39] printk, xen: fbfront: create/use safe function for forcing preferred

2022-11-14 Thread John Ogness
ty console, it is assumed the pointer is still valid after releasing the console_sem. This assumption is incorrect and unsafe. Make the hack safe by introducing a new function console_force_preferred_locked() and perform the full operation under the console_list_lock. Signed-off-by: John Ogness --

[PATCH printk v4 00/39] reduce console_lock scope

2022-11-14 Thread John Ogness
lso take the console_lock to guarantee safe access to console->seq. - In console_force_preferred_locked() use hlist_del_rcu() instead of hlist_del_init_rcu() so that there is never a window where the console can be viewed as unregistered. John Ogness [0] https://lore.kernel.or

Re: [PATCH printk v3 33/40] printk, xen: fbfront: create/use safe function for forcing preferred

2022-11-10 Thread John Ogness
On 2022-11-10, Petr Mladek wrote: + /* Only the new head can have CON_CONSDEV set. */ + WRITE_ONCE(cur_pref_con->flags, cur_pref_con->flags & ~CON_CONSDEV); >>> >>> As mentioned in the reply for 7th patch, I would prefer to hide this >>> WRITE_ONCE into a wrapper, e.g.

Re: [PATCH printk v3 33/40] printk, xen: fbfront: create/use safe function for forcing preferred

2022-11-10 Thread John Ogness
On 2022-11-10, Petr Mladek wrote: >> +void console_force_preferred_locked(struct console *con) >> +{ >> +struct console *cur_pref_con; >> + >> +if (!console_is_registered_locked(con)) >> +return; >> + >> +cur_pref_con = console_first(); >> + >> +/* Already preferred?

[PATCH printk v3 33/40] printk, xen: fbfront: create/use safe function for forcing preferred

2022-11-07 Thread John Ogness
ty console, it is assumed the pointer is still valid after releasing the console_sem. This assumption is incorrect and unsafe. Make the hack safe by introducing a new function console_force_preferred_locked() and perform the full operation under the console_list_lock. Signed-off-by: John Ogness --

[PATCH printk v3 00/40] reduce console_lock scope

2022-11-07 Thread John Ogness
the enabled boot consoles - add comments and lockdep assertion to unregister_console_locked() because it is not clear from the name which lock is implied - dropped patches that caused unnecessary churn in the series John Ogness [0] https://lore.kernel.org/lkml/20221019145600.1282823-1-john

Re: [PATCH printk v2 38/38] printk, xen: fbfront: create/use safe function for forcing preferred

2022-10-27 Thread John Ogness
On 2022-10-27, Petr Mladek wrote: >> -if (c) { >> -unregister_console(c); >> -c->flags |= CON_CONSDEV; >> -c->flags &= ~CON_PRINTBUFFER; /* don't print again */ >> -register_console(c); >> -} >> +if (c) >> +

[PATCH printk v2 24/38] xen: fbfront: use srcu console list iterator

2022-10-19 Thread John Ogness
Since the console_lock is not being used for anything other than safe console list traversal, use srcu console list iteration instead. Signed-off-by: John Ogness --- drivers/video/fbdev/xen-fbfront.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev

[PATCH printk v2 38/38] printk, xen: fbfront: create/use safe function for forcing preferred

2022-10-19 Thread John Ogness
ty console, it is assumed the pointer is still valid after releasing the console_sem. This assumption is incorrect and unsafe. Make the hack safe by introducing a new function console_force_preferred() to perform the full operation under the console_list_lock. Signed-off-by: John Ogness --- drivers/v

[PATCH printk v2 00/38] reduce console_lock scope

2022-10-19 Thread John Ogness
fore adding to list - unregister_console: fix ENODEV return value if the console is not registered - console_stop: synchronize srcu - printk_late_init: use _safe variant of iteration - __pr_flush: use srcu instead of relying on console_lock for list iteration John Ogness [0] https://lor

Re: [PATCH] drm: fb-helper: Avoid nesting spinlock_t into raw_spinlock_t

2022-02-15 Thread John Ogness
On 2022-02-15, Sebastian Siewior wrote: >> From: Jiri Kosina >> >> drm_fb_helper_damage() is acquiring spinlock_t (helper->damage_lock), >> while it can be called from contexts where raw_spinlock_t is held (e.g. >> console_owner lock obtained on vprintk_emit() codepath). >> >> As the

Re: printk deadlock due to double lock attempt on current CPU's runqueue

2021-11-11 Thread John Ogness
On 2021-11-10, Sultan Alsawaf wrote: > On Wed, Nov 10, 2021 at 11:13:37AM +0106, John Ogness wrote: >> Even after we introduce kthread printers, there will still be >> situations where direct printing is used: booting (before kthreads >> exist) and shutdown/suspend/c

Re: printk deadlock due to double lock attempt on current CPU's runqueue

2021-11-10 Thread John Ogness
not yet exist (hoping to get them in for 5.17), I am not sure how we should address the reported bug for existing kernels. John Ogness

kmemleak report: 5.15.0-rc3: nouveau_fence_new

2021-09-29 Thread John Ogness
ell. I do not know if this is a good channel for reporting this, so please let me know if I should report it somewhere else. Also let me know if you need any additional information from me. John Ogness

Re: [PATCH 1/3] printk: use CONFIG_CONSOLE_LOGLEVEL_* directly

2021-02-03 Thread John Ogness
ng some Kconfig settings from that subsystem. Headers exist to make information available to external code. Kconfig (particularly for a subsystem) exist to configure that subsystem. But my feeling on this may be misguided. Is it generally accepted in the kernel tha

Re: [PATCH v9 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-08-02 Thread John Ogness
keep the related messages together. >> >> The lockless ringbuffer might make handling of related (partial) >> lines worse or better. It might justify KUnit's extra buffering >> or it might allow to get rid of it. > > Thanks for CC'ing me on the printk ringbuffer t

Re: [PATCH v2 1/3] drm: Add support for panic message output

2019-03-15 Thread John Ogness
On 2019-03-14, John Ogness wrote: > On 2019-03-14, Daniel Vetter wrote: >> That's why we came up with the trylock + immediate bail out design if >> that fails. Plus really only render the oops int whatever is the >> current display buffer, so that we don't have to do any hw

Re: [PATCH v2 1/3] drm: Add support for panic message output

2019-03-15 Thread John Ogness
you may have functions without a return value taking spinlocks. But now those functions could fail. John Ogness ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v2 1/3] drm: Add support for panic message output

2019-03-13 Thread John Ogness
makes sense to do this if the driver has a chance of being successful. Ignoring locks is a serious issue. I personally am quite unhappy that the serial drivers do this, which was part of my motivation for the new printk design I'm working on. If the driver is not capable of doing something usef