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] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211220615.q0vnGfzb-lkp@intel.com>
Date:   Tue, 22 Nov 2022 06:20:23 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc:     oe-kbuild-all@...ts.linux.dev, netdev@...r.kernel.org,
        edumazet@...gle.com, pabeni@...hat.com, uwe@...ine-koenig.org,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>, Ido Schimmel <idosch@...dia.com>
Subject: Re: [PATCH net-next 04/12] net/mlxsw: Convert to i2c's .probe_new()

Hi Jakub,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Jakub-Kicinski/net-Complete-conversion-to-i2c_probe_new/20221122-031952
patch link:    https://lore.kernel.org/r/20221121191546.1853970-5-kuba%40kernel.org
patch subject: [PATCH net-next 04/12] net/mlxsw: Convert to i2c's .probe_new()
config: m68k-allyesconfig
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/b9d623a1069452a5c81ffeee8806dd82b515985c
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Jakub-Kicinski/net-Complete-conversion-to-i2c_probe_new/20221122-031952
        git checkout b9d623a1069452a5c81ffeee8806dd82b515985c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/net/ethernet/mellanox/mlxsw/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/mellanox/mlxsw/i2c.c: In function 'mlxsw_i2c_probe':
   drivers/net/ethernet/mellanox/mlxsw/i2c.c:637:42: error: implicit declaration of function 'i2c_client_get_device_id'; did you mean 'i2c_get_device_id'? [-Werror=implicit-function-declaration]
     637 |         const struct i2c_device_id *id = i2c_client_get_device_id(client);
         |                                          ^~~~~~~~~~~~~~~~~~~~~~~~
         |                                          i2c_get_device_id
>> drivers/net/ethernet/mellanox/mlxsw/i2c.c:637:42: warning: initialization of 'const struct i2c_device_id *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   cc1: some warnings being treated as errors


vim +637 drivers/net/ethernet/mellanox/mlxsw/i2c.c

   634	
   635	static int mlxsw_i2c_probe(struct i2c_client *client)
   636	{
 > 637		const struct i2c_device_id *id = i2c_client_get_device_id(client);
   638		const struct i2c_adapter_quirks *quirks = client->adapter->quirks;
   639		struct mlxsw_i2c *mlxsw_i2c;
   640		u8 status;
   641		int err;
   642	
   643		mlxsw_i2c = devm_kzalloc(&client->dev, sizeof(*mlxsw_i2c), GFP_KERNEL);
   644		if (!mlxsw_i2c)
   645			return -ENOMEM;
   646	
   647		if (quirks) {
   648			if ((quirks->max_read_len &&
   649			     quirks->max_read_len < MLXSW_I2C_BLK_DEF) ||
   650			    (quirks->max_write_len &&
   651			     quirks->max_write_len < MLXSW_I2C_BLK_DEF)) {
   652				dev_err(&client->dev, "Insufficient transaction buffer length\n");
   653				return -EOPNOTSUPP;
   654			}
   655	
   656			mlxsw_i2c->block_size = max_t(u16, MLXSW_I2C_BLK_DEF,
   657						      min_t(u16, quirks->max_read_len,
   658							    quirks->max_write_len));
   659		} else {
   660			mlxsw_i2c->block_size = MLXSW_I2C_BLK_DEF;
   661		}
   662	
   663		i2c_set_clientdata(client, mlxsw_i2c);
   664		mutex_init(&mlxsw_i2c->cmd.lock);
   665	
   666		/* In order to use mailboxes through the i2c, special area is reserved
   667		 * on the i2c address space that can be used for input and output
   668		 * mailboxes. Such mailboxes are called local mailboxes. When using a
   669		 * local mailbox, software should specify 0 as the Input/Output
   670		 * parameters. The location of the Local Mailbox addresses on the i2c
   671		 * space can be retrieved through the QUERY_FW command.
   672		 * For this purpose QUERY_FW is to be issued with opcode modifier equal
   673		 * 0x01. For such command the output parameter is an immediate value.
   674		 * Here QUERY_FW command is invoked for ASIC probing and for getting
   675		 * local mailboxes addresses from immedate output parameters.
   676		 */
   677	
   678		/* Prepare and write out Command Interface Register for transaction */
   679		err = mlxsw_i2c_write_cmd(client, mlxsw_i2c, 1);
   680		if (err) {
   681			dev_err(&client->dev, "Could not start transaction");
   682			goto errout;
   683		}
   684	
   685		/* Wait until go bit is cleared. */
   686		err = mlxsw_i2c_wait_go_bit(client, mlxsw_i2c, &status);
   687		if (err) {
   688			dev_err(&client->dev, "HW semaphore is not released");
   689			goto errout;
   690		}
   691	
   692		/* Validate transaction completion status. */
   693		if (status) {
   694			dev_err(&client->dev, "Bad transaction completion status %x\n",
   695				status);
   696			err = -EIO;
   697			goto errout;
   698		}
   699	
   700		/* Get mailbox offsets. */
   701		err = mlxsw_i2c_get_mbox(client, mlxsw_i2c);
   702		if (err < 0) {
   703			dev_err(&client->dev, "Fail to get mailboxes\n");
   704			goto errout;
   705		}
   706	
   707		dev_info(&client->dev, "%s mb size=%x off=0x%08x out mb size=%x off=0x%08x\n",
   708			 id->name, mlxsw_i2c->cmd.mb_size_in,
   709			 mlxsw_i2c->cmd.mb_off_in, mlxsw_i2c->cmd.mb_size_out,
   710			 mlxsw_i2c->cmd.mb_off_out);
   711	
   712		/* Register device bus. */
   713		mlxsw_i2c->bus_info.device_kind = id->name;
   714		mlxsw_i2c->bus_info.device_name = client->name;
   715		mlxsw_i2c->bus_info.dev = &client->dev;
   716		mlxsw_i2c->bus_info.low_frequency = true;
   717		mlxsw_i2c->dev = &client->dev;
   718		mlxsw_i2c->pdata = client->dev.platform_data;
   719	
   720		err = mlxsw_i2c_irq_init(mlxsw_i2c, client->addr);
   721		if (err)
   722			goto errout;
   723	
   724		err = mlxsw_core_bus_device_register(&mlxsw_i2c->bus_info,
   725						     &mlxsw_i2c_bus, mlxsw_i2c, false,
   726						     NULL, NULL);
   727		if (err) {
   728			dev_err(&client->dev, "Fail to register core bus\n");
   729			goto err_bus_device_register;
   730		}
   731	
   732		return 0;
   733	
   734	err_bus_device_register:
   735		mlxsw_i2c_irq_fini(mlxsw_i2c);
   736	errout:
   737		mutex_destroy(&mlxsw_i2c->cmd.lock);
   738		i2c_set_clientdata(client, NULL);
   739	
   740		return err;
   741	}
   742	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (282799 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ