fpga: dfl: afu: use parent device to log errors on port enable/disable
authorPeter Colberg <peter.colberg@intel.com>
Wed, 20 Nov 2024 01:10:19 +0000 (20:10 -0500)
committerXu Yilun <yilun.xu@linux.intel.com>
Tue, 10 Dec 2024 06:54:59 +0000 (14:54 +0800)
AFU port enable/disable may be triggered from userspace at any point,
e.g., after a port has been released. This commit prepares a subsequent
commit that destroys the port platform device on port release, which is
then no longer available during port enable/disable. Use the parent,
physical DFL, e.g., PCIe FPGA device instead for logging errors.

Signed-off-by: Peter Colberg <peter.colberg@intel.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Reviewed-by: Basheer Ahmed Muddebihal <basheer.ahmed.muddebihal@linux.intel.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20241120011035.230574-4-peter.colberg@intel.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
drivers/fpga/dfl-afu-main.c

index 4f7555c08d2dc4590bba9b41e53373558c5e37b4..24eb41519b7b86574f6047638b92dfcd0db04115 100644 (file)
@@ -60,7 +60,8 @@ int __afu_port_enable(struct platform_device *pdev)
        if (readq_poll_timeout(base + PORT_HDR_CTRL, v,
                               !(v & PORT_CTRL_SFTRST_ACK),
                               RST_POLL_INVL, RST_POLL_TIMEOUT)) {
-               dev_err(&pdev->dev, "timeout, failure to enable device\n");
+               dev_err(pdata->dfl_cdev->parent,
+                       "timeout, failure to enable device\n");
                return -ETIMEDOUT;
        }
 
@@ -99,7 +100,8 @@ int __afu_port_disable(struct platform_device *pdev)
        if (readq_poll_timeout(base + PORT_HDR_CTRL, v,
                               v & PORT_CTRL_SFTRST_ACK,
                               RST_POLL_INVL, RST_POLL_TIMEOUT)) {
-               dev_err(&pdev->dev, "timeout, failure to disable device\n");
+               dev_err(pdata->dfl_cdev->parent,
+                       "timeout, failure to disable device\n");
                return -ETIMEDOUT;
        }