All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Swee, Leong Ching" <leong.ching.swee@intel.com>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	"linux-stm32@st-md-mailman.stormreply.com"
	<linux-stm32@st-md-mailman.stormreply.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Teoh Ji Sheng <ji.sheng.teoh@intel.com>
Subject: RE: [PATCH net-next v2 3/4] net: stmmac: Add support for TX/RX channel interrupt
Date: Wed, 10 Jan 2024 05:45:17 +0000	[thread overview]
Message-ID: <CH0PR11MB549071EAB3017E244DCC2F71CF692@CH0PR11MB5490.namprd11.prod.outlook.com> (raw)
In-Reply-To: <xybq2523vgod6rbefw4zjs2kb2xtfmizecdwdjzyl6l2iovjqq@o3q4t2qny55o>

> -----Original Message-----
> From: Serge Semin <fancer.lancer@gmail.com>
> Sent: Monday, January 8, 2024 4:39 AM
> To: Swee, Leong Ching <leong.ching.swee@intel.com>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Jose Abreu <joabreu@synopsys.com>;
> David S . Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Rob Herring <robh+dt@kernel.org>; Krzysztof
> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Giuseppe Cavallaro <peppe.cavallaro@st.com>;
> linux-stm32@st-md-mailman.stormreply.com; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org; devicetree@vger.kernel.org; Teoh Ji Sheng
> <ji.sheng.teoh@intel.com>
> Subject: Re: [PATCH net-next v2 3/4] net: stmmac: Add support for TX/RX
> channel interrupt
> 
> On Fri, Jan 05, 2024 at 03:09:24PM +0800, Leong Ching Swee wrote:
> > From: Swee Leong Ching <leong.ching.swee@intel.com>
> >
> > Enable TX/RX channel interrupt registration for MAC that interrupts
> > CPU through shared peripheral interrupt (SPI).
> >
> > Per channel interrupts and interrupt-names are registered through,
> > Eg: 4 tx and 4 rx channels:
> > interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
> >              <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
> >              <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
> >              <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
> >              <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
> >              <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
> >              <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
> >              <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; interrupt-names =
> > "dma_tx0",
> >                   "dma_tx1",
> >                   "dma_tx2",
> >                   "dma_tx3",
> >                   "dma_rx0",
> >                   "dma_rx1",
> >                   "dma_rx2",
> >                   "dma_rx3";
> >
> > Signed-off-by: Teoh Ji Sheng <ji.sheng.teoh@intel.com>
> > Signed-off-by: Swee Leong Ching <leong.ching.swee@intel.com>
> > ---
> >  .../ethernet/stmicro/stmmac/stmmac_platform.c | 28
> > +++++++++++++++++++
> >  1 file changed, 28 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > index 70eadc83ca68..ae6859153e98 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > @@ -710,6 +710,10 @@
> EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt);
> >  int stmmac_get_platform_resources(struct platform_device *pdev,
> >  				  struct stmmac_resources *stmmac_res)  {
> 
> > +	char irq_name[9];
> > +	int i;
> > +	int irq;
> > +
> 
> Reverse xmas tree please. Also what the point in having "i" and "irq"
> defined separately? Wouldn't it be better to merge them into a single
> statement:
> +	char irq_name[9];
> +	int i, irq;
>
Will rework this in v3.
> >  	memset(stmmac_res, 0, sizeof(*stmmac_res));
> >
> >  	/* Get IRQ information early to have an ability to ask for deferred
> > @@ -743,6 +747,30 @@ int stmmac_get_platform_resources(struct
> platform_device *pdev,
> >  		dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
> >  	}
> >
> 
> > +	/* For RX Channel */
> 
> Why haven't you added a more descriptive comment as I suggested on v1:
> 
> +	/* Get optional Tx/Rx DMA per-channel IRQs, which otherwise
> +	 * are supposed to be delivered via the common MAC IRQ line
> +	 */
> 
> ?
> 
Sorry I missed this, will rework this on v3.
> > +	for (i = 0; i < MTL_MAX_RX_QUEUES; i++) {
> > +		snprintf(irq_name, sizeof(irq_name), "dma_rx%i", i);
> > +		irq = platform_get_irq_byname_optional(pdev, irq_name);
> > +		if (irq == -EPROBE_DEFER)
> > +			return irq;
> > +		else if (irq < 0)
> > +			break;
> > +
> > +		stmmac_res->rx_irq[i] = irq;
> > +	}
> > +
> 
> > +	/* For TX Channel */
> 
> * see the comment above
> 
> -Serge(y)
> 
> > +	for (i = 0; i < MTL_MAX_TX_QUEUES; i++) {
> > +		snprintf(irq_name, sizeof(irq_name), "dma_tx%i", i);
> > +		irq = platform_get_irq_byname_optional(pdev, irq_name);
> > +		if (irq == -EPROBE_DEFER)
> > +			return irq;
> > +		else if (irq < 0)
> > +			break;
> > +
> > +		stmmac_res->tx_irq[i] = irq;
> > +	}
> > +
> >  	stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
> >
> >  	return PTR_ERR_OR_ZERO(stmmac_res->addr);
> > --
> > 2.34.1
> >
> >

WARNING: multiple messages have this Message-ID (diff)
From: "Swee, Leong Ching" <leong.ching.swee@intel.com>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	"linux-stm32@st-md-mailman.stormreply.com"
	<linux-stm32@st-md-mailman.stormreply.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Teoh Ji Sheng <ji.sheng.teoh@intel.com>
Subject: RE: [PATCH net-next v2 3/4] net: stmmac: Add support for TX/RX channel interrupt
Date: Wed, 10 Jan 2024 05:45:17 +0000	[thread overview]
Message-ID: <CH0PR11MB549071EAB3017E244DCC2F71CF692@CH0PR11MB5490.namprd11.prod.outlook.com> (raw)
In-Reply-To: <xybq2523vgod6rbefw4zjs2kb2xtfmizecdwdjzyl6l2iovjqq@o3q4t2qny55o>

> -----Original Message-----
> From: Serge Semin <fancer.lancer@gmail.com>
> Sent: Monday, January 8, 2024 4:39 AM
> To: Swee, Leong Ching <leong.ching.swee@intel.com>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Jose Abreu <joabreu@synopsys.com>;
> David S . Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Rob Herring <robh+dt@kernel.org>; Krzysztof
> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Giuseppe Cavallaro <peppe.cavallaro@st.com>;
> linux-stm32@st-md-mailman.stormreply.com; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org; devicetree@vger.kernel.org; Teoh Ji Sheng
> <ji.sheng.teoh@intel.com>
> Subject: Re: [PATCH net-next v2 3/4] net: stmmac: Add support for TX/RX
> channel interrupt
> 
> On Fri, Jan 05, 2024 at 03:09:24PM +0800, Leong Ching Swee wrote:
> > From: Swee Leong Ching <leong.ching.swee@intel.com>
> >
> > Enable TX/RX channel interrupt registration for MAC that interrupts
> > CPU through shared peripheral interrupt (SPI).
> >
> > Per channel interrupts and interrupt-names are registered through,
> > Eg: 4 tx and 4 rx channels:
> > interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
> >              <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
> >              <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
> >              <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
> >              <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
> >              <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
> >              <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
> >              <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; interrupt-names =
> > "dma_tx0",
> >                   "dma_tx1",
> >                   "dma_tx2",
> >                   "dma_tx3",
> >                   "dma_rx0",
> >                   "dma_rx1",
> >                   "dma_rx2",
> >                   "dma_rx3";
> >
> > Signed-off-by: Teoh Ji Sheng <ji.sheng.teoh@intel.com>
> > Signed-off-by: Swee Leong Ching <leong.ching.swee@intel.com>
> > ---
> >  .../ethernet/stmicro/stmmac/stmmac_platform.c | 28
> > +++++++++++++++++++
> >  1 file changed, 28 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > index 70eadc83ca68..ae6859153e98 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > @@ -710,6 +710,10 @@
> EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt);
> >  int stmmac_get_platform_resources(struct platform_device *pdev,
> >  				  struct stmmac_resources *stmmac_res)  {
> 
> > +	char irq_name[9];
> > +	int i;
> > +	int irq;
> > +
> 
> Reverse xmas tree please. Also what the point in having "i" and "irq"
> defined separately? Wouldn't it be better to merge them into a single
> statement:
> +	char irq_name[9];
> +	int i, irq;
>
Will rework this in v3.
> >  	memset(stmmac_res, 0, sizeof(*stmmac_res));
> >
> >  	/* Get IRQ information early to have an ability to ask for deferred
> > @@ -743,6 +747,30 @@ int stmmac_get_platform_resources(struct
> platform_device *pdev,
> >  		dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
> >  	}
> >
> 
> > +	/* For RX Channel */
> 
> Why haven't you added a more descriptive comment as I suggested on v1:
> 
> +	/* Get optional Tx/Rx DMA per-channel IRQs, which otherwise
> +	 * are supposed to be delivered via the common MAC IRQ line
> +	 */
> 
> ?
> 
Sorry I missed this, will rework this on v3.
> > +	for (i = 0; i < MTL_MAX_RX_QUEUES; i++) {
> > +		snprintf(irq_name, sizeof(irq_name), "dma_rx%i", i);
> > +		irq = platform_get_irq_byname_optional(pdev, irq_name);
> > +		if (irq == -EPROBE_DEFER)
> > +			return irq;
> > +		else if (irq < 0)
> > +			break;
> > +
> > +		stmmac_res->rx_irq[i] = irq;
> > +	}
> > +
> 
> > +	/* For TX Channel */
> 
> * see the comment above
> 
> -Serge(y)
> 
> > +	for (i = 0; i < MTL_MAX_TX_QUEUES; i++) {
> > +		snprintf(irq_name, sizeof(irq_name), "dma_tx%i", i);
> > +		irq = platform_get_irq_byname_optional(pdev, irq_name);
> > +		if (irq == -EPROBE_DEFER)
> > +			return irq;
> > +		else if (irq < 0)
> > +			break;
> > +
> > +		stmmac_res->tx_irq[i] = irq;
> > +	}
> > +
> >  	stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
> >
> >  	return PTR_ERR_OR_ZERO(stmmac_res->addr);
> > --
> > 2.34.1
> >
> >

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-01-10  5:45 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05  7:09 [PATCH net-next v2 0/4] net: stmmac: Enable Per DMA Channel interrupt Leong Ching Swee
2024-01-05  7:09 ` Leong Ching Swee
2024-01-05  7:09 ` [PATCH net-next v2 1/4] dt-bindings: net: snps,dwmac: per channel irq Leong Ching Swee
2024-01-05  7:09   ` Leong Ching Swee
2024-01-07 20:10   ` Serge Semin
2024-01-07 20:10     ` Serge Semin
2024-01-09  9:10     ` Krzysztof Kozlowski
2024-01-09  9:10       ` Krzysztof Kozlowski
2024-01-09 22:20       ` Serge Semin
2024-01-09 22:20         ` Serge Semin
2024-01-05  7:09 ` [PATCH net-next v2 2/4] net: stmmac: Make MSI interrupt routine generic Leong Ching Swee
2024-01-05  7:09   ` Leong Ching Swee
2024-01-07 20:27   ` Serge Semin
2024-01-07 20:27     ` Serge Semin
2024-01-10  5:51     ` Swee, Leong Ching
2024-01-10  5:51       ` Swee, Leong Ching
2024-01-24 14:47       ` Serge Semin
2024-01-24 14:47         ` Serge Semin
2024-01-05  7:09 ` [PATCH net-next v2 3/4] net: stmmac: Add support for TX/RX channel interrupt Leong Ching Swee
2024-01-05  7:09   ` Leong Ching Swee
2024-01-07 20:38   ` Serge Semin
2024-01-07 20:38     ` Serge Semin
2024-01-10  5:45     ` Swee, Leong Ching [this message]
2024-01-10  5:45       ` Swee, Leong Ching
2024-01-05  7:09 ` [PATCH net-next v2 4/4] net: stmmac: Use interrupt mode INTM=1 for per channel irq Leong Ching Swee
2024-01-05  7:09   ` Leong Ching Swee
2024-01-07 20:52   ` Serge Semin
2024-01-07 20:52     ` Serge Semin
2024-01-10  5:43     ` Swee, Leong Ching
2024-01-10  5:43       ` Swee, Leong Ching
2024-01-07 16:40 ` [PATCH net-next v2 0/4] net: stmmac: Enable Per DMA Channel interrupt patchwork-bot+netdevbpf
2024-01-07 16:40   ` patchwork-bot+netdevbpf
2024-01-07 19:06   ` Krzysztof Kozlowski
2024-01-07 19:06     ` Krzysztof Kozlowski
2024-01-07 21:24     ` Serge Semin
2024-01-07 21:24       ` Serge Semin
2024-01-08  1:02       ` Jakub Kicinski
2024-01-08  1:02         ` Jakub Kicinski
2024-01-09  8:05       ` Swee, Leong Ching
2024-01-09  8:05         ` Swee, Leong Ching

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=CH0PR11MB549071EAB3017E244DCC2F71CF692@CH0PR11MB5490.namprd11.prod.outlook.com \
    --to=leong.ching.swee@intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=ji.sheng.teoh@intel.com \
    --cc=joabreu@synopsys.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=robh+dt@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.