Re: change "panic: i82489_icr_wait: busy" when entering DDB to warning

Kimihiro Nonaka <[email protected]>
Newsgroups gmane.os.netbsd.ports.x86-64,gmane.os.netbsd.current,gmane.os.netbsd.ports.i386
Message-ID <CAM+xf6AOhsTfD4CJ+mHDoJ8UjaGZO_5ONtWWPud+7wNsrMvzBw@mail.gmail.com>
Hi,

On Wed, Oct 28, 2015 at 12:56 AM, Christoph Badura <[email protected]> wrote:

> I get an annoying recursive "panic: i82489_icr_wait: busy" when invoking
> DDB from the console on my Dell PE1400SC machines. C.f. the console log at
> the end.

Could you try the attached patch.

Regards,
-- 
Kimihiro Nonaka
x86-single-cpu-ddb.diff (text/plain, 1.7 KB)
diff --git a/sys/arch/amd64/amd64/db_interface.c b/sys/arch/amd64/amd64/db_interface.c
index 5b07bf197f3..df64670046f 100644
--- a/sys/arch/amd64/amd64/db_interface.c
+++ b/sys/arch/amd64/amd64/db_interface.c
@@ -131,11 +131,25 @@ db_suspend_others(void)
 	win = (ddb_cpu == cpu_me);
 	__cpu_simple_unlock(&db_lock);
 	if (win) {
+		CPU_INFO_ITERATOR cii;
+		struct cpu_info *ci, *self = curcpu();
+		bool do_ipi = false;
+
+		for (CPU_INFO_FOREACH(cii, ci)) {
+			if (ci == self)
+				continue;
+			if ((ci->ci_flags & CPUF_RUNNING) == 0)
+				continue;
+			do_ipi = true;
+			break;
+		}
+		if (do_ipi) {
 #ifdef XEN
-		xen_broadcast_ipi(XEN_IPI_DDB);
+			xen_broadcast_ipi(XEN_IPI_DDB);
 #else
-		x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
+			x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
 #endif /* XEN */
+		}
 
 	}
 	ddb_mp_online = x86_mp_online;
diff --git a/sys/arch/i386/i386/db_interface.c b/sys/arch/i386/i386/db_interface.c
index 5b51554eefa..c8580801de7 100644
--- a/sys/arch/i386/i386/db_interface.c
+++ b/sys/arch/i386/i386/db_interface.c
@@ -142,11 +142,25 @@ db_suspend_others(void)
 	win = (ddb_cpu == cpu_me);
 	__cpu_simple_unlock(&db_lock);
 	if (win) {
+		CPU_INFO_ITERATOR cii;
+		struct cpu_info *ci, *self = curcpu();
+		bool do_ipi = false;
+
+		for (CPU_INFO_FOREACH(cii, ci)) {
+			if (ci == self)
+				continue;
+			if ((ci->ci_flags & CPUF_RUNNING) == 0)
+				continue;
+			do_ipi = true;
+			break;
+		}
+		if (do_ipi) {
 #ifdef XEN
-		xen_broadcast_ipi(XEN_IPI_DDB);
+			xen_broadcast_ipi(XEN_IPI_DDB);
 #else
-		x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
+			x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
 #endif /* XEN */
+		}
 	}
 	ddb_mp_online = x86_mp_online;
 	x86_mp_online = false;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.