* [PATCH 01/11] completely initialize hw_regs_t in ide_setup_ports
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 0:27 ` [PATCH 02/11] atyfb_base compile fix for CONFIG_PCI=n zippel
` (9 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-ide
ide_setup_ports does not completely initialize the hw_regs_t structure
which can cause random failures, as the structure is often on the stack.
None of the callers expect a partially initialized structure, i.e. none
of them do any setup of their own before calling ide_setup_ports().
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
drivers/ide/ide.c | 1 +
drivers/ide/legacy/q40ide.c | 1 +
2 files changed, 2 insertions(+)
Index: linux-2.6-mm/drivers/ide/ide.c
===================================================================
--- linux-2.6-mm.orig/drivers/ide/ide.c
+++ linux-2.6-mm/drivers/ide/ide.c
@@ -730,6 +730,7 @@ void ide_setup_ports ( hw_regs_t *hw,
{
int i;
+ memset(hw, 0, sizeof(hw_regs_t));
for (i = 0; i < IDE_NR_PORTS; i++) {
if (offsets[i] == -1) {
switch(i) {
Index: linux-2.6-mm/drivers/ide/legacy/q40ide.c
===================================================================
--- linux-2.6-mm.orig/drivers/ide/legacy/q40ide.c
+++ linux-2.6-mm/drivers/ide/legacy/q40ide.c
@@ -80,6 +80,7 @@ void q40_ide_setup_ports ( hw_regs_t *hw
{
int i;
+ memset(hw, 0, sizeof(hw_regs_t));
for (i = 0; i < IDE_NR_PORTS; i++) {
/* BIG FAT WARNING:
assumption: only DATA port is ever used in 16 bit mode */
--
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 02/11] atyfb_base compile fix for CONFIG_PCI=n
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
2006-05-25 0:27 ` [PATCH 01/11] completely initialize hw_regs_t in ide_setup_ports zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 1:33 ` Andrew Morton
2006-05-25 0:27 ` [PATCH 03/11] cleanup unistd.h zippel
` (8 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
The atyfb_driver structure is only available if CONFIG_PCI is set.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
drivers/video/aty/atyfb_base.c | 4 ++++
1 file changed, 4 insertions(+)
Index: linux-2.6-mm/drivers/video/aty/atyfb_base.c
===================================================================
--- linux-2.6-mm.orig/drivers/video/aty/atyfb_base.c
+++ linux-2.6-mm/drivers/video/aty/atyfb_base.c
@@ -3861,7 +3861,9 @@ static int __init atyfb_init(void)
atyfb_setup(option);
#endif
+#ifdef CONFIG_PCI
pci_register_driver(&atyfb_driver);
+#endif
#ifdef CONFIG_ATARI
atyfb_atari_probe();
#endif
@@ -3870,7 +3872,9 @@ static int __init atyfb_init(void)
static void __exit atyfb_exit(void)
{
+#ifdef CONFIG_PCI
pci_unregister_driver(&atyfb_driver);
+#endif
}
module_init(atyfb_init);
--
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 02/11] atyfb_base compile fix for CONFIG_PCI=n
2006-05-25 0:27 ` [PATCH 02/11] atyfb_base compile fix for CONFIG_PCI=n zippel
@ 2006-05-25 1:33 ` Andrew Morton
2006-05-25 4:07 ` Greg KH
0 siblings, 1 reply; 18+ messages in thread
From: Andrew Morton @ 2006-05-25 1:33 UTC (permalink / raw)
To: zippel; +Cc: linux-kernel, Greg KH
zippel@linux-m68k.org wrote:
>
> The atyfb_driver structure is only available if CONFIG_PCI is set.
>
> Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
>
> ---
>
> drivers/video/aty/atyfb_base.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> Index: linux-2.6-mm/drivers/video/aty/atyfb_base.c
> ===================================================================
> --- linux-2.6-mm.orig/drivers/video/aty/atyfb_base.c
> +++ linux-2.6-mm/drivers/video/aty/atyfb_base.c
> @@ -3861,7 +3861,9 @@ static int __init atyfb_init(void)
> atyfb_setup(option);
> #endif
>
> +#ifdef CONFIG_PCI
> pci_register_driver(&atyfb_driver);
> +#endif
> #ifdef CONFIG_ATARI
> atyfb_atari_probe();
> #endif
> @@ -3870,7 +3872,9 @@ static int __init atyfb_init(void)
>
> static void __exit atyfb_exit(void)
> {
> +#ifdef CONFIG_PCI
> pci_unregister_driver(&atyfb_driver);
> +#endif
> }
bah. If pci_register_driver() was a macro we wouldn't need to do this all
over the place.
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 02/11] atyfb_base compile fix for CONFIG_PCI=n
2006-05-25 1:33 ` Andrew Morton
@ 2006-05-25 4:07 ` Greg KH
2006-05-25 4:28 ` Andrew Morton
2006-05-30 12:21 ` Roman Zippel
0 siblings, 2 replies; 18+ messages in thread
From: Greg KH @ 2006-05-25 4:07 UTC (permalink / raw)
To: Andrew Morton; +Cc: zippel, linux-kernel
On Wed, May 24, 2006 at 06:33:27PM -0700, Andrew Morton wrote:
> zippel@linux-m68k.org wrote:
> >
> > The atyfb_driver structure is only available if CONFIG_PCI is set.
> >
> > Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
> >
> > ---
> >
> > drivers/video/aty/atyfb_base.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > Index: linux-2.6-mm/drivers/video/aty/atyfb_base.c
> > ===================================================================
> > --- linux-2.6-mm.orig/drivers/video/aty/atyfb_base.c
> > +++ linux-2.6-mm/drivers/video/aty/atyfb_base.c
> > @@ -3861,7 +3861,9 @@ static int __init atyfb_init(void)
> > atyfb_setup(option);
> > #endif
> >
> > +#ifdef CONFIG_PCI
> > pci_register_driver(&atyfb_driver);
> > +#endif
> > #ifdef CONFIG_ATARI
> > atyfb_atari_probe();
> > #endif
> > @@ -3870,7 +3872,9 @@ static int __init atyfb_init(void)
> >
> > static void __exit atyfb_exit(void)
> > {
> > +#ifdef CONFIG_PCI
> > pci_unregister_driver(&atyfb_driver);
> > +#endif
> > }
>
> bah. If pci_register_driver() was a macro we wouldn't need to do this all
> over the place.
Yes, this can be fixed easily in the pci.h header file, all other pci
functions are stubbed out properly if CONFIG_PCI is not enabled. These
should be too.
Roman, care to make that change instead?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 02/11] atyfb_base compile fix for CONFIG_PCI=n
2006-05-25 4:07 ` Greg KH
@ 2006-05-25 4:28 ` Andrew Morton
2006-05-30 12:21 ` Roman Zippel
1 sibling, 0 replies; 18+ messages in thread
From: Andrew Morton @ 2006-05-25 4:28 UTC (permalink / raw)
To: Greg KH; +Cc: zippel, linux-kernel
Greg KH <greg@kroah.com> wrote:
>
> On Wed, May 24, 2006 at 06:33:27PM -0700, Andrew Morton wrote:
> > zippel@linux-m68k.org wrote:
> > >
> > > The atyfb_driver structure is only available if CONFIG_PCI is set.
> > >
> > > Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
> > >
> > > ---
> > >
> > > drivers/video/aty/atyfb_base.c | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > Index: linux-2.6-mm/drivers/video/aty/atyfb_base.c
> > > ===================================================================
> > > --- linux-2.6-mm.orig/drivers/video/aty/atyfb_base.c
> > > +++ linux-2.6-mm/drivers/video/aty/atyfb_base.c
> > > @@ -3861,7 +3861,9 @@ static int __init atyfb_init(void)
> > > atyfb_setup(option);
> > > #endif
> > >
> > > +#ifdef CONFIG_PCI
> > > pci_register_driver(&atyfb_driver);
> > > +#endif
> > > #ifdef CONFIG_ATARI
> > > atyfb_atari_probe();
> > > #endif
> > > @@ -3870,7 +3872,9 @@ static int __init atyfb_init(void)
> > >
> > > static void __exit atyfb_exit(void)
> > > {
> > > +#ifdef CONFIG_PCI
> > > pci_unregister_driver(&atyfb_driver);
> > > +#endif
> > > }
> >
> > bah. If pci_register_driver() was a macro we wouldn't need to do this all
> > over the place.
>
> Yes, this can be fixed easily in the pci.h header file, all other pci
> functions are stubbed out properly if CONFIG_PCI is not enabled. These
> should be too.
>
Well pci_register_driver() and pci_unregister_driver() do have stubs. But
they're static-inlines, hence they reference their argument, hence the
above ifdefs.
But if the pci_register_driver() and pci_unregister_driver() stubs were
macros which do not reference their argument, the above ifdefs aren't
needed.
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 02/11] atyfb_base compile fix for CONFIG_PCI=n
2006-05-25 4:07 ` Greg KH
2006-05-25 4:28 ` Andrew Morton
@ 2006-05-30 12:21 ` Roman Zippel
1 sibling, 0 replies; 18+ messages in thread
From: Roman Zippel @ 2006-05-30 12:21 UTC (permalink / raw)
To: Greg KH; +Cc: Andrew Morton, linux-kernel
Hi,
On Wed, 24 May 2006, Greg KH wrote:
> > > Index: linux-2.6-mm/drivers/video/aty/atyfb_base.c
> > > ===================================================================
> > > --- linux-2.6-mm.orig/drivers/video/aty/atyfb_base.c
> > > +++ linux-2.6-mm/drivers/video/aty/atyfb_base.c
> > > @@ -3861,7 +3861,9 @@ static int __init atyfb_init(void)
> > > atyfb_setup(option);
> > > #endif
> > >
> > > +#ifdef CONFIG_PCI
> > > pci_register_driver(&atyfb_driver);
> > > +#endif
> > > #ifdef CONFIG_ATARI
> > > atyfb_atari_probe();
> > > #endif
> > > @@ -3870,7 +3872,9 @@ static int __init atyfb_init(void)
> > >
> > > static void __exit atyfb_exit(void)
> > > {
> > > +#ifdef CONFIG_PCI
> > > pci_unregister_driver(&atyfb_driver);
> > > +#endif
> > > }
> >
> > bah. If pci_register_driver() was a macro we wouldn't need to do this all
> > over the place.
>
> Yes, this can be fixed easily in the pci.h header file, all other pci
> functions are stubbed out properly if CONFIG_PCI is not enabled. These
> should be too.
I'm not a big fan of such dummy macros, as these macros should properly
look like:
#define pci_register_driver(x) ({ (void)(x); 0; })
otherwise you risk warnings about defined but unused variables.
The other alternative is to remove the #ifdef around atyfb_driver, recent
gcc (>= 4.0) can remove the unused structure.
bye, Roman
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 03/11] cleanup unistd.h
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
2006-05-25 0:27 ` [PATCH 01/11] completely initialize hw_regs_t in ide_setup_ports zippel
2006-05-25 0:27 ` [PATCH 02/11] atyfb_base compile fix for CONFIG_PCI=n zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 0:27 ` [PATCH 04/11] Remove some unused definitions in zorro.h zippel
` (7 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Remove long obsolete kernel syscalls, only execve is still used.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
include/asm-m68k/unistd.h | 39 ---------------------------------------
1 file changed, 39 deletions(-)
Index: linux-2.6-mm/include/asm-m68k/unistd.h
===================================================================
--- linux-2.6-mm.orig/include/asm-m68k/unistd.h
+++ linux-2.6-mm/include/asm-m68k/unistd.h
@@ -410,46 +410,7 @@ __syscall_return(type,__res); \
#ifdef __KERNEL_SYSCALLS__
-#include <linux/compiler.h>
-#include <linux/interrupt.h>
-#include <linux/types.h>
-
-/*
- * we need this inline - forking from kernel space will result
- * in NO COPY ON WRITE (!!!), until an execve is executed. This
- * is no problem, but for the stack. This is handled by not letting
- * main() use the stack at all after fork(). Thus, no function
- * calls - which means inline code for fork too, as otherwise we
- * would use the stack upon exit from 'fork()'.
- *
- * Actually only pause and fork are needed inline, so that there
- * won't be any messing with the stack from main(), but we define
- * some others too.
- */
-#define __NR__exit __NR_exit
-static inline _syscall0(pid_t,setsid)
-static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
-static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
-static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
-static inline _syscall1(int,dup,int,fd)
static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
-static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
-static inline _syscall1(int,close,int,fd)
-static inline _syscall1(int,_exit,int,exitcode)
-static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
-
-asmlinkage long sys_mmap2(
- unsigned long addr, unsigned long len,
- unsigned long prot, unsigned long flags,
- unsigned long fd, unsigned long pgoff);
-asmlinkage int sys_execve(char *name, char **argv, char **envp);
-asmlinkage int sys_pipe(unsigned long *fildes);
-struct pt_regs;
-struct sigaction;
-asmlinkage long sys_rt_sigaction(int sig,
- const struct sigaction __user *act,
- struct sigaction __user *oact,
- size_t sigsetsize);
#endif /* __KERNEL_SYSCALLS__ */
--
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 04/11] Remove some unused definitions in zorro.h
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
` (2 preceding siblings ...)
2006-05-25 0:27 ` [PATCH 03/11] cleanup unistd.h zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 0:27 ` [PATCH 05/11] use c99 initializer zippel
` (6 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
These definitions have long been superseded by asm-offsets.h
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
include/linux/zorro.h | 42 ------------------------------------------
1 file changed, 42 deletions(-)
Index: linux-2.6-mm/include/linux/zorro.h
===================================================================
--- linux-2.6-mm.orig/include/linux/zorro.h
+++ linux-2.6-mm/include/linux/zorro.h
@@ -11,8 +11,6 @@
#ifndef _LINUX_ZORRO_H
#define _LINUX_ZORRO_H
-#ifndef __ASSEMBLY__
-
#include <linux/device.h>
@@ -112,45 +110,6 @@ struct ConfigDev {
__u32 cd_Unused[4]; /* for whatever the driver wants */
} __attribute__ ((packed));
-#else /* __ASSEMBLY__ */
-
-LN_Succ = 0
-LN_Pred = LN_Succ+4
-LN_Type = LN_Pred+4
-LN_Pri = LN_Type+1
-LN_Name = LN_Pri+1
-LN_sizeof = LN_Name+4
-
-ER_Type = 0
-ER_Product = ER_Type+1
-ER_Flags = ER_Product+1
-ER_Reserved03 = ER_Flags+1
-ER_Manufacturer = ER_Reserved03+1
-ER_SerialNumber = ER_Manufacturer+2
-ER_InitDiagVec = ER_SerialNumber+4
-ER_Reserved0c = ER_InitDiagVec+2
-ER_Reserved0d = ER_Reserved0c+1
-ER_Reserved0e = ER_Reserved0d+1
-ER_Reserved0f = ER_Reserved0e+1
-ER_sizeof = ER_Reserved0f+1
-
-CD_Node = 0
-CD_Flags = CD_Node+LN_sizeof
-CD_Pad = CD_Flags+1
-CD_Rom = CD_Pad+1
-CD_BoardAddr = CD_Rom+ER_sizeof
-CD_BoardSize = CD_BoardAddr+4
-CD_SlotAddr = CD_BoardSize+4
-CD_SlotSize = CD_SlotAddr+2
-CD_Driver = CD_SlotSize+2
-CD_NextCD = CD_Driver+4
-CD_Unused = CD_NextCD+4
-CD_sizeof = CD_Unused+(4*4)
-
-#endif /* __ASSEMBLY__ */
-
-#ifndef __ASSEMBLY__
-
#define ZORRO_NUM_AUTO 16
#ifdef __KERNEL__
@@ -290,7 +249,6 @@ extern DECLARE_BITMAP(zorro_unused_z2ram
#define Z2RAM_CHUNKSHIFT (16)
-#endif /* !__ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _LINUX_ZORRO_H */
--
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 05/11] use c99 initializer
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
` (3 preceding siblings ...)
2006-05-25 0:27 ` [PATCH 04/11] Remove some unused definitions in zorro.h zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 0:27 ` [PATCH 06/11] print correct stack trace zippel
` (5 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
include/asm-m68k/processor.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-2.6-mm/include/asm-m68k/processor.h
===================================================================
--- linux-2.6-mm.orig/include/asm-m68k/processor.h
+++ linux-2.6-mm/include/asm-m68k/processor.h
@@ -71,10 +71,10 @@ struct thread_struct {
};
#define INIT_THREAD { \
- ksp: sizeof(init_stack) + (unsigned long) init_stack, \
- sr: PS_S, \
- fs: __KERNEL_DS, \
- info: INIT_THREAD_INFO(init_task) \
+ .ksp = sizeof(init_stack) + (unsigned long) init_stack, \
+ .sr = PS_S, \
+ .fs = __KERNEL_DS, \
+ .info = INIT_THREAD_INFO(init_task), \
}
/*
--
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 06/11] print correct stack trace
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
` (4 preceding siblings ...)
2006-05-25 0:27 ` [PATCH 05/11] use c99 initializer zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 0:27 ` [PATCH 07/11] restore amikbd compatibility with 2.4 zippel
` (4 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Pass unmodified stack argument to show_trace().
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
arch/m68k/kernel/traps.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: linux-2.6-mm/arch/m68k/kernel/traps.c
===================================================================
--- linux-2.6-mm.orig/arch/m68k/kernel/traps.c
+++ linux-2.6-mm/arch/m68k/kernel/traps.c
@@ -992,6 +992,7 @@ void show_registers(struct pt_regs *regs
void show_stack(struct task_struct *task, unsigned long *stack)
{
+ unsigned long *p;
unsigned long *endstack;
int i;
@@ -1004,12 +1005,13 @@ void show_stack(struct task_struct *task
endstack = (unsigned long *)(((unsigned long)stack + THREAD_SIZE - 1) & -THREAD_SIZE);
printk("Stack from %08lx:", (unsigned long)stack);
+ p = stack;
for (i = 0; i < kstack_depth_to_print; i++) {
- if (stack + 1 > endstack)
+ if (p + 1 > endstack)
break;
if (i % 8 == 0)
printk("\n ");
- printk(" %08lx", *stack++);
+ printk(" %08lx", *p++);
}
printk("\n");
show_trace(stack);
--
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 07/11] restore amikbd compatibility with 2.4
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
` (5 preceding siblings ...)
2006-05-25 0:27 ` [PATCH 06/11] print correct stack trace zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 1:36 ` Andrew Morton
2006-05-25 0:27 ` [PATCH 08/11] extra delay zippel
` (3 subsequent siblings)
10 siblings, 1 reply; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Dump the extra mapping in the amikbd interrupt handler, so old Amiga
keymaps work again. Amigas need a special keymap anyway, standard
keymaps are not usable and recreating all keymaps is simply not worth
the trouble.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
drivers/input/keyboard/amikbd.c | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)
Index: linux-2.6-mm/drivers/input/keyboard/amikbd.c
===================================================================
--- linux-2.6-mm.orig/drivers/input/keyboard/amikbd.c
+++ linux-2.6-mm/drivers/input/keyboard/amikbd.c
@@ -36,6 +36,7 @@
#include <linux/input.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
+#include <linux/keyboard.h>
#include <asm/amigaints.h>
#include <asm/amigahw.h>
@@ -45,7 +46,7 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@u
MODULE_DESCRIPTION("Amiga keyboard driver");
MODULE_LICENSE("GPL");
-static unsigned char amikbd_keycode[0x78] = {
+static unsigned char amikbd_keycode[0x78] __initdata = {
[0] = KEY_GRAVE,
[1] = KEY_1,
[2] = KEY_2,
@@ -170,12 +171,9 @@ static irqreturn_t amikbd_interrupt(int
scancode >>= 1;
if (scancode < 0x78) { /* scancodes < 0x78 are keys */
-
- scancode = amikbd_keycode[scancode];
-
input_regs(amikbd_dev, fp);
- if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */
+ if (scancode == 98) { /* CapsLock is a toggle switch key on Amiga */
input_report_key(amikbd_dev, scancode, 1);
input_report_key(amikbd_dev, scancode, 0);
} else {
@@ -191,7 +189,7 @@ static irqreturn_t amikbd_interrupt(int
static int __init amikbd_init(void)
{
- int i;
+ int i, j;
if (!AMIGAHW_PRESENT(AMI_KEYBOARD))
return -EIO;
@@ -214,14 +212,26 @@ static int __init amikbd_init(void)
amikbd_dev->id.version = 0x0100;
amikbd_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
- amikbd_dev->keycode = amikbd_keycode;
- amikbd_dev->keycodesize = sizeof(unsigned char);
- amikbd_dev->keycodemax = ARRAY_SIZE(amikbd_keycode);
for (i = 0; i < 0x78; i++)
- if (amikbd_keycode[i])
- set_bit(amikbd_keycode[i], amikbd_dev->keybit);
+ set_bit(i, amikbd_dev->keybit);
+ for (i = 0; i < MAX_NR_KEYMAPS; i++) {
+ static u_short temp_map[NR_KEYS] __initdata;
+ if (!key_maps[i])
+ continue;
+ memset(temp_map, 0, sizeof(temp_map));
+ for (j = 0; j < 0x78; j++) {
+ if (!amikbd_keycode[j])
+ continue;
+ temp_map[j] = key_maps[i][amikbd_keycode[j]];
+ }
+ for (j = 0; j < NR_KEYS; j++) {
+ if (!temp_map[j])
+ temp_map[j] = 0xf200;
+ }
+ memcpy(key_maps[i], temp_map, sizeof(temp_map));
+ }
ciaa.cra &= ~0x41; /* serial data in, turn off TA */
request_irq(IRQ_AMIGA_CIAA_SP, amikbd_interrupt, 0, "amikbd", amikbd_interrupt);
--
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 07/11] restore amikbd compatibility with 2.4
2006-05-25 0:27 ` [PATCH 07/11] restore amikbd compatibility with 2.4 zippel
@ 2006-05-25 1:36 ` Andrew Morton
2006-05-25 1:50 ` Roman Zippel
0 siblings, 1 reply; 18+ messages in thread
From: Andrew Morton @ 2006-05-25 1:36 UTC (permalink / raw)
To: zippel; +Cc: linux-kernel
zippel@linux-m68k.org wrote:
>
> + for (i = 0; i < MAX_NR_KEYMAPS; i++) {
> + static u_short temp_map[NR_KEYS] __initdata;
> + if (!key_maps[i])
> + continue;
> + memset(temp_map, 0, sizeof(temp_map));
> + for (j = 0; j < 0x78; j++) {
> + if (!amikbd_keycode[j])
> + continue;
> + temp_map[j] = key_maps[i][amikbd_keycode[j]];
> + }
> + for (j = 0; j < NR_KEYS; j++) {
> + if (!temp_map[j])
> + temp_map[j] = 0xf200;
> + }
> + memcpy(key_maps[i], temp_map, sizeof(temp_map));
> + }
I assume temp_map[] is static to avoid using too much stack.
But wouldn't it be simpler to make this code operate on key_maps[i] directly?
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 07/11] restore amikbd compatibility with 2.4
2006-05-25 1:36 ` Andrew Morton
@ 2006-05-25 1:50 ` Roman Zippel
0 siblings, 0 replies; 18+ messages in thread
From: Roman Zippel @ 2006-05-25 1:50 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Hi,
On Wed, 24 May 2006, Andrew Morton wrote:
> zippel@linux-m68k.org wrote:
> >
> > + for (i = 0; i < MAX_NR_KEYMAPS; i++) {
> > + static u_short temp_map[NR_KEYS] __initdata;
> > + if (!key_maps[i])
> > + continue;
> > + memset(temp_map, 0, sizeof(temp_map));
> > + for (j = 0; j < 0x78; j++) {
> > + if (!amikbd_keycode[j])
> > + continue;
> > + temp_map[j] = key_maps[i][amikbd_keycode[j]];
> > + }
> > + for (j = 0; j < NR_KEYS; j++) {
> > + if (!temp_map[j])
> > + temp_map[j] = 0xf200;
> > + }
> > + memcpy(key_maps[i], temp_map, sizeof(temp_map));
> > + }
>
> I assume temp_map[] is static to avoid using too much stack.
Yes, although it should only be 1KB.
> But wouldn't it be simpler to make this code operate on key_maps[i] directly?
No, the remapping would overwrite data which still needs to be read.
bye, Roman
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 08/11] extra delay
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
` (6 preceding siblings ...)
2006-05-25 0:27 ` [PATCH 07/11] restore amikbd compatibility with 2.4 zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 0:27 ` [PATCH 09/11] use proper defines for zone initialization zippel
` (2 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
The wd33c93 needs a small delay before a new command can be started.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
drivers/scsi/wd33c93.c | 4 ++++
1 file changed, 4 insertions(+)
Index: linux-2.6-mm/drivers/scsi/wd33c93.c
===================================================================
--- linux-2.6-mm.orig/drivers/scsi/wd33c93.c
+++ linux-2.6-mm/drivers/scsi/wd33c93.c
@@ -939,6 +939,7 @@ wd33c93_intr(struct Scsi_Host *instance)
DB(DB_INTR, printk("%02x", cmd->SCp.Status))
if (hostdata->level2 >= L2_BASIC) {
sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear interrupt */
+ udelay(7);
hostdata->state = S_RUNNING_LEVEL2;
write_wd33c93(regs, WD_COMMAND_PHASE, 0x50);
write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER);
@@ -955,6 +956,7 @@ wd33c93_intr(struct Scsi_Host *instance)
msg = read_1_byte(regs);
sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear interrupt */
+ udelay(7);
hostdata->incoming_msg[hostdata->incoming_ptr] = msg;
if (hostdata->incoming_msg[0] == EXTENDED_MESSAGE)
@@ -1358,6 +1360,7 @@ wd33c93_intr(struct Scsi_Host *instance)
} else {
/* Verify this is a change to MSG_IN and read the message */
sr = read_wd33c93(regs, WD_SCSI_STATUS);
+ udelay(7);
if (sr == (CSR_ABORT | PHS_MESS_IN) ||
sr == (CSR_UNEXP | PHS_MESS_IN) ||
sr == (CSR_SRV_REQ | PHS_MESS_IN)) {
@@ -1374,6 +1377,7 @@ wd33c93_intr(struct Scsi_Host *instance)
asr);
}
sr = read_wd33c93(regs, WD_SCSI_STATUS);
+ udelay(7);
if (sr != CSR_MSGIN)
printk
("wd33c93: Not paused with ACK on RESEL (%02x)\n",
--
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 09/11] use proper defines for zone initialization
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
` (7 preceding siblings ...)
2006-05-25 0:27 ` [PATCH 08/11] extra delay zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 0:27 ` [PATCH 10/11] adjust to changed HARDIRQ_MASK zippel
2006-05-25 0:27 ` [PATCH 11/11] m68k mac VIA2 fixes and cleanups zippel
10 siblings, 0 replies; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
MAX_NR_ZONES changed, so use correct defines now.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
arch/m68k/mm/motorola.c | 12 ++++++------
arch/m68k/mm/sun3mmu.c | 5 ++---
2 files changed, 8 insertions(+), 9 deletions(-)
Index: linux-2.6-mm/arch/m68k/mm/motorola.c
===================================================================
--- linux-2.6-mm.orig/arch/m68k/mm/motorola.c
+++ linux-2.6-mm/arch/m68k/mm/motorola.c
@@ -203,7 +203,7 @@ void __init paging_init(void)
{
int chunk;
unsigned long mem_avail = 0;
- unsigned long zones_size[3] = { 0, };
+ unsigned long zones_size[MAX_NR_ZONES] = { 0, };
#ifdef DEBUG
{
@@ -257,12 +257,12 @@ void __init paging_init(void)
#ifdef DEBUG
printk ("before free_area_init\n");
#endif
- zones_size[0] = (mach_max_dma_address < (unsigned long)high_memory ?
- (mach_max_dma_address+1) : (unsigned long)high_memory);
- zones_size[1] = (unsigned long)high_memory - zones_size[0];
+ zones_size[ZONE_DMA] = (mach_max_dma_address < (unsigned long)high_memory ?
+ (mach_max_dma_address+1) : (unsigned long)high_memory);
+ zones_size[ZONE_NORMAL] = (unsigned long)high_memory - zones_size[0];
- zones_size[0] = (zones_size[0] - PAGE_OFFSET) >> PAGE_SHIFT;
- zones_size[1] >>= PAGE_SHIFT;
+ zones_size[ZONE_DMA] = (zones_size[ZONE_DMA] - PAGE_OFFSET) >> PAGE_SHIFT;
+ zones_size[ZONE_NORMAL] >>= PAGE_SHIFT;
free_area_init(zones_size);
}
Index: linux-2.6-mm/arch/m68k/mm/sun3mmu.c
===================================================================
--- linux-2.6-mm.orig/arch/m68k/mm/sun3mmu.c
+++ linux-2.6-mm/arch/m68k/mm/sun3mmu.c
@@ -46,7 +46,7 @@ void __init paging_init(void)
unsigned long address;
unsigned long next_pgtable;
unsigned long bootmem_end;
- unsigned long zones_size[3] = {0, 0, 0};
+ unsigned long zones_size[MAX_NR_ZONES] = { 0, };
unsigned long size;
@@ -92,8 +92,7 @@ void __init paging_init(void)
current->mm = NULL;
/* memory sizing is a hack stolen from motorola.c.. hope it works for us */
- zones_size[0] = ((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT;
- zones_size[1] = 0;
+ zones_size[ZONE_DMA] = ((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT;
free_area_init(zones_size);
--
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 10/11] adjust to changed HARDIRQ_MASK
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
` (8 preceding siblings ...)
2006-05-25 0:27 ` [PATCH 09/11] use proper defines for zone initialization zippel
@ 2006-05-25 0:27 ` zippel
2006-05-25 0:27 ` [PATCH 11/11] m68k mac VIA2 fixes and cleanups zippel
10 siblings, 0 replies; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
adjust entry.S to the changed HARDIRQ_MASK, add a check to prevent it
from silently breaking again.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
arch/m68k/kernel/entry.S | 4 ++--
arch/m68k/kernel/ints.c | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
Index: linux-2.6-mm/arch/m68k/kernel/entry.S
===================================================================
--- linux-2.6-mm.orig/arch/m68k/kernel/entry.S
+++ linux-2.6-mm/arch/m68k/kernel/entry.S
@@ -226,7 +226,7 @@ ENTRY(nmi_handler)
inthandler:
SAVE_ALL_INT
GET_CURRENT(%d0)
- addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+2)
+ addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
| put exception # in d0
bfextu %sp@(PT_VECTOR){#4,#10},%d0
@@ -245,7 +245,7 @@ inthandler:
3: addql #8,%sp | pop parameters off stack
ret_from_interrupt:
- subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+2)
+ subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+1)
jeq 1f
2:
RESTORE_ALL
Index: linux-2.6-mm/arch/m68k/kernel/ints.c
===================================================================
--- linux-2.6-mm.orig/arch/m68k/kernel/ints.c
+++ linux-2.6-mm/arch/m68k/kernel/ints.c
@@ -95,6 +95,12 @@ void __init init_IRQ(void)
{
int i;
+ /* assembly irq entry code relies on this... */
+ if (HARDIRQ_MASK != 0x00ff0000) {
+ extern void hardirq_mask_is_broken(void);
+ hardirq_mask_is_broken();
+ }
+
for (i = 0; i < SYS_IRQS; i++) {
if (mach_default_handler)
irq_list[i].handler = (*mach_default_handler)[i];
--
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 11/11] m68k mac VIA2 fixes and cleanups
2006-05-25 0:27 [PATCH 00/11] various m68k patches zippel
` (9 preceding siblings ...)
2006-05-25 0:27 ` [PATCH 10/11] adjust to changed HARDIRQ_MASK zippel
@ 2006-05-25 0:27 ` zippel
10 siblings, 0 replies; 18+ messages in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, Finn Thain
From: Finn Thain <fthain@telegraphics.com.au>
Some fixes and cleanups from the linux-mac68k repo. Fix mac_esp by
clearing the VIA2 SCSI IRQ flag before the SCSI IRQ handler is invoked.
Also fix a race condition caused by unmasking a nubus slot IRQ then
setting the relevant nubus_active bit.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
arch/m68k/mac/config.c | 13 -------------
arch/m68k/mac/macints.c | 1 -
arch/m68k/mac/via.c | 17 ++---------------
3 files changed, 2 insertions(+), 29 deletions(-)
Index: linux-2.6-mm/arch/m68k/mac/config.c
===================================================================
--- linux-2.6-mm.orig/arch/m68k/mac/config.c
+++ linux-2.6-mm/arch/m68k/mac/config.c
@@ -89,24 +89,11 @@ extern void mac_debugging_long(int, long
static void mac_get_model(char *str);
-void mac_bang(int irq, void *vector, struct pt_regs *p)
-{
- printk(KERN_INFO "Resetting ...\n");
- mac_reset();
-}
-
static void mac_sched_init(irqreturn_t (*vector)(int, void *, struct pt_regs *))
{
via_init_clock(vector);
}
-#if 0
-void mac_waitbut (void)
-{
- ;
-}
-#endif
-
extern irqreturn_t mac_default_handler(int, void *, struct pt_regs *);
irqreturn_t (*mac_handlers[8])(int, void *, struct pt_regs *)=
Index: linux-2.6-mm/arch/m68k/mac/macints.c
===================================================================
--- linux-2.6-mm.orig/arch/m68k/mac/macints.c
+++ linux-2.6-mm/arch/m68k/mac/macints.c
@@ -216,7 +216,6 @@ static void scc_irq_disable(int);
* console_loglevel determines NMI handler function
*/
-extern irqreturn_t mac_bang(int, void *, struct pt_regs *);
irqreturn_t mac_nmi_handler(int, void *, struct pt_regs *);
irqreturn_t mac_debug_handler(int, void *, struct pt_regs *);
Index: linux-2.6-mm/arch/m68k/mac/via.c
===================================================================
--- linux-2.6-mm.orig/arch/m68k/mac/via.c
+++ linux-2.6-mm/arch/m68k/mac/via.c
@@ -25,7 +25,6 @@
#include <linux/init.h>
#include <linux/ide.h>
-#include <asm/traps.h>
#include <asm/bootinfo.h>
#include <asm/macintosh.h>
#include <asm/macints.h>
@@ -71,7 +70,6 @@ void via_irq_enable(int irq);
void via_irq_disable(int irq);
void via_irq_clear(int irq);
-extern irqreturn_t mac_bang(int, void *, struct pt_regs *);
extern irqreturn_t mac_scc_dispatch(int, void *, struct pt_regs *);
extern int oss_present;
@@ -212,11 +210,6 @@ void __init via_init(void)
break;
}
#else
- /* The alernate IRQ mapping seems to just not work. Anyone with a */
- /* supported machine is welcome to take a stab at fixing it. It */
- /* _should_ work on the following Quadras: 610,650,700,800,900,950 */
- /* - 1999-06-12 (jmt) */
-
via_alt_mapping = 0;
#endif
@@ -270,12 +263,6 @@ void __init via_register_interrupts(void
cpu_request_irq(IRQ_AUTO_1, via1_irq,
IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
(void *) via1);
-#if 0 /* interferes with serial on some machines */
- if (!psc_present) {
- cpu_request_irq(IRQ_AUTO_6, mac_bang, IRQ_FLG_LOCK,
- "Off Switch", mac_bang);
- }
-#endif
}
cpu_request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
"via2", (void *) via2);
@@ -471,8 +458,8 @@ irqreturn_t via2_irq(int irq, void *dev_
for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1)
if (events & irq_bit) {
via2[gIER] = irq_bit;
- mac_do_irq_list(VIA2_SOURCE_BASE + i, regs);
via2[gIFR] = irq_bit | rbv_clear;
+ mac_do_irq_list(VIA2_SOURCE_BASE + i, regs);
via2[gIER] = irq_bit | 0x80;
}
return IRQ_HANDLED;
@@ -529,6 +516,7 @@ void via_irq_enable(int irq) {
}
via2[gIER] = irq_bit | 0x80;
} else if (irq_src == 7) {
+ nubus_active |= irq_bit;
if (rbv_present) {
/* enable the slot interrupt. SIER works like IER. */
via2[rSIER] = IER_SET_BIT(irq_idx);
@@ -550,7 +538,6 @@ void via_irq_enable(int irq) {
}
}
}
- nubus_active |= irq_bit;
}
}
--
^ permalink raw reply [flat|nested] 18+ messages in thread