NetBSD-Bugs archive

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

Re: install/47603: Failed installing NetBSD 6.0.1



Please tell me step by step using this patch.

Sent from my iPhone

On Mar 5, 2013, at 9:22 PM, christos%zoulas.com@localhost (Christos Zoulas) 
wrote:

> On Mar 5, 10:35am, slashwaves%yahoo.com@localhost (Stefanus Hermawan) wrote:
> -- Subject: Re: install/47603: Failed installing NetBSD 6.0.1
> 
> | The following reply was made to PR install/47603; it has been noted by 
> GNATS.
> | 
> | From: Stefanus Hermawan <slashwaves%yahoo.com@localhost>
> | To: Christos Zoulas <christos%zoulas.com@localhost>
> | Cc: "gnats-bugs%NetBSD.org@localhost" <gnats-bugs%NetBSD.org@localhost>,
> |  "install-manager%netbsd.org@localhost" 
> <install-manager%netbsd.org@localhost>,
> |  "gnats-admin%netbsd.org@localhost" <gnats-admin%netbsd.org@localhost>,
> |  "netbsd-bugs%netbsd.org@localhost" <netbsd-bugs%netbsd.org@localhost>
> | Subject: Re: install/47603: Failed installing NetBSD 6.0.1
> | Date: Tue, 5 Mar 2013 15:44:55 +0700
> | 
> |  I re-debug, I just can sort the function that called on the infinite loop 
> |  
> |  1. call pckbc_send_devcmd
> |  2. call pckbc_send_cmd
> |  3. call pckbc_wait_output
> |  4. return value of pckbc_wait_output: 1
> |  5. return value of pckbc_send_cmd: 1
> |  6. return value of pckbc_send_devcmd: 1
> |  7. call pckbc_poll_data1
> |  8. return value of pckbc_poll_data1: 0xfc
> |  
> 
> Excellent! You built your own kernel. Please try this patch...
> 
> christos
> 
> Index: pckbdreg.h
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/pckbport/pckbdreg.h,v
> retrieving revision 1.2
> diff -u -p -u -r1.2 pckbdreg.h
> --- pckbdreg.h    11 Dec 2005 12:23:22 -0000    1.2
> +++ pckbdreg.h    5 Mar 2013 14:21:45 -0000
> @@ -19,7 +19,9 @@
> #define    KBR_EXTENDED0    0xE0    /* extended key sequence */
> #define    KBR_EXTENDED1    0xE1    /* extended key sequence */
> #define    KBR_RESEND    0xFE    /* needs resend of command */
> +#define    KBR_BAT_DONE    0xAA
> #define    KBR_ACK        0xFA    /* received a valid command */
> +#define    KBR_BAT_FAIL    0xFC
> #define    KBR_OVERRUN    0x00    /* flooded */
> #define    KBR_FAILURE    0xFD    /* diagnostic failure */
> #define    KBR_BREAK    0xF0    /* break code prefix - sent on key release */
> Index: pckbport.c
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/pckbport/pckbport.c,v
> retrieving revision 1.14
> diff -u -p -u -r1.14 pckbport.c
> --- pckbport.c    9 Sep 2011 14:00:01 -0000    1.14
> +++ pckbport.c    5 Mar 2013 14:21:45 -0000
> @@ -93,11 +93,15 @@ static const char * const pckbport_slot_
> 
> static struct pckbport_tag pckbport_cntag;
> 
> -#define KBC_DEVCMD_ACK 0xfa
> -#define KBC_DEVCMD_RESEND 0xfe
> -
> #define    KBD_DELAY    DELAY(8)
> 
> +#define PCKBPORTDEBUG
> +#ifdef PCKBPORTDEBUG
> +#define DPRINTF(a)    printf a
> +#else
> +#define DPRINTF(a)
> +#endif
> +
> static int
> pckbport_poll_data1(pckbport_tag_t t, pckbport_slot_t slot)
> {
> @@ -261,35 +265,29 @@ pckbport_poll_cmd1(struct pckbport_tag *
>            if (c != -1)
>                break;
>        }
> -
> -        if (c == KBC_DEVCMD_ACK) {
> +        switch (c) {
> +        case KBR_ACK:
>            cmd->cmdidx++;
>            continue;
> -        }
> -        if (c == KBC_DEVCMD_RESEND) {
> -#ifdef PCKBPORTDEBUG
> -            printf("pckbport_cmd: RESEND\n");
> -#endif
> +        case KBR_BAT_DONE:
> +        case KBR_BAT_FAIL:
> +        case KBR_RESEND:
> +            DPRINTF(("%s: %s\n", __func__, c == KBR_RESEND ?
> +                "RESEND" : (c == KBR_BAT_DONE ? "BAT_DONE" :
> +                "BAT_FAIL")));
>            if (cmd->retries++ < 5)
>                continue;
>            else {
> -#ifdef PCKBPORTDEBUG
> -                printf("pckbport: cmd failed\n");
> -#endif
> +                DPRINTF(("%s: cmd failed\n", __func__));
>                cmd->status = EIO;
>                return;
>            }
> -        }
> -        if (c == -1) {
> -#ifdef PCKBPORTDEBUG
> -            printf("pckbport_cmd: timeout\n");
> -#endif
> +        case -1:
> +            DPRINTF(("%s: timeout\n", __func__));
>            cmd->status = EIO;
>            return;
>        }
> -#ifdef PCKBPORTDEBUG
> -        printf("pckbport_cmd: lost 0x%x\n", c);
> -#endif
> +        DPRINTF(("%s: lost 0x%x\n", __func__, c));
>    }
> 
>    while (cmd->responseidx < cmd->responselen) {
> @@ -303,9 +301,7 @@ pckbport_poll_cmd1(struct pckbport_tag *
>                break;
>        }
>        if (c == -1) {
> -#ifdef PCKBPORTDEBUG
> -            printf("pckbport_cmd: no data\n");
> -#endif
> +            DPRINTF(("%s: no data\n", __func__));
>            cmd->status = ETIMEDOUT;
>            return;
>        } else
> @@ -344,15 +340,12 @@ void
> pckbport_cleanqueue(struct pckbport_slotdata *q)
> {
>    struct pckbport_devcmd *cmd;
> -#ifdef PCKBPORTDEBUG
> -    int i;
> -#endif
> 
>    while ((cmd = TAILQ_FIRST(&q->cmdqueue))) {
>        TAILQ_REMOVE(&q->cmdqueue, cmd, next);
> #ifdef PCKBPORTDEBUG
> -        printf("pckbport_cleanqueue: removing");
> -        for (i = 0; i < cmd->cmdlen; i++)
> +        printf("%s: removing", __func__);
> +        for (int i = 0; i < cmd->cmdlen; i++)
>            printf(" %02x", cmd->cmd[i]);
>        printf("\n");
> #endif
> @@ -445,17 +438,15 @@ pckbport_cmdresponse(struct pckbport_tag
>        panic("pckbport_cmdresponse: no active command");
> #endif
>    if (cmd->cmdidx < cmd->cmdlen) {
> -        if (data != KBC_DEVCMD_ACK && data != KBC_DEVCMD_RESEND)
> +        if (data != KBR_ACK && data != KBR_RESEND)
>            return 0;
> 
> -        if (data == KBC_DEVCMD_RESEND) {
> +        if (data == KBR_RESEND) {
>            if (cmd->retries++ < 5)
>                /* try again last command */
>                goto restart;
>            else {
> -#ifdef PCKBPORTDEBUG
> -                printf("pckbport: cmd failed\n");
> -#endif
> +                DPRINTF(("%s: cmd failed\n", __func__));
>                cmd->status = EIO;
>                /* dequeue */
>            }
> @@ -584,12 +575,11 @@ pckbportintr(pckbport_tag_t t, pckbport_
>    if (CMD_IN_QUEUE(q) && pckbport_cmdresponse(t, slot, data))
>        return;
> 
> -    if (t->t_inputhandler[slot])
> +    if (t->t_inputhandler[slot]) {
>        (*t->t_inputhandler[slot])(t->t_inputarg[slot], data);
> -#ifdef PCKBPORTDEBUG
> -    else
> -        printf("pckbportintr: slot %d lost %d\n", slot, data);
> -#endif
> +        return;
> +    }
> +    DPRINTF(("%s: slot %d lost %d\n", slot, data, __func__));
> }
> 
> int


Home | Main Index | Thread Index | Old Index