All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] cleanup pciback_reset_device
@ 2006-12-18  9:21 Akio Takebe
  2006-12-18  9:33 ` Keir Fraser
  0 siblings, 1 reply; 3+ messages in thread
From: Akio Takebe @ 2006-12-18  9:21 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 873 bytes --]

Hi,

This patch is for cleanup of pciback_reset_device.
is_enabled=0 and is_busmaster=0 are not necessary
because pci_disable_device() do them.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

diff -r c6f637694b85 linux-2.6-xen-sparse/drivers/xen/pciback/pciback_ops.c
--- a/linux-2.6-xen-sparse/drivers/xen/pciback/pciback_ops.c	Fri Dec 15 11:
53:45 2006 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/pciback/pciback_ops.c	Mon Dec 18 08:
58:43 2006 +0900
@@ -22,11 +22,7 @@ void pciback_reset_device(struct pci_dev
 	/* Disable devices (but not bridges) */
 	if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
 		pci_disable_device(dev);
-
 		pci_write_config_word(dev, PCI_COMMAND, 0);
-
-		dev->is_enabled = 0;
-		dev->is_busmaster = 0;
 	} else {
 		pci_read_config_word(dev, PCI_COMMAND, &cmd);
 		if (cmd & (PCI_COMMAND_INVALIDATE)) {


Best Regards,

Akio Takebe

[-- Attachment #2: cleanup_pciback_reset_device.patch --]
[-- Type: application/octet-stream, Size: 641 bytes --]

diff -r c6f637694b85 linux-2.6-xen-sparse/drivers/xen/pciback/pciback_ops.c
--- a/linux-2.6-xen-sparse/drivers/xen/pciback/pciback_ops.c	Fri Dec 15 11:53:45 2006 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/pciback/pciback_ops.c	Mon Dec 18 08:58:43 2006 +0900
@@ -22,11 +22,7 @@ void pciback_reset_device(struct pci_dev
 	/* Disable devices (but not bridges) */
 	if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
 		pci_disable_device(dev);
-
 		pci_write_config_word(dev, PCI_COMMAND, 0);
-
-		dev->is_enabled = 0;
-		dev->is_busmaster = 0;
 	} else {
 		pci_read_config_word(dev, PCI_COMMAND, &cmd);
 		if (cmd & (PCI_COMMAND_INVALIDATE)) {

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] cleanup pciback_reset_device
  2006-12-18  9:21 [Patch] cleanup pciback_reset_device Akio Takebe
@ 2006-12-18  9:33 ` Keir Fraser
  2006-12-18 13:26   ` Akio Takebe
  0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2006-12-18  9:33 UTC (permalink / raw)
  To: Akio Takebe, xen-devel

On 18/12/06 9:21 am, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote:

> This patch is for cleanup of pciback_reset_device.
> is_enabled=0 and is_busmaster=0 are not necessary
> because pci_disable_device() do them.

If you are zapping the command register then doesn't it makes sense to zap
the software flags relating to that at the same time, even if that sometimes
happens to be redundant? It certainly means we can be sure they won't get
out of sync.

 -- Keir

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] cleanup pciback_reset_device
  2006-12-18  9:33 ` Keir Fraser
@ 2006-12-18 13:26   ` Akio Takebe
  0 siblings, 0 replies; 3+ messages in thread
From: Akio Takebe @ 2006-12-18 13:26 UTC (permalink / raw)
  To: Keir Fraser, xen-devel; +Cc: Akio Takebe

Hi, Keir

>On 18/12/06 9:21 am, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote:
>
>> This patch is for cleanup of pciback_reset_device.
>> is_enabled=0 and is_busmaster=0 are not necessary
>> because pci_disable_device() do them.
>
>If you are zapping the command register then doesn't it makes sense to zap
>the software flags relating to that at the same time, even if that sometimes
>happens to be redundant? It certainly means we can be sure they won't get
>out of sync.
>
I checked linux-2.6.19 and linux-2.6.18, 
both pci_disable_device()s do is_enabled=0 and is_busmaster=0.
I think pci_write_config_word(dev, PCI_COMMAND, 0) is not also necessary,
(though I'm not sure it.)

So I think they in pciback_reset_device() are not necessary.

But if you want to leave it for safe, I agree. :)

Best Regards,

Akio Takebe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-18 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-18  9:21 [Patch] cleanup pciback_reset_device Akio Takebe
2006-12-18  9:33 ` Keir Fraser
2006-12-18 13:26   ` Akio Takebe

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.