[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.22.394.2209071433320.3336870@rhweight-WRK1>
Date: Wed, 7 Sep 2022 14:37:32 -0700 (PDT)
From: matthew.gerlach@...ux.intel.com
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
cc: hao.wu@...el.com, yilun.xu@...el.com, russell.h.weight@...el.com,
basheer.ahmed.muddebihal@...el.com, trix@...hat.com,
mdf@...nel.org, linux-fpga@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
tianfei.zhang@...el.com, corbet@....net,
gregkh@...uxfoundation.org, linux-serial@...r.kernel.org,
jirislaby@...nel.org, geert+renesas@...der.be,
niklas.soderlund+renesas@...natech.se, phil.edworthy@...esas.com,
macro@...am.me.uk, johan@...nel.org, lukas@...ner.de
Subject: Re: [PATCH v1 4/5] fpga: dfl: add generic support for MSIX
interrupts
On Tue, 6 Sep 2022, Andy Shevchenko wrote:
> On Tue, Sep 06, 2022 at 12:04:25PM -0700, matthew.gerlach@...ux.intel.com wrote:
>> From: Matthew Gerlach <matthew.gerlach@...ux.intel.com>
>>
>> Define and use a DFHv1 parameter to add generic support for MSIX
>> interrupts for DFL devices.
>
> ...
>
>> + if (fid != FEATURE_ID_AFU && fid != PORT_FEATURE_ID_ERROR &&
>> + fid != PORT_FEATURE_ID_UINT && fid != FME_FEATURE_ID_GLOBAL_ERR) {
>> + v = readq(base);
>> + v = FIELD_GET(DFH_VERSION, v);
>> +
>> + if (v == 1) {
>> + v = readq(base + DFHv1_CSR_SIZE_GRP);
>
> I am already lost what v keeps...
>
> Perhaps
>
> v = readq(base);
> switch (FIELD_GET(DFH_VERSION, v)) {
> case 1:
> ...
> break;
> }
How about?
if (FIELD_GET(DFH_VERSION, readq(base)) == 1) {
...
}
>
>> + if (FIELD_GET(DFHv1_CSR_SIZE_GRP_HAS_PARAMS, v)) {
>
> void __iomem *v1hdr = base + DFHv1_PARAM_HDR;
>
>> + off = dfl_find_param(base + DFHv1_PARAM_HDR, ofst,
>> + DFHv1_PARAM_ID_MSIX);
>
> off = dfl_find_param(v1hdr, ofst, DFHv1_PARAM_ID_MSIX);
>
>> + if (off >= 0) {
>> + ibase = readl(base + DFHv1_PARAM_HDR +
>> + off + DFHv1_PARAM_MSIX_STARTV);
>> + inr = readl(base + DFHv1_PARAM_HDR +
>> + off + DFHv1_PARAM_MSIX_NUMV);
>
> ibase = readl(v1hdr + off + DFHv1_PARAM_MSIX_STARTV);
> inr = readl(v1hdr + off + DFHv1_PARAM_MSIX_NUMV);
>
>> + dev_dbg(binfo->dev, "%s start %d num %d fid 0x%x\n",
>> + __func__, ibase, inr, fid);
>
> No __func__ for dev_dbg(). Dynamic debug has this feature at runtime!
>
>> + }
>> + }
>> + }
>> + }
>
> ...
>
>> +/*
>
> If it's a kernel doc, make it to be parsable as a such.
Yes, the intention is kernel doc. Thanks for the feedback. I
will fix this and add the newline as suggested below.
Matthew Gerlach
>
>> + * dfl_find_param() - find the offset of the given parameter
>> + * @base: base pointer to start of dfl parameters in DFH
>> + * @max: maximum offset to search
>> + * @param: id of dfl parameter
>> + *
>> + * Return: positive offset on success, negative error code otherwise.
>> + */
>> +int dfl_find_param(void __iomem *base, resource_size_t max, int param);
>
> + blank line.
>
>> #endif /* __LINUX_DFL_H */
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
>
Powered by blists - more mailing lists