From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933365AbcGGJAY (ORCPT ); Thu, 7 Jul 2016 05:00:24 -0400 Received: from mga11.intel.com ([192.55.52.93]:14343 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933066AbcGGJAT (ORCPT ); Thu, 7 Jul 2016 05:00:19 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,324,1464678000"; d="scan'208";a="1017187213" Date: Thu, 7 Jul 2016 12:00:13 +0300 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: Octavian Purdila , Len Brown , Matt Fleming , Mark Brown , Wolfram Sang , Joel Becker , "linux-acpi@vger.kernel.org" , linux-efi@vger.kernel.org, linux-i2c , linux-spi , lkml , Irina Tirdea , Leonard Crestez Subject: Re: [PATCH v5 2/8] acpi: fix enumeration (visited) flags for bus rescans Message-ID: <20160707090013.GK23527@lahna.fi.intel.com> References: <1467404352-27101-1-git-send-email-octavian.purdila@intel.com> <20160706150317.GH23527@lahna.fi.intel.com> <31239967.dEXrvihxAE@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31239967.dEXrvihxAE@vostro.rjw.lan> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 06, 2016 at 11:09:44PM +0200, Rafael J. Wysocki wrote: > On Wednesday, July 06, 2016 06:37:46 PM Octavian Purdila wrote: > > On Wed, Jul 6, 2016 at 6:03 PM, Mika Westerberg > > wrote: > > > On Fri, Jul 01, 2016 at 11:19:06PM +0300, Octavian Purdila wrote: > > >> If the ACPI tables changes as a result of a dinamically loaded table and > > >> a bus rescan is required the enumeration/visited flag are not > > >> consistent. > > >> > > >> I2C/SPI are not directly enumerated in acpi_bus_attach(), however the > > >> visited flag is set. This makes it impossible to check if an ACPI device > > >> has already been enumerated by the I2C and SPI subsystems. To fix this > > >> issue we only set the visited flags if the device is not I2C or SPI. > > >> > > >> With this change we also need to remove setting visited to false from > > >> acpi_bus_attach(), otherwise if we rescan already enumerated I2C/SPI > > >> devices we try to re-enumerate them. > > >> > > >> Note that I2C/SPI devices can be enumerated either via a scan handler > > >> (when using PRP0001) or via regular device_attach(). In either case > > >> the flow goes through acpi_default_enumeration() which makes it the > > >> ideal place to mark the ACPI device as enumerated. > > > > > > Hmm, this somehow fails to enumerate PRP0001 devices. > > > > > > I'm adding following SSDT to my initrd and the resulting device is never > > > enumerated on SPI bus (it exists in /sys/bus/acpi/devices). If I use > > > normal ACPI IDs (non-PRP0001) then it works fine. > > > > > > > I specifically tested with PRP0001 via initrd with I2C, I am not sure > > why it does not work on SPI. I'll give it a try tomorrow when I have > > access to my setup. > > OK, I'll wait for this test to conclude before applying the series, then. :-) I tested again and it works fine. I probably had an older version of the series applied or something like that. Now, I'm able to see my AT25 SPI eeprom successfully probed: [ 7.264705] at25 spi-PRP0001:00: 1 KByte at25 eeprom, pagesize 32 Sorry about the confusion.