Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4382901rdb; Thu, 14 Sep 2023 23:39:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOSWVmTd4wJQR8HYQxHOd+UvWcm76qmTPOuQdDJhYdzuDxYvPlMjSJ8lcuUBqJEVHbxiQ8 X-Received: by 2002:a05:6a20:5648:b0:154:b4cb:2e8c with SMTP id is8-20020a056a20564800b00154b4cb2e8cmr905419pzc.24.1694759994647; Thu, 14 Sep 2023 23:39:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694759994; cv=none; d=google.com; s=arc-20160816; b=oBFSsnjs8/0BOMVouWBy1zZVm77wlh63PAThGgrHl0ufzJ0uBARs8PnI0ECwMxsD5Y 7Iy7reebIfkZJudFOMhvjkddkXzmu14sROzindtR5w8Nj1ULC0fPIxzgtLLB2fRKJRdd w1u2jHEu8pSfmc8MdGUHgcQ6LaxjR+vMpn7dNrLcrBZz2FAG6I2CkEorpWPmdpHF0/f5 asG+oL2wP2S1e7xL4qjEBbtmZQWeKcHy+0xHFIPnBPyi4hekeNv1PtlP90qvyVPsDOxG RcJocUEEGu/05IgeWcBgoM60TthoWQINKxHPRWxYnxrV9oPvoJza0mBho7RnrsKkqEsd PDTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Qzmi/iJpKjOZhxEQBLno/kngFnqZ7SNTMdomSBt3AV4=; fh=rtaIsJJCeEOVLDVZ9WLLg+kbp+YzcIMjHpBgVN7bb98=; b=VPGBytCu5oWeTmsQgh4QPNFGl6ljXlFLtBl0QShAxaHFNqW27ZOe4AxFNDD+XeVC8p v1tYWdEgXfK4VuEW1Kz2ym1MRDvHmmbX2lvBmX4TOAlM4mSmBT9nihHi0RIdzRDaZ3wU yYK9z7guBLRbCs/F4vObdERc2NiPxYzH+pxmrFjSHObZDYwH35zy0hKRw+xhX68Mzmll VKT5AEz9afGmKfSZrbf76SnGjwLXUMjmGUL3TvpHOa0xQ8gzsixeI8jHVQmkVc81orSW T2Cbl/ywJ+hQ4lpuJQDOoaeYD2o3e5sAWKLcVbCv7BsT1keVGylbBt28sr5px5CnAXFh uC8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UDeSruiP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id u13-20020a63d34d000000b0057771e49c25si2716296pgi.693.2023.09.14.23.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 23:39:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UDeSruiP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9F620811245B; Thu, 14 Sep 2023 21:07:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231680AbjIOEHU (ORCPT + 99 others); Fri, 15 Sep 2023 00:07:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231802AbjIOEHT (ORCPT ); Fri, 15 Sep 2023 00:07:19 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162F12718 for ; Thu, 14 Sep 2023 21:07:14 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-502153ae36cso2715965e87.3 for ; Thu, 14 Sep 2023 21:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1694750832; x=1695355632; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Qzmi/iJpKjOZhxEQBLno/kngFnqZ7SNTMdomSBt3AV4=; b=UDeSruiPdFHlQdH6JfCu2Ei8OwAp5U7MV1+i2hneGUx5wQYXUaX8X26FM62BWRqe/U fm4GwtPEhNNeQN8yJYIcmpAQ8/HN2mNwn4mU8SK0hnkT5P8NPj1rkGJ8kVgkHm3IG/8f djhUvO5lsmmFsxaCFhEO897/W3W7Vzn4Z5R7o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694750832; x=1695355632; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qzmi/iJpKjOZhxEQBLno/kngFnqZ7SNTMdomSBt3AV4=; b=oyqO9xwRq5ZIpImilyGPbvfCNKIvD1a3qAII0vmpc+7XVFHbudPHtspHNBApZG3avi 2LwmOi4mZU5REhDNqZHODZGXjTsBObnuw4zOsBap4pUeTzImZChZfU3ECdna/XLBHk/W dcoiphMDUshY03wMndCq8tu23bmw8w/4VcyEJjAapCP8stUYsFSdyCi5w4tHVWN/8Jkj 9HTurrhay/Jl+PzKgz4KOpOEp7FdJUFxAMxR6zNdswAuPhCXBzz5LrmnBdtwi5nEvduT LGN8oGUvBvvBDtkDoOzjkk9Igq5viyPk4GXSwPNJElDnbhWC3iwuSjRzdylsSJpexwQR fLqg== X-Gm-Message-State: AOJu0YweW5BVdxkATJ2X/uqiwtxny/F5EtnDmofcmrXSDVxlcdBgQNvt KqFWFjcy53/sGSpdv6dEl2KiQISuNd7E7LiaFC+A4g== X-Received: by 2002:a05:6512:3d05:b0:4fe:8c4:44fb with SMTP id d5-20020a0565123d0500b004fe08c444fbmr532868lfv.38.1694750832139; Thu, 14 Sep 2023 21:07:12 -0700 (PDT) MIME-Version: 1.0 References: <20230914183831.587273-1-john.ogness@linutronix.de> <20230914183831.587273-12-john.ogness@linutronix.de> In-Reply-To: <20230914183831.587273-12-john.ogness@linutronix.de> From: Chen-Yu Tsai Date: Fri, 15 Sep 2023 12:07:00 +0800 Message-ID: Subject: Re: [PATCH tty v1 11/74] serial: 8250_mtk: Use port lock wrappers To: John Ogness Cc: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, Petr Mladek , Thomas Gleixner , linux-kernel@vger.kernel.org, Matthias Brugger , AngeloGioacchino Del Regno , Tony Lindgren , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 14 Sep 2023 21:07:19 -0700 (PDT) On Fri, Sep 15, 2023 at 2:38=E2=80=AFAM John Ogness wrote: > > From: Thomas Gleixner > > When a serial port is used for kernel console output, then all > modifications to the UART registers which are done from other contexts, > e.g. getty, termios, are interference points for the kernel console. > > So far this has been ignored and the printk output is based on the > principle of hope. The rework of the console infrastructure which aims to > support threaded and atomic consoles, requires to mark sections which > modify the UART registers as unsafe. This allows the atomic write functio= n > to make informed decisions and eventually to restore operational state. I= t > also allows to prevent the regular UART code from modifying UART register= s > while printk output is in progress. > > All modifications of UART registers are guarded by the UART port lock, > which provides an obvious synchronization point with the console > infrastructure. > > To avoid adding this functionality to all UART drivers, wrap the > spin_[un]lock*() invocations for uart_port::lock into helper functions > which just contain the spin_[un]lock*() invocations for now. In a > subsequent step these helpers will gain the console synchronization > mechanisms. > > Converted with coccinelle. No functional change. > > Signed-off-by: Thomas Gleixner Replacements look correct. Reviewed-by: Chen-Yu Tsai