9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] BUG: thinclient not booting with usbehci,usbohci
Date: Sat, 09 Jan 2021 18:12:11 +0100	[thread overview]
Message-ID: <F6982FB5B8A2131C268C8A1260ABA158@felloff.net> (raw)
In-Reply-To: <DD7D5365EC46CA15EE516D9FAB92DF14@kamalatta.ddnss.de>

interesting.

one thing that could cause this might be that the firmware
has still control over the usb controllers for ps2 emulation.

a while ago, our pci startup code now clears the busmaster
enable of all pci devices on boot. i wonder if this causes
the problems later on when we do the handoff.

you can try commenting out the call to pcireset() in
/sys/src/9/pc/pcipc.c in the pcicfginit() function?

	if(pciroot == nil)
		goto out;

-	pcireset();
+	// pcireset();

	if(nobios) {

we might also try making sure we clear interrupt enables
and interrupt status bits in ehci and ohci reset()
functions. it is possible that firmware has some
pending interrupts which are somehow left enabled
and not cleared by the controller reset.

for usbohci.c, that would be adding the following lines
to ohcireset() function:

	delay(100);
+	ctlr->ohci->intrdisable = Mie;
+	ctlr->ohci->intrenable = 0;
+	ctlr->ohci->intrsts = ctlr->ohci->intrsts & ~Mie;
	ctlr->ohci->control = 0;

and for usbehcipc.c, in ehcireset() function:

	/* reclaim from bios */
	getehci(ctlr);

+	/* disable interrupts */
+	opio->intr = 0;
+	opio->sts = opio->sts & Sintrs;

	/*
	 * halt and route ports to companion controllers
	 * until we are setup
	 */
	ehcirun(ctlr, 0);

also it would be nice if we could narrow it down to
eigther ohci or the ehci controllers.

--
cinap

  reply	other threads:[~2021-01-09 17:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09  9:22 stevie
2021-01-09  9:46 ` stevie
2021-01-09 17:12   ` cinap_lenrek [this message]
2021-01-09 18:29     ` stevie
2021-01-09 23:09       ` cinap_lenrek
2021-01-10  9:29         ` stevie
2021-01-10 19:34           ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F6982FB5B8A2131C268C8A1260ABA158@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).