[{"id":1779484,"web_url":"http://patchwork.ozlabs.org/comment/1779484/","msgid":"<1e473b53-f031-fa86-9c2d-5b4c8bba8a28@skidata.com>","list_archive_url":null,"date":"2017-10-04T07:27:14","subject":"Re: [PATCH 2/9 v2] usb: usb251xb: Add USB251x specific port count\n\tsetting","submitter":{"id":70889,"url":"http://patchwork.ozlabs.org/api/people/70889/","name":"Richard Leitner","email":"richard.leitner@skidata.com"},"content":"On 09/16/2017 12:42 PM, Serge Semin wrote:\n> USB251xb as well as USB2517 datasheet states, that all these\n> hubs differ by number of ports declared as the last digit in the\n> model name. So USB2512 got two ports, USB2513 - three, and so on.\n> Such setting must be reflected in the device specific data\n> structure and corresponding dts property should be checked whether\n> it doesn't get out of available ports.\n> \n> Signed-off-by: Serge Semin <fancer.lancer@gmail.com>\n> ---\n>  drivers/usb/misc/usb251xb.c | 21 ++++++++++++++++++---\n>  1 file changed, 18 insertions(+), 3 deletions(-)\n> \n> diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c\n> index 96a8c20ac..5cb0e5570 100644\n> --- a/drivers/usb/misc/usb251xb.c\n> +++ b/drivers/usb/misc/usb251xb.c\n\n...\n\n>  \n> @@ -422,8 +431,10 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,\n>  \t\tfor (i = 0; i < len / sizeof(u32); i++) {\n>  \t\t\tu32 port = be32_to_cpu(cproperty_u32[i]);\n>  \n> -\t\t\tif ((port >= 1) && (port <= 4))\n> +\t\t\tif ((port >= 1) && (port <= data->port_cnt))\n>  \t\t\t\thub->non_rem_dev |= BIT(port);\n> +\t\t\telse\n> +\t\t\t\tdev_warn(dev, \"port %u doesn't exist\\n\", port);\n\nI'd prefer to add the (invalid) property trying to be set in this\nwarning messages. So someone is able to find the invalid dt setting\nfaster. Something like;\n\n\tdev_warn(dev, \"requested NRD port %u doesn't exist\\n\", port);\n\n>  \t\t}\n>  \t}\n>  \n> @@ -433,8 +444,10 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,\n>  \t\tfor (i = 0; i < len / sizeof(u32); i++) {\n>  \t\t\tu32 port = be32_to_cpu(cproperty_u32[i]);\n>  \n> -\t\t\tif ((port >= 1) && (port <= 4))\n> +\t\t\tif ((port >= 1) && (port <= data->port_cnt))\n>  \t\t\t\thub->port_disable_sp |= BIT(port);\n> +\t\t\telse\n> +\t\t\t\tdev_warn(dev, \"port %u doesn't exist\\n\", port);\n\n... same as above. For example:\n\n\tdev_warn(dev, \"requested PDS port %u doesn't exist\\n\", port);\n\n>  \t\t}\n>  \t}\n>  \n> @@ -444,8 +457,10 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,\n>  \t\tfor (i = 0; i < len / sizeof(u32); i++) {\n>  \t\t\tu32 port = be32_to_cpu(cproperty_u32[i]);\n>  \n> -\t\t\tif ((port >= 1) && (port <= 4))\n> +\t\t\tif ((port >= 1) && (port <= data->port_cnt))\n>  \t\t\t\thub->port_disable_bp |= BIT(port);\n> +\t\t\telse\n> +\t\t\t\tdev_warn(dev, \"port %u doesn't exist\\n\", port);\n\n... same as above. For example:\n\n\tdev_warn(dev, \"requested PDB port %u doesn't exist\\n\", port);\n\n\nApart from that this patch looks fine for me. Thanks for the spot of the\nhardcoded max ports check.\n\nregards,\nRichard.L\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y6SRJ1t7kz9sxR\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tWed,  4 Oct 2017 18:37:32 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751315AbdJDHha (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tWed, 4 Oct 2017 03:37:30 -0400","from mail1.skidata.com ([91.230.2.99]:43186 \"EHLO\n\tmail1.skidata.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751047AbdJDHha (ORCPT <rfc822;devicetree@vger.kernel.org>);\n\tWed, 4 Oct 2017 03:37:30 -0400"],"X-Greylist":"delayed 598 seconds by postgrey-1.27 at vger.kernel.org;\n\tWed, 04 Oct 2017 03:37:29 EDT","X-IronPort-AV":"E=Sophos;i=\"5.42,476,1500933600\"; d=\"scan'208\";a=\"6403056\"","Subject":"Re: [PATCH 2/9 v2] usb: usb251xb: Add USB251x specific port count\n\tsetting","To":"Serge Semin <fancer.lancer@gmail.com>,\n\t<gregkh@linuxfoundation.org>, <robh+dt@kernel.org>,\n\t<mark.rutland@arm.com>","CC":"<Sergey.Semin@t-platforms.ru>, <linux-usb@vger.kernel.org>,\n\t<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,\n\tRichard Leitner <richard.leitner@skidata.com>","References":"<20170915233113.17855-1-fancer.lancer@gmail.com>\n\t<20170916104220.3742-1-fancer.lancer@gmail.com>\n\t<20170916104220.3742-3-fancer.lancer@gmail.com>","From":"Richard Leitner <richard.leitner@skidata.com>","Message-ID":"<1e473b53-f031-fa86-9c2d-5b4c8bba8a28@skidata.com>","Date":"Wed, 4 Oct 2017 09:27:14 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170916104220.3742-3-fancer.lancer@gmail.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-Originating-IP":"[172.16.60.30]","X-ClientProxiedBy":"sdex1srv.skidata.net (172.16.10.92) To\n\tsdex1srv.skidata.net (172.16.10.92)","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1779490,"web_url":"http://patchwork.ozlabs.org/comment/1779490/","msgid":"<2ad7bb5b-d8cb-65f3-7b03-be5972d7acd3@skidata.com>","list_archive_url":null,"date":"2017-10-04T07:51:01","subject":"Re: [PATCH 3/9 v2] usb: usb251xb: Add 5, 6,\n\t7 ports mapping def setting","submitter":{"id":70889,"url":"http://patchwork.ozlabs.org/api/people/70889/","name":"Richard Leitner","email":"richard.leitner@skidata.com"},"content":"On 09/16/2017 12:42 PM, Serge Semin wrote:\n> USB2517 got three additionl downstream ports, which can\n> as well be mapped to another logical ports. USB2551xb driver\n\ntypo in \"USB251xb\"\n\n> currently doesn't fully support such setting configuration\n> from dts file. This patch doesn't change this, but adds\n> usb2517 spcific ports default liner mapping.\n> \n> Signed-off-by: Serge Semin <fancer.lancer@gmail.com>\n> ---\n>  drivers/usb/misc/usb251xb.c | 12 +++++++++++-\n>  1 file changed, 11 insertions(+), 1 deletion(-)\n> \n\nCode itself looks good to me, therefore feel free to add:\n\nAcked-by: Richard Leitner <richard.leitner@skidata.com>\n\nregards,\nRichard.L\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y6SlG11JPz9s4q\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tWed,  4 Oct 2017 18:51:22 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751613AbdJDHvH (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tWed, 4 Oct 2017 03:51:07 -0400","from mail1.skidata.com ([91.230.2.99]:4881 \"EHLO mail1.skidata.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751297AbdJDHvF (ORCPT <rfc822;devicetree@vger.kernel.org>);\n\tWed, 4 Oct 2017 03:51:05 -0400"],"X-IronPort-AV":"E=Sophos;i=\"5.42,476,1500933600\"; d=\"scan'208\";a=\"6403638\"","Subject":"Re: [PATCH 3/9 v2] usb: usb251xb: Add 5, 6,\n\t7 ports mapping def setting","To":"Serge Semin <fancer.lancer@gmail.com>,\n\t<gregkh@linuxfoundation.org>, <robh+dt@kernel.org>,\n\t<mark.rutland@arm.com>","CC":"<Sergey.Semin@t-platforms.ru>, <linux-usb@vger.kernel.org>,\n\t<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,\n\tRichard Leitner <richard.leitner@skidata.com>","References":"<20170915233113.17855-1-fancer.lancer@gmail.com>\n\t<20170916104220.3742-1-fancer.lancer@gmail.com>\n\t<20170916104220.3742-4-fancer.lancer@gmail.com>","From":"Richard Leitner <richard.leitner@skidata.com>","Message-ID":"<2ad7bb5b-d8cb-65f3-7b03-be5972d7acd3@skidata.com>","Date":"Wed, 4 Oct 2017 09:51:01 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170916104220.3742-4-fancer.lancer@gmail.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-Originating-IP":"[172.16.60.30]","X-ClientProxiedBy":"sdex1srv.skidata.net (172.16.10.92) To\n\tsdex1srv.skidata.net (172.16.10.92)","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}},{"id":1779493,"web_url":"http://patchwork.ozlabs.org/comment/1779493/","msgid":"<bd49be97-2d63-8f70-b57b-14ae9ada45e4@skidata.com>","list_archive_url":null,"date":"2017-10-04T07:57:36","subject":"Re: [PATCH 4/9 v2] usb: usb251xb: Add 5,6,7 ports boost settings","submitter":{"id":70889,"url":"http://patchwork.ozlabs.org/api/people/70889/","name":"Richard Leitner","email":"richard.leitner@skidata.com"},"content":"On 09/16/2017 12:42 PM, Serge Semin wrote:\n> USB electrical signaling drive strength boost bit is also supported\n> by USB2517 hub. Since it got three addition ports, the designers\n> needed to add one more register for initialization. It turned out\n> to be formerly reserved 0xF7. As before we just initialize it with\n> default zeros.\n> \n> Signed-off-by: Serge Semin <fancer.lancer@gmail.com>\n> ---\n>  drivers/usb/misc/usb251xb.c | 15 ++++++++++-----\n>  1 file changed, 10 insertions(+), 5 deletions(-)\n> \n\nLooks good to me. Feel free to add:\n\nAcked-by: Richard Leitner <richard.leitner@skidata.com>\n\nregards,\nRichard.L\n--\nTo unsubscribe from this list: send the line \"unsubscribe devicetree\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<devicetree-owner@vger.kernel.org>","X-Original-To":"incoming-dt@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-dt@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=devicetree-owner@vger.kernel.org; receiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y6StY5zWhz9t16\n\tfor <incoming-dt@patchwork.ozlabs.org>;\n\tWed,  4 Oct 2017 18:57:41 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751388AbdJDH5k (ORCPT\n\t<rfc822;incoming-dt@patchwork.ozlabs.org>);\n\tWed, 4 Oct 2017 03:57:40 -0400","from mail1.skidata.com ([91.230.2.99]:42481 \"EHLO\n\tmail1.skidata.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751330AbdJDH5j (ORCPT <rfc822;devicetree@vger.kernel.org>);\n\tWed, 4 Oct 2017 03:57:39 -0400"],"X-IronPort-AV":"E=Sophos;i=\"5.42,476,1500933600\"; d=\"scan'208\";a=\"6403799\"","Subject":"Re: [PATCH 4/9 v2] usb: usb251xb: Add 5,6,7 ports boost settings","To":"Serge Semin <fancer.lancer@gmail.com>,\n\t<gregkh@linuxfoundation.org>, <robh+dt@kernel.org>,\n\t<mark.rutland@arm.com>","CC":"<Sergey.Semin@t-platforms.ru>, <linux-usb@vger.kernel.org>,\n\t<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,\n\tRichard Leitner <richard.leitner@skidata.com>","References":"<20170915233113.17855-1-fancer.lancer@gmail.com>\n\t<20170916104220.3742-1-fancer.lancer@gmail.com>\n\t<20170916104220.3742-5-fancer.lancer@gmail.com>","From":"Richard Leitner <richard.leitner@skidata.com>","Message-ID":"<bd49be97-2d63-8f70-b57b-14ae9ada45e4@skidata.com>","Date":"Wed, 4 Oct 2017 09:57:36 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170916104220.3742-5-fancer.lancer@gmail.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Originating-IP":"[172.16.60.30]","X-ClientProxiedBy":"sdex1srv.skidata.net (172.16.10.92) To\n\tsdex1srv.skidata.net (172.16.10.92)","Sender":"devicetree-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<devicetree.vger.kernel.org>","X-Mailing-List":"devicetree@vger.kernel.org"}}]