From patchwork Tue Jun 4 15:51:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10975583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E57DF14E5 for ; Tue, 4 Jun 2019 15:51:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6B731FE82 for ; Tue, 4 Jun 2019 15:51:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B95EA2000A; Tue, 4 Jun 2019 15:51:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BD87C1FE82 for ; Tue, 4 Jun 2019 15:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Y/ts52Rus+f+nJFoHjO6G1X78NV6Pv1sAOsBIHs9YYI=; b=TL+kbGO7+k+YR8 1BGqL93mryw4u6bw8VPsOKxjfUME5Nsg/EKPJJ3Lkv04oQc3CZ87JFmqZ1mRhE0OgpG8qduQtSnFO WimfPSJfU6MYxQZDHjQgyHhpCtXeqdxm6WegstXW+nLeEWPqE2EYwHK5fcAHKYR2DtKIn+w7t4Isg Mi4yG9ai92Qj2rNJPiitucC2XIHQyrbGmAhREO7a9j388k38RC4K/MMCTIJftEdNiR8oI9tXoIiiz DRR9z1b0T9RTXX/65eAuQ0nswmnt7gdfWWvGRwB40zXCWRt8iturPNAPSLQarSGrz+kItP7J4TnoV cx23fc6mjcjBlgQaFnQA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYBj2-0008AS-9t; Tue, 04 Jun 2019 15:51:48 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYBiy-00089p-TR for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2019 15:51:46 +0000 Received: by mail-wr1-x444.google.com with SMTP id e16so8129960wrn.1 for ; Tue, 04 Jun 2019 08:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qH4FDRgRxazUxppnfy66oz7/ZG4EwLFotnt4vrr38Jk=; b=ph1lWQ+lD7EEE/KoatFoMerQik8dUq2QfqaGCfo7jVtKJxMuNmqsThFLNMeeh7kkS+ FD0nIKmo1GtzpfttCVJcwIMmJyB5JHhFexJ8+8wALREiZztVcbbLGac6k+1wZ4wWMQ9s S549TuGx7TdiORJMeoMfamHmIMeL9vhVWIvKklBmPOPrBXdf3KFoneu4kcfpMmIysKvr uSRWIkIh4h4kotHAJTFeNJ3qlTXKjXzHdRRumEHoXdy+N3gIqnghr8iBDZuMd1K+4kZq C/YWPpXgeDGmws4DQaMkdvTWNtLXBZFlbTRRUiwk4764DdtYBpwO87yIfQElPI88QA2e ldaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qH4FDRgRxazUxppnfy66oz7/ZG4EwLFotnt4vrr38Jk=; b=GmSTY24ugCjBsqfgpaAegZzY8n9agoxBkWNXx8ZV/VvNbdN4tRXJqjl/22ifFYoJC9 kRsV0Ifq6HJ98zn1A3hihxocp8y+FSO7zXx5bn8ZNldh0Rw00kq6zmj+s8GXGfFXOGUJ 7l95LiMuz+7y9tmaQBziIpCnb62xnJ/seNWKU06K1uglA7H83/JetcdQ3PCI1vVwB75t X1WFKFz6LeR0iPOOCQ7ue6KGDbsNJq5KZ0UcWae4p2F3T4PK1ZIPQZMgGvBcZT+G6ZAm iCDnOlhfUiNpbFKfJWtX9/82kujKu3LxQ+SuzWk6umzywDevY0YI5AGo0YDZZl6XiVJR AVcg== X-Gm-Message-State: APjAAAVDqlKpKJ4ImiDc1yWF1j8CfHbi8N0pTwRDX0UVGA/Zbzwimark DrMSwgd3BuPah0JY1dxBb+Y= X-Google-Smtp-Source: APXvYqyJDCOSSw64vLkSR9L4wCqk+kXrRkrMGCNK8o6OONOCjbvwA7NYyHqVoIQWqFYEp/Nq7LQ24g== X-Received: by 2002:a5d:404a:: with SMTP id w10mr2976806wrp.177.1559663502864; Tue, 04 Jun 2019 08:51:42 -0700 (PDT) Received: from localhost (p2E5BEF36.dip0.t-ipconnect.de. [46.91.239.54]) by smtp.gmail.com with ESMTPSA id d18sm3511733wrn.26.2019.06.04.08.51.36 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 04 Jun 2019 08:51:36 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH v2 1/3] soc/tegra: pmc: Fail to allocate more than one wake IRQ Date: Tue, 4 Jun 2019 17:51:33 +0200 Message-Id: <20190604155135.25390-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190604_085144_968995_CD6BA639 X-CRM114-Status: GOOD ( 11.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, Bitan Biswas , linux-arm-kernel@lists.infradead.org, Jon Hunter Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding The code currently doesn't support allocating more than one wake IRQ at a time. Detect this situation and error out. Also make sure to output a warning when that happens to help track down callers. Signed-off-by: Thierry Reding --- drivers/soc/tegra/pmc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 5648e5c09ef5..653fe2c466f6 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -1863,6 +1863,9 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq, unsigned int i; int err = 0; + if (WARN_ON(num_irqs > 1)) + return -EINVAL; + for (i = 0; i < soc->num_wake_events; i++) { const struct tegra_wake_event *event = &soc->wake_events[i];