Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp944684lqp; Fri, 22 Mar 2024 00:03:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVn+j6DLmhl7yeTyNgBaF5+7js8ULSDkVl3zN03eMe7b8l7tcPLedtiZrGpZ02X6OL7u9KPqOMn+GvMQXJ81LSjP4Vo5GuosG5erwZbxw== X-Google-Smtp-Source: AGHT+IFTf9S3TnJ99FzjKjOws7ilf6AISQg8jZ28Wdh0Ejvv7VXHOvI7pLG5MacuTh9tWWW5vs8w X-Received: by 2002:a05:6a00:1a8b:b0:6e6:e587:4859 with SMTP id e11-20020a056a001a8b00b006e6e5874859mr1712767pfv.14.1711090981186; Fri, 22 Mar 2024 00:03:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711090981; cv=pass; d=google.com; s=arc-20160816; b=fnaaH/DukFGv7NiYJh/WiO1b1Oya/0afdpoU0Sjw1MJUheY9EDGAzyyzCJtOWn9I3Z G+Pj2foK+iy7VzQLXRDKpYcto7AIQMVfkIOlajfRBn4+ZIZzesStRtZS7GNbaD2hoLRF pOzqYHgXhjQuF3P4GP+Kq9cVCracOgYNv1noPOfRmUHY/z7TNt8JEcrccx5oND8WSnJq JkIz0E4U+MzNXwpo+z7fjq9FqVARLB/6shpkzwSqkDI7K8sssSm8UFagGJcbsfrBCd19 cBQYKiRQ72CwqF5FhZCgdWrtxDKlYLfWp9ouPldkRVon6xxaEHcjVxAcnQPbmyCZHpK0 xYkw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=eiS3qG9J6mMzNFY6lGYJUzyU8506CYrK3SwtAiQf9DY=; fh=B5OfzIAgFKHcVHfyK5Swr43co/b4onZqxbnF9eYkNLA=; b=xcxYT5sqWdic1fzrDHRkaet2VN8H07Atl3PKTVs44PCK5BjeHBoSad/8V3XGvNHg/8 RxAv7XL4YrxPaUk3pY1I6gxjyDAGGQXhJfjFOh6BABTfovxZO1B2q9wQjVm/KHpKgUdu d0MrKvYKRDAkR4frkYpee7Ps2ZWgDI86SP1h2sS/gLOX8zq80+jBpbpOVXL2aw4arEN1 5+20/oHvYMECIVOyaRo6iqw6kRLT876i/mrzwC5zOfC4SIP1R0PDqO9qc8oo2Xzk9Y6t u0JDK46jub0/TB8oglBzVM+eTmPaWdHG+7WtWyTx6qw/6altn4TXe53eJvlSVEaWusXV Y1Jw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-111036-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111036-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 189-20020a6300c6000000b005c279da45f1si1425664pga.566.2024.03.22.00.03.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 00:03:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111036-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-111036-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111036-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5423A287210 for ; Fri, 22 Mar 2024 06:54:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5B6910A25; Fri, 22 Mar 2024 06:54:50 +0000 (UTC) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 AB58012E4E; Fri, 22 Mar 2024 06:54:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711090490; cv=none; b=rlJ8fSczxj7RN1TSratr7cDj+hXlL1iyIMt0xlMZBFUOxfhRyTFKYljKUys7ygYkijjSYxWywW+HYsx6kvWz00+Fycj49N9gj0++9gFs2e2UCpS9+4nnporiRJvlAFyoyu+wnKtcOq7KKCc41n7EySe7SPmL/yKcaiYneOdu5Bk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711090490; c=relaxed/simple; bh=+BNSGJsx1vJosmhq5hxoZxMU4t+RbrQAhNkSA77o6hQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TE/4HROEjper341i+jWiCYw9K7Fh5GK/UQr6REli/P5BU9iHBqdsiZTSVvp48EU1rIeGoYsP3e/gKrb0AKLahAO9MQdiO2UD6Pi7PLdjL2ZBE6B9AcFKgOD2ZmzdS11ig05duN6s4jakcnzwlifPr/YApWDjhYloJdosrQG3ANg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2d46d729d89so21168281fa.3; Thu, 21 Mar 2024 23:54:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711090485; x=1711695285; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eiS3qG9J6mMzNFY6lGYJUzyU8506CYrK3SwtAiQf9DY=; b=fKz8Fk4lcgsuiZN3azbRIcDpHn2CxhoXhCh+HSxoSVFyBuVxurNY2GfIZxQrDcCWTM wumTHdDs4TEOBE/mGGAH2uyYiya0UkinoczNbesiej17+d5iAVmA8pTx+dymHyuaZik6 Aw3XLjaKrmWFHM3g+0v3urrHIsvjT6DPKPP/4/J+53/RpdEOyz7y2cvW4bGvJtk/dbJH +9jxB4mB2odRzkv6KvFLjNUzfWkYzEW9E/iwMmEI9EASKnUkG+0/Jqo29VNbPe8qQyCX jUm8Qx38qX8tv44qkGpeTs1w6b9RE894qIa39WbUrsH+7MxD6VKodveS8AesTz96z76u bJvA== X-Forwarded-Encrypted: i=1; AJvYcCX6blEZqV3fDFolW6hUAvgmPAPQmQ1CZu+zRdCs9UoBqhIO1NuNa8iprz3Hv6TgfviAelII75RGk8PLh9762foscQYcNevgXcEAcP+ulaJNQfBs2OJbbb7iqJ3Pe6DyAArRTG8EZimYSXpR X-Gm-Message-State: AOJu0YwzKL0kIV6uon6eB+00x6OfJn0vMgy+1CLjWhX2bwbsZcCjiDKp V2HJLYuytL2X1ROyK5lvsHvbAkKgJbXoCz5a6SnzLds322yhYD1K2S7THJEO01g= X-Received: by 2002:a2e:beaa:0:b0:2d6:9e7a:1524 with SMTP id a42-20020a2ebeaa000000b002d69e7a1524mr1264647ljr.13.1711090484484; Thu, 21 Mar 2024 23:54:44 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:69? ([2a0b:e7c0:0:107::aaaa:69]) by smtp.gmail.com with ESMTPSA id l5-20020a05600c1d0500b004146a1bf590sm7961043wms.32.2024.03.21.23.54.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Mar 2024 23:54:43 -0700 (PDT) Message-ID: Date: Fri, 22 Mar 2024 07:54:42 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V4] kdb: Fix the deadlock issue in KDB debugging. To: liu.yec@h3c.com, daniel.thompson@linaro.org Cc: dianders@chromium.org, gregkh@linuxfoundation.org, jason.wessel@windriver.com, kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org References: <20240321110407.GB7342@aspen.lan> <20240321115017.2879691-1-liu.yec@h3c.com> Content-Language: en-US From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSE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+4QOgbcezWI wZ5w/JVfEJW9JXp3BFAVzRQ5nVrrLDAJZ8Y5ioWcm99JtSIIxXxt9FJaGc1Bgsi5K/+dyTKL wLMJgiBzbVx8G+fCJJ9YtlNOPWhbKPlrQ8+AY52Aagi9WNhe6XfJdh5g6ptiOILm330mkR4g W6nEgZVyIyTq3ekOuruftWL99qpP5zi+eNrMmLRQx9iecDNgFr342R9bTDlb1TLuRb+/tJ98 f/bIWIr0cqQmqQ33FgRhrG1+Xml6UXyJ2jExmlO8JljuOGeXYh6ZkIEyzqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <20240321115017.2879691-1-liu.yec@h3c.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 21. 03. 24, 12:50, liu.yec@h3c.com wrote: > From: LiuYe > > Currently, if CONFIG_KDB_KEYBOARD is enabled, then kgdboc will > attempt to use schedule_work() to provoke a keyboard reset when > transitioning out of the debugger and back to normal operation. > This can cause deadlock because schedule_work() is not NMI-safe. > > The stack trace below shows an example of the problem. In this > case the master cpu is not running from NMI but it has parked > the slave CPUs using an NMI and the parked CPUs is holding > spinlocks needed by schedule_work(). I am missing here an explanation (perhaps because I cannot find any docs for irq_work) why irq_work works in this case. And why you need to schedule another work in the irq_work and not do the job directly. thanks, -- js suse labs