Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-03 Thread Arnd Bergmann
On Tuesday 03 February 2015 11:37:30 Marc Zyngier wrote: > Side question: In the probe-only case, should we still allow this write > to happen? No, my understanding is that PCI_PROBE_ONLY precisely means that we do not modify the config space and instead trust what is there to be sensible.

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-03 Thread Marc Zyngier
On 03/02/15 11:31, Arnd Bergmann wrote: > On Tuesday 03 February 2015 10:38:25 Marc Zyngier wrote: >> >> That's exactly what I thought until Lorenzo reported kvmtool falling >> over because of this write. Obviously, some platforms must actually >> require this (possibly for bridges that are not

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-03 Thread Arnd Bergmann
On Tuesday 03 February 2015 10:38:25 Marc Zyngier wrote: > > That's exactly what I thought until Lorenzo reported kvmtool falling > over because of this write. Obviously, some platforms must actually > require this (possibly for bridges that are not known by the firmware). This sounds much like

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-03 Thread Marc Zyngier
On 02/02/15 17:02, Arnd Bergmann wrote: > On Wednesday 28 January 2015 14:51:23 Marc Zyngier wrote: >> void __weak pcibios_update_irq(struct pci_dev *dev, int irq) >> { >> - dev_dbg(>dev, "assigning IRQ %02d\n", irq); >> - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); >> +

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-03 Thread Arnd Bergmann
On Tuesday 03 February 2015 10:38:25 Marc Zyngier wrote: That's exactly what I thought until Lorenzo reported kvmtool falling over because of this write. Obviously, some platforms must actually require this (possibly for bridges that are not known by the firmware). This sounds much like a

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-03 Thread Marc Zyngier
On 03/02/15 11:31, Arnd Bergmann wrote: On Tuesday 03 February 2015 10:38:25 Marc Zyngier wrote: That's exactly what I thought until Lorenzo reported kvmtool falling over because of this write. Obviously, some platforms must actually require this (possibly for bridges that are not known by

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-03 Thread Arnd Bergmann
On Tuesday 03 February 2015 11:37:30 Marc Zyngier wrote: Side question: In the probe-only case, should we still allow this write to happen? No, my understanding is that PCI_PROBE_ONLY precisely means that we do not modify the config space and instead trust what is there to be sensible.

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-03 Thread Marc Zyngier
On 02/02/15 17:02, Arnd Bergmann wrote: On Wednesday 28 January 2015 14:51:23 Marc Zyngier wrote: void __weak pcibios_update_irq(struct pci_dev *dev, int irq) { - dev_dbg(dev-dev, assigning IRQ %02d\n, irq); - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); + struct

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Arnd Bergmann
On Wednesday 28 January 2015 14:51:23 Marc Zyngier wrote: > void __weak pcibios_update_irq(struct pci_dev *dev, int irq) > { > - dev_dbg(>dev, "assigning IRQ %02d\n", irq); > - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); > + struct irq_data *d; > + > + d =

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Russell King - ARM Linux
On Mon, Feb 02, 2015 at 06:08:17PM +, Marc Zyngier wrote: > Hi Russell, > > On 02/02/15 16:33, Russell King - ARM Linux wrote: > > What your change would mean is that the IRQs currently being programmed > >> = 16 would be programmed into with numbers with 16 removed from them. > > This means

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Marc Zyngier
Hi Russell, On 02/02/15 16:33, Russell King - ARM Linux wrote: > On Wed, Jan 28, 2015 at 02:51:23PM +, Marc Zyngier wrote: >> void __weak pcibios_update_irq(struct pci_dev *dev, int irq) >> { >> -dev_dbg(>dev, "assigning IRQ %02d\n", irq); >> -pci_write_config_byte(dev,

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Russell King - ARM Linux
On Wed, Jan 28, 2015 at 02:51:23PM +, Marc Zyngier wrote: > void __weak pcibios_update_irq(struct pci_dev *dev, int irq) > { > - dev_dbg(>dev, "assigning IRQ %02d\n", irq); > - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); > + struct irq_data *d; > + > + d =

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Marc Zyngier
On 02/02/15 15:57, Bjorn Helgaas wrote: > On Wed, Jan 28, 2015 at 8:51 AM, Marc Zyngier wrote: >> pcibios_update_irq writes an irq number into the config space >> of a given PCI device, but ignores the fact that this number >> is a virtual interrupt number, which might be a very different >>

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Bjorn Helgaas
On Mon, Feb 2, 2015 at 10:15 AM, Marc Zyngier wrote: > On 28/01/15 15:43, Bjorn Helgaas wrote: >> On Wed, Jan 28, 2015 at 9:27 AM, Marc Zyngier wrote: >>> Hi Gerry, >>> >>> On 28/01/15 15:21, Jiang Liu wrote: On 2015/1/28 22:51, Marc Zyngier wrote: > pcibios_update_irq writes

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Marc Zyngier
On 28/01/15 15:43, Bjorn Helgaas wrote: > On Wed, Jan 28, 2015 at 9:27 AM, Marc Zyngier wrote: >> Hi Gerry, >> >> On 28/01/15 15:21, Jiang Liu wrote: >>> >>> >>> On 2015/1/28 22:51, Marc Zyngier wrote: pcibios_update_irq writes an irq number into the config space of a given PCI device,

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Jiang Liu
On 2015/2/2 23:57, Bjorn Helgaas wrote: > On Wed, Jan 28, 2015 at 8:51 AM, Marc Zyngier wrote: >> pcibios_update_irq writes an irq number into the config space >> of a given PCI device, but ignores the fact that this number >> is a virtual interrupt number, which might be a very different >>

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Bjorn Helgaas
On Wed, Jan 28, 2015 at 8:51 AM, Marc Zyngier wrote: > pcibios_update_irq writes an irq number into the config space > of a given PCI device, but ignores the fact that this number > is a virtual interrupt number, which might be a very different > value from what the underlying hardware is using.

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Jiang Liu
On 2015/2/2 23:57, Bjorn Helgaas wrote: On Wed, Jan 28, 2015 at 8:51 AM, Marc Zyngier marc.zyng...@arm.com wrote: pcibios_update_irq writes an irq number into the config space of a given PCI device, but ignores the fact that this number is a virtual interrupt number, which might be a very

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Marc Zyngier
On 28/01/15 15:43, Bjorn Helgaas wrote: On Wed, Jan 28, 2015 at 9:27 AM, Marc Zyngier marc.zyng...@arm.com wrote: Hi Gerry, On 28/01/15 15:21, Jiang Liu wrote: On 2015/1/28 22:51, Marc Zyngier wrote: pcibios_update_irq writes an irq number into the config space of a given PCI device, but

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Bjorn Helgaas
On Wed, Jan 28, 2015 at 8:51 AM, Marc Zyngier marc.zyng...@arm.com wrote: pcibios_update_irq writes an irq number into the config space of a given PCI device, but ignores the fact that this number is a virtual interrupt number, which might be a very different value from what the underlying

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Marc Zyngier
On 02/02/15 15:57, Bjorn Helgaas wrote: On Wed, Jan 28, 2015 at 8:51 AM, Marc Zyngier marc.zyng...@arm.com wrote: pcibios_update_irq writes an irq number into the config space of a given PCI device, but ignores the fact that this number is a virtual interrupt number, which might be a very

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Russell King - ARM Linux
On Wed, Jan 28, 2015 at 02:51:23PM +, Marc Zyngier wrote: void __weak pcibios_update_irq(struct pci_dev *dev, int irq) { - dev_dbg(dev-dev, assigning IRQ %02d\n, irq); - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); + struct irq_data *d; + + d =

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Bjorn Helgaas
On Mon, Feb 2, 2015 at 10:15 AM, Marc Zyngier marc.zyng...@arm.com wrote: On 28/01/15 15:43, Bjorn Helgaas wrote: On Wed, Jan 28, 2015 at 9:27 AM, Marc Zyngier marc.zyng...@arm.com wrote: Hi Gerry, On 28/01/15 15:21, Jiang Liu wrote: On 2015/1/28 22:51, Marc Zyngier wrote:

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Russell King - ARM Linux
On Mon, Feb 02, 2015 at 06:08:17PM +, Marc Zyngier wrote: Hi Russell, On 02/02/15 16:33, Russell King - ARM Linux wrote: What your change would mean is that the IRQs currently being programmed = 16 would be programmed into with numbers with 16 removed from them. This means that

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Marc Zyngier
Hi Russell, On 02/02/15 16:33, Russell King - ARM Linux wrote: On Wed, Jan 28, 2015 at 02:51:23PM +, Marc Zyngier wrote: void __weak pcibios_update_irq(struct pci_dev *dev, int irq) { -dev_dbg(dev-dev, assigning IRQ %02d\n, irq); -pci_write_config_byte(dev, PCI_INTERRUPT_LINE,

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-02-02 Thread Arnd Bergmann
On Wednesday 28 January 2015 14:51:23 Marc Zyngier wrote: void __weak pcibios_update_irq(struct pci_dev *dev, int irq) { - dev_dbg(dev-dev, assigning IRQ %02d\n, irq); - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); + struct irq_data *d; + + d =

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-01-28 Thread Jiang Liu
On 2015/1/28 22:51, Marc Zyngier wrote: > pcibios_update_irq writes an irq number into the config space > of a given PCI device, but ignores the fact that this number > is a virtual interrupt number, which might be a very different > value from what the underlying hardware is using. > > The

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-01-28 Thread Marc Zyngier
Hi Gerry, On 28/01/15 15:21, Jiang Liu wrote: > > > On 2015/1/28 22:51, Marc Zyngier wrote: >> pcibios_update_irq writes an irq number into the config space >> of a given PCI device, but ignores the fact that this number >> is a virtual interrupt number, which might be a very different >> value

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-01-28 Thread Bjorn Helgaas
On Wed, Jan 28, 2015 at 9:27 AM, Marc Zyngier wrote: > Hi Gerry, > > On 28/01/15 15:21, Jiang Liu wrote: >> >> >> On 2015/1/28 22:51, Marc Zyngier wrote: >>> pcibios_update_irq writes an irq number into the config space >>> of a given PCI device, but ignores the fact that this number >>> is a

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-01-28 Thread Marc Zyngier
Hi Gerry, On 28/01/15 15:21, Jiang Liu wrote: On 2015/1/28 22:51, Marc Zyngier wrote: pcibios_update_irq writes an irq number into the config space of a given PCI device, but ignores the fact that this number is a virtual interrupt number, which might be a very different value from what

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-01-28 Thread Bjorn Helgaas
On Wed, Jan 28, 2015 at 9:27 AM, Marc Zyngier marc.zyng...@arm.com wrote: Hi Gerry, On 28/01/15 15:21, Jiang Liu wrote: On 2015/1/28 22:51, Marc Zyngier wrote: pcibios_update_irq writes an irq number into the config space of a given PCI device, but ignores the fact that this number is a

Re: [PATCH] PCI: Fix pcibios_update_irq misuse of irq number

2015-01-28 Thread Jiang Liu
On 2015/1/28 22:51, Marc Zyngier wrote: pcibios_update_irq writes an irq number into the config space of a given PCI device, but ignores the fact that this number is a virtual interrupt number, which might be a very different value from what the underlying hardware is using. The obvious