Re: [PATCH v4 1/2] PCI: mediatek-gen3: Add support for setting max-link-speed limit

From: AngeloGioacchino Del Regno
Date: Mon Nov 04 2024 - 08:10:36 EST


Il 04/11/24 14:06, Krzysztof Wilczyński ha scritto:
Hello,

+ if (err > 0) {

You could drop > 0 here.


I have no strong opinions about that, would be fine for me.

+ /* Get the maximum speed supported by the controller */
+ max_speed = mtk_pcie_get_controller_max_link_speed(pcie);
+
+ /* Set max_link_speed only if the controller supports it */
+ if (max_speed >= 0 && max_speed <= err) {
+ pcie->max_link_speed = err;
+ dev_dbg(pcie->dev,
+ "Max controller link speed Gen%d, override to Gen%u",
+ max_speed, pcie->max_link_speed);
+ }
+ }

I wonder if this debug message would be better served as a warning to let
the user know that the speed has been overridden due to the platform
limitation. Thoughts?

Also, there is no need to sent a new series if you fine with the
suggestions. I will mend the code on the branch when applying.


A warning seems to be a bit too much and would appear like something to worry
about (or something unintended)...

Perhaps a dev_info() would work better here?

Thanks,
Angelo

Krzysztof