From patchwork Thu Jun 26 07:10:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan R X-Patchwork-Id: 32530 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0C425201EF for ; Thu, 26 Jun 2014 07:14:40 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id rq2sf11997746pbb.10 for ; Thu, 26 Jun 2014 00:14:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=wnnnKbIQhKAosekWXNfwx43d+TAjwShnapV06+WxgIY=; b=fSVP51SF9LTLQ1hhq06UEaF8tEkqZFTUx4QsY0NDdLnIprESvRR3C6MjTM/K35hiIR jTJ6NJ3FOnzpgRdtBveTPKXbk9CImwaT7KcS7TV3cJH919Zzl5oFjILuvzXT+0X9ddrx O9q7Mq9Lr8HGWZdklfTFy9cPtr5xgCVYNb6zMDpzXzZYNdjtTLoxr3H0iYbtNCAfVY1A NdtMVRt1U7kmTcppz/EVYNrQkdDHo9xhtyCsXgmJrIiX8UlUclzmtHvk4F31GWRELynW 0OfJ+XOxIL0pQ5VN1J065tJ4899E1aOEtEvZCfwcMofBygeMUgsV8n0Kl7rtDrrcJQxw N2cw== X-Gm-Message-State: ALoCoQlRdPIlo1NXlpPurCTiGvhF8mzJUcfWRr67fdPckUBDEolKJ0Rt/YxfhJFtZmKJjmsrQS1U X-Received: by 10.66.151.140 with SMTP id uq12mr7480131pab.23.1403766880361; Thu, 26 Jun 2014 00:14:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.36 with SMTP id 33ls139935qgg.19.gmail; Thu, 26 Jun 2014 00:14:40 -0700 (PDT) X-Received: by 10.52.119.179 with SMTP id kv19mr9776743vdb.3.1403766880222; Thu, 26 Jun 2014 00:14:40 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id fp5si3837522vcb.75.2014.06.26.00.14.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Jun 2014 00:14:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so3202898veb.41 for ; Thu, 26 Jun 2014 00:14:40 -0700 (PDT) X-Received: by 10.221.25.210 with SMTP id rj18mr11573843vcb.5.1403766880151; Thu, 26 Jun 2014 00:14:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp10279vcb; Thu, 26 Jun 2014 00:14:39 -0700 (PDT) X-Received: by 10.66.182.69 with SMTP id ec5mr18392714pac.125.1403766879423; Thu, 26 Jun 2014 00:14:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bm3si8481527pad.232.2014.06.26.00.14.38; Thu, 26 Jun 2014 00:14:38 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756155AbaFZHOR (ORCPT + 27 others); Thu, 26 Jun 2014 03:14:17 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:48409 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755841AbaFZHOO (ORCPT ); Thu, 26 Jun 2014 03:14:14 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5Q7Dh9a009904; Thu, 26 Jun 2014 02:13:43 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5Q7DhcL025996; Thu, 26 Jun 2014 02:13:43 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Thu, 26 Jun 2014 02:13:43 -0500 Received: from uda0393807.india.ti.com. (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5Q7CTSf000852; Thu, 26 Jun 2014 02:13:40 -0500 From: Sricharan R To: , , , CC: , , , , , , , , Subject: [PATCH V4 14/16] irqchip: crossbar: Introduce centralized check for crossbar write Date: Thu, 26 Jun 2014 12:40:32 +0530 Message-ID: <1403766634-18543-15-git-send-email-r.sricharan@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1403766634-18543-1-git-send-email-r.sricharan@ti.com> References: <1403766634-18543-1-git-send-email-r.sricharan@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: r.sricharan@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Nishanth Menon This is a basic check to ensure that crossbar register needs to be written. This ensures that we have a common check which is used in both map and unmap logic. Signed-off-by: Nishanth Menon Signed-off-by: Sricharan R Acked-by: Santosh Shilimkar --- drivers/irqchip/irq-crossbar.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c index c9f068c..83f803b 100644 --- a/drivers/irqchip/irq-crossbar.c +++ b/drivers/irqchip/irq-crossbar.c @@ -84,10 +84,20 @@ static inline int allocate_free_irq(int cb_no) return -ENODEV; } +static inline bool needs_crossbar_write(irq_hw_number_t hw) +{ + if (hw > GIC_IRQ_START) + return true; + + return false; +} + static int crossbar_domain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) { - cb->write(hw - GIC_IRQ_START, cb->irq_map[hw - GIC_IRQ_START]); + if (needs_crossbar_write(hw)) + cb->write(hw - GIC_IRQ_START, cb->irq_map[hw - GIC_IRQ_START]); + return 0; } @@ -106,7 +116,7 @@ static void crossbar_domain_unmap(struct irq_domain *d, unsigned int irq) { irq_hw_number_t hw = irq_get_irq_data(irq)->hwirq; - if (hw > GIC_IRQ_START) { + if (needs_crossbar_write(hw)) { cb->irq_map[hw - GIC_IRQ_START] = IRQ_FREE; cb->write(hw - GIC_IRQ_START, cb->safe_map); }