From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH v3] tpm: do not suspend/resume if power stays on Date: Fri, 3 Mar 2017 10:11:07 -0700 Message-ID: <20170303171107.GA2273@obsidianresearch.com> References: <20170303160959.27422-1-enric.balletbo@collabora.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20170303160959.27422-1-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Enric Balletbo i Serra Cc: Mark Rutland , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Rob Herring , Sonny Rao List-Id: devicetree@vger.kernel.org On Fri, Mar 03, 2017 at 05:09:59PM +0100, Enric Balletbo i Serra wrote: > From: Sonny Rao > > The suspend/resume behavior of the TPM can be controlled by setting > "powered-while-suspended" in the DTS. This is useful for the cases > when hardware does not power-off the TPM. > > Signed-off-by: Sonny Rao > Signed-off-by: Enric Balletbo i Serra Reviewed-by: Jason Gunthorpe > +++ b/drivers/char/tpm/tpm_of.c > @@ -34,6 +34,9 @@ int tpm_read_log_of(struct tpm_chip *chip) > else > return -ENODEV; > > + if (of_property_read_bool(np, "powered-while-suspended")) > + chip->flags |= TPM_CHIP_FLAG_ALWAYS_POWERED; > + It is really weird that this is in a function called tpm_read_log_of, but it makes sense to use the existing conditional infrastructure for OF as well. We should try to tidy this later... Jason ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot