From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com ([192.55.52.120]:14402 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751211AbcHHH4r (ORCPT ); Mon, 8 Aug 2016 03:56:47 -0400 Date: Mon, 8 Aug 2016 10:56:42 +0300 From: Mika Westerberg To: Jean Delvare Cc: stable@vger.kernel.org, gregkh@linuxfoundation.org, benjamin.tissoires@redhat.com, luto@kernel.org, pali.rohar@gmail.com, rafael.j.wysocki@intel.com, wsa@the-dreams.de Subject: Re: [PATCH v4.4+v4.6] i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR Message-ID: <20160808075642.GS14693@lahna.fi.intel.com> References: <20160728115111.5ccb8299@endymion> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160728115111.5ccb8299@endymion> Sender: stable-owner@vger.kernel.org List-ID: On Thu, Jul 28, 2016 at 11:51:11AM +0200, Jean Delvare wrote: > Upstream commit: a7ae81952cdab56a1277bd2f9ed7284c0f575120 > > Many Intel systems the BIOS declares a SystemIO OpRegion below the SMBus > PCI device as can be seen in ACPI DSDT table from Lenovo Yoga 900: > > Device (SBUS) > { > OperationRegion (SMBI, SystemIO, (SBAR << 0x05), 0x10) > Field (SMBI, ByteAcc, NoLock, Preserve) > { > HSTS, 8, > Offset (0x02), > HCON, 8, > HCOM, 8, > TXSA, 8, > DAT0, 8, > DAT1, 8, > HBDR, 8, > PECR, 8, > RXSA, 8, > SDAT, 16 > } > > There are also bunch of AML methods that that the BIOS can use to access > these fields. Most of the systems in question AML methods accessing the > SMBI OpRegion are never used. > > Now, because of this SMBI OpRegion many systems fail to load the SMBus > driver with an error looking like one below: > > ACPI Warning: SystemIO range 0x0000000000003040-0x000000000000305F > conflicts with OpRegion 0x0000000000003040-0x000000000000304F > (\_SB.PCI0.SBUS.SMBI) (20160108/utaddress-255) > ACPI: If an ACPI driver is available for this device, you should use > it instead of the native driver > > The reason is that this SMBI OpRegion conflicts with the PCI BAR used by > the SMBus driver. > > It turns out that we can install a custom SystemIO address space handler > for the SMBus device to intercept all accesses through that OpRegion. This > allows us to share the PCI BAR with the AML code if it for some reason is > using it. We do not expect that this OpRegion handler will ever be called > but if it is we print a warning and prevent all access from the SMBus > driver itself. > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=110041 > Reported-by: Andy Lutomirski > Reported-by: Pali Roh�r > Suggested-by: Rafael J. Wysocki > Signed-off-by: Mika Westerberg > Acked-by: Rafael J. Wysocki > Reviewed-by: Jean Delvare > Reviewed-by: Benjamin Tissoires > Tested-by: Pali Roh�r > Tested-by: Jean Delvare > Signed-off-by: Wolfram Sang > Cc: stable@vger.kernel.org > --- > This is a backport of upstream commit > a7ae81952cdab56a1277bd2f9ed7284c0f575120 suitable for kernels v4.4 and > v4.6. Thanks. Sorry for being non-responsive - I was on vacation and just came back. Thanks Jean for taking care of backporting this.