diff mbox

[v3,33/36] genirq: Use helper function to access irq_data->msi_desc

Message ID 1433145945-789-34-git-send-email-jiang.liu@linux.intel.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Jiang Liu June 1, 2015, 8:05 a.m. UTC
Use irq_data access helper to access irq_data->msi_desc, so we could
move msi_desc from struct irq_data into struct irq_common_data later.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
 arch/ia64/kernel/msi_ia64.c         |    2 +-
 arch/ia64/sn/kernel/msi_sn.c        |    2 +-
 arch/powerpc/sysdev/xics/ics-opal.c |    2 +-
 arch/powerpc/sysdev/xics/ics-rtas.c |    2 +-
 arch/tile/kernel/pci_gx.c           |    2 +-
 drivers/pci/msi.c                   |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

Comments

Michael Ellerman June 2, 2015, 3:45 a.m. UTC | #1
On Mon, 2015-01-06 at 08:05:42 UTC, Jiang Liu wrote:
> Use irq_data access helper to access irq_data->msi_desc, so we could
> move msi_desc from struct irq_data into struct irq_common_data later.
> 
> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
> ---
>  arch/powerpc/sysdev/xics/ics-opal.c |    2 +-
>  arch/powerpc/sysdev/xics/ics-rtas.c |    2 +-
> 
> diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c
> index 3996393c254d..27c936c080a6 100644
> --- a/arch/powerpc/sysdev/xics/ics-opal.c
> +++ b/arch/powerpc/sysdev/xics/ics-opal.c
> @@ -72,7 +72,7 @@ static unsigned int ics_opal_startup(struct irq_data *d)
>  	 * card, using the MSI mask bits. Firmware doesn't appear to unmask
>  	 * at that level, so we do it here by hand.
>  	 */
> -	if (d->msi_desc)
> +	if (irq_data_get_msi_desc(d))
>  		pci_msi_unmask_irq(d);
>  #endif
>  
> diff --git a/arch/powerpc/sysdev/xics/ics-rtas.c b/arch/powerpc/sysdev/xics/ics-rtas.c
> index e2665a9dfc0f..3854dd41558d 100644
> --- a/arch/powerpc/sysdev/xics/ics-rtas.c
> +++ b/arch/powerpc/sysdev/xics/ics-rtas.c
> @@ -75,7 +75,7 @@ static unsigned int ics_rtas_startup(struct irq_data *d)
>  	 * card, using the MSI mask bits. Firmware doesn't appear to unmask
>  	 * at that level, so we do it here by hand.
>  	 */
> -	if (d->msi_desc)
> +	if (irq_data_get_msi_desc(d))
>  		pci_msi_unmask_irq(d);
>  #endif
>  	/* unmask it */

These look OK.

Though I would point out we already have 16 irq_foo_get_bar() accessors?!

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiang Liu June 2, 2015, 5:46 a.m. UTC | #2
On 2015/6/2 11:45, Michael Ellerman wrote:
> On Mon, 2015-01-06 at 08:05:42 UTC, Jiang Liu wrote:
>> Use irq_data access helper to access irq_data->msi_desc, so we could
>> move msi_desc from struct irq_data into struct irq_common_data later.
>>
>> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
>> ---
>>  arch/powerpc/sysdev/xics/ics-opal.c |    2 +-
>>  arch/powerpc/sysdev/xics/ics-rtas.c |    2 +-
>>
>> diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c
>> index 3996393c254d..27c936c080a6 100644
>> --- a/arch/powerpc/sysdev/xics/ics-opal.c
>> +++ b/arch/powerpc/sysdev/xics/ics-opal.c
>> @@ -72,7 +72,7 @@ static unsigned int ics_opal_startup(struct irq_data *d)
>>  	 * card, using the MSI mask bits. Firmware doesn't appear to unmask
>>  	 * at that level, so we do it here by hand.
>>  	 */
>> -	if (d->msi_desc)
>> +	if (irq_data_get_msi_desc(d))
>>  		pci_msi_unmask_irq(d);
>>  #endif
>>  
>> diff --git a/arch/powerpc/sysdev/xics/ics-rtas.c b/arch/powerpc/sysdev/xics/ics-rtas.c
>> index e2665a9dfc0f..3854dd41558d 100644
>> --- a/arch/powerpc/sysdev/xics/ics-rtas.c
>> +++ b/arch/powerpc/sysdev/xics/ics-rtas.c
>> @@ -75,7 +75,7 @@ static unsigned int ics_rtas_startup(struct irq_data *d)
>>  	 * card, using the MSI mask bits. Firmware doesn't appear to unmask
>>  	 * at that level, so we do it here by hand.
>>  	 */
>> -	if (d->msi_desc)
>> +	if (irq_data_get_msi_desc(d))
>>  		pci_msi_unmask_irq(d);
>>  #endif
>>  	/* unmask it */
> 
> These look OK.
> 
> Though I would point out we already have 16 irq_foo_get_bar() accessors?!
Hi Michael,
	Thanks for review. We are trying to solve some issues introduced
by hierarchy irqdomain/irqchip by splitting irq_data into a common part
(irq_common_data) and per-chip part(irq_data). These accessors are used
to ease the transition and hide implementation details.
Thanks!
Gerry

> 
> Acked-by: Michael Ellerman <mpe@ellerman.id.au>
> 
> cheers
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Gleixner June 3, 2015, 4:53 p.m. UTC | #3
On Tue, 2 Jun 2015, Michael Ellerman wrote:
> Though I would point out we already have 16 irq_foo_get_bar() accessors?!

Say thanks to the people who mindlessly fiddled in the core managed
fields of irqdesc and irqdata. The hard to track down wreckage they
caused me to enforce accessors.

The new accessors are to help migrating members of irq_data to a new
data structure without breaking the world and some more.

Thanks,

	tglx


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c
index 6c50d332b7d7..af4eaec0f7c3 100644
--- a/arch/ia64/kernel/msi_ia64.c
+++ b/arch/ia64/kernel/msi_ia64.c
@@ -23,7 +23,7 @@  static int ia64_set_msi_irq_affinity(struct irq_data *idata,
 	if (irq_prepare_move(irq, cpu))
 		return -1;
 
-	__get_cached_msi_msg(idata->msi_desc, &msg);
+	__get_cached_msi_msg(irq_data_get_msi_desc(idata), &msg);
 
 	addr = msg.address_lo;
 	addr &= MSI_ADDR_DEST_ID_MASK;
diff --git a/arch/ia64/sn/kernel/msi_sn.c b/arch/ia64/sn/kernel/msi_sn.c
index 42b5a13af142..fb25065b22c6 100644
--- a/arch/ia64/sn/kernel/msi_sn.c
+++ b/arch/ia64/sn/kernel/msi_sn.c
@@ -175,7 +175,7 @@  static int sn_set_msi_irq_affinity(struct irq_data *data,
 	 * Release XIO resources for the old MSI PCI address
 	 */
 
-	__get_cached_msi_msg(data->msi_desc, &msg);
+	__get_cached_msi_msg(irq_data_get_msi_desc(data), &msg);
 	sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo;
 	pdev = sn_pdev->pdi_linux_pcidev;
 	provider = SN_PCIDEV_BUSPROVIDER(pdev);
diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c
index 3996393c254d..27c936c080a6 100644
--- a/arch/powerpc/sysdev/xics/ics-opal.c
+++ b/arch/powerpc/sysdev/xics/ics-opal.c
@@ -72,7 +72,7 @@  static unsigned int ics_opal_startup(struct irq_data *d)
 	 * card, using the MSI mask bits. Firmware doesn't appear to unmask
 	 * at that level, so we do it here by hand.
 	 */
-	if (d->msi_desc)
+	if (irq_data_get_msi_desc(d))
 		pci_msi_unmask_irq(d);
 #endif
 
diff --git a/arch/powerpc/sysdev/xics/ics-rtas.c b/arch/powerpc/sysdev/xics/ics-rtas.c
index e2665a9dfc0f..3854dd41558d 100644
--- a/arch/powerpc/sysdev/xics/ics-rtas.c
+++ b/arch/powerpc/sysdev/xics/ics-rtas.c
@@ -75,7 +75,7 @@  static unsigned int ics_rtas_startup(struct irq_data *d)
 	 * card, using the MSI mask bits. Firmware doesn't appear to unmask
 	 * at that level, so we do it here by hand.
 	 */
-	if (d->msi_desc)
+	if (irq_data_get_msi_desc(d))
 		pci_msi_unmask_irq(d);
 #endif
 	/* unmask it */
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c
index b1df847d0686..65b701b3b5ed 100644
--- a/arch/tile/kernel/pci_gx.c
+++ b/arch/tile/kernel/pci_gx.c
@@ -1442,7 +1442,7 @@  static struct pci_ops tile_cfg_ops = {
 /* MSI support starts here. */
 static unsigned int tilegx_msi_startup(struct irq_data *d)
 {
-	if (d->msi_desc)
+	if (irq_data_get_msi_desc(d))
 		pci_msi_unmask_irq(d);
 
 	return 0;
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index be6034cf5c21..c2f0da733d3a 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1178,7 +1178,7 @@  EXPORT_SYMBOL(pci_enable_msix_range);
  */
 void pci_msi_domain_write_msg(struct irq_data *irq_data, struct msi_msg *msg)
 {
-	struct msi_desc *desc = irq_data->msi_desc;
+	struct msi_desc *desc = irq_data_get_msi_desc(irq_data);
 
 	/*
 	 * For MSI-X desc->irq is always equal to irq_data->irq. For