From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936638AbdGTR0Q (ORCPT ); Thu, 20 Jul 2017 13:26:16 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52682 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933712AbdGTR0O (ORCPT ); Thu, 20 Jul 2017 13:26:14 -0400 From: Victor Aoqui To: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, aneesh.kumar@linux.vnet.ibm.com, mpe@ellerman.id.au, khandual@linux.vnet.ibm.com Cc: victora@br.ibm.com, victora@linux.vnet.ibm.com, mauricfo@linux.vnet.ibm.com Subject: [PATCH] powerpc/kernel: Avoid preemption check during iommu_range_alloc Date: Thu, 20 Jul 2017 14:26:06 -0300 X-Mailer: git-send-email 2.11.0 (Apple Git-81) X-TM-AS-MML: disable x-cbid: 17072017-0032-0000-0000-00000575BB5E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17072017-0033-0000-0000-000011FC04F2 Message-Id: <20170720172606.3811-1-victora@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-20_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707200268 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replaced __this_cpu_read function call by raw_cpu_read in iommu_range_alloc function. Preemption doesn't need to be disabled since any CPU can safely use IOMMU pool. Signed-off-by: Victor Aoqui --- arch/powerpc/kernel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 233ca3f..0e49a45 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -208,7 +208,7 @@ static unsigned long iommu_range_alloc(struct device *dev, * We don't need to disable preemption here because any CPU can * safely use any IOMMU pool. */ - pool_nr = __this_cpu_read(iommu_pool_hash) & (tbl->nr_pools - 1); + pool_nr = raw_cpu_read(iommu_pool_hash) & (tbl->nr_pools - 1); if (largealloc) pool = &(tbl->large_pool); -- 1.8.3.1