Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp637018iof; Mon, 6 Jun 2022 09:47:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxo5qGVNR8jvWAz2c25ktq/MWS5HYI9FPVdJQYpirm3+ockpVjFmg0/GzvzTG69HocRIBBO X-Received: by 2002:a17:90b:247:b0:1e6:7f44:e385 with SMTP id fz7-20020a17090b024700b001e67f44e385mr27148142pjb.195.1654534054239; Mon, 06 Jun 2022 09:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654534054; cv=none; d=google.com; s=arc-20160816; b=L91w/1I0h6fPL6tEZs08L/BHbryaVDIsmA/zE9L77GIMKeTVRV5MEgkTu6JhrdlTJM xn4vgmjZHqgCACaCvHpnAp9FPrXWqyw6J4OyNwaaPZti93Jj9tAmjE+bnNalHbLtCweL iZuGQ9iWz9FeE240r9RyUPmLcpPcgROFtiiBgPpyL9xKW2gMDAEDgi0MYCcG1rNp3U8g qzbaPiXz3WGYZxfcWyOvy6Mfn3u14bASyhQMHj8xgri6zAhljtWZE4F4qm/hwYspuu/0 3f+tTFuADpdVpjKORKfQyCpTrCWQu+JNtESp1TBf5X8lor8EIL8FkRWlry0Kkb+2SOOD 4mrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=neoUJ8Q8MnVWs6Yy7PShzHl8kKF3V7sjILdSoqdJ1lk=; b=gQENj+gSSERY9jNL+jew+YW0hEuDp4T57eH01cLZqjlBZqAuCQzgFGYBbefODmq5Wa j2rfSQq8dOP8uXlwu9SwauMidc7uEcntsX2IQM6il6vgBpa/0cy9RcLR4/pKULelhRZ/ 0E0r7aZicGxF2vX5DbtJ+aKTEKwoYXq27j/A9/MCShHL+dar+ujyuncPrgDwRw49QP9g ACz3UgnkHfRXZ2IMZp70bm/fdQiu2xJoVl9Tumlai1WKav8wO6zhEgKg9d/knpx0an0j gLtMI9+aOGF2Wb5CpBEG+AIKrH1SU+LCWYmD7M4tefgMSVWFlWfmjv31P9KAbZg5TtOL ujnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=f9Yzktdk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i7-20020a170902c94700b001636dafb8e4si11964178pla.217.2022.06.06.09.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 09:47:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=f9Yzktdk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0B92032934D; Mon, 6 Jun 2022 09:30:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241783AbiFFQ30 (ORCPT + 99 others); Mon, 6 Jun 2022 12:29:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241726AbiFFQ3P (ORCPT ); Mon, 6 Jun 2022 12:29:15 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBA953249B6 for ; Mon, 6 Jun 2022 09:29:14 -0700 (PDT) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 256D2J0w030658; Mon, 6 Jun 2022 18:28:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=neoUJ8Q8MnVWs6Yy7PShzHl8kKF3V7sjILdSoqdJ1lk=; b=f9Yzktdknxath2c5tYr11ki58w90tkMiR8D2NxM65rTOBJMt/PlwgLOKScCRvTWyxir1 Dsd6mVNsp6TSe9CMR6YHGglScVfki/fmqoEk1mN7OSc1Fuft78PqZxSuT5e036S9vcca kfkzeaQUozvNLoRYH27Eg8c7vZGQjYbzk8vo0AdBk+laZEUNXEH8gstQtMjz9Krj0d87 5afPl670BgdcA+JusHKJsL2JKN9qQZywGD9eQbIV47noWKGozHq7X9WhmnIeisOJGmyP 6ffyElQoeaQ85o5+iORK+pYtCyAgeIN7LjShZ3SMV6XRdXC7fJCcZpdErpl1m8eDdu8W eQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3gfvha3u2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jun 2022 18:28:43 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 37F3C10002A; Mon, 6 Jun 2022 18:28:43 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3191D231DC0; Mon, 6 Jun 2022 18:28:43 +0200 (CEST) Received: from localhost (10.75.127.48) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Mon, 6 Jun 2022 18:28:42 +0200 From: Antonio Borneo To: Thomas Gleixner , Marc Zyngier , Maxime Coquelin , Alexandre Torgue , , , CC: Ludovic Barre , Loic Pallardy , Pascal Paillet , Antonio Borneo Subject: [PATCH v2 4/6] irqchip/stm32-exti: Tag emr register as undefined for stm32mp15 Date: Mon, 6 Jun 2022 18:27:55 +0200 Message-ID: <20220606162757.415354-5-antonio.borneo@foss.st.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510164123.557921-1-antonio.borneo@foss.st.com> References: <20220510164123.557921-1-antonio.borneo@foss.st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-06_04,2022-06-03_01,2022-02-23_01 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandre Torgue The reference manual RM0436 of stm32mp15 till version v4.0 was erroneously reporting the Event Mask Registers (EMR) for the Cortex-A CPUs. These registers have been removed from v5.0 of the manual and the corresponding offsets have been marked as 'Reserved'. Prevent accessing these reserved addresses by tagging the EMR offsets as UNDEF_REG and modifying the code to handle this case. Signed-off-by: Alexandre Torgue Signed-off-by: Antonio Borneo --- drivers/irqchip/irq-stm32-exti.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c index e2722e499ae5..e8fa91bda4ba 100644 --- a/drivers/irqchip/irq-stm32-exti.c +++ b/drivers/irqchip/irq-stm32-exti.c @@ -132,7 +132,7 @@ static const struct stm32_exti_drv_data stm32h7xx_drv_data = { static const struct stm32_exti_bank stm32mp1_exti_b1 = { .imr_ofst = 0x80, - .emr_ofst = 0x84, + .emr_ofst = UNDEF_REG, .rtsr_ofst = 0x00, .ftsr_ofst = 0x04, .swier_ofst = 0x08, @@ -142,7 +142,7 @@ static const struct stm32_exti_bank stm32mp1_exti_b1 = { static const struct stm32_exti_bank stm32mp1_exti_b2 = { .imr_ofst = 0x90, - .emr_ofst = 0x94, + .emr_ofst = UNDEF_REG, .rtsr_ofst = 0x20, .ftsr_ofst = 0x24, .swier_ofst = 0x28, @@ -152,7 +152,7 @@ static const struct stm32_exti_bank stm32mp1_exti_b2 = { static const struct stm32_exti_bank stm32mp1_exti_b3 = { .imr_ofst = 0xA0, - .emr_ofst = 0xA4, + .emr_ofst = UNDEF_REG, .rtsr_ofst = 0x40, .ftsr_ofst = 0x44, .swier_ofst = 0x48, @@ -795,7 +795,8 @@ stm32_exti_chip_data *stm32_exti_chip_init(struct stm32_exti_host_data *h_data, * clear registers to avoid residue */ writel_relaxed(0, base + stm32_bank->imr_ofst); - writel_relaxed(0, base + stm32_bank->emr_ofst); + if (stm32_bank->emr_ofst != UNDEF_REG) + writel_relaxed(0, base + stm32_bank->emr_ofst); pr_info("%pOF: bank%d\n", node, bank_idx); -- 2.36.1