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: <00a901d98315$8e388180$aaa98480$@trustnetic.com>
Date: Wed, 10 May 2023 16:00:58 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: <andy.shevchenko@...il.com>
Cc: "'Piotr Raczynski'" <piotr.raczynski@...el.com>,
	<netdev@...r.kernel.org>,
	<jarkko.nikula@...ux.intel.com>,
	<andriy.shevchenko@...ux.intel.com>,
	<mika.westerberg@...ux.intel.com>,
	<jsd@...ihalf.com>,
	<Jose.Abreu@...opsys.com>,
	<andrew@...n.ch>,
	<hkallweit1@...il.com>,
	<linux@...linux.org.uk>,
	<linux-i2c@...r.kernel.org>,
	<linux-gpio@...r.kernel.org>,
	<mengyuanlou@...-swift.com>
Subject: RE: [PATCH net-next v7 2/9] i2c: designware: Add driver support for Wangxun 10Gb NIC

On Wednesday, May 10, 2023 3:48 PM, andy.shevchenko@...il.com wrote:
> Wed, May 10, 2023 at 02:43:50PM +0800, Jiawen Wu kirjoitti:
> > On Tuesday, May 9, 2023 9:52 PM, Piotr Raczynski wrote:
> > > On Tue, May 09, 2023 at 10:27:27AM +0800, Jiawen Wu wrote:
> 
> ...
> 
> > > >  	/*
> > > > -	 * Initiate I2C message transfer when AMD NAVI GPU card is enabled,
> > > > +  * Initiate I2C message transfer when polling mode is enabled,
> > > >  	 * As it is polling based transfer mechanism, which does not support
> > > >  	 * interrupt based functionalities of existing DesignWare driver.
> > > >  	 */
> > > > -	if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU) {
> > > > +	switch (dev->flags & MODEL_MASK) {
> > > > +	case MODEL_AMD_NAVI_GPU:
> > > >  		ret = amd_i2c_dw_xfer_quirk(adap, msgs, num);
> > > >  		goto done_nolock;
> > > > +	case MODEL_WANGXUN_SP:
> > > > +		ret = txgbe_i2c_dw_xfer_quirk(adap, msgs, num);
> > > > +		goto done_nolock;
> > > > +	default:
> > > > +		break;
> > > >  	}
> > > Nit pick, when I first saw above code it looked a little weird,
> > > maybe it would be a little clearer with:
> > >
> > > 	if (i2c_dw_is_model_poll(dev)) {
> > > 		switch (dev->flags & MODEL_MASK) {
> > > 		case MODEL_AMD_NAVI_GPU:
> > > 			ret = amd_i2c_dw_xfer_quirk(adap, msgs, num);
> > > 			break;
> > > 		case MODEL_WANGXUN_SP:
> > > 			ret = txgbe_i2c_dw_xfer_quirk(adap, msgs, num);
> > > 			break;
> > > 		default:
> > > 			break;
> > > 		}
> > > 		goto done_nolock;
> > > 	}
> > >
> > > I do not insist though.
> >
> > Sure, it looks more obvious as polling mode quirk.
> 
> I don't think we need a double checks. The i2c_dw_is_model_poll() will repeat
> the switch. Please, leave it as is in your current version.

Okay, thanks for all your comments.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ