Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2665336lqt; Mon, 22 Apr 2024 19:06:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVh/v4o3olFHvp5zH3QMh3TK/sYGpE+JddJhSA0H3HGIduEz2EXkPEdVw9RLole+FwbeYtIKDunNYBjf7nJbpK8tl4+uxFnvD5YqBWqzg== X-Google-Smtp-Source: AGHT+IGSveB49qikwib2auHdb3y0P1xf+M1Xxsdv8l9CZy29cEUd8l7l61NDh1eFQFwzvXlbNYnP X-Received: by 2002:a05:6a21:3d85:b0:1a9:49ae:853 with SMTP id bj5-20020a056a213d8500b001a949ae0853mr10715513pzc.45.1713838002491; Mon, 22 Apr 2024 19:06:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713838002; cv=pass; d=google.com; s=arc-20160816; b=V+IzYi9u+4hcRVSxDMa60OJ4DQ19/Oit8GlBduDZ/Mroj5FvH1MDg7/BsNGQCkOGB7 hYPJOTl9WtFR0OZwtHpRdhCvYZvtAh9sU+3KUPi5nP1U4AWwPDUYkb591q3OU4/9cQa0 g3jRhBOBwNqEJCufvwzIGmQNHyND5fhoXcjnPfC/q40mMeV9IB10ngipiW0QkB0ZE41m 5s+YAVIGfnx//RDS53oP8jJ9e5Vt/IjMPJXYIKSDMD9xgHqjARgWEt/KMXefUVCOWf1t M7nL+d2wQGnA8bJKnLdoV7SodW0vT+H4tuf2e4xTBR+xu0Jhw017PDTZAwfy05cIwX1D WdpQ== 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=waszPwSUwTOtETfRgHTu/kDUB/tVHu6WwyBPZl9yfsU=; fh=+/f0rylXhyoMWZoWgzi6Bct7o3QizvWMIfnqjn9/zfs=; b=Nt3JeNRkH6VxGdOERZuC2oS6uYx75A60ADlzEcVfHH5+e6yTmHVJrZE/SVok8w1INL B1bwApW8BE8/B2+xLbVNoldPvaAR3QKnWo4/QryjtzzAOZrgWq0Ej/poqj9bKMpGbHPw XCD3n6d6ENeEfMz8pzIoJM+tIRs4KDC8PR5bszuPKitHADiw1NymkG19TFFwcXWf74/5 JKexApn0/wG76+cdXAsiYe3/NQ8Oe4gm5MVVPExACxTKFZNhhm6YIy6Gx66rbdqK6mRi Gj9/5PnzOXZErkbkdy0f1J4Zyz0rje5Jgxp59Jew/RvZ4W6WstG79TP5rjKVhN10+hrH uElw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EpGiPlHo; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-154410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154410-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 75-20020a63014e000000b005feab3f4591si3311734pgb.152.2024.04.22.19.06.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 19:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154410-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; dkim=pass header.i=@chromium.org header.s=google header.b=EpGiPlHo; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-154410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154410-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 D14C7282B97 for ; Tue, 23 Apr 2024 02:06:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D16117545; Tue, 23 Apr 2024 02:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="EpGiPlHo" Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 8204833FD for ; Tue, 23 Apr 2024 02:06:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713837996; cv=none; b=NEmK9/z+vLge3w03ztpzJu2LVfw5bxgJvhMzEIfHtcfhjx5tQ0Js+r6la6WlkRJphlXjxzVO/UB+e+0WZqMw+3eym//NTVddBj7IqYB6VuZx61K467E0wJ44cfyw9GZJJR9unU/Lu2x/lt1ABKgjA15773TfS2eVNbuw169gCQI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713837996; c=relaxed/simple; bh=c2xonoCbADKF8/xTJiffDV6oZLP+9gnvZFV5ez6gLjI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tKtjgqiMo8p1txFD60Kbo1uzcSI1Csr50aB6hNKm4SqfmFLcbqP/4WG3qdYM+I3jmk90rG7jBhLceiBAL7f4ttnLuqEjTIwBkDTCcV8JwYS1e2nAIvRXqbwadGIEUxxYuC7Y67rLH0lJunxnQpZCDVEZnR8e2u8RueDG2GYV2eY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=EpGiPlHo; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-51ab4ee9df8so4994036e87.1 for ; Mon, 22 Apr 2024 19:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713837992; x=1714442792; 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=waszPwSUwTOtETfRgHTu/kDUB/tVHu6WwyBPZl9yfsU=; b=EpGiPlHoY/3UhTLaqetCS75r+hTOqoqgYZknbBXjy4+5x+DmnRCQjmJh03QuEcCRS2 Liy/FGWFGIBct/fNEn3QoMgFjfFYmK07a6nq5WUPIDCuafOu1Etna2uBCPd0x4pVikeQ tjF9oMyZ0krhe1Fzi3bErbVm2mGt2gLfPGf/Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713837992; x=1714442792; 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=waszPwSUwTOtETfRgHTu/kDUB/tVHu6WwyBPZl9yfsU=; b=MFn+iLokMHhA/XS1bx6AGG6Hm8wKPRyy/8a1zh2vEPS1Bm9pCsRM8aZ2NKyPuvob+S NAuKhkq4ZwLYYouJ3+cDhbFCbVizZpqMkmhuH5YWN3JYHRyl952KWIi8sX6SCkWl3O2K XhQpzu9q9LbGBRLs9jZClHwx/z+K2mwQvRq9jEjts9rmN7MhdzFKVulhT6qzh2mNzQZf 6Mro0u0AUqPEFfVvA+tKI/waNXLPFqMlNmrSFFBxej6MYxyoieb/TYXw1gnv1YjbdbbW pZDl467GMKC4A2B2KVOlUVC3OHS9rOefim2fAgvH50KKsSivNslV1fuN98UZuDDMcZQk aybA== X-Gm-Message-State: AOJu0Ywl+JvccO3XHYjpBOqjoFIcTP66R+lSbbTFEGmee+CCm0MqozSJ bjxK/yPuKEB0ECG8l9qSwqrpaRLBl0ypwPXPFl4Tt9SkbXLbx8Xj6j5q8YtHqxoLlpozUCM1a7B JSyzgFKugPi+GEM8GPWMqRRPgxqSyccmHY7kV X-Received: by 2002:ac2:48b0:0:b0:51a:f3b9:f774 with SMTP id u16-20020ac248b0000000b0051af3b9f774mr5993796lfg.21.1713837992555; Mon, 22 Apr 2024 19:06:32 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240418074652.126355-1-stevensd@chromium.org> <87wmopuobi.ffs@tglx> In-Reply-To: <87wmopuobi.ffs@tglx> From: David Stevens Date: Tue, 23 Apr 2024 11:06:21 +0900 Message-ID: Subject: Re: [PATCH] genirq: Disable suspended irqs when restoring affinity To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 23, 2024 at 5:36=E2=80=AFAM Thomas Gleixner wrote: > > On Thu, Apr 18 2024 at 16:46, David Stevens wrote: > > In irq_restore_affinity_of_irq(), after initializing an affinity > > managed irq, disable the irq if it should be suspended. This ensures > > that irqs are not delivered to drivers during the noirq phase of > > resuming from S3, after non-boot CPUs are brought back online. > > > > Signed-off-by: David Stevens > > --- > > kernel/irq/cpuhotplug.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c > > index 1ed2b1739363..c00132013708 100644 > > --- a/kernel/irq/cpuhotplug.c > > +++ b/kernel/irq/cpuhotplug.c > > @@ -197,6 +197,8 @@ static void irq_restore_affinity_of_irq(struct irq_= desc *desc, unsigned int cpu) > > > > if (irqd_is_managed_and_shutdown(data)) { > > irq_startup(desc, IRQ_RESEND, IRQ_START_COND); > > + if (desc->istate & IRQS_SUSPENDED) > > + __disable_irq(desc); > > Makes sense. But I rather avoid the whole startup/disable dance in this > case and let resume_device_irqs() deal with it. Thanks for taking a look at my patch. Should I send a v2 with your suggestions, or will you create a patch for your tree yourself? -David