linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] xen/MSI: Retrieve MSI msg from cached msi_desc->msg
@ 2014-08-15  3:14 Yijing Wang
  2014-08-15  3:51 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 3+ messages in thread
From: Yijing Wang @ 2014-08-15  3:14 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, Yijing Wang, Konrad Rzeszutek Wilk, xen-devel

We had cached the MSI msg in __write_msi_msg(),
so we should retrieve the cached MSI msg directly,
not to access the MSI address/data hardware registers
again.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: xen-devel@lists.xenproject.org
---
 arch/x86/pci/xen.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index 4656099..7a74404 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -228,7 +228,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 		return 1;
 
 	list_for_each_entry(msidesc, &dev->msi_list, list) {
-		read_msi_msg(msidesc, &msg);
+		get_cached_msi_msg(msidesc, &msg);
 		pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) |
 			((msg.address_lo >> MSI_ADDR_DEST_ID_SHIFT) & 0xff);
 		if (msg.data != XEN_PIRQ_MSI_DATA ||
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] xen/MSI: Retrieve MSI msg from cached msi_desc->msg
  2014-08-15  3:14 [PATCH 3/3] xen/MSI: Retrieve MSI msg from cached msi_desc->msg Yijing Wang
@ 2014-08-15  3:51 ` Konrad Rzeszutek Wilk
  2014-08-15  5:43   ` Yijing Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-08-15  3:51 UTC (permalink / raw)
  To: Yijing Wang; +Cc: Bjorn Helgaas, linux-pci, xen-devel

On Fri, Aug 15, 2014 at 11:14:37AM +0800, Yijing Wang wrote:
> We had cached the MSI msg in __write_msi_msg(),
> so we should retrieve the cached MSI msg directly,
> not to access the MSI address/data hardware registers
> again.

Is this fixing a particular problem?

Could you kindly explain to me when you do the __write_msi_msg
before doing an read_msi_msg? The order of operation in this
function is read, and then write.

> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> CC: xen-devel@lists.xenproject.org
> ---
>  arch/x86/pci/xen.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
> index 4656099..7a74404 100644
> --- a/arch/x86/pci/xen.c
> +++ b/arch/x86/pci/xen.c
> @@ -228,7 +228,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>  		return 1;
>  
>  	list_for_each_entry(msidesc, &dev->msi_list, list) {
> -		read_msi_msg(msidesc, &msg);
> +		get_cached_msi_msg(msidesc, &msg);
>  		pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) |
>  			((msg.address_lo >> MSI_ADDR_DEST_ID_SHIFT) & 0xff);
>  		if (msg.data != XEN_PIRQ_MSI_DATA ||
> -- 
> 1.7.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] xen/MSI: Retrieve MSI msg from cached msi_desc->msg
  2014-08-15  3:51 ` Konrad Rzeszutek Wilk
@ 2014-08-15  5:43   ` Yijing Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Yijing Wang @ 2014-08-15  5:43 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Bjorn Helgaas, linux-pci, xen-devel

On 2014/8/15 11:51, Konrad Rzeszutek Wilk wrote:
> On Fri, Aug 15, 2014 at 11:14:37AM +0800, Yijing Wang wrote:
>> We had cached the MSI msg in __write_msi_msg(),
>> so we should retrieve the cached MSI msg directly,
>> not to access the MSI address/data hardware registers
>> again.
> 
> Is this fixing a particular problem?
> 
> Could you kindly explain to me when you do the __write_msi_msg
> before doing an read_msi_msg? The order of operation in this
> function is read, and then write.

Hi Konrad,
   Thanks for your review and comments. It looks like I made a mistake.
Before I thought xen_hvm_setup_msi_irqs() here worked like restore MSI irq,
but it seems not in real. Since every time we call the setup MSI irq function,
the msi_desc always new allocated, so here should use read_msi_msg(),
I'm sorry for my mistake. :(

Bjorn, please drop this one.

Thanks!
Yijing.

> 
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> CC: xen-devel@lists.xenproject.org
>> ---
>>  arch/x86/pci/xen.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
>> index 4656099..7a74404 100644
>> --- a/arch/x86/pci/xen.c
>> +++ b/arch/x86/pci/xen.c
>> @@ -228,7 +228,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>>  		return 1;
>>  
>>  	list_for_each_entry(msidesc, &dev->msi_list, list) {
>> -		read_msi_msg(msidesc, &msg);
>> +		get_cached_msi_msg(msidesc, &msg);
>>  		pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) |
>>  			((msg.address_lo >> MSI_ADDR_DEST_ID_SHIFT) & 0xff);
>>  		if (msg.data != XEN_PIRQ_MSI_DATA ||
>> -- 
>> 1.7.1
>>
> 
> 


-- 
Thanks!
Yijing


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-15  5:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15  3:14 [PATCH 3/3] xen/MSI: Retrieve MSI msg from cached msi_desc->msg Yijing Wang
2014-08-15  3:51 ` Konrad Rzeszutek Wilk
2014-08-15  5:43   ` Yijing Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).