Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5258133iog; Wed, 22 Jun 2022 15:52:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u+E+SNDtbRnYmDJPMr5x0Oh3nExTG2RqirNfAW86tpdfYsEtPVboTyE2zN9cctCN7NZ13z X-Received: by 2002:a17:907:9805:b0:711:d8b7:d8b6 with SMTP id ji5-20020a170907980500b00711d8b7d8b6mr5308911ejc.234.1655938361791; Wed, 22 Jun 2022 15:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655938361; cv=none; d=google.com; s=arc-20160816; b=b0sec7u2cr5UONdI0bIUM+HE02mRZfU/KaEalP72c9i7uwDcD/Z9d7b8/BeTgMtp4S UgL/z/+NWAJN6SZPVDzwwMo5uiZ3XNWdk106nfZ1g/mvSLBcdG6e08NQdqRroZy7DtjZ BAhuBjYGUWmS5B8adNWRPLii3dmhkiC3PUfo5hsbSZH6fjjPaihFInlaCQWIZuhnNBie MZ9T+p/NuKWWkGYAsllz2OP4zJWW0x4J2n4a3z7i8UHdmxTOOLo03Mrvv3H7ycbBszmV 9aMx+0PKKG4rXFLyOG07zpdf+9vbLKIaUXn62pmcI7UQ7vBGf5bFskXYNgJWV1Rep12a nEfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=8tSupLdVkgmkJxR6XWH1BaGWmi5B6LARumTOlnBjCLU=; b=0JUq5ATmWaZFLvG3ZesfDb5g64TdhuSih+92CF1d9sU7cNJaywKw226xOGqTqH+zHq u6kJBBtn+eK0ISW1DLHPBAH+tjaj3Fbpt9IiARnVphdDJ7mihQ/zUTmDDySuCSuzjlsb hCd6xnWNHVRRjr3jRyCygddg0+SD6ihACXsLBF9/03X3OuN18bTxDXBR/NdPE32KMbeP o+po5nGJ/ut2WL5Y6Rg1y5usBDnBkbKqyEmHPv0xrpctO+wUimdowb2P8f4SKOTTkSEC 70CqE5vPIqjELqZq0MqI9jMVwQtD5zmF8SjZIxFHx9SGO1CDg2t4t6NnKvgV18YlKxJI 1BGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=h2dsoGyM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l4-20020a170906794400b0071076a14dc5si21155912ejo.774.2022.06.22.15.52.17; Wed, 22 Jun 2022 15:52:41 -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=@linutronix.de header.s=2020 header.b=h2dsoGyM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359649AbiFVWhZ (ORCPT + 99 others); Wed, 22 Jun 2022 18:37:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241081AbiFVWhY (ORCPT ); Wed, 22 Jun 2022 18:37:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BCD840A33 for ; Wed, 22 Jun 2022 15:37:23 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1655937435; 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=8tSupLdVkgmkJxR6XWH1BaGWmi5B6LARumTOlnBjCLU=; b=h2dsoGyMgLwZjzVS9szjvLRMkofizn2sHhCAgoKoil5WEmoTfKt5Sv98yHwN1uZtQngl1q bHkdqeJ2H5Ld+Vw8Xl4WcZqMqM1ObX/byCfCH7MCKOIcPG/DvDGxH3GeqzDyEHtGlW2xHb CiI8wSJuKIXzC1Ve+OEK4GQxdwBdMHE1Cp8ukuW7UApz0g0SiW3v9Xh4hbQfd/icYFzVxF NKakt9z2rIMmjHHxJXxd8/DrtogxTSsLjEvxqaEDUq1JoV26ZhL/EBBPhR1dr3EDabFb3d xx6PuwQSQRiaYJ8fc3w9YNTAy48otfvkej2CPHfhRCYQYrOIZ4jAxrdVGUUSYA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1655937435; 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=8tSupLdVkgmkJxR6XWH1BaGWmi5B6LARumTOlnBjCLU=; b=E8vgALv5rGfb7cjIr53AYf3otdbEMlM7X8s97Y88959INfA84zSQz6buqDJN519OKO9haJ D05jBbsTXnSy3/Aw== To: Geert Uytterhoeven Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Linux Kernel Mailing List , Greg Kroah-Hartman , linux-riscv Subject: Re: [PATCH printk v5 1/1] printk: extend console_lock for per-console locking In-Reply-To: References: <20220421212250.565456-1-john.ogness@linutronix.de> <20220421212250.565456-15-john.ogness@linutronix.de> <878rrs6ft7.fsf@jogness.linutronix.de> Date: Thu, 23 Jun 2022 00:43:15 +0206 Message-ID: <87v8ssgw9w.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 2022-06-22, Geert Uytterhoeven wrote: > I have bisected another intriguing issue to this commit: on SiPEED > MAiX BiT (Canaan K210 riscv), it no longer prints the line detecting > ttySIF0, i.e. the console output changes like: > > spi-nor spi1.0: gd25lq128d (16384 Kbytes) > i2c_dev: i2c /dev entries driver > k210-fpioa 502b0000.pinmux: K210 FPIOA pin controller > -38000000.serial: ttySIF0 at MMIO 0x38000000 (irq = 1, base_baud = > 115200) is a SiFive UART v0 > printk: console [ttySIF0] enabled > printk: bootconsole [sifive0] disabled > printk: console [ttySIF0] printing thread started > > As this patch does not make any changes to drivers/tty/, and ttySIF0 > does work (it's the console), I looked in /proc/kmsg, and bingo, > the missing line is there, so it is generated, but never printed. What is sifive0? Are you using the earlycon driver to create an early boot console? Can I see your boot args? There is a known issue the that earlycon does not synchronize with normal consoles. A patch was recently posted [0] on LKML. > I tried taking the port spinlock in sifive_serial_startup(), as > suggested for the meson driver, but that doesn't make a difference. It may not have made a difference for you, but it should be there. sifive_serial_startup() is writing to SIFIVE_SERIAL_IE_OFFS without taking port->lock. sifive_serial_console_write() also writes to this register (under port->lock). This could lead to RX watermark interrupts being disabled for some time. The problem is not as bad as it was with the meson driver because __ssp_enable_rxwm() is updating the shadow copy. But still, it is a bug. And anyway we shouldn't have 2 CPUs writing to a register simultaneously. John Ogness [0] https://lore.kernel.org/lkml/20220621090900.GB7891@pathway.suse.cz