linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/MSI: Clean up unnecessary override function
@ 2014-06-24  8:30 Yijing Wang
  2014-06-24 13:21 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 3+ messages in thread
From: Yijing Wang @ 2014-06-24  8:30 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, Thomas Gleixner, H. Peter Anvin, x86,
	Konrad Rzeszutek Wilk, Wuyun, Yijing Wang

MSI driver provides several weak functions allow
platform to override. These override functions
arch_msi/x_mask_irq(), arch_restore_msi_irqs(),
arch_teardown_msi_irqs() in x86 don't provide
platform specific function, still call the
default functions. So cleanup these override
functions.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/x86/kernel/x86_init.c |   22 ----------------------
 1 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index e48b674..00529fa 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -113,11 +113,7 @@ struct x86_msi_ops x86_msi = {
 	.setup_msi_irqs		= native_setup_msi_irqs,
 	.compose_msi_msg	= native_compose_msi_msg,
 	.teardown_msi_irq	= native_teardown_msi_irq,
-	.teardown_msi_irqs	= default_teardown_msi_irqs,
-	.restore_msi_irqs	= default_restore_msi_irqs,
 	.setup_hpet_msi		= default_setup_hpet_msi,
-	.msi_mask_irq		= default_msi_mask_irq,
-	.msix_mask_irq		= default_msix_mask_irq,
 };
 
 /* MSI arch specific hooks */
@@ -126,28 +122,10 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 	return x86_msi.setup_msi_irqs(dev, nvec, type);
 }
 
-void arch_teardown_msi_irqs(struct pci_dev *dev)
-{
-	x86_msi.teardown_msi_irqs(dev);
-}
-
 void arch_teardown_msi_irq(unsigned int irq)
 {
 	x86_msi.teardown_msi_irq(irq);
 }
-
-void arch_restore_msi_irqs(struct pci_dev *dev)
-{
-	x86_msi.restore_msi_irqs(dev);
-}
-u32 arch_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
-{
-	return x86_msi.msi_mask_irq(desc, mask, flag);
-}
-u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag)
-{
-	return x86_msi.msix_mask_irq(desc, flag);
-}
 #endif
 
 struct x86_io_apic_ops x86_io_apic_ops = {
-- 
1.7.1



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

* Re: [PATCH] x86/MSI: Clean up unnecessary override function
  2014-06-24  8:30 [PATCH] x86/MSI: Clean up unnecessary override function Yijing Wang
@ 2014-06-24 13:21 ` Konrad Rzeszutek Wilk
  2014-06-25  1:12   ` Yijing Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-06-24 13:21 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, linux-pci, Thomas Gleixner, H. Peter Anvin, x86,
	Wuyun

On Tue, Jun 24, 2014 at 04:30:45PM +0800, Yijing Wang wrote:
> MSI driver provides several weak functions allow
> platform to override. These override functions
> arch_msi/x_mask_irq(), arch_restore_msi_irqs(),
> arch_teardown_msi_irqs() in x86 don't provide
> platform specific function, still call the
> default functions. So cleanup these override
> functions.

They do. Please in the future use 'git annotate' to
figure out which commits added them in and see if
those are still in use.

P.S.
Look in arch/x86/pci/xen.c
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
>  arch/x86/kernel/x86_init.c |   22 ----------------------
>  1 files changed, 0 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
> index e48b674..00529fa 100644
> --- a/arch/x86/kernel/x86_init.c
> +++ b/arch/x86/kernel/x86_init.c
> @@ -113,11 +113,7 @@ struct x86_msi_ops x86_msi = {
>  	.setup_msi_irqs		= native_setup_msi_irqs,
>  	.compose_msi_msg	= native_compose_msi_msg,
>  	.teardown_msi_irq	= native_teardown_msi_irq,
> -	.teardown_msi_irqs	= default_teardown_msi_irqs,
> -	.restore_msi_irqs	= default_restore_msi_irqs,
>  	.setup_hpet_msi		= default_setup_hpet_msi,
> -	.msi_mask_irq		= default_msi_mask_irq,
> -	.msix_mask_irq		= default_msix_mask_irq,
>  };
>  
>  /* MSI arch specific hooks */
> @@ -126,28 +122,10 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>  	return x86_msi.setup_msi_irqs(dev, nvec, type);
>  }
>  
> -void arch_teardown_msi_irqs(struct pci_dev *dev)
> -{
> -	x86_msi.teardown_msi_irqs(dev);
> -}
> -
>  void arch_teardown_msi_irq(unsigned int irq)
>  {
>  	x86_msi.teardown_msi_irq(irq);
>  }
> -
> -void arch_restore_msi_irqs(struct pci_dev *dev)
> -{
> -	x86_msi.restore_msi_irqs(dev);
> -}
> -u32 arch_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
> -{
> -	return x86_msi.msi_mask_irq(desc, mask, flag);
> -}
> -u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag)
> -{
> -	return x86_msi.msix_mask_irq(desc, flag);
> -}
>  #endif
>  
>  struct x86_io_apic_ops x86_io_apic_ops = {
> -- 
> 1.7.1
> 
> 

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

* Re: [PATCH] x86/MSI: Clean up unnecessary override function
  2014-06-24 13:21 ` Konrad Rzeszutek Wilk
@ 2014-06-25  1:12   ` Yijing Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Yijing Wang @ 2014-06-25  1:12 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Bjorn Helgaas, linux-pci, Thomas Gleixner, H. Peter Anvin, x86,
	Wuyun

> They do. Please in the future use 'git annotate' to
> figure out which commits added them in and see if
> those are still in use.

Hi Konrad,
   Thanks for your detailed explanation, I see what your mean,
you are right, x86_msi will be replaced in x86/xen running.
This is the point I missing.

Bjorn, please drop this patch.

Thanks!
Yijing.

> 
> P.S.
> Look in arch/x86/pci/xen.c
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> ---
>>  arch/x86/kernel/x86_init.c |   22 ----------------------
>>  1 files changed, 0 insertions(+), 22 deletions(-)
>>
>> diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
>> index e48b674..00529fa 100644
>> --- a/arch/x86/kernel/x86_init.c
>> +++ b/arch/x86/kernel/x86_init.c
>> @@ -113,11 +113,7 @@ struct x86_msi_ops x86_msi = {
>>  	.setup_msi_irqs		= native_setup_msi_irqs,
>>  	.compose_msi_msg	= native_compose_msi_msg,
>>  	.teardown_msi_irq	= native_teardown_msi_irq,
>> -	.teardown_msi_irqs	= default_teardown_msi_irqs,
>> -	.restore_msi_irqs	= default_restore_msi_irqs,
>>  	.setup_hpet_msi		= default_setup_hpet_msi,
>> -	.msi_mask_irq		= default_msi_mask_irq,
>> -	.msix_mask_irq		= default_msix_mask_irq,
>>  };
>>  
>>  /* MSI arch specific hooks */
>> @@ -126,28 +122,10 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>>  	return x86_msi.setup_msi_irqs(dev, nvec, type);
>>  }
>>  
>> -void arch_teardown_msi_irqs(struct pci_dev *dev)
>> -{
>> -	x86_msi.teardown_msi_irqs(dev);
>> -}
>> -
>>  void arch_teardown_msi_irq(unsigned int irq)
>>  {
>>  	x86_msi.teardown_msi_irq(irq);
>>  }
>> -
>> -void arch_restore_msi_irqs(struct pci_dev *dev)
>> -{
>> -	x86_msi.restore_msi_irqs(dev);
>> -}
>> -u32 arch_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
>> -{
>> -	return x86_msi.msi_mask_irq(desc, mask, flag);
>> -}
>> -u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag)
>> -{
>> -	return x86_msi.msix_mask_irq(desc, flag);
>> -}
>>  #endif
>>  
>>  struct x86_io_apic_ops x86_io_apic_ops = {
>> -- 
>> 1.7.1
>>
>>
> 
> .
> 


-- 
Thanks!
Yijing


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

end of thread, other threads:[~2014-06-25  1:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24  8:30 [PATCH] x86/MSI: Clean up unnecessary override function Yijing Wang
2014-06-24 13:21 ` Konrad Rzeszutek Wilk
2014-06-25  1:12   ` 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).