Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754580AbaDOUiI (ORCPT ); Tue, 15 Apr 2014 16:38:08 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:56324 "EHLO jenni1.inet.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979AbaDOUiF (ORCPT ); Tue, 15 Apr 2014 16:38:05 -0400 Date: Tue, 15 Apr 2014 23:35:10 +0300 From: "Kirill A. Shutemov" To: Stephane Eranian Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@elte.hu, sfr@canb.auug.org.au, hpa@zytor.com Subject: Re: [PATCH v2] perf/x86/uncore: fix compilation warning in snb_uncore_imc_init_box() Message-ID: <20140415203510.GA17037@node.dhcp.inet.fi> References: <20140311235329.GA28624@quad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140311235329.GA28624@quad> User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 12, 2014 at 12:53:30AM +0100, Stephane Eranian wrote: > > This patch fixes a compilation problem (unused variable) with the > new SNB/IVB/HSW uncore IMC code. > > In V2, we simplify the fix as suggested by Peter Zjilstra. > > Reported-by: Stephen Rothwell > Signed-off-by: Stephane Eranian > -- > > diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c > index 3e5b240..d614f6b 100644 > --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c > +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c > @@ -1722,15 +1722,16 @@ static struct attribute_group snb_uncore_imc_format_group = { > static void snb_uncore_imc_init_box(struct intel_uncore_box *box) > { > struct pci_dev *pdev = box->pci_dev; > - u32 addr_lo, addr_hi; > + int where = SNB_UNCORE_PCI_IMC_BAR_OFFSET; > + u32 pci_dword; > resource_size_t addr; > > - pci_read_config_dword(pdev, SNB_UNCORE_PCI_IMC_BAR_OFFSET, &addr_lo); > - addr = addr_lo; > + pci_read_config_dword(pdev, where, &pci_dword); > + addr = pci_dword; > > #ifdef CONFIG_PHYS_ADDR_T_64BIT > - pci_read_config_dword(pdev, SNB_UNCORE_PCI_IMC_BAR_OFFSET+4, &addr_hi); > - addr = ((resource_size_t)addr_hi << 32) | addr_lo; > + pci_read_config_dword(pdev, where + 4, &pci_dword); > + addr |= ((resource_size_t)pci_dword << 32); > #endif > > addr &= ~(PAGE_SIZE - 1); I see the warning on my laptop (X1 Carbon), which probably related to the commit: [ 0.559204] ------------[ cut here ]------------ [ 0.559216] WARNING: CPU: 2 PID: 1 at /home/kas/git/public/linux/arch/x86/mm/ioremap.c:171 __ioremap_caller+0x2e3/0x390() [ 0.559225] Info: mapping multiple BARs. Your kernel is fine. [ 0.559230] Modules linked in: [ 0.559238] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 3.15.0-rc1-00012-g55101e2d6ce1 #38 [ 0.559246] Hardware name: LENOVO 3460CC6/3460CC6, BIOS G6ET93WW (2.53 ) 02/04/2013 [ 0.559254] 0000000000000009 ffff8801182f3b60 ffffffff81a2274e ffff8801182f3ba8 [ 0.559264] ffff8801182f3b98 ffffffff810db97d ffffc90000658000 00000000fed16000 [ 0.559274] ffffc90000658000 ffffc90000658000 0000000000006000 ffff8801182f3bf8 [ 0.559284] Call Trace: [ 0.559293] [] dump_stack+0x4d/0x6f [ 0.559300] [] warn_slowpath_common+0x7d/0xa0 [ 0.559307] [] warn_slowpath_fmt+0x4c/0x50 [ 0.559316] [] ? iomem_map_sanity_check+0xac/0xe0 [ 0.559324] [] __ioremap_caller+0x2e3/0x390 [ 0.559332] [] ioremap_nocache+0x17/0x20 [ 0.559339] [] snb_uncore_imc_init_box+0x65/0x90 [ 0.559348] [] uncore_pci_probe+0xd8/0x1b0 [ 0.559356] [] local_pci_probe+0x45/0xa0 [ 0.559364] [] ? pci_match_device+0xc5/0xd0 [ 0.559371] [] pci_device_probe+0xd9/0x130 [ 0.559379] [] driver_probe_device+0x87/0x390 [ 0.559385] [] __driver_attach+0x93/0xa0 [ 0.559392] [] ? __device_attach+0x40/0x40 [ 0.559401] [] bus_for_each_dev+0x6b/0xb0 [ 0.559408] [] driver_attach+0x1e/0x20 [ 0.559415] [] bus_add_driver+0x188/0x260 [ 0.559425] [] ? uncore_pmu_register+0xdb/0xdb [ 0.559432] [] driver_register+0x64/0xf0 [ 0.559439] [] ? uncore_pmu_register+0xdb/0xdb [ 0.559446] [] __pci_register_driver+0x60/0x70 [ 0.559454] [] intel_uncore_init+0x175/0x42b [ 0.559461] [] ? uncore_pmu_register+0xdb/0xdb [ 0.559470] [] do_one_initcall+0xfa/0x1b0 [ 0.559479] [] ? parse_args+0x225/0x3f0 [ 0.559487] [] kernel_init_freeable+0x1da/0x25f [ 0.559495] [] ? do_early_param+0x88/0x88 [ 0.559504] [] ? rest_init+0x140/0x140 [ 0.559511] [] kernel_init+0xe/0xf0 [ 0.559519] [] ret_from_fork+0x7c/0xb0 [ 0.559526] [] ? rest_init+0x140/0x140 [ 0.559538] ---[ end trace 2d7d94a103087769 ]--- -- Kirill A. Shutemov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/