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: <SEZPR06MB526997FBE2B216AD82986E0EF2609@SEZPR06MB5269.apcprd06.prod.outlook.com>
Date:   Fri, 21 Apr 2023 02:01:28 +0000
From:   Ryan Chen <ryan_chen@...eedtech.com>
To:     Andi Shyti <andi.shyti@...nel.org>
CC:     "jk@...econstruct.com.au" <jk@...econstruct.com.au>,
        Brendan Higgins <brendan.higgins@...ux.dev>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Joel Stanley <joel@....id.au>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Andrew Jeffery <andrew@...id.au>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Wolfram Sang <wsa@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
        Florian Fainelli <f.fainelli@...il.com>,
        Jean Delvare <jdelvare@...e.de>,
        William Zhang <william.zhang@...adcom.com>,
        Tyrone Ting <kfting@...oton.com>,
        Tharun Kumar P <tharunkumar.pasumarthi@...rochip.com>,
        Conor Dooley <conor.dooley@...rochip.com>,
        Phil Edworthy <phil.edworthy@...esas.com>,
        "openbmc@...ts.ozlabs.org" <openbmc@...ts.ozlabs.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-aspeed@...ts.ozlabs.org" <linux-aspeed@...ts.ozlabs.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v10 2/2] i2c: aspeed: support ast2600 i2c new register
 mode driver

Hello Andi,
> 
> On Sat, Apr 15, 2023 at 09:28:48AM +0800, Ryan Chen wrote:
> > Add i2c new register mode driver to support AST2600 i2c new register
> > mode. AST2600 i2c controller have legacy and new register mode. The
> > new register mode have global register support 4 base clock for scl
> > clock selection, and new clock divider mode. The i2c new register mode
> > have separate register set to control i2c master and slave.
> 
> This commit message is a bit messy, could you please write it more clear?
> 
> [...]
> 
The more statement is in cover letter.
https://patchwork.ozlabs.org/project/linux-aspeed/cover/20230415012848.1777768-1-ryan_chen@aspeedtech.com/


> > +static int ast2600_i2c_probe(struct platform_device *pdev) {
> > +	struct device_node *np = pdev->dev.of_node;
> > +	struct device *dev = &pdev->dev;
> > +	struct ast2600_i2c_bus *i2c_bus;
> > +	struct resource *res;
> > +	u32 global_ctrl;
> > +	int ret = 0;
> > +
> > +	i2c_bus = devm_kzalloc(dev, sizeof(*i2c_bus), GFP_KERNEL);
> > +	if (!i2c_bus)
> > +		return -ENOMEM;
> 
> Let's use dev_err_probe whenever possible, at least we keep a coherent style.

Will modify dev_err_probe to next patch
> 
> [...]
> 
> > +	ret = devm_request_irq(dev, i2c_bus->irq, ast2600_i2c_bus_irq, 0,
> > +			       dev_name(dev), i2c_bus);
> 
> isn't it better to use threaded irq? You have quite an elaborate irq handler, you
> may want to use a thread for it.

Thanks, but I would prefer to stick currently implement of the IRQ request. Thank you for your input.

> 
> > +	if (ret < 0)
> > +		return dev_err_probe(dev, ret, "Unable to request irq %d\n",
> > +i2c_bus->irq);
> > +
> > +	if (of_property_read_bool(dev->of_node, "smbus-alert")) {
> > +		i2c_bus->alert_enable = 1;
> 
> true;

> 
> alert_enable is boolean, make it bool.

Will modify dev_err_probe to next patch

> 
> > +		i2c_bus->ara = i2c_new_smbus_alert_device(&i2c_bus->adap,
> &i2c_bus->alert_data);
> > +		if (!i2c_bus->ara)
> > +			dev_warn(dev, "Failed to register ARA client\n");
> > +
> > +		writel(AST2600_I2CM_PKT_DONE | AST2600_I2CM_BUS_RECOVER |
> AST2600_I2CM_SMBUS_ALT,
> > +		       i2c_bus->reg_base + AST2600_I2CM_IER);
> > +	} else {
> > +		i2c_bus->alert_enable = 0;
> 
> false;

Will modify dev_err_probe to next patch

> 
> I'm not going to review any further, please send the patch after you have run
> checkpatch.pl on it. Thanks!

Sure. 

Thanks, your review.
Ryan Chen.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ