Re: [PATCH] scsi: ufs: qcom: Drop the PHY power_count check

From: Vladimir Oltean

Date: Wed Mar 25 2026 - 08:29:49 EST


On Wed, Mar 25, 2026 at 05:31:22PM +0530, Manivannan Sadhasivam wrote:
> phy_power_off() can safely be called even when PHY is not powered on. So
> drop the PHY power_count check.

Sorry, do you mind writing a more elaborate explanation _why_ you think
that phy_power_off() can safely be called even when the PHY is not
powered on? If 0, the power_count would become negative after
phy_power_off(), and a subsequent phy_power_on() would merely bump it
back to 0, thereby not calling into the driver's qmp_ufs_power_on().
If there is a regulator assigned to phy->pwr, this would see a call to
regulator_disable() with no prior call having been made to regulator_enable().
At the very least you'd want to explain in the commit message why that
is something to be desired, so as to give reviewers confidence that
conscientious thought has been given to the change.