Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Nov 2019 21:03:55 +0000 (UTC)
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354311 - head/sys/dev/ichiic
Message-ID:  <201911032103.xA3L3t0H071822@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wulf
Date: Sun Nov  3 21:03:55 2019
New Revision: 354311
URL: https://svnweb.freebsd.org/changeset/base/354311

Log:
  [ig4] Convert last remaining usage of TX_NOTFULL status to TX_EMPTY
  
  in ig4iic_read routine. It makes possible interrupt utilization while
  waiting for empty space in TX FIFO.

Modified:
  head/sys/dev/ichiic/ig4_iic.c

Modified: head/sys/dev/ichiic/ig4_iic.c
==============================================================================
--- head/sys/dev/ichiic/ig4_iic.c	Sun Nov  3 21:03:07 2019	(r354310)
+++ head/sys/dev/ichiic/ig4_iic.c	Sun Nov  3 21:03:55 2019	(r354311)
@@ -337,14 +337,14 @@ ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t
 	while (received < len) {
 		burst = sc->cfg.txfifo_depth -
 		    (reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK);
-		/* Ensure we have enough free space in RXFIFO */
-		burst = MIN(burst, sc->cfg.rxfifo_depth - lowat);
 		if (burst <= 0) {
-			error = wait_status(sc, IG4_STATUS_TX_NOTFULL);
+			error = wait_status(sc, IG4_STATUS_TX_EMPTY);
 			if (error)
 				break;
-			burst = 1;
+			burst = sc->cfg.txfifo_depth;
 		}
+		/* Ensure we have enough free space in RXFIFO */
+		burst = MIN(burst, sc->cfg.rxfifo_depth - lowat);
 		target = MIN(requested + burst, (int)len);
 		while (requested < target) {
 			cmd = IG4_DATA_COMMAND_RD;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911032103.xA3L3t0H071822>