From: Finn Thain <fthain@telegraphics.com.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@vger.kernel.org
Subject: [PATCH 05/16] m68k/mac: cleanup mac_clear_irq
Date: Mon, 24 Oct 2011 01:11:13 +1100 [thread overview]
Message-ID: <20111023141133.808777479@telegraphics.com.au> (raw)
In-Reply-To: 20111023141108.856998818@telegraphics.com.au
[-- Attachment #1: cleanup-mac_clear_irq --]
[-- Type: text/plain, Size: 4610 bytes --]
mac_clear_irq() is dead code and has been dead for as long as I can recall. On certain Mac models, certain irqs can't be cleared this way. Outside of irq dispatch, this code appears be unusable without busy loops or worse, and for irq dispatch we duplicate the same logic. Remove mac_clear_irq() and supporting code.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Index: linux-m68k/arch/m68k/mac/baboon.c
===================================================================
--- linux-m68k.orig/arch/m68k/mac/baboon.c 2011-10-22 23:02:38.000000000 +1100
+++ linux-m68k/arch/m68k/mac/baboon.c 2011-10-23 00:51:09.000000000 +1100
@@ -124,13 +124,6 @@ void baboon_irq_disable(int irq)
mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C));
}
-void baboon_irq_clear(int irq)
-{
- int irq_idx = IRQ_IDX(irq);
-
- baboon->mb_ifr &= ~(1 << irq_idx);
-}
-
int baboon_irq_pending(int irq)
{
int irq_idx = IRQ_IDX(irq);
Index: linux-m68k/arch/m68k/mac/macints.c
===================================================================
--- linux-m68k.orig/arch/m68k/mac/macints.c 2011-10-22 23:02:38.000000000 +1100
+++ linux-m68k/arch/m68k/mac/macints.c 2011-10-23 00:51:09.000000000 +1100
@@ -239,7 +239,6 @@ void __init mac_init_IRQ(void)
/*
* mac_irq_enable - enable an interrupt source
* mac_irq_disable - disable an interrupt source
- * mac_clear_irq - clears a pending interrupt
* mac_irq_pending - returns the pending status of an IRQ (nonzero = pending)
*
* These routines are just dispatchers to the VIA/OSS/PSC routines.
@@ -314,38 +313,6 @@ void mac_irq_disable(struct irq_data *da
break;
}
}
-
-void mac_clear_irq(unsigned int irq)
-{
- switch(IRQ_SRC(irq)) {
- case 1:
- via_irq_clear(irq);
- break;
- case 2:
- case 7:
- if (oss_present)
- oss_irq_clear(irq);
- else
- via_irq_clear(irq);
- break;
- case 3:
- case 5:
- case 6:
- if (psc_present)
- psc_irq_clear(irq);
- else if (oss_present)
- oss_irq_clear(irq);
- break;
- case 4:
- if (psc_present)
- psc_irq_clear(irq);
- break;
- case 8:
- if (baboon_present)
- baboon_irq_clear(irq);
- break;
- }
-}
int mac_irq_pending(unsigned int irq)
{
Index: linux-m68k/arch/m68k/mac/oss.c
===================================================================
--- linux-m68k.orig/arch/m68k/mac/oss.c 2011-10-22 23:02:38.000000000 +1100
+++ linux-m68k/arch/m68k/mac/oss.c 2011-10-23 00:51:09.000000000 +1100
@@ -221,37 +221,6 @@ void oss_irq_disable(int irq) {
}
/*
- * Clear an OSS interrupt
- *
- * Not sure if this works or not but it's the only method I could
- * think of based on the contents of the mac_oss structure.
- */
-
-void oss_irq_clear(int irq) {
- /* FIXME: how to do this on OSS? */
- switch(irq) {
- case IRQ_MAC_SCC:
- oss->irq_pending &= ~OSS_IP_IOPSCC;
- break;
- case IRQ_MAC_ADB:
- oss->irq_pending &= ~OSS_IP_IOPISM;
- break;
- case IRQ_MAC_SCSI:
- oss->irq_pending &= ~OSS_IP_SCSI;
- break;
- case IRQ_NUBUS_9:
- case IRQ_NUBUS_A:
- case IRQ_NUBUS_B:
- case IRQ_NUBUS_C:
- case IRQ_NUBUS_D:
- case IRQ_NUBUS_E:
- irq -= NUBUS_SOURCE_BASE;
- oss->irq_pending &= ~(1 << irq);
- break;
- }
-}
-
-/*
* Check to see if a specific OSS interrupt is pending
*/
Index: linux-m68k/arch/m68k/mac/psc.c
===================================================================
--- linux-m68k.orig/arch/m68k/mac/psc.c 2011-10-22 23:02:38.000000000 +1100
+++ linux-m68k/arch/m68k/mac/psc.c 2011-10-23 00:51:09.000000000 +1100
@@ -181,14 +181,6 @@ void psc_irq_disable(int irq) {
psc_write_byte(pIER, 1 << irq_idx);
}
-void psc_irq_clear(int irq) {
- int irq_src = IRQ_SRC(irq);
- int irq_idx = IRQ_IDX(irq);
- int pIFR = pIERbase + (irq_src << 4);
-
- psc_write_byte(pIFR, 1 << irq_idx);
-}
-
int psc_irq_pending(int irq)
{
int irq_src = IRQ_SRC(irq);
Index: linux-m68k/arch/m68k/mac/via.c
===================================================================
--- linux-m68k.orig/arch/m68k/mac/via.c 2011-10-22 23:02:38.000000000 +1100
+++ linux-m68k/arch/m68k/mac/via.c 2011-10-23 00:51:09.000000000 +1100
@@ -584,22 +584,6 @@ void via_irq_disable(int irq) {
}
}
-void via_irq_clear(int irq) {
- int irq_src = IRQ_SRC(irq);
- int irq_idx = IRQ_IDX(irq);
- int irq_bit = 1 << irq_idx;
-
- if (irq_src == 1) {
- via1[vIFR] = irq_bit;
- } else if (irq_src == 2) {
- via2[gIFR] = irq_bit | rbv_clear;
- } else if (irq_src == 7) {
- /* FIXME: There is no way to clear an individual nubus slot
- * IRQ flag, other than getting the device to do it.
- */
- }
-}
-
/*
* Returns nonzero if an interrupt is pending on the given
* VIA/IRQ combination.
next prev parent reply other threads:[~2011-10-23 14:11 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-23 14:11 [PATCH 00/16] more mac68k fixes and cleanup Finn Thain
2011-10-23 14:11 ` [PATCH 01/16] pmac_zilog: fix unexpected irq Finn Thain
2011-11-24 14:34 ` Finn Thain
2011-11-24 14:56 ` Alan Cox
2011-11-24 20:41 ` Benjamin Herrenschmidt
2011-11-25 3:15 ` Finn Thain
2011-11-28 0:30 ` Benjamin Herrenschmidt
2011-11-24 15:28 ` David Laight
2011-11-24 20:43 ` Benjamin Herrenschmidt
2011-12-06 15:13 ` [PATCH 01/16 v2] " Finn Thain
2011-12-06 15:27 ` Geert Uytterhoeven
2011-12-07 1:26 ` Finn Thain
2011-12-06 15:39 ` Alan Cox
2011-12-07 3:49 ` [PATCH 01/16 v3] " Finn Thain
2011-12-08 3:17 ` Benjamin Herrenschmidt
2011-12-08 4:20 ` Benjamin Herrenschmidt
2011-12-08 4:30 ` Benjamin Herrenschmidt
2011-12-08 11:26 ` Finn Thain
2011-12-08 11:54 ` Geert Uytterhoeven
2011-12-08 19:44 ` Benjamin Herrenschmidt
2011-12-11 23:48 ` Benjamin Herrenschmidt
2011-12-11 23:55 ` Benjamin Herrenschmidt
2011-12-12 13:34 ` Finn Thain
2011-12-12 20:06 ` Benjamin Herrenschmidt
2011-12-13 1:24 ` Finn Thain
2011-10-23 14:11 ` [PATCH 02/16] macfb: fix black and white modes Finn Thain
2011-12-10 5:23 ` Finn Thain
2011-10-23 14:11 ` [PATCH 03/16] mac_sonic: add irq resources and cleanup Finn Thain
2011-11-13 10:28 ` Geert Uytterhoeven
2011-11-13 14:30 ` Finn Thain
2011-11-13 17:36 ` Geert Uytterhoeven
2011-12-10 5:23 ` Finn Thain
2011-10-23 14:11 ` [PATCH 04/16] m68k/mac: early console Finn Thain
2011-10-23 14:11 ` Finn Thain [this message]
2011-10-23 14:11 ` [PATCH 06/16] m68k/mac: cleanup mac_irq_pending Finn Thain
2011-12-10 5:24 ` Finn Thain
2011-10-23 14:11 ` [PATCH 07/16] m68k/mac: cleanup forward declarations Finn Thain
2011-10-23 14:11 ` [PATCH 08/16] m68k/mac: enable via_alt_mapping on performa 580 Finn Thain
2011-10-23 14:11 ` [PATCH 09/16] m68k/mac: fix nubus slot irq disable and shutdown Finn Thain
2011-10-23 14:11 ` [PATCH 10/16] m68k/mac: oss irq fixes Finn Thain
2011-10-23 14:11 ` [PATCH 11/16] m68k/mac: fix baboon irq disable and shutdown Finn Thain
2011-10-23 14:11 ` [PATCH 12/16] m68k/mac: fix powerbook 150 adb_type Finn Thain
2011-10-23 14:11 ` [PATCH 13/16] mac_scsi: fix mac_scsi on some powerbooks Finn Thain
2011-12-10 5:24 ` Finn Thain
2011-10-23 14:11 ` [PATCH 14/16] m68k/mac: cleanup macro case Finn Thain
2011-10-23 14:11 ` [PATCH 15/16] mac_scsi: dont enable mac_scsi irq before requesting it Finn Thain
2011-12-10 5:24 ` Finn Thain
2011-10-23 14:11 ` [PATCH 16/16] mac_esp: rename irq Finn Thain
2011-12-10 5:24 ` Finn Thain
2011-10-31 18:35 ` [PATCH 00/16] more mac68k fixes and cleanup Geert Uytterhoeven
2011-10-31 19:16 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111023141133.808777479@telegraphics.com.au \
--to=fthain@telegraphics.com.au \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox