mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] m68k mac_esp prerequisites and updates
@ 2008-05-05 19:25 Geert Uytterhoeven
  2008-05-05 19:25 ` [PATCH 1/3] m68k: Handle 68040 bus faults Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2008-05-05 19:25 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: Linux/m68k, Linux Kernel Development

	Hi Linus, Andrew

The new mac_esp SCSI driver already went in through the linux-scsi tree in

    commit 6fe07aaffbf086a0ce9134ef27ce4a8921ff5947
    Author: Finn Thain <fthain@telegraphics.com.au>
    Date:   Fri Apr 25 10:06:05 2008 -0500

    [SCSI] m68k: new mac_esp scsi driver
	    
    Replace the mac_esp driver with a new one based on the
    esp_scsi core.

Here are some more patches related to this driver:
  [1] [PATCH] m68k: Handle 68040 bus faults
  [2] [PATCH] m68k: remove old mac_esp cruft
  [3] [PATCH] CONFIG_SCSI_MAC_ESP needs CONFIG_SCSI_SPI_ATTRS

[1] is a prerequisite for the PDMA support in the mac_esp SCSI driver.
[2] and [3] are cleanups.

Please apply. Thanks!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] m68k: Handle 68040 bus faults
  2008-05-05 19:25 [PATCH 0/3] m68k mac_esp prerequisites and updates Geert Uytterhoeven
@ 2008-05-05 19:25 ` Geert Uytterhoeven
  2008-05-05 19:26 ` [PATCH 2/3] m68k: remove old mac_esp cruft Geert Uytterhoeven
  2008-05-05 19:27 ` [PATCH 3/3] CONFIG_SCSI_MAC_ESP needs CONFIG_SCSI_SPI_ATTRS Geert Uytterhoeven
  2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2008-05-05 19:25 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: Linux/m68k, Linux Kernel Development

From: Roman Zippel <zippel@linux-m68k.org>

Fix 68040 bus fault handling, so the standard kernel exception handling
can be used for i/o probing.
Contrary to normal access faults there is nothing to fix, but at least
we have to disable writebacks to avoid recursive faults.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/kernel/traps.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -468,15 +468,26 @@ static inline void access_error040(struc
 			 * (if do_page_fault didn't fix the mapping,
                          * the writeback won't do good)
 			 */
+disable_wb:
 #ifdef DEBUG
 			printk(".. disabling wb2\n");
 #endif
 			if (fp->un.fmt7.wb2a == fp->un.fmt7.faddr)
 				fp->un.fmt7.wb2s &= ~WBV_040;
+			if (fp->un.fmt7.wb3a == fp->un.fmt7.faddr)
+				fp->un.fmt7.wb3s &= ~WBV_040;
 		}
-	} else if (send_fault_sig(&fp->ptregs) > 0) {
-		printk("68040 access error, ssw=%x\n", ssw);
-		trap_c(fp);
+	} else {
+		/* In case of a bus error we either kill the process or expect
+		 * the kernel to catch the fault, which then is also responsible
+		 * for cleaning up the mess.
+		 */
+		current->thread.signo = SIGBUS;
+		current->thread.faddr = fp->un.fmt7.faddr;
+		if (send_fault_sig(&fp->ptregs) >= 0)
+			printk("68040 bus error (ssw=%x, faddr=%lx)\n", ssw,
+			       fp->un.fmt7.faddr);
+		goto disable_wb;
 	}
 
 	do_040writebacks(fp);

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] m68k: remove old mac_esp cruft
  2008-05-05 19:25 [PATCH 0/3] m68k mac_esp prerequisites and updates Geert Uytterhoeven
  2008-05-05 19:25 ` [PATCH 1/3] m68k: Handle 68040 bus faults Geert Uytterhoeven
@ 2008-05-05 19:26 ` Geert Uytterhoeven
  2008-05-05 19:27 ` [PATCH 3/3] CONFIG_SCSI_MAC_ESP needs CONFIG_SCSI_SPI_ATTRS Geert Uytterhoeven
  2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2008-05-05 19:26 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: Linux/m68k, Linux Kernel Development

From: Finn Thain <fthain@telegraphics.com.au>

Remove the rest of the old mac_esp driver. Also ditch the rest of the 
machw mechanism, it needs to be replaced by a fake openfirmware tree.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 Documentation/kernel-parameters.txt |    3 ---
 arch/m68k/mac/config.c              |   24 ------------------------
 include/asm-m68k/machw.h            |   30 ------------------------------
 3 files changed, 57 deletions(-)

--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1094,9 +1094,6 @@ and is between 256 and 4096 characters. 
 	mac5380=	[HW,SCSI] Format:
 			<can_queue>,<cmd_per_lun>,<sg_tablesize>,<hostid>,<use_tags>
 
-	mac53c9x=	[HW,SCSI] Format:
-			<num_esps>,<disconnect>,<nosync>,<can_queue>,<cmd_per_lun>,<sg_tablesize>,<hostid>,<use_tags>
-
 	machvec=	[IA64] Force the use of a particular machine-vector
 			(machvec) in a generic kernel.
 			Example: machvec=hpzx1_swiotlb
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -48,9 +48,6 @@
 struct mac_booter_data mac_bi_data;
 int mac_bisize = sizeof mac_bi_data;
 
-struct mac_hw_present mac_hw_present;
-EXPORT_SYMBOL(mac_hw_present);
-
 /* New m68k bootinfo stuff and videobase */
 
 extern int m68k_num_memory;
@@ -817,27 +814,6 @@ void __init mac_identify(void)
 		m68k_ramdisk.addr, m68k_ramdisk.size);
 #endif
 
-	/*
-	 * TODO: set the various fields in macintosh_config->hw_present here!
-	 */
-	switch (macintosh_config->scsi_type) {
-	case MAC_SCSI_OLD:
-		MACHW_SET(MAC_SCSI_80);
-		break;
-	case MAC_SCSI_QUADRA:
-	case MAC_SCSI_QUADRA2:
-	case MAC_SCSI_QUADRA3:
-		MACHW_SET(MAC_SCSI_96);
-		if ((macintosh_config->ident == MAC_MODEL_Q900) ||
-		    (macintosh_config->ident == MAC_MODEL_Q950))
-			MACHW_SET(MAC_SCSI_96_2);
-		break;
-	default:
-		printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
-		MACHW_SET(MAC_SCSI_80);
-		break;
-	}
-
 	iop_init();
 	via_init();
 	oss_init();
--- a/include/asm-m68k/machw.h
+++ b/include/asm-m68k/machw.h
@@ -66,36 +66,6 @@ struct MAC_SCC
 # define mac_scc ((*(volatile struct SCC*)MAC_SCC_BAS))
 #endif
 
-/* hardware stuff */
-
-#define MACHW_DECLARE(name)	unsigned name : 1
-#define MACHW_SET(name)		(mac_hw_present.name = 1)
-#define MACHW_PRESENT(name)	(mac_hw_present.name)
-
-struct mac_hw_present {
-  /* video hardware */
-  /* sound hardware */
-  /* disk storage interfaces */
-  MACHW_DECLARE(MAC_SCSI_80);     /* Directly mapped NCR5380 */
-  MACHW_DECLARE(MAC_SCSI_96);     /* 53c9[46] */
-  MACHW_DECLARE(MAC_SCSI_96_2);   /* 2nd 53c9[46] Q900 and Q950 */
-  MACHW_DECLARE(IDE);             /* IDE Interface */
-  /* other I/O hardware */
-  MACHW_DECLARE(SCC);             /* Serial Communications Contr. */
-  /* DMA */
-  MACHW_DECLARE(SCSI_DMA);        /* DMA for the NCR5380 */
-  /* real time clocks */
-  MACHW_DECLARE(RTC_CLK);         /* clock chip */
-  /* supporting hardware */
-  MACHW_DECLARE(VIA1);            /* Versatile Interface Ad. 1 */
-  MACHW_DECLARE(VIA2);            /* Versatile Interface Ad. 2 */
-  MACHW_DECLARE(RBV);             /* Versatile Interface Ad. 2+ */
-  /* NUBUS */
-  MACHW_DECLARE(NUBUS);           /* NUBUS */
-};
-
-extern struct mac_hw_present mac_hw_present;
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* linux/machw.h */

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] CONFIG_SCSI_MAC_ESP needs CONFIG_SCSI_SPI_ATTRS
  2008-05-05 19:25 [PATCH 0/3] m68k mac_esp prerequisites and updates Geert Uytterhoeven
  2008-05-05 19:25 ` [PATCH 1/3] m68k: Handle 68040 bus faults Geert Uytterhoeven
  2008-05-05 19:26 ` [PATCH 2/3] m68k: remove old mac_esp cruft Geert Uytterhoeven
@ 2008-05-05 19:27 ` Geert Uytterhoeven
  2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2008-05-05 19:27 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: James Bottomley, Linux/m68k, Linux Kernel Development, linux-scsi

From: Geert Uytterhoeven <geert@linux-m68k.org>

The new mac_esp scsi driver needs CONFIG_SCSI_SPI_ATTRS, just like all other
drivers using the new esp_scsi core.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/scsi/Kconfig |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1679,6 +1679,7 @@ config MAC_SCSI
 config SCSI_MAC_ESP
 	tristate "Macintosh NCR53c9[46] SCSI"
 	depends on MAC && SCSI
+	select SCSI_SPI_ATTRS
 	help
 	  This is the NCR 53c9x SCSI controller found on most of the 68040
 	  based Macintoshes.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-05 19:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-05 19:25 [PATCH 0/3] m68k mac_esp prerequisites and updates Geert Uytterhoeven
2008-05-05 19:25 ` [PATCH 1/3] m68k: Handle 68040 bus faults Geert Uytterhoeven
2008-05-05 19:26 ` [PATCH 2/3] m68k: remove old mac_esp cruft Geert Uytterhoeven
2008-05-05 19:27 ` [PATCH 3/3] CONFIG_SCSI_MAC_ESP needs CONFIG_SCSI_SPI_ATTRS Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®