Message ID | 1430456549-21090-3-git-send-email-gwshan@linux.vnet.ibm.com |
---|---|
State | Superseded |
Delegated to: | Benjamin Herrenschmidt |
Headers | show |
On Fri, 2015-05-01 at 15:02 +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. Tentative ack. I just want to check it doesn't break writing to the VPD stuff on palmetto. Cheers, Ben. > Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> > --- > 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 52b9489..1d616fb 100644 > --- a/hw/p8-i2c.c > +++ b/hw/p8-i2c.c > @@ -558,10 +558,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) {
diff --git a/hw/p8-i2c.c b/hw/p8-i2c.c index 52b9489..1d616fb 100644 --- a/hw/p8-i2c.c +++ b/hw/p8-i2c.c @@ -558,10 +558,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) {
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@linux.vnet.ibm.com> --- hw/p8-i2c.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)