Hi,
I think that the first patch is ok.
Thanks to Aki for finding the bug and Bob for the explanation
and every one else who was involved.
But the second patch needs some discussion:
During the submition of URBs/TDs the HC continues running.
(The implementation of the TD handling is pretty close to
the proposal of the OHCI manual.)
So the writel (..., cmdstatus) just makes shure that
the HCD starts/continues its work. If there are some
already queued TDs on the ED the HCD do not stop
during the insertion of the additional TDs and in this case
the writel is just a "dummy" call.
So if the intention of the second patch is to make shure
that the HC do not work during the insertion of the TDs
then it is useless.
Roman
"Dunlap, Randy" wrote:
>
> Hi,
>
> Thanks for the news.
>
> The first patch that you listed is in the kernel.org
> sources (or should be; it's been sent to Linus).
> I don't recall about the second patch.
>
> Are both of them necessary? I.e., did you test with
> only one of them and it still failed?
>
> Thanks,
> Randy
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 24, 2000 5:47 PM
> To: [EMAIL PROTECTED]
> Subject: [linux-usb] G4 usb success
>
> Hello,
> Benjamin Herrenschmidt sent me the following to patches to 2.3.99pre3
> to try on my G4 today. I manually applied them to the 2.3.99pre3
> linux-pmac-devel kernel sources (which are 2.3.99pre3 with some of
> the more recent usb patches). The first of these two patches seems
> to eliminate the kernel faults on the G4. The second seems okay as
> well in concert with the first. Unfortunately the linux-pmac-devel
> kernel seems to have some ext2 filesystem issues since my boot stopped
> with a problem reading the superblock on the ext2 volume. However I
> was able to use my usb keyboard to login as root at the emergency
> prompt so I think usb is usable now on the G4. Below are the two
> patches that Ben sent me that did the trick.
>
> diff -Naur -X dontdiff linux-2.3.99-pre3-8/drivers/usb/usb-ohci.c
> linux-2.3.99-pre3-8-greg/drivers/usb/usb-ohci.c
> --- linux-2.3.99-pre3-8/drivers/usb/usb-ohci.c Thu Mar 23 14:22:09 2000
> +++ linux-2.3.99-pre3-8-greg/drivers/usb/usb-ohci.c Thu Mar 23 14:50:31
> 2000@@ -339,10 +339,11 @@
> (le16_to_cpu
> (ohci->hcca.frame_no) + 10)) & 0xffff;
> }
>
> - td_submit_urb (urb); /* fill the TDs and link it to the ed */
> -
> if (ed->state != ED_OPER) /* link the ed into a chain if is not
> already */
> ep_link (ohci, ed);
> +
> + td_submit_urb (urb); /* fill the TDs and link it to the ed */
> +
> spin_unlock_irqrestore (&usb_ed_lock, flags);
>
> urb->status = USB_ST_URB_PENDING;
>
> --- linux/drivers/usb/usb-ohci.c.bak Thu Mar 23 21:52:14 2000
> +++ linux/drivers/usb/usb-ohci.c Thu Mar 23 21:54:58 2000
> @@ -871,6 +872,7 @@
> TD_CC | TD_DP_OUT : TD_CC | TD_R | TD_DP_IN
> ;
> td_fill (info | (cnt? TD_T_TOGGLE:toggle), data,
> data_len, urb, (cnt? 0: ST_ADDR) | ADD_LEN, cnt);
> cnt++;
> + wmb();
> writel (OHCI_BLF, &ohci->regs->cmdstatus); /*
> start bulk list */
> break;
>
> @@ -891,6 +893,7 @@
> info = usb_pipeout (urb->pipe)?
> TD_CC | TD_DP_IN | TD_T_DATA1: TD_CC |
> TD_DP_OUT | TD_T_DATA1;
> td_fill (info, NULL, 0, urb, 0, cnt++);
> + wmb();
> writel (OHCI_CLF, &ohci->regs->cmdstatus); /*
> TD_CC | TD_DP_OUT : TD_CC | TD_R | TD_DP_IN
> ;
> td_fill (info | (cnt? TD_T_TOGGLE:toggle), data,
> data_len, urb, (cnt? 0: ST_ADDR) | ADD_LEN, cnt);
> cnt++;
> + wmb();
> writel (OHCI_BLF, &ohci->regs->cmdstatus); /*
> start bulk list */
> break;
>
> @@ -891,6 +893,7 @@
> info = usb_pipeout (urb->pipe)?
> TD_CC | TD_DP_IN | TD_T_DATA1: TD_CC |
> TD_DP_OUT | TD_T_DATA1;
> td_fill (info, NULL, 0, urb, 0, cnt++);
> + wmb();
> writel (OHCI_CLF, &ohci->regs->cmdstatus); /*
> start Control list */
> break;
>
> Thanks for everyone's efforts here getting the usb fixed on the G4.
> Jack Howarth
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]