All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Jiri Kosina <jikos@jikos.cz>
Cc: mlindner@syskonnect.de, rroesler@syskonnect.de,
	Andrew Morton <akpm@osdl.org>, Jeff Garzik <jeff@garzik.org>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] sk98lin: handle pci_enable_device() return value in skge_resume() properly
Date: Thu, 12 Oct 2006 15:47:14 -0700	[thread overview]
Message-ID: <20061012154714.6924f465@freekitty> (raw)
In-Reply-To: <Pine.LNX.4.64.0610130028450.29022@twin.jikos.cz>

On Fri, 13 Oct 2006 00:38:20 +0200 (CEST)
Jiri Kosina <jikos@jikos.cz> wrote:

> On Thu, 12 Oct 2006, Stephen Hemminger wrote:
> 
> > >  	pci_set_power_state(pdev, PCI_D0);
> > >  	pci_restore_state(pdev);
> > > -	pci_enable_device(pdev);
> > > +	if ((ret = pci_enable_device(pdev))) {
> > > +		printk(KERN_ERR "sk98lin: Cannot enable PCI device during resume\n");
> > > +		unregister_netdev(dev);
> > >
> > Having the device unregister seems harsh.
> 
> What would be the proper way? As the initialization failed, accessing the 
> device would not make sense any more (therefore I don't think that calling 
> skge_remove_one() would be OK, as it issues calls to SkEventQueue() and 
> SkEventDispatcher(), trying to send something to the card).

I guess, its just not clear what the state of the machine is anyway
if you can't enable the device something is hosed (or the device was
hot removed).

> > Why put condtional on same line?
> 
> Pardon me?

I prefer:
	ret = pci_enable_device(pdev);
	if (ret) {



> 
> > Why not print device name dev->name.
> 
> Thanks.
> 
> [PATCH] fix sk98lin driver, ignoring return value from pci_enable_device()
> 
> add check of return value to _resume() function of sk98lin driver.
> 
> Signed-off-by: Jiri Kosina <jikos@jikos.cz>
> 
> --- 
> 
>  drivers/net/sk98lin/skge.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
> index d4913c3..1f03cf8 100644
> --- a/drivers/net/sk98lin/skge.c
> +++ b/drivers/net/sk98lin/skge.c
> @@ -5070,7 +5070,11 @@ static int skge_resume(struct pci_dev *p
>  
>  	pci_set_power_state(pdev, PCI_D0);
>  	pci_restore_state(pdev);
> -	pci_enable_device(pdev);
> +	if ((ret = pci_enable_device(pdev))) {
> +		printk(KERN_ERR "sk98lin: Cannot enable PCI device %s during resume\n", 
> +				dev->name);
> +		return ret;
> +	}
>  	pci_set_master(pdev);
>  	if (pAC->GIni.GIMacsFound == 2)
>  		ret = request_irq(dev->irq, SkGeIsr, IRQF_SHARED, "sk98lin", dev);
> 


-- 
Stephen Hemminger <shemminger@osdl.org>

  reply	other threads:[~2006-10-12 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-12 22:17 [PATCH] sk98lin: handle pci_enable_device() return value in skge_resume() properly Jiri Kosina
2006-10-12 22:25 ` Stephen Hemminger
2006-10-12 22:38   ` Jiri Kosina
2006-10-12 22:47     ` Stephen Hemminger [this message]
2006-10-12 22:57       ` Jiri Kosina
2006-10-13  0:50         ` Andrew Morton
2006-10-13  1:12           ` Jiri Kosina
2007-02-23 23:17             ` [PATCH] sk98lin: handle pci_enable_device() return value in skge_resume() Dmitriy Monakhov
2007-02-24 11:41               ` Dmitriy Monakhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061012154714.6924f465@freekitty \
    --to=shemminger@osdl.org \
    --cc=akpm@osdl.org \
    --cc=jeff@garzik.org \
    --cc=jikos@jikos.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlindner@syskonnect.de \
    --cc=netdev@vger.kernel.org \
    --cc=rroesler@syskonnect.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.