[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dd1c34c5-e2c0-25fc-b668-a5bbb7869397@intel.com>
Date: Thu, 1 Oct 2020 15:59:24 -0700
From: "Dey, Megha" <megha.dey@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Dave Jiang <dave.jiang@...el.com>, vkoul@...nel.org,
maz@...nel.org, bhelgaas@...gle.com, alex.williamson@...hat.com,
jacob.jun.pan@...el.com, ashok.raj@...el.com, jgg@...lanox.com,
yi.l.liu@...el.com, baolu.lu@...el.com, kevin.tian@...el.com,
sanjay.k.kumar@...el.com, tony.luck@...el.com, jing.lin@...el.com,
dan.j.williams@...el.com, kwankhede@...dia.com,
eric.auger@...hat.com, parav@...lanox.com, rafael@...nel.org,
netanelg@...lanox.com, shahafs@...lanox.com,
yan.y.zhao@...ux.intel.com, pbonzini@...hat.com,
samuel.ortiz@...el.com, mona.hossain@...el.com
Cc: dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
x86@...nel.org, linux-pci@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [PATCH v3 01/18] irqchip: Add IMS (Interrupt Message Storage)
driver
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@...utronix.de>
>> +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
Powered by blists - more mailing lists