Re: [PATCH v2 13/19] platform/x86/intel/tpmi: Use guard() for tpmi_dev_lock in the status read
From: Andy Shevchenko
Date: Thu Sep 24 2026 - 17:17:56 EST
On Thu, Sep 24, 2026 at 11:23:35AM -0700, Kuppuswamy Sathyanarayanan wrote:
> tpmi_read_feature_status() takes tpmi_dev_lock explicitly and unwinds
> through an err_unlock label, which is what forced the two error paths
> before the mailbox command is issued to be gotos rather than returns.
>
> Take the mutex with guard() and return directly from those two paths.
>
> The done_proc label stays, because the paths that reach it have already
> handed the mailbox to the hardware and still owe it the CPL write before
> dropping the lock. That is unchanged: the two early failures never wrote
> CPL before either.
>
> No functional change intended.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
--
With Best Regards,
Andy Shevchenko