Re: [RFC PATCH 1/2] pci: add function reset call that can be used inside of probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(2010/08/11 8:14), Alexander Duyck wrote:
Kenji Kaneshige wrote:
(2010/07/31 9:58), Jeff Kirsher wrote:
From: Alexander Duyck<alexander.h.duyck@xxxxxxxxx>
+ /*
+ * both INTx and MSI are disabled after the Interrupt Disable bit
+ * is set and the Bus Master bit is cleared.
+ */
+ pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE);
+
+ rc = __pci_dev_reset(dev, 0);

Could you tell me why you need to program command register before reset?

"MSI enable" and "Bus Master" bits are cleared by the reset. Furthermore,
resetting the device clears the "Interrupt Disable bit", even though it
was set just before the rest. So I'm a little confused.

Thanks,
Kenji Kaneshige


The point is to prevent any pending transactions from being on the bus
while we are doing the reset. By writing only the INTX disable bit we
are disabling all interrupts from being generated, and also disabling
all DMA and MSI interrupts since the bus master enable bit is not set.

Without this change the device might be in the middle of a transaction
or sending an interrupt while we are doing the reset which may lead to
other issues after the reset.


Thank you for clarification. I understood.

Thanks,
Kenji Kaneshige


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux