<span style=" font-size:10pt;font-family:sans-serif">Test and verified
working.</span><br><br><span style=" font-size:10pt;font-family:sans-serif">Tested-by: George
Keishing <gkeishin@in.ibm.com></span><br><br><br><span style=" font-size:10pt;color:blue;font-family:sans-serif"><b>Thanks
and Regards,</b></span><br><span style=" font-size:10pt;color:blue;font-family:sans-serif"> 
 George Keishing</span><br><span style=" font-size:10pt;color:blue;font-family:sans-serif"> 
 IBM Systems &Technology Lab, Firmware Development,</span><br><span style=" font-size:10pt;font-family:sans-serif"><i>“</i></span><span style=" font-size:12pt">There isn't enough time in a day to be lazy!!! </span><span style=" font-size:9pt;font-family:sans-serif">.”</span><br><img src=cid:_2_0C3801F00B0000280016254465258265 style="border:0px solid;"><br><br><br><br><br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">From:
       </span><span style=" font-size:9pt;font-family:sans-serif">Andrew
Jeffery <andrew@aj.id.au></span><br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">To:
       </span><span style=" font-size:9pt;font-family:sans-serif">gkeishin@in.ibm.com</span><br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Date:
       </span><span style=" font-size:9pt;font-family:sans-serif">04/04/2018
09:25 AM</span><br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Subject:
       </span><span style=" font-size:9pt;font-family:sans-serif">Fwd:
[PATCH linux dev-4.13 3/5] pmbus (core): One-shot retries for failure to
set page</span><br><hr noshade><br><br><br><tt><span style=" font-size:10pt"><br><br>----- Original message -----<br>From: Andrew Jeffery <andrew@aj.id.au><br>To: joel@jms.id.au<br>Cc: Andrew Jeffery <andrew@aj.id.au>, openbmc@lists.ozlabs.org, Eddie
James <eajames@linux.vnet.ibm.com>, Matt Spinler <mspinler@linux.vnet.ibm.com><br>Subject: [PATCH linux dev-4.13 3/5] pmbus (core): One-shot retries for
failure to set page<br>Date: Tue,  3 Apr 2018 23:56:53 +0930<br><br>Work around the shonky behaviour seen with the MAX31785 where we fail<br>to set the page register in some circumstances.<br><br>There's no real elegant way to do this. We can propagate the error up,<br>but that forces us to retry the operation way up the call tree in any<br>number of places. It also forces callers to split out pmbus_set_page()<br>from the pmbus_{read,write}_{byte,word}_data() functions in order to<br>differentiate between a failure to set the page and a failure to read a<br>register (that might not exist, in which case an error is anticiptated).<br><br>Cc: Eddie James <eajames@linux.vnet.ibm.com><br>Cc: Matt Spinler <mspinler@linux.vnet.ibm.com><br>Signed-off-by: Andrew Jeffery <andrew@aj.id.au><br>---<br> drivers/hwmon/pmbus/pmbus_core.c | 12 ++++++++++--<br> 1 file changed, 10 insertions(+), 2 deletions(-)<br><br>diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c<br>index ee7e0684c29f..ee1bf11c7fc6 100644<br>--- a/drivers/hwmon/pmbus/pmbus_core.c<br>+++ b/drivers/hwmon/pmbus/pmbus_core.c<br>@@ -167,9 +167,17 @@ int pmbus_set_page(struct i2c_client *client, int
page)<br>                  
               
return 0;<br> <br>                  if
(!(data->info->func[page] & PMBUS_PAGE_VIRTUAL)) {<br>+                
                 dev_dbg(&client->dev,
"Want page %u, %u cached\n", page,<br>+                
                 
               
data->currpage);<br>+<br>                  
               
rv = i2c_smbus_write_byte_data(client, PMBUS_PAGE, page);<br>-                
                 if
(rv < 0)<br>-                
                 
               
return rv;<br>+                
                 if
(rv) {<br>+                
                 
               
rv = i2c_smbus_write_byte_data(client, PMBUS_PAGE,<br>+                
                 
               
                 
               
                 
      page);<br>+                
                 
               
dev_dbg(&client->dev,<br>+                
                 
               
                 "Failed
to set page %u, performed one-shot retry %s: %d\n",<br>+                
                 
               
                 page,
rv ? "and failed" : "with success", rv);<br>+                
                 }<br> <br>                  
               
rv = i2c_smbus_read_byte_data(client, PMBUS_PAGE);<br>                  
               
if (rv < 0)<br>-- <br>2.14.1<br><br></span></tt><br><br><BR>