From kbaidarov@ru.mvista.com Tue Feb 5 09:41:30 2008 Received: with ECARTIS (v1.0.0; list kdb); Tue, 05 Feb 2008 09:41:43 -0800 (PST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m15HfSfL013762 for ; Tue, 5 Feb 2008 09:41:30 -0800 X-ASG-Debug-ID: 1202233303-429a02a60000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.dev.rtsoft.ru (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id B47A85A1DA3 for ; Tue, 5 Feb 2008 09:41:43 -0800 (PST) Received: from mail.dev.rtsoft.ru (rtsoft2.corbina.net [85.21.88.2]) by cuda.sgi.com with SMTP id abWbktTDFRVQWPde for ; Tue, 05 Feb 2008 09:41:43 -0800 (PST) Received: (qmail 24526 invoked from network); 5 Feb 2008 17:41:42 -0000 Received: from windmill.dev.rtsoft.ru.dev.rtsoft.ru (HELO windmill.dev.rtsoft.ru) (192.168.1.124) by mail.dev.rtsoft.ru with SMTP; 5 Feb 2008 17:41:42 -0000 Date: Tue, 5 Feb 2008 20:34:21 +0300 From: Konstantin Baydarov To: kdb@oss.sgi.com Cc: Aaron Young , jlan@sgi.com (Jay Lan) X-ASG-Orig-Subj: Re: [PATCH] Add support for USB Keyboard attached to UHCI Subject: Re: [PATCH] Add support for USB Keyboard attached to UHCI Message-ID: <20080205203421.5cdfa3cc@windmill.dev.rtsoft.ru> In-Reply-To: <200801111716.m0BHGVQx205060@kluge.engr.sgi.com> References: <478439B8.3010809@sgi.com> <200801111716.m0BHGVQx205060@kluge.engr.sgi.com> X-Mailer: Claws Mail 3.1.0 (GTK+ 2.12.1; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Barracuda-Connect: rtsoft2.corbina.net[85.21.88.2] X-Barracuda-Start-Time: 1202233310 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.41453 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M BODY: Custom Rule 7568M X-archive-position: 1329 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kbaidarov@ru.mvista.com Precedence: bulk X-list: kdb Hello, Aarong, Jay. Sorry that it takes to much time to review/reply messages related to UHCI. ftp://oss.sgi.com/projects/kdb/download/v4.4/USB_UHCI_support-v2.bz2 - isn't complete. Kernel 2.6.24-rc4 doesn't even compile. I've redesign my patch to make only minimal changes to common usb layer. - I've added two USB Host Controller (HC) specific callbacks kdb_hc_keyboard_attach, kdb_hc_keyboard_detach to the kdb_usb_kbd_info. Callbacks kdb_hc_keyboard_attach, kdb_hc_keyboard_detach are called from kdb_usb_keyboard_attach, kdb_usb_keyboard_detach correspondingly to make USB HC specific KDB work when KBD is attached/detached. So no new global functions to USB layer are required. Currently only UHCI has this callbacks. - I've moved all KDB UHCI code to UHCI HC files. Now we have only one kdb_uhci_keyboard_urb() instead of 3 copies (Jay noticed it earlier). - As I've added USB HC specific callbacks and moved all UHCI code to UHCI driver, there shouldn't any problems now when USB HD drivers is compiled as kernel modules. - Allow CONFIG_KDB_USB option(In arch/x86/Kconfig.debug) if any of USB HC is selected, not only OHCI. - One common change was done in get_usb_char(). It was in earlier version of patch but we didn't discuss it. In case of UHCI Keyboard, when 2 keys is pressed simultaneously we get 2 urbs. First urb stores only 1 keycode of the first pressed key in kdb_usb_kbds[i].buffer[2]. Second urb stores 2 keycodes - first keycode in kdb_usb_kbds[i].buffer[2], second keycode in kdb_usb_kbds[i].buffer[3]. As previous code of get_usb_char() just ignore kdb_usb_kbds[i].buffer[3], I've made updates of get_usb_char(). Also I've added USB HC specific URB complete callback to get_usb_char(). I don't know how keycodes are stored in case of OHCI and EHCI, so probably USB HC checks should also be added to get_usb_char() or new USB HC callback should be added to get_usb_char(), that extracts keycodes from URB buffer. Patch was done for 2.6.24-rc4 KDB kernel with ftp://oss.sgi.com/projects/kdb/download/v4.4/USB_EHCI_support-v2.bz2 applied. I hope you'll have some time to review changes. Also I've sent another patch http://oss.sgi.com/archives/kdb/2007-11/msg00037.html , Aarong, I hope you'll have some time to review it too. With Best Regards, Konstantin Baydarov, Software Engineer Montavista Russia mail-to: kbaidarov@ru.mvista.com Signed-off-by: Konstantin Baydarov Index: linux-2.6.24-rc4_kdb_usb/arch/x86/kdb/kdba_io_32.c =================================================================== --- linux-2.6.24-rc4_kdb_usb.orig/arch/x86/kdb/kdba_io_32.c +++ linux-2.6.24-rc4_kdb_usb/arch/x86/kdb/kdba_io_32.c @@ -20,7 +20,7 @@ #include #include -#include +#include "pc_keyb_32.h" #ifdef CONFIG_VT_CONSOLE #define KDB_BLINK_LED 1 @@ -30,9 +30,8 @@ #ifdef CONFIG_KDB_USB -/* support up to 8 USB keyboards (probably excessive, but...) */ -#define KDB_USB_NUM_KEYBOARDS 8 struct kdb_usb_kbd_info kdb_usb_kbds[KDB_USB_NUM_KEYBOARDS]; +EXPORT_SYMBOL(kdb_usb_kbds); extern int kdb_no_usb; @@ -60,7 +59,12 @@ static unsigned char kdb_usb_keycode[256 * Attach a USB keyboard to kdb. */ int -kdb_usb_keyboard_attach(struct urb *urb, unsigned char *buffer, void *poll_func) +kdb_usb_keyboard_attach(struct urb *urb, unsigned char *buffer, + void *poll_func, void *compl_func, + kdb_hc_keyboard_attach_t kdb_hc_keyboard_attach, + kdb_hc_keyboard_detach_t kdb_hc_keyboard_detach, + unsigned int bufsize, + struct urb *hid_urb) { int i; int rc = -1; @@ -82,6 +86,15 @@ kdb_usb_keyboard_attach(struct urb *urb, kdb_usb_kbds[i].urb = urb; kdb_usb_kbds[i].buffer = buffer; kdb_usb_kbds[i].poll_func = poll_func; + kdb_usb_kbds[i].kdb_hc_urb_complete = compl_func; + kdb_usb_kbds[i].kdb_hc_keyboard_attach = kdb_hc_keyboard_attach; + kdb_usb_kbds[i].kdb_hc_keyboard_detach = kdb_hc_keyboard_detach; + + /* USB Host Controller specific Keyboadr attach callback. + * Currently only UHCI has this callback. + */ + if (kdb_usb_kbds[i].kdb_hc_keyboard_attach) + kdb_usb_kbds[i].kdb_hc_keyboard_attach(i, bufsize); rc = 0; /* success */ @@ -112,14 +125,21 @@ kdb_usb_keyboard_detach(struct urb *urb) */ for (i = 0; i < KDB_USB_NUM_KEYBOARDS; i++) { - if (kdb_usb_kbds[i].urb != urb) + if ((kdb_usb_kbds[i].urb != urb) && (kdb_usb_kbds[i].hid_urb != urb)) continue; /* found it, clear the index */ + + /* USB Host Controller specific Keyboard detach callback. + * Currently only UHCI has this callback. + */ + if (kdb_usb_kbds[i].kdb_hc_keyboard_detach) + kdb_usb_kbds[i].kdb_hc_keyboard_detach(urb, i); kdb_usb_kbds[i].urb = NULL; kdb_usb_kbds[i].buffer = NULL; kdb_usb_kbds[i].poll_func = NULL; kdb_usb_kbds[i].caps_lock = 0; + kdb_usb_kbds[i].hid_urb = NULL; rc = 0; /* success */ @@ -142,6 +162,9 @@ get_usb_char(void) int ret; unsigned char keycode, spec; extern u_short plain_map[], shift_map[], ctrl_map[]; + int ret_key = -1, j, max; + + ret = -1; if (kdb_no_usb) return -1; @@ -162,15 +185,24 @@ get_usb_char(void) if (ret == -1) /* error or no characters, try the next kbd */ continue; + /* If 2 keys was pressed simultaneously, + * both keycodes will be in buffer. + * Last pressed key will be last non + * zero byte. + */ + for (j=0; j<4; j++){ + if (!kdb_usb_kbds[i].buffer[2+j]) + break; + } + /* Last pressed key */ + max = j + 1; + spec = kdb_usb_kbds[i].buffer[0]; - keycode = kdb_usb_kbds[i].buffer[2]; + keycode = kdb_usb_kbds[i].buffer[max]; kdb_usb_kbds[i].buffer[0] = (char)0; kdb_usb_kbds[i].buffer[2] = (char)0; - if(kdb_usb_kbds[i].buffer[3]) { - kdb_usb_kbds[i].buffer[3] = (char)0; - continue; - } + ret_key = -1; /* A normal key is pressed, decode it */ if(keycode) @@ -182,10 +214,12 @@ get_usb_char(void) { case 0x2: case 0x20: /* Shift */ - return shift_map[keycode]; + ret_key = shift_map[keycode]; + break; case 0x1: case 0x10: /* Ctrl */ - return ctrl_map[keycode]; + ret_key = ctrl_map[keycode]; + break; case 0x4: case 0x40: /* Alt */ break; @@ -194,31 +228,47 @@ get_usb_char(void) switch(keycode) { case 0x1C: /* Enter */ - return 13; - + ret_key = 13; + break; case 0x3A: /* Capslock */ kdb_usb_kbds[i].caps_lock = !(kdb_usb_kbds[i].caps_lock); break; case 0x0E: /* Backspace */ - return 8; + ret_key = 8; + break; case 0x0F: /* TAB */ - return 9; + ret_key = 9; + break; case 0x77: /* Pause */ break ; default: if(!kdb_usb_kbds[i].caps_lock) { - return plain_map[keycode]; + ret_key = plain_map[keycode]; + break; } else { - return shift_map[keycode]; + ret_key = shift_map[keycode]; + break; } } } - } + /* Key was pressed, return keycode */ + + /* Clear buffer before urb resending */ + if (kdb_usb_kbds[i].buffer) + for(j=0; j<8; j++) + kdb_usb_kbds[i].buffer[j] = (char)0; + + /* USB Host Controller specific Urb complete callback. + * Currently only UHCI has this callback. + */ + if (kdb_usb_kbds[i].kdb_hc_urb_complete) + (*kdb_usb_kbds[i].kdb_hc_urb_complete)((struct urb *)kdb_usb_kbds[i].urb); - /* no chars were returned from any of the USB keyboards */ + break; + } - return -1; + return ret_key; } #endif /* CONFIG_KDB_USB */ Index: linux-2.6.24-rc4_kdb_usb/drivers/hid/usbhid/hid-core.c =================================================================== --- linux-2.6.24-rc4_kdb_usb.orig/drivers/hid/usbhid/hid-core.c +++ linux-2.6.24-rc4_kdb_usb/drivers/hid/usbhid/hid-core.c @@ -1045,8 +1045,20 @@ static int hid_probe(struct usb_interfac int ret; struct usbhid_device *usbhid = hid->driver_data; extern void * usb_hcd_get_kdb_poll_func(struct usb_device *udev); + extern void * usb_hcd_get_kdb_completion_func(struct usb_device *udev); + extern int usb_hcd_check_uhci(struct usb_device *udev); + extern kdb_hc_keyboard_attach_t + usb_hcd_get_hc_keyboard_attach(struct usb_device *udev); + extern kdb_hc_keyboard_detach_t + usb_hcd_get_hc_keyboard_detach(struct usb_device *udev); + ret = kdb_usb_keyboard_attach(usbhid->urbin, usbhid->inbuf, - usb_hcd_get_kdb_poll_func(interface_to_usbdev(intf))); + usb_hcd_get_kdb_poll_func(interface_to_usbdev(intf)), + usb_hcd_get_kdb_completion_func(interface_to_usbdev(intf)), + usb_hcd_get_hc_keyboard_attach(interface_to_usbdev(intf)), + usb_hcd_get_hc_keyboard_detach(interface_to_usbdev(intf)), + usbhid->bufsize, + NULL); if (ret == -1) printk(": FAILED to register keyboard (%s) " Index: linux-2.6.24-rc4_kdb_usb/drivers/usb/core/hcd.c =================================================================== --- linux-2.6.24-rc4_kdb_usb.orig/drivers/usb/core/hcd.c +++ linux-2.6.24-rc4_kdb_usb/drivers/usb/core/hcd.c @@ -37,6 +37,9 @@ #include #include #include +#ifdef CONFIG_KDB_USB +#include +#endif #include @@ -1852,6 +1855,58 @@ usb_hcd_get_kdb_poll_func(struct usb_dev return NULL; } EXPORT_SYMBOL_GPL (usb_hcd_get_kdb_poll_func); + +void * +usb_hcd_get_kdb_completion_func(struct usb_device *udev) +{ + struct usb_hcd *hcd = bus_to_hcd(udev->bus); + + if (hcd && hcd->driver) + return (void *)(hcd->driver->kdb_completion); + + return NULL; +} +EXPORT_SYMBOL_GPL (usb_hcd_get_kdb_completion_func); + +int +usb_hcd_check_uhci(struct usb_device *udev) +{ + struct usb_hcd *hcd = bus_to_hcd(udev->bus); + + if (hcd && hcd->driver){ + if (!(strcmp(hcd->driver->description, "uhci_hcd"))) + return 1; + } + + return 0; +} +EXPORT_SYMBOL_GPL (usb_hcd_check_uhci); + +kdb_hc_keyboard_attach_t +usb_hcd_get_hc_keyboard_attach(struct usb_device *udev) +{ + struct usb_hcd *hcd = bus_to_hcd(udev->bus); + + if (hcd && hcd->driver){ + return hcd->driver->kdb_hc_keyboard_attach; + } + + return 0; +} +EXPORT_SYMBOL_GPL (usb_hcd_get_hc_keyboard_attach); + +kdb_hc_keyboard_detach_t +usb_hcd_get_hc_keyboard_detach(struct usb_device *udev) +{ + struct usb_hcd *hcd = bus_to_hcd(udev->bus); + + if (hcd && hcd->driver){ + return hcd->driver->kdb_hc_keyboard_detach; + } + + return 0; +} +EXPORT_SYMBOL_GPL (usb_hcd_get_hc_keyboard_detach); #endif /* CONFIG_KDB_USB */ /*-------------------------------------------------------------------------*/ Index: linux-2.6.24-rc4_kdb_usb/drivers/usb/core/hcd.h =================================================================== --- linux-2.6.24-rc4_kdb_usb.orig/drivers/usb/core/hcd.h +++ linux-2.6.24-rc4_kdb_usb/drivers/usb/core/hcd.h @@ -20,6 +20,9 @@ #ifdef __KERNEL__ #include +#ifdef CONFIG_KDB_USB +#include +#endif /* This file contains declarations of usbcore internals that are mostly * used or exposed by Host Controller Drivers. @@ -213,6 +216,9 @@ struct hc_driver { #ifdef CONFIG_KDB_USB /* KDB poll function for this HC */ int (*kdb_poll_char)(struct urb *urb); + void (*kdb_completion)(struct urb *urb); + kdb_hc_keyboard_attach_t kdb_hc_keyboard_attach; + kdb_hc_keyboard_detach_t kdb_hc_keyboard_detach; #endif /* CONFIG_KDB_USB */ }; Index: linux-2.6.24-rc4_kdb_usb/drivers/usb/host/uhci-hcd.c =================================================================== --- linux-2.6.24-rc4_kdb_usb.orig/drivers/usb/host/uhci-hcd.c +++ linux-2.6.24-rc4_kdb_usb/drivers/usb/host/uhci-hcd.c @@ -50,6 +50,11 @@ #include "uhci-hcd.h" #include "pci-quirks.h" +#ifdef CONFIG_KDB_USB +#include +#include +#endif + /* * Version Information */ @@ -430,6 +435,214 @@ static irqreturn_t uhci_irq(struct usb_h return IRQ_HANDLED; } +#ifdef CONFIG_KDB_USB +/* Unlink KDB QH from hardware and software scheduler */ +static void kdb_unlink_uhci_qh(struct urb *urb, struct uhci_qh *qh) +{ + unsigned long flags; + struct uhci_hcd *uhci; + + uhci = (struct uhci_hcd *) hcd_to_uhci(bus_to_hcd(urb->dev->bus)); + + spin_lock_irqsave(&uhci->lock, flags); + unlink_interrupt(NULL, qh); + list_del(&(qh->node)); + spin_unlock_irqrestore(&uhci->lock, flags); + +} + +static int uhci_kdb_poll_char(struct urb *urb) +{ + if (!urb) /* can happen if no keyboard attached */ + return -1; + + return uhci_check_kdb_uhci_qh(kdb_uhci_keyboard_get_qh(urb)); +} + +/* Only 1 UHCI Keyboard supported */ +static inline void kdb_usb_fill_int_urb (struct urb *urb, + struct usb_device *dev, + unsigned int pipe, + void *transfer_buffer, + int buffer_length, + usb_complete_t complete_fn, + void *context, + int interval) +{ + urb->dev = dev; + urb->pipe = pipe; + urb->transfer_buffer = transfer_buffer; + urb->transfer_buffer_length = buffer_length; + urb->complete = complete_fn; + urb->context = context; + urb->interval = interval; + urb->start_frame = -1; +} + +static int kdb_uhci_keyboard_attach(int i, unsigned int usbhid_bufsize) +{ + struct urb *kdb_urb; + unsigned char *kdb_buffer; + dma_addr_t uhci_inbuf_dma; + struct urb *hid_inurb = kdb_usb_kbds[i].urb; + int ret = -1; + + kdb_usb_kbds[i].hid_urb = hid_inurb; + + kdb_urb = NULL; + kdb_buffer = NULL; + if (!(kdb_buffer = usb_buffer_alloc(hid_inurb->dev, + usbhid_bufsize, GFP_ATOMIC, + &uhci_inbuf_dma))) + goto out; + + if (!(kdb_urb = usb_alloc_urb(0, GFP_KERNEL))) + goto out; + + kdb_usb_fill_int_urb(kdb_urb, + hid_inurb->dev, + hid_inurb->pipe, + kdb_buffer, + hid_inurb->transfer_buffer_length, + hid_inurb->complete, + hid_inurb->context, + hid_inurb->interval + ); + + (kdb_urb)->transfer_dma = uhci_inbuf_dma; + (kdb_urb)->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + + kdb_usb_kbds[i].urb = kdb_urb; + kdb_usb_kbds[i].buffer = kdb_buffer; + + if (usb_submit_urb(kdb_urb, GFP_ATOMIC)){ + kdb_usb_keyboard_detach(hid_inurb); + goto out; + } + /* Remove KDB special URB from endpoin queue to + * prevent hang during hid_disconnect(). + */ + list_del(&(kdb_urb->urb_list)); + + ret = 0; + return ret; +out: + /* Some Error Cleanup */ + ret = -1; + printk("KDB: Error, UHCI Keyboard HID won't work!\n"); + + if (kdb_buffer) + usb_buffer_free(hid_inurb->dev, + usbhid_bufsize, kdb_buffer, + uhci_inbuf_dma); + + if (kdb_urb) + usb_free_urb(kdb_urb); + + return ret; +} + +static int kdb_uhci_keyboard_detach(struct urb *urb, int i) +{ + int ret; + + if (kdb_usb_kbds[i].qh && (kdb_usb_kbds[i].hid_urb == urb)) { + /* UHCI keyboard */ + kdb_unlink_uhci_qh(kdb_usb_kbds[i].urb, kdb_usb_kbds[i].qh); + ret = 0; + } + ret = -1; + + return ret; +} + +/* Check if URB is managed by KDB code */ +static int kdb_uhci_keyboard_urb(struct urb *urb) +{ + int i; + + for (i = 0; i < KDB_USB_NUM_KEYBOARDS; i++) { + if (kdb_usb_kbds[i].urb && kdb_usb_kbds[i].urb == urb) + return i; + } + return -1; +} + +/* Check if UHCI QH is managed by KDB code */ +static int kdb_uhci_keyboard_check_uhci_qh(struct uhci_qh *qh) +{ + int i; + + for (i = 0; i < KDB_USB_NUM_KEYBOARDS; i++) { + if (kdb_usb_kbds[i].urb && kdb_usb_kbds[i].qh == qh) + return i; + } + return -1; +} + +/* Set UHCI QH using URB pointer */ +static int kdb_uhci_keyboard_set_qh(struct urb *urb, struct uhci_qh *qh) +{ + int i; + + i = kdb_uhci_keyboard_urb(urb); + if (i != -1) + kdb_usb_kbds[i].qh = qh; + + return 0; +} + +/* Get UHCI QH using URB pointer */ +static struct uhci_qh *kdb_uhci_keyboard_get_qh(struct urb *urb) +{ + int i; + + i = kdb_uhci_keyboard_urb(urb); + if (i != -1) + return kdb_usb_kbds[i].qh; + + return NULL; +} + +/* Set UHCI hid_event using URB pointer */ +static int kdb_uhci_keyboard_set_hid_event(struct urb *urb, int hid_event) +{ + int i; + + i = kdb_uhci_keyboard_urb(urb); + if (i != -1) + kdb_usb_kbds[i].kdb_hid_event = hid_event; + + return 0; +} + +/* Get UHCI hid_event using URB pointer */ +static int kdb_uhci_keyboard_get_hid_event(struct urb *urb) +{ + int i; + + i = kdb_uhci_keyboard_urb(urb); + if (i != -1) + return kdb_usb_kbds[i].kdb_hid_event; + + return 0; +} + +/* Set UHCI hid_event using UHCI QH pointer */ +static int kdb_uhci_keyboard_set_hid_event_qh(struct uhci_qh *qh, int hid_event) +{ + int i; + + for (i = 0; i < KDB_USB_NUM_KEYBOARDS; i++) { + if (kdb_usb_kbds[i].urb && kdb_usb_kbds[i].qh == qh){ + kdb_usb_kbds[i].kdb_hid_event = hid_event; + return i; + } + } + return -1; +} +#endif + /* * Store the current frame number in uhci->frame_number if the controller * is runnning. Expand from 11 bits (of which we use only 10) to a @@ -888,6 +1101,12 @@ static const struct hc_driver uhci_drive .hub_status_data = uhci_hub_status_data, .hub_control = uhci_hub_control, +#ifdef CONFIG_KDB_USB + .kdb_poll_char = uhci_kdb_poll_char, + .kdb_completion = kdb_uhci_urb_complete, + .kdb_hc_keyboard_attach = kdb_uhci_keyboard_attach, + .kdb_hc_keyboard_detach = kdb_uhci_keyboard_detach, +#endif }; static const struct pci_device_id uhci_pci_ids[] = { { Index: linux-2.6.24-rc4_kdb_usb/drivers/usb/host/uhci-q.c =================================================================== --- linux-2.6.24-rc4_kdb_usb.orig/drivers/usb/host/uhci-q.c +++ linux-2.6.24-rc4_kdb_usb/drivers/usb/host/uhci-q.c @@ -25,6 +25,17 @@ * games with the FSBR code to make sure we get the correct order in all * the cases. I don't think it's worth the effort */ +#ifdef CONFIG_KDB_USB +/* KDB HID QH, managed by KDB code */ +static int kdb_uhci_keyboard_check_uhci_qh(struct uhci_qh *qh); +static int kdb_uhci_keyboard_set_qh(struct urb *urb, struct uhci_qh *qh); +static struct uhci_qh *kdb_uhci_keyboard_get_qh(struct urb *urb); +static int kdb_uhci_keyboard_set_hid_event(struct urb *urb, int hid_event); +static int kdb_uhci_keyboard_get_hid_event(struct urb *urb); +static int kdb_uhci_keyboard_set_hid_event_qh(struct uhci_qh *qh, int hid_event); +static int kdb_uhci_keyboard_urb(struct urb *urb); +#endif + static void uhci_set_next_interrupt(struct uhci_hcd *uhci) { if (uhci->is_stopped) @@ -292,6 +303,58 @@ static struct uhci_qh *uhci_alloc_qh(str return qh; } +#ifdef CONFIG_KDB_USB +/* + * Same as uhci_alloc_qh execpt it doesn't change to hep->hcpriv + */ +static struct uhci_qh *kdb_uhci_alloc_qh(struct uhci_hcd *uhci, + struct usb_device *udev, struct usb_host_endpoint *hep) +{ + dma_addr_t dma_handle; + struct uhci_qh *qh; + + qh = dma_pool_alloc(uhci->qh_pool, GFP_ATOMIC, &dma_handle); + if (!qh) + return NULL; + + memset(qh, 0, sizeof(*qh)); + qh->dma_handle = dma_handle; + + qh->element = UHCI_PTR_TERM; + qh->link = UHCI_PTR_TERM; + + INIT_LIST_HEAD(&qh->queue); + INIT_LIST_HEAD(&qh->node); + + if (udev) { /* Normal QH */ + qh->type = hep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; + if (qh->type != USB_ENDPOINT_XFER_ISOC) { + qh->dummy_td = uhci_alloc_td(uhci); + if (!qh->dummy_td) { + dma_pool_free(uhci->qh_pool, qh, dma_handle); + return NULL; + } + } + qh->state = QH_STATE_IDLE; + qh->hep = hep; + qh->udev = udev; + + if (qh->type == USB_ENDPOINT_XFER_INT || + qh->type == USB_ENDPOINT_XFER_ISOC) + qh->load = usb_calc_bus_time(udev->speed, + usb_endpoint_dir_in(&hep->desc), + qh->type == USB_ENDPOINT_XFER_ISOC, + le16_to_cpu(hep->desc.wMaxPacketSize)) + / 1000 + 1; + + } else { /* Skeleton QH */ + qh->state = QH_STATE_ACTIVE; + qh->type = -1; + } + return qh; +} +#endif + static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) { WARN_ON(qh->state != QH_STATE_IDLE && qh->udev); @@ -1399,6 +1462,20 @@ static int uhci_urb_enqueue(struct usb_h if (!urbp) goto done; +#ifdef CONFIG_KDB_USB + /* Always allocate new QH for KDB URB. + * KDB HQ will be managed by KDB poll code not by + * UHCI HCD Driver. + */ + if (kdb_uhci_keyboard_urb(urb) != -1){ + /* KDB urb will be enqued only once */ + kdb_uhci_keyboard_set_qh(urb, NULL); + qh = kdb_uhci_alloc_qh(uhci, urb->dev, urb->ep); + if (!qh) + goto err_no_qh; + kdb_uhci_keyboard_set_qh(urb, qh); + } else +#endif if (urb->ep->hcpriv) qh = urb->ep->hcpriv; else { @@ -1648,6 +1725,13 @@ static int uhci_advance_check(struct uhc int ret = 1; unsigned status; +#ifdef CONFIG_KDB_USB + /* Don't manage KDB QH */ + if(kdb_uhci_keyboard_check_uhci_qh(qh) != -1){ + ret = 0; + goto done; + } +#endif if (qh->type == USB_ENDPOINT_XFER_ISOC) goto done; @@ -1740,6 +1824,11 @@ rescan: uhci->next_qh = list_entry(qh->node.next, struct uhci_qh, node); +#ifdef CONFIG_KDB_USB + /* Don't manage KDB QH */ + if(kdb_uhci_keyboard_check_uhci_qh(qh) != -1) + continue; +#endif if (uhci_advance_check(uhci, qh)) { uhci_scan_qh(uhci, qh); if (qh->state == QH_STATE_ACTIVE) { @@ -1766,3 +1855,76 @@ rescan: else uhci_set_next_interrupt(uhci); } + +#ifdef CONFIG_KDB_USB +/* + * Activate KDB UHCI QH, called by KDB poll code. + */ +static void kdb_activate_uhci_qh(struct uhci_qh *qh) +{ + struct urb_priv *urbp; + struct uhci_td *td; + __le32 status, token; + + urbp = list_entry(qh->queue.next, struct urb_priv, node); + + list_for_each_entry(td, &urbp->td_list, list){ + status = td->status; + token = td->token; + barrier(); + /* Clear Status and ActLen */ + status &= cpu_to_le32(0xff000000); + /* Make TD Active */ + status |= cpu_to_le32(TD_CTRL_ACTIVE); + /* Clear TD Interrupt */ + status &= cpu_to_le32(~TD_CTRL_IOC); + /* Toggle Data Sycronization Bit */ + if (token & cpu_to_le32(TD_TOKEN_TOGGLE)) + token &= cpu_to_le32(~TD_TOKEN_TOGGLE); + else + token |= cpu_to_le32(TD_TOKEN_TOGGLE); + + td->token = token; + td->status = status; + barrier(); + } + /* Activate KDB UHCI Keyboard HID QH */ + td = list_entry(urbp->td_list.next, struct uhci_td, list); + qh->element = LINK_TO_TD(td); + barrier(); +} + +/* + * Called when KDB finishes process key press/release event. + */ +static void +kdb_uhci_urb_complete (struct urb *urb) +{ + if (!kdb_uhci_keyboard_get_hid_event(urb)) + return; + + /* Activate KDB TD */ + kdb_activate_uhci_qh(kdb_uhci_keyboard_get_qh(urb)); + kdb_uhci_keyboard_set_hid_event(urb, 0); +} + +/* + * Check if state of KDB URB changed (key was pressed/released). + */ +static int uhci_check_kdb_uhci_qh(struct uhci_qh *qh) +{ + struct urb_priv *urbp = NULL; + struct uhci_td *td; + unsigned status; + + urbp = list_entry(qh->queue.next, struct urb_priv, node); + td = list_entry(urbp->td_list.next, struct uhci_td, list); + status = td_status(td); + if (!(status & TD_CTRL_ACTIVE)){ + /* We're okay, the queue has advanced */ + kdb_uhci_keyboard_set_hid_event_qh(qh, 1); + return 0; + } + return -1; +} +#endif Index: linux-2.6.24-rc4_kdb_usb/include/linux/kdb.h =================================================================== --- linux-2.6.24-rc4_kdb_usb.orig/include/linux/kdb.h +++ linux-2.6.24-rc4_kdb_usb/include/linux/kdb.h @@ -143,7 +143,16 @@ extern void smp_kdb_stop(void); #include -extern int kdb_usb_keyboard_attach(struct urb *urb, unsigned char *buffer, void *poll_func); +typedef int (*kdb_hc_keyboard_attach_t)(int i, unsigned int bufsize); +typedef int (*kdb_hc_keyboard_detach_t)(struct urb *urb, int i); +extern int +kdb_usb_keyboard_attach(struct urb *urb, unsigned char *buffer, + void *poll_func, void *compl_func, + kdb_hc_keyboard_attach_t kdb_hc_keyboard_attach, + kdb_hc_keyboard_detach_t kdb_hc_keyboard_detach, + unsigned int bufsize, + struct urb *hid_urb); + extern int kdb_usb_keyboard_detach(struct urb *urb); #endif /* CONFIG_KDB_USB */ Index: linux-2.6.24-rc4_kdb_usb/include/linux/kdbprivate.h =================================================================== --- linux-2.6.24-rc4_kdb_usb.orig/include/linux/kdbprivate.h +++ linux-2.6.24-rc4_kdb_usb/include/linux/kdbprivate.h @@ -485,12 +485,25 @@ extern char kdb_prompt_str[]; #ifdef CONFIG_KDB_USB #include +/* support up to 8 USB keyboards (probably excessive, but...) */ +#define KDB_USB_NUM_KEYBOARDS 8 + struct kdb_usb_kbd_info { struct urb *urb; /* pointer to the URB */ unsigned char *buffer; /* pointer to the kbd char buffer */ int (*poll_func)(struct urb *urb); /* poll function to retrieve chars */ int caps_lock; /* state of the caps lock for this keyboard */ + struct uhci_qh *qh; + int kdb_hid_event; + struct urb *hid_urb; /* pointer to the HID URB */ + /* USB Host Controller specific callbacks */ + kdb_hc_keyboard_attach_t kdb_hc_keyboard_attach; + kdb_hc_keyboard_detach_t kdb_hc_keyboard_detach; + int (*kdb_hc_urb_complete)(struct urb *urb); /* called when URB int is processed */ }; + +extern struct kdb_usb_kbd_info kdb_usb_kbds[KDB_USB_NUM_KEYBOARDS]; + #endif /* CONFIG_KDB_USB */ #endif /* !_KDBPRIVATE_H */ Index: linux-2.6.24-rc4_kdb_usb/arch/x86/Kconfig.debug =================================================================== --- linux-2.6.24-rc4_kdb_usb.orig/arch/x86/Kconfig.debug +++ linux-2.6.24-rc4_kdb_usb/arch/x86/Kconfig.debug @@ -183,10 +183,10 @@ config KDB_CONTINUE_CATASTROPHIC setting to 2. config KDB_USB - bool "Support for USB Keyboard in KDB (OHCI only)" - depends on KDB && USB_OHCI_HCD + bool "Support for USB Keyboard in KDB" + depends on KDB && (USB_OHCI_HCD || USB_UHCI_HCD || USB_EHCI_HCD) help - If you want to use kdb from a OHCI USB keyboard then say Y here. If you + If you want to use kdb from a USB keyboard then say Y here. If you say N then kdb can only be used from a PC (AT) keyboard or a serial console. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From jlan@sgi.com Wed Feb 6 10:34:36 2008 Received: with ECARTIS (v1.0.0; list kdb); Wed, 06 Feb 2008 10:34:50 -0800 (PST) Received: from kluge.engr.sgi.com (kluge.engr.sgi.com [192.102.96.102]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m16IYYfY011375 for ; Wed, 6 Feb 2008 10:34:36 -0800 Received: from [150.166.8.78] (aware.engr.sgi.com [150.166.8.78]) by kluge.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m16IYwAl308908; Wed, 6 Feb 2008 10:34:58 -0800 (PST) Message-ID: <47A9FDD1.6060109@sgi.com> Date: Wed, 06 Feb 2008 10:34:57 -0800 From: Jay Lan User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: Konstantin Baydarov CC: kdb@oss.sgi.com, Aaron Young Subject: Re: [PATCH] Add support for USB Keyboard attached to UHCI References: <478439B8.3010809@sgi.com> <200801111716.m0BHGVQx205060@kluge.engr.sgi.com> <20080205203421.5cdfa3cc@windmill.dev.rtsoft.ru> In-Reply-To: <20080205203421.5cdfa3cc@windmill.dev.rtsoft.ru> Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1330 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: jlan@sgi.com Precedence: bulk X-list: kdb Hi Konstantin, Thanks for your updated version. I actually managed to fix and merge the USB_UHCI_support-v2 to kdb patchset 2.6.24-rc8-3 (and thus the 2.6.24-1 patch set.) Well, Aaron noticed that OHCI was broken and we noticed dropped characters. So, here is the plan. I will back out USB_UHCI_support part of code from 2.6.24-1 and remove USB_UHCI_support-v2.bz from the download area, and we will start with your new patch. Thanks, - jay Konstantin Baydarov wrote: > Hello, Aarong, Jay. Sorry that it takes to much time to review/reply messages related to UHCI. > ftp://oss.sgi.com/projects/kdb/download/v4.4/USB_UHCI_support-v2.bz2 - isn't complete. Kernel 2.6.24-rc4 doesn't even compile. > I've redesign my patch to make only minimal changes to common usb layer. > - I've added two USB Host Controller (HC) specific callbacks kdb_hc_keyboard_attach, kdb_hc_keyboard_detach to the kdb_usb_kbd_info. Callbacks kdb_hc_keyboard_attach, kdb_hc_keyboard_detach are called from kdb_usb_keyboard_attach, kdb_usb_keyboard_detach correspondingly to make USB HC specific KDB work when KBD is attached/detached. So no new global functions to USB layer are required. Currently only UHCI has this callbacks. > - I've moved all KDB UHCI code to UHCI HC files. Now we have only one kdb_uhci_keyboard_urb() instead of 3 copies (Jay noticed it earlier). > - As I've added USB HC specific callbacks and moved all UHCI code to UHCI driver, there shouldn't any problems now when USB HD drivers is compiled as kernel modules. > - Allow CONFIG_KDB_USB option(In arch/x86/Kconfig.debug) if any of USB HC is selected, not only OHCI. > - One common change was done in get_usb_char(). It was in earlier version of patch but we didn't discuss it. In case of UHCI Keyboard, when 2 keys is pressed simultaneously we get 2 urbs. First urb stores only 1 keycode of the first pressed key in kdb_usb_kbds[i].buffer[2]. Second urb stores 2 keycodes - first keycode in kdb_usb_kbds[i].buffer[2], second keycode in kdb_usb_kbds[i].buffer[3]. As previous code of get_usb_char() just ignore kdb_usb_kbds[i].buffer[3], I've made updates of get_usb_char(). Also I've added USB HC specific URB complete callback to get_usb_char(). I don't know how keycodes are stored in case of OHCI and EHCI, so probably USB HC checks should also be added to get_usb_char() or new USB HC callback should be added to get_usb_char(), that extracts keycodes from URB buffer. > > Patch was done for 2.6.24-rc4 KDB kernel with ftp://oss.sgi.com/projects/kdb/download/v4.4/USB_EHCI_support-v2.bz2 applied. > > I hope you'll have some time to review changes. > > Also I've sent another patch http://oss.sgi.com/archives/kdb/2007-11/msg00037.html , Aarong, I hope you'll have some time to review it too. > > With Best Regards, > Konstantin Baydarov, Software Engineer > Montavista Russia > mail-to: kbaidarov@ru.mvista.com > > Signed-off-by: Konstantin Baydarov > --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kbaidarov@ru.mvista.com Wed Feb 6 12:54:09 2008 Received: with ECARTIS (v1.0.0; list kdb); Wed, 06 Feb 2008 12:54:15 -0800 (PST) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m16Ks8oq021636 for ; Wed, 6 Feb 2008 12:54:09 -0800 X-ASG-Debug-ID: 1202331256-3dd900900000-sLlkUa X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from buildserver.ru.mvista.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 27F735A9804 for ; Wed, 6 Feb 2008 12:54:16 -0800 (PST) Received: from buildserver.ru.mvista.com (rtsoft3.corbina.net [85.21.88.6]) by cuda.sgi.com with ESMTP id crN8YCXhEPHIWJU0 for ; Wed, 06 Feb 2008 12:54:16 -0800 (PST) Received: from medved (unknown [10.150.0.9]) by buildserver.ru.mvista.com (Postfix) with ESMTP id CE8268810; Thu, 7 Feb 2008 01:54:21 +0400 (SAMT) Date: Wed, 6 Feb 2008 23:54:13 +0300 From: Konstantin Baydarov To: Jay Lan Cc: kdb@oss.sgi.com, Aaron Young X-ASG-Orig-Subj: Re: [PATCH] Add support for USB Keyboard attached to UHCI Subject: Re: [PATCH] Add support for USB Keyboard attached to UHCI Message-ID: <20080206235413.3b310c92@medved> In-Reply-To: <47A9FDD1.6060109@sgi.com> References: <478439B8.3010809@sgi.com> <200801111716.m0BHGVQx205060@kluge.engr.sgi.com> <20080205203421.5cdfa3cc@windmill.dev.rtsoft.ru> <47A9FDD1.6060109@sgi.com> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Barracuda-Connect: rtsoft3.corbina.net[85.21.88.6] X-Barracuda-Start-Time: 1202331270 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.41544 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 1331 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kbaidarov@ru.mvista.com Precedence: bulk X-list: kdb On Wed, 06 Feb 2008 10:34:57 -0800 Jay Lan wrote: > Hi Konstantin, > > Thanks for your updated version. > I actually managed to fix and merge the USB_UHCI_support-v2 to > kdb patchset 2.6.24-rc8-3 (and thus the 2.6.24-1 patch set.) > Well, Aaron noticed that OHCI was broken and we noticed dropped > characters. > > So, here is the plan. I will back out USB_UHCI_support part of code > from 2.6.24-1 and remove USB_UHCI_support-v2.bz from the download > area, and we will start with your new patch. > > Thanks, > - jay Good. > Konstantin Baydarov wrote: > > Also I've sent another patch > > http://oss.sgi.com/archives/kdb/2007-11/msg00037.html , Aarong, I > > hope you'll have some time to review it too. > > What about this patch? -- With Best Regards, Konstantin Baydarov, Software Engineer Montavista Russia mail-to: kbaidarov@ru.mvista.com --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From jlan@sgi.com Fri Feb 8 12:40:16 2008 Received: with ECARTIS (v1.0.0; list kdb); Fri, 08 Feb 2008 12:40:25 -0800 (PST) Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m18KeENb030970 for ; Fri, 8 Feb 2008 12:40:16 -0800 Received: from [134.15.0.154] (mtv-vpn-sw-corp-0-154.corp.sgi.com [134.15.0.154]) by cthulhu.engr.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id m18KebL3024144; Fri, 8 Feb 2008 12:40:38 -0800 Message-ID: <47ACBE02.7080300@sgi.com> Date: Fri, 08 Feb 2008 12:39:30 -0800 From: Jay Lan User-Agent: Thunderbird 1.5 (X11/20060317) MIME-Version: 1.0 To: KDB Subject: kgdb going mainline X-Enigmail-Version: 0.94.0.0 Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1332 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: jlan@sgi.com Precedence: bulk X-list: kdb Kgdb is in Andrew's mm tree and heading to Linus' tree. I thought the reason KDB was rejected was because they did not want a kernel debugger at a crashed system? The philosophy of kdump is "freeze the system, take a dump and reboot." Anyone knows of why kgdb was OK to KDB critics? Cheers, - jay --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From hedi@sgi.com Fri Feb 8 17:44:11 2008 Received: with ECARTIS (v1.0.0; list kdb); Fri, 08 Feb 2008 17:44:20 -0800 (PST) Received: from relay.sgi.com (relay1.corp.sgi.com [192.26.58.214]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m191iASJ017264 for ; Fri, 8 Feb 2008 17:44:11 -0800 Received: from zorg.emea.sgi.com (zorg.emea.sgi.com [144.253.68.115]) by relay1.corp.sgi.com (Postfix) with ESMTP id 64DB98F806F for ; Fri, 8 Feb 2008 17:44:31 -0800 (PST) Received: from hedi by zorg.emea.sgi.com with local (Exim 4.63) (envelope-from ) id 1JNela-0000hL-Po for kdb@oss.sgi.com; Sat, 09 Feb 2008 01:44:30 +0000 Date: Sat, 9 Feb 2008 01:44:30 +0000 From: Hedi Berriche To: KDB Subject: Re: kgdb going mainline Message-ID: <20080209014430.GA14995@sgi.com> Mail-Followup-To: KDB References: <47ACBE02.7080300@sgi.com> MIME-Version: 1.0 Content-type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <47ACBE02.7080300@sgi.com> User-Agent: Mutt/1.5.13 (2006-08-11) Content-Transfer-Encoding: 8bit X-archive-position: 1333 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: hedi@sgi.com Precedence: bulk X-list: kdb On Fri, Feb 08, 2008 at 20:54 Jay Lan wrote: | Kgdb is in Andrew's mm tree and heading to Linus' tree. | | I thought the reason KDB was rejected was because they did not want | a kernel debugger at a crashed system? The philosophy of kdump is | "freeze the system, take a dump and reboot." | | Anyone knows of why kgdb was OK to KDB critics? Short story http://kerneltrap.org/Linux/kgdb_To_Merge_Or_Not_To_Merge Not so short one http://kerneltrap.org/mailarchive/linux-kernel/2008/1/30/648104 Cheers, Hedi. -- Be careful of reading health books, you might die of a misprint. -- Mark Twain --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From hedi@sgi.com Fri Feb 8 17:58:53 2008 Received: with ECARTIS (v1.0.0; list kdb); Fri, 08 Feb 2008 17:58:58 -0800 (PST) Received: from relay.sgi.com (relay1.corp.sgi.com [192.26.58.214]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m191wq20017811 for ; Fri, 8 Feb 2008 17:58:53 -0800 Received: from zorg.emea.sgi.com (zorg.emea.sgi.com [144.253.68.115]) by relay1.corp.sgi.com (Postfix) with ESMTP id 52AC28F80AB for ; Fri, 8 Feb 2008 17:59:16 -0800 (PST) Received: from hedi by zorg.emea.sgi.com with local (Exim 4.63) (envelope-from ) id 1JNezr-0000jG-OV for kdb@oss.sgi.com; Sat, 09 Feb 2008 01:59:15 +0000 Date: Sat, 9 Feb 2008 01:59:15 +0000 From: Hedi Berriche To: KDB Subject: Re: kgdb going mainline Message-ID: <20080209015915.GB14995@sgi.com> Mail-Followup-To: KDB References: <47ACBE02.7080300@sgi.com> <20080209014430.GA14995@sgi.com> MIME-Version: 1.0 Content-type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20080209014430.GA14995@sgi.com> User-Agent: Mutt/1.5.13 (2006-08-11) Content-Transfer-Encoding: 8bit X-archive-position: 1334 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: hedi@sgi.com Precedence: bulk X-list: kdb On Sat, Feb 09, 2008 at 01:54 Hedi Berriche wrote: | On Fri, Feb 08, 2008 at 20:54 Jay Lan wrote: | | Kgdb is in Andrew's mm tree and heading to Linus' tree. | | | | I thought the reason KDB was rejected was because they did not want | | a kernel debugger at a crashed system? The philosophy of kdump is | | "freeze the system, take a dump and reboot." | | | | Anyone knows of why kgdb was OK to KDB critics? | | Short story | | http://kerneltrap.org/Linux/kgdb_To_Merge_Or_Not_To_Merge | | Not so short one | | http://kerneltrap.org/mailarchive/linux-kernel/2008/1/30/648104 And this one provides insight on the backup behind kgdb http://kerneltrap.org/Linux/x86_Architecture_Merges_in_2.6.25 Cheers, Hedi. -- Be careful of reading health books, you might die of a misprint. -- Mark Twain --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.