On Thu, May 14, 2020 at 07:03:18PM +0530, Mukesh, Savaliya wrote: > > On 5/6/2020 5:35 PM, Greg KH wrote: > > On Wed, May 06, 2020 at 05:03:31PM +0530, Mukesh, Savaliya wrote: > > > + /* > > > + * If the WM bit never set, then the Tx state machine is not > > > + * in a valid state, so break, cancel/abort any existing > > > + * command. Unfortunately the current data being written is > > > + * lost. > > > + */ > > > + while (!msm_geni_serial_poll_bit(uport, SE_GENI_M_IRQ_STATUS, > > > + M_TX_FIFO_WATERMARK_EN, true)) > > > + break; > > Am I reading this correctly in that if the bit is set properly, you will > > just loop for forever? > > > > That feels wrong, are you sure this is correct? > > It seems correct to me. The API returns true if function sees the BIT is set > else returns false. > > Mostly it's true and returns true, hence it shouldn't loop. What if it always is false, the loop is now stuck and can never break out of this. You need some sort of "timeout" for when the hardware breaks :) thanks, greg k-h