[Skiboot] [PATCH v7 02/17] hw/p8-i2c: Speed up SMBUS_WRITE

Gavin Shan gwshan at linux.vnet.ibm.com
Fri Jun 5 16:34:37 AEST 2015


On Thu, Jun 04, 2015 at 04:18:54PM +1000, Gavin Shan wrote:
>For SMBUS_WRITE, the register offset and the following data can be
>sent to I2C bus in one shoot if the FIFO has enough spare space.
>It will help to gain a bit more performance obviously.
>
>Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>

Ben, you had following reply to this patch in last round (v6) of
review. I missed to add the tentative-ack to the patch:

| Tentative ack. I just want to check it doesn't break writing
| to the VPD stuff on palmetto.
|
| Cheers,
| Ben.

Thanks,
Gavin

>---
> hw/p8-i2c.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
>diff --git a/hw/p8-i2c.c b/hw/p8-i2c.c
>index f1bddc7..7b6e87c 100644
>--- a/hw/p8-i2c.c
>+++ b/hw/p8-i2c.c
>@@ -560,10 +560,15 @@ static void p8_i2c_status_data_request(struct p8_i2c_master *master,
> 			rc = p8_i2c_fifo_write(master, master->obuf,
> 					       req->offset_bytes);
> 		}
>+
>+		/* For read, wait address phase to complete */
>+		if (rc || req->op != SMBUS_WRITE)
>+			break;
>+
> 		/* For writes, transition to data phase now */
>-		if (rc == 0 && req->op == SMBUS_WRITE)
>-			master->state = state_data;
>-		break;
>+		master->state = state_data;
>+		fifo_free -= req->offset_bytes;
>+		/* Fall through */
> 	case state_data:
> 		/* Sanity check */
> 		if (master->bytes_sent >= req->rw_len) {
>-- 
>2.1.0
>



More information about the Skiboot mailing list