linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] m68k/mac: Use '030 reset method on SE/30
@ 2018-12-22  2:18 Finn Thain
  2018-12-22 11:04 ` Geert Uytterhoeven
  2019-01-21  9:41 ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Finn Thain @ 2018-12-22  2:18 UTC (permalink / raw)
  To: Joshua Thompson, Geert Uytterhoeven; +Cc: linux-m68k, linux-kernel

The comment says that calling the ROM routine doesn't work. But testing
shows that the 68030 fall-back reset method does work, so just use that.

Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
 arch/m68k/mac/misc.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index ebb3b6d169ea..2d8da060f875 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -410,9 +410,8 @@ void mac_poweroff(void)
 
 void mac_reset(void)
 {
-	if (macintosh_config->adb_type == MAC_ADB_II) {
-		unsigned long flags;
-
+	if (macintosh_config->adb_type == MAC_ADB_II &&
+	    macintosh_config->ident != MAC_MODEL_SE30) {
 		/* need ROMBASE in booter */
 		/* indeed, plus need to MAP THE ROM !! */
 
@@ -422,17 +421,8 @@ void mac_reset(void)
 		/* works on some */
 		rom_reset = (void *) (mac_bi_data.rombase + 0xa);
 
-		if (macintosh_config->ident == MAC_MODEL_SE30) {
-			/*
-			 * MSch: Machines known to crash on ROM reset ...
-			 */
-		} else {
-			local_irq_save(flags);
-
-			rom_reset();
-
-			local_irq_restore(flags);
-		}
+		local_irq_disable();
+		rom_reset();
 #ifdef CONFIG_ADB_CUDA
 	} else if (macintosh_config->adb_type == MAC_ADB_EGRET ||
 	           macintosh_config->adb_type == MAC_ADB_CUDA) {
-- 
2.19.2

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

* Re: [PATCH] m68k/mac: Use '030 reset method on SE/30
  2018-12-22  2:18 [PATCH] m68k/mac: Use '030 reset method on SE/30 Finn Thain
@ 2018-12-22 11:04 ` Geert Uytterhoeven
  2018-12-22 23:03   ` Finn Thain
  2019-01-21  9:41 ` Geert Uytterhoeven
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2018-12-22 11:04 UTC (permalink / raw)
  To: Finn Thain; +Cc: Joshua Thompson, linux-m68k, Linux Kernel Mailing List

Hi Finn,

On Sat, Dec 22, 2018 at 4:07 AM Finn Thain <fthain@telegraphics.com.au> wrote:
> The comment says that calling the ROM routine doesn't work. But testing
> shows that the 68030 fall-back reset method does work, so just use that.
>
> Tested-by: Stan Johnson <userm57@yahoo.com>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

Thanks for your patch!

> --- a/arch/m68k/mac/misc.c
> +++ b/arch/m68k/mac/misc.c
> @@ -410,9 +410,8 @@ void mac_poweroff(void)
>
>  void mac_reset(void)
>  {
> -       if (macintosh_config->adb_type == MAC_ADB_II) {
> -               unsigned long flags;
> -
> +       if (macintosh_config->adb_type == MAC_ADB_II &&
> +           macintosh_config->ident != MAC_MODEL_SE30) {
>                 /* need ROMBASE in booter */
>                 /* indeed, plus need to MAP THE ROM !! */
>
> @@ -422,17 +421,8 @@ void mac_reset(void)
>                 /* works on some */
>                 rom_reset = (void *) (mac_bi_data.rombase + 0xa);
>
> -               if (macintosh_config->ident == MAC_MODEL_SE30) {
> -                       /*
> -                        * MSch: Machines known to crash on ROM reset ...
> -                        */
> -               } else {
> -                       local_irq_save(flags);
> -
> -                       rom_reset();
> -
> -                       local_irq_restore(flags);

I guess you removed the call to local_irq_restore() because you never
get there anyway?

> -               }
> +               local_irq_disable();
> +               rom_reset();
>  #ifdef CONFIG_ADB_CUDA
>         } else if (macintosh_config->adb_type == MAC_ADB_EGRET ||
>                    macintosh_config->adb_type == MAC_ADB_CUDA) {

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

* Re: [PATCH] m68k/mac: Use '030 reset method on SE/30
  2018-12-22 11:04 ` Geert Uytterhoeven
@ 2018-12-22 23:03   ` Finn Thain
  0 siblings, 0 replies; 4+ messages in thread
From: Finn Thain @ 2018-12-22 23:03 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Joshua Thompson, linux-m68k, Linux Kernel Mailing List

On Sat, 22 Dec 2018, Geert Uytterhoeven wrote:

> > -                       local_irq_save(flags);
> > -
> > -                       rom_reset();
> > -
> > -                       local_irq_restore(flags);
> 
> I guess you removed the call to local_irq_restore() because you never
> get there anyway?
> 

If a ROM call returns, we have a real problem, because we didn't call it 
in an execution environment that it is designed to be called in. Anything 
could happen.

Moreover, local_irq_restore() is bogus either way, given that there's 
nothing that our interrupt handlers can usefully do now.

See also commit 558d5ad276c9 ("m68k/mac: Avoid soft-lockup warning after 
mach_power_off").

-- 

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

* Re: [PATCH] m68k/mac: Use '030 reset method on SE/30
  2018-12-22  2:18 [PATCH] m68k/mac: Use '030 reset method on SE/30 Finn Thain
  2018-12-22 11:04 ` Geert Uytterhoeven
@ 2019-01-21  9:41 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2019-01-21  9:41 UTC (permalink / raw)
  To: Finn Thain; +Cc: Joshua Thompson, linux-m68k, Linux Kernel Mailing List

On Sat, Dec 22, 2018 at 4:07 AM Finn Thain <fthain@telegraphics.com.au> wrote:
> The comment says that calling the ROM routine doesn't work. But testing
> shows that the 68030 fall-back reset method does work, so just use that.
>
> Tested-by: Stan Johnson <userm57@yahoo.com>
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

Thanks, applied and queued for v5.1.

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:[~2019-01-21  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-22  2:18 [PATCH] m68k/mac: Use '030 reset method on SE/30 Finn Thain
2018-12-22 11:04 ` Geert Uytterhoeven
2018-12-22 23:03   ` Finn Thain
2019-01-21  9:41 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).