From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757105AbcBRULg (ORCPT ); Thu, 18 Feb 2016 15:11:36 -0500 Received: from mga04.intel.com ([192.55.52.120]:9645 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757082AbcBRULe (ORCPT ); Thu, 18 Feb 2016 15:11:34 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,467,1449561600"; d="scan'208";a="655205821" Date: Thu, 18 Feb 2016 22:10:35 +0200 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: Peter Huewe , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [tpmdd-devel] [PATCH] tpm_crb: fix: associate to the correct device Message-ID: <20160218201035.GA7033@intel.com> References: <1455708211-9653-1-git-send-email-jarkko.sakkinen@linux.intel.com> <20160218180331.GA7191@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160218180331.GA7191@obsidianresearch.com> 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 On Thu, Feb 18, 2016 at 11:03:31AM -0700, Jason Gunthorpe wrote: > On Wed, Feb 17, 2016 at 01:23:31PM +0200, Jarkko Sakkinen wrote: > > At the moment for tpm_crb /proc/iomem shows the HW interface and not the > > device using the memory range. This patch fixes the issue by associating > > memory mappings to the TPM character device. > > > > The end result is this: > > > > $ cat /proc/iomem|grep MSFT -A2 > > dbfff000-dbffffff : MSFT0101:00 > > dbfff000-dbffffff : tpm0 > > Hmmm... This large patch basically changes devm_ioremap so it uses the > tpm chip dev not the acpi_dev - which seems reasonable - however I > notice lots of drivers do use the parent device.. > > However, it will change the unwind ordering on remove.. And when we > check if tpm_crb is OK on that point I see this bug: > > static int crb_acpi_remove(struct acpi_device *device) > { > [..] > tpm_chip_unregister(chip); > if (chip->flags & TPM_CHIP_FLAG_TPM2) > tpm2_shutdown(chip, TPM2_SU_CLEAR); Good catch, thanks! /Jarkko