Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1212149pxa; Thu, 20 Aug 2020 05:48:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2z6+o/j2ioxXc/4x/kl95TCk+An7KwSlC2RP2EigR4TEZjfeYVFBZ+yCJ8u0Ifkco30P+ X-Received: by 2002:a05:6402:1ca6:: with SMTP id cz6mr2645445edb.310.1597927721695; Thu, 20 Aug 2020 05:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597927721; cv=none; d=google.com; s=arc-20160816; b=j6V2BUsh8Pihpn59fzdW3+NgO+SKkUWW1VGEq3ONgF8liepjlt4YGKS3bn2mpd0m7S wajU2uqEUZOD+KNrRFii8zFJE+KRJEE0NCdzlcG50ZfkiU1ecZovqYlPBvnhhZtPtm4K HnqkYUlCDQ/CJxrLrntdbdvKzGcWFvuwvCWmToG9u79Piq+HF04kxK68iyuubOWs6ldm iQ8tR6tn5G0yEDli7KO0nJy+gqg/phRToqscg5Ra8qstoKe+ch9ilpgmm4DkjQ0shOn9 peDOK+JgrnQgTtmi55Rybvh9gccrnLurGzmlDX8z9RvJoIhdKLZe2aWe0xv05J2qByT+ bA0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dJL2uoVDVyUoqELzwLEw2wsPLm57shMYESLfeqzX+vE=; b=na2W/apIDDBN+8H5V5DI9gVQwGIQOkq53dDpeoUuqPBcL2ir5ocE9tMO8BIFxd1dXq G6p6l+f753K1TpGmvHTsDjk/DutaMWz0hZLYuiTCfN+SCNmu+zgVm77lq4VZWWzmSfao 9yNv7nwaFrBfB09CuN8sW7YPzUD6vra53AjAS6mjawsv/InDDLAjsGXuNhrDKe7vZfc7 bsD5YD5ARs2BalKOOzJoiYpByEquVcGQir1+IpO6rFFMGVsKgM8zkVRnP3Oci1Al9dDn 4eGzMeXD/qpUWQPPYOr8E1SKmnt3r78o+Sc3XHJdrzrixH+AVwUUr57CgjwDExQOWERi yP5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KypVw0nR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si1091106eja.692.2020.08.20.05.48.17; Thu, 20 Aug 2020 05:48:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KypVw0nR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729371AbgHTMrq (ORCPT + 99 others); Thu, 20 Aug 2020 08:47:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:45860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729204AbgHTJpR (ORCPT ); Thu, 20 Aug 2020 05:45:17 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B7CA822D37; Thu, 20 Aug 2020 09:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916685; bh=9wY0bvHnP823z5bTKju7vuT8yhn2NEW7Ay9LUlzPZQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KypVw0nR9aRQ7m5jymfZ1Z8csYgKqs/erciGfEsEWqkipfDt3ZQxCXAD88m2wD7YQ l+Md0TBIk3ZENcTedb5Yu0bZ42j8T2N4ul5pV4Z2kEwDZAjREUYL7Di6KksX/0kKFW 8znZHiKB32ETHbKG0gl+Hn/dyw6JgkSrn9i0e/+0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guenter Roeck , Thomas Gleixner , "Rafael J. Wysocki" Subject: [PATCH 5.4 003/152] genirq/PM: Always unlock IRQ descriptor in rearm_wake_irq() Date: Thu, 20 Aug 2020 11:19:30 +0200 Message-Id: <20200820091553.795295304@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091553.615456912@linuxfoundation.org> References: <20200820091553.615456912@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guenter Roeck commit e27b1636e9337d1a1d174b191e53d0f86421a822 upstream. rearm_wake_irq() does not unlock the irq descriptor if the interrupt is not suspended or if wakeup is not enabled on it. Restucture the exit conditions so the unlock is always ensured. Fixes: 3a79bc63d9075 ("PCI: irq: Introduce rearm_wake_irq()") Signed-off-by: Guenter Roeck Signed-off-by: Thomas Gleixner Acked-by: Rafael J. Wysocki Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200811180001.80203-1-linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman --- kernel/irq/pm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/kernel/irq/pm.c +++ b/kernel/irq/pm.c @@ -185,14 +185,18 @@ void rearm_wake_irq(unsigned int irq) unsigned long flags; struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL); - if (!desc || !(desc->istate & IRQS_SUSPENDED) || - !irqd_is_wakeup_set(&desc->irq_data)) + if (!desc) return; + if (!(desc->istate & IRQS_SUSPENDED) || + !irqd_is_wakeup_set(&desc->irq_data)) + goto unlock; + desc->istate &= ~IRQS_SUSPENDED; irqd_set(&desc->irq_data, IRQD_WAKEUP_ARMED); __enable_irq(desc); +unlock: irq_put_desc_busunlock(desc, flags); }