Re: [PATCH v3 01/18] irqchip: Add IMS (Interrupt Message Storage) driver

From: Dey, Megha
Date: Thu Oct 01 2020 - 19:00:05 EST


Hi Thomas,

On 9/30/2020 11:23 AM, Thomas Gleixner wrote:
On Tue, Sep 15 2020 at 16:27, Dave Jiang wrote:
From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
+config IMS_MSI_ARRAY
+ bool "IMS Interrupt Message Storm MSI controller for device memory storage arrays"
Hehe, you missed a Message Storm :)
i will change this in the next version
+ depends on PCI
+ select IMS_MSI
+ select GENERIC_MSI_IRQ_DOMAIN
+ help
+ Support for IMS Interrupt Message Storm MSI controller
and another one.
ok :)

+ with IMS slot storage in a slot array in device memory
+
+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 */
Bah, I fundamentaly hate tail comments. They are a distraction and
disturb the reading flow. Put it above the ioread32() please.
Will do.

+static void ims_array_unmask_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);
Why is this one not flushed?
I will add it.

+}
+
+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);
Yuck? slot points to the struct and just because ioread32() accepts a
void pointer does not make it any more readable.
hmm ok , will change this.

+static void ims_array_reset_slot(struct ims_slot __iomem *slot)
+{
+ iowrite32(0, &slot->address_lo);
+ iowrite32(0, &slot->address_hi);
+ iowrite32(0, &slot->data);
+ iowrite32(0, &slot->ctrl);
Flush?

ok!

-Megha


Thanks,

tglx