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]
Date:	Sat, 26 Aug 2006 17:41:58 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Valerie Henson <val_henson@...ux.intel.com>
Cc:	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	Jeff Garzik <jeff@...zik.org>
Subject: Re: [patch 08/10] [TULIP] Handle pci_enable_device() errors in
	resume

Ar Gwe, 2006-08-25 am 17:02 -0700, ysgrifennodd Valerie Henson:
>  	pci_set_power_state(pdev, PCI_D0);
>  	pci_restore_state(pdev);
>  
> -	pci_enable_device(pdev);
> +	if ((retval = pci_enable_device(pdev))) {
> +		printk (KERN_ERR "tulip: pci_enable_device failed in resume\n");
> +		return retval;
> +	}
Should you not stick it back in D3 if you are being neat about this ?

 
>  	if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev))) {
>  		printk (KERN_ERR "tulip: request_irq failed in resume\n");
> --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/winbond-840.c
> +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/winbond-840.c
> @@ -1626,14 +1626,18 @@ static int w840_resume (struct pci_dev *
>  {
>  	struct net_device *dev = pci_get_drvdata (pdev);
>  	struct netdev_private *np = netdev_priv(dev);
> +	int retval;
>  
>  	rtnl_lock();
>  	if (netif_device_present(dev))
>  		goto out; /* device not suspended */
>  	if (netif_running(dev)) {
> -		pci_enable_device(pdev);
> -	/*	pci_power_on(pdev); */
> -
> +		if ((retval = pci_enable_device(pdev))) {
> +			printk (KERN_ERR
> +				"%s: pci_enable_device failed in resume\n",
> +				dev->name);
> +			return retval;

NAK: What about rtnl_lock()

> +		}
>  		spin_lock_irq(&np->lock);
>  		iowrite32(1, np->base_addr+PCIBusCfg);
>  		ioread32(np->base_addr+PCIBusCfg);
> --- linux-2.6.18-rc4-mm1.orig/drivers/net/tulip/de2104x.c
> +++ linux-2.6.18-rc4-mm1/drivers/net/tulip/de2104x.c
> @@ -2138,17 +2138,21 @@ static int de_resume (struct pci_dev *pd
>  {
>  	struct net_device *dev = pci_get_drvdata (pdev);
>  	struct de_private *de = dev->priv;
> +	int retval;
>  
>  	rtnl_lock();
>  	if (netif_device_present(dev))
>  		goto out;
> -	if (netif_running(dev)) {
> -		pci_enable_device(pdev);
> -		de_init_hw(de);
> -		netif_device_attach(dev);
> -	} else {
> -		netif_device_attach(dev);
> +	if (!netif_running(dev))
> +		goto out_attach;
> +	if ((retval = pci_enable_device(pdev))) {
> +		printk (KERN_ERR "%s: pci_enable_device failed in resume\n",
> +			dev->name);
> +		return retval;

NAK again - rtnl_lock


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ