[{"id":1763243,"web_url":"http://patchwork.ozlabs.org/comment/1763243/","msgid":"<0cde622f-107c-92f2-42c6-b41e0e0133be@linux.vnet.ibm.com>","date":"2017-09-05T11:20:54","subject":"Re: [PATCH V2] cxl: Add support for POWER9 DD2","submitter":{"id":67555,"url":"http://patchwork.ozlabs.org/api/people/67555/","name":"Frederic Barrat","email":"fbarrat@linux.vnet.ibm.com"},"content":"Le 04/09/2017 à 17:29, Christophe Lombard a écrit :\n> The PSL initialization sequence has been updated to DD2.\n> This patch adapts to the changes, retaining compatibility with DD1.\n> The patch includes some changes to DD1 fix-ups as well.\n> \n> Tests performed on some of the old/new hardware.\n> \n> The function is_page_fault(), for POWER9, lists the Translation Checkout\n> Responses where the page fault will be handled by copro_handle_mm_fault().\n> This list is too restrictive and not necessary.\n> \n> This patches removes this restriction and all page faults, whatever the\n> reason, will be handled. In this case, the interruption is always\n> acknowledged.\n> \n> Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>\n> \n> ---\n\nI'm ok with those changes.\nWe should add to the commit message that we'll have more changes coming, \nat least to add the phb reset when switching to capi mode (if we still \ncan't get rid of it). The other item is capp recovery, which is still \nbeing worked on, but any change required there would hopefully be \nlimited to skiboot.\n\nWith the above:\nAcked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>\n\n   Fred\n\n\n> Changelog[v2]\n>   - Rebase to latest upstream.\n>   - Update the function is_page_fault()\n> ---\n>   drivers/misc/cxl/cxl.h   |  2 ++\n>   drivers/misc/cxl/fault.c | 15 ++-------------\n>   drivers/misc/cxl/pci.c   | 46 +++++++++++++++++++++++-----------------------\n>   3 files changed, 27 insertions(+), 36 deletions(-)\n> \n> diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h\n> index b1afecc..0167df8 100644\n> --- a/drivers/misc/cxl/cxl.h\n> +++ b/drivers/misc/cxl/cxl.h\n> @@ -100,6 +100,8 @@ static const cxl_p1_reg_t CXL_XSL_FEC       = {0x0158};\n>   static const cxl_p1_reg_t CXL_XSL_DSNCTL    = {0x0168};\n>   /* PSL registers - CAIA 2 */\n>   static const cxl_p1_reg_t CXL_PSL9_CONTROL  = {0x0020};\n> +static const cxl_p1_reg_t CXL_XSL9_INV      = {0x0110};\n> +static const cxl_p1_reg_t CXL_XSL9_DEF      = {0x0140};\n>   static const cxl_p1_reg_t CXL_XSL9_DSNCTL   = {0x0168};\n>   static const cxl_p1_reg_t CXL_PSL9_FIR1     = {0x0300};\n>   static const cxl_p1_reg_t CXL_PSL9_FIR2     = {0x0308};\n> diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c\n> index 6eed7d0..0cf7f4a 100644\n> --- a/drivers/misc/cxl/fault.c\n> +++ b/drivers/misc/cxl/fault.c\n> @@ -204,22 +204,11 @@ static bool cxl_is_segment_miss(struct cxl_context *ctx, u64 dsisr)\n> \n>   static bool cxl_is_page_fault(struct cxl_context *ctx, u64 dsisr)\n>   {\n> -\tu64 crs; /* Translation Checkout Response Status */\n> -\n>   \tif ((cxl_is_power8()) && (dsisr & CXL_PSL_DSISR_An_DM))\n>   \t\treturn true;\n> \n> -\tif (cxl_is_power9()) {\n> -\t\tcrs = (dsisr & CXL_PSL9_DSISR_An_CO_MASK);\n> -\t\tif ((crs == CXL_PSL9_DSISR_An_PF_SLR) ||\n> -\t\t    (crs == CXL_PSL9_DSISR_An_PF_RGC) ||\n> -\t\t    (crs == CXL_PSL9_DSISR_An_PF_RGP) ||\n> -\t\t    (crs == CXL_PSL9_DSISR_An_PF_HRH) ||\n> -\t\t    (crs == CXL_PSL9_DSISR_An_PF_STEG) ||\n> -\t\t    (crs == CXL_PSL9_DSISR_An_URTCH)) {\n> -\t\t\treturn true;\n> -\t\t}\n> -\t}\n> +\tif (cxl_is_power9())\n> +\t\treturn true;\n> \n>   \treturn false;\n>   }\n> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c\n> index d18b3d9..3edc991 100644\n> --- a/drivers/misc/cxl/pci.c\n> +++ b/drivers/misc/cxl/pci.c\n> @@ -401,7 +401,8 @@ int cxl_calc_capp_routing(struct pci_dev *dev, u64 *chipid,\n>   \t*capp_unit_id = get_capp_unit_id(np, *phb_index);\n>   \tof_node_put(np);\n>   \tif (!*capp_unit_id) {\n> -\t\tpr_err(\"cxl: invalid capp unit id\\n\");\n> +\t\tpr_err(\"cxl: invalid capp unit id (phb_index: %d)\\n\",\n> +\t\t       *phb_index);\n>   \t\treturn -ENODEV;\n>   \t}\n> \n> @@ -475,37 +476,36 @@ static int init_implementation_adapter_regs_psl9(struct cxl *adapter,\n>   \tpsl_fircntl |= 0x1ULL; /* ce_thresh */\n>   \tcxl_p1_write(adapter, CXL_PSL9_FIR_CNTL, psl_fircntl);\n> \n> -\t/* vccredits=0x1  pcklat=0x4 */\n> -\tcxl_p1_write(adapter, CXL_PSL9_DSNDCTL, 0x0000000000001810ULL);\n> -\n> -\t/*\n> -\t * For debugging with trace arrays.\n> -\t * Configure RX trace 0 segmented mode.\n> -\t * Configure CT trace 0 segmented mode.\n> -\t * Configure LA0 trace 0 segmented mode.\n> -\t * Configure LA1 trace 0 segmented mode.\n> +\t/* Setup the PSL to transmit packets on the PCIe before the\n> +\t * CAPP is enabled\n>   \t */\n> -\tcxl_p1_write(adapter, CXL_PSL9_TRACECFG, 0x8040800080000000ULL);\n> -\tcxl_p1_write(adapter, CXL_PSL9_TRACECFG, 0x8040800080000003ULL);\n> -\tcxl_p1_write(adapter, CXL_PSL9_TRACECFG, 0x8040800080000005ULL);\n> -\tcxl_p1_write(adapter, CXL_PSL9_TRACECFG, 0x8040800080000006ULL);\n> +\tcxl_p1_write(adapter, CXL_PSL9_DSNDCTL, 0x0001001000002A10ULL);\n> \n>   \t/*\n>   \t * A response to an ASB_Notify request is returned by the\n>   \t * system as an MMIO write to the address defined in\n> -\t * the PSL_TNR_ADDR register\n> +\t * the PSL_TNR_ADDR register.\n> +\t * keep the Reset Value: 0x00020000E0000000\n>   \t */\n> -\t/* PSL_TNR_ADDR */\n> \n> -\t/* NORST */\n> -\tcxl_p1_write(adapter, CXL_PSL9_DEBUG, 0x8000000000000000ULL);\n> +\t/* Enable XSL rty limit */\n> +\tcxl_p1_write(adapter, CXL_XSL9_DEF, 0x51F8000000000005ULL);\n> +\n> +\t/* Change XSL_INV dummy read threshold */\n> +\tcxl_p1_write(adapter, CXL_XSL9_INV, 0x0000040007FFC200ULL);\n> \n> -\t/* allocate the apc machines */\n> -\tcxl_p1_write(adapter, CXL_PSL9_APCDEDTYPE, 0x40000003FFFF0000ULL);\n> +\tif (phb_index == 3) {\n> +\t\t/* disable machines 31-47 and 20-27 for DMA */\n> +\t\tcxl_p1_write(adapter, CXL_PSL9_APCDEDTYPE, 0x40000FF3FFFF0000ULL);\n> +\t}\n> +\n> +\t/* Snoop machines */\n> +\tcxl_p1_write(adapter, CXL_PSL9_APCDEDALLOC, 0x800F000200000000ULL);\n> \n> -\t/* Disable vc dd1 fix */\n> -\tif (cxl_is_power9_dd1())\n> -\t\tcxl_p1_write(adapter, CXL_PSL9_GP_CT, 0x0400000000000001ULL);\n> +\tif (cxl_is_power9_dd1()) {\n> +\t\t/* Disabling deadlock counter CAR */\n> +\t\tcxl_p1_write(adapter, CXL_PSL9_GP_CT, 0x0020000000000001ULL);\n> +\t}\n> \n>   \treturn 0;\n>   }\n>","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 3xmkrK4fj4z9s3T\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  5 Sep 2017 21:24: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 3xmkrK3YfHzDrKs\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue,  5 Sep 2017 21:24: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 3xmkmZ3JkQzDrJ7\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue,  5 Sep 2017 21:21:02 +1000 (AEST)","from pps.filterd (m0098394.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv85BKKP0089393\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 5 Sep 2017 07:20:59 -0400","from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2csqt5u9kv-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 05 Sep 2017 07:20:59 -0400","from localhost\n\tby e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <fbarrat@linux.vnet.ibm.com>;\n\tTue, 5 Sep 2017 12:20:57 +0100","from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195)\n\tby e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tTue, 5 Sep 2017 12:20:55 +0100","from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com\n\t[9.149.105.58])\n\tby b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v85BKsQD29491378; Tue, 5 Sep 2017 11:20:54 GMT","from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 675574C040;\n\tTue,  5 Sep 2017 12:17:38 +0100 (BST)","from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 2DB7D4C044;\n\tTue,  5 Sep 2017 12:17:38 +0100 (BST)","from [9.101.4.34] (unknown [9.101.4.34])\n\tby d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP;\n\tTue,  5 Sep 2017 12:17:38 +0100 (BST)"],"Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=fbarrat@linux.vnet.ibm.com; receiver=<UNKNOWN>)","Subject":"Re: [PATCH V2] cxl: Add support for POWER9 DD2","To":"Christophe Lombard <clombard@linux.vnet.ibm.com>,\n\tlinuxppc-dev@lists.ozlabs.org, vaibhav@linux.vnet.ibm.com,\n\tandrew.donnellan@au1.ibm.com","References":"<1504538995-13792-1-git-send-email-clombard@linux.vnet.ibm.com>","From":"Frederic Barrat <fbarrat@linux.vnet.ibm.com>","Date":"Tue, 5 Sep 2017 13:20:54 +0200","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":"<1504538995-13792-1-git-send-email-clombard@linux.vnet.ibm.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-TM-AS-GCONF":"00","x-cbid":"17090511-0016-0000-0000-000004E8BDBA","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17090511-0017-0000-0000-000028224C70","Message-Id":"<0cde622f-107c-92f2-42c6-b41e0e0133be@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-05_06:, , 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-1709050173","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>","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>"}}]