From patchwork Tue Jul 11 16:45:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salter X-Patchwork-Id: 107408 Delivered-To: patch@linaro.org Received: by 10.182.72.42 with SMTP id a10csp5065332obv; Tue, 11 Jul 2017 09:46:01 -0700 (PDT) X-Received: by 10.99.115.85 with SMTP id d21mr866375pgn.8.1499791561425; Tue, 11 Jul 2017 09:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499791561; cv=none; d=google.com; s=arc-20160816; b=WqlQ+UoN5MoorFWhMPh4NUItF6SidJkj1hW8Vx95a508OHQ3vHaad6vuGbY7vMgnYY A+/8V1X83GZVDJjBX7brtvT1PeZFp1zYlexTjlgEI3cN48577Evc3CB2XzGysdW+9iI+ /QI46++R1v1wuOZmXcEmDRutMkfxPN1A9xZGeul6e7JLWVSzdUH8O+61k55Qs/wQAcm9 b6Knn3G39Ho3sSaHCi86QB/z4EPCO6C7KLuJpmiEABxbyS6FdaBqOuWZWiHEjoB0KgVr 8c5YFq2aI5LEkSScYR2QknsDWbiVzZZj6f1FtdqG4VI1LNrHX48naZrT70w6jsPPeXZm ++wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-filter:dmarc-filter:arc-authentication-results; bh=AlHkyAnLJ4zeo12ebNyujUGK106bleKDdX0RQXDdok4=; b=wa/sV/dCVHd2QuzaFcIO2M2ZzUhMOwLdkS4FtZRQ9gdttr8VV/Hs5a0LtQNC+UNEIA 01V1AGPS72fFgkv597CeAMniWqIWTTGlcTm0NpMdu4n/GIjXrgLh8ewew3vX+Yg/m3dE U0JpWB1EXFuqqYuy/kREG2uxmSl/7mlb9K+1w9YbQLQN8vaHZ6winjiCn0b8ftgm3k5n LS+c3hV0db6JhvuHBUMGfCRDAnabY2ajd33vuxKLVRem0DSy7lwwpfoHX6/eKqkaLKK6 j+uI6W7IEyO837ZSAZv2zYG8lUtdZneODelO1m8lHVn5yHSyDwxEA/764wTqkI0xCt+O cJ9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u127si267487pfb.373.2017.07.11.09.46.01; Tue, 11 Jul 2017 09:46:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932974AbdGKQqA (ORCPT + 8 others); Tue, 11 Jul 2017 12:46:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49970 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932627AbdGKQp7 (ORCPT ); Tue, 11 Jul 2017 12:45:59 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBBC74E4D4; Tue, 11 Jul 2017 16:45:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CBBC74E4D4 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=msalter@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CBBC74E4D4 Received: from t540.localdomain (ovpn-120-169.rdu2.redhat.com [10.10.120.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC5A37FB97; Tue, 11 Jul 2017 16:45:57 +0000 (UTC) From: Mark Salter To: "Rafael J . Wysocki" Cc: Marc Zyngier , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] acpi: Fix proper return code for function acpi_gsi_to_irq Date: Tue, 11 Jul 2017 12:45:43 -0400 Message-Id: <20170711164543.23439-1-msalter@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 11 Jul 2017 16:45:59 +0000 (UTC) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The function acpi_gsi_to_irq must return 0 on success as the caller ghes_probe expects an 0 for success. This change also matches x86 implementation. This patch was submitted around 4.5 timeframe but wasn't pushed because it didn't fix a real problem. Now that RAS/GHES patches are in kernel, this fixes an error seen on a Mustang (arm64) platform: GHES: Failed to map GSI to IRQ for generic hardware error source: 2 GHES: probe of GHES.2 failed with error 81 Signed-off-by: Tuan Phan Signed-off-by: Loc Ho [rebased to v4.12-rc] Signed-off-by: Mark Salter --- drivers/acpi/irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.4 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Lorenzo Pieralisi diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c index 830299a..7c352cb 100644 --- a/drivers/acpi/irq.c +++ b/drivers/acpi/irq.c @@ -24,7 +24,7 @@ static struct fwnode_handle *acpi_gsi_domain_id; * * irq location updated with irq value [>0 on success, 0 on failure] * - * Returns: linux IRQ number on success (>0) + * Returns: 0 on success * -EINVAL on failure */ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) @@ -37,7 +37,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) * *irq == 0 means no mapping, that should * be reported as a failure */ - return (*irq > 0) ? *irq : -EINVAL; + return (*irq > 0) ? 0 : -EINVAL; } EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);