All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: architt@codeaurora.org
Cc: linux-arm-msm@vger.kernel.org
Subject: [bug report] drm/msm/hdmi: HDMI 8996 PHY/PLL support
Date: Mon, 4 Oct 2021 14:59:36 +0300	[thread overview]
Message-ID: <20211004115936.GA28995@kili> (raw)

Hello Archit Taneja,

The patch e17afdceb4f2: "drm/msm/hdmi: HDMI 8996 PHY/PLL support"
from Feb 25, 2016, leads to the following
Smatch static checker warning:

   drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c:606 hdmi_8996_pll_prepare()
   info: return a literal instead of 'ret'

   drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c:622 hdmi_8996_pll_prepare()
   info: return a literal instead of 'ret'

drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c
    592 static int hdmi_8996_pll_prepare(struct clk_hw *hw)
    593 {
    594         struct hdmi_pll_8996 *pll = hw_clk_to_pll(hw);
    595         struct hdmi_phy *phy = pll_get_phy(pll);
    596         int i, ret = 0;
    597 
    598         hdmi_phy_write(phy, REG_HDMI_8996_PHY_CFG, 0x1);
    599         udelay(100);
    600 
    601         hdmi_phy_write(phy, REG_HDMI_8996_PHY_CFG, 0x19);
    602         udelay(100);
    603 
    604         ret = hdmi_8996_pll_lock_status(pll);
    605         if (!ret)
--> 606                 return ret;

If this is not locked it returns success?  That's strange.

    607 
    608         for (i = 0; i < HDMI_NUM_TX_CHANNEL; i++)
    609                 hdmi_tx_chan_write(pll, i,
    610                         REG_HDMI_PHY_QSERDES_TX_LX_HIGHZ_TRANSCEIVEREN_BIAS_DRVR_EN,
    611                         0x6F);
    612 
    613         /* Disable SSC */
    614         hdmi_pll_write(pll, REG_HDMI_PHY_QSERDES_COM_SSC_PER1, 0x0);
    615         hdmi_pll_write(pll, REG_HDMI_PHY_QSERDES_COM_SSC_PER2, 0x0);
    616         hdmi_pll_write(pll, REG_HDMI_PHY_QSERDES_COM_SSC_STEP_SIZE1, 0x0);
    617         hdmi_pll_write(pll, REG_HDMI_PHY_QSERDES_COM_SSC_STEP_SIZE2, 0x0);
    618         hdmi_pll_write(pll, REG_HDMI_PHY_QSERDES_COM_SSC_EN_CENTER, 0x2);
    619 
    620         ret = hdmi_8996_phy_ready_status(phy);
    621         if (!ret)
    622                 return ret;

If it's not ready then this returns success.  That seems very wrong.  I
would have expected -EIO or something.

    623 
    624         /* Restart the retiming buffer */
    625         hdmi_phy_write(phy, REG_HDMI_8996_PHY_CFG, 0x18);
    626         udelay(1);
    627         hdmi_phy_write(phy, REG_HDMI_8996_PHY_CFG, 0x19);
    628 
    629         return 0;
    630 }

regards,
dan carpenter

             reply	other threads:[~2021-10-04 11:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 11:59 Dan Carpenter [this message]
     [not found] ` <6ea3f6b01beb7fc57837e763e70b9963@codeaurora.org>
2021-10-04 23:35   ` Fwd: [bug report] drm/msm/hdmi: HDMI 8996 PHY/PLL support jesszhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211004115936.GA28995@kili \
    --to=dan.carpenter@oracle.com \
    --cc=architt@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.