From patchwork Tue Jan 21 07:28:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1226268 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4820Xf53LPz9sPJ for ; Tue, 21 Jan 2020 18:29:22 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=iPTvILKf; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4820Xd334JzDqWX for ; Tue, 21 Jan 2020 18:29:21 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::641; helo=mail-pl1-x641.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=iPTvILKf; dkim-atps=neutral Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4820X75vXgzDqTQ for ; Tue, 21 Jan 2020 18:28:54 +1100 (AEDT) Received: by mail-pl1-x641.google.com with SMTP id s21so950946plr.7 for ; Mon, 20 Jan 2020 23:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UzYPUUGqcl5t5h1BsNe7wNFEV4tL9LRlzYiUgq4RfaA=; b=iPTvILKf0XZa7kMmydKb6wBCssottf7gB5QP4/mGgGFaLMmHpnAgkUNICVW8lWv/fF a6sYX5sW9vU+RTJVyiywP+2iqcmeSyKjjR0STnj7uRPkRV1Iz+oAlpbdNtye30c6ZUjP xu4vgUEUAIFaS0xv8xsvAQ9mb7xCxbgmKTaXRR59L67TXKHKJQ9ekJ8rGHeykIM3HM4J yXUydl7cU57FNEfI/HNkZsNP2HTVba11xyI8cKjyrrHB+ka/OLwcUygC2H97mRPoXAbK p+TO5RWaX2QPQBptinifYhVEU1sUxgpu2vPEAdQwxZjEEy+C4+lLtekpUTzMjX0ssWDJ Uwzg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=UzYPUUGqcl5t5h1BsNe7wNFEV4tL9LRlzYiUgq4RfaA=; b=RUc/S3r9JFNoz6qmla4t910pgV5tonaAbo5LIm/m6Dc3sGhOeJ4fu7xNepBD7LAFxz l3MRRyhfGnWqSfT19Y1d0U5pD2UAXq6s3nhDaPZSCxCJPP3fyrqz1AqIvlUYgoFJmb3q CPNw//WzeC/yLnnA/o1GtFHvL89MkrWOwoh7DnHdfMNwAsdY9fMT0gVXdOehPR9kgNw4 a8p9PaVKsDAfNOEqxu5qbOP2bvwZ3vGc6UOsg+WUd1Y7J5guZG9vExlslO0Lby6OPtng VVqi6wKMMZk8w+PfN9V2lJeJRZGHF1lTNyXuEtwG+ESgcX3pJC6TlgmMQkwh12AsyRpF h6BA== X-Gm-Message-State: APjAAAVBDFz1ArAQ4ijYXpFACM5yjOk7N78VJQyqx/qRwX62hreoeH5B ldMscs5uo7CjZ36IyhrTVEWpv2GN X-Google-Smtp-Source: APXvYqwdFCT6wcqo858WML+g01lzwcjOCMJN6UJqj207VzizEIQm/XOf78GxtYRPVHB5rHgar+WiUg== X-Received: by 2002:a17:902:8f8a:: with SMTP id z10mr4135233plo.169.1579591731530; Mon, 20 Jan 2020 23:28:51 -0800 (PST) Received: from wafer.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id u3sm41027750pga.72.2020.01.20.23.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 23:28:51 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Tue, 21 Jan 2020 18:28:35 +1100 Message-Id: <20200121072838.2771-2-oohall@gmail.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200121072838.2771-1-oohall@gmail.com> References: <20200121072838.2771-1-oohall@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 2/5] hw/phb4: Fix interrupt names X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Linux doesn't seem to parse the interrupt-names property when there are unnamed (zero length string) interrupts. Add a name callback to the interrupt source and go from there. Signed-off-by: Oliver O'Halloran --- hw/phb4.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hw/phb4.c b/hw/phb4.c index 0b7bf778a50e..2591c0390d5f 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -5613,9 +5613,26 @@ static uint64_t phb4_lsi_attributes(struct irq_source *is __unused, return IRQ_ATTR_TARGET_LINUX; } +static char *phb4_lsi_name(struct irq_source *is, uint32_t isn) +{ + struct phb4 *p = is->data; + uint32_t idx = isn - p->base_lsi; + char buf[32]; + + if (idx == PHB4_LSI_PCIE_INF) + snprintf(buf, 32, "phb#%04x-inf", p->phb.opal_id); + else if (idx == PHB4_LSI_PCIE_ER) + snprintf(buf, 32, "phb#%04x-err", p->phb.opal_id); + else + assert(0); /* PCIe LSIs should never be directed to OPAL */ + + return strdup(buf); +} + static const struct irq_source_ops phb4_lsi_ops = { .interrupt = phb4_err_interrupt, .attributes = phb4_lsi_attributes, + .name = phb4_lsi_name, }; static __be64 lane_eq_default[8] = {