Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6896376pxv; Fri, 30 Jul 2021 05:20:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjNU1FSbNz5/ZiY9JJe4dNkNcdlbsLFBzbL0aDyJOVky5MqFNsCuro0fQoY2WaEAjZMH8J X-Received: by 2002:a05:6638:25c7:: with SMTP id u7mr1954711jat.26.1627647616077; Fri, 30 Jul 2021 05:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627647616; cv=none; d=google.com; s=arc-20160816; b=xmfX+wWg3HFxV6I6QJwwu/ZCd8w7O8Q1/vNjflWuISPgHen6vBZ/5+0W7p3bemBz4R 6llVJT0B8IblqBr2RP/x5342STI0R+XKXsD8rRiO1PwwcywATCntKLOl6qoje2u5vMh5 YV0waPKHyTijZQwSThYyiG5vGgQazAWwXFBrxeOca9WlZ8FmYhQ2z/NsS9gDpf6lkSAG bsD/sf3+eiUsePmpiAfEUy+izfsHttbC9k/ALl/mqrA5CCGrajXPoCR++BiOHq3N1AIp HZndokD952j6qMnV9XpnRUQIsrRhvwmaxLEnulRD3VWW5F2SFoFapc2I8uzwfJg/xP13 TK+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=SMM3pe9tuwST1Osu05RB58a3kMOn9N18cYM5hhDk5Ww=; b=MjuKhceMpwFlRGBTyVz6Q2G8a/ZpRLFVcY2BlAt9Mrkg0rWI5wu+88XIhqMMqtDFf4 HwBIZUa3/OLmTbN838oHZvL/x0gfIBSymff7oIBAQ6Ltt/4LR6wRK4JqztMeZS8NqwOD yzK4DoLLrAEVgvx1SXkZNq/OJIziX3+6lRVMaBEycd/37Dflb07vE2a04SK7tdOz8Y5v I4jiPCLET5b67vhSkPxZNxnrk0ZIE11B22LGfaNybMpaHNIJxuGrgw9hW2k92NJazuOT FhJnfJ4juW5DbLp1hQBGonWrNIzHgxqrOCCUlh3+q4z7BADfH4yAVEOOc79J+YJNJCHq fZqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t11si2143233ilu.68.2021.07.30.05.20.03; Fri, 30 Jul 2021 05:20:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238693AbhG3MRq (ORCPT + 99 others); Fri, 30 Jul 2021 08:17:46 -0400 Received: from foss.arm.com ([217.140.110.172]:41274 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbhG3MRq (ORCPT ); Fri, 30 Jul 2021 08:17:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 393261FB; Fri, 30 Jul 2021 05:17:41 -0700 (PDT) Received: from [10.57.36.146] (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 67CBD3F70D; Fri, 30 Jul 2021 05:17:39 -0700 (PDT) Subject: Re: [PATCH 2/2] arm64: dts: juno: Enable more SMMUs To: Anders Roxell , sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, liviu.dudau@arm.com Cc: linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org, arnd@arndb.de, lkft-triage@lists.linaro.org, Linux Kernel Functional Testing References: <720d0a9a42e33148fcac45cd39a727093a32bf32.1614965598.git.robin.murphy@arm.com> From: Robin Murphy Message-ID: <0a1d437d-9ea0-de83-3c19-e07f560ad37c@arm.com> Date: Fri, 30 Jul 2021 13:17:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-07-30 12:35, Anders Roxell wrote: > From: Robin Murphy > >> Now that PCI inbound window restrictions are handled generically between >> the of_pci resource parsing and the IOMMU layer, and described in the >> Juno DT, we can finally enable the PCIe SMMU without the risk of DMA >> mappings inadvertently allocating unusable addresses. >> >> Similarly, the relevant support for IOMMU mappings for peripheral >> transfers has been hooked up in the pl330 driver for ages, so we can >> happily enable the DMA SMMU without that breaking anything either. >> >> Signed-off-by: Robin Murphy > > When we build a kernel with 64k page size and run the ltp syscalls we > sporadically see a kernel crash while doing a mkfs on a connected SATA > drive. This is happening every third test run on any juno-r2 device in > the lab with the same kernel image (stable-rc 5.13.y, mainline and next) > with gcc-11. Hmm, I guess 64K pages might make a difference in that we'll chew through IOVA space a lot faster with small mappings... I'll have to try to reproduce this locally, since the interesting thing would be knowing what DMA address it was trying to use that went wrong, but IOMMU tracepoints and/or dma-debug are going to generate an crazy amount of data to sift through and try to correlate - having done it before it's not something I'd readily ask someone else to do for me :) On a hunch, though, does it make any difference if you remove the first entry from the PCIe "dma-ranges" (the 0x2c1c0000 one)? Robin. > Here is a snippet of the boot log [1]: > > + mkfs -t ext4 /dev/disk/by-id/ata-SanDisk_SDSSDA120G_165192443611 > mke2fs 1.43.8 (1-Jan-2018) > Discarding device blocks: 4096/29305200 > [ 55.344291] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 > frozen > [ 55.351423] ata1.00: irq_stat 0x00020002, failed to transmit command > FIS > [ 55.358205] ata1.00: failed command: DATA SET MANAGEMENT > [ 55.363561] ata1.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 12 > dma 512 out > [ 55.363561] res ec/ff:00:00:00:00/00:00:00:00:ec/00 Emask > 0x12 (ATA bus error) > [ 55.378955] ata1.00: status: { Busy } > [ 55.382658] ata1.00: error: { ICRC UNC AMNF IDNF ABRT } > [ 55.387947] ata1: hard resetting link > [ 55.391653] ata1: controller in dubious state, performing PORT_RST > [ 57.588447] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 0) > [ 57.613471] ata1.00: configured for UDMA/100 > [ 57.617866] ata1.00: device reported invalid CHS sector 0 > [ 57.623397] ata1: EH complete > > > When we revert this patch we don't see any issue. > > Reported-by: Linux Kernel Functional Testing > > Cheers, > Anders > [1] > https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.13.y/build/v5.13.5-225-g692072e7b7fa/testrun/5279599/suite/ltp-syscalls-tests/test/copy_file_range01/log >