From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81D3AC43334 for ; Wed, 20 Jul 2022 16:35:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229968AbiGTQfk (ORCPT ); Wed, 20 Jul 2022 12:35:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiGTQfj (ORCPT ); Wed, 20 Jul 2022 12:35:39 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E853DFC8 for ; Wed, 20 Jul 2022 09:35:38 -0700 (PDT) Date: Wed, 20 Jul 2022 18:35:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1658334937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SzYRnD31ArqphC0obldOfpyK/WHzS0mU3rD8NaHRSIA=; b=MhXKKELCiFUtQIMxk+GCPPNViSq49vf098g8smouuZ3hUsvVqPI49oErJ+SDFegV6U5ZYw oX3Nx6iphsBoRvAJIkae9Mc+otT7n0kQg1FYrUVkZnpDmlfF1ZlLRNPJ1Nj9exnmdtMGzO MfuPEZTTqLAKPMVdsU2Swv9yOyYkB9IhCE2cRRQi30HNbYSBKjDkRWYtIkwxnLwewPdVx3 N0GEssXYrFU3JEJgWqgnTld8TRIUomuDHfNA4KV0mZAqkAdJuvB0EldHyJ9ZwPflD2sXbj w9qHy/HP0khHp4m9gJBwkj34m8BQGMZgp7l9DOuHR8nrdTfLrRCk29ZlI3idpw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1658334937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SzYRnD31ArqphC0obldOfpyK/WHzS0mU3rD8NaHRSIA=; b=OcgVu/JKmKE6YV2ebfi/ypQst3f+wFcmfEncR0VVX6d477EuUbEU2eXDHyx53ciEnjKQXT dzvAThb8HYMNQrDQ== From: Sebastian Andrzej Siewior To: John Ogness Cc: linux-kernel@vger.kernel.org, Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner Subject: Re: [PATCH] printk: Skip console drivers on PREEMPT_RT. Message-ID: References: <87y1wn3g3g.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87y1wn3g3g.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-07-20 18:32:43 [+0206], John Ogness wrote: > Hi Sebastian, Hi, > > --- a/kernel/printk/printk.c > > +++ b/kernel/printk/printk.c > > @@ -2843,6 +2843,16 @@ void console_unlock(void) > > } > > > > /* > > + * On PREEMPT_RT it is not possible to invoke console drivers with > > + * disabled interrupts and or preemption. Therefore all drivers are > > + * skipped and the output can be retrieved from the buffer. > > + */ > > + if (IS_ENABLED(CONFIG_PREEMPT_RT)) { > > + up_console_sem(); > > This should be: > > __console_unlock(); Why? > > + return; > > + } > > Note that if @console_may_schedule is 1, then we are in a sleepable > context and could print. But since that is not very often, it is > probably better to just have it off all the time as you propose. No we can't coz printk disables interrupts before invoking the console drivers. > John Ogness Sebastian