public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Inochi Amaoto <inochiama@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Chen Wang <unicorn_wang@outlook.com>,
	Inochi Amaoto <inochiama@gmail.com>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	sophgo@lists.linux.dev, Yixun Lan <dlan@gentoo.org>,
	Longbin Li <looong.bin@gmail.com>
Subject: Re: [PATCH 2/2] irqchip/sg2042-msi: Add the Sophgo SG2044 MSI interrupt controller
Date: Mon, 03 Mar 2025 20:31:32 +0100	[thread overview]
Message-ID: <87y0xlc3mz.ffs@tglx> (raw)
In-Reply-To: <20250303111648.1337543-3-inochiama@gmail.com>

On Mon, Mar 03 2025 at 19:16, Inochi Amaoto wrote:
> Add support for Sophgo SG2044 MSI interrupt controller.

This patch fails to apply on top of:

     git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/drivers

Please always ensure that your patches apply against the tree/branch
into which they are supposed to be merged. Grabbing random patches from
the mailing list as base is not sufficient. It's clearly documented
against what you should work.
     
> +struct sg2042_msi_of_data {

There is nothing specific to OF in this data structure. This structure
contains the chip and the MSI parent ops of each variant. So something
like sg204x_chip_info is way more descriptive.

> +	const struct irq_chip		*irqchip;
> +	const struct msi_parent_ops	*parent_ops;
> +};
> +
>  struct sg2042_msi_chipdata {

and rename that one to sg204x_... as it is not longer sg2042 specific.

>  	void __iomem	*reg_clr;	// clear reg, see TRM, 10.1.33, GP_INTR0_CLR
>  
> @@ -29,8 +34,10 @@ struct sg2042_msi_chipdata {
>  	u32		irq_first;	// The vector number that MSIs starts
>  	u32		num_irqs;	// The number of vectors for MSIs
>  
> -	DECLARE_BITMAP(msi_map, SG2042_MAX_MSI_VECTOR);
> +	unsigned long	*msi_map;
>  	struct mutex	msi_map_lock;	// lock for msi_map
> +
> +	const struct sg2042_msi_of_data	*data;

Please keep the tabular formatting of this struct. See:

https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#coding-style-notes

>  };
>  
>  static int sg2042_msi_allocate_hwirq(struct sg2042_msi_chipdata *data, int num_req)
> @@ -81,6 +88,37 @@ static const struct irq_chip sg2042_msi_middle_irq_chip = {
>  	.irq_compose_msi_msg	= sg2042_msi_irq_compose_msi_msg,
>  };
>  
> +static void sg2044_msi_irq_ack(struct irq_data *d)
> +{
> +	struct sg2042_msi_chipdata *data = irq_data_get_irq_chip_data(d);
> +
> +	writel(0, (unsigned int *)data->reg_clr + d->hwirq);
> +

Pointless newline

> +	irq_chip_ack_parent(d);
> +}
> +
> +static void sg2044_msi_irq_compose_msi_msg(struct irq_data *d,
> +					   struct msi_msg *msg)

No line break required. Please use up to 100 characters.

>  static int sg2042_msi_parent_domain_alloc(struct irq_domain *domain,
>  					  unsigned int virq, int hwirq)
>  {
> @@ -119,7 +157,7 @@ static int sg2042_msi_middle_domain_alloc(struct irq_domain *domain,
>  			goto err_hwirq;
>  
>  		irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
> -					      &sg2042_msi_middle_irq_chip, data);
> +					      data->data->irqchip, data);

The conversion of the existing code to this should be a preparatory patch
for ease of review and the support for the new chip built on top.

Also please come up with a sensible name for this new 'data' pointer.

     data->data->

is horribly unintuitive. It's not the same data type. 

     data->chip_info

or such makes it clear what this is about.

Thanks,

        tglx

  reply	other threads:[~2025-03-03 19:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 11:16 [PATCH 0/2] irqchip/sg2042-msi: Add the Sophgo SG2044 MSI interrupt controller Inochi Amaoto
2025-03-03 11:16 ` [PATCH 1/2] dt-bindings: interrupt-controller: Add Sophgo SG2044 MSI controller Inochi Amaoto
2025-03-03 16:29   ` Conor Dooley
2025-03-04  1:00     ` Inochi Amaoto
2025-03-03 11:16 ` [PATCH 2/2] irqchip/sg2042-msi: Add the Sophgo SG2044 MSI interrupt controller Inochi Amaoto
2025-03-03 19:31   ` Thomas Gleixner [this message]
2025-03-04  0:41     ` Inochi Amaoto
2025-03-04  2:16   ` Chen Wang

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=87y0xlc3mz.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=inochiama@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=looong.bin@gmail.com \
    --cc=robh@kernel.org \
    --cc=sophgo@lists.linux.dev \
    --cc=unicorn_wang@outlook.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