* 2.6.7, amd64: PS/2 Mouse detection doesn't work @ 2004-07-11 7:00 Harald Dunkel 2004-07-11 8:42 ` Vojtech Pavlik 0 siblings, 1 reply; 9+ messages in thread From: Harald Dunkel @ 2004-07-11 7:00 UTC (permalink / raw) To: linux-kernel Hi folks, Most of the times my mouse is detected as generic PS/2, even though it is a Logitech. I have to reload the mousedev and psmouse modules to make it work. # grep -i mouse /var/log/kern.log Jul 10 17:23:08 r101 kernel: input: PS/2 Generic Mouse on isa0060/serio1 Jul 10 17:23:08 r101 kernel: mice: PS/2 mouse device common for all mice Jul 10 17:24:59 r101 kernel: input: PS/2 Generic Mouse on isa0060/serio1 Jul 10 17:24:59 r101 kernel: mice: PS/2 mouse device common for all mice Jul 10 17:43:41 r101 kernel: input: PS2++ Logitech Mouse on isa0060/serio1 Jul 10 17:43:41 r101 kernel: mice: PS/2 mouse device common for all mice Jul 10 17:46:59 r101 kernel: input: PS2++ Logitech Mouse on isa0060/serio1 Jul 10 17:47:00 r101 kernel: mice: PS/2 mouse device common for all mice Jul 11 07:34:34 r101 kernel: input: PS/2 Generic Mouse on isa0060/serio1 Jul 11 07:34:34 r101 kernel: mice: PS/2 mouse device common for all mice Jul 11 07:36:01 r101 kernel: input: PS/2 Generic Mouse on isa0060/serio1 Jul 11 07:36:01 r101 kernel: mice: PS/2 mouse device common for all mice Jul 11 08:43:33 r101 kernel: mice: PS/2 mouse device common for all mice Jul 11 08:43:33 r101 kernel: input: PS2++ Logitech Mouse on isa0060/serio1 Usually I wouldn't care, but I can go mad if the 4th mouse button doesn't work :-). Any idea? Regards Harri ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.7, amd64: PS/2 Mouse detection doesn't work 2004-07-11 7:00 2.6.7, amd64: PS/2 Mouse detection doesn't work Harald Dunkel @ 2004-07-11 8:42 ` Vojtech Pavlik 2004-07-11 13:16 ` Harald Dunkel ` (3 more replies) 0 siblings, 4 replies; 9+ messages in thread From: Vojtech Pavlik @ 2004-07-11 8:42 UTC (permalink / raw) To: Harald Dunkel; +Cc: linux-kernel [-- Attachment #1: Type: text/plain, Size: 1577 bytes --] On Sun, Jul 11, 2004 at 09:00:22AM +0200, Harald Dunkel wrote: > Hi folks, > > Most of the times my mouse is detected as generic PS/2, > even though it is a Logitech. I have to reload the mousedev > and psmouse modules to make it work. > > # grep -i mouse /var/log/kern.log > Jul 10 17:23:08 r101 kernel: input: PS/2 Generic Mouse on isa0060/serio1 > Jul 10 17:23:08 r101 kernel: mice: PS/2 mouse device common for all mice > Jul 10 17:24:59 r101 kernel: input: PS/2 Generic Mouse on isa0060/serio1 > Jul 10 17:24:59 r101 kernel: mice: PS/2 mouse device common for all mice > Jul 10 17:43:41 r101 kernel: input: PS2++ Logitech Mouse on isa0060/serio1 > Jul 10 17:43:41 r101 kernel: mice: PS/2 mouse device common for all mice > Jul 10 17:46:59 r101 kernel: input: PS2++ Logitech Mouse on isa0060/serio1 > Jul 10 17:47:00 r101 kernel: mice: PS/2 mouse device common for all mice > Jul 11 07:34:34 r101 kernel: input: PS/2 Generic Mouse on isa0060/serio1 > Jul 11 07:34:34 r101 kernel: mice: PS/2 mouse device common for all mice > Jul 11 07:36:01 r101 kernel: input: PS/2 Generic Mouse on isa0060/serio1 > Jul 11 07:36:01 r101 kernel: mice: PS/2 mouse device common for all mice > Jul 11 08:43:33 r101 kernel: mice: PS/2 mouse device common for all mice > Jul 11 08:43:33 r101 kernel: input: PS2++ Logitech Mouse on isa0060/serio1 > > > Usually I wouldn't care, but I can go mad if the 4th mouse > button doesn't work :-). > > Any idea? Build the USB drivers into the kernel, or use the attached patch. If it helps, please tell me. -- Vojtech Pavlik SuSE Labs, SuSE CR [-- Attachment #2: psmouse-usb-fix-3 --] [-- Type: text/plain, Size: 2719 bytes --] ChangeSet@1.1831, 2004-04-03 23:30:39+02:00, vojtech@suse.cz input: Disable USB Legacy emulation in PCI quirks. quirks.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 62 insertions(+) diff -Nru a/drivers/pci/quirks.c b/drivers/pci/quirks.c --- a/drivers/pci/quirks.c Sat Apr 3 23:30:49 2004 +++ b/drivers/pci/quirks.c Sat Apr 3 23:30:49 2004 @@ -868,6 +868,68 @@ } #endif /* CONFIG_SCSI_SATA */ + +#define UHCI_USBLEGSUP 0xc0 /* legacy support */ +#define UHCI_USBCMD 0 /* command register */ +#define UHCI_USBINTR 4 /* interrupt register */ +#define UHCI_USBLEGSUP_DEFAULT 0x2000 /* only PIRQ enable set */ +#define UHCI_USBCMD_GRESET 0x0004 /* Global reset */ + +#define OHCI_CONTROL 0x04 +#define OHCI_CMDSTATUS 0x08 +#define OHCI_INTRENABLE 0x10 +#define OHCI_OCR (1 << 3) /* ownership change request */ +#define OHCI_CTRL_IR (1 << 8) /* interrupt routing */ +#define OHCI_INTR_OC (1 << 30) /* ownership change */ + +#if defined(__i386__) || defined(__x86_64__) +static void __init quirk_usb_disable_smm_bios(struct pci_dev *pdev) +{ + + if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x00)) { /* UHCI */ + int i; + unsigned long base = 0;; + + for (i = 0; i < PCI_ROM_RESOURCE; i++) + if ((pci_resource_flags(pdev, i) & IORESOURCE_IO)) { + base = pci_resource_start(pdev, i); + break; + } + + if (!base) + return; + + outw(0, base + UHCI_USBINTR); + outw(UHCI_USBCMD_GRESET, base + UHCI_USBCMD); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout((HZ*50+999) / 1000); + outw(0, base + UHCI_USBCMD); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout((HZ*10+999) / 1000); + + pci_write_config_word(pdev, UHCI_USBLEGSUP, UHCI_USBLEGSUP_DEFAULT); + } + + if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x10)) { /* OHCI */ + char *base = ioremap_nocache(pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0)); + if (base == NULL) return; + + if (readl(base + OHCI_CONTROL) & OHCI_CTRL_IR) { + int temp = 500; /* arbitrary: five seconds */ + writel(OHCI_INTR_OC, base + OHCI_INTRENABLE); + writel(OHCI_OCR, base + OHCI_CMDSTATUS); + while (temp && readl(base + OHCI_CONTROL) & OHCI_CTRL_IR) { + temp--; + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout( HZ / 100); + } + } + iounmap(base); + } +} +#endif + /* * The main table of quirks. * @@ -983,6 +1043,10 @@ { PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_intel_ide_combined }, #endif /* CONFIG_SCSI_SATA */ + +#if defined(__i386__) || defined(__x86_64__) + { PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, quirk_usb_disable_smm_bios }, +#endif { 0 } }; ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.7, amd64: PS/2 Mouse detection doesn't work 2004-07-11 8:42 ` Vojtech Pavlik @ 2004-07-11 13:16 ` Harald Dunkel 2004-07-18 10:22 ` Harald Dunkel ` (2 subsequent siblings) 3 siblings, 0 replies; 9+ messages in thread From: Harald Dunkel @ 2004-07-11 13:16 UTC (permalink / raw) To: Vojtech Pavlik; +Cc: linux-kernel Vojtech Pavlik wrote: > On Sun, Jul 11, 2004 at 09:00:22AM +0200, Harald Dunkel wrote: > >> >>Usually I wouldn't care, but I can go mad if the 4th mouse >>button doesn't work :-). >> >>Any idea? > > > Build the USB drivers into the kernel, or use the attached patch. > If it helps, please tell me. > > I tried the patch: Seems to work. After a power cycle the mouse was detected as Jul 11 15:09:29 r101 kernel: input: PS2++ Logitech Mouse on isa0060/serio1 Jul 11 15:09:29 r101 kernel: mice: PS/2 mouse device common for all mice as expected. Many thanx Harri ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.7, amd64: PS/2 Mouse detection doesn't work 2004-07-11 8:42 ` Vojtech Pavlik 2004-07-11 13:16 ` Harald Dunkel @ 2004-07-18 10:22 ` Harald Dunkel 2004-08-04 10:52 ` Harald Dunkel 2004-10-20 12:57 ` Harald Dunkel 3 siblings, 0 replies; 9+ messages in thread From: Harald Dunkel @ 2004-07-18 10:22 UTC (permalink / raw) To: Vojtech Pavlik; +Cc: linux-kernel Vojtech Pavlik wrote: > > Build the USB drivers into the kernel, or use the attached patch. > If it helps, please tell me. > The patch worked, as written before. Would it be possible to permanently add it to the kernel for 2.6.8-rc3? Many thanx Harri ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.7, amd64: PS/2 Mouse detection doesn't work 2004-07-11 8:42 ` Vojtech Pavlik 2004-07-11 13:16 ` Harald Dunkel 2004-07-18 10:22 ` Harald Dunkel @ 2004-08-04 10:52 ` Harald Dunkel 2004-10-20 12:57 ` Harald Dunkel 3 siblings, 0 replies; 9+ messages in thread From: Harald Dunkel @ 2004-08-04 10:52 UTC (permalink / raw) To: linux-kernel; +Cc: Vojtech Pavlik Hi folks, Vojtech Pavlik wrote: > On Sun, Jul 11, 2004 at 09:00:22AM +0200, Harald Dunkel wrote: > >>Hi folks, >> >>Most of the times my mouse is detected as generic PS/2, >>even though it is a Logitech. I have to reload the mousedev >>and psmouse modules to make it work. >> Would it be possible to get Vojtech's patch in for 2.6.8? Or are there some unpredictable side effects? Many thanx Harri ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.7, amd64: PS/2 Mouse detection doesn't work 2004-07-11 8:42 ` Vojtech Pavlik ` (2 preceding siblings ...) 2004-08-04 10:52 ` Harald Dunkel @ 2004-10-20 12:57 ` Harald Dunkel 2004-10-20 19:40 ` Alan Cox 3 siblings, 1 reply; 9+ messages in thread From: Harald Dunkel @ 2004-10-20 12:57 UTC (permalink / raw) To: linux-kernel; +Cc: Vojtech Pavlik [-- Attachment #1: Type: text/plain, Size: 79 bytes --] Hi folks, Attached you can find an updated patch for 2.6.9. Regards Harri [-- Attachment #2: psmouse-usb-fix-3.new --] [-- Type: text/plain, Size: 2382 bytes --] --- /tmp/linux-2.6.9/drivers/pci/quirks.c 2004-10-18 23:53:06.000000000 +0200 +++ linux-2.6.9/drivers/pci/quirks.c 2004-10-20 14:21:02.000000000 +0200 @@ -826,6 +826,69 @@ pci_read_config_byte(dev, 0x77, &val); } + +#define UHCI_USBLEGSUP 0xc0 /* legacy support */ +#define UHCI_USBCMD 0 /* command register */ +#define UHCI_USBINTR 4 /* interrupt register */ +#define UHCI_USBLEGSUP_DEFAULT 0x2000 /* only PIRQ enable set */ +#define UHCI_USBCMD_GRESET 0x0004 /* Global reset */ + +#define OHCI_CONTROL 0x04 +#define OHCI_CMDSTATUS 0x08 +#define OHCI_INTRENABLE 0x10 +#define OHCI_OCR (1 << 3) /* ownership change request */ +#define OHCI_CTRL_IR (1 << 8) /* interrupt routing */ +#define OHCI_INTR_OC (1 << 30) /* ownership change */ + +#if defined(__i386__) || defined(__x86_64__) +static void __init quirk_usb_disable_smm_bios(struct pci_dev *pdev) +{ + + if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x00)) { /* UHCI */ + int i; + unsigned long base = 0;; + + for (i = 0; i < PCI_ROM_RESOURCE; i++) + if ((pci_resource_flags(pdev, i) & IORESOURCE_IO)) { + base = pci_resource_start(pdev, i); + break; + } + + if (!base) + return; + + outw(0, base + UHCI_USBINTR); + outw(UHCI_USBCMD_GRESET, base + UHCI_USBCMD); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout((HZ*50+999) / 1000); + outw(0, base + UHCI_USBCMD); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout((HZ*10+999) / 1000); + + pci_write_config_word(pdev, UHCI_USBLEGSUP, UHCI_USBLEGSUP_DEFAULT); + } + + if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x10)) { /* OHCI */ + char *base = ioremap_nocache(pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0)); + if (base == NULL) return; + + if (readl(base + OHCI_CONTROL) & OHCI_CTRL_IR) { + int temp = 500; /* arbitrary: five seconds */ + writel(OHCI_INTR_OC, base + OHCI_INTRENABLE); + writel(OHCI_OCR, base + OHCI_CMDSTATUS); + while (temp && readl(base + OHCI_CONTROL) & OHCI_CTRL_IR) { + temp--; + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout( HZ / 100); + } + } + iounmap(base); + } +} +DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_disable_smm_bios ); +#endif + /* * ... This is further complicated by the fact that some SiS96x south * bridges pretend to be 85C503/5513 instead. In that case see if we ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.7, amd64: PS/2 Mouse detection doesn't work 2004-10-20 12:57 ` Harald Dunkel @ 2004-10-20 19:40 ` Alan Cox 2004-10-21 8:11 ` Harald Dunkel 0 siblings, 1 reply; 9+ messages in thread From: Alan Cox @ 2004-10-20 19:40 UTC (permalink / raw) To: Harald Dunkel; +Cc: Linux Kernel Mailing List, Vojtech Pavlik On Mer, 2004-10-20 at 13:57, Harald Dunkel wrote: > Hi folks, > > Attached you can find an updated patch for 2.6.9. You need to handle the USB reset quirks for OHCI and also catch any escaped interrupts. It also seems you have to deal with UHCI (at least my E750x fixes arent sufficient with a keyboard on an EHCI hub) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.7, amd64: PS/2 Mouse detection doesn't work 2004-10-20 19:40 ` Alan Cox @ 2004-10-21 8:11 ` Harald Dunkel 2004-10-21 9:44 ` Alan Cox 0 siblings, 1 reply; 9+ messages in thread From: Harald Dunkel @ 2004-10-21 8:11 UTC (permalink / raw) To: Alan Cox; +Cc: Linux Kernel Mailing List, Vojtech Pavlik Alan Cox wrote: > On Mer, 2004-10-20 at 13:57, Harald Dunkel wrote: > >>Hi folks, >> >>Attached you can find an updated patch for 2.6.9. > > > You need to handle the USB reset quirks for OHCI and also catch any > escaped interrupts. It also seems you have to deal with UHCI (at least > my E750x fixes arent sufficient with a keyboard on an EHCI hub) > I am not a kernel developer. I just modified Vojtech's patch for 2.6.9. His patch works for me since 2.6.7. But it seems that UHCI _is_ handled, isn't it? Regards Harri ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 2.6.7, amd64: PS/2 Mouse detection doesn't work 2004-10-21 8:11 ` Harald Dunkel @ 2004-10-21 9:44 ` Alan Cox 0 siblings, 0 replies; 9+ messages in thread From: Alan Cox @ 2004-10-21 9:44 UTC (permalink / raw) To: Harald Dunkel; +Cc: Linux Kernel Mailing List, Vojtech Pavlik On Iau, 2004-10-21 at 09:11, Harald Dunkel wrote: > I am not a kernel developer. I just modified Vojtech's patch > for 2.6.9. His patch works for me since 2.6.7. > > But it seems that UHCI _is_ handled, isn't it? Braino .. I meant EHCI ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-10-21 10:51 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-07-11 7:00 2.6.7, amd64: PS/2 Mouse detection doesn't work Harald Dunkel 2004-07-11 8:42 ` Vojtech Pavlik 2004-07-11 13:16 ` Harald Dunkel 2004-07-18 10:22 ` Harald Dunkel 2004-08-04 10:52 ` Harald Dunkel 2004-10-20 12:57 ` Harald Dunkel 2004-10-20 19:40 ` Alan Cox 2004-10-21 8:11 ` Harald Dunkel 2004-10-21 9:44 ` Alan Cox
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox