public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Cc: kaneshige.kenji@soft.fujitsu.com
Subject: [PATCH] PCI: 'is_enabled' flag should be set/cleared when the device is actually enabled/disabled
Date: Wed, 4 May 2005 00:02:16 -0700	[thread overview]
Message-ID: <1115190136453@kroah.com> (raw)
In-Reply-To: <20050504070107.GA17791@kroah.com>

[PATCH] PCI: 'is_enabled' flag should be set/cleared when the device is actually enabled/disabled

I think 'is_enabled' flag in pci_dev structure should be set/cleared
when the device actually enabled/disabled. Especially about
pci_enable_device(), it can be failed. By this change, we will also
get the possibility of refering 'is_enabled' flag from the functions
called through pci_enable_device()/pci_disable_device().

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit ceb43744cd48a20212e2179e0c7ff2f450a3c97e
tree f9554643bc9d70fe761840a603adce393c0e9f08
parent 8800cea62025a5209d110c5fa5990429239d6eee
author Kenji Kaneshige <kaneshige.kenji@soft.fujitsu.com> 1112939611 +0900
committer Greg KH <gregkh@suse.de> 1115189113 -0700

Index: drivers/pci/pci.c
===================================================================
--- 2aa9e4732d7014dcda4c0e80d2e377f52e2262e9/drivers/pci/pci.c  (mode:100644 sha1:bfbff83352688dc99776706033e1bb80b8282946)
+++ f9554643bc9d70fe761840a603adce393c0e9f08/drivers/pci/pci.c  (mode:100644 sha1:fc8cc6c53778b6336e26ef23b1ac3e78eb16c7a2)
@@ -398,10 +398,10 @@
 {
 	int err;
 
-	dev->is_enabled = 1;
 	if ((err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1)))
 		return err;
 	pci_fixup_device(pci_fixup_enable, dev);
+	dev->is_enabled = 1;
 	return 0;
 }
 
@@ -427,16 +427,15 @@
 {
 	u16 pci_command;
 	
-	dev->is_enabled = 0;
-	dev->is_busmaster = 0;
-
 	pci_read_config_word(dev, PCI_COMMAND, &pci_command);
 	if (pci_command & PCI_COMMAND_MASTER) {
 		pci_command &= ~PCI_COMMAND_MASTER;
 		pci_write_config_word(dev, PCI_COMMAND, pci_command);
 	}
+	dev->is_busmaster = 0;
 
 	pcibios_disable_device(dev);
+	dev->is_enabled = 0;
 }
 
 /**


  reply	other threads:[~2005-05-04  7:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-04  7:01 [GIT PATCH] PCI bugfixes for 2.6.12-rc3 Greg KH
2005-05-04  7:02 ` Greg KH [this message]
2005-05-04  7:02   ` [PATCH] PCI: fix stale PCI pm docs Greg KH
2005-05-04  7:02     ` [PATCH] PCI: update PCI documentation for pci_get_slot() depreciation Greg KH
2005-05-04  7:02       ` [PATCH] PCI: Clean up a lot of sparse "Should it be static?" warnings Greg KH
2005-05-04  7:02         ` [PATCH] PCI Hotplug ibmphp_pci.c: Fix masking out needed information too early Greg KH
2005-05-04  7:02           ` [PATCH] PCI: fix up word-aligned 16-bit PCI config access through sysfs Greg KH
2005-05-04  7:02             ` [PATCH] PCI: Add pci shutdown ability Greg KH
2005-05-04  7:02               ` [PATCH] PCI: Rapid Hance quirk Greg KH
2005-05-04  7:02                 ` [PATCH] PCI Hotplug: fix pciehp regression Greg KH
2005-05-04  7:02                   ` [PATCH] PCI: Spelling fixes for drivers/pci Greg KH
2005-05-04  7:02                     ` [PATCH] PCI: drivers/pci/pci.c: remove pci_dac_set_dma_mask Greg KH

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=1115190136453@kroah.com \
    --to=gregkh@suse.de \
    --cc=greg@kroah.com \
    --cc=kaneshige.kenji@soft.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox