[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170114002857.GA5851@obsidianresearch.com>
Date: Fri, 13 Jan 2017 17:28:57 -0700
From: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
To: Andrey Pronin <apronin@...omium.org>
Cc: Peter Huewe <peterhuewe@....de>,
Marcel Selhorst <tpmdd@...horst.net>,
Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
tpmdd-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
semenzato@...omium.org, groeck@...omium.org
Subject: Re: [PATCH] tpm/tpm_i2c_infineon: ensure no ongoing commands on
shutdown
On Fri, Jan 13, 2017 at 04:09:54PM -0800, Andrey Pronin wrote:
> Resetting TPM while processing a command may lead to issues
> on the next boot. Ensure that we don't have any ongoing
> commands, and that no further commands can be sent to the chip
> by unregistering the device in the shutdown handler.
> tpm_chip_unregister() waits for the completion of an ongoing
> command, if any, and then clears out chip->ops and unregisters
> sysfs entities.
Unregistering in a shutdown handler seems very strange, it also waits
for userspace things, so I wonder if it could be problematic?
Maybe just use
down_write(&chip->ops_sem);
chip->ops = NULL;
up_write(&chip->ops_sem);
In the shutdown handler?
Jason
Powered by blists - more mailing lists