Comment 295 for bug 1189721

Revision history for this message
Jan Vodochalek (kukulo2011) wrote :

I also changed:

        case RTBTH_IOCDMAC:
            do {
                struct rtbth_dmac dmac;

                if (copy_from_user(&dmac, (void *)arg, sizeof(dmac))) {
                    retval = -EFAULT;
                    DebugPrint(ERROR, DBG_INIT,"copy_from_user failed at %d\n", __LINE__);
                    break;
                }
                DebugPrint(ERROR, DBG_INIT,"RTBTH_IOCDMAC: dmac.dmac_op=%d\n", dmac.dmac_op);

                if(dmac.dmac_op == 0){
                    RtbtResetPDMA(gpAd);
                }else if(dmac.dmac_op == 1){
                    BthEnableRxTx(gpAd);
                }else if(dmac.dmac_op == 2){
                    DebugPrint(TRACE, DBG_MISC, "%s:kfifo reset ==>\n", __func__);
                    kfifo_reset(gpAd->acl_fifo);
                    kfifo_reset(gpAd->hci_fifo);
                    kfifo_reset(gpAd->evt_fifo);
                    kfifo_reset(gpAd->sco_fifo);
                    kfifo_reset(gpAd->rx_fifo);
                    DebugPrint(TRACE, DBG_MISC, "%s:kfifo reset <== \n", __func__);
                }
                else {
                     DebugPrint(ERROR, DBG_INIT,"No such the dma op = %d\n", dmac.dmac_op);
                }
            }while(0);
break;

to:

        case RTBTH_IOCDMAC:
            do {
                struct rtbth_dmac dmac;

                if (copy_from_user(&dmac, (void *)arg, sizeof(dmac))) {
                    retval = -EFAULT;
                    DebugPrint(ERROR, DBG_INIT,"copy_from_user failed at %d\n", __LINE__);
                    break;
                }
                DebugPrint(ERROR, DBG_INIT,"RTBTH_IOCDMAC: dmac.dmac_op=%d\n", dmac.dmac_op);

                if(dmac.dmac_op == 2){
                    DebugPrint(TRACE, DBG_MISC, "%s:kfifo reset ==>\n", __func__);
                    kfifo_reset(gpAd->acl_fifo);
                    kfifo_reset(gpAd->hci_fifo);
                    kfifo_reset(gpAd->evt_fifo);
                    kfifo_reset(gpAd->sco_fifo);
                    kfifo_reset(gpAd->rx_fifo);
                    DebugPrint(TRACE, DBG_MISC, "%s:kfifo reset <== \n", __func__);
                }

                if(dmac.dmac_op == 0){
                    RtbtResetPDMA(gpAd);
                }
                if(dmac.dmac_op == 1){
                    BthEnableRxTx(gpAd);
                } else {
                     DebugPrint(ERROR, DBG_INIT,"No such the dma op = %d\n", dmac.dmac_op);
                }

            }while(0);
            break;

Now it is the pairing even more reliable. Paired 5 different devices including bluetooth audio device.

Somehow the execution was not reaching this part:

  if(dmac.dmac_op == 2){
                    DebugPrint(TRACE, DBG_MISC, "%s:kfifo reset ==>\n", __func__);
                    kfifo_reset(gpAd->acl_fifo);
                    kfifo_reset(gpAd->hci_fifo);
                    kfifo_reset(gpAd->evt_fifo);
                    kfifo_reset(gpAd->sco_fifo);
                    kfifo_reset(gpAd->rx_fifo);
                    DebugPrint(TRACE, DBG_MISC, "%s:kfifo reset <== \n", __func__);
                }

It is the interrupt causing it?