From patchwork Tue Oct 27 11:26:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shameerali Kolothum Thodi X-Patchwork-Id: 11859987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48A9BC55178 for ; Tue, 27 Oct 2020 11:29:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA70922258 for ; Tue, 27 Oct 2020 11:29:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fSnaRCM9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA70922258 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=LwZnzr697GSo4wvdx3Vfh5As5eBUNfh3oCsAc4BT9/I=; b=fSnaRCM914GweJj0MJdcLIabPo ONTIYn2Jsnn2SmG4w6gLT0N9iI1vmABxBRGAHWR+IR6n5W9rE7lzv8FDbFixXSi+QqXaNSRMcHDcW DWcdLi2ngTe1WXLTL7Ir9vL0ATXojiY32N4XXN/1YwhKQq5NfnFMjDLcb1oIYNUAhrU4cZsyUPh19 LayQ2gb3jtVOE8OSg2oQBA6I2YQhRdUu15qrwyWFuj6otvzQzKFZD4JZRGkn2697n88Oz1XKD9+rZ BB1R1Uh/V42BQnHVXSL0mNU6XZMUlfvWaf1pKV+vcu8+JH5RBNW7FCUZTHpfrQav6NCdJAtfOELVb yDRnRn+Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXN9y-0001wR-VW; Tue, 27 Oct 2020 11:29:03 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXN9D-0001ZN-OM for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 11:28:21 +0000 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CL8Zn117nz6yh1; Tue, 27 Oct 2020 19:28:01 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.47.24.15) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Tue, 27 Oct 2020 19:27:46 +0800 From: Shameer Kolothum To: , , , Subject: [RFC PATCH 0/4] ACPI/IORT: Support for IORT RMR node Date: Tue, 27 Oct 2020 11:26:42 +0000 Message-ID: <20201027112646.44680-1-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.47.24.15] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_072816_439847_48804E7C X-CRM114-Status: GOOD ( 11.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lorenzo.pieralisi@arm.com, joro@8bytes.org, jonathan.cameron@huawei.com, linuxarm@huawei.com, guohanjun@huawei.com, robin.murphy@arm.com, wanghuiqiang@huawei.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The series adds support to IORT RMR nodes specified in IORT Revision E -ARM DEN 0049E[0]. RMR nodes are used to describe memory ranges that are used by endpoints and require a unity mapping in SMMU. We have faced issues with 3408iMR RAID controller cards which fail to boot when SMMU is enabled. This is because these controllers make use of host memory for various caching related purposes and when SMMU is enabled the iMR firmware fails to access these memory regions as there is no mapping for them. IORT RMR provides a way for UEFI to describe and report these memory regions so that the kernel can make a unity mapping for these in SMMU. RFC because, Patch #1 is to update the actbl2.h and should be done through acpica update. I have send out a pull request[1] for that. Tests: With a UEFI, that reports the RMR for the dev, .... [16F0h 5872 1] Type : 06 [16F1h 5873 2] Length : 007C [16F3h 5875 1] Revision : 00 [1038h 0056 2] Reserved : 00000000 [1038h 0056 2] Identifier : 00000000 [16F8h 5880 4] Mapping Count : 00000001 [16FCh 5884 4] Mapping Offset : 00000040 [1700h 5888 4] Number of RMR Descriptors : 00000002 [1704h 5892 4] RMR Descriptor Offset : 00000018 [1708h 5896 8] Base Address of RMR : 0000E6400000 [1710h 5904 8] Length of RMR : 000000100000 [1718h 5912 4] Reserved : 00000000 [171Ch 5916 8] Base Address of RMR : 0000000027B00000 [1724h 5924 8] Length of RMR : 0000000000C00000 [172Ch 5932 4] Reserved : 00000000 [1730h 5936 4] Input base : 00000000 [1734h 5940 4] ID Count : 00000001 [1738h 5944 4] Output Base : 00000003 [173Ch 5948 4] Output Reference : 00000064 [1740h 5952 4] Flags (decoded below) : 00000001 Single Mapping : 1 ... Without the series the RAID controller initilization fails as below, ... [ 12.631117] megaraid_sas 0000:03:00.0: FW supports sync cache : Yes [ 12.637360] megaraid_sas 0000:03:00.0: megasas_disable_intr_fusion is called outbound_intr_mask:0x40000009 [ 18.776377] megaraid_sas 0000:03:00.0: Init cmd return status FAILED for SCSI host 0 [ 23.019383] megaraid_sas 0000:03:00.0: Waiting for FW to come to ready state [ 106.684281] megaraid_sas 0000:03:00.0: FW in FAULT state, Fault code:0x10000 subcode:0x0 func:megasas_transition_to_ready [ 106.695186] megaraid_sas 0000:03:00.0: System Register set: [ 106.889787] megaraid_sas 0000:03:00.0: Failed to transition controller to ready for scsi0. [ 106.910475] megaraid_sas 0000:03:00.0: Failed from megasas_init_fw 6407 estuary:/$ With the series, now the kernel has direct mapping for the dev as below, estuary:/$ cat /sys/kernel/iommu_groups/0/reserved_regions 0x0000000008000000 0x00000000080fffff msi 0x0000000027b00000 0x00000000286fffff direct 0x00000000e6400000 0x00000000e64fffff direct estuary:/$ .... [ 12.254318] megaraid_sas 0000:03:00.0: megasas_disable_intr_fusion is called outbound_intr_mask:0x40000009 [ 12.739089] megaraid_sas 0000:03:00.0: FW provided supportMaxExtLDs: 0 max_lds: 32 [ 12.746628] megaraid_sas 0000:03:00.0: controller type : iMR(0MB) [ 12.752694] megaraid_sas 0000:03:00.0: Online Controller Reset(OCR) : Enabled [ 12.759798] megaraid_sas 0000:03:00.0: Secure JBOD support : Yes [ 12.765778] megaraid_sas 0000:03:00.0: NVMe passthru support : Yes [ 12.771931] megaraid_sas 0000:03:00.0: FW provided TM TaskAbort/Reset timeou: 6 secs/60 secs [ 12.780503] megaraid_sas 0000:03:00.0: JBOD sequence map support : Yes [ 12.787000] megaraid_sas 0000:03:00.0: PCI Lane Margining support : No [ 12.819179] megaraid_sas 0000:03:00.0: NVME page size : (4096) [ 12.825672] megaraid_sas 0000:03:00.0: megasas_enable_intr_fusion is called outbound_intr_mask:0x40000000 [ 12.835199] megaraid_sas 0000:03:00.0: INIT adapter done [ 12.873932] megaraid_sas 0000:03:00.0: pci id : (0x1000)/(0x0017)/(0x19e5)/(0xd213) [ 12.881644] megaraid_sas 0000:03:00.0: unevenspan support : no [ 12.887451] megaraid_sas 0000:03:00.0: firmware crash dump : no [ 12.893344] megaraid_sas 0000:03:00.0: JBOD sequence map : enabled RAID controller init is now success and can detect the drives attached as well. Thanks, Shameer [0]. https://developer.arm.com/documentation/den0049/latest/ [1]. https://github.com/acpica/acpica/pull/638 Shameer Kolothum (4): ACPICA: IORT: Update for revision E ACPI/IORT: Add support for RMR node parsing ACPI/IORT: Add RMR memory regions reservation helper iommu/dma: Reserve any RMR regions associated with a dev drivers/acpi/arm64/iort.c | 175 +++++++++++++++++++++++++++++++++++++- drivers/iommu/dma-iommu.c | 12 ++- include/acpi/actbl2.h | 25 ++++-- include/linux/acpi_iort.h | 4 + 4 files changed, 205 insertions(+), 11 deletions(-)