Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp577913ybk; Wed, 20 May 2020 07:01:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjR01Apl/VbRaKm99EnCw5zUG81Oc6IkF3l2NBemcThmvhGrtxDXnLhj72MmFZCx8Jfeb2 X-Received: by 2002:a50:b961:: with SMTP id m88mr3614000ede.4.1589983272124; Wed, 20 May 2020 07:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589983272; cv=none; d=google.com; s=arc-20160816; b=SLadu5crZY5IRrZLCOmZ6u0WrBL+UnVB+cceJglKMKSsFNHLVixBGCmrOX1KHYOsUq z0j8M6jLSCMKhE1+uUjzL7J9/y56pSMA47EO4Zdkc00EwJQ9W6L8wDrO1Le4i3fHdsuj Nv1lcNCqKdMURbCVjXiqtgQAXCljO4dKmabbJ/waxsjJFLIH1ln6DWfFutAc8sAnbOby taTDdyKhL571B9AIpgoVIdeHtzUurNY5hsXhOoVNbBg7MjLQ4m23PPs4JitmkMCU+TQp r5A0Zwfs5gyXNg6c43b17CF5lMjtvDP6F7sKV2exGt3lSR8cTKqu06l2XrKjv5Z3Nnt3 ZwQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=LG3KUsNiIMSosM1O6RTGMaOEPHOD9LLOulGEJ2/CZVw=; b=rI6L2j5ZDMSFvLgVbm45mbEGu7TEZNhv8y+ji+uyWP4GGVjKqYBJX6UCKVQ9F9vHd4 A389sDo9J4pzkweN7uZXh1RsdpHSNItSw5WC5zh98nopTGKfkZaaN7d9H0ZET99K707w TtfjBloRytuRXdVVLB7hxGUl5ke+bFIXa9cFSPTPO7aqS4WsH5pOQ5HOW0UmAukAPOK2 mAzsF6Wtj3oqVsQlGW0iaAyxYRALE7RZG/7oSC+zHcPYX4DImD6t4qkKp4GrQzVkQxna GAQshJhDgljt+DoXR+i/aD/gL07qpvrcGHLOAm6ctqj5iyh7x1plokaFhnYjrYpxj37j 85Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q/rc+qik"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si1782023eji.549.2020.05.20.07.00.47; Wed, 20 May 2020 07:01:12 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b="Q/rc+qik"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726801AbgETN5L (ORCPT + 99 others); Wed, 20 May 2020 09:57:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:45326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbgETN5K (ORCPT ); Wed, 20 May 2020 09:57:10 -0400 Received: from localhost (mobile-166-175-190-200.mycingular.net [166.175.190.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B1B5206C3; Wed, 20 May 2020 13:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589983030; bh=5+IbKprRxyqw9NFTJTpxeEJkrQ0uTWF2tKNer2QzvW4=; h=Date:From:To:Cc:Subject:From; b=Q/rc+qik2yM/X4meIPkIhKjBgLcKmYsuhXCObjnXLXQ53nzwMll4Yv32dZYOOT1xE tWoIGlrQa9rjeMjh+5+uDrP9wROLCoFgsVBfksIeeG1s4gEeIjL+DlC8/CFEq0rz34 dh199yR295AXjsr1E6Zq8j0sGBROxXWAjWbntkPo= Date: Wed, 20 May 2020 08:57:08 -0500 From: Bjorn Helgaas To: Paul Burton Cc: Krzysztof Wilczynski , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: piix4-poweroff.c I/O BAR usage Message-ID: <20200520135708.GA1086370@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, This looks like it might be a bug: static const int piix4_pm_io_region = PCI_BRIDGE_RESOURCES; static int piix4_poweroff_probe(struct pci_dev *dev, const struct pci_device_id *id) { ... /* Request access to the PIIX4 PM IO registers */ res = pci_request_region(dev, piix4_pm_io_region, "PIIX4 PM IO registers"); pci_request_region() takes a BAR number (0-5), but here we're passing PCI_BRIDGE_RESOURCES (13 if CONFIG_PCI_IOV, or 7 otherwise), which is the bridge I/O window. I don't think this device ([8086:7113]) is a bridge, so that resource should be empty. Based on this spec: https://www.intel.com/Assets/PDF/datasheet/290562.pdf, it looks like it should be the PIIX4 power management function at function 3, which has no standard PCI BARs but does have a PMBA (Power Management Base Address) at 0x40 and an SMBBA (SMBus Base Address) at 0x90 in config space. I suppose on an ACPI system the regions described by PMBA and SMBBA might be described via ACPI, since they're not discoverable by standard PCI enumeration? Pretty sure you don't have ACPI on MIPS though. Maybe the driver should read PMBA and SMBBA and reserve those regions by hand with request_region()? Bjorn