Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp120963lqt; Mon, 18 Mar 2024 03:25:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKgxmo4EoQLxZigLj2laeIwf6PdGPuJWZ+NREWws5fBOUc7x2DX6oPU3SWI8YiQV2t5MfYlV1DduPApnceHiylU4oxbF6+JaG36ioWdw== X-Google-Smtp-Source: AGHT+IERcA1KaRMXuLM/Miam8ulWahQHEBq4l55unE/z11Q27Yhq/QpEAOYJ6iTCgEuiBmOrGWza X-Received: by 2002:a81:5386:0:b0:610:c2a6:1b9e with SMTP id h128-20020a815386000000b00610c2a61b9emr2088979ywb.6.1710757555468; Mon, 18 Mar 2024 03:25:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710757555; cv=pass; d=google.com; s=arc-20160816; b=t5WjxGPAw1Y+cXFf5yi1Awfwp8+lhmD0eRMfKl3iXipbqReQYTVNzUiVguFDDcASIh nIRVdJvBl5QwZnvB7Q1jafFG4S+Gw6I53EQnV2RioSfhsA/HhxXsR1XgF7o2bBYOsrP9 pC1/ZLwjrAY5KPDggi1nRbRgkbretKuIJrrrNFa32uBTTxFY+aWiKLAFTbWpXDC1xo9/ JIE751hAHESmTcJ5V3gYxXUJEHSfxU18wS1YyUb2rAg6k3s3+RzjSTO9P4GjzW7yb8Zb psybJrblhx2LnMACWhlG2IS0BLDLI9E3ZzNlaCb7L/v6n7L+Bw8x2cLwRLiMpS2IwLhQ qIcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=kntj7D+3C8Siu9Mte/gOo4b2BDgoQlvmaeXCzlwHfd0=; fh=Kpj0+S4YUGGZvTgXFlQn7JF0aar7fCp5jUTzqmHu2Sk=; b=ps7PIjDbGCP2G3lzzhFslUW2wdwWy3H6qITIGtv8FW9Ysz+aApxNB7cVMvC2vAMqpj ae6Im+W+Y0f9EsrOw5skDYJyWp95ZPxRxiRiInSTUULkA72EckQ8nIZ9SidVQkBqK55W 3XHE4iGDM4T+sIsiSyw2v4JRNdO5j36uqAe5xwD2WJtviCkDfdgrL69UPctveUTwiv2U b6DowbOkX1jXlWXSi6ex/DGdFGwvuccr1BJoh6gU9/UT+osdFaJZdaWXSIVKCsSXxcwU 8c6Q1siATBrwt2oW8Bs94/kfGIztkpBQPrXb2yJxQZkvKVQQ5hswE52DCB4+Kw88p28p +Etg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lmoK1sgR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-106000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106000-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k12-20020ac85fcc000000b00430c408053csi3705242qta.612.2024.03.18.03.25.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 03:25:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lmoK1sgR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-106000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106000-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 30BD41C21D59 for ; Mon, 18 Mar 2024 10:25:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 057DD31A82; Mon, 18 Mar 2024 10:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lmoK1sgR" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C1432E827; Mon, 18 Mar 2024 10:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710757474; cv=none; b=DUbZrNTswbCtNLFuadx3efJNIOWaDzf4EpDe2FFXGVuQfnWeytpNRF70sb0JTLL1eRNXzO9pnp3bjUDWKFQBfUgKOZrzqYGpAejHzLtd0W16CHi762AtO+DDEE64fXAu83we8YeDq3fj48N73Vm7676Ae7FHuWFHci8mJsl8n1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710757474; c=relaxed/simple; bh=ery6NRFC2rTlrIrfvpDvhH0oInDvwM5WelThauRvuDo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bMaaLUC7abaD5Pi90jL7zhncqhrRxSVFrcLAktqESJ64p7p94sAejoFtdpvEiaA34W3hsMoVfMlUGMnFDVN14/8b0GdJm440veBYdx0beii1s2yoGCzfMtvp9XhFczCBG7qSLcBRVhaFsH1TY+r0XLnTFL82qx0RvueQfB588wk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lmoK1sgR; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-514a8259ec1so199335e87.1; Mon, 18 Mar 2024 03:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710757471; x=1711362271; 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=kntj7D+3C8Siu9Mte/gOo4b2BDgoQlvmaeXCzlwHfd0=; b=lmoK1sgRotMr6NFD81+Fuxb7w39vRuu3qzIlp5/t81ZYSPIrB+nEXjSPSXA9ToVdRP Mp8QTJNDSfCEdf0hy9c11DxO4gdb1rNEhW+DM9FWJP97zaafW+2d3XaeS9YrefzBMZVt 56rUxk3on4qAtXt/7oW27ezG5I1B61LHeyEIsZoSZyQ9eCpxb2s5wx6nWE/gv+xqT+e4 RPixKY/E5KSRst8RPeKYf6hzFy0RXhg9ZIAHdGIKmUfmbzulMy6yhSxNNSlnv5uwAoqs VdkP7CsyGN84cy3IFrYldmq4Btp+OJdM2z4O7G/vqSHXNuUTZbvF5+t8mKjVPY3bMI5+ u6kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710757471; x=1711362271; 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=kntj7D+3C8Siu9Mte/gOo4b2BDgoQlvmaeXCzlwHfd0=; b=QUwCpQ+2LXHBHkKcLQP/seKKZDiHJGoblUMyRpKlpganhdi6XGV0lTvhkXhtl3vHRy qWkgSe8UCCBmjJUE2EeYcta1cPmEhY/ogBg/a8OgmCjMHV82aroi0JHmrI46DWJfIjwW 8I59bGhQoBr9RI/6qpwkhLCqpVeJe3rcwHuziHNYpcFv1frJg6ruHSAuYnMu/84Fip7l Zp/ImQdjVeFN1pM/TQOIKTANjhNvg6HbOaQGA/WrbKJfsg74nCp2fIQB+ntra5/mM8hx HlfcC8fIHnJp9Yb2EUclTRlj6nTCcUZc78D6sHg1HPIyv726BQEtkVmNfQeTS/q8tBxw Dx9g== X-Forwarded-Encrypted: i=1; AJvYcCUC23pS2NdAqIiNXT7aANnvfWkPolTn/inVKxfbbkU0xGXJNytORUpXyEAbM2DE4T7V3E8Q6OQd7HRJvFpQtgqTyRm+mV7281Gz+WFWuH2YQQikLCjnSsW1RQ0yhvHDWIJB5Qm73LOh2O/s6MOASI4eXMWG9HZY545KO3CT1sUzuXyTZ/4= X-Gm-Message-State: AOJu0Yx5GWurtCdzu3awWEpozeeRcrU54ezuT6BUy5tRXmO9wiWyypZY j7zzdigmBvP5AwFfJUNlSGshMaP+6w9ssCn7H+sg6nxQQajL4wXgpblX2OehT68P3tyZndiSpiw GbOLRgMMNL+e9NzAf9B72uHXkfE8= X-Received: by 2002:a05:6512:485c:b0:513:ca84:3a0e with SMTP id ep28-20020a056512485c00b00513ca843a0emr6709998lfb.58.1710757470631; Mon, 18 Mar 2024 03:24:30 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240317222718.3e03edb1@namcao> <20240318100108.4fafd72b@namcao> In-Reply-To: <20240318100108.4fafd72b@namcao> From: Eva Kurchatova Date: Mon, 18 Mar 2024 12:24:18 +0200 Message-ID: Subject: Re: Boot hang with SiFive PLIC when routing I2C-HID level-triggered interrupts To: Nam Cao Cc: linux-riscv , bugs@lists.linux.dev, linux-i2c@vger.kernel.org, jikos@kernel.org, benjamin.tissoires@redhat.com, dianders@chromium.org, mripard@kernel.org, johan+linaro@kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 18, 2024 at 11:01=E2=80=AFAM Nam Cao wro= te: > Nice! I assume I can add > Reported-and-tested-by: Eva Kurchatova > to the patch? > Yes. You can also add link to upstream RVVM repo if anyone is interested in reproduction. This RVVM patch applied to 0.6 makes a keystroke storm: (window_update() is called on each display redraw and has access to hid_kb) diff --git a/src/devices/fb_window.c b/src/devices/fb_window.c index f170e2d..17e2519 100644 --- a/src/devices/fb_window.c +++ b/src/devices/fb_window.c @@ -77,6 +77,11 @@ static const uint8_t rvvm_logo_pix[] =3D { static void window_update(rvvm_mmio_dev_t* device) { + fb_window_t* win =3D device->data; + for (size_t i=3D0; i<100000; ++i) { + hid_keyboard_press(win->keyboard, HID_KEY_LEFTCTRL); + hid_keyboard_release(win->keyboard, HID_KEY_LEFTCTRL); + } fb_window_update((fb_window_t*)device->data); } > I am still confused why RT throttling doesn't unstuck the kernel in this > case. I will consult some people and investigate more on this. But I thin= k > this patch is good on its own, so I will send a proper patch shortly. > > Best regards, > Nam RT throttling kicked in *very* rarely, in most cases where the unpatched kernel was actually stuck RT throttling wasn't reported at all. It didn't hang every time either, so it's possible that RT throttling helped sometimes, but not enough to always recover from such a loop: [incoming IRQ]->[IRQ claimed]->[no handling]->[IRQ completion (which immediately triggers phase 1 again)] Best regards, Eva