From patchwork Fri Feb 9 16:49:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 199001 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp985329dyd; Fri, 9 Feb 2024 08:55:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+Zj0uQPbgZNxcmLAVD5l5CxQRCntnH7dAGm00kwySfynaSzuy+OojomzBHL5nJqr9DMdd X-Received: by 2002:a05:622a:1649:b0:42c:60b2:10c6 with SMTP id y9-20020a05622a164900b0042c60b210c6mr1189915qtj.35.1707497701824; Fri, 09 Feb 2024 08:55:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707497701; cv=pass; d=google.com; s=arc-20160816; b=duekhRaB/Yn0+gvbEkjfqfQI+Y7VBIzKlSjwgXx83pERF4eAKQ8pYIQ9JzLJgHQAQJ 4h8W6BRzWSCKcgZAlQvHE66Hbi9cvQI1MWbc21J2tWb5EoPuLiEdd4eK4HahoLOGjbO2 RhUCUuYAcCcAVaaxcJQR3Itl9y+9xBdKPjx2vJjvcv6ZSuzkAFlFoYAYb2BkCpy48wg0 l9p22reSqKyTIJeejgqeJmW/XWSnG3qGzh5Ho/u5kv8sFmOSrQqF4ZVmZq3gOjf6CtEW YqTG1wNPxE3urY56RiSx9W1p63ull+wutYUlpa4bPy8e3tyMe/7GGfhME0p7Pip5Nvww 0ocg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=lo5WCo84XMUZLomSoeZcC3ui5P1IgcAkfSqd59c/Ddc=; fh=Q4z5X4k8tgv+eYhvl/WX6Hro0GgxmmYqim4WPUeQo8c=; b=f5M3KoJysILiLPsmY3r6pjLHl+xyS7tRWkhsCzLmnagKERoSm6ViYA+xhhyvqPtb+o hBhAlzHlJrnBXroU0LiHQ9l5Tfq/F6/Za3ScrcxNZDLfAeVJnNoQAyRIUwJkPBEjyITS Glr1WLN8Jr3xhLAynjY+6Nnkg5tM5efl9weWwURIzL9El6Wd5H9TIQVPyZAI6YLEl216 mfo6kx14WdL2G8dtsMxz/cThxpOe72/lULP3KyILYfvjpIkhwQZrNFYjsiLLy7k1V2Se Dsytb5Nh8M98vQ/1RAIiV7SI5kjAENiAC/SpMj0DR4CvoocPMoJyk03NKvOlgM07BnxE ccEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-59673-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59673-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCUXwdm0qKe4CBpPmI8ySXI9p4RR3t9vS/Te7vibsE+k8mDlxolr7gn9F+rrgM6xKUcVAoG7p3UTREd7qR0WN8+UA7UGwA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j11-20020ac85c4b000000b0042c2e4f5c68si2255958qtj.631.2024.02.09.08.55.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 08:55:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59673-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-59673-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59673-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9831D1C20F84 for ; Fri, 9 Feb 2024 16:55:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DF3D82874; Fri, 9 Feb 2024 16:50:31 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C89B80BF6; Fri, 9 Feb 2024 16:50:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707497429; cv=none; b=lNPfiRL9YA0mAN9VSOrb2pgvGAA9QwQUeJwfdkRSXYoiJnxhDG2COqIgacr50vaXw7a2k/rwm7rcivDB+H+gJtE2tG4e79JADmwg9KcdXE+bMuXizEuE+84OC3/CscvWifvzZn3+X+METq2cT9GNZOie9uStF3swImGYiHmfiVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707497429; c=relaxed/simple; bh=78sazIr90PfD2p3pMcVPhdyFlfiEISIeaG+WW9mJPWA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=K2WZeKe83pXGBZ7MtnW/o91asr+8l4CXVtnv4xMNS1VZXNKtBFIq05eiGdKHykBaFqrtaBJ0SCoMbAukssgNJ8YGXy+fK2056kOgqHxxth1ly4AZ1lhOo57QW0cXGKzjSQL+LID9+YkdX7NIW8OJfrxDP4+hBIP+MnHEP1WTtMc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 A64EFFEC; Fri, 9 Feb 2024 08:51:08 -0800 (PST) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D0E8C3F64C; Fri, 9 Feb 2024 08:50:22 -0800 (PST) From: Robin Murphy To: Cc: Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Paul Walmsley , Palmer Dabbelt , Albert Ou , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Suravee Suthikulpanit , David Woodhouse , Lu Baolu , Niklas Schnelle , Matthew Rosato , Gerald Schaefer , Jean-Philippe Brucker , Rob Herring , Frank Rowand , Marek Szyprowski , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Rob Herring Subject: [PATCH v3 1/7] OF: Retire dma-ranges mask workaround Date: Fri, 9 Feb 2024 16:49:58 +0000 Message-Id: <3d759722a5bd898dc5736048b4a5f30689c33888.1707493264.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.39.2.101.g768bb238c484.dirty In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790441110020618349 X-GMAIL-MSGID: 1790441110020618349 The fixup adding 1 to the dma-ranges size may have been for the benefit of some early AMD Seattle DTs, or may have merely been a just-in-case, but either way anyone who might have deserved to get the message has hopefully seen the warning in the 9 years we've had it there. The modern dma_range_map mechanism should happily handle odd-sized ranges with no ill effect, so there's little need to care anyway now. Clean it up. Acked-by: Rob Herring Signed-off-by: Robin Murphy --- v2: Tweak commit message --- drivers/of/device.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/of/device.c b/drivers/of/device.c index de89f9906375..a988bee2ee5a 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -129,22 +129,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, dma_end = r->dma_start + r->size; } size = dma_end - dma_start; - - /* - * Add a work around to treat the size as mask + 1 in case - * it is defined in DT as a mask. - */ - if (size & 1) { - dev_warn(dev, "Invalid size 0x%llx for dma-range(s)\n", - size); - size = size + 1; - } - - if (!size) { - dev_err(dev, "Adjusted size 0x%llx invalid\n", size); - kfree(map); - return -EINVAL; - } } /*