Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1223799

Re: [PATCH] platform-msi: Do not cache msi_desc in handler_data

From Jiang Liu <jiang.liu@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] platform-msi: Do not cache msi_desc in handler_data
Date 2015-09-14 04:30 +0200
Message-ID <q8rGN-16f-1@gated-at.bofh.it> (permalink)
References <q8eJC-7J8-59@gated-at.bofh.it>
Organization Intel

Show all headers | View raw


On 2015/9/13 20:37, Marc Zyngier wrote:
> The current implementation of platform MSI caches the msi_desc
> pointer in irq_data::handler_data. This is a bit silly, as
> we also have irq_data::msi_desc, which is perfectly valid.
> 
> Remove the useless assignment and simplify the whole flow.
> 
> Reported-by: Ma Jun <majun258@huawei.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Jiang Liu <jiang.liu@linux.intel.com>



> ---
>  drivers/base/platform-msi.c | 18 +++---------------
>  1 file changed, 3 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c
> index 1857a5d..134483d 100644
> --- a/drivers/base/platform-msi.c
> +++ b/drivers/base/platform-msi.c
> @@ -63,20 +63,8 @@ static int platform_msi_init(struct irq_domain *domain,
>  			     unsigned int virq, irq_hw_number_t hwirq,
>  			     msi_alloc_info_t *arg)
>  {
> -	struct irq_data *data;
> -
> -	irq_domain_set_hwirq_and_chip(domain, virq, hwirq,
> -				      info->chip, info->chip_data);
> -
> -	/*
> -	 * Save the MSI descriptor in handler_data so that the
> -	 * irq_write_msi_msg callback can retrieve it (and the
> -	 * associated device).
> -	 */
> -	data = irq_domain_get_irq_data(domain, virq);
> -	data->handler_data = arg->desc;
> -
> -	return 0;
> +	return irq_domain_set_hwirq_and_chip(domain, virq, hwirq,
> +					     info->chip, info->chip_data);
>  }
>  #else
>  #define platform_msi_set_desc		NULL
> @@ -97,7 +85,7 @@ static void platform_msi_update_dom_ops(struct msi_domain_info *info)
>  
>  static void platform_msi_write_msg(struct irq_data *data, struct msi_msg *msg)
>  {
> -	struct msi_desc *desc = irq_data_get_irq_handler_data(data);
> +	struct msi_desc *desc = irq_data_get_msi_desc(data);
>  	struct platform_msi_priv_data *priv_data;
>  
>  	priv_data = desc->platform.msi_priv_data;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] platform-msi: Do not cache msi_desc in handler_data Marc Zyngier <marc.zyngier@arm.com> - 2015-09-13 14:40 +0200
  Re: [PATCH] platform-msi: Do not cache msi_desc in handler_data Jiang Liu <jiang.liu@linux.intel.com> - 2015-09-14 04:30 +0200
  [tip:irq/urgent] platform-msi:   Do not cache msi_desc in handler_data tip-bot for Marc Zyngier <tipbot@zytor.com> - 2015-09-15 17:50 +0200

csiph-web