[{"id":1759050,"web_url":"http://patchwork.ozlabs.org/comment/1759050/","msgid":"<20170829062031.hb3pwrnt5pohpr7l@tungsten.ozlabs.ibm.com>","date":"2017-08-29T06:20:31","subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","submitter":{"id":64137,"url":"http://patchwork.ozlabs.org/api/people/64137/","name":"Sam Bobroff","email":"sam.bobroff@au1.ibm.com"},"content":"On Mon, Aug 28, 2017 at 11:05:03AM -0500, Bryant G. Ly wrote:\n> For a PCI device it's pci_dn can be retrieved from\n> pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list.\n> Thus, we should just use the generic function pci_get_pdn_by_devfn\n> to get the pci_dn.\n> \n> Signed-off-by: Bryant G. Ly <bgly@us.ibm.com>\nReviewed-by: Sam Bobroff <sam.bobroff@au1.ibm.com>\n\nI don't know this area but I tested it using a patched kernel with the\nold and new code together. My test kernel booted fine (in QEMU+KVM) and\nI saw 26 reads and 4 writes, all of which got the same value with either\ncode block.\n\nI also checked that the error result in the \"not found\" case is the same\nas well, which it is, because rtas_{read,write}_config() will return\nPCIBIOS_DEVICE_NOT_FOUND if given a NULL pdn.\n\nSo, looks good to me.\n\nCheers,\nSam.\n\n> ---\n>  arch/powerpc/kernel/rtas_pci.c | 30 ++----------------------------\n>  1 file changed, 2 insertions(+), 28 deletions(-)\n> \n> diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c\n> index 73f1934..c21e6c5 100644\n> --- a/arch/powerpc/kernel/rtas_pci.c\n> +++ b/arch/powerpc/kernel/rtas_pci.c\n> @@ -91,25 +91,13 @@ static int rtas_pci_read_config(struct pci_bus *bus,\n>  \t\t\t\tunsigned int devfn,\n>  \t\t\t\tint where, int size, u32 *val)\n>  {\n> -\tstruct device_node *busdn, *dn;\n>  \tstruct pci_dn *pdn;\n> -\tbool found = false;\n>  \tint ret;\n>  \n>  \t/* Search only direct children of the bus */\n>  \t*val = 0xFFFFFFFF;\n> -\tbusdn = pci_bus_to_OF_node(bus);\n> -\tfor (dn = busdn->child; dn; dn = dn->sibling) {\n> -\t\tpdn = PCI_DN(dn);\n> -\t\tif (pdn && pdn->devfn == devfn\n> -\t\t    && of_device_is_available(dn)) {\n> -\t\t\tfound = true;\n> -\t\t\tbreak;\n> -\t\t}\n> -\t}\n>  \n> -\tif (!found)\n> -\t\treturn PCIBIOS_DEVICE_NOT_FOUND;\n> +\tpdn = pci_get_pdn_by_devfn(bus, devfn);\n>  \n>  \tret = rtas_read_config(pdn, where, size, val);\n>  \tif (*val == EEH_IO_ERROR_VALUE(size) &&\n> @@ -153,23 +141,9 @@ static int rtas_pci_write_config(struct pci_bus *bus,\n>  \t\t\t\t unsigned int devfn,\n>  \t\t\t\t int where, int size, u32 val)\n>  {\n> -\tstruct device_node *busdn, *dn;\n>  \tstruct pci_dn *pdn;\n> -\tbool found = false;\n> -\n> -\t/* Search only direct children of the bus */\n> -\tbusdn = pci_bus_to_OF_node(bus);\n> -\tfor (dn = busdn->child; dn; dn = dn->sibling) {\n> -\t\tpdn = PCI_DN(dn);\n> -\t\tif (pdn && pdn->devfn == devfn\n> -\t\t    && of_device_is_available(dn)) {\n> -\t\t\tfound = true;\n> -\t\t\tbreak;\n> -\t\t}\n> -\t}\n>  \n> -\tif (!found)\n> -\t\treturn PCIBIOS_DEVICE_NOT_FOUND;\n> +\tpdn = pci_get_pdn_by_devfn(bus, devfn);\n>  \n>  \treturn rtas_write_config(pdn, where, size, val);\n>  }\n> -- \n> 2.5.4 (Apple Git-61)","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@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 3xhJSb6vgtz9s4q\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 16:21:51 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhJSb64cTzDqjl\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 16:21:51 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\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 3xhJRH02SdzDqR9\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 29 Aug 2017 16:20:42 +1000 (AEST)","from pps.filterd (m0098396.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7T6JQnT069995\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 29 Aug 2017 02:20:40 -0400","from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cmvjf6kbg-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 29 Aug 2017 02:20:40 -0400","from localhost\n\tby e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <sam.bobroff@au1.ibm.com>;\n\tTue, 29 Aug 2017 16:20:37 +1000","from d23relay10.au.ibm.com (202.81.31.229)\n\tby e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tTue, 29 Aug 2017 16:20:35 +1000","from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119])\n\tby d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv7T6KYgU39321722\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 29 Aug 2017 16:20:34 +1000","from d23av05.au.ibm.com (localhost [127.0.0.1])\n\tby d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv7T6KY79010944\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 29 Aug 2017 16:20:34 +1000","from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14])\n\tby d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv7T6KXhB010908; Tue, 29 Aug 2017 16:20:33 +1000","from tungsten.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114])\n\t(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.au.ibm.com (Postfix) with ESMTPSA id DCA10A010B;\n\tTue, 29 Aug 2017 16:20:32 +1000 (AEST)"],"Date":"Tue, 29 Aug 2017 16:20:31 +1000","From":"Sam Bobroff <sam.bobroff@au1.ibm.com>","To":"\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com>","Subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","References":"<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>","User-Agent":"NeoMutt/20170113 (1.7.2)","X-TM-AS-MML":"disable","x-cbid":"17082906-0008-0000-0000-00000154A471","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17082906-0009-0000-0000-00000987A76C","Message-Id":"<20170829062031.hb3pwrnt5pohpr7l@tungsten.ozlabs.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-29_01:, , 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-1708290094","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"martin.petersen@oracle.com, paulus@samba.org,\n\t\"Bryant G. Ly\" <bgly@us.ibm.com>, linuxppc-dev@lists.ozlabs.org","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1759062,"web_url":"http://patchwork.ozlabs.org/comment/1759062/","msgid":"<87wp5m28br.fsf@concordia.ellerman.id.au>","date":"2017-08-29T06:31:52","subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","submitter":{"id":46580,"url":"http://patchwork.ozlabs.org/api/people/46580/","name":"Michael Ellerman","email":"mpe@ellerman.id.au"},"content":"Hi Bryant,\n\nThanks for the patch, a few comments/questions.\n\nHow have you tested this?\n\n\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com> writes:\n> For a PCI device it's pci_dn can be retrieved from\n> pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list.\n> Thus, we should just use the generic function pci_get_pdn_by_devfn\n> to get the pci_dn.\n\n\"generic\" means shared between architectures, which is not true for\npci_get_pdn_by_devfn(). \"existing\" would be more appropriate.\n\n> diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c\n> index 73f1934..c21e6c5 100644\n> --- a/arch/powerpc/kernel/rtas_pci.c\n> +++ b/arch/powerpc/kernel/rtas_pci.c\n> @@ -91,25 +91,13 @@ static int rtas_pci_read_config(struct pci_bus *bus,\n>  \t\t\t\tunsigned int devfn,\n>  \t\t\t\tint where, int size, u32 *val)\n>  {\n> -\tstruct device_node *busdn, *dn;\n>  \tstruct pci_dn *pdn;\n> -\tbool found = false;\n>  \tint ret;\n>  \n>  \t/* Search only direct children of the bus */\n\nYou kept the comment, but is it still true, and what does it apply to\nnow?\n\nAlso you removed the comment below in write, I'd expect it to either\nstay in both or be removed in both?\n\n>  \t*val = 0xFFFFFFFF;\n> -\tbusdn = pci_bus_to_OF_node(bus);\n> -\tfor (dn = busdn->child; dn; dn = dn->sibling) {\n> -\t\tpdn = PCI_DN(dn);\n> -\t\tif (pdn && pdn->devfn == devfn\n> -\t\t    && of_device_is_available(dn)) {\n> -\t\t\tfound = true;\n> -\t\t\tbreak;\n> -\t\t}\n> -\t}\n>  \n> -\tif (!found)\n> -\t\treturn PCIBIOS_DEVICE_NOT_FOUND;\n> +\tpdn = pci_get_pdn_by_devfn(bus, devfn);\n\nThis appears to not handle the pdn == NULL case.\n\n>  \tret = rtas_read_config(pdn, where, size, val);\n\nBut actually is handled in there ^\nThat would have been worth mentioning in the change log.\n\ncheers\n\n>  \tif (*val == EEH_IO_ERROR_VALUE(size) &&\n> @@ -153,23 +141,9 @@ static int rtas_pci_write_config(struct pci_bus *bus,\n>  \t\t\t\t unsigned int devfn,\n>  \t\t\t\t int where, int size, u32 val)\n>  {\n> -\tstruct device_node *busdn, *dn;\n>  \tstruct pci_dn *pdn;\n> -\tbool found = false;\n> -\n> -\t/* Search only direct children of the bus */\n> -\tbusdn = pci_bus_to_OF_node(bus);\n> -\tfor (dn = busdn->child; dn; dn = dn->sibling) {\n> -\t\tpdn = PCI_DN(dn);\n> -\t\tif (pdn && pdn->devfn == devfn\n> -\t\t    && of_device_is_available(dn)) {\n> -\t\t\tfound = true;\n> -\t\t\tbreak;\n> -\t\t}\n> -\t}\n>  \n> -\tif (!found)\n> -\t\treturn PCIBIOS_DEVICE_NOT_FOUND;\n> +\tpdn = pci_get_pdn_by_devfn(bus, devfn);\n>  \n>  \treturn rtas_write_config(pdn, where, size, val);\n>  }\n> -- \n> 2.5.4 (Apple Git-61)","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@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 3xhK1K6sWdz9t38\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 16:46:45 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhK1K5lDyzDrJm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 16:46:45 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xhJhC1nt2zDqkh\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 29 Aug 2017 16:31:55 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xhJhC0t3Mz9t2v;\n\tTue, 29 Aug 2017 16:31:55 +1000 (AEST)"],"From":"Michael Ellerman <mpe@ellerman.id.au>","To":"\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com>, benh@kernel.crashing.org, \n\tpaulus@samba.org","Subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","In-Reply-To":"<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>","References":"<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>","User-Agent":"Notmuch/0.21 (https://notmuchmail.org)","Date":"Tue, 29 Aug 2017 16:31:52 +1000","Message-ID":"<87wp5m28br.fsf@concordia.ellerman.id.au>","MIME-Version":"1.0","Content-Type":"text/plain","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"\"Bryant G. Ly\" <bgly@us.ibm.com>, linuxppc-dev@lists.ozlabs.org,\n\t\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com>, martin.petersen@oracle.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1759063,"web_url":"http://patchwork.ozlabs.org/comment/1759063/","msgid":"<87tw0q289e.fsf@concordia.ellerman.id.au>","date":"2017-08-29T06:33:17","subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","submitter":{"id":46580,"url":"http://patchwork.ozlabs.org/api/people/46580/","name":"Michael Ellerman","email":"mpe@ellerman.id.au"},"content":"\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com> writes:\n\n> For a PCI device it's pci_dn can be retrieved from\n> pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list.\n> Thus, we should just use the generic function pci_get_pdn_by_devfn\n> to get the pci_dn.\n>\n> Signed-off-by: Bryant G. Ly <bgly@us.ibm.com>\n\nMinor issue, it's preferable if the email in your Signed-off-by matches\nthe email you send patches from.\n\ncheers","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@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 3xhK2l4Tw5z9ryr\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 16:47:59 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhK2l3YhmzDrZQ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 16:47:59 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xhJjn2LqTzDrVR\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 29 Aug 2017 16:33:17 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xhJjn148gz9t2v;\n\tTue, 29 Aug 2017 16:33:17 +1000 (AEST)"],"From":"Michael Ellerman <mpe@ellerman.id.au>","To":"\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com>, benh@kernel.crashing.org, \n\tpaulus@samba.org","Subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","In-Reply-To":"<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>","References":"<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>","User-Agent":"Notmuch/0.21 (https://notmuchmail.org)","Date":"Tue, 29 Aug 2017 16:33:17 +1000","Message-ID":"<87tw0q289e.fsf@concordia.ellerman.id.au>","MIME-Version":"1.0","Content-Type":"text/plain","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"\"Bryant G. Ly\" <bgly@us.ibm.com>, linuxppc-dev@lists.ozlabs.org,\n\t\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com>, martin.petersen@oracle.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1759330,"web_url":"http://patchwork.ozlabs.org/comment/1759330/","msgid":"<560467db-963b-46f1-bb7b-63892fb5496d@linux.vnet.ibm.com>","date":"2017-08-29T13:18:34","subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","submitter":{"id":72247,"url":"http://patchwork.ozlabs.org/api/people/72247/","name":"Bryant G. Ly","email":"bryantly@linux.vnet.ibm.com"},"content":"On 8/29/17 1:33 AM, Michael Ellerman wrote:\n\n> \"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com> writes:\n>\n>> For a PCI device it's pci_dn can be retrieved from\n>> pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list.\n>> Thus, we should just use the generic function pci_get_pdn_by_devfn\n>> to get the pci_dn.\n>>\n>> Signed-off-by: Bryant G. Ly <bgly@us.ibm.com>\n> Minor issue, it's preferable if the email in your Signed-off-by matches\n> the email you send patches from.\n>\n> cheers\n>\nHi Michael,\n\nThanks for the review. I apologize for the email's not matching, I switch between the two frequently\nthroughout the day for internal gerrit commits and Linux patches. I have addressed all your comments\nin the new patch that I had just put up. Also, I have tested it with mellanox cx4 cards on P8 systems.\n\nI'd also like to let you know that I am working on patches to enable SRIOV on power and would like\nyour feedback on design, which I will send in a private email.\n\n-Bryant","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@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 3xhTnP0ncSz9s71\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 23:22:01 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhTnN6VmDzDqkh\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 23:22:00 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\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 3xhTjY4dsMzDqZ6\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 29 Aug 2017 23:18:41 +1000 (AEST)","from pps.filterd (m0098396.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7TDFCDO098043\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 29 Aug 2017 09:18:40 -0400","from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cn4211cdf-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 29 Aug 2017 09:18:39 -0400","from localhost\n\tby e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<bryantly@linux.vnet.ibm.com>; Tue, 29 Aug 2017 07:18:39 -0600","from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17)\n\tby e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tTue, 29 Aug 2017 07:18:36 -0600","from b03ledav004.gho.boulder.ibm.com\n\t(b03ledav004.gho.boulder.ibm.com [9.17.130.235])\n\tby b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v7TDIZfL63832254; Tue, 29 Aug 2017 06:18:35 -0700","from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 8330278043;\n\tTue, 29 Aug 2017 07:18:35 -0600 (MDT)","from [9.80.207.28] (unknown [9.80.207.28])\n\tby b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id A77EC78037;\n\tTue, 29 Aug 2017 07:18:34 -0600 (MDT)"],"Subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","To":"Michael Ellerman <mpe@ellerman.id.au>, benh@kernel.crashing.org,\n\tpaulus@samba.org","References":"<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>\n\t<87tw0q289e.fsf@concordia.ellerman.id.au>","From":"\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com>","Date":"Tue, 29 Aug 2017 08:18:34 -0500","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0)\n\tGecko/20100101 Thunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<87tw0q289e.fsf@concordia.ellerman.id.au>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","X-TM-AS-GCONF":"00","x-cbid":"17082913-0028-0000-0000-000008478FD7","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007633; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00909256; UDB=6.00456005;\n\tIPR=6.00689540; \n\tBA=6.00005560; 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.00016917;\n\tXFM=3.00000015; UTC=2017-08-29 13:18:37","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17082913-0029-0000-0000-0000375702E6","Message-Id":"<560467db-963b-46f1-bb7b-63892fb5496d@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-29_03:, , 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-1708290199","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"\"Bryant G. Ly\" <bgly@us.ibm.com>, linuxppc-dev@lists.ozlabs.org,\n\tmartin.petersen@oracle.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1759332,"web_url":"http://patchwork.ozlabs.org/comment/1759332/","msgid":"<0bbc434e-a9d2-8887-43fa-a343013cacb1@linux.vnet.ibm.com>","date":"2017-08-29T13:19:47","subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","submitter":{"id":72247,"url":"http://patchwork.ozlabs.org/api/people/72247/","name":"Bryant G. Ly","email":"bryantly@linux.vnet.ibm.com"},"content":"On 8/29/17 1:20 AM, Sam Bobroff wrote:\n\n> On Mon, Aug 28, 2017 at 11:05:03AM -0500, Bryant G. Ly wrote:\n>> For a PCI device it's pci_dn can be retrieved from\n>> pdev->dev.archdata.firmware_data, PCI_DN(devnode), or parent's list.\n>> Thus, we should just use the generic function pci_get_pdn_by_devfn\n>> to get the pci_dn.\n>>\n>> Signed-off-by: Bryant G. Ly <bgly@us.ibm.com>\n> Reviewed-by: Sam Bobroff <sam.bobroff@au1.ibm.com>\n>\n> I don't know this area but I tested it using a patched kernel with the\n> old and new code together. My test kernel booted fine (in QEMU+KVM) and\n> I saw 26 reads and 4 writes, all of which got the same value with either\n> code block.\n>\n> I also checked that the error result in the \"not found\" case is the same\n> as well, which it is, because rtas_{read,write}_config() will return\n> PCIBIOS_DEVICE_NOT_FOUND if given a NULL pdn.\n>\n> So, looks good to me.\n>\n> Cheers,\n> Sam.\n>\nThanks for the review Sam!","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@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 3xhTps39rtz9t2v\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 23:23:17 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhTps0qnLzDrCf\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 23:23:17 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\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 3xhTl12qxrzDqgD\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 29 Aug 2017 23:19:57 +1000 (AEST)","from pps.filterd (m0098404.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7TDIqcf143728\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 29 Aug 2017 09:19:55 -0400","from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cn6ynrusy-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 29 Aug 2017 09:19:54 -0400","from localhost\n\tby e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<bryantly@linux.vnet.ibm.com>; Tue, 29 Aug 2017 07:19:54 -0600","from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18)\n\tby e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tTue, 29 Aug 2017 07:19:49 -0600","from b03ledav004.gho.boulder.ibm.com\n\t(b03ledav004.gho.boulder.ibm.com [9.17.130.235])\n\tby b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v7TDJnDr65339474; Tue, 29 Aug 2017 06:19:49 -0700","from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 6130478037;\n\tTue, 29 Aug 2017 07:19:49 -0600 (MDT)","from [9.80.207.28] (unknown [9.80.207.28])\n\tby b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id 631CF7804D;\n\tTue, 29 Aug 2017 07:19:48 -0600 (MDT)"],"Subject":"Re: [PATCH] powerpc/kernel: Change retrieval of pci_dn","To":"Sam Bobroff <sam.bobroff@au1.ibm.com>","References":"<1503936303-18274-1-git-send-email-bryantly@linux.vnet.ibm.com>\n\t<20170829062031.hb3pwrnt5pohpr7l@tungsten.ozlabs.ibm.com>","From":"\"Bryant G. Ly\" <bryantly@linux.vnet.ibm.com>","Date":"Tue, 29 Aug 2017 08:19:47 -0500","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0)\n\tGecko/20100101 Thunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170829062031.hb3pwrnt5pohpr7l@tungsten.ozlabs.ibm.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","X-TM-AS-GCONF":"00","x-cbid":"17082913-0024-0000-0000-0000171D9B1D","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007633; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00909256; UDB=6.00456005;\n\tIPR=6.00689540; \n\tBA=6.00005560; 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.00016917;\n\tXFM=3.00000015; UTC=2017-08-29 13:19:52","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17082913-0025-0000-0000-00004C80DD24","Message-Id":"<0bbc434e-a9d2-8887-43fa-a343013cacb1@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-29_03:, , 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-1708290200","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"martin.petersen@oracle.com, paulus@samba.org,\n\t\"Bryant G. Ly\" <bgly@us.ibm.com>, linuxppc-dev@lists.ozlabs.org","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]