Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sparc SMP seems fixed (was: re: SparcStation 20 system freezes)



A bit off topic, but is the following spl(9) code in
src/sys/arch/sparc/dev/kd.c valid for SMP systems?

https://nxr.netbsd.org/xref/src/sys/arch/sparc/dev/kd.c?r=1.54#344

---

    344 static void
    345 kdstart(struct tty *tp)
    346 {
    347 	int s1, s2;
    348 
    349 	s1 = splsoftclock();
    350 	s2 = spltty();
    351 	if (tp->t_state & (TS_BUSY|TS_TTSTOP|TS_TIMEOUT))
    352 		goto out;
    353 
    354 	if (ttypull(tp)) {
    355 		tp->t_state |= TS_BUSY;
    356 		if ((s1 & PSR_PIL) == 0) {
    357 			/* called at level zero - update screen now. */
    358 			splx(s2);
    359 			kd_putfb(tp);
    360 			s2 = spltty();
    361 			tp->t_state &= ~TS_BUSY;
    362 		} else {
    363 			/* called at interrupt level - do it later */
    364 			callout_schedule(&tp->t_rstrt_ch, 0);
    365 		}
    366 	}
    367 out:
    368 	splx(s2);
    369 	splx(s1);
    370 }

---

I wonder if we should always use callout(9) to avoid possible race.

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index