Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/633518/?format=api
{ "id": 633518, "url": "http://patchwork.ozlabs.org/api/patches/633518/?format=api", "web_url": "http://patchwork.ozlabs.org/project/skiboot/patch/1465535032-26749-13-git-send-email-gwshan@linux.vnet.ibm.com/", "project": { "id": 44, "url": "http://patchwork.ozlabs.org/api/projects/44/?format=api", "name": "skiboot firmware development", "link_name": "skiboot", "list_id": "skiboot.lists.ozlabs.org", "list_email": "skiboot@lists.ozlabs.org", "web_url": "http://github.com/open-power/skiboot", "scm_url": "http://github.com/open-power/skiboot", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1465535032-26749-13-git-send-email-gwshan@linux.vnet.ibm.com>", "list_archive_url": null, "date": "2016-06-10T05:03:41", "name": "[v12,12/23] core/pci: Return value for struct phb_ops::device_init", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d86cb45be6728c84e31d95955b0d4a9c3ce54953", "submitter": { "id": 63923, "url": "http://patchwork.ozlabs.org/api/people/63923/?format=api", "name": "Gavin Shan", "email": "gwshan@linux.vnet.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/skiboot/patch/1465535032-26749-13-git-send-email-gwshan@linux.vnet.ibm.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/633518/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/633518/checks/", "tags": {}, "related": [], "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 AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3rQqtD2QRwz9sD3\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 10 Jun 2016 15:07:32 +1000 (AEST)", "from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3rQqtD1K5ZzDqR7\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 10 Jun 2016 15:07:32 +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 3rQqrD1V9nzDqJV\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 15:05:48 +1000 (AEST)", "from pps.filterd (m0048827.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id\n\tu5A53tdJ042591\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 01:05:46 -0400", "from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 23f9vdg27k-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 01:05:46 -0400", "from localhost\n\tby e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <skiboot@lists.ozlabs.org> from <gwshan@linux.vnet.ibm.com>;\n\tFri, 10 Jun 2016 15:05:43 +1000", "from d23dlp03.au.ibm.com (202.81.31.214)\n\tby e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tFri, 10 Jun 2016 15:05:41 +1000", "from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37])\n\tby d23dlp03.au.ibm.com (Postfix) with ESMTP id 300EF357805C\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 15:05:30 +1000 (EST)", "from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96])\n\tby d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tu5A55Opj8258022\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 15:05:25 +1000", "from d23av01.au.ibm.com (localhost [127.0.0.1])\n\tby d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tu5A55OOU010119\n\tfor <skiboot@lists.ozlabs.org>; Fri, 10 Jun 2016 15:05:24 +1000", "from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14])\n\tby d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tu5A55Oqi010006; Fri, 10 Jun 2016 15:05:24 +1000", "from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114])\n\tby ozlabs.au.ibm.com (Postfix) with ESMTP id E33B2A01C1;\n\tFri, 10 Jun 2016 15:03:57 +1000 (AEST)", "from gwshan (shangw.ozlabs.ibm.com [10.61.2.199])\n\tby bran.ozlabs.ibm.com (Postfix) with ESMTP id E10C0E3B1A;\n\tFri, 10 Jun 2016 15:03:57 +1000 (AEST)", "by gwshan (Postfix, from userid 1000)\n\tid C6DE1942CA3; Fri, 10 Jun 2016 15:03:57 +1000 (AEST)" ], "X-IBM-Helo": "d23dlp03.au.ibm.com", "X-IBM-MailFrom": "gwshan@linux.vnet.ibm.com", "X-IBM-RcptTo": "skiboot@lists.ozlabs.org", "From": "Gavin Shan <gwshan@linux.vnet.ibm.com>", "To": "skiboot@lists.ozlabs.org", "Date": "Fri, 10 Jun 2016 15:03:41 +1000", "X-Mailer": "git-send-email 2.1.0", "In-Reply-To": "<1465535032-26749-1-git-send-email-gwshan@linux.vnet.ibm.com>", "References": "<1465535032-26749-1-git-send-email-gwshan@linux.vnet.ibm.com>", "X-TM-AS-MML": "disable", "X-Content-Scanned": "Fidelis XPS MAILER", "x-cbid": "16061005-0048-0000-0000-00000190499D", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "16061005-0049-0000-0000-000045E8DBED", "Message-Id": "<1465535032-26749-13-git-send-email-gwshan@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2016-06-10_04:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=1\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000\n\tdefinitions=main-1606100058", "Subject": "[Skiboot] [PATCH v12 12/23] core/pci: Return value for struct\n\tphb_ops::device_init", "X-BeenThere": "skiboot@lists.ozlabs.org", "X-Mailman-Version": "2.1.22", "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": "alistair@popple.id.au", "MIME-Version": "1.0", "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>" }, "content": "This adds @data argument and \"int\" return value for struct phb_ops::\ndevice_init() so that it can be called in pci_walk_dev() directly to\nreinitialize the PCI devices behind the specified slot in subsequent\npatches.\n\nSigned-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>\n---\n core/pci.c | 2 +-\n hw/p7ioc-phb.c | 12 ++++++++++--\n hw/phb3.c | 12 ++++++++++--\n include/pci.h | 3 ++-\n 4 files changed, 23 insertions(+), 6 deletions(-)", "diff": "diff --git a/core/pci.c b/core/pci.c\nindex 8040932..b36d5a6 100644\n--- a/core/pci.c\n+++ b/core/pci.c\n@@ -255,7 +255,7 @@ static struct pci_device *pci_scan_one(struct phb *phb, struct pci_device *paren\n \t * Call PHB hook\n \t */\n \tif (phb->ops->device_init)\n-\t\tphb->ops->device_init(phb, pd);\n+\t\tphb->ops->device_init(phb, pd, NULL);\n \n \treturn pd;\n fail:\ndiff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c\nindex a50bae0..9e52d31 100644\n--- a/hw/p7ioc-phb.c\n+++ b/hw/p7ioc-phb.c\n@@ -2180,7 +2180,9 @@ static void p7ioc_endpoint_init(struct phb *phb,\n \tpci_cfg_write32(phb, bdfn, aercap + PCIECAP_AER_CAPCTL, val32);\n }\n \n-static void p7ioc_device_init(struct phb *phb, struct pci_device *dev)\n+static int p7ioc_device_init(struct phb *phb,\n+\t\t\t struct pci_device *dev,\n+\t\t\t void *data __unused)\n {\n \tint ecap = 0;\n \tint aercap = 0;\n@@ -2209,6 +2211,8 @@ static void p7ioc_device_init(struct phb *phb, struct pci_device *dev)\n \t\tp7ioc_switch_port_init(phb, dev, ecap, aercap);\n \telse\n \t\tp7ioc_endpoint_init(phb, dev, ecap, aercap);\n+\n+\treturn 0;\n }\n \n static int64_t p7ioc_pci_reinit(struct phb *phb,\n@@ -2216,6 +2220,7 @@ static int64_t p7ioc_pci_reinit(struct phb *phb,\n {\n \tstruct pci_device *pd;\n \tuint16_t bdfn = data;\n+\tint ret;\n \n \tif (scope != OPAL_REINIT_PCI_DEV)\n \t\treturn OPAL_PARAMETER;\n@@ -2224,7 +2229,10 @@ static int64_t p7ioc_pci_reinit(struct phb *phb,\n \tif (!pd)\n \t\treturn OPAL_PARAMETER;\n \n-\tp7ioc_device_init(phb, pd);\n+\tret = p7ioc_device_init(phb, pd, NULL);\n+\tif (ret)\n+\t\treturn OPAL_HARDWARE;\n+\n \treturn OPAL_SUCCESS;\n }\n \ndiff --git a/hw/phb3.c b/hw/phb3.c\nindex 9a67560..c9906c7 100644\n--- a/hw/phb3.c\n+++ b/hw/phb3.c\n@@ -526,7 +526,9 @@ static void phb3_check_device_quirks(struct phb *phb, struct pci_device *dev)\n \t}\n }\n \n-static void phb3_device_init(struct phb *phb, struct pci_device *dev)\n+static int phb3_device_init(struct phb *phb,\n+\t\t\t struct pci_device *dev,\n+\t\t\t void *data __unused)\n {\n \tint ecap = 0;\n \tint aercap = 0;\n@@ -558,12 +560,15 @@ static void phb3_device_init(struct phb *phb, struct pci_device *dev)\n \t\tphb3_switch_port_init(phb, dev, ecap, aercap);\n \telse\n \t\tphb3_endpoint_init(phb, dev, ecap, aercap);\n+\n+\treturn 0;\n }\n \n static int64_t phb3_pci_reinit(struct phb *phb, uint64_t scope, uint64_t data)\n {\n \tstruct pci_device *pd;\n \tuint16_t bdfn = data;\n+\tint ret;\n \n \tif (scope != OPAL_REINIT_PCI_DEV)\n \t\treturn OPAL_PARAMETER;\n@@ -572,7 +577,10 @@ static int64_t phb3_pci_reinit(struct phb *phb, uint64_t scope, uint64_t data)\n \tif (!pd)\n \t\treturn OPAL_PARAMETER;\n \n-\tphb3_device_init(phb, pd);\n+\tret = phb3_device_init(phb, pd, NULL);\n+\tif (ret)\n+\t\treturn OPAL_HARDWARE;\n+\n \treturn OPAL_SUCCESS;\n }\n \ndiff --git a/include/pci.h b/include/pci.h\nindex 788f1ef..69be49e 100644\n--- a/include/pci.h\n+++ b/include/pci.h\n@@ -261,7 +261,8 @@ struct phb_ops {\n \t * and before probing further. It can alter things like scan_map\n \t * for bridge ports etc...\n \t */\n-\tvoid (*device_init)(struct phb *phb, struct pci_device *device);\n+\tint (*device_init)(struct phb *phb, struct pci_device *device,\n+\t\t\t void *data);\n \n \t/* PHB final fixup is called after PCI probing is completed */\n \tvoid (*phb_final_fixup)(struct phb *phb);\n", "prefixes": [ "v12", "12/23" ] }