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: <6e75f1b5-db99-43c8-aae9-132269b2eb89@sirena.org.uk>
Date:   Tue, 13 Jun 2023 15:22:35 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Okan Sahin <okan.sahin@...log.com>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Ibrahim Tilki <Ibrahim.Tilki@...log.com>,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v1 2/2] regulator: max77857: Add ADI MAX77857/MAX77831
 Regulator Support

On Tue, Jun 13, 2023 at 11:05:50AM +0300, Okan Sahin wrote:

> +struct regmap_config max77857_regmap_config = {
> +	.reg_bits = 8,
> +	.val_bits = 8,
> +	.cache_type = REGCACHE_RBTREE,

Please use the more modern REGCACHE_MAPLE for new devices.

> +static irqreturn_t max77857_irq_handler(int irq, void *data)
> +{
> +	struct regulator_dev *rdev = data;
> +	enum max77857_id id = (enum max77857_id)rdev_get_drvdata(rdev);
> +	struct device *dev = &rdev->dev;
> +	unsigned long flags = 0;
> +	unsigned int status;
> +	int ret;
> +
> +	switch (id) {
> +	case ID_MAX77831:
> +	case ID_MAX77857:
> +		ret = regmap_read(rdev->regmap, MAX77857_REG_INT_SRC, &status);
> +		break;
> +	default:
> +		return IRQ_HANDLED;
> +	}

We just completely ignore the interrupt if it's not one of the supported
devices, that seems wrong - it looks likee those devices don't have the
support for interrupts at all and so should never get here?  If the
interrupt does go off then this is likely to lead to problems.  I think
it'd be better if the driver just didn't request the interrupt for
devices that it doesn't support interrupts for, if there's no interrupt
support in the hardware for those it could also complain if one is
specified though that's optional.

> +	if (ret) {
> +		dev_err(dev, "cannot read status\n");
> +		return IRQ_HANDLED;
> +	}

IRQ_NONE.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ