All of lore.kernel.org
 help / color / mirror / Atom feed
* Some problems about FruDevice in the entity-manager
@ 2019-03-22  5:41 Henbin Chang
  2019-03-22 15:54 ` James Feist
  0 siblings, 1 reply; 10+ messages in thread
From: Henbin Chang @ 2019-03-22  5:41 UTC (permalink / raw)
  To: james.feist, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

Hi James,

There is EEPROM (AT24C64) with the valid FRU data on my board.

But the FruDevice would fail to format it.

I added some debug information to determine what's wrong with it.

Then I found the flag variable returned by isDevice16Bit() was equal 0.
That's, the FruDevice could think it's 8-bit EEPROM.
/* Check for Device type if it is 8 bit or 16 bit */
int flag = isDevice16Bit(file);

There is the below comment in the isDevice16Bit().

/* Read 7 more bytes, it will read same first byte in case of
 * 8 bit but it will read next byte in case of 16 bit
*/
But the rule isn't applicable to my EEPROM (AT24C64) .
root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
0x00
root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
0x00
root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
0x00
root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
0x00
root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
0x00
root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
0x00
root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
0x00
root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
0x00
root@henbin:/var/volatile#

Could you give some suggestion?

Thanks.

[-- Attachment #2: Type: text/html, Size: 1835 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Some problems about FruDevice in the entity-manager
  2019-03-22  5:41 Some problems about FruDevice in the entity-manager Henbin Chang
@ 2019-03-22 15:54 ` James Feist
  2019-03-22 18:10   ` Vijay Khemka
  0 siblings, 1 reply; 10+ messages in thread
From: James Feist @ 2019-03-22 15:54 UTC (permalink / raw)
  To: Henbin Chang, OpenBMC Maillist; +Cc: Vijay Khemka

On 3/21/19 10:41 PM, Henbin Chang wrote:
> Hi James,
> 
> There is EEPROM (AT24C64) with the valid FRU data on my board.
> 
> But the FruDevice would fail to format it.
> 
> I added some debug information to determine what's wrong with it.
> 
> Then I found the flag variable returned by isDevice16Bit() was equal 0.
> That's, the FruDevice could think it's 8-bit EEPROM.
> /* Check for Device type if it is 8 bit or 16 bit */
> int flag = isDevice16Bit(file);
> 
> There is the below comment in the isDevice16Bit().

Vijay, can you comment on this?

I believe the logic here was that the 16bit eeproms Vijay was using 
auto-increment the address, so reading twice over the header should give 
different answers, as the checksum is in the header. That being said I 
don't have any 16bit eeproms in my system so I haven't tried this 
branch. Vijay authored this so he might have a better idea of what is 
going on.

Thanks,

James


> 
> /* Read 7 more bytes, it will read same first byte in case of
>   * 8 bit but it will read next byte in case of 16 bit
> */
> But the rule isn't applicable to my EEPROM (AT24C64) .
> root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
> 0x00
> root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
> 0x00
> root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
> 0x00
> root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
> 0x00
> root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
> 0x00
> root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
> 0x00
> root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
> 0x00
> root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
> 0x00
> root@henbin:/var/volatile#
> 
> Could you give some suggestion?
> 
> Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Some problems about FruDevice in the entity-manager
  2019-03-22 15:54 ` James Feist
@ 2019-03-22 18:10   ` Vijay Khemka
  2019-03-25  1:39     ` Henbin Chang
  0 siblings, 1 reply; 10+ messages in thread
From: Vijay Khemka @ 2019-03-22 18:10 UTC (permalink / raw)
  To: James Feist, Henbin Chang, OpenBMC Maillist



On 3/22/19, 8:55 AM, "James Feist" <james.feist@linux.intel.com> wrote:

    On 3/21/19 10:41 PM, Henbin Chang wrote:
    > Hi James,
    > 
    > There is EEPROM (AT24C64) with the valid FRU data on my board.
    > 
    > But the FruDevice would fail to format it.
    > 
    > I added some debug information to determine what's wrong with it.
    > 
    > Then I found the flag variable returned by isDevice16Bit() was equal 0.
    > That's, the FruDevice could think it's 8-bit EEPROM.
    > /* Check for Device type if it is 8 bit or 16 bit */
    > int flag = isDevice16Bit(file);
    > 
    > There is the below comment in the isDevice16Bit().
    
    Vijay, can you comment on this?
    
    I believe the logic here was that the 16bit eeproms Vijay was using 
    auto-increment the address, so reading twice over the header should give 
    different answers, as the checksum is in the header. That being said I 
    don't have any 16bit eeproms in my system so I haven't tried this 
    branch. Vijay authored this so he might have a better idea of what is 
    going on.
    
    Thanks,
    
    James

The issues here is eeprom index is not at 00 which was an assumption. In this case, it
is not pointing to first 8 byte header but it is pointing to garbage where all next 
8 bytes are same which means my check is failing. We need better way to find if i2c device
Is eeprom and then find 8 bit or 16 bits. I will look into it. In the meanwhile there is patch 
for direct reading from sysfs, please use that and see if it solves for time being. I will send gerrit
link for patch soon.

-Vijay

    
    
    > 
    > /* Read 7 more bytes, it will read same first byte in case of
    >   * 8 bit but it will read next byte in case of 16 bit
    > */
    > But the rule isn't applicable to my EEPROM (AT24C64) .
    > root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
    > 0x00
    > root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
    > 0x00
    > root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
    > 0x00
    > root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
    > 0x00
    > root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
    > 0x00
    > root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
    > 0x00
    > root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
    > 0x00
    > root@henbin:/var/volatile# i2ctransfer -f -y 6 w1@0x50 0 r1
    > 0x00
    > root@henbin:/var/volatile#
    > 
    > Could you give some suggestion?
    > 
    > Thanks.
    


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Some problems about FruDevice in the entity-manager
  2019-03-22 18:10   ` Vijay Khemka
@ 2019-03-25  1:39     ` Henbin Chang
  2019-03-25 23:05       ` Vijay Khemka
  0 siblings, 1 reply; 10+ messages in thread
From: Henbin Chang @ 2019-03-25  1:39 UTC (permalink / raw)
  To: Vijay Khemka; +Cc: James Feist, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

Thanks for your response.

I also encountered another problem.

That's,  I found the content of 16-bit EEPROM through the combination of
the SMBUS APIs was not incorrect.

    /* This is for 16 bit addressing EEPROM device. First an offset
     * needs to be written before read data from a offset
     */
    int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }

    return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);

So I referred to i2c-tools to modify them.
And then I could see my FRU under the tree of
'xyz/openbmc_project/FruDevice/'

    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }
    while (index < len){
buf[index] = i2c_smbus_read_byte(file);
index++;
    }

    //return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
    return len;

Let me know if you have any comments.

Thanks.

[-- Attachment #2: Type: text/html, Size: 1652 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Some problems about FruDevice in the entity-manager
  2019-03-25  1:39     ` Henbin Chang
@ 2019-03-25 23:05       ` Vijay Khemka
  2019-03-26  1:01         ` Henbin Chang
  0 siblings, 1 reply; 10+ messages in thread
From: Vijay Khemka @ 2019-03-25 23:05 UTC (permalink / raw)
  To: Henbin Chang; +Cc: James Feist, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 1886 bytes --]

Hi Henbin,
I am assuming your device is 16 bit and in your last email you said 16bit check is failing. If that check fails then following code will not get executed. Also while loop is same as i2c_smbus_read_i2c_block_data().

I would suggest one thing, if your 16bit check is passing and still you don’t see fru device, please make only one line change below and test.
    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);

Please let me know result.

Regards
-Vijay


From: Henbin Chang <henbinchang@gmail.com>
Date: Sunday, March 24, 2019 at 6:39 PM
To: Vijay Khemka <vijaykhemka@fb.com>
Cc: James Feist <james.feist@linux.intel.com>, OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: Some problems about FruDevice in the entity-manager

Thanks for your response.

I also encountered another problem.

That's,  I found the content of 16-bit EEPROM through the combination of the SMBUS APIs was not incorrect.

    /* This is for 16 bit addressing EEPROM device. First an offset
     * needs to be written before read data from a offset
     */
    int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }

    return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);

So I referred to i2c-tools to modify them.
And then I could see my FRU under the tree of 'xyz/openbmc_project/FruDevice/'

    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }
    while (index < len){
buf[index] = i2c_smbus_read_byte(file);
index++;
    }

    //return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
    return len;

Let me know if you have any comments.

Thanks.

[-- Attachment #2: Type: text/html, Size: 6598 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Some problems about FruDevice in the entity-manager
  2019-03-25 23:05       ` Vijay Khemka
@ 2019-03-26  1:01         ` Henbin Chang
  2019-03-26 18:44           ` Vijay Khemka
  0 siblings, 1 reply; 10+ messages in thread
From: Henbin Chang @ 2019-03-26  1:01 UTC (permalink / raw)
  To: Vijay Khemka; +Cc: James Feist, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 2693 bytes --]

Hi Vijay,
Currently, I bypass the 8/16bit checking to try dbus-sensor.

I just followed your suggestion and only changed the one line.
But I couldn't find the fru device under the tree of
/xyz/openbmc_project/FruDevice/

There was the below error message in the journal.
Mar 26 08:17:56 henbin fru-device[1111]: failed to format fru for device at
bus 6address 50

Please let me know if you want to try other.

BRs.
Henbin.

Vijay Khemka <vijaykhemka@fb.com> 於 2019年3月26日 週二 上午7:05寫道:

> Hi Henbin,
>
> I am assuming your device is 16 bit and in your last email you said 16bit
> check is failing. If that check fails then following code will not get
> executed. Also while loop is same as i2c_smbus_read_i2c_block_data().
>
>
>
> I would suggest one thing, if your 16bit check is passing and still you
> don’t see fru device, please make only one line change below and test.
>
>     int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
>
>     //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
>
>
>
> Please let me know result.
>
>
>
> Regards
>
> -Vijay
>
>
>
>
>
> *From: *Henbin Chang <henbinchang@gmail.com>
> *Date: *Sunday, March 24, 2019 at 6:39 PM
> *To: *Vijay Khemka <vijaykhemka@fb.com>
> *Cc: *James Feist <james.feist@linux.intel.com>, OpenBMC Maillist <
> openbmc@lists.ozlabs.org>
> *Subject: *Re: Some problems about FruDevice in the entity-manager
>
>
>
> Thanks for your response.
>
>
>
> I also encountered another problem.
>
>
>
> That's,  I found the content of 16-bit EEPROM through the combination of
> the SMBUS APIs was not incorrect.
>
>
>
>     /* This is for 16 bit addressing EEPROM device. First an offset
>
>      * needs to be written before read data from a offset
>
>      */
>
>     int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
>
>     if (ret < 0)
>
>     {
>
>         return ret;
>
>     }
>
>
>
>     return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
>
>
>
> So I referred to i2c-tools to modify them.
>
> And then I could see my FRU under the tree of
> 'xyz/openbmc_project/FruDevice/'
>
>
>
>     int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
>
>     //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
>
>     if (ret < 0)
>
>     {
>
>         return ret;
>
>     }
>
>     while (index < len){
>
> buf[index] = i2c_smbus_read_byte(file);
>
> index++;
>
>     }
>
>
>
>     //return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
>
>     return len;
>
>
>
> Let me know if you have any comments.
>
>
>
> Thanks.
>

[-- Attachment #2: Type: text/html, Size: 6332 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Some problems about FruDevice in the entity-manager
  2019-03-26  1:01         ` Henbin Chang
@ 2019-03-26 18:44           ` Vijay Khemka
  2019-03-27  6:33             ` Henbin Chang
  0 siblings, 1 reply; 10+ messages in thread
From: Vijay Khemka @ 2019-03-26 18:44 UTC (permalink / raw)
  To: Henbin Chang; +Cc: James Feist, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 3170 bytes --]

Hi Henbin,
If you are by passing this check then you have to be careful in changing code. None of below changes are required. I can’t say without debugging, why your fru device is not getting scanned properly. Please hexdump your eeprom device through sys file system and verify if it has right data.

Regards
-Vijay

From: Henbin Chang <henbinchang@gmail.com>
Date: Monday, March 25, 2019 at 6:02 PM
To: Vijay Khemka <vijaykhemka@fb.com>
Cc: James Feist <james.feist@linux.intel.com>, OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: Some problems about FruDevice in the entity-manager

Hi Vijay,
Currently, I bypass the 8/16bit checking to try dbus-sensor.

I just followed your suggestion and only changed the one line.
But I couldn't find the fru device under the tree of /xyz/openbmc_project/FruDevice/

There was the below error message in the journal.
Mar 26 08:17:56 henbin fru-device[1111]: failed to format fru for device at bus 6address 50

Please let me know if you want to try other.

BRs.
Henbin.

Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>> 於 2019年3月26日 週二 上午7:05寫道:
Hi Henbin,
I am assuming your device is 16 bit and in your last email you said 16bit check is failing. If that check fails then following code will not get executed. Also while loop is same as i2c_smbus_read_i2c_block_data().

I would suggest one thing, if your 16bit check is passing and still you don’t see fru device, please make only one line change below and test.
    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);

Please let me know result.

Regards
-Vijay


From: Henbin Chang <henbinchang@gmail.com<mailto:henbinchang@gmail.com>>
Date: Sunday, March 24, 2019 at 6:39 PM
To: Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>>
Cc: James Feist <james.feist@linux.intel.com<mailto:james.feist@linux.intel.com>>, OpenBMC Maillist <openbmc@lists.ozlabs.org<mailto:openbmc@lists.ozlabs.org>>
Subject: Re: Some problems about FruDevice in the entity-manager

Thanks for your response.

I also encountered another problem.

That's,  I found the content of 16-bit EEPROM through the combination of the SMBUS APIs was not incorrect.

    /* This is for 16 bit addressing EEPROM device. First an offset
     * needs to be written before read data from a offset
     */
    int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }

    return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);

So I referred to i2c-tools to modify them.
And then I could see my FRU under the tree of 'xyz/openbmc_project/FruDevice/'

    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }
    while (index < len){
buf[index] = i2c_smbus_read_byte(file);
index++;
    }

    //return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
    return len;

Let me know if you have any comments.

Thanks.

[-- Attachment #2: Type: text/html, Size: 13251 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Some problems about FruDevice in the entity-manager
  2019-03-26 18:44           ` Vijay Khemka
@ 2019-03-27  6:33             ` Henbin Chang
  2019-03-27 18:49               ` Vijay Khemka
  0 siblings, 1 reply; 10+ messages in thread
From: Henbin Chang @ 2019-03-27  6:33 UTC (permalink / raw)
  To: Vijay Khemka; +Cc: James Feist, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 3635 bytes --]

Thanks Vijay.

We expect the patch for direct reading from sysfs you said before.

BRs,
Henbin.

Vijay Khemka <vijaykhemka@fb.com> 於 2019年3月27日 週三 上午2:44寫道:

> Hi Henbin,
>
> If you are by passing this check then you have to be careful in changing
> code. None of below changes are required. I can’t say without debugging,
> why your fru device is not getting scanned properly. Please hexdump your
> eeprom device through sys file system and verify if it has right data.
>
>
>
> Regards
>
> -Vijay
>
>
>
> *From: *Henbin Chang <henbinchang@gmail.com>
> *Date: *Monday, March 25, 2019 at 6:02 PM
> *To: *Vijay Khemka <vijaykhemka@fb.com>
> *Cc: *James Feist <james.feist@linux.intel.com>, OpenBMC Maillist <
> openbmc@lists.ozlabs.org>
> *Subject: *Re: Some problems about FruDevice in the entity-manager
>
>
>
> Hi Vijay,
>
> Currently, I bypass the 8/16bit checking to try dbus-sensor.
>
>
>
> I just followed your suggestion and only changed the one line.
>
> But I couldn't find the fru device under the tree of
> /xyz/openbmc_project/FruDevice/
>
>
>
> There was the below error message in the journal.
>
> Mar 26 08:17:56 henbin fru-device[1111]: failed to format fru for device
> at bus 6address 50
>
>
>
> Please let me know if you want to try other.
>
>
>
> BRs.
>
> Henbin.
>
>
>
> Vijay Khemka <vijaykhemka@fb.com> 於 2019年3月26日 週二 上午7:05寫道:
>
> Hi Henbin,
>
> I am assuming your device is 16 bit and in your last email you said 16bit
> check is failing. If that check fails then following code will not get
> executed. Also while loop is same as i2c_smbus_read_i2c_block_data().
>
>
>
> I would suggest one thing, if your 16bit check is passing and still you
> don’t see fru device, please make only one line change below and test.
>
>     int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
>
>     //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
>
>
>
> Please let me know result.
>
>
>
> Regards
>
> -Vijay
>
>
>
>
>
> *From: *Henbin Chang <henbinchang@gmail.com>
> *Date: *Sunday, March 24, 2019 at 6:39 PM
> *To: *Vijay Khemka <vijaykhemka@fb.com>
> *Cc: *James Feist <james.feist@linux.intel.com>, OpenBMC Maillist <
> openbmc@lists.ozlabs.org>
> *Subject: *Re: Some problems about FruDevice in the entity-manager
>
>
>
> Thanks for your response.
>
>
>
> I also encountered another problem.
>
>
>
> That's,  I found the content of 16-bit EEPROM through the combination of
> the SMBUS APIs was not incorrect.
>
>
>
>     /* This is for 16 bit addressing EEPROM device. First an offset
>
>      * needs to be written before read data from a offset
>
>      */
>
>     int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
>
>     if (ret < 0)
>
>     {
>
>         return ret;
>
>     }
>
>
>
>     return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
>
>
>
> So I referred to i2c-tools to modify them.
>
> And then I could see my FRU under the tree of
> 'xyz/openbmc_project/FruDevice/'
>
>
>
>     int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
>
>     //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
>
>     if (ret < 0)
>
>     {
>
>         return ret;
>
>     }
>
>     while (index < len){
>
> buf[index] = i2c_smbus_read_byte(file);
>
> index++;
>
>     }
>
>
>
>     //return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
>
>     return len;
>
>
>
> Let me know if you have any comments.
>
>
>
> Thanks.
>
>

[-- Attachment #2: Type: text/html, Size: 9657 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Some problems about FruDevice in the entity-manager
  2019-03-27  6:33             ` Henbin Chang
@ 2019-03-27 18:49               ` Vijay Khemka
  2019-03-29 18:14                 ` Vijay Khemka
  0 siblings, 1 reply; 10+ messages in thread
From: Vijay Khemka @ 2019-03-27 18:49 UTC (permalink / raw)
  To: Henbin Chang; +Cc: James Feist, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 3891 bytes --]

Henbin,
We are making some upgrade to that patch, will send you soon.

Regards
-Vijay

From: Henbin Chang <henbinchang@gmail.com>
Date: Tuesday, March 26, 2019 at 11:33 PM
To: Vijay Khemka <vijaykhemka@fb.com>
Cc: James Feist <james.feist@linux.intel.com>, OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: Some problems about FruDevice in the entity-manager

Thanks Vijay.

We expect the patch for direct reading from sysfs you said before.


BRs,
Henbin.

Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>> 於 2019年3月27日 週三 上午2:44寫道:
Hi Henbin,
If you are by passing this check then you have to be careful in changing code. None of below changes are required. I can’t say without debugging, why your fru device is not getting scanned properly. Please hexdump your eeprom device through sys file system and verify if it has right data.

Regards
-Vijay

From: Henbin Chang <henbinchang@gmail.com<mailto:henbinchang@gmail.com>>
Date: Monday, March 25, 2019 at 6:02 PM
To: Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>>
Cc: James Feist <james.feist@linux.intel.com<mailto:james.feist@linux.intel.com>>, OpenBMC Maillist <openbmc@lists.ozlabs.org<mailto:openbmc@lists.ozlabs.org>>
Subject: Re: Some problems about FruDevice in the entity-manager

Hi Vijay,
Currently, I bypass the 8/16bit checking to try dbus-sensor.

I just followed your suggestion and only changed the one line.
But I couldn't find the fru device under the tree of /xyz/openbmc_project/FruDevice/

There was the below error message in the journal.
Mar 26 08:17:56 henbin fru-device[1111]: failed to format fru for device at bus 6address 50

Please let me know if you want to try other.

BRs.
Henbin.

Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>> 於 2019年3月26日 週二 上午7:05寫道:
Hi Henbin,
I am assuming your device is 16 bit and in your last email you said 16bit check is failing. If that check fails then following code will not get executed. Also while loop is same as i2c_smbus_read_i2c_block_data().

I would suggest one thing, if your 16bit check is passing and still you don’t see fru device, please make only one line change below and test.
    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);

Please let me know result.

Regards
-Vijay


From: Henbin Chang <henbinchang@gmail.com<mailto:henbinchang@gmail.com>>
Date: Sunday, March 24, 2019 at 6:39 PM
To: Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>>
Cc: James Feist <james.feist@linux.intel.com<mailto:james.feist@linux.intel.com>>, OpenBMC Maillist <openbmc@lists.ozlabs.org<mailto:openbmc@lists.ozlabs.org>>
Subject: Re: Some problems about FruDevice in the entity-manager

Thanks for your response.

I also encountered another problem.

That's,  I found the content of 16-bit EEPROM through the combination of the SMBUS APIs was not incorrect.

    /* This is for 16 bit addressing EEPROM device. First an offset
     * needs to be written before read data from a offset
     */
    int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }

    return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);

So I referred to i2c-tools to modify them.
And then I could see my FRU under the tree of 'xyz/openbmc_project/FruDevice/'

    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }
    while (index < len){
buf[index] = i2c_smbus_read_byte(file);
index++;
    }

    //return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
    return len;

Let me know if you have any comments.

Thanks.

[-- Attachment #2: Type: text/html, Size: 17240 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Some problems about FruDevice in the entity-manager
  2019-03-27 18:49               ` Vijay Khemka
@ 2019-03-29 18:14                 ` Vijay Khemka
  0 siblings, 0 replies; 10+ messages in thread
From: Vijay Khemka @ 2019-03-29 18:14 UTC (permalink / raw)
  To: Henbin Chang; +Cc: OpenBMC Maillist, James Feist

[-- Attachment #1: Type: text/plain, Size: 4405 bytes --]

Henbin,
Please see patch in gerrit.
https://gerrit.openbmc-project.xyz/#/c/openbmc/entity-manager/+/18783/

Regards
-Vijay

From: openbmc <openbmc-bounces+vijaykhemka=fb.com@lists.ozlabs.org> on behalf of Vijay Khemka <vijaykhemka@fb.com>
Date: Wednesday, March 27, 2019 at 12:32 PM
To: Henbin Chang <henbinchang@gmail.com>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>, James Feist <james.feist@linux.intel.com>
Subject: [Potential Spoof] Re: Some problems about FruDevice in the entity-manager

Henbin,
We are making some upgrade to that patch, will send you soon.

Regards
-Vijay

From: Henbin Chang <henbinchang@gmail.com>
Date: Tuesday, March 26, 2019 at 11:33 PM
To: Vijay Khemka <vijaykhemka@fb.com>
Cc: James Feist <james.feist@linux.intel.com>, OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: Some problems about FruDevice in the entity-manager

Thanks Vijay.

We expect the patch for direct reading from sysfs you said before.



BRs,
Henbin.

Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>> 於 2019年3月27日 週三 上午2:44寫道:
Hi Henbin,
If you are by passing this check then you have to be careful in changing code. None of below changes are required. I can’t say without debugging, why your fru device is not getting scanned properly. Please hexdump your eeprom device through sys file system and verify if it has right data.

Regards
-Vijay

From: Henbin Chang <henbinchang@gmail.com<mailto:henbinchang@gmail.com>>
Date: Monday, March 25, 2019 at 6:02 PM
To: Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>>
Cc: James Feist <james.feist@linux.intel.com<mailto:james.feist@linux.intel.com>>, OpenBMC Maillist <openbmc@lists.ozlabs.org<mailto:openbmc@lists.ozlabs.org>>
Subject: Re: Some problems about FruDevice in the entity-manager

Hi Vijay,
Currently, I bypass the 8/16bit checking to try dbus-sensor.

I just followed your suggestion and only changed the one line.
But I couldn't find the fru device under the tree of /xyz/openbmc_project/FruDevice/

There was the below error message in the journal.
Mar 26 08:17:56 henbin fru-device[1111]: failed to format fru for device at bus 6address 50

Please let me know if you want to try other.

BRs.
Henbin.

Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>> 於 2019年3月26日 週二 上午7:05寫道:
Hi Henbin,
I am assuming your device is 16 bit and in your last email you said 16bit check is failing. If that check fails then following code will not get executed. Also while loop is same as i2c_smbus_read_i2c_block_data().

I would suggest one thing, if your 16bit check is passing and still you don’t see fru device, please make only one line change below and test.
    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);

Please let me know result.

Regards
-Vijay


From: Henbin Chang <henbinchang@gmail.com<mailto:henbinchang@gmail.com>>
Date: Sunday, March 24, 2019 at 6:39 PM
To: Vijay Khemka <vijaykhemka@fb.com<mailto:vijaykhemka@fb.com>>
Cc: James Feist <james.feist@linux.intel.com<mailto:james.feist@linux.intel.com>>, OpenBMC Maillist <openbmc@lists.ozlabs.org<mailto:openbmc@lists.ozlabs.org>>
Subject: Re: Some problems about FruDevice in the entity-manager

Thanks for your response.

I also encountered another problem.

That's,  I found the content of 16-bit EEPROM through the combination of the SMBUS APIs was not incorrect.

    /* This is for 16 bit addressing EEPROM device. First an offset
     * needs to be written before read data from a offset
     */
    int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }

    return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);

So I referred to i2c-tools to modify them.
And then I could see my FRU under the tree of 'xyz/openbmc_project/FruDevice/'

    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }
    while (index < len){
buf[index] = i2c_smbus_read_byte(file);
index++;
    }

    //return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
    return len;

Let me know if you have any comments.

Thanks.

[-- Attachment #2: Type: text/html, Size: 18626 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-03-29 18:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22  5:41 Some problems about FruDevice in the entity-manager Henbin Chang
2019-03-22 15:54 ` James Feist
2019-03-22 18:10   ` Vijay Khemka
2019-03-25  1:39     ` Henbin Chang
2019-03-25 23:05       ` Vijay Khemka
2019-03-26  1:01         ` Henbin Chang
2019-03-26 18:44           ` Vijay Khemka
2019-03-27  6:33             ` Henbin Chang
2019-03-27 18:49               ` Vijay Khemka
2019-03-29 18:14                 ` Vijay Khemka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.