AnsweredAssumed Answered

select would be blocked when UART DMA congured

Question asked by ma shaofeng on Jun 7, 2020
Latest reply on Jun 8, 2020 by ma shaofeng

dear :


on imx8qxp platform , we have ttyLP2 uart port , if will configure DMA in dts , the upper layer application would be blocked sometimes;


the dts configuration:

assigned-clocks = <&clk IMX8QXP_UART2_CLK>;
  assigned-clock-rates = <80000000>;
  power-domains = <&pd_dma2_chan13>;
  dma-names = "tx","rx";
  dmas = <&edma2 13 0 0>,
   <&edma2 12 0 1>;


the application call 

iRet = pselect(s_fd + 1, &fdset, NULL, NULL, NULL,NULL);


the application would be blocked in pselect function;


if we modify pselect to :

iRet = pselect(s_fd + 1, &fdset, NULL, NULL, &timeout,NULL);


sometimes it would be timeout , and if timeout occoured , it will always timeout;


but  if we ignore tiemout , it means  we don't care the case iRet==0 and read data directily ,it seems  we can read the data;


if we don't use rx DMA , there are no issue;


but if we don't use DMA, there are high CPU occupany


it seems tty's select and poll function on imx8qxp have issue ;


how to fix it ?