Date: Fri, 31 Jul 2015 09:57:19 +0200 From: Hans Petter Selasky <hps@selasky.org> To: freebsd-arm@FreeBSD.org Subject: Re: DWC OTG TX path optimisation for 11-current Message-ID: <55BB2A5F.9000502@selasky.org> In-Reply-To: <46aece00b53.3c1cdc1f@mail.schwarzes.net> References: <55A7D8CE.4020809@selasky.org> <CAHNYxxMp9jGDbV-5=-cE6daR-O3eN5pdvO1s-=QfX=A9XYqYmA@mail.gmail.com> <55B23276.8090703@selasky.org> <CAHNYxxNc9uB62hHEv1PM9PcsGgUs=zsvNgatqLD0p%2BiiDA3Aiw@mail.gmail.com> <55B73113.2020308@selasky.org> <CAFHCsPVaPZpqXLS7OApa=Xz5VLnLjVpV5dYV8Pn2uHh1Lcz7Tg@mail.gmail.com> <55B8AB76.7030603@selasky.org> <CAFHCsPUMaYEwJsaGUFuw9yZi_5bmraSBsOYpRWvSeuebpXBJUA@mail.gmail.com> <55B8B297.1010008@selasky.org> <CAFHCsPVGLs8j6LAV%2Bg4rP_ueTOd8pUOupYFGvmgC3XGcJC720Q@mail.gmail.com> <20150729154516.GH78154@funkthat.com> <55B8F5EC.2050908@selasky.org> <46ad096c958.1a82a175@mail.schwarzes.net> <55B9C3E2.5040501@selasky.org> <46ae815c7c3.447237c8@mail.schwarzes.net> <46aece00b53.3c1cdc1f@mail.schwarzes.net>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On 07/31/15 05:52, Andreas Schwarz wrote:
> On 31.07.15, Andreas Schwarz wrote:
>> On 30.07.15, Hans Petter Selasky wrote:
>>> On 07/29/15 21:41, Andreas Schwarz wrote:
>>>> On 29.07.15, Hans Petter Selasky wrote:
>>>>
>>>>> On 07/29/15 17:45, John-Mark Gurney wrote:
>>>>>> Just for your information, when I start buildworld, the system
>>>>>>> responds very fast (console, ssh). After about one hour, it starts to
>>>>>>> print the following warnings:
>>>>>
>>>>> Did this happen before r285935 aswell or only after this revision?
>>>>
>>>> This will happen since ~r283xxx, there are some reports in this ml,
>>>> have a look at my post from 2015-06-03.
>>>>
>>>
>>> If this is easy to reproduce for you, can you try the SMSC patch I made?
>>
>> It's not so easy to reproduce, it will occur under high load (and disk IO)
>> situations, e.g.when building the world (-j4). But not in every case,
>> sometimes buildworld complete without a problem.
>>
>> If the system is in this state, it will react very very slow. System load
>> is high (without a causing process) and it will often hang (during shutdown)
>> when performing a reboot.
>>
>> I'll try your patch.
>
> This was fast. Patch (smsc.diff) did not help. I've applied the patch, compiled and
> installed the new kernel and started to build the kernel tool-chain. Just 10 minutes
> ago the problem occur again.
>
Hi,
Can you try this patch separately from the attached one?
> Index: sys/dev/usb/controller/dwc_otg.c
> ===================================================================
> --- sys/dev/usb/controller/dwc_otg.c (revision 286002)
> +++ sys/dev/usb/controller/dwc_otg.c (working copy)
> @@ -579,6 +579,9 @@
> sc->sc_irq_mask |= GINTMSK_RXFLVLMSK;
> DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask);
>
> + /* clear RX FIFO level interrupt */
> + DWC_OTG_WRITE_4(sc, DOTG_GINTSTS, GINTSTS_RXFLVL);
> +
> /* clear cached status */
> sc->sc_last_rx_status = 0;
> }
The attached patch will add some more debug prints so that I know what
is going on in the problematic function. You'll need to C&P me the
resulting console prints.
--HPS
[-- Attachment #2 --]
Index: dev/usb/controller/dwc_otg.c
===================================================================
--- dev/usb/controller/dwc_otg.c (revision 286002)
+++ dev/usb/controller/dwc_otg.c (working copy)
@@ -2554,8 +2554,17 @@
uint32_t temp;
uint8_t got_rx_status;
uint8_t x;
+ uint32_t count = 0;
+ int came_from = -1;
+ static uint32_t max_count;
repeat:
+ if (++count > max_count && came_from != -1) {
+ max_count = count;
+ printf("MAX=%d CAME=%d STS=0x%08x ACTIVE=0x%08x\n",
+ (int)max_count, came_from, sc->sc_last_rx_status,
+ sc->sc_active_rx_ep);
+ }
/* get all channel interrupts */
for (x = 0; x != sc->sc_host_ch_max; x++) {
temp = DWC_OTG_READ_4(sc, DOTG_HCINT(x));
@@ -2593,6 +2602,7 @@
DPRINTFN(5, "channel halt complete ch=%u\n", ep_no);
}
dwc_otg_common_rx_ack(sc);
+ came_from = 1;
goto repeat;
}
@@ -2612,6 +2622,7 @@
/* check if we should dump the data */
if (!(sc->sc_active_rx_ep & (1U << ep_no))) {
dwc_otg_common_rx_ack(sc);
+ came_from = 2;
goto repeat;
}
@@ -2634,6 +2645,7 @@
/* check if we should dump the data */
if (!(sc->sc_active_rx_ep & (1U << ep_no))) {
dwc_otg_common_rx_ack(sc);
+ came_from = 3;
goto repeat;
}
@@ -2646,8 +2658,10 @@
if (got_rx_status) {
/* check if data was consumed */
- if (sc->sc_last_rx_status == 0)
+ if (sc->sc_last_rx_status == 0) {
+ came_from = 4;
goto repeat;
+ }
/* disable RX FIFO level interrupt */
sc->sc_irq_mask &= ~GINTMSK_RXFLVLMSK;
@@ -2656,8 +2670,10 @@
if (sc->sc_flags.status_device_mode == 0 && sc->sc_xfer_complete == 0) {
/* update host transfer schedule, so that new transfers can be issued */
- if (dwc_otg_update_host_transfer_schedule_locked(sc))
+ if (dwc_otg_update_host_transfer_schedule_locked(sc)) {
+ came_from = 5;
goto repeat;
+ }
}
}
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55BB2A5F.9000502>
