[{"id":1761462,"web_url":"http://patchwork.ozlabs.org/comment/1761462/","msgid":"<CAOSf1CEY7gNR4aCA3PKZ0zFqS6W8TU9HY26ENvJAnSX_DXcBPQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-01T04:17:41","subject":"Re: [Skiboot] [PATCH v2 5/5] hdata/i2c: add support to the i2c\n\tarray version 2","submitter":{"id":68108,"url":"http://patchwork.ozlabs.org/api/people/68108/","name":"Oliver O'Halloran","email":"oohall@gmail.com"},"content":"On Thu, Aug 31, 2017 at 5:12 PM, Claudio Carvalho\n<cclaudio@linux.vnet.ibm.com> wrote:\n> This adds the description field to the i2c array, as specified in the i2c\n> array version 2.\n>\n> When the description field is populated, we should be able to get the\n> description (name, compat and label) of new i2c devices from it, instead\n> of having to input these information manually in the list of known i2c\n> devices.\n>\n> Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>\n> ---\n>  hdata/i2c.c | 8 +++-----\n>  1 file changed, 3 insertions(+), 5 deletions(-)\n>\n> diff --git a/hdata/i2c.c b/hdata/i2c.c\n> index 8a2e392..c365a92 100644\n> --- a/hdata/i2c.c\n> +++ b/hdata/i2c.c\n> @@ -22,6 +22,7 @@ struct i2c_dev {\n>         __be32 purpose;\n>         __be32 i2c_link;\n>         __be16 slca_index;\n> +       char desc[64];\n>  };\n>\n>  #define P9_I2CM_XSCOM_SIZE 0x1000\n> @@ -202,11 +203,8 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,\n>                 version = be32_to_cpu(ahdr->version);\n>         }\n>\n> -       if (version == 2) {\n> -               prerror(\"I2C: v%d found, but not supported. Parsing as v1\\n\",\n> -                       version);\n> -       } else if (version > 2) {\n> -               prerror(\"I2C: v%d found, but not supported! THIS IS A BUG\\n\",\n> +       if (version != 1 && version != 2) {\n> +               prerror(\"I2C: HDAT version %d not supported! THIS IS A BUG\\n\",\n>                         version);\n>                 return -1;\n>         }\n> --\n> 2.7.4\n>\n\nNAK\n\nI added that error in the first place since the spec for the v2\nstrings  hadn't been finalised and I didn't want it going off into the\nweeds if something changed. In hindsight this was a mistake since the\nV2 format only extends the V1 format so parsing it as V1 is always\ngoing to work.  This has (almost) always been the case with HDAT so\nthere's no need to make this a hard error.\n\nI'd just drop this patch until we have support for parsing the\ndescription strings (and they're actually populated).\n\nOliver","headers":{"Return-Path":"<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","skiboot@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","skiboot@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xk5Z84LdCz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 14:17:52 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xk5Z81fmZzDqfx\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 14:17:52 +1000 (AEST)","from mail-qt0-x244.google.com (mail-qt0-x244.google.com\n\t[IPv6:2607:f8b0:400d:c0d::244])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xk5Z022NpzDqYb\n\tfor <skiboot@lists.ozlabs.org>; Fri,  1 Sep 2017 14:17:44 +1000 (AEST)","by mail-qt0-x244.google.com with SMTP id v20so1161311qtg.1\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 21:17:44 -0700 (PDT)","by 10.140.21.10 with HTTP; Thu, 31 Aug 2017 21:17:41 -0700 (PDT)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"KefAaBw9\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"KefAaBw9\"; dkim-atps=neutral","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"KefAaBw9\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=RAjSYbWtBkubMyZ+LyqKBqThYSCIRum7ALq4mLAoDqs=;\n\tb=KefAaBw9m/FyIWp8DAqVOADn9ooc3rG++5Pv+yEHi5WR6hmmesNR0/PALAlU7o6Zz3\n\tSh+8AoYtmUHhYhGaLq59pW0AhM77lmHOaVW6Zg1vPlQcCYj8kRwkPV6j5aY1hAKMrKa3\n\t0wREubdTmggFSOackbULEhfMZSfzXRMz/ss+uQRt0RoMFVG/VC4BvEiF6u8XXGwKjdcN\n\tQ5y6Ej3kmtCEJMgNMjestz9n5Ek39IeLLeEHkcLmKSfUDagbmsCHfUDMU00MeQxNi83a\n\to5v5vXNMA3Lr6eO9hdr3/ZncDw+ap4YglXznORli8DBk+bTJsKVJuDfjPR2aAi9NRQS7\n\tq1uA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=RAjSYbWtBkubMyZ+LyqKBqThYSCIRum7ALq4mLAoDqs=;\n\tb=P2vh5kT73IPFdtq6NFrxRRb9TOkxMijHgPeWpKjQRqywzolHRnzI95yFUz7zpuCe5M\n\tQlRHcXuIB1bOr/Z7YWW9rd90w5Qhik/2zKngzIseDlIxjFt0+lFrJWK34aEmV7pz64On\n\tR7HfNyFxsvscTJRZz4eX3OSrWpfB4E23fn8Z3x48qkTon1EDMkPQjb0GGLP5ccaw2NdV\n\tnhtJPPcRjYajw5INTQZlr8fu4fiNFOFqGAFpaonoWgQQTnCGtmDKwviFSFAreeEGOk54\n\t6k+i0NI/Y+gBQfxUaB06/thZtpsfMKVSCr7oaWDQRHwmBU+kYKqfDXFw1TmFF0yV1mq/\n\tUQSA==","X-Gm-Message-State":"AHPjjUjqjQS8mv5+VP29YWDSN5tuqkMn8Qu9ib4qMpIVUIND2UDw6qz2\n\tZFQH7zPVJqYO1dHrOFgt1Udg4i2zgA==","X-Google-Smtp-Source":"ADKCNb7qznoX+Su/4gMIgZfTArKKnZ/m6gG20Xvz1KsQQMshO2SAqwzqJ/LhBdmNO2uVWVinB43JBtUwBLIgDC6kD/A=","X-Received":"by 10.200.43.68 with SMTP id 4mr976924qtv.281.1504239461894; Thu,\n\t31 Aug 2017 21:17:41 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1504163557-14432-6-git-send-email-cclaudio@linux.vnet.ibm.com>","References":"<1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com>\n\t<1504163557-14432-6-git-send-email-cclaudio@linux.vnet.ibm.com>","From":"Oliver <oohall@gmail.com>","Date":"Fri, 1 Sep 2017 14:17:41 +1000","Message-ID":"<CAOSf1CEY7gNR4aCA3PKZ0zFqS6W8TU9HY26ENvJAnSX_DXcBPQ@mail.gmail.com>","To":"Claudio Carvalho <cclaudio@linux.vnet.ibm.com>","Subject":"Re: [Skiboot] [PATCH v2 5/5] hdata/i2c: add support to the i2c\n\tarray version 2","X-BeenThere":"skiboot@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Mailing list for skiboot development <skiboot.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/skiboot/>","List-Post":"<mailto:skiboot@lists.ozlabs.org>","List-Help":"<mailto:skiboot-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=subscribe>","Cc":"skiboot list <skiboot@lists.ozlabs.org>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"Skiboot\"\n\t<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"}},{"id":1762711,"web_url":"http://patchwork.ozlabs.org/comment/1762711/","msgid":"<a9d2699c-02ed-46fa-9c9a-fa1cdaf9cf05@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-04T14:53:20","subject":"Re: [Skiboot] [PATCH v2 5/5] hdata/i2c: add support to the i2c\n\tarray version 2","submitter":{"id":69305,"url":"http://patchwork.ozlabs.org/api/people/69305/","name":"Claudio Carvalho","email":"cclaudio@linux.vnet.ibm.com"},"content":"On 01/09/2017 01:17, Oliver wrote:\n> On Thu, Aug 31, 2017 at 5:12 PM, Claudio Carvalho\n> <cclaudio@linux.vnet.ibm.com> wrote:\n>> This adds the description field to the i2c array, as specified in the i2c\n>> array version 2.\n>>\n>> When the description field is populated, we should be able to get the\n>> description (name, compat and label) of new i2c devices from it, instead\n>> of having to input these information manually in the list of known i2c\n>> devices.\n>>\n>> Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>\n>> ---\n>>   hdata/i2c.c | 8 +++-----\n>>   1 file changed, 3 insertions(+), 5 deletions(-)\n>>\n>> diff --git a/hdata/i2c.c b/hdata/i2c.c\n>> index 8a2e392..c365a92 100644\n>> --- a/hdata/i2c.c\n>> +++ b/hdata/i2c.c\n>> @@ -22,6 +22,7 @@ struct i2c_dev {\n>>          __be32 purpose;\n>>          __be32 i2c_link;\n>>          __be16 slca_index;\n>> +       char desc[64];\n>>   };\n>>\n>>   #define P9_I2CM_XSCOM_SIZE 0x1000\n>> @@ -202,11 +203,8 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,\n>>                  version = be32_to_cpu(ahdr->version);\n>>          }\n>>\n>> -       if (version == 2) {\n>> -               prerror(\"I2C: v%d found, but not supported. Parsing as v1\\n\",\n>> -                       version);\n>> -       } else if (version > 2) {\n>> -               prerror(\"I2C: v%d found, but not supported! THIS IS A BUG\\n\",\n>> +       if (version != 1 && version != 2) {\n>> +               prerror(\"I2C: HDAT version %d not supported! THIS IS A BUG\\n\",\n>>                          version);\n>>                  return -1;\n>>          }\n>> --\n>> 2.7.4\n>>\n> NAK\n>\n> I added that error in the first place since the spec for the v2\n> strings  hadn't been finalised and I didn't want it going off into the\n> weeds if something changed. In hindsight this was a mistake since the\n> V2 format only extends the V1 format so parsing it as V1 is always\n> going to work.  This has (almost) always been the case with HDAT so\n> there's no need to make this a hard error.\n>\n> I'd just drop this patch until we have support for parsing the\n> description strings (and they're actually populated).\n>\n> Oliver\n>\n\nYeah, makes sense. We can drop this patch for now.","headers":{"Return-Path":"<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","skiboot@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","skiboot@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmCXK2Kgxz9t2R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 00:53:37 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xmCXK1PsTzDqnr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 00:53:37 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xmCXC0gJgzDqbd\n\tfor <skiboot@lists.ozlabs.org>; Tue,  5 Sep 2017 00:53:30 +1000 (AEST)","from pps.filterd (m0098417.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv84EnDJE062554\n\tfor <skiboot@lists.ozlabs.org>; Mon, 4 Sep 2017 10:53:28 -0400","from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cs8rsgs3q-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <skiboot@lists.ozlabs.org>; Mon, 04 Sep 2017 10:53:28 -0400","from localhost\n\tby e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <skiboot@lists.ozlabs.org> from <cclaudio@linux.vnet.ibm.com>;\n\tMon, 4 Sep 2017 08:53:27 -0600","from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19)\n\tby e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tMon, 4 Sep 2017 08:53:25 -0600","from b03ledav006.gho.boulder.ibm.com\n\t(b03ledav006.gho.boulder.ibm.com [9.17.130.237])\n\tby b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v84ErPwm65667208; Mon, 4 Sep 2017 07:53:25 -0700","from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id E7D2EC6043;\n\tMon,  4 Sep 2017 08:53:24 -0600 (MDT)","from [9.80.192.82] (unknown [9.80.192.82])\n\tby b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id ED14BC603E;\n\tMon,  4 Sep 2017 08:53:23 -0600 (MDT)"],"Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=cclaudio@linux.vnet.ibm.com; receiver=<UNKNOWN>)","To":"Oliver <oohall@gmail.com>","References":"<1504163557-14432-1-git-send-email-cclaudio@linux.vnet.ibm.com>\n\t<1504163557-14432-6-git-send-email-cclaudio@linux.vnet.ibm.com>\n\t<CAOSf1CEY7gNR4aCA3PKZ0zFqS6W8TU9HY26ENvJAnSX_DXcBPQ@mail.gmail.com>","From":"Claudio Carvalho <cclaudio@linux.vnet.ibm.com>","Date":"Mon, 4 Sep 2017 11:53:20 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<CAOSf1CEY7gNR4aCA3PKZ0zFqS6W8TU9HY26ENvJAnSX_DXcBPQ@mail.gmail.com>","Content-Language":"en-US","X-TM-AS-GCONF":"00","x-cbid":"17090414-8235-0000-0000-00000C37D82F","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007665; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00912155; UDB=6.00457684;\n\tIPR=6.00692418; \n\tBA=6.00005569; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016998;\n\tXFM=3.00000015; UTC=2017-09-04 14:53:26","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17090414-8236-0000-0000-00003D81F41C","Message-Id":"<a9d2699c-02ed-46fa-9c9a-fa1cdaf9cf05@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-04_09:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709040238","Subject":"Re: [Skiboot] [PATCH v2 5/5] hdata/i2c: add support to the i2c\n\tarray version 2","X-BeenThere":"skiboot@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Mailing list for skiboot development <skiboot.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/skiboot/>","List-Post":"<mailto:skiboot@lists.ozlabs.org>","List-Help":"<mailto:skiboot-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=subscribe>","Cc":"skiboot list <skiboot@lists.ozlabs.org>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"Skiboot\"\n\t<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"}}]