Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Aug 2013 14:26:11 +0200
From:      Hans Petter Selasky <hps@bitfrost.no>
To:        "Lundberg, Johannes" <johannes@brilliantservice.co.jp>
Cc:        Alexander Motin <mav@FreeBSD.org>, FreeBSD Current <freebsd-current@freebsd.org>, "freebsd-usb@freebsd.org" <freebsd-usb@freebsd.org>
Subject:   Re: xhci broken on 10-CURRENT and 2013 MacBook Air?
Message-ID:  <52208F63.4060308@bitfrost.no>
In-Reply-To: <CAASDrV=xi-qW-8tpYK-pyhh5xh7n90sy7s4uE3W405jgDkCcaw@mail.gmail.com>
References:  <CAASDrV=_8XDFZqcVP7aHdgEwxtMEDyNDQAyM5dgPmJ6=toOpow@mail.gmail.com> <CAASDrVmyduRKwsp5oURYuHX8G4hoODn0TftbC5MfV=3XhhocrA@mail.gmail.com> <521B9CD7.8010902@bitfrost.no> <CAASDrVk5xjptRPttbQA6b7Tg_Pgf005EqMQpUhv-jNje%2B352%2BA@mail.gmail.com> <521C6C26.7050207@bitfrost.no> <CAASDrVnJj4%2BkhHB-StW3JpVuCqZx7MBcmqA59_Ay-06Jgu5PnQ@mail.gmail.com> <CAASDrVk4eWVLj0=VHygKk5iG9Zd0tSwNkqLX%2BLJjP=mD_LRrUw@mail.gmail.com> <52203EC9.4060808@bitfrost.no> <CAASDrVnwKOwqAVAu19gExpNvPYcwXo1V%2Bg=kVbnZWq5ic4NDvA@mail.gmail.com> <52207030.8050107@bitfrost.no> <CAASDrV=xi-qW-8tpYK-pyhh5xh7n90sy7s4uE3W405jgDkCcaw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 08/30/13 13:54, Lundberg, Johannes wrote:
> Still got the same behaviour after applying the patch...
>
> Johannes Lundberg
> BRILLIANTSERVICE CO., LTD. <http://www.brilliantservice.co.jp>;

I've seen something similar with my mac, that the boot menu counter is 
not always counting stable. I think this problem is inside the following 
function, if you say that the code is stuck inside pause():

sys/x86/isa/clock.c:DELAY()

Maybe you can try this patch instead. Just apply it by hand:

=== sys/x86/isa/clock.c
==================================================================
--- sys/x86/isa/clock.c	(revision 254832)
+++ sys/x86/isa/clock.c	(local)
@@ -262,6 +262,7 @@
  	timecounter_get_t *func;
  	uint64_t end, freq, now;
  	u_int last, mask, u;
+	int overflow = 0;

  	tc = timecounter;
  	freq = atomic_load_acq_64(&tsc_freq);
@@ -281,6 +282,11 @@
  		sched_pin();
  	last = func(tc) & mask;
  	do {
+		if (--overflow == 0) {
+			printf("DELAY overflow\n");
+			break;
+		}
+
  		cpu_spinwait();
  		u = func(tc) & mask;
  		if (u < last)
@@ -304,6 +310,7 @@
  DELAY(int n)
  {
  	int delta, prev_tick, tick, ticks_left;
+	int overflow = 0;
  #ifdef DELAYDEBUG
  	int getit_calls = 1;
  	int n1;
@@ -365,6 +372,10 @@
  			     / 1000000;

  	while (ticks_left > 0) {
+		if (--overflow == 0) {
+			printf("DELAY overflow\n");
+			break;
+		}
  #ifdef KDB
  		if (kdb_active) {
  #ifdef PC98


--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52208F63.4060308>