On Tue, Sep 15 2020 at 16:27, Dave Jiang wrote:i will change this in the next version
From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>Hehe, you missed a Message Storm :)
+config IMS_MSI_ARRAY
+ bool "IMS Interrupt Message Storm MSI controller for device memory storage arrays"
ok :)+ depends on PCIand another one.
+ select IMS_MSI
+ select GENERIC_MSI_IRQ_DOMAIN
+ help
+ Support for IMS Interrupt Message Storm MSI controller
Will do.
+ with IMS slot storage in a slot array in device memoryBah, I fundamentaly hate tail comments. They are a distraction and
+
+static void ims_array_mask_irq(struct irq_data *data)
+{
+ struct msi_desc *desc = irq_data_get_msi_desc(data);
+ struct ims_slot __iomem *slot = desc->device_msi.priv_iomem;
+ u32 __iomem *ctrl = &slot->ctrl;
+
+ iowrite32(ioread32(ctrl) | IMS_VECTOR_CTRL_MASK, ctrl);
+ ioread32(ctrl); /* Flush write to device */
disturb the reading flow. Put it above the ioread32() please.
I will add it.
+static void ims_array_unmask_irq(struct irq_data *data)Why is this one not flushed?
+{
+ struct msi_desc *desc = irq_data_get_msi_desc(data);
+ struct ims_slot __iomem *slot = desc->device_msi.priv_iomem;
+ u32 __iomem *ctrl = &slot->ctrl;
+
+ iowrite32(ioread32(ctrl) & ~IMS_VECTOR_CTRL_MASK, ctrl);
hmm ok , will change this.
+}Yuck? slot points to the struct and just because ioread32() accepts a
+
+static void ims_array_write_msi_msg(struct irq_data *data, struct msi_msg *msg)
+{
+ struct msi_desc *desc = irq_data_get_msi_desc(data);
+ struct ims_slot __iomem *slot = desc->device_msi.priv_iomem;
+
+ iowrite32(msg->address_lo, &slot->address_lo);
+ iowrite32(msg->address_hi, &slot->address_hi);
+ iowrite32(msg->data, &slot->data);
+ ioread32(slot);
void pointer does not make it any more readable.
+static void ims_array_reset_slot(struct ims_slot __iomem *slot)Flush?
+{
+ iowrite32(0, &slot->address_lo);
+ iowrite32(0, &slot->address_hi);
+ iowrite32(0, &slot->data);
+ iowrite32(0, &slot->ctrl);
Thanks,
tglx