Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp961231pxb; Wed, 3 Mar 2021 22:37:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwh5RzjG37j9lqBCZYbEieY2BtXMUr/e7v3iXyLhXkOJWcVh86Y4pAMePN/2BABfzKdcE0K X-Received: by 2002:a17:906:2db2:: with SMTP id g18mr2639388eji.73.1614839868634; Wed, 03 Mar 2021 22:37:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839868; cv=none; d=google.com; s=arc-20160816; b=iColUUUa/aoGJohLhDdQOf/crCPlVrcgXonmBjwZ798g74eMtVUcTM9gh8N4gU1SUM RWLoWAwBJCSzlxJ4sTewzpfPQaGeu241R3GwLfuhIHQlc5YMsO3/rtWsppJYNhy6rqlQ LlcwnB52bT53N1TVp4NS9Kq+Jqw/T8nOGpIllgxsfz1evFfC4yc5JN+aTj9hhDKTY0UQ tr2DrV0DvquBJm1esXrPR8xQYXxmXv1ww26M/Yb5WF6KEoCC8Wi3Nbcn0+UTBk+J5pVP sGvG7PlWrJE5AYkSCZeJah9EiZLVAEuTPVkuDA+weW4JL4GrVMy1xUDGhjAjpeduJgX9 5I3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=mBGrIEpYLEoNjQaMEskuoQP/5ASxAATpFzpnXC1zzX8=; b=FkKpwuD7NBGnFf3d04nqoR28mtnQiCzGFA2bB4LKiL0MqLu9i+x2PcphOTGGZYCiEv /I5a7lwvR74C8FQfE84pVPGut+K9lN0DnUGx10SLeR8Lsdl1CAw++B0YkZOua1M1PNwW Vsd0bcUFCfyOoiLSOqkgDBEIjFEFwF+TeMKwIXkKD0F5f7emJtvny7ozTorDhxmPGGpk QXHzUwvtW3t5MPPYGiRNsprftaWZVjlO/lQVklasFiiDo18srauWRp6MEfvjOY0QB+oA sFomthxGvjHggSdYM1NpKT0n299t+VIR2oCA8EovxbMQ2Dz3fQlZ8joKtKjsL3mQT5rc R9Mg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc12si11203412edb.241.2021.03.03.22.37.26; Wed, 03 Mar 2021 22:37:48 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1839851AbhCBTzE (ORCPT + 99 others); Tue, 2 Mar 2021 14:55:04 -0500 Received: from mx.socionext.com ([202.248.49.38]:7344 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1580059AbhCBRWZ (ORCPT ); Tue, 2 Mar 2021 12:22:25 -0500 Received: from unknown (HELO iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 03 Mar 2021 02:21:37 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id 2AD5F2059035; Wed, 3 Mar 2021 02:21:37 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Wed, 3 Mar 2021 02:21:37 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan2.css.socionext.com (Postfix) with ESMTP id C362FB1D40; Wed, 3 Mar 2021 02:21:36 +0900 (JST) From: Kunihiko Hayashi To: Konrad Rzeszutek Wilk , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Jianxiong Gao Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [PATCH] swiotlb: Fix type of max_slot Date: Wed, 3 Mar 2021 02:21:28 +0900 Message-Id: <1614705688-10567-1-git-send-email-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After the refactoring phase, the type of max_slot has changed from unsigned long to unsigned int. The return type of the function get_max_slots() and the 4th argument type of iommu_is_span_boundary() are different from the type of max_slot. Finally, asserts BUG_ON in iommu_is_span_boundary(). Cc: Christoph Hellwig Fixes: 567d877f9a7d ("swiotlb: refactor swiotlb_tbl_map_single") Signed-off-by: Kunihiko Hayashi --- kernel/dma/swiotlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 369e4c3..c10e855 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -534,7 +534,7 @@ static int find_slots(struct device *dev, phys_addr_t orig_addr, unsigned long boundary_mask = dma_get_seg_boundary(dev); dma_addr_t tbl_dma_addr = phys_to_dma_unencrypted(dev, io_tlb_start) & boundary_mask; - unsigned int max_slots = get_max_slots(boundary_mask); + unsigned long max_slots = get_max_slots(boundary_mask); unsigned int iotlb_align_mask = dma_get_min_align_mask(dev) & ~(IO_TLB_SIZE - 1); unsigned int nslots = nr_slots(alloc_size), stride; -- 2.7.4