From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754458AbdGCNFa (ORCPT ); Mon, 3 Jul 2017 09:05:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:55648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752567AbdGCNF3 (ORCPT ); Mon, 3 Jul 2017 09:05:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1874B22B5F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Mon, 3 Jul 2017 08:05:26 -0500 From: Bjorn Helgaas To: Lukas Wunner Cc: Ethan Zhao , Chen Yu , linux-pci , LKML , thejoe@gmail.com, "Rafael J. Wysocki" Subject: Re: [PATCH] PCI: Work around poweroff & suspend-to-RAM issue on Macbook Pro 11 Message-ID: <20170703130526.GC13824@bhelgaas-glaptop.roam.corp.google.com> References: <20170702205948.GB18324@bhelgaas-glaptop.roam.corp.google.com> <20170703042621.GA22429@yu-desktop-1.sh.intel.com> <20170703091048.GA15823@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170703091048.GA15823@wunner.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 03, 2017 at 11:10:48AM +0200, Lukas Wunner wrote: > On Mon, Jul 03, 2017 at 02:33:39PM +0800, Ethan Zhao wrote: > > On Mon, Jul 3, 2017 at 12:26 PM, Chen Yu wrote: > > > On Sun, Jul 02, 2017 at 03:59:48PM -0500, Bjorn Helgaas wrote: > > >> --- a/arch/x86/pci/fixup.c > > >> +++ b/arch/x86/pci/fixup.c > [snip] > > >> +static void quirk_apple_mbp_poweroff(struct pci_dev *pdev) > > >> +{ > > >> + struct device *dev = &pdev->dev; > > >> + struct resource *res; > > >> + > > >> + if ((!dmi_match(DMI_PRODUCT_NAME, "MacBookPro11,4") && > > >> + !dmi_match(DMI_PRODUCT_NAME, "MacBookPro11,5")) || > > >> + pdev->bus->number != 0 || pdev->devfn != PCI_DEVFN(0x1c, 0)) > > >> + return; > > >> + > > > Not sure why we need to also the bus number of devfn, as there > > > is only one PCI bridge that would match 0x8c10? according to > > > https://bugzilla.kernel.org/attachment.cgi?id=210611 > > > am I missing something? > > > > To make sure it runs only once only when 00:1c.0 is 0x8c10 ? > > Each root port has a different PCI device ID and is only present once > on the affected machines, so I think Chen Yu is right. > > Actually, since the quirk is now related to a memory region and no longer > to a specific PCI device, it need not be a PCI fixup. It could go into > arch/x86/kernel/setup.c:trim_platform_memory_ranges() as a DMI quirk. > > This would also allow declaration of the code as __init. That's a good idea, but I don't know what (if any) ordering issues we'd have with reserving this region vs. the host bridge windows. If somebody wants to rework this and test it, I'd be glad to replace the current patch. If you do, please collect the /proc/iomem contents to make sure they look reasonable. Bjorn