[{"id":1768307,"web_url":"http://patchwork.ozlabs.org/comment/1768307/","msgid":"<1505356145.12628.181.camel@kernel.crashing.org>","list_archive_url":null,"date":"2017-09-14T02:29:05","subject":"Re: [Skiboot] [PATCH] core: POWER9 implement\n\tOPAL_SIGNAL_SYSTEM_RESET","submitter":{"id":38,"url":"http://patchwork.ozlabs.org/api/people/38/","name":"Benjamin Herrenschmidt","email":"benh@kernel.crashing.org"},"content":"On Wed, 2017-09-13 at 18:50 +1000, Nicholas Piggin wrote:\n> +static int core_set_special_wakeup(struct cpu_thread *cpu)\n> +{\n> +       uint32_t chip_id = pir_to_chip_id(cpu->pir);\n> +       uint32_t core_id = pir_to_core_id(cpu->pir);\n> +       uint32_t swake_addr;\n> +       uint32_t gpmmr_addr;\n> +       uint64_t val;\n> +       int i;\n> +\n> +       swake_addr = XSCOM_ADDR_P9_EC(core_id, P9_PPM_SPWKUP_OTR);\n> +       gpmmr_addr = XSCOM_ADDR_P9_EC(core_id, P9_PPM_GPMMR);\n> +\n\nWe need a common place to handle special wakeups (with per-core use\ncounts) because I bet you that's not the only place that will need it.\n\nTalking of which ... why do we need it anyway ? Won't the sreset wake\nup the core ?\n\nBen.","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 3xt2Xt0N70z9t3V\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 12:29:18 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xt2Xs5DJ6zDqYx\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 12:29:17 +1000 (AEST)","from gate.crashing.org (gate.crashing.org [63.228.1.57])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xt2Xn33XszDq78\n\tfor <skiboot@lists.ozlabs.org>; Thu, 14 Sep 2017 12:29:13 +1000 (AEST)","from localhost (localhost.localdomain [127.0.0.1])\n\tby gate.crashing.org (8.14.1/8.13.8) with ESMTP id v8E2T5pA031885;\n\tWed, 13 Sep 2017 21:29:07 -0500"],"Authentication-Results":"ozlabs.org; spf=permerror (mailfrom)\n\tsmtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57;\n\thelo=gate.crashing.org; envelope-from=benh@kernel.crashing.org;\n\treceiver=<UNKNOWN>)","Message-ID":"<1505356145.12628.181.camel@kernel.crashing.org>","From":"Benjamin Herrenschmidt <benh@kernel.crashing.org>","To":"Nicholas Piggin <npiggin@gmail.com>, skiboot@lists.ozlabs.org","Date":"Thu, 14 Sep 2017 12:29:05 +1000","In-Reply-To":"<20170913085003.9537-1-npiggin@gmail.com>","References":"<20170913085003.9537-1-npiggin@gmail.com>","X-Mailer":"Evolution 3.24.5 (3.24.5-1.fc26) ","Mime-Version":"1.0","Subject":"Re: [Skiboot] [PATCH] core: POWER9 implement\n\tOPAL_SIGNAL_SYSTEM_RESET","X-BeenThere":"skiboot@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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 <alistair@popple.id.au>","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":1768317,"web_url":"http://patchwork.ozlabs.org/comment/1768317/","msgid":"<10936044.ZdlKGrZyL6@new-mexico>","list_archive_url":null,"date":"2017-09-14T03:29:22","subject":"Re: [Skiboot] [PATCH] core: POWER9 implement\n\tOPAL_SIGNAL_SYSTEM_RESET","submitter":{"id":24781,"url":"http://patchwork.ozlabs.org/api/people/24781/","name":"Alistair Popple","email":"alistair@popple.id.au"},"content":"On Thu, 14 Sep 2017 12:29:05 PM Benjamin Herrenschmidt wrote:\n> On Wed, 2017-09-13 at 18:50 +1000, Nicholas Piggin wrote:\n> > +static int core_set_special_wakeup(struct cpu_thread *cpu)\n> > +{\n> > +       uint32_t chip_id = pir_to_chip_id(cpu->pir);\n> > +       uint32_t core_id = pir_to_core_id(cpu->pir);\n> > +       uint32_t swake_addr;\n> > +       uint32_t gpmmr_addr;\n> > +       uint64_t val;\n> > +       int i;\n> > +\n> > +       swake_addr = XSCOM_ADDR_P9_EC(core_id, P9_PPM_SPWKUP_OTR);\n> > +       gpmmr_addr = XSCOM_ADDR_P9_EC(core_id, P9_PPM_GPMMR);\n> > +\n> \n> We need a common place to handle special wakeups (with per-core use\n> counts) because I bet you that's not the only place that will need it.\n> \n> Talking of which ... why do we need it anyway ? Won't the sreset wake\n> up the core ?\n\nDon't you need it to talk to the entire chiplet at all? I believe the direct\ncontrol to stop the thread will wake the thread up. For what it's worth the\noriginal HW procedures had the special wakeup.\n\n- Alistair\n\n>\n> Ben.\n>","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 3xt3tT5PR4z9t2f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 13:29: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 3xt3tT44fpzDrMY\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 13:29:37 +1000 (AEST)","from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net\n\t[150.101.137.145])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xt3tD2qDtzDqlR\n\tfor <skiboot@lists.ozlabs.org>; Thu, 14 Sep 2017 13:29:24 +1000 (AEST)","from static-82-10.transact.net.au (HELO new-mexico.localnet)\n\t([122.99.82.10]) by ipmail06.adl6.internode.on.net with ESMTP;\n\t14 Sep 2017 12:59:24 +0930"],"Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=popple.id.au\n\t(client-ip=150.101.137.145; helo=ipmail06.adl6.internode.on.net;\n\tenvelope-from=alistair@popple.id.au; receiver=<UNKNOWN>)","X-IronPort-Anti-Spam-Filtered":"true","X-IronPort-Anti-Spam-Result":"A2BoBgCn9rlZ/wpSY3pcHQEFAQsBhSyFfYk2kSeRQoZ4hUgChSwBAgEBAQEBAmsohRgBAQEBAgEnEz8QCw4KCRUQDwFHBoo8B65zOos0AQEBBwImgyuIXYpsBaB5lUWSAkiWIVeBDRwWGAkIGBmHeC6MEQEBAQ","From":"Alistair Popple <alistair@popple.id.au>","To":"Benjamin Herrenschmidt <benh@kernel.crashing.org>","Date":"Thu, 14 Sep 2017 13:29:22 +1000","Message-ID":"<10936044.ZdlKGrZyL6@new-mexico>","User-Agent":"KMail/4.14.1 (Linux/4.9.0-0.bpo.3-amd64; KDE/4.14.2; x86_64; ; )","In-Reply-To":"<1505356145.12628.181.camel@kernel.crashing.org>","References":"<20170913085003.9537-1-npiggin@gmail.com>\n\t<1505356145.12628.181.camel@kernel.crashing.org>","MIME-Version":"1.0","Subject":"Re: [Skiboot] [PATCH] core: POWER9 implement\n\tOPAL_SIGNAL_SYSTEM_RESET","X-BeenThere":"skiboot@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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@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":1768358,"web_url":"http://patchwork.ozlabs.org/comment/1768358/","msgid":"<20170914163633.1f34084e@roar.ozlabs.ibm.com>","list_archive_url":null,"date":"2017-09-14T06:36:33","subject":"Re: [Skiboot] [PATCH] core: POWER9 implement\n\tOPAL_SIGNAL_SYSTEM_RESET","submitter":{"id":69518,"url":"http://patchwork.ozlabs.org/api/people/69518/","name":"Nicholas Piggin","email":"npiggin@gmail.com"},"content":"On Thu, 14 Sep 2017 12:29:05 +1000\nBenjamin Herrenschmidt <benh@kernel.crashing.org> wrote:\n\n> On Wed, 2017-09-13 at 18:50 +1000, Nicholas Piggin wrote:\n> > +static int core_set_special_wakeup(struct cpu_thread *cpu)\n> > +{\n> > +       uint32_t chip_id = pir_to_chip_id(cpu->pir);\n> > +       uint32_t core_id = pir_to_core_id(cpu->pir);\n> > +       uint32_t swake_addr;\n> > +       uint32_t gpmmr_addr;\n> > +       uint64_t val;\n> > +       int i;\n> > +\n> > +       swake_addr = XSCOM_ADDR_P9_EC(core_id, P9_PPM_SPWKUP_OTR);\n> > +       gpmmr_addr = XSCOM_ADDR_P9_EC(core_id, P9_PPM_GPMMR);\n> > +  \n> \n> We need a common place to handle special wakeups (with per-core use\n> counts) because I bet you that's not the only place that will need it.\n> \n> Talking of which ... why do we need it anyway ? Won't the sreset wake\n> up the core ?\n\nI did try that, but it seems not to handle running vs idle threads\nproperly. Does not set SRR1[46:47] for threads in power save mode,\nby the looks.\n\nSo we have to assert special wakeup, read out the stop state of the\nthread, set the PWR bit if needed, then we can do the sreset. It\nwould be nice to just ping the sreset, but this has been working\nrobustly so far. We *could* possibly work around things by adding\nsome extra checks to idle paths, but I prefer not to if we can do it\nthis way (unless there is some other good reason not to).\n\nThanks,\nNick","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 3xt82n213qz9t1t\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 16:37:05 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xt82n0rPpzDrMd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 16:37:05 +1000 (AEST)","from mail-pg0-x242.google.com (mail-pg0-x242.google.com\n\t[IPv6:2607:f8b0:400e:c05::242])\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 3xt82T5tBMzDrFt\n\tfor <skiboot@lists.ozlabs.org>; Thu, 14 Sep 2017 16:36:49 +1000 (AEST)","by mail-pg0-x242.google.com with SMTP id m30so1237975pgn.5\n\tfor <skiboot@lists.ozlabs.org>; Wed, 13 Sep 2017 23:36:49 -0700 (PDT)","from roar.ozlabs.ibm.com (203-219-56-202.tpgi.com.au.\n\t[203.219.56.202]) by smtp.gmail.com with ESMTPSA id\n\tb24sm6284375pfd.37.2017.09.13.23.36.44\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 13 Sep 2017 23:36:46 -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=\"EBlTNPgi\"; 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=\"EBlTNPgi\"; dkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400e:c05::242; helo=mail-pg0-x242.google.com;\n\tenvelope-from=npiggin@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"EBlTNPgi\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:in-reply-to:references\n\t:organization:mime-version:content-transfer-encoding;\n\tbh=q62otV1PnM1HorzU7j+Jsk5LNSTQj+4A/mLEUhbVxEs=;\n\tb=EBlTNPgim5Bxd8F0dPd70q9ZZBpbeLT4EKDJWt831Dhj49DRU0Hqm+tL+n07Pk1tBT\n\tf/cS4rtVvdM/zcJkrs68m4heYtOQCgHKDx5aVb7pRjef62Vf8fYnv0/3N9cuDM95uN0I\n\tZpo0bRjluFkD25gbQjpBiwfiHpHSLYTfmTCCIsqtXpu0ZN6AOp8usOotEcT1vTIZR2PJ\n\tOOU3lwl1Cg9TKR5B/4OrmWggljn9/xZait5ioZrWlQdLKdTiOCyHPM9YeFbuK82I2DU7\n\tcLzfzOjYLyznpyDQx7SKNb8tJ8nEpauK9a9WNtKqA4RE8tJ7YG04IyTQ/nI5PPRdpKjx\n\tnkQA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to\n\t:references:organization:mime-version:content-transfer-encoding;\n\tbh=q62otV1PnM1HorzU7j+Jsk5LNSTQj+4A/mLEUhbVxEs=;\n\tb=ZzSVs+u1w36omNs7BtQA7wKgwABo2LGQeEG1fDiHkuoakCGCqfhcXV43q3My7IBO+3\n\txVJ3TwWyEJ7AyMo/C0PaZJbH2ijQqELwfEFB9EWN0oVRrJzh8sZQ3Tv000vaozjsMdOz\n\tV2oqP1iLZG9P9Frlym+/TFIkNCyLk3JS+QkS9/PapqQIc+enxsCpeibNJ9NeJodA/UPx\n\tk8EiHEe9V9egygP72mFDPY803sjoZD1pndvnVprt2S/z2lb9su1eD4EeQNmgIQGD0yOK\n\tzC6JtHfI9/EJEE45B4O5ckbXA8ysSbYVKFnkq3c841FbKFq5UT8s8pkT6DKwZuhaBCya\n\t39Eg==","X-Gm-Message-State":"AHPjjUgVRt3wQ03RoWKjQdaG2yI7NCqNWfGhM1VkJ2CT3NW84UZGxSMT\n\tpV8X6dpwaS7DK3FF","X-Google-Smtp-Source":"ADKCNb45SHYpOm0qf6JFEv3KdNcFVLtSNRVBKmACQnMUDlDDLsiiODQcWJMy3KOSVgcXMNExB+gLwg==","X-Received":"by 10.99.2.214 with SMTP id 205mr20001656pgc.375.1505371007937; \n\tWed, 13 Sep 2017 23:36:47 -0700 (PDT)","Date":"Thu, 14 Sep 2017 16:36:33 +1000","From":"Nicholas Piggin <npiggin@gmail.com>","To":"Benjamin Herrenschmidt <benh@kernel.crashing.org>","Message-ID":"<20170914163633.1f34084e@roar.ozlabs.ibm.com>","In-Reply-To":"<1505356145.12628.181.camel@kernel.crashing.org>","References":"<20170913085003.9537-1-npiggin@gmail.com>\n\t<1505356145.12628.181.camel@kernel.crashing.org>","Organization":"IBM","X-Mailer":"Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","Subject":"Re: [Skiboot] [PATCH] core: POWER9 implement\n\tOPAL_SIGNAL_SYSTEM_RESET","X-BeenThere":"skiboot@lists.ozlabs.org","X-Mailman-Version":"2.1.24","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@lists.ozlabs.org, Alistair Popple <alistair@popple.id.au>","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>"}}]