From patchwork Fri Mar 25 16:40:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12791730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0B6DC433F5 for ; Fri, 25 Mar 2022 16:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241312AbiCYQmW (ORCPT ); Fri, 25 Mar 2022 12:42:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243097AbiCYQmV (ORCPT ); Fri, 25 Mar 2022 12:42:21 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0E57DF4BB for ; Fri, 25 Mar 2022 09:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1648226441; bh=6e8x+3vHpe/N4+j4wLJlK1lnp0sz4Gqbdy4NlzdXlDs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=LD3v6h7lpB19ibr5353KcWs8fTbpha2M1ZAuu5wJasRe32XHnvNSONqfNurBHnciA Lh+XZtMvA0TbDh99NglNAItH1OdytvGhzq2sqN8iKpglPXTVgkOPU3cii3QyZdHgke YviNag2NQPzHu+7ZUF3xsHS4EgEAkHgFMbtC/i5U= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.164.212]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MYNNy-1nccZe3ir4-00VNLa; Fri, 25 Mar 2022 17:40:40 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org Cc: James Bottomley , John David Anglin Subject: [PATCH 1/2] parisc: Add constant for control registers and clean up mfctl() Date: Fri, 25 Mar 2022 17:40:39 +0100 Message-Id: <20220325164040.502188-1-deller@gmx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:i6Qpw2EImUk/Qkcqpmx5qdbhUUA4uX7UU1PuAgqy7QS3TDBycYF 3FiSatmxFY6io5Zx9hpvuJRePoYNBrOyotOOewQHYqhQKLhYZz93waco+Hy4E6ewtfR00J5 LQ4s9n1bx1fSUqXHkeCk/4R3xM6ZnRxnypOo7aM0SFBBDTDUCFTrN4ysjeuSZWLaX8nt0Z9 Natlm1/Ja9ORx17dk7S6A== X-UI-Out-Filterresults: notjunk:1;V03:K0:Bxd10u3t6bY=:mdRD63tkNzWiv9Gik+6meO mwsDU8HhMkrG/Xt4xoKk4xvOlRF+sR6QGJsy3iA9UNUZBeJ9FjAd96MVT3Z08XCCwQ3y170cG WMkmdKZ9nGyH35HGuwQHjEBQ7KFfcgCe6g989BB511TustZWZ5WE28VoDUCVpkqtPC23cd8P7 Sh1TktYPxDYDYz64126IVB7jhDQtXbiZX7V54HaIZT8AN+4qArijTApw2LIF4eChHXr6TWvT1 1J6za4ONHCN/HW4qsXdHg5JcrUXisJjAE4kldOyHCAXxFkfrXQBAFxKgB5L+IGrlEazJ0aDFr gCLFxmZjBWMBOK56FT1baTntAj2oPTq7r3NzKD4AmBla+iGo5nBZ2G/7j8woTIO3dphk4e+KO VlKF4v6iQKpedDPhOsAlCpT1f7J8mRHQJPzCfkkqEcmyz2P02ApTmgAs3dcOX2SXRR9iEM1sM 4ltWgW3S/d3D14zwidMUenQju8A18fZEN44P3VTpdZdyy0b7Th65WbveG22S/j7vYk7Q8E/IK Sqs1f7WdFszBVu/5mWKp9vehNzJ5cxkqB2s51/9af4Ag+DL3k+HCH8vbzefcExBXwsKnuaWIR UaHVrhIICt1mxAHtQLQFxH8dEqzUCPUpTuHrH9dhqZymTEVH2BXEQWHtMS+x3IegH9qbyc1es +lThtW/KDfNs0izxhwR1RzCoCC1saNUvo8MLHDKP3wWBrPgd4M6Zpud2FpJBiMRjbB4rPjjf0 aNUSHxAwl0vdcXtMkqdphxSM2efgQ50BB3CbNCpURRMK0wg4GV+PoSznOjyXvvJ849KL4QElr IN6SfrKMOTjkwi0fmCj5/A+DmkbNAlX0moZ/3NItTVFxMhavHF25N+2ndpT1no/4kw+kBO/VK G1w4laiI/C5nmk023d1BhCAe9wvokbG1gN2+CXhg98Wa5hLPuEU1xxk0MwKyfryEttIBlq9Pl OaSqO4QUIgU5nDnK7Au0zE9eNuzxnyLBwVx1SvL110s4TkYJXuKPZtGgEdDvmH7a6waVvEb7O kp3+xJN0+82MaJ42/FydGjtVh971UtLXbAuBwPlEygGYd+aEAhxus3Ydvk/JVlfxtjuZFv/sM nf1lmRGAdJ3xSs= Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Clean up the code and add often used constants. Signed-off-by: Helge Deller --- arch/parisc/include/asm/special_insns.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.35.1 diff --git a/arch/parisc/include/asm/special_insns.h b/arch/parisc/include/asm/special_insns.h index 41b3ddbd344c..c822bd0c0e3c 100644 --- a/arch/parisc/include/asm/special_insns.h +++ b/arch/parisc/include/asm/special_insns.h @@ -30,11 +30,15 @@ pa; \ }) +#define CR_EIEM 15 /* External Interrupt Enable Mask */ +#define CR_CR16 16 /* CR16 Interval Timer */ +#define CR_EIRR 23 /* External Interrupt Request Register */ + #define mfctl(reg) ({ \ unsigned long cr; \ __asm__ __volatile__( \ - "mfctl " #reg ",%0" : \ - "=r" (cr) \ + "mfctl %1,%0" : \ + "=r" (cr) : "i" (reg) \ ); \ cr; \ }) @@ -44,13 +48,8 @@ : /* no outputs */ \ : "r" (gr), "i" (cr) : "memory") -/* these are here to de-mystefy the calling code, and to provide hooks */ -/* which I needed for debugging EIEM problems -PB */ -#define get_eiem() mfctl(15) -static inline void set_eiem(unsigned long val) -{ - mtctl(val, 15); -} +#define get_eiem() mfctl(CR_EIEM) +#define set_eiem(val) mtctl(val, CR_EIEM) #define mfsp(reg) ({ \ unsigned long cr; \ From patchwork Fri Mar 25 16:40:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 12791729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FD91C433EF for ; Fri, 25 Mar 2022 16:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245560AbiCYQmW (ORCPT ); Fri, 25 Mar 2022 12:42:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241312AbiCYQmV (ORCPT ); Fri, 25 Mar 2022 12:42:21 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4733EDFD4A for ; Fri, 25 Mar 2022 09:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1648226441; bh=rstQ87HukJoIbDAbGQ1k4+xAUoWLYWvSY8YmQNacqeU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=KDcyFxNpaoc7HZtYMD9aRob1oCWnWRP0KHFrmdtMvz8hMJzbDEeCFZ+fgsUiE1qla D9b+maWq0Vm7xynC7082NEq36ikLJOb6jV1FHy3yb2uonicnEajm9w2SJxkDbBXLMu 5IJQvx0UQEsdvm4K2KHWQ95Dh5GNklw5vqnTDuhY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100.fritz.box ([92.116.164.212]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mn2WF-1nxCKF4B6d-00k8yJ; Fri, 25 Mar 2022 17:40:41 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org Cc: James Bottomley , John David Anglin Subject: [PATCH 2/2] parisc: Delay until next timer irq in __cpu_disable() Date: Fri, 25 Mar 2022 17:40:40 +0100 Message-Id: <20220325164040.502188-2-deller@gmx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220325164040.502188-1-deller@gmx.de> References: <20220325164040.502188-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:QEk6/fsKrzazR6tfFiKljFfj27c4HoeesHvvO2kGvBMQ6p+BXZn yqDZcJxvXOmCBM+AXBz9C1AF+pEICb+03PHae5BC/5Bs3wk5maACnV65jACqnI/JbOEZIW0 Ghdq3eEH6g52at1CENODBTnMtglFl+RDDfusDhHIKn4Jd7UTZ6fgQOO/AdvAFjvI1Km9D6W 9PYdqX/7ClD0rsaZQcNyA== X-UI-Out-Filterresults: notjunk:1;V03:K0:/3iLsw3CJRI=:yb8wAbKVLEkJ2XgJqB5flT YhUi1K4HteC7RD5uPadIsIT1PlBFK8wZstkEFlFkuqYSCnE8NWwsQbpLej2LKDYBqteVBXHjL dUFXryzRXOkocBdvOyAyG5npYvet1dijN8to0coDBuQhdNEdHM/8d8NvMGpyomasuIW3+7KsP abf1+jx4ax0KUQ6zGEPEwBHyNOiwXJwZqPgwy8m4RJ7GDTLqY9ytFhFboDEpNR5pMuEpsDXTR YrgsNCjAGvpvp73sLECHxqme+E2bilqsuZqiP6LbSYfV5jtvgGi424AEswi3Eu7FN/98ubv4+ VXDvaJGYUfZi2UJiV/BS9N9+00WCIhnJSXH3yNttJhkFnAD9WgDdhZUxD7/8hbD/hzthWkJkM e9bnUezogHlEZAGgaCrmgwnT056f2zpq3Pz7uYQ6nOMT3ABwebFtLESTUtqwrn0ypPuX3eoK7 QfvZv/qio9cXj1VLpSaMi9NRpfr2CeinMiS1dQxSTjqwzB9HyOVSfdvIosOFh72geluKobuYk H9cVBbxEc7UqP4bwkkl5GckOQ/nHa38XrK9v4eXaHzxzQN00YDLmLuYhxUp9DPoBNXTnGLB2f ISkvsLmEMDV9qIAw1H6bKP0CcpX8UhztVjznlWYrS1pxpL8tHQcFnkVVZiAM33iEQ7q1P4w+e pNJ+HsG40YLHbhwmSryPKpgxQ8lxQiprOqDX52ZvZCl4lXuw+7cSBb2W5M1LPxFD6GnzdTJnQ 57jPy51KoBK83i+akbqux17OuIjkCkYwVmDF3a1Un6V2ZKxdFlZbHCbGee5heqvlZrOvTVYeQ Le5+xgsx0EP6dmT7EeBGlxBRvbSpczcBUlUMhYSOShprZvBh44T7d3xQo3+x0ImpiZ3FpnWwa MIKYES+Ym8D00Ev1VXxiuu340xvW6qSosOdKcArvjkGbbVicSQwMXsGIZeKPHe0uzVSVlMZmj BB4xj/piopNV1HRKu3sbxlJzUzZwtvjtCqDxSkDSWATntH/qvKL/6DSn3lePvdklFirJkYR6b 0Pul7nvd3lz5hhdaOD9n3UpW0jyFQ4M8ncQzUPPqZE1Xww449W00I+T46jHZIzckAblZFVutr cClIgve/VX+amA= Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Wait for next timer irq to trigger, then clear all pending external irqs before jumping into rendevous PDC loop. Signed-off-by: Helge Deller --- arch/parisc/kernel/smp.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.35.1 diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 60cc33fd345c..564442ac74c9 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -491,6 +491,15 @@ int __cpu_disable(void) /* disable all irqs, including timer irq */ local_irq_disable(); + + /* wait for next timer irq ... */ + mdelay(1000/HZ+100); + + /* ... and then clear all pending external irqs */ + set_eiem(0); + mtctl(~0UL, CR_EIRR); + mfctl(CR_EIRR); + mtctl(0, CR_EIRR); #endif return 0; }