Received: by 10.213.65.68 with SMTP id h4csp2116835imn; Sun, 8 Apr 2018 20:07:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/e8xdepIGK0euyYTVow8L4kKyQdGjFXxelIQWqWCWydXLdwg3DGzQw0bsu9IJ8NeW9gDvK X-Received: by 10.98.206.77 with SMTP id y74mr27847565pfg.205.1523243268196; Sun, 08 Apr 2018 20:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243268; cv=none; d=google.com; s=arc-20160816; b=dM/76jNcgY31+df10cDJ/1XCIjzBGtvgw5rf5su/a3Zt35149XY47hbLv7HOultWU8 Ycfm5Q40J+/X+4AS68Fb5u4Wz5Qyszi4mO+Vr4AqkWXjL3qEToFFc/uoJTDMyj+Nqx6s q2nT6rT6+N0dNHZHgXz27gsA3ltYcrbJJA4EsqbS9wcjzzUyQejcf3OoK87KAQhjXu0n yGDrcvupI9X2X0uBhC0gFCcoc9lD5CWbBAoCbI/y26CGCqBLebaIdwD1uR+ExcPsmGqH mxr5k5J2TkgB3VGDxC/dhosxkNgVUrEbIgBzT4taJnUMW18klQ+LLOCYqCoyCcrLlB2P +DyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=5S81j+AtAYDeyEEDIVplnCQ0UwHKSGiuj8bUtV3NME8=; b=TOVMVzkTDhm6Msw4f+am+pvbf80unmcSO9H16DZXK7RhSF/6a1QqCJI00f2/sB2cGu 2JZnNZE2ctcDEPjg9LcB+QpW6ir3Z9K4kw1r7a5qcOkW5pOxyXA3KYye6K4VNDHvWHnx QOa16WtviBIRhGVD0eI7cW5EES604SxF/YPLYTHi/0CE25fPF0CkEiJ+Wb9bLkkPPpEr gJ39qL51IOakTGiOU1q3pMYuIJ75BI23cEY9B8xFPftlOmyYOWDq5DSDA7SdzZMO8uu2 y5huEDRHwjtzje2b+GXrgc0HEe1oXR+rEzR8kVqWcUwgNnmiLmwJLKKXWohqZIKiL85u yhqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=hNTEs8pt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3-v6si13553275plb.147.2018.04.08.20.07.11; Sun, 08 Apr 2018 20:07:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=hNTEs8pt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757246AbeDIBSQ (ORCPT + 99 others); Sun, 8 Apr 2018 21:18:16 -0400 Received: from mail-bl2nam02on0103.outbound.protection.outlook.com ([104.47.38.103]:27456 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932835AbeDIAhs (ORCPT ); Sun, 8 Apr 2018 20:37:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5S81j+AtAYDeyEEDIVplnCQ0UwHKSGiuj8bUtV3NME8=; b=hNTEs8ptXbATtVDEcieH6BMrxuopzrBz9OM3uKRHxDucH3C7TKZPLj3JcxcC5YPoHZeYoVszrVroBLwwqDKEYi3uHCNtTTue+0nDXA73q+NGvJYwpP8riS9t8JrIetSQiDAQ4PaP61mjwfqYgYQfgLmZB8/lTATpW7NBm+V97hc= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1110.namprd21.prod.outlook.com (52.132.131.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:37:45 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:37:45 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Suzuki K Poulose , Marc Zyngier , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 102/162] irqchip/gic-v3: Report failures in gic_irq_domain_alloc Thread-Topic: [PATCH AUTOSEL for 4.4 102/162] irqchip/gic-v3: Report failures in gic_irq_domain_alloc Thread-Index: AQHTz5nBihZuzVcJoEyiVVM67zR2RQ== Date: Mon, 9 Apr 2018 00:29:01 +0000 Message-ID: <20180409002738.163941-102-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1110;7:dxmTx/bmmojDM59YOO85qomyUa2rUFEUgRAy+uvpDllgLkctIxrfF7wjC6uxlSLzOtrZftVf1n8BZGk0qZiVVKgyNbzZPoPhViJxIhh6gE49LR/UCABL2zJ9aZSttQxdsVG2TOyaIC2JTqWKK8++cl5bbrFFuVgloxqottEcYK66eDqKOE0IQth57qHtSnUdSHuctRTpDoNSpKVbLeGPbdCQCVNvinPULqsrktPsTuk4B2sjyER8woowoOlLoR8l;20:P/kOtptDx6Iq5s9RvdIH3NI3muytteFyZqswQ8Z1ameqw7GkrHyq1YIaqrNTjYKJrofE5d0KPQkmtILfa6Ct1ObGf3L2AC4a7O4DKjm9RSy2R9QsppgZ+DS9hRYQhh6ZijRt9EkCRepAyewehyrQLl8haud6mVXyilrsGJ2AFwQ= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 1a6a61ab-f7df-4610-b943-08d59db21cbf x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1110; x-ms-traffictypediagnostic: DM5PR2101MB1110: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1110;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1110; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(39860400002)(39380400002)(346002)(396003)(376002)(366004)(199004)(189003)(53936002)(186003)(5250100002)(105586002)(11346002)(99286004)(476003)(66066001)(6512007)(86362001)(575784001)(3660700001)(1076002)(54906003)(68736007)(110136005)(3280700002)(316002)(305945005)(4326008)(107886003)(22452003)(14454004)(7736002)(446003)(6666003)(2501003)(10290500003)(3846002)(6116002)(72206003)(106356001)(25786009)(6486002)(6436002)(8936002)(478600001)(5660300001)(86612001)(8676002)(81156014)(59450400001)(2906002)(102836004)(81166006)(6506007)(2900100001)(76176011)(2616005)(486006)(26005)(36756003)(10090500001)(97736004)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1110;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: xNQV2lJ0dNvepce2Tsn6w2szmfv2YIqagrUABap2BYWamhxSpJlv0UeQ0m/37ap76T2caGKVkffeiYHFt5dlQn0ZNpDNsjdhOzZ3x6LoDQRQ4LIXGPEoXC5bxCXWZsbub7VzAvb0T9TSwJeTV1No0iTHw854yTe0uiC7dxueC+G1Ifg+uiIGfsCdz7nkQY9ikjV8UbGhxiEaIBnM9TDn88da+ZDERUQ+GiSNJtEhFTA0ZhMw7TY7ZCGepaIFUZMjNQmNLCbIwNn1CSbDtoI/bTHjWuINPJZDVqFHBCgdBDhEsTAgqPCY+L1wrb3+YaUOz30fd6aZRRNiPezaHQUePzat2O8fjouHeh4CHEIFQ7dHTCfeA49vpEwmYRxj3ICx2Q6AIZFXKNmEMee9HeYtBaHTyiKlO9v16nkhKKiVdU0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a6a61ab-f7df-4610-b943-08d59db21cbf X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:29:01.5054 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1110 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suzuki K Poulose [ Upstream commit 63c16c6eacb69d0cbdaee5dea0dd56d238375fe6 ] If the GIC cannot map an IRQ via irq_domain_ops->alloc(), it doesn't return an error code. This can cause a problem with drivers, where it thinks it has successfully got an IRQ for the device, but requesting the same ends up failure with -ENOSYS (as the IRQ's chip is not set). Fixes: commit 443acc4f37f6 ("irqchip: GICv3: Convert to domain hierarchy") Cc: Marc Zyngier Signed-off-by: Suzuki K Poulose Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin --- drivers/irqchip/irq-gic-v3.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 3f1c4dea8866..5d93e0254d70 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -802,8 +802,11 @@ static int gic_irq_domain_alloc(struct irq_domain *dom= ain, unsigned int virq, if (ret) return ret; =20 - for (i =3D 0; i < nr_irqs; i++) - gic_irq_domain_map(domain, virq + i, hwirq + i); + for (i =3D 0; i < nr_irqs; i++) { + ret =3D gic_irq_domain_map(domain, virq + i, hwirq + i); + if (ret) + return ret; + } =20 return 0; } --=20 2.15.1