lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYTBRVtpUA6xavV7@smile.fi.intel.com>
Date: Thu, 5 Feb 2026 18:11:49 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: WangYuli <wangyuli@...c.io>
Cc: mario.limonciello@....com, thomas.lendacky@....com, john.allen@....com,
	herbert@...dor.apana.org.au, davem@...emloft.net,
	mika.westerberg@...ux.intel.com, jsd@...ihalf.com,
	andi.shyti@...nel.org, linux-crypto@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
	bp@...en8.de, ashish.kalra@....com, markhas@...omium.org,
	jarkko.nikula@...ux.intel.com, wsa@...nel.org,
	WangYuli <wangyl5933@...naunicom.cn>, stable@...r.kernel.org
Subject: Re: [PATCH] i2c: designware: Enable PSP semaphore for AMDI0010 and
 fix probe deferral

On Thu, Feb 05, 2026 at 06:30:47PM +0800, WangYuli wrote:

> AMD Strix Point platforms use the AMDI0010 ACPI HID for their I2C
> controllers, but this entry was missing the ARBITRATION_SEMAPHORE flag
> that enables PSP-based bus arbitration.
> 
> Without proper arbitration, when both the x86 host and AMD PSP
> (Platform Security Processor) attempt to access the shared I2C bus
> simultaneously, the DesignWare controller loses arbitration and reports:
> 
>   i2c_designware AMDI0010:01: i2c_dw_handle_tx_abort: lost arbitration
> 
> This causes communication failures with I2C devices such as touchpads
> (e.g., BLTP7853 HID-over-I2C).
> 
> Add the ARBITRATION_SEMAPHORE flag to the AMDI0010 entry to enable PSP
> mailbox-based I2C bus arbitration, consistent with how AMDI0019 was
> handled for AMD Cezanne platforms.
> 
> However, simply enabling this flag exposes a latent bug introduced by
> commit 440da737cf8d ("i2c: designware: Use PCI PSP driver for
> communication"): the driver unconditionally returns -EPROBE_DEFER when
> psp_check_platform_access_status() fails, causing an infinite probe
> deferral loop on platforms that lack PSP platform access support.
> 
> The problem is that psp_check_platform_access_status() returned -ENODEV
> for all failure cases, but there are two distinct scenarios:
> 
>   1. PSP is still initializing (psp pointer exists but platform_access_data
>      is not yet ready, while vdata->platform_access indicates support) -
>      this is a transient condition that warrants probe deferral.
> 
>   2. The platform genuinely lacks PSP platform access support (either no
>      psp pointer, or vdata->platform_access is not set) - this is a
>      permanent condition where probe deferral would loop indefinitely.
> 
> Fix this by updating psp_check_platform_access_status() to return:
> 
>   - -EPROBE_DEFER: when PSP exists with platform_access capability but
>     platform_access_data is not yet initialized (transient)
>   - -ENODEV: when the platform lacks PSP platform access support (permanent)
> 
> Then update the I2C driver to pass through the actual return code from
> psp_check_platform_access_status() instead of forcing -EPROBE_DEFER,
> allowing the driver to fail gracefully on unsupported platforms.
> 
> Tested on MECHREVO XINGYAO 14 with AMD Ryzen AI 9 H 365.

...

> +++ b/drivers/crypto/ccp/platform-access.c

> int psp_check_platform_access_status(void)
>  {
>  	struct psp_device *psp = psp_get_master_device();
>  
> -	if (!psp || !psp->platform_access_data)
> +	/* PSP driver not loaded yet, caller should defer */
> +	if ((!psp) || (!psp->platform_access_data && psp->vdata->platform_access))

Too many parentheses (it's not a macro).

> +		return -EPROBE_DEFER;
> +
> +	/* PSP loaded but platform_access not supported by hardware */
> +	if (!psp->platform_access_data && !psp->vdata->platform_access)
>  		return -ENODEV;

This can be refactored.

>  	return 0;
>  }

	/* PSP driver not loaded yet, caller should defer */
	if (!psp)
		return -EPROBE_DEFER;

	if (!psp->platform_access_data) {
		if (psp->vdata->platform_access)
			/* ...missing comment... */
			return -EPROBE_DEFER;
		else
			/* PSP loaded but platform_access not supported by hardware */
			return -ENODEV;
	}

...

>   * Returns:
> - * 0          platform features is ready
> - * -%ENODEV   platform features is not ready or present
> + *  0:            platform features is ready
> + *  -%ENODEV:     platform_access is not supported by hardware
> + *  -%EPROBE_DEFER: PSP driver not ready or platform features not yet initialized

Run kernel-doc and render this.

You need "* *" for each item in the list.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ