Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755504AbbLGKQk (ORCPT ); Mon, 7 Dec 2015 05:16:40 -0500 Received: from mga01.intel.com ([192.55.52.88]:36926 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755150AbbLGKQj (ORCPT ); Mon, 7 Dec 2015 05:16:39 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,394,1444719600"; d="scan'208";a="835836058" Date: Mon, 7 Dec 2015 12:16:36 +0200 From: Jarkko Sakkinen To: "Wilck, Martin" Cc: Jason Gunthorpe , "tpmdd-devel@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [tpmdd-devel] [PATCH v2 0/3] tpm_tis: Clean up force module parameter Message-ID: <20151207101635.GA20456@intel.com> References: <20151201213351.GC5071@intel.com> <20151202182726.GB30972@obsidianresearch.com> <20151202191155.GA2832@obsidianresearch.com> <20151203060042.GB10359@intel.com> <20151203181932.GA22973@obsidianresearch.com> <20151206040226.GA4396@intel.com> <20151206041544.GA5585@intel.com> <20151207085626.GA15567@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1747 Lines: 43 On Mon, Dec 07, 2015 at 10:52:51AM +0100, Wilck, Martin wrote: > > > > You can completely ignore this question. I saw Martins reply with a fix for > > > > "tpm_tis: Use devm_ioremap_resource" that you should squash into that > > > > change. So it's proved that TPM ACPI device objects do not always have a > > > > memory resource. Good. > > > > > > Repeat, the memory resource DOES exist on my system. Not sure what proof > > > you saw there. > > > > Ok, lets go this through. > > > > I deduced this from two facts: > > > > * It used to have memory resource as conditional and as a fallback use > > fixed value. > > * Your workaround reverted the situation to this. > > > > Did I understand something incorrectly? > > The problem in my case didn't occur because ACPI was lacking a resource. > It has one "extra" resource that Jason's original code didn't > recognize. > > Jason's code was wrongly assuming that a resource that isn't of type > "IRQ" has to be of type "MEMORY". If I print out the resource types > encountered in tpm_check_resource(), I get > ACPI_RESOURCE_TYPE_FIXED_MEMORY32 (0x0a) first, followed by > ACPI_RESOURCE_TYPE_END_TAG (0x07). The latter was mistakenly used by > Jason't code as a memory resource. This is how ACPI ResourceTemplates > work (a list with an end marker). The correct solution is to always > check the return value of acpi_dev_resource_memory(), as it's currently > implemented in Jason't current "for-jarkko" branch. Aah. Right. > Martin /Jarkko -- 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/