Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp269348rwl; Wed, 29 Mar 2023 01:15:42 -0700 (PDT) X-Google-Smtp-Source: AKy350Yx53BNOf0WXB1f7EMX6oLUpuo2JevHIfMWlYxsGh3tefQ/3S3NnzDamb3tBIhUp1ODRutD X-Received: by 2002:a17:907:8b8b:b0:93e:2289:ecc0 with SMTP id tb11-20020a1709078b8b00b0093e2289ecc0mr16007357ejc.42.1680077742439; Wed, 29 Mar 2023 01:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680077742; cv=none; d=google.com; s=arc-20160816; b=dBmpF0/0oQPuJzGWfmETmjLsQgpKTF7te3MkkxT7cVj3250jDI8wdKssh6Ob9FCqa7 whIhMQ2JhDfKIy8zkr71OXlWhRkV1Y787jZ6x2DoDDg0C0KT/37heLeiD0T8owzKtBev zTA49oLUqs9oAAFlMZ9PAeIEcSK0sj4Q8jgCocpJo8rjXoV5yi3X0/cDG/bdRPeog71w O9ffFcSa/C2oM5sfUh0c8LTJYn66+fhwTfl7oxtD6/VaQZtqA2AojxpBm1kURHr09QML rH4ZcgOI9pH+F6WnpsC8Z4p/CCdc1r4TwOwOQMwHWCn+lmyzIjczXUIx60V/hkpqv4vx gK0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ICn2IUeBEefhWUnrVwwgjW98U4BhJgsWujMRsb5uiew=; b=Eu+BZwWqp4nMg17Cm0pn6L1BAYOBIx758uZHxYoxQtqXG0+dL5Kb63U8A8uXS+Ji2m QLrs6ykiUiLAiHLkuHlyiNjBfBbSwU+BoREjUlTFrykxtMBErSPNgkJlT5baw93y1rpL rq3o/MTu2BN4U8rLoBwbdifoL6QEscM89eivPpSpzKUCFpl1vqUhGoMPX+i8EpcRP2tu 0k9ayKx93bX+RM83k9M2f/FVLpbYzitjN7vgiqtWn00wTTCyzewP4dWKtxKLHovognOR Z1MSi5BXGMjwyNHTF3VbiXQVb8pOoWbF9nFbt017esBTXQlQAfSAY3OoMrNoPROEMkxw /KNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=FJS+18HM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fy29-20020a1709069f1d00b0093a06ab8695si19551409ejc.540.2023.03.29.01.15.18; Wed, 29 Mar 2023 01:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=FJS+18HM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230250AbjC2IDu (ORCPT + 99 others); Wed, 29 Mar 2023 04:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbjC2IDl (ORCPT ); Wed, 29 Mar 2023 04:03:41 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C605A3AB8; Wed, 29 Mar 2023 01:03:39 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 7F852219E7; Wed, 29 Mar 2023 08:03:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1680077018; h=from:from:reply-to: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=ICn2IUeBEefhWUnrVwwgjW98U4BhJgsWujMRsb5uiew=; b=FJS+18HMODTwNmHvvxxOJaelViHM+6afdk9Pgzu6vt4DkahdE6qeAZmAS2mImejCjWuCod pTjIstQ62m9cov9oi8oweZjZvdtEDYtmSxnvHBCOYsAua1FNyY8AJlOgQhvCm5e1mw8hV9 oNbWsqoqiejrQuKT5r84TeQdZ9c2enk= Received: from suse.cz (unknown [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E98FB2C141; Wed, 29 Mar 2023 08:03:36 +0000 (UTC) Date: Wed, 29 Mar 2023 10:03:34 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Jason Wessel , Daniel Thompson , Douglas Anderson , Aaron Tomlin , Luis Chamberlain , kgdb-bugreport@lists.sourceforge.net, Greg Kroah-Hartman , linux-fsdevel@vger.kernel.org, Andrew Morton , "Guilherme G. Piccoli" , David Gow , Tiezhu Yang , Daniel Vetter , tangmeng , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , rcu@vger.kernel.org Subject: Re: locking API: was: [PATCH printk v1 00/18] serial: 8250: implement non-BKL console Message-ID: References: <20230302195618.156940-1-john.ogness@linutronix.de> <87wn3zsz5x.fsf@jogness.linutronix.de> <87a5zxger3.fsf@jogness.linutronix.de> <87ilekmtuj.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ilekmtuj.fsf@jogness.linutronix.de> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2023-03-28 23:53:16, John Ogness wrote: > On 2023-03-28, Petr Mladek wrote: > >> If an atomic context loses ownership while doing certain activities, > >> it may need to re-acquire ownership in order to finish or cleanup > >> what it started. > > > > This sounds suspicious. If a console/writer context has lost the lock > > then all shared/locked resources might already be used by the new > > owner. > > Correct. > > > I would expect that the context could touch only non-shared resources > > after loosing the lock. > > Correct. > > The 8250 driver must disable interrupts before writing to the TX > FIFO. After writing it re-enables the interrupts. However, it might be > the case that the interrupts were already disabled, in which case after > writing they are left disabled. I see. The reacquire() makes sense now. Thanks a lot for explanation. Best Regards, Petr