xen-pciback: also support disabling of bus-mastering and memory-write-invalidate
PATCH 2/2 xen-pciback: also support disabling of bus-mastering and memory-write-invalidate
It's not clear to me why only the enabling operation got handled so far.
--- drivers/xen/xen-pciback/conf_space_header.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/xen/xen-pciback/conf_space_header.c +14 -1
@@ -88,9 +88,15 @@ static int command_write(struct pci_dev printk(KERN_DEBUG DRV_NAME ": %s: set bus master\n", pci_name(dev));pci_set_master (dev); + }else if (dev->is_busmaster && !is_master_cmd (value)) { +if (unlikely (verbose_request)) + printk(KERN_DEBUG DRV_NAME ": %s: clear bus master\n", +pci_name (dev)); +pci_clear_master (dev); } -if (value &PCI_COMMAND_INVALIDATE ) { +if (!(cmd->val &PCI_COMMAND_INVALIDATE ) && + (value &PCI_COMMAND_INVALIDATE )) {if (unlikely (verbose_request)) printk(KERN_DEBUG DRV_NAME ": %s: enable memory-write-invalidate\n",
@@ -101,6 +107,13 @@ static int command_write(struct pci_dev pci_name(dev), err); value &= ~PCI_COMMAND_INVALIDATE ; } + }else if ((cmd->val &PCI_COMMAND_INVALIDATE ) && + !(value &PCI_COMMAND_INVALIDATE )) { +if (unlikely (verbose_request)) +printk (KERN_DEBUG + DRV_NAME ": %s: disable memory-write-invalidate\n", +pci_name (dev)); +pci_clear_mwi (dev); } cmd->val = value;
Quoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Quoted 42 lines
Signed-off-by Jan Beulich <[email protected]>--- drivers/xen/xen-pciback/conf_space_header.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)drivers/xen/xen-pciback/conf_space_header.c +14
-1@@ -88,9 +88,15 @@ static int command_write(struct pci_dev printk(KERN_DEBUG DRV_NAME ": %s: set bus master\n", pci_name(dev));pci_set_master (dev); + }else if (dev->is_busmaster && !is_master_cmd (value)) { +if (unlikely (verbose_request)) + printk(KERN_DEBUG DRV_NAME ": %s: clear bus master\n", +pci_name (dev)); +pci_clear_master (dev); } -if (value &PCI_COMMAND_INVALIDATE ) { +if (!(cmd->val &PCI_COMMAND_INVALIDATE ) && + (value &PCI_COMMAND_INVALIDATE )) {if (unlikely (verbose_request)) printk(KERN_DEBUG DRV_NAME ": %s: enable memory-write-invalidate\n",@@ -101,6 +107,13 @@ static int command_write(struct pci_dev pci_name(dev), err); value &= ~PCI_COMMAND_INVALIDATE ; } + }else if ((cmd->val &PCI_COMMAND_INVALIDATE ) && + !(value &PCI_COMMAND_INVALIDATE )) { +if (unlikely (verbose_request)) +printk (KERN_DEBUG + DRV_NAME ": %s: disable memory-write-invalidate\n", +pci_name (dev)); +pci_clear_mwi (dev); } cmd->val = value;
Quoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Quoted 42 lines
Signed-off-by Jan Beulich <[email protected]>--- drivers/xen/xen-pciback/conf_space_header.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)drivers/xen/xen-pciback/conf_space_header.c +14
-1@@ -88,9 +88,15 @@ static int command_write(struct pci_dev printk(KERN_DEBUG DRV_NAME ": %s: set bus master\n", pci_name(dev));pci_set_master (dev); + }else if (dev->is_busmaster && !is_master_cmd (value)) { +if (unlikely (verbose_request)) + printk(KERN_DEBUG DRV_NAME ": %s: clear bus master\n", +pci_name (dev)); +pci_clear_master (dev); } -if (value &PCI_COMMAND_INVALIDATE ) { +if (!(cmd->val &PCI_COMMAND_INVALIDATE ) && + (value &PCI_COMMAND_INVALIDATE )) {if (unlikely (verbose_request)) printk(KERN_DEBUG DRV_NAME ": %s: enable memory-write-invalidate\n",@@ -101,6 +107,13 @@ static int command_write(struct pci_dev pci_name(dev), err); value &= ~PCI_COMMAND_INVALIDATE ; } + }else if ((cmd->val &PCI_COMMAND_INVALIDATE ) && + !(value &PCI_COMMAND_INVALIDATE )) { +if (unlikely (verbose_request)) +printk (KERN_DEBUG + DRV_NAME ": %s: disable memory-write-invalidate\n", +pci_name (dev)); +pci_clear_mwi (dev); } cmd->val = value;
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Reviewed-by Konrad Rzeszutek Wilk <[email protected]>
With no reports that this actually fixes anything, do we want this in 4.0 or 4.1?
David
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Reviewed-by Konrad Rzeszutek Wilk <[email protected]>
With no reports that this actually fixes anything, do we want this in 4.0 or 4.1?
David
Quoted 9 lines · David Vrabel
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Reviewed-by Konrad Rzeszutek Wilk <[email protected]>With no reports that this actually fixes anything, do we want this in 4.0 or 4.1?
4.1 is fine.
Quoted 2 lines
David
Quoted 9 lines · David Vrabel
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Reviewed-by Konrad Rzeszutek Wilk <[email protected]>With no reports that this actually fixes anything, do we want this in 4.0 or 4.1?
4.1 is fine.
Quoted 2 lines
David
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 11.03.15 at 15:44, <[email protected]> wrote:
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Reviewed-by Konrad Rzeszutek Wilk <[email protected]>With no reports that this actually fixes anything, do we want this in 4.0 or 4.1?
I'd say 4.1.
Jan
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 11.03.15 at 15:44, <[email protected]> wrote:
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Reviewed-by Konrad Rzeszutek Wilk <[email protected]>With no reports that this actually fixes anything, do we want this in 4.0 or 4.1?
I'd say 4.1.
Jan
David Vrabel
AppliedQuoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Applied to devel/for-linus-4.1, thanks.
David
David Vrabel
AppliedQuoted 2 lines · Jan Beulich
It's not clear to me why only the enabling operation got handled so far.
Applied to devel/for-linus-4.1, thanks.
David