From patchwork Wed Aug 9 21:25:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 109754 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1448584qge; Wed, 9 Aug 2017 14:26:10 -0700 (PDT) X-Received: by 10.84.128.76 with SMTP id 70mr10378333pla.56.1502313970401; Wed, 09 Aug 2017 14:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502313970; cv=none; d=google.com; s=arc-20160816; b=CPgryRYeXaSwksXD25e3eF/1SOpdcG8MbfGkSl9SvsnmxAdOK2d4xayzoBxI14LaAX WS7UXurv0sP0FKSYh+6w8Tv+SbWghs3CKBoF+ifgXt1eEhsX1Vm+RkOZBCPif4e/MyIY m/OsJcUkHNBPq+MMVNDMkZIr79nDUiTA6bjwx1CeHyuf3NSN/QtVTBKo3eKHAAzxFhje QB5SfVScDGYrTeX6YoakjBtYEadxsMP1NlNPyG9wphDiMgrp3QL8bZRuMxzc5df8gcln AmuVCcKGl/hE2mbAsmXK8iPCibVICHDST8cPM4jiGUMjxXTe1dX/2w1PgW05Jkix1BwE WV0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=CUIqMIvUifdnAC1bvkTAUf5wLVAEt3ekf6TriBO/hM4=; b=V2rUtZLTq9zfI9qhAgNX/VY0N/r9wgbnOIOT0HlRTYLvIvK0LWwf04H3NLBeBxDzyF 4nosnZ4MUmVCxPpDIPhFnpYWDnasVdjwvgKJo0D1SrvZPelUQxLebRdxKn/5K1cGsnfq u5Y3tfRR9pKh+tkZ79re1Cv78X8VvLJyRwRiibsmsrTaCU+RSnjBjw4G0jbQgzvPhuRk T1xXVk/qeOl4xvvM5XNECjF8hvMr10JloWsLH8kmu38YELFk0pPyBdq0zO5UKiR42JlV HhKkvvm12lTTvspS3IpylU3Y2OzyuRNqHsynMLl3DvQ1p+M2wuBa7b4ZJB9561ql2Qw8 d1Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=p03NF1CU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10si2954766pgf.82.2017.08.09.14.26.10; Wed, 09 Aug 2017 14:26:10 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=p03NF1CU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752332AbdHIV0G (ORCPT + 25 others); Wed, 9 Aug 2017 17:26:06 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:36981 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751958AbdHIV0E (ORCPT ); Wed, 9 Aug 2017 17:26:04 -0400 Received: by mail-oi0-f68.google.com with SMTP id j194so6866599oib.4 for ; Wed, 09 Aug 2017 14:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=CUIqMIvUifdnAC1bvkTAUf5wLVAEt3ekf6TriBO/hM4=; b=p03NF1CU/H0bnz4hppoTADBcbb0fzMM1q4X7Fs2WyHlJzpDb64hFZX5KXTXPv2dUw2 nV1iY6pu2GooM2mKTBfcwlC6WqGrlTX+g6mNdH0uNk3QsTyJemfJz24iEDEqdD3AP1FB Gwk9JaHq+/ou3ItI+k+nl0lJhCrSpql3mytFU/4///ToB0tkGi4ElG6DYNaZFZsmMuz+ qjdw70dpjv1ipDjyD4uC9v9niBy+c01NtfAhjrNNM8RQal11N3lpOMTNg2k/fsPYs/TP p/GZ5rZTH6NP4d0tUakBLMLJiDq3xyAcb6MoJ7we8p4zTpoj+v8S+35KotTTZUll+Mjf hg7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=CUIqMIvUifdnAC1bvkTAUf5wLVAEt3ekf6TriBO/hM4=; b=PPd8AyJeOYm7RGqhCNKT1GY/juwM8EiJs4wwYPM+1IUNkNUaiQpZftpVCItfM0HLak iY0SbzmVm3XvGNv2oVqsrthhv/USTI9v15q+6uI45VEgsuNfAZXKrPnpBI0mQAX9qWDe UkF/FMaVKY7S6gfjURkLxTj/dJZ+yGS8O4teD63NCYD0GEEI0YMCMSCMp8+YGkF9I/vL uS7DNpH2RPWxAcPlRVnNxRahQfpabjhm9tPuqYDVD+0bTcHgMgTdqMYeYlsfD2GbIWI0 7c8U2CfunecJprJ9rObR24rzyYepHApfyXZTdBwB+0MOdyqGZAadNRgFR1MiBNAC5HyI ThiQ== X-Gm-Message-State: AHYfb5gKUzFfLAZj2GVds+AFwtl9L8O14BzpUvjB8iPMKhJ9ng+IGKrz 3jC9FkcnBLO+4QN/aAk= X-Received: by 10.202.190.4 with SMTP id o4mr9646713oif.122.1502313964220; Wed, 09 Aug 2017 14:26:04 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id p63sm5876199oie.8.2017.08.09.14.26.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Aug 2017 14:26:02 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 7EF6D329; Wed, 9 Aug 2017 16:26:01 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id B4EF2300A65; Wed, 9 Aug 2017 16:26:00 -0500 (CDT) From: minyard@acm.org To: linux-mips@linux-mips.org, ralf@linux-mips.org, linux-kernel@vger.kernel.org Cc: Corey Minyard Subject: [PATCH] mips: Fix using smp_processor_id() when preemptible Date: Wed, 9 Aug 2017 16:25:50 -0500 Message-Id: <1502313950-725-1-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Corey Minyard I was getting the following: BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 caller is pcibios_set_cache_line_size+0x10/0x58 pcibios_set_cache_line_size() used current_cpu_data outside of an unpreemptible context. Signed-off-by: Corey Minyard --- arch/mips/pci/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index bd67ac7..afd2f8a 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c @@ -28,9 +28,11 @@ EXPORT_SYMBOL(PCIBIOS_MIN_MEM); static int __init pcibios_set_cache_line_size(void) { - struct cpuinfo_mips *c = ¤t_cpu_data; + struct cpuinfo_mips *c; unsigned int lsize; + preempt_disable(); + c = ¤t_cpu_data; /* * Set PCI cacheline size to that of the highest level in the * cache hierarchy. @@ -38,6 +40,7 @@ static int __init pcibios_set_cache_line_size(void) lsize = c->dcache.linesz; lsize = c->scache.linesz ? : lsize; lsize = c->tcache.linesz ? : lsize; + preempt_enable(); BUG_ON(!lsize);