tech-kern archive

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

Re: com(4) and LSI bug workaround



> Although the processing for this ARMADAXP was moved to com_mv.c, IIR of
> com is reset by reading.  That is, since IIR was read by mvuart_intr(),
> IIR was not able to be correctly read by comintr().
> I would like to add the next member to com_softc, in order to solve this
> problem.
 :
> Please let me know your opinion.
 :
> --- ic/com.c  1 Sep 2013 04:58:15 -0000       1.314
> +++ ic/com.c  24 Sep 2013 11:00:02 -0000
> @@ -1938,6 +1938,18 @@
>       mutex_spin_enter(&sc->sc_lock);
>       iir = CSR_READ_1(regsp, COM_REG_IIR);
>  
> +     if (sc->sc_type == COM_TYPE_ARMADAXP) {
> +             if ((iir & IIR_BUSY) == IIR_BUSY) {
> +                     if (sc->sc_vendor_workaround != NULL &&
> +                         sc->sc_vendor_workaround(sc) != 0) {
> +                             mutex_spin_exit(&sc->sc_lock);
> +                             return (0);
> +                     }
> +                     CSR_WRITE_1(regsp, COM_REG_LCR, sc->sc_lcr);
> +                     iir = CSR_READ_1(regsp, COM_REG_IIR);
> +             }
> +     }
> +
>       if (ISSET(iir, IIR_NOPEND)) {
>               mutex_spin_exit(&sc->sc_lock);
>               return (0);

It looks meaningless that the (*sc_vendor_workaround)() hook function
is inside of MD if (sc->sc_type == COM_TYPE_ARMADAXP) statement.

Isn't it simpler to prepare a MD hook function that returns
(possible pre-processed) IIR register value that can be used
to check if the interrupt for the device is pending or not?

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index