lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <201801300951.rRb7NuZt%fengguang.wu@intel.com>
Date:   Tue, 30 Jan 2018 09:57:27 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Channagoud Kadabi <ckadabi@...eaurora.org>
Cc:     kbuild-all@...org, linux-arm-msm@...r.kernel.org,
        linux-arm@...ts.infradead.org, linux-kernel@...r.kernel.org,
        tsoni@...eaurora.org, sboyd@...eaurora.org, kyan@...eaurora.org,
        Channagoud Kadabi <ckadabi@...eaurora.org>
Subject: Re: [PATCH 2/2] drivers: soc: Add LLCC driver

Hi Channagoud,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.15 next-20180126]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Channagoud-Kadabi/SDM845-System-Cache-Driver/20180119-223446
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm64 

All errors (new ones prefixed by >>):

>> drivers/soc/qcom/llcc-slice.c:138:25: error: redefinition of 'llcc_slice_getd'
    struct llcc_slice_desc *llcc_slice_getd(struct device *dev, const char *name)
                            ^~~~~~~~~~~~~~~
   In file included from drivers/soc/qcom/llcc-slice.c:28:0:
   include/linux/soc/qcom/llcc-qcom.h:111:39: note: previous definition of 'llcc_slice_getd' was here
    static inline struct llcc_slice_desc *llcc_slice_getd(struct device *dev,
                                          ^~~~~~~~~~~~~~~
>> drivers/soc/qcom/llcc-slice.c:171:6: error: redefinition of 'llcc_slice_putd'
    void llcc_slice_putd(struct llcc_slice_desc *desc)
         ^~~~~~~~~~~~~~~
   In file included from drivers/soc/qcom/llcc-slice.c:28:0:
   include/linux/soc/qcom/llcc-qcom.h:117:20: note: previous definition of 'llcc_slice_putd' was here
    static inline void llcc_slice_putd(struct llcc_slice_desc *desc)
                       ^~~~~~~~~~~~~~~
>> drivers/soc/qcom/llcc-slice.c:214:5: error: redefinition of 'llcc_slice_activate'
    int llcc_slice_activate(struct llcc_slice_desc *desc)
        ^~~~~~~~~~~~~~~~~~~
   In file included from drivers/soc/qcom/llcc-slice.c:28:0:
   include/linux/soc/qcom/llcc-qcom.h:131:19: note: previous definition of 'llcc_slice_activate' was here
    static inline int llcc_slice_activate(struct llcc_slice_desc *desc)
                      ^~~~~~~~~~~~~~~~~~~
>> drivers/soc/qcom/llcc-slice.c:257:5: error: redefinition of 'llcc_slice_deactivate'
    int llcc_slice_deactivate(struct llcc_slice_desc *desc)
        ^~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/soc/qcom/llcc-slice.c:28:0:
   include/linux/soc/qcom/llcc-qcom.h:136:19: note: previous definition of 'llcc_slice_deactivate' was here
    static inline int llcc_slice_deactivate(struct llcc_slice_desc *desc)
                      ^~~~~~~~~~~~~~~~~~~~~
>> drivers/soc/qcom/llcc-slice.c:299:5: error: redefinition of 'llcc_get_slice_id'
    int llcc_get_slice_id(struct llcc_slice_desc *desc)
        ^~~~~~~~~~~~~~~~~
   In file included from drivers/soc/qcom/llcc-slice.c:28:0:
   include/linux/soc/qcom/llcc-qcom.h:122:19: note: previous definition of 'llcc_get_slice_id' was here
    static inline int llcc_get_slice_id(struct llcc_slice_desc *desc)
                      ^~~~~~~~~~~~~~~~~
>> drivers/soc/qcom/llcc-slice.c:315:8: error: redefinition of 'llcc_get_slice_size'
    size_t llcc_get_slice_size(struct llcc_slice_desc *desc)
           ^~~~~~~~~~~~~~~~~~~
   In file included from drivers/soc/qcom/llcc-slice.c:28:0:
   include/linux/soc/qcom/llcc-qcom.h:127:22: note: previous definition of 'llcc_get_slice_size' was here
    static inline size_t llcc_get_slice_size(struct llcc_slice_desc *desc)
                         ^~~~~~~~~~~~~~~~~~~
>> drivers/soc/qcom/llcc-slice.c:384:5: error: redefinition of 'qcom_llcc_probe'
    int qcom_llcc_probe(struct platform_device *pdev,
        ^~~~~~~~~~~~~~~
   In file included from drivers/soc/qcom/llcc-slice.c:28:0:
   include/linux/soc/qcom/llcc-qcom.h:140:19: note: previous definition of 'qcom_llcc_probe' was here
    static inline int qcom_llcc_probe(struct platform_device *pdev,
                      ^~~~~~~~~~~~~~~
>> drivers/soc/qcom/llcc-slice.c:443:5: error: redefinition of 'qcom_llcc_remove'
    int qcom_llcc_remove(struct platform_device *pdev)
        ^~~~~~~~~~~~~~~~
   In file included from drivers/soc/qcom/llcc-slice.c:28:0:
   include/linux/soc/qcom/llcc-qcom.h:146:19: note: previous definition of 'qcom_llcc_remove' was here
    static inline int qcom_llcc_remove(struct platform_device *pdev)
                      ^~~~~~~~~~~~~~~~

vim +/llcc_slice_getd +138 drivers/soc/qcom/llcc-slice.c

   129	
   130	/**
   131	 * llcc_slice_getd - get llcc slice descriptor
   132	 * @dev: Device pointer of the client
   133	 * @name: Name of the use case
   134	 *
   135	 * A pointer to llcc slice descriptor will be returned on success and
   136	 * and error pointer is returned on failure
   137	 */
 > 138	struct llcc_slice_desc *llcc_slice_getd(struct device *dev, const char *name)
   139	{
   140		struct device_node *np = dev->of_node;
   141		int index = 0;
   142		const char *slice_name;
   143		struct property *prop;
   144	
   145		if (!np) {
   146			dev_err(dev, "%s() currently only supports DT\n", __func__);
   147			return ERR_PTR(-ENOENT);
   148		}
   149	
   150		if (!of_get_property(np, "cache-slice-names", NULL)) {
   151			dev_err(dev,
   152				"%s() requires a \"cache-slice-names\" property\n",
   153				__func__);
   154			return ERR_PTR(-ENOENT);
   155		}
   156	
   157		of_property_for_each_string(np, "cache-slice-names", prop, slice_name) {
   158			if (!strcmp(name, slice_name))
   159				break;
   160			index++;
   161		}
   162	
   163		return llcc_slice_get_entry(dev, index);
   164	}
   165	EXPORT_SYMBOL(llcc_slice_getd);
   166	
   167	/**
   168	 * llcc_slice_putd - llcc slice descritpor
   169	 * @desc: Pointer to llcc slice descriptor
   170	 */
 > 171	void llcc_slice_putd(struct llcc_slice_desc *desc)
   172	{
   173		kfree(desc);
   174	}
   175	EXPORT_SYMBOL(llcc_slice_putd);
   176	
   177	static int llcc_update_act_ctrl(struct llcc_drv_data *drv, u32 sid,
   178					u32 act_ctrl_reg_val, u32 status)
   179	{
   180		u32 act_ctrl_reg;
   181		u32 status_reg;
   182		u32 slice_status;
   183		unsigned long timeout;
   184	
   185		act_ctrl_reg = drv->b_off + LLCC_TRP_ACT_CTRLn(sid);
   186		status_reg = drv->b_off + LLCC_TRP_STATUSn(sid);
   187	
   188		regmap_write(drv->llcc_map, act_ctrl_reg, act_ctrl_reg_val);
   189	
   190		/* Make sure the activate trigger is applied before clearing it */
   191		mb();
   192	
   193		/* Clear the ACTIVE trigger */
   194		act_ctrl_reg_val &= ~ACT_CTRL_ACT_TRIG;
   195		regmap_write(drv->llcc_map, act_ctrl_reg, act_ctrl_reg_val);
   196	
   197		timeout = jiffies + usecs_to_jiffies(LLCC_STATUS_READ_DELAY);
   198		while (time_before(jiffies, timeout)) {
   199			regmap_read(drv->llcc_map, status_reg, &slice_status);
   200			if (!(slice_status & status))
   201				return 0;
   202		}
   203	
   204		return -ETIMEDOUT;
   205	}
   206	
   207	/**
   208	 * llcc_slice_activate - Activate the llcc slice
   209	 * @desc: Pointer to llcc slice descriptor
   210	 *
   211	 * A value zero will be returned on success and a negative errno will
   212	 * be returned in error cases
   213	 */
 > 214	int llcc_slice_activate(struct llcc_slice_desc *desc)
   215	{
   216		int rc = -EINVAL;
   217		u32 act_ctrl_val;
   218		struct llcc_drv_data *drv;
   219	
   220		if (desc == NULL) {
   221			pr_err("Input descriptor supplied is invalid\n");
   222			return rc;
   223		}
   224	
   225		drv = dev_get_drvdata(desc->dev);
   226		if (!drv) {
   227			pr_err("Invalid device pointer in the desc\n");
   228			return rc;
   229		}
   230	
   231		mutex_lock(&drv->slice_mutex);
   232		if (test_bit(desc->llcc_slice_id, drv->llcc_slice_map)) {
   233			mutex_unlock(&drv->slice_mutex);
   234			return 0;
   235		}
   236	
   237		act_ctrl_val = ACT_CTRL_OPCODE_ACTIVATE << ACT_CTRL_OPCODE_SHIFT;
   238		act_ctrl_val |= ACT_CTRL_ACT_TRIG;
   239	
   240		rc = llcc_update_act_ctrl(drv, desc->llcc_slice_id, act_ctrl_val,
   241					  DEACTIVATE);
   242	
   243		__set_bit(desc->llcc_slice_id, drv->llcc_slice_map);
   244		mutex_unlock(&drv->slice_mutex);
   245	
   246		return rc;
   247	}
   248	EXPORT_SYMBOL(llcc_slice_activate);
   249	
   250	/**
   251	 * llcc_slice_deactivate - Deactivate the llcc slice
   252	 * @desc: Pointer to llcc slice descriptor
   253	 *
   254	 * A value zero will be returned on success and a negative errno will
   255	 * be returned in error cases
   256	 */
 > 257	int llcc_slice_deactivate(struct llcc_slice_desc *desc)
   258	{
   259		u32 act_ctrl_val;
   260		int rc = -EINVAL;
   261		struct llcc_drv_data *drv;
   262	
   263		if (desc == NULL) {
   264			pr_err("Input descriptor supplied is invalid\n");
   265			return rc;
   266		}
   267	
   268		drv = dev_get_drvdata(desc->dev);
   269		if (!drv) {
   270			pr_err("Invalid device pointer in the desc\n");
   271			return rc;
   272		}
   273	
   274		mutex_lock(&drv->slice_mutex);
   275		if (!test_bit(desc->llcc_slice_id, drv->llcc_slice_map)) {
   276			mutex_unlock(&drv->slice_mutex);
   277			return 0;
   278		}
   279		act_ctrl_val = ACT_CTRL_OPCODE_DEACTIVATE << ACT_CTRL_OPCODE_SHIFT;
   280		act_ctrl_val |= ACT_CTRL_ACT_TRIG;
   281	
   282		rc = llcc_update_act_ctrl(drv, desc->llcc_slice_id, act_ctrl_val,
   283					  ACTIVATE);
   284	
   285		__clear_bit(desc->llcc_slice_id, drv->llcc_slice_map);
   286		mutex_unlock(&drv->slice_mutex);
   287	
   288		return rc;
   289	}
   290	EXPORT_SYMBOL(llcc_slice_deactivate);
   291	
   292	/**
   293	 * llcc_get_slice_id - return the slice id
   294	 * @desc: Pointer to llcc slice descriptor
   295	 *
   296	 * A positive value will be returned on success and a negative errno will
   297	 * be returned on error
   298	 */
 > 299	int llcc_get_slice_id(struct llcc_slice_desc *desc)
   300	{
   301		if (!desc)
   302			return -EINVAL;
   303	
   304		return desc->llcc_slice_id;
   305	}
   306	EXPORT_SYMBOL(llcc_get_slice_id);
   307	
   308	/**
   309	 * llcc_get_slice_size - return the slice id
   310	 * @desc: Pointer to llcc slice descriptor
   311	 *
   312	 * A positive value will be returned on success and zero will returned on
   313	 * error
   314	 */
 > 315	size_t llcc_get_slice_size(struct llcc_slice_desc *desc)
   316	{
   317		if (!desc)
   318			return 0;
   319	
   320		return desc->llcc_slice_size;
   321	}
   322	EXPORT_SYMBOL(llcc_get_slice_size);
   323	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (58559 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ