Hi,

The following patch fixes a bus error on sparc64 kernel. The
uhci->io_addr field was incorrectly converted from long to int in
several places.
Please ignore the previous patch it missed some places in uhci-debug.c
and uhci-hub.c
With this patch I can use a usb mouse on sparc64. without it I get lots
of bus errors... I still can't use the mouse plugged into an external
hub though...

Ludovic Aubry


diff -Nru -X dontdiff linux-2.6.7/drivers/usb/host/uhci-debug.c 
linux-2.6.7-new/drivers/usb/host/uhci-debug.c
--- linux-2.6.7/drivers/usb/host/uhci-debug.c   2004-06-16 07:18:59.000000000 +0200
+++ linux-2.6.7-new/drivers/usb/host/uhci-debug.c       2004-06-21 14:55:38.000000000 
+0200
@@ -248,7 +248,7 @@
 static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len)
 {
        char *out = buf;
-       unsigned int io_addr = uhci->io_addr;
+       unsigned long io_addr = uhci->io_addr;
        unsigned short usbcmd, usbstat, usbint, usbfrnum;
        unsigned int flbaseadd;
        unsigned char sof;
diff -Nru -X dontdiff linux-2.6.7/drivers/usb/host/uhci-hcd.c 
linux-2.6.7-new/drivers/usb/host/uhci-hcd.c
--- linux-2.6.7/drivers/usb/host/uhci-hcd.c     2004-06-16 07:19:53.000000000 +0200
+++ linux-2.6.7-new/drivers/usb/host/uhci-hcd.c 2004-06-20 22:26:14.000000000 +0200
@@ -1756,7 +1756,7 @@
 static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
 {
        struct uhci_hcd *uhci = hcd_to_uhci(hcd);
-       unsigned int io_addr = uhci->io_addr;
+       unsigned long io_addr = uhci->io_addr;
        unsigned short status;
        struct list_head *tmp, *head;
        unsigned int age;
@@ -1829,7 +1829,7 @@
 
 static void reset_hc(struct uhci_hcd *uhci)
 {
-       unsigned int io_addr = uhci->io_addr;
+       unsigned long io_addr = uhci->io_addr;
 
        /* Global reset for 50ms */
        uhci->state = UHCI_RESET;
@@ -1846,7 +1846,7 @@
 
 static void suspend_hc(struct uhci_hcd *uhci)
 {
-       unsigned int io_addr = uhci->io_addr;
+       unsigned long io_addr = uhci->io_addr;
 
        dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__);
        uhci->state = UHCI_SUSPENDED;
@@ -1856,7 +1856,7 @@
 
 static void wakeup_hc(struct uhci_hcd *uhci)
 {
-       unsigned int io_addr = uhci->io_addr;
+       unsigned long io_addr = uhci->io_addr;
 
        switch (uhci->state) {
                case UHCI_SUSPENDED:            /* Start the resume */
@@ -1896,7 +1896,7 @@
 
 static int ports_active(struct uhci_hcd *uhci)
 {
-       unsigned int io_addr = uhci->io_addr;
+       unsigned long io_addr = uhci->io_addr;
        int connection = 0;
        int i;
 
@@ -1908,7 +1908,7 @@
 
 static int suspend_allowed(struct uhci_hcd *uhci)
 {
-       unsigned int io_addr = uhci->io_addr;
+       unsigned long io_addr = uhci->io_addr;
        int i;
 
        if (to_pci_dev(uhci_dev(uhci))->vendor != PCI_VENDOR_ID_INTEL)
@@ -1973,7 +1973,7 @@
 
 static void start_hc(struct uhci_hcd *uhci)
 {
-       unsigned int io_addr = uhci->io_addr;
+       unsigned long io_addr = uhci->io_addr;
        int timeout = 1000;
 
        /*
diff -Nru -X dontdiff linux-2.6.7/drivers/usb/host/uhci-hub.c 
linux-2.6.7-new/drivers/usb/host/uhci-hub.c
--- linux-2.6.7/drivers/usb/host/uhci-hub.c     2004-06-16 07:18:57.000000000 +0200
+++ linux-2.6.7-new/drivers/usb/host/uhci-hub.c 2004-06-21 14:55:56.000000000 +0200
@@ -36,7 +36,7 @@
 static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf)
 {
        struct uhci_hcd *uhci = hcd_to_uhci(hcd);
-       unsigned int io_addr = uhci->io_addr;
+       unsigned long io_addr = uhci->io_addr;
        int i;
 
        *buf = 0;
@@ -69,7 +69,7 @@
 {
        struct uhci_hcd *uhci = hcd_to_uhci(hcd);
        int status, retval = 0, len = 0;
-       unsigned int port_addr = uhci->io_addr + USBPORTSC1 + 2 * (wIndex-1);
+       unsigned long port_addr = uhci->io_addr + USBPORTSC1 + 2 * (wIndex-1);
        __u16 wPortChange, wPortStatus;
 
        switch (typeReq) {



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to