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: <fa91c90d-c0d6-49d1-a7e5-732aac0c7ed5@linux.intel.com>
Date:   Wed, 15 Nov 2023 11:45:10 +0200
From:   Jarkko Nikula <jarkko.nikula@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Mario Limonciello <mario.limonciello@....com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        Wolfram Sang <wsa@...nel.org>, linux-i2c@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Jan Dabros <jsd@...ihalf.com>,
        Andi Shyti <andi.shyti@...nel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Hans de Goede <hdegoede@...hat.com>
Subject: Re: [PATCH v3 01/25] i2c: designware: Delete adapter before disabling
 in i2c_dw_pci_remove()

On 11/10/23 20:11, Andy Shevchenko wrote:
> Make i2c_dw_pci_remove() to be aligned with dw_i2c_plat_remove() on
> the sequence of the ceasing I²C operations.
> 
> Fixes: 18dbdda89f5c ("i2c-designware: Add runtime power management support")

I think this is wrong. Commit 18dbdda89f5c is 12 years ago so is this 
patch really fixing a real bug that was hiding all these years?

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>   drivers/i2c/busses/i2c-designware-pcidrv.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
> index 61d7a27aa070..35d35d7c8e23 100644
> --- a/drivers/i2c/busses/i2c-designware-pcidrv.c
> +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
> @@ -354,11 +354,13 @@ static void i2c_dw_pci_remove(struct pci_dev *pdev)
>   {
>   	struct dw_i2c_dev *dev = pci_get_drvdata(pdev);
>   
> +	i2c_del_adapter(&dev->adapter);
> +
>   	dev->disable(dev);
> +
>   	pm_runtime_forbid(&pdev->dev);
>   	pm_runtime_get_noresume(&pdev->dev);
>   
> -	i2c_del_adapter(&dev->adapter);
>   	devm_free_irq(&pdev->dev, dev->irq, dev);
>   	pci_free_irq_vectors(pdev);
>   }

Then I believe this patch may potentially introduce a bug. As far as I 
can see nothing wrong regarding adapter deletion after the commit 
18dbdda89f5c:

i2c_dw_pci_probe()
{
	...
	i2c_add_numbered_adapter()
	pm_runtime_enable_stuff()
	...
}

i2c_dw_pci_remove()
{
	...
	pm_runtime_disable_stuff()
	i2c_del_adapter()
	...
}

Order is still practically the same in current i2c-designware-pcidrv.c 
code but after this patch disabling/deletion is not done in reverse order.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ