From: Yijing Wang <wangyijing@huawei.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>,
Gerald Schaefer <gerald.schaefer@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
linux-s390@vger.kernel.org, linux-pci@vger.kernel.org,
Wuyun <wuyun.wu@huawei.com>, Xinwei Hu <huxinwei@huawei.com>
Subject: Re: [PATCH 5/5] s390/MSI: Fix msi mask issue
Date: Fri, 4 Jul 2014 09:53:37 +0800 [thread overview]
Message-ID: <53B60921.7090501@huawei.com> (raw)
In-Reply-To: <20140703235706.GC25980@google.com>
>> @@ -263,7 +263,7 @@ static int zpci_msi_set_mask_bits(struct msi_desc *msi, u32 mask, u32 flag)
>> } else
>> return 0;
>>
>> - msi->msi_attrib.maskbit = !!flag;
>> + msi->masked = !!flag;
>
> This doesn't look right. For MSI-X, you just overwrote the previous update
> of msi->masked:
>
> if (msi->msi_attrib.is_msix) {
> ...
> msi->masked = readl(msi->mask_base + offset);
>
> Maybe the update values end up being the same, but why do it twice?
Hi Bjorn, this code is some difficult to understand. I guess it's for save
MSI mask status, for MSI-X, do this twice, maybe this line should move up int to
MSI if ()...
Because I don't have the platform to test, so I do not want to change the code logic,
what I am sure is save the flag status in msi->msi_attrib.maskbit is wrong.
So I change this like:
msi->masked = !!flag;
Sebastian may know why do it like this.
Besides, I think we can use MSI code driver interface mask_msi_irq() and unmask_msi_irq()
to replace zpci_enable_irq() and zpci_disable_irq().
>
> Also, the MSI mask bits are 32-bit field that can individually mask any
> subset of the 32 possible MSI vectors, and you collapsed this down to a
> single bit, so msi->masked no longer contains that information.
>
> Maybe none of this matters because all the zpci_msi_set_mask_bits() uses
> seem to be for a single bit, but the name says "mask_*bits*" and the
> msi->masked field is generic and covers multiple MSI vectors in general.
Yes, it always uses single bit here, as you said, this code has some problems for
multiple MSI, although it may does not use it.
I will try to send a new patch fix the original problem.
Thanks!
Yijing.
>
>> return 1;
>> }
>>
>> --
>> 1.7.1
>>
>>
>
> .
>
--
Thanks!
Yijing
prev parent reply other threads:[~2014-07-04 1:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-19 8:31 [PATCH 5/5] s390/MSI: Fix msi mask issue Yijing Wang
2014-06-23 10:47 ` Sebastian Ott
2014-07-03 23:57 ` Bjorn Helgaas
2014-07-04 1:53 ` Yijing Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53B60921.7090501@huawei.com \
--to=wangyijing@huawei.com \
--cc=bhelgaas@google.com \
--cc=gerald.schaefer@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=huxinwei@huawei.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=sebott@linux.vnet.ibm.com \
--cc=wuyun.wu@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox