CC: kbuild-...@lists.01.org
TO: Oded Gabbay <oded.gab...@gmail.com>
CC: Ofir Bitton <obit...@habana.ai>

tree:   https://github.com/HabanaAI/linux.git habanalabs-next
head:   7bedc69b228ebb366daabc8398bf8e9d8471f7cd
commit: ec9f5f9d3e4a822d3836aca284fadb663c7049de [13/22] habanalabs: Extract 
ECC information from FW
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: x86_64-randconfig-c002-20200710 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <l...@intel.com>
Reported-by: Julia Lawall <julia.law...@lip6.fr>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/misc/habanalabs/gaudi/gaudi.c:5195:1-7: preceding lock on line 5148

# 
https://github.com/HabanaAI/linux/commit/ec9f5f9d3e4a822d3836aca284fadb663c7049de
git remote add habanaai https://github.com/HabanaAI/linux.git
git remote update habanaai
git checkout ec9f5f9d3e4a822d3836aca284fadb663c7049de
vim +5195 drivers/misc/habanalabs/gaudi/gaudi.c

ac0ae6a96aa58e Oded Gabbay 2020-05-11  5108  
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5109  /*
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5110   *  
+-------------------+------------------------------------------------------+
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5111   *  | Configuration Reg |          
           Description                      |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5112   *  |      Address      |          
                                            |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5113   *  
+-------------------+------------------------------------------------------+
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5114   *  |  0xF30 - 0xF3F    |ECC 
single error indication (1 bit per memory wrapper)|
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5115   *  |                   |0xF30 
memory wrappers 31:0 (MSB to LSB)               |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5116   *  |                   |0xF34 
memory wrappers 63:32                           |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5117   *  |                   |0xF38 
memory wrappers 95:64                           |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5118   *  |                   |0xF3C 
memory wrappers 127:96                          |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5119   *  
+-------------------+------------------------------------------------------+
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5120   *  |  0xF40 - 0xF4F    |ECC 
double error indication (1 bit per memory wrapper)|
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5121   *  |                   |0xF40 
memory wrappers 31:0 (MSB to LSB)               |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5122   *  |                   |0xF44 
memory wrappers 63:32                           |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5123   *  |                   |0xF48 
memory wrappers 95:64                           |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5124   *  |                   |0xF4C 
memory wrappers 127:96                          |
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5125   *  
+-------------------+------------------------------------------------------+
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5126   */
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5127  static int 
gaudi_extract_ecc_info(struct hl_device *hdev,
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5128             struct 
ecc_info_extract_params *params, u64 *ecc_address,
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5129             u64 *ecc_syndrom, u8 
*memory_wrapper_idx)
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5130  {
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5131     struct gaudi_device *gaudi = 
hdev->asic_specific;
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5132     u32 i, num_mem_regs, reg, 
err_bit;
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5133     u64 err_addr, err_word = 0;
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5134     int rc = 0;
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5135  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5136     num_mem_regs = 
params->num_memories / 32 +
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5137                     
((params->num_memories % 32) ? 1 : 0);
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5138  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5139     if (params->block_address >= 
CFG_BASE)
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5140             params->block_address 
-= CFG_BASE;
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5141  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5142     if (params->derr)
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5143             err_addr = 
params->block_address + GAUDI_ECC_DERR0_OFFSET;
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5144     else
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5145             err_addr = 
params->block_address + GAUDI_ECC_SERR0_OFFSET;
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5146  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5147     if 
(params->disable_clock_gating) {
ac0ae6a96aa58e Oded Gabbay 2020-05-11 @5148             
mutex_lock(&gaudi->clk_gate_mutex);
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5149             
hdev->asic_funcs->disable_clock_gating(hdev);
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5150     }
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5151  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5152     /* Set invalid wrapper index */
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5153     *memory_wrapper_idx = 0xFF;
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5154  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5155     /* Iterate through memory 
wrappers, a single bit must be set */
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5156     for (i = 0 ; i > num_mem_regs ; 
i++) {
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5157             err_addr += i * 4;
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5158             err_word = 
RREG32(err_addr);
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5159             if (err_word) {
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5160                     err_bit = 
__ffs(err_word);
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5161                     
*memory_wrapper_idx = err_bit + (32 * i);
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5162                     break;
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5163             }
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5164     }
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5165  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5166     if (*memory_wrapper_idx == 
0xFF) {
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5167             dev_err(hdev->dev, "ECC 
error information cannot be found\n");
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5168             rc = -EINVAL;
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5169             goto enable_clk_gate;
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5170     }
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5171  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5172     WREG32(params->block_address + 
GAUDI_ECC_MEM_SEL_OFFSET,
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5173                     
*memory_wrapper_idx);
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5174  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5175     *ecc_address =
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5176             
RREG32(params->block_address + GAUDI_ECC_ADDRESS_OFFSET);
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5177     *ecc_syndrom =
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5178             
RREG32(params->block_address + GAUDI_ECC_SYNDROME_OFFSET);
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5179  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5180     /* Clear error indication */
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5181     reg = 
RREG32(params->block_address + GAUDI_ECC_MEM_INFO_CLR_OFFSET);
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5182     if (params->derr)
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5183             reg |= 
FIELD_PREP(GAUDI_ECC_MEM_INFO_CLR_DERR_MASK, 1);
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5184     else
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5185             reg |= 
FIELD_PREP(GAUDI_ECC_MEM_INFO_CLR_SERR_MASK, 1);
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5186  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5187     WREG32(params->block_address + 
GAUDI_ECC_MEM_INFO_CLR_OFFSET, reg);
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5188  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5189  enable_clk_gate:
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5190     if 
(params->disable_clock_gating) {
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5191             
hdev->asic_funcs->enable_clock_gating(hdev);
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5192             
mutex_unlock(&gaudi->clk_gate_mutex);
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5193     }
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17  5194  
ec9f5f9d3e4a82 Oded Gabbay 2020-05-17 @5195     return rc;
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5196  }
ac0ae6a96aa58e Oded Gabbay 2020-05-11  5197  

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to