Skip to contentSkip to conversation

MSI: Use correct data offset for 32-bit MSI in read_msi_msg()

DISCUSSION Eric W. Biederman 3 participants 5 messages Oct 3, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Eric W. Biederman

author Acked-by
#1 lore raw
Quoted 4 lines · Roland Dreier

While reading the MSI code trying to find a reason why MSI wouldn't work for devices that have a 32-bit MSI address capability, I noticed that read_msi_msg() seems to read the message data from the wrong offset in this case.

Doh! Sorry about that.

Quoted 21 lines

---
Unfortunately MSI still doesn't seem to work with Intel 945GM integrated graphics on my laptop, even with this fix....

 drivers/pci/msi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/pci/msi.c +1 -1
index be1df85..87e0161 100644
@@ -132,7 +132,7 @@ void read_msi_msg(unsigned int irq, struct msi_msg *msg)
 			pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
 		} else {
 			msg->address_hi = 0;
-			pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
+			pci_read_config_word(dev, msi_data_reg(pos, 0), &data);
 		}
 		msg->data = data;
 		break;
#2 lore raw
Quoted 6 lines
Quoted 4 lines

While reading the MSI code trying to find a reason why MSI wouldn't work for devices that have a 32-bit MSI address capability, I noticed that read_msi_msg() seems to read the message data from the wrong offset in this case.

Doh! Sorry about that.

Doesn't matter, it wasn't the bug hitting me anyway :) the IRQ never got affinity changed so read_msi_msg() never even got called.

I'm starting to think that Intel 945GM graphics just has a busted MSI implementation, although there may be a bug hiding in the Linux code that I'm not seeing.

- R.

#3 lore raw
Quoted 5 lines · Roland Dreier
Quoted 5 lines
Quoted 4 lines

While reading the MSI code trying to find a reason why MSI wouldn't work for devices that have a 32-bit MSI address capability, I noticed that read_msi_msg() seems to read the message data from the wrong offset in this case.

Quoted 8 lines
Quoted 1 line

Doh! Sorry about that.

Doesn't matter, it wasn't the bug hitting me anyway :) the IRQ never got affinity changed so read_msi_msg() never even got called.

I'm starting to think that Intel 945GM graphics just has a busted MSI implementation, although there may be a bug hiding in the Linux code that I'm not seeing.

Well it is a bug worth fixing. Who knows it may have something to do with the disable_irq problems the forcedeth driver was seeing.

Right now MSI is still sufficiently new that everyone is still getting the bugs out of their implementations.

Eric

#4 lore raw
Quoted 2 lines

Well it is a bug worth fixing. Who knows it may have something to do with the disable_irq problems the forcedeth driver was seeing.

I agree completely, the fix looks obvious and there's no point in leaving the bug there. I just don't have a test case that I can point to as being fixed by this, since I don't have a working 32-bit MSI device...

Do you know whether the forcedeth devices have a 32-bit MSI address?

- R.

#5 lore raw
Quoted 9 lines · Roland Dreier
Quoted 2 lines

Well it is a bug worth fixing. Who knows it may have something to do with the disable_irq problems the forcedeth driver was seeing.

I agree completely, the fix looks obvious and there's no point in leaving the bug there. I just don't have a test case that I can point to as being fixed by this, since I don't have a working 32-bit MSI device...

Do you know whether the forcedeth devices have a 32-bit MSI address?

Sorry I don't. The ones I have don't have an MSI capability.

Eric