Message ID | 20231028102059.66891-1-justin.he@arm.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp1140884vqb; Sat, 28 Oct 2023 03:23:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUa4M8AOiFeTmXt+9AD5qyOTG3r3vxA86pESuqiQxKOpGuT9cwNtZJvWO4ImFY0v9zAIWB X-Received: by 2002:a05:6808:7da:b0:3b2:e292:370 with SMTP id f26-20020a05680807da00b003b2e2920370mr5409584oij.38.1698488601838; Sat, 28 Oct 2023 03:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698488601; cv=none; d=google.com; s=arc-20160816; b=o0SVUY+GYYYg4sOA28pXHAjsIf4WpQ+yb0BGRv7saWaTA2WY8t5HFJPr1XzzYfC+XC IRTUyZROa+ks4ZJj8czKtPlNHGVveLFRFdhlxCmGOYqVaJ3sRC4aAAHiUpcNZF8BOqIf Vwg/+3kbGL+a6Zoa9zYmIxB1rMoTWEU6tNf8VhkC4z2oGFTsRdN/h2Hn5px2KmCAd7Bw 7I7GyHYO7CCY9XBJVV3qmnuXljIl8ITHMmYy7cqyC5mssGZEMlvDJBj/ZeezRRK9fASF liQPRTqIvfkXjgiXv8GiSwvIJ9bc83cY/24/iKZqWQgVTlR8/A4vV2hOgce4QsIeh34W ogbw== 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 :message-id:date:subject:cc:to:from; bh=tZei/pjhWxUyFgJMRm9Fn5UPJJAGjMWlWJLxYnPKS9Q=; fh=68tg6b1bPtmZVBq+B2APHMHzj3ZViBb0z45z2Kpdrwo=; b=P8WvDMvNcJm9dNNPEUA6lVpLsQrqKV1wrPyjtx1fbCUVcNHjp4ONW6tuHyyRaZ2bcO DdI7oWJmS54TD4nuZCIbf7eEmLMhQ55ihINjiOZgQeXL6/V5NFpT8e7hmlrl3QnuKiN9 V9nAywT4jnDXNF+EgqCqWXa5EhS/pPaZPd8m3q5ZkSV+R9E/aL86zF6ovdZHhOfQSHvl e0gM3PGo6g62HEGrJcciWYIO8I5QrxgZ6lYvcMigv1Bof8wk6gO0rFa2w1sodDI42OJz ifVYcbiZaVaa/eXj3QB3XgdkSJC4HrpMMcSN3dBL2hzFrrSBCM919CYjWe47zAeNBTlo OZlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id 36-20020a630c64000000b005b4a9b2f404si2305965pgm.710.2023.10.28.03.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 03:23:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8230A8024AF3; Sat, 28 Oct 2023 03:23:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229488AbjJ1KVP (ORCPT <rfc822;peter110.wang@gmail.com> + 28 others); Sat, 28 Oct 2023 06:21:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjJ1KVP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 28 Oct 2023 06:21:15 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 884A7E5 for <linux-kernel@vger.kernel.org>; Sat, 28 Oct 2023 03:21:12 -0700 (PDT) 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 552BF1424; Sat, 28 Oct 2023 03:21:53 -0700 (PDT) Received: from entos-ampere02.shanghai.arm.com (unknown [10.169.212.228]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3F7E73F64C; Sat, 28 Oct 2023 03:21:08 -0700 (PDT) From: Jia He <justin.he@arm.com> To: Christoph Hellwig <hch@lst.de>, Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, iommu@lists.linux.dev Cc: linux-kernel@vger.kernel.org, nd@arm.com, Jia He <justin.he@arm.com> Subject: [PATCH v4 0/2] fix dma_addressing_limited() if dma_range_map Date: Sat, 28 Oct 2023 10:20:57 +0000 Message-Id: <20231028102059.66891-1-justin.he@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 28 Oct 2023 03:23:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780994384127738562 X-GMAIL-MSGID: 1780994384127738562 |
Series |
fix dma_addressing_limited() if dma_range_map
|
|
Message
Justin He
Oct. 28, 2023, 10:20 a.m. UTC
This is to fix the hangs at boot. The root cause is the nvme device dma mapping is failed in the checking path of phys_to_dma() since dma_max_mapping_size() gave the wrong answer to start with. --- Changelog: v1: https://lore.kernel.org/all/20230912084002.2168-1-justin.he@arm.com/ v2: https://lore.kernel.org/lkml/20231010020835.3678-1-justin.he@arm.com/ - refine the subject and commit msg (By Robin Murphy) - refactor the checking loop in check_ram_in_range_map() in the pages unit to avoid wrap to 0 on 32bits platforms (Robin) v3: https://lore.kernel.org/lkml/20231016125254.1875-1-justin.he@arm.com/ - move and export dma_addressing_limited() to avoid adding a new exported helper (by Christoph Hellwig) v4: - refine the commit msg in patch01 - address patch02 coding style issues - add the dma ops check in dma_addressing_limited() (Christoph) - move dma_direct_all_ram_mapped() to direct.c (Christoph) Jia He (2): dma-mapping: move dma_addressing_limited() out of line dma-mapping: fix dma_addressing_limited() if dma_range_map can't cover all system RAM include/linux/dma-mapping.h | 19 +++++------------ kernel/dma/direct.c | 41 +++++++++++++++++++++++++++++++++++++ kernel/dma/direct.h | 1 + kernel/dma/mapping.c | 23 +++++++++++++++++++++ 4 files changed, 70 insertions(+), 14 deletions(-)
Comments
Thanks, this looks good to me, and I've applied this with two tweaks to the dma-apping tree.