From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::830; helo=mail-qt1-x830.google.com; envelope-from=henbinchang@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nLgbWrE2"; dkim-atps=neutral Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44TdVt5CN9zDqKg for ; Wed, 27 Mar 2019 17:33:40 +1100 (AEDT) Received: by mail-qt1-x830.google.com with SMTP id p20so17555693qtc.9 for ; Tue, 26 Mar 2019 23:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0OxpcGZ1PP526PVQyEXa8EaVMKhxTrD6BKH12rwQ3f8=; b=nLgbWrE2pX9/8TR2QqpVKnamkd2G3XrmbnImRlCwT/5b5dRQVeJ2x5KiREuhsdWfcI wwiqqDRZVlYDUDLOFg/J4rfwmoKNmKv4sUqk5QRSnDJWVrFlwsmpbuLI7xaepNZld5oI gp3JfF7Ikcq90ex3GTs/nRUp+uJvC8n0zhevdu8TtNgIg5ce6YaavsbyEyOpg5xSF7bU AYPXpPxgtmHvFN18yr8atcIrMV3+b2zAEB2Muak5UnTKInjNGMVoocHOKdYYzMmUHxq/ gZtpGbVcsYBvDgnZFik2bVyUBUt6UwC5IsPKVa+hEAMmLg7vBc9D2UvWv8/3Kg3CYPSQ Oaug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0OxpcGZ1PP526PVQyEXa8EaVMKhxTrD6BKH12rwQ3f8=; b=OHABZQCXRHdRXJVfpuCVRVoZB09OCFROo14RJGaF/ZN+3XLtA4ZpbQjyCWpPKh5hWI 2k4cEPMB93pXON7FIIe8uCOmsu929/8zacrzLYh8bL7qTEcy9cSuPsEL7DB5qc0P0Hvv /ZwUt50pJJclvBfpTwvtEr6OAunD6GWn52AE8/s+p4BD890XcoZBpCkakLnUPmx2cESH p4x0QVcRXrBaR8QBpXKUt/JnQgMyYcvNsJjF9UDIhzaFujWUrardBht7EIcKk79kMVin Zzz4iudwGWZdKzAeU1D6HbDa2YZ5UAwhyquizdDW+g07a6K+8fxxKR7tcDy9IfBiiDgJ 1/dQ== X-Gm-Message-State: APjAAAUlCfh6wAyJ3Osh3wySJMCLpo5gjQCgpNB6sIPhd4gzYb0cfqFd /bK8JAUXS/9PUSOdCq+fDQmhUOjfipP0/VKdXWM8WOlv X-Google-Smtp-Source: APXvYqygaKwT/X/0nyaTxnVVF9ezIyDgPfBzj6pjQe2LJJesGn45cWfgeppaf3JrmAtIyyOMr83v1oyCOsovVlScpms= X-Received: by 2002:ac8:72d3:: with SMTP id o19mr29815080qtp.274.1553668416441; Tue, 26 Mar 2019 23:33:36 -0700 (PDT) MIME-Version: 1.0 References: <740E00DF-F233-41A1-B894-9DB98A9AD62A@fb.com> <2B1545B0-29CC-4E8C-85B5-317A2E5AD5D9@fb.com> <0B090F23-9C2C-4B7A-B59A-206C6236E816@fb.com> In-Reply-To: <0B090F23-9C2C-4B7A-B59A-206C6236E816@fb.com> From: Henbin Chang Date: Wed, 27 Mar 2019 14:33:25 +0800 Message-ID: Subject: Re: Some problems about FruDevice in the entity-manager To: Vijay Khemka Cc: James Feist , OpenBMC Maillist Content-Type: multipart/alternative; boundary="0000000000000f8fba05850d9ec1" X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Mar 2019 06:33:43 -0000 --0000000000000f8fba05850d9ec1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Vijay. We expect the patch for direct reading from sysfs you said before. BRs, Henbin. Vijay Khemka =E6=96=BC 2019=E5=B9=B43=E6=9C=8827=E6=97= =A5 =E9=80=B1=E4=B8=89 =E4=B8=8A=E5=8D=882:44=E5=AF=AB=E9=81=93=EF=BC=9A > 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=E2=80=99t say without deb= ugging, > 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 > *Date: *Monday, March 25, 2019 at 6:02 PM > *To: *Vijay Khemka > *Cc: *James Feist , 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 =E6=96=BC 2019=E5=B9=B43=E6=9C=8826=E6= =97=A5 =E9=80=B1=E4=BA=8C =E4=B8=8A=E5=8D=887:05=E5=AF=AB=E9=81=93=EF=BC=9A > > 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=E2=80=99t see fru device, please make only one line change below and = test. > > int ret =3D i2c_smbus_write_byte_data(file, high_addr, low_addr); > > //int ret =3D i2c_smbus_write_byte_data(file, 0, low_addr); > > > > Please let me know result. > > > > Regards > > -Vijay > > > > > > *From: *Henbin Chang > *Date: *Sunday, March 24, 2019 at 6:39 PM > *To: *Vijay Khemka > *Cc: *James Feist , 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 =3D 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 =3D i2c_smbus_write_byte_data(file, high_addr, low_addr); > > //int ret =3D i2c_smbus_write_byte_data(file, 0, low_addr); > > if (ret < 0) > > { > > return ret; > > } > > while (index < len){ > > buf[index] =3D 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. > > --0000000000000f8fba05850d9ec1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Vijay.

We expect the patch=C2=A0for direct reading from sys= fs=C2=A0you said before.

BRs,
Henbin.

Vijay Khemka <vijaykhemka@fb.com> =E6=96=BC 2019=E5= =B9=B43=E6=9C=8827=E6=97=A5 =E9=80=B1=E4=B8=89 =E4=B8=8A=E5=8D=882:44=E5=AF= =AB=E9=81=93=EF=BC=9A

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=E2=80= =99t say without debugging, why your fru device is not getting scanned prop= erly. Please hexdump your eeprom device through sys file system and verify if it has right data.

=C2=A0

Regards

-Vijay

=C2=A0

From: = Henbin Chang <henbinchang@gmail.co= m>
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<= /u>

=C2=A0

Hi Vijay,

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

=C2=A0

I just followed your suggestion and only changed the= one line.

But I couldn't find the fru device under the tre= e of /xyz/openbmc_project/FruDevice/

=C2=A0

There was the below error message in the journal.=

Mar 26 08:17:56 henbin fru-device[1111]: failed to f= ormat fru for device at bus 6address 50

=C2=A0

Please let me know if you want to try other.<= u>

=C2=A0

BRs.

Henbin.

=C2=A0

Vijay Khemka <vijaykhemka@fb.com> =E6=96=BC 2019=E5=B9=B43=E6=9C=8826=E6=97=A5 =E9=80=B1=E4=BA=8C= =E4=B8=8A=E5=8D=887:05=E5=AF=AB=E9=81=93=EF=BC=9A

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().

=C2=A0

I would suggest one thing, if your 16bit check is pa= ssing and still you don=E2=80=99t see fru device, please make only one line= change below and test.

=C2=A0 =C2=A0 int ret =3D i2c_smbus_write_byte_data(= file, high_addr, low_addr);

=C2=A0 =C2=A0 //int ret =3D i2c_smbus_write_byte_dat= a(file, 0, low_addr);

=C2=A0

Please let me know result.

=C2=A0

Regards

-Vijay

=C2=A0

=C2=A0

From: Henbin Chang <henbinchang@gmail.co= m>
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

=C2=A0

Thanks for your response.

=C2=A0

I also encountered another problem.

=C2=A0

That's,=C2=A0 I found the content of 16-bit EEPR= OM through the=C2=A0combination of the SMBUS APIs was not incorrect.=

=C2=A0

=C2=A0 =C2=A0 /* This is for 16 bit addressing EEPRO= M device. First an offset

=C2=A0 =C2=A0 =C2=A0* needs to be written before rea= d data from a offset

=C2=A0 =C2=A0 =C2=A0*/

=C2=A0 =C2=A0 int ret =3D i2c_smbus_write_byte_data(= file, 0, low_addr);

=C2=A0 =C2=A0 if (ret < 0)

=C2=A0 =C2=A0 {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 return ret;

=C2=A0 =C2=A0 }

=C2=A0

=C2=A0 =C2=A0 return i2c_smbus_read_i2c_block_data(f= ile, high_addr, len, buf);

=C2=A0

So I referred to i2c-tools to modify them.=C2=A0<= /u>

And then I could see my FRU under the tree of 'x= yz/openbmc_project/FruDevice/'

=C2=A0

=C2=A0 =C2=A0 int ret =3D i2c_smbus_write_byte_data(= file, high_addr, low_addr);

=C2=A0 =C2=A0 //int ret =3D i2c_smbus_write_byte_dat= a(file, 0, low_addr);

=C2=A0 =C2=A0 if (ret < 0)

=C2=A0 =C2=A0 {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 return ret;

=C2=A0 =C2=A0 }

=C2=A0 =C2=A0 while (index < len){<= /p>

buf[index] =3D i2c_smbus_read_byte(file);<= /u>

index++;

=C2=A0 =C2=A0 }

=C2=A0

=C2=A0 =C2=A0 //return i2c_smbus_read_i2c_block_data= (file, high_addr, len, buf);

=C2=A0 =C2=A0 return len;

=C2=A0

Let me know if you have any comments.<= /p>

=C2=A0

Thanks.

--0000000000000f8fba05850d9ec1--