From patchwork Mon Jun 10 00:49:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 250171 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 767D82C093B for ; Mon, 10 Jun 2013 16:01:23 +1000 (EST) Received: from mail-ee0-x22b.google.com (mail-ee0-x22b.google.com [IPv6:2a00:1450:4013:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id CDBD62C02B9 for ; Mon, 10 Jun 2013 10:49:38 +1000 (EST) Received: by mail-ee0-f43.google.com with SMTP id l10so2000409eei.2 for ; Sun, 09 Jun 2013 17:49:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=HRuNjedqi3QExVH02uyBKSqmJnlHsP28bQgKEGLcI4g=; b=dzmoURXY4SZkRjma4K4Qvevmro/enXE6MJdJVtHKZibWgMHjuSkRCKVfQi18cVPeDQ QWJ/tveNLhM9Uhvf4qu7Td7eN+hXlK5eaLtE1PYaM9lbvaCPVz7u66li1O+vywQFGUJY rEbTHVY5qdzJdMxJXyDbFcqhFDLvzZ6IRSP8ZLgH1qIynNyR042oSJgCNvWRz+0m0jKK eSbtGuJGfHZBDiaTbiCau8rstsR9WNfwTy52PtxF4nDQU3ijUarzg9KsOnzWaCa9vVY3 Awn/qKAW5CkqZBFAFfSXiNqWPhsi6G7VPRoF57kAYC0D6PQTaDcg6l9BH6UnaXgvwf+B BaOQ== X-Received: by 10.15.51.78 with SMTP id m54mr8555151eew.1.1370825374607; Sun, 09 Jun 2013 17:49:34 -0700 (PDT) Received: from localhost (host86-179-75-146.range86-179.btcentralplus.com. [86.179.75.146]) by mx.google.com with ESMTPSA id 3sm19167958een.7.2013.06.09.17.49.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Jun 2013 17:49:33 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 6BE9B3E0A90; Mon, 10 Jun 2013 01:49:31 +0100 (BST) From: Grant Likely To: linux-kernel@vger.kernel.org Subject: [RFC 03/10] irqdomain: Add a name field Date: Mon, 10 Jun 2013 01:49:15 +0100 Message-Id: <1370825362-11145-4-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1370825362-11145-1-git-send-email-grant.likely@linaro.org> References: <1370825362-11145-1-git-send-email-grant.likely@linaro.org> X-Gm-Message-State: ALoCoQlAIkroqnKKB9tbDXydGEPtxV6vF0w4nOj6FrV8eR/qSfRPod+cFd20BSRPBNdaH+ux2TWH X-Mailman-Approved-At: Mon, 10 Jun 2013 15:58:48 +1000 Cc: Grant Likely , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Arnd Bergmann X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch adds a name field to the irq_domain structure to help mere mortals understand the mappings between irq domains and virqs. It also converts a number of places that have open-coded some kind of fudging an irqdomain name to use the new field. This means a more consistent display of names in irq domain log messages and debugfs output. Signed-off-by: Grant Likely --- include/linux/irqdomain.h | 1 + kernel/irq/generic-chip.c | 1 + kernel/irq/irqdomain.c | 19 ++++++------------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 6f06241..e5e513c 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -89,6 +89,7 @@ struct irq_domain_chip_generic; */ struct irq_domain { struct list_head link; + const char *name; /* type of reverse mapping_technique */ unsigned int revmap_type; diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c index 95575d8..ca98cc5 100644 --- a/kernel/irq/generic-chip.c +++ b/kernel/irq/generic-chip.c @@ -305,6 +305,7 @@ int irq_alloc_domain_generic_chips(struct irq_domain *d, int irqs_per_chip, /* Calc pointer to the next generic chip */ tmp += sizeof(*gc) + num_ct * sizeof(struct irq_chip_type); } + d->name = name; return 0; } EXPORT_SYMBOL_GPL(irq_alloc_domain_generic_chips); diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 1ac8cf4..b1b5e67 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -410,12 +410,15 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base, */ if (ret != -EPERM) { pr_info("%s didn't like hwirq-0x%lx to VIRQ%i mapping (rc=%d)\n", - of_node_full_name(domain->of_node), hwirq, virq, ret); + domain->name, hwirq, virq, ret); } irq_data->domain = NULL; irq_data->hwirq = 0; continue; } + /* If not already assigned, give the domain the chip's name */ + if (!domain->name && irq_data->chip) + domain->name = irq_data->chip->name; } switch (domain->revmap_type) { @@ -708,8 +711,6 @@ static int virq_debug_show(struct seq_file *m, void *private) { unsigned long flags; struct irq_desc *desc; - const char *p; - static const char none[] = "none"; void *data; int i; @@ -731,20 +732,12 @@ static int virq_debug_show(struct seq_file *m, void *private) seq_printf(m, "0x%05lx ", desc->irq_data.hwirq); chip = irq_desc_get_chip(desc); - if (chip && chip->name) - p = chip->name; - else - p = none; - seq_printf(m, "%-15s ", p); + seq_printf(m, "%-15s ", (chip && chip->name) ? chip->name : "none"); data = irq_desc_get_chip_data(desc); seq_printf(m, data ? "0x%p " : " %p ", data); - if (desc->irq_data.domain) - p = of_node_full_name(desc->irq_data.domain->of_node); - else - p = none; - seq_printf(m, "%s\n", p); + seq_printf(m, "%s\n", desc->irq_data.domain->name); } raw_spin_unlock_irqrestore(&desc->lock, flags);