All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 1/2] ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver
Date: Thu, 17 Sep 2020 13:00:16 +0300	[thread overview]
Message-ID: <20200917100016.GN4282@kadam> (raw)
In-Reply-To: <1600247876-8013-2-git-send-email-viorel.suman@oss.nxp.com>

[-- Attachment #1: Type: text/plain, Size: 4722 bytes --]

Hi "Viorel,

url:    https://github.com/0day-ci/linux/commits/Viorel-Suman-OSS/DAI-driver-for-new-XCVR-IP/20200916-171921
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: i386-randconfig-m021-20200917 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
sound/soc/fsl/fsl_xcvr.c:381 fsl_xcvr_en_aud_pll() warn: 'xcvr->phy_clk' not released on lines: 361.

# https://github.com/0day-ci/linux/commit/87299d2c9ad1b82091b3c273c7b393595a3325ab
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Viorel-Suman-OSS/DAI-driver-for-new-XCVR-IP/20200916-171921
git checkout 87299d2c9ad1b82091b3c273c7b393595a3325ab
vim +381 sound/soc/fsl/fsl_xcvr.c

87299d2c9ad1b82 Viorel Suman 2020-09-16  339  static int fsl_xcvr_en_aud_pll(struct fsl_xcvr *xcvr, u32 freq)
87299d2c9ad1b82 Viorel Suman 2020-09-16  340  {
87299d2c9ad1b82 Viorel Suman 2020-09-16  341  	struct device *dev = &xcvr->pdev->dev;
87299d2c9ad1b82 Viorel Suman 2020-09-16  342  	int ret;
87299d2c9ad1b82 Viorel Suman 2020-09-16  343  
87299d2c9ad1b82 Viorel Suman 2020-09-16  344  	clk_disable_unprepare(xcvr->phy_clk);

We disable clk_disable_unprepare() at the start...  I sure hope these
new warnings are correct because I've been sending a lot recently and
I'm not sure I understand the rules.

87299d2c9ad1b82 Viorel Suman 2020-09-16  345  	ret = clk_set_rate(xcvr->phy_clk, freq);
87299d2c9ad1b82 Viorel Suman 2020-09-16  346  	if (ret < 0) {
87299d2c9ad1b82 Viorel Suman 2020-09-16  347  		dev_err(dev, "Error while setting AUD PLL rate: %d\n", ret);
87299d2c9ad1b82 Viorel Suman 2020-09-16  348  		return ret;
87299d2c9ad1b82 Viorel Suman 2020-09-16  349  	}
87299d2c9ad1b82 Viorel Suman 2020-09-16  350  	ret = clk_prepare_enable(xcvr->phy_clk);
                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Enable

87299d2c9ad1b82 Viorel Suman 2020-09-16  351  	if (ret) {
87299d2c9ad1b82 Viorel Suman 2020-09-16  352  		dev_err(dev, "failed to start PHY clock: %d\n", ret);
87299d2c9ad1b82 Viorel Suman 2020-09-16  353  		return ret;
87299d2c9ad1b82 Viorel Suman 2020-09-16  354  	}
87299d2c9ad1b82 Viorel Suman 2020-09-16  355  
87299d2c9ad1b82 Viorel Suman 2020-09-16  356  	/* Release AI interface from reset */
87299d2c9ad1b82 Viorel Suman 2020-09-16  357  	ret = regmap_write(xcvr->regmap, FSL_XCVR_PHY_AI_CTRL_SET,
87299d2c9ad1b82 Viorel Suman 2020-09-16  358  			   FSL_XCVR_PHY_AI_CTRL_AI_RESETN);
87299d2c9ad1b82 Viorel Suman 2020-09-16  359  	if (ret < 0) {
87299d2c9ad1b82 Viorel Suman 2020-09-16  360  		dev_err(dev, "Error while setting IER0: %d\n", ret);
87299d2c9ad1b82 Viorel Suman 2020-09-16  361  		return ret;

clk_disable_unprepare(xcvr->phy_clk); before returning?

87299d2c9ad1b82 Viorel Suman 2020-09-16  362  	}
87299d2c9ad1b82 Viorel Suman 2020-09-16  363  
87299d2c9ad1b82 Viorel Suman 2020-09-16  364  	if (xcvr->mode == FSL_XCVR_MODE_EARC) { /* eARC mode */
87299d2c9ad1b82 Viorel Suman 2020-09-16  365  		/* PHY: CTRL_SET: TX_DIFF_OE, PHY_EN */
87299d2c9ad1b82 Viorel Suman 2020-09-16  366  		fsl_xcvr_ai_write(xcvr, FSL_XCVR_PHY_CTRL_SET,
87299d2c9ad1b82 Viorel Suman 2020-09-16  367  				  FSL_XCVR_PHY_CTRL_TSDIFF_OE |
87299d2c9ad1b82 Viorel Suman 2020-09-16  368  				  FSL_XCVR_PHY_CTRL_PHY_EN, 1);
87299d2c9ad1b82 Viorel Suman 2020-09-16  369  		/* PHY: CTRL2_SET: EARC_TX_MODE */
87299d2c9ad1b82 Viorel Suman 2020-09-16  370  		fsl_xcvr_ai_write(xcvr, FSL_XCVR_PHY_CTRL2_SET,
87299d2c9ad1b82 Viorel Suman 2020-09-16  371  				  FSL_XCVR_PHY_CTRL2_EARC_TXMS, 1);
87299d2c9ad1b82 Viorel Suman 2020-09-16  372  	} else { /* SPDIF mode */
87299d2c9ad1b82 Viorel Suman 2020-09-16  373  		/* PHY: CTRL_SET: TX_CLK_AUD_SS | SPDIF_EN */
87299d2c9ad1b82 Viorel Suman 2020-09-16  374  		fsl_xcvr_ai_write(xcvr, FSL_XCVR_PHY_CTRL_SET,
87299d2c9ad1b82 Viorel Suman 2020-09-16  375  				  FSL_XCVR_PHY_CTRL_TX_CLK_AUD_SS |
87299d2c9ad1b82 Viorel Suman 2020-09-16  376  				  FSL_XCVR_PHY_CTRL_SPDIF_EN, 1);
87299d2c9ad1b82 Viorel Suman 2020-09-16  377  	}
87299d2c9ad1b82 Viorel Suman 2020-09-16  378  
87299d2c9ad1b82 Viorel Suman 2020-09-16  379  	dev_dbg(dev, "PLL Fexp: %u\n", freq);
87299d2c9ad1b82 Viorel Suman 2020-09-16  380  
87299d2c9ad1b82 Viorel Suman 2020-09-16 @381  	return 0;
87299d2c9ad1b82 Viorel Suman 2020-09-16  382  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34024 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 1/2] ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver
Date: Thu, 17 Sep 2020 13:00:16 +0300	[thread overview]
Message-ID: <20200917100016.GN4282@kadam> (raw)
In-Reply-To: <1600247876-8013-2-git-send-email-viorel.suman@oss.nxp.com>

[-- Attachment #1: Type: text/plain, Size: 4722 bytes --]

Hi "Viorel,

url:    https://github.com/0day-ci/linux/commits/Viorel-Suman-OSS/DAI-driver-for-new-XCVR-IP/20200916-171921
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: i386-randconfig-m021-20200917 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
sound/soc/fsl/fsl_xcvr.c:381 fsl_xcvr_en_aud_pll() warn: 'xcvr->phy_clk' not released on lines: 361.

# https://github.com/0day-ci/linux/commit/87299d2c9ad1b82091b3c273c7b393595a3325ab
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Viorel-Suman-OSS/DAI-driver-for-new-XCVR-IP/20200916-171921
git checkout 87299d2c9ad1b82091b3c273c7b393595a3325ab
vim +381 sound/soc/fsl/fsl_xcvr.c

87299d2c9ad1b82 Viorel Suman 2020-09-16  339  static int fsl_xcvr_en_aud_pll(struct fsl_xcvr *xcvr, u32 freq)
87299d2c9ad1b82 Viorel Suman 2020-09-16  340  {
87299d2c9ad1b82 Viorel Suman 2020-09-16  341  	struct device *dev = &xcvr->pdev->dev;
87299d2c9ad1b82 Viorel Suman 2020-09-16  342  	int ret;
87299d2c9ad1b82 Viorel Suman 2020-09-16  343  
87299d2c9ad1b82 Viorel Suman 2020-09-16  344  	clk_disable_unprepare(xcvr->phy_clk);

We disable clk_disable_unprepare() at the start...  I sure hope these
new warnings are correct because I've been sending a lot recently and
I'm not sure I understand the rules.

87299d2c9ad1b82 Viorel Suman 2020-09-16  345  	ret = clk_set_rate(xcvr->phy_clk, freq);
87299d2c9ad1b82 Viorel Suman 2020-09-16  346  	if (ret < 0) {
87299d2c9ad1b82 Viorel Suman 2020-09-16  347  		dev_err(dev, "Error while setting AUD PLL rate: %d\n", ret);
87299d2c9ad1b82 Viorel Suman 2020-09-16  348  		return ret;
87299d2c9ad1b82 Viorel Suman 2020-09-16  349  	}
87299d2c9ad1b82 Viorel Suman 2020-09-16  350  	ret = clk_prepare_enable(xcvr->phy_clk);
                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Enable

87299d2c9ad1b82 Viorel Suman 2020-09-16  351  	if (ret) {
87299d2c9ad1b82 Viorel Suman 2020-09-16  352  		dev_err(dev, "failed to start PHY clock: %d\n", ret);
87299d2c9ad1b82 Viorel Suman 2020-09-16  353  		return ret;
87299d2c9ad1b82 Viorel Suman 2020-09-16  354  	}
87299d2c9ad1b82 Viorel Suman 2020-09-16  355  
87299d2c9ad1b82 Viorel Suman 2020-09-16  356  	/* Release AI interface from reset */
87299d2c9ad1b82 Viorel Suman 2020-09-16  357  	ret = regmap_write(xcvr->regmap, FSL_XCVR_PHY_AI_CTRL_SET,
87299d2c9ad1b82 Viorel Suman 2020-09-16  358  			   FSL_XCVR_PHY_AI_CTRL_AI_RESETN);
87299d2c9ad1b82 Viorel Suman 2020-09-16  359  	if (ret < 0) {
87299d2c9ad1b82 Viorel Suman 2020-09-16  360  		dev_err(dev, "Error while setting IER0: %d\n", ret);
87299d2c9ad1b82 Viorel Suman 2020-09-16  361  		return ret;

clk_disable_unprepare(xcvr->phy_clk); before returning?

87299d2c9ad1b82 Viorel Suman 2020-09-16  362  	}
87299d2c9ad1b82 Viorel Suman 2020-09-16  363  
87299d2c9ad1b82 Viorel Suman 2020-09-16  364  	if (xcvr->mode == FSL_XCVR_MODE_EARC) { /* eARC mode */
87299d2c9ad1b82 Viorel Suman 2020-09-16  365  		/* PHY: CTRL_SET: TX_DIFF_OE, PHY_EN */
87299d2c9ad1b82 Viorel Suman 2020-09-16  366  		fsl_xcvr_ai_write(xcvr, FSL_XCVR_PHY_CTRL_SET,
87299d2c9ad1b82 Viorel Suman 2020-09-16  367  				  FSL_XCVR_PHY_CTRL_TSDIFF_OE |
87299d2c9ad1b82 Viorel Suman 2020-09-16  368  				  FSL_XCVR_PHY_CTRL_PHY_EN, 1);
87299d2c9ad1b82 Viorel Suman 2020-09-16  369  		/* PHY: CTRL2_SET: EARC_TX_MODE */
87299d2c9ad1b82 Viorel Suman 2020-09-16  370  		fsl_xcvr_ai_write(xcvr, FSL_XCVR_PHY_CTRL2_SET,
87299d2c9ad1b82 Viorel Suman 2020-09-16  371  				  FSL_XCVR_PHY_CTRL2_EARC_TXMS, 1);
87299d2c9ad1b82 Viorel Suman 2020-09-16  372  	} else { /* SPDIF mode */
87299d2c9ad1b82 Viorel Suman 2020-09-16  373  		/* PHY: CTRL_SET: TX_CLK_AUD_SS | SPDIF_EN */
87299d2c9ad1b82 Viorel Suman 2020-09-16  374  		fsl_xcvr_ai_write(xcvr, FSL_XCVR_PHY_CTRL_SET,
87299d2c9ad1b82 Viorel Suman 2020-09-16  375  				  FSL_XCVR_PHY_CTRL_TX_CLK_AUD_SS |
87299d2c9ad1b82 Viorel Suman 2020-09-16  376  				  FSL_XCVR_PHY_CTRL_SPDIF_EN, 1);
87299d2c9ad1b82 Viorel Suman 2020-09-16  377  	}
87299d2c9ad1b82 Viorel Suman 2020-09-16  378  
87299d2c9ad1b82 Viorel Suman 2020-09-16  379  	dev_dbg(dev, "PLL Fexp: %u\n", freq);
87299d2c9ad1b82 Viorel Suman 2020-09-16  380  
87299d2c9ad1b82 Viorel Suman 2020-09-16 @381  	return 0;
87299d2c9ad1b82 Viorel Suman 2020-09-16  382  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34024 bytes --]

  parent reply	other threads:[~2020-09-17 10:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16  9:17 [PATCH 0/2] DAI driver for new XCVR IP Viorel Suman (OSS)
2020-09-16  9:17 ` Viorel Suman (OSS)
2020-09-16  9:17 ` [PATCH 1/2] ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver Viorel Suman (OSS)
2020-09-16  9:17   ` Viorel Suman (OSS)
2020-09-17  7:14   ` Nicolin Chen
2020-09-17  7:14     ` Nicolin Chen
2020-09-17  7:14     ` Nicolin Chen
2020-09-18 14:21     ` Viorel Suman (OSS)
2020-09-18 14:21       ` Viorel Suman (OSS)
2020-09-18 14:21       ` Viorel Suman (OSS)
2020-09-18 16:06       ` Timur Tabi
2020-09-18 16:06         ` Timur Tabi
2020-09-18 16:06         ` Timur Tabi
2020-09-17 10:00   ` Dan Carpenter [this message]
2020-09-17 10:00     ` Dan Carpenter
2020-09-17 13:53   ` Mark Brown
2020-09-17 13:53     ` Mark Brown
2020-09-17 13:53     ` Mark Brown
2020-09-18 15:02     ` Viorel Suman (OSS)
2020-09-18 15:02       ` Viorel Suman (OSS)
2020-09-18 15:02       ` Viorel Suman (OSS)
2020-09-18 15:20       ` Mark Brown
2020-09-18 15:20         ` Mark Brown
2020-09-18 15:20         ` Mark Brown
2020-09-18 15:33         ` Viorel Suman (OSS)
2020-09-18 15:33           ` Viorel Suman (OSS)
2020-09-18 15:33           ` Viorel Suman (OSS)
2020-09-16  9:17 ` [PATCH 2/2] ASoC: dt-bindings: fsl_xcvr: Add document for XCVR Viorel Suman (OSS)
2020-09-16  9:17   ` Viorel Suman (OSS)
2020-09-18 17:23   ` Rob Herring
2020-09-18 17:23     ` Rob Herring
2020-09-18 17:23     ` Rob Herring
  -- strict thread matches above, loose matches on Subject: below --
2020-09-17  8:14 [PATCH 1/2] ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver kernel test robot

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=20200917100016.GN4282@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.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.