Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1708084ybi; Wed, 17 Jul 2019 20:30:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiZPCn9YQbVGX5WTAV3bqWIYRN6Wb/DQhDkzEgm0QCYwrJ6fj+yq1sddpaY6nfY7rqE6Iv X-Received: by 2002:a17:902:2a29:: with SMTP id i38mr47776760plb.46.1563420653681; Wed, 17 Jul 2019 20:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563420653; cv=none; d=google.com; s=arc-20160816; b=gZn0kz7hiPoQpX0pPMyvHabslrsRKG1papE1KrTPOYeC4BP2arOop6voTgTDyyYyg8 L9J0g88VK/gaX7SryTsyROFpmJg8l9aegowmUHAj3lgNKl26OQJdLsdOg92FysRIB+AQ I8ai6MIJ7JLFypMPj7LT6AsyY9n4NdNGIEZw/5B4YB95HTHSonNLCxuL1iLSCIF6Vp35 Jpz2xLRh5hku+xCic61e8f6PoRu93NrogDeHsHDpgyprI6HRb5nrz/KIuwRTWoQSjF0u dma1n/cD2LFflSGg41BVFFOxxz/w0YX7lk9tAlJA4Evj9VugHcFEqM+JU8ohzTPSVBbO 93tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=aekjeOyBLXtXtmLr8heIfnlzF9kRkZ5Y2yO03MqvxWk=; b=nWZqjsz7c7iZqc0K+KKek3/b+7ofc8acFgB31YFd0U1uoP0Iyh8UzjfTmV5TGlgeMR pl15V0YWG0Jn2J0CvcRFUoRm8yKi4FoETScBnMIreinugyDTEeoRWFZKDVvS/4pLfBp2 UUWl/rZV23FpQQnFUHVF9IAQo1Q2ZLAnSsUjyrGt6oaMF9P1/Hh5F1p0pbOXyG2r5936 L2LCGj46GcwEdROpb3+KogG+KLEwr7HxJ7aRMU7nHb57ctkh1S2fM0MmQ6bVSzODnzaZ /iAKu45A2tZaU/5/xCzyUG6Vwkh9iWIyFV5lcs5l3J0JBKxcSDLk4oszGoKveViDl0g2 PU1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a16si872474pju.24.2019.07.17.20.30.37; Wed, 17 Jul 2019 20:30:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389741AbfGRD3y (ORCPT + 99 others); Wed, 17 Jul 2019 23:29:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:24132 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389577AbfGRD3x (ORCPT ); Wed, 17 Jul 2019 23:29:53 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6I3S3k2020823; Wed, 17 Jul 2019 23:29:32 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ttd5fxwnb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jul 2019 23:29:31 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x6I3TVL6023563; Wed, 17 Jul 2019 23:29:31 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ttd5fxwmp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jul 2019 23:29:31 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x6I3Q8gY026039; Thu, 18 Jul 2019 03:29:30 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma03dal.us.ibm.com with ESMTP id 2tq6x7mhxw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Jul 2019 03:29:30 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6I3TT2E14156636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Jul 2019 03:29:29 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 767D3AE060; Thu, 18 Jul 2019 03:29:29 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 466E4AE05C; Thu, 18 Jul 2019 03:29:25 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.85.129.123]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 18 Jul 2019 03:29:25 +0000 (GMT) From: Thiago Jung Bauermann To: x86@kernel.org Cc: iommu@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Konrad Rzeszutek Wilk , Alexey Dobriyan , Thomas Lendacky , Halil Pasic , Mike Anderson , Ram Pai , Thiago Jung Bauermann Subject: [PATCH v3 3/6] dma-mapping: Remove dma_check_mask() Date: Thu, 18 Jul 2019 00:28:55 -0300 Message-Id: <20190718032858.28744-4-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190718032858.28744-1-bauerman@linux.ibm.com> References: <20190718032858.28744-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-18_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907180037 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sme_active() is an x86-specific function so it's better not to call it from generic code. Christoph Hellwig mentioned that "There is no reason why we should have a special debug printk just for one specific reason why there is a requirement for a large DMA mask.", so just remove dma_check_mask(). Signed-off-by: Thiago Jung Bauermann --- kernel/dma/mapping.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 1f628e7ac709..61eeefbfcb36 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -291,12 +291,6 @@ void dma_free_attrs(struct device *dev, size_t size, void *cpu_addr, } EXPORT_SYMBOL(dma_free_attrs); -static inline void dma_check_mask(struct device *dev, u64 mask) -{ - if (sme_active() && (mask < (((u64)sme_get_me_mask() << 1) - 1))) - dev_warn(dev, "SME is active, device will require DMA bounce buffers\n"); -} - int dma_supported(struct device *dev, u64 mask) { const struct dma_map_ops *ops = get_dma_ops(dev); @@ -327,7 +321,6 @@ int dma_set_mask(struct device *dev, u64 mask) return -EIO; arch_dma_set_mask(dev, mask); - dma_check_mask(dev, mask); *dev->dma_mask = mask; return 0; } @@ -345,7 +338,6 @@ int dma_set_coherent_mask(struct device *dev, u64 mask) if (!dma_supported(dev, mask)) return -EIO; - dma_check_mask(dev, mask); dev->coherent_dma_mask = mask; return 0; }