From patchwork Wed Oct 14 10:18:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 53637 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9EAO8ut003733 for ; Wed, 14 Oct 2009 10:24:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756097AbZJNKY0 (ORCPT ); Wed, 14 Oct 2009 06:24:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756124AbZJNKY0 (ORCPT ); Wed, 14 Oct 2009 06:24:26 -0400 Received: from qw-out-2122.google.com ([74.125.92.26]:63604 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756097AbZJNKYZ (ORCPT ); Wed, 14 Oct 2009 06:24:25 -0400 Received: by qw-out-2122.google.com with SMTP id 9so1169470qwb.37 for ; Wed, 14 Oct 2009 03:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=UdCU3DHELPXcrPLrTWDYSPrY38zfWJ4ETdmvTRvGmk0=; b=KZU0BLzxP9AM0Ie48fxUPZahvkg8urp2M8L52kUevNpottgBRQ3vd1YBh6e6w3fxT7 z1y+/gvXxTqtp4/uF6FNKZKYyAWSilvGXjhexUIcB6EXy6ZMLZ7vKUm/7yJXkXIwprDK towu6oJkHjRXvhlmkmZYS5HhoHEYoTgaFJPpk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=Yn2kbycaPSwX9sxwxjAwvxf4OAhazXkIAPm+mvj86ixdXo8Me+AdKxAcHREZiGu+ZL 1XOpLiSPehu8zQXKc0dmo9Kipk04NrdnPjKC/FJa0/UrsysM+Tm8EziOamUiOtIUdM/+ uKPHVlvyBtizOp27xeY1blEHF1qJbMvpYViCw= Received: by 10.224.74.207 with SMTP id v15mr6778266qaj.295.1255515798754; Wed, 14 Oct 2009 03:23:18 -0700 (PDT) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 22sm2684475qyk.2.2009.10.14.03.23.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 14 Oct 2009 03:23:18 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Wed, 14 Oct 2009 19:18:30 +0900 Message-Id: <20091014101830.21842.25661.sendpatchset@rxone.opensource.se> In-Reply-To: <20091014101821.21842.40286.sendpatchset@rxone.opensource.se> References: <20091014101821.21842.40286.sendpatchset@rxone.opensource.se> Subject: [PATCH 01/07] sh: Restore all INTC registers on resume Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0001/drivers/sh/intc.c +++ work/drivers/sh/intc.c 2009-10-08 12:13:22.000000000 +0900 @@ -54,6 +54,8 @@ struct intc_desc_int { unsigned int nr_prio; struct intc_handle_int *sense; unsigned int nr_sense; + struct intc_handle_int *secondary; + unsigned int nr_secondary; struct irq_chip chip; }; @@ -612,6 +614,14 @@ static void __init intc_register_irq(str if (data[!primary]) _intc_enable(irq, data[!primary]); + /* add to d->secondary list if secondary masking method is present */ + if (data[!primary]) { + hp = d->secondary + d->nr_secondary; + hp->irq = irq; + hp->handle = data[!primary]; + d->nr_secondary++; + } + /* add irq to d->prio list if priority is available */ if (data[1]) { hp = d->prio + d->nr_prio; @@ -717,6 +727,9 @@ void __init register_intc_controller(str } } + d->secondary = kzalloc(desc->nr_vectors * sizeof(*d->secondary), + GFP_NOWAIT); + d->chip.name = desc->name; d->chip.mask = intc_disable; d->chip.unmask = intc_enable; @@ -787,6 +800,7 @@ static int intc_suspend(struct sys_devic { struct intc_desc_int *d; struct irq_desc *desc; + struct intc_handle_int *ihp; int irq; /* get intc controller associated with this sysdev */ @@ -794,11 +808,22 @@ static int intc_suspend(struct sys_devic switch (state.event) { case PM_EVENT_ON: +#if 0 if (d->state.event != PM_EVENT_FREEZE) break; +#endif for_each_irq_desc(irq, desc) { if (desc->chip != &d->chip) continue; + + /* setup secondary masking register if available */ + ihp = intc_find_irq(d->secondary, d->nr_secondary, irq); + if (ihp) + _intc_enable(irq, ihp->handle); + + /* set priority as well */ + intc_set_priority(irq, intc_prio_level[irq]); + if (desc->status & IRQ_DISABLED) intc_disable(irq); else