All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: "Mrinmay Sarkar" <quic_msarkar@quicinc.com>,
	vkoul@kernel.org, jingoohan1@gmail.com, conor+dt@kernel.org,
	konrad.dybcio@linaro.org, robh+dt@kernel.org,
	quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com,
	quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com,
	dmitry.baryshkov@linaro.org, quic_krichai@quicinc.com,
	quic_vbadigan@quicinc.com, quic_parass@quicinc.com,
	quic_schintav@quicinc.com, quic_shijjose@quicinc.com,
	"Gustavo Pimentel" <gustavo.pimentel@synopsys.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	mhi@lists.linux.dev
Subject: Re: [PATCH v1 4/6] dmaengine: dw-edma: Move HDMA_V0_MAX_NR_CH definition to edma.h
Date: Fri, 2 Feb 2024 17:56:48 +0530	[thread overview]
Message-ID: <20240202122648.GD8020@thinkpad> (raw)
In-Reply-To: <qfdsnz7louqdrs6mhz72o6mzjo66kw63vtlhgpz6hgqfyyzyhq@tge3r7mvwtw3>

On Fri, Feb 02, 2024 at 01:47:37PM +0300, Serge Semin wrote:
> Hi Mrinmay
> 
> On Fri, Jan 19, 2024 at 06:30:20PM +0530, Mrinmay Sarkar wrote:
> > From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > 
> > To maintain uniformity with eDMA, let's move the HDMA max channel
> > definition to edma.h. While at it, let's also rename it to HDMA_MAX_NR_CH.
> 
> First of all include/linux/dma/edma.h already contains the common DW
> EDMA and _HDMA_ settings/entities including the number of channels.
> Both of these IP-cores have the same constraints on the max amount of
> channels. Moreover the EDMA_MAX_WR_CH/EDMA_MAX_RD_CH macros are
> already utilized in the common dw_edma_probe() method. So to speak you
> can freely use these macros for HDMA too. Thus this change is
> redundant. So is the patches 1/6 and 2/6.
> 
> Note currently all the common DW EDMA driver code uses the EDMA_/edma_
> prefixes. HDMA_/hdma_ prefixes are utilized in the Native
> HDMA-specific module only. So if you wished to provide some IP-core
> specific settings utilized in the common part of the driver, then the
> best approach would be to provide a change for the entire driver
> interface (for instance first convert it to having a neutral prefixes,
> like xdma_/etc, and then use the IP-core specific ones). So please
> just use the EDMA_MAX_WR_CH and EDMA_MAX_RD_CH macros and drop the
> patches 1, 2, and 4.
> 

Hmm. With my limited access to the HDMA IP insights, I was not aware that the
constraints are similar with EDMA. If so, then it makes sense to reuse the same
macros. But I would also add a comment on top of the macros to avoid confusion.

- Mani

> -Serge(y)
> 
> > 
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > Signed-off-by: Mrinmay Sarkar <quic_msarkar@quicinc.com>
> > ---
> >  drivers/dma/dw-edma/dw-hdma-v0-core.c | 4 ++--
> >  drivers/dma/dw-edma/dw-hdma-v0-regs.h | 3 +--
> >  include/linux/dma/edma.h              | 1 +
> >  3 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c
> > index 1f4cb7d..819ef1f 100644
> > --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c
> > +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c
> > @@ -54,7 +54,7 @@ static void dw_hdma_v0_core_off(struct dw_edma *dw)
> >  {
> >  	int id;
> >  
> > -	for (id = 0; id < HDMA_V0_MAX_NR_CH; id++) {
> > +	for (id = 0; id < HDMA_MAX_NR_CH; id++) {
> >  		SET_BOTH_CH_32(dw, id, int_setup,
> >  			       HDMA_V0_STOP_INT_MASK | HDMA_V0_ABORT_INT_MASK);
> >  		SET_BOTH_CH_32(dw, id, int_clear,
> > @@ -70,7 +70,7 @@ static u16 dw_hdma_v0_core_ch_count(struct dw_edma *dw, enum dw_edma_dir dir)
> >  	 * available, we set it to maximum channels and let the platform
> >  	 * set the right number of channels.
> >  	 */
> > -	return HDMA_V0_MAX_NR_CH;
> > +	return HDMA_MAX_NR_CH;
> >  }
> >  
> >  static enum dma_status dw_hdma_v0_core_ch_status(struct dw_edma_chan *chan)
> > diff --git a/drivers/dma/dw-edma/dw-hdma-v0-regs.h b/drivers/dma/dw-edma/dw-hdma-v0-regs.h
> > index a974abd..cd7eab2 100644
> > --- a/drivers/dma/dw-edma/dw-hdma-v0-regs.h
> > +++ b/drivers/dma/dw-edma/dw-hdma-v0-regs.h
> > @@ -11,7 +11,6 @@
> >  
> >  #include <linux/dmaengine.h>
> >  
> > -#define HDMA_V0_MAX_NR_CH			8
> >  #define HDMA_V0_LOCAL_ABORT_INT_EN		BIT(6)
> >  #define HDMA_V0_REMOTE_ABORT_INT_EN		BIT(5)
> >  #define HDMA_V0_LOCAL_STOP_INT_EN		BIT(4)
> > @@ -92,7 +91,7 @@ struct dw_hdma_v0_ch {
> >  } __packed;
> >  
> >  struct dw_hdma_v0_regs {
> > -	struct dw_hdma_v0_ch ch[HDMA_V0_MAX_NR_CH];	/* 0x0000..0x0fa8 */
> > +	struct dw_hdma_v0_ch ch[HDMA_MAX_NR_CH];	/* 0x0000..0x0fa8 */
> >  } __packed;
> >  
> >  struct dw_hdma_v0_lli {
> > diff --git a/include/linux/dma/edma.h b/include/linux/dma/edma.h
> > index 550f6a4..2cdf249a 100644
> > --- a/include/linux/dma/edma.h
> > +++ b/include/linux/dma/edma.h
> > @@ -14,6 +14,7 @@
> >  
> >  #define EDMA_MAX_WR_CH                                  8
> >  #define EDMA_MAX_RD_CH                                  8
> > +#define HDMA_MAX_NR_CH					8
> >  
> >  struct dw_edma;
> >  struct dw_edma_chip;
> > -- 
> > 2.7.4
> > 

-- 
மணிவண்ணன் சதாசிவம்

  reply	other threads:[~2024-02-02 12:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19 13:00 [PATCH v1 0/6] Add Change to integrate HDMA with dwc ep driver Mrinmay Sarkar
2024-01-19 13:00 ` [PATCH v1 1/6] dmaengine: dw-edma: Pass 'struct dw_edma_chip' to irq_vector() Mrinmay Sarkar
2024-01-19 13:23   ` Dmitry Baryshkov
2024-02-02 10:50   ` Serge Semin
2024-01-19 13:00 ` [PATCH v1 2/6] dmaengine: dw-edma: Introduce helpers for getting the eDMA/HDMA max channel count Mrinmay Sarkar
2024-01-19 13:26   ` Dmitry Baryshkov
2024-01-30  8:48     ` Manivannan Sadhasivam
2024-02-02 10:51   ` Serge Semin
2024-01-19 13:00 ` [PATCH v1 3/6] PCI: dwc: Add HDMA support Mrinmay Sarkar
2024-02-02 21:40   ` Serge Semin
2024-02-07 17:06     ` Manivannan Sadhasivam
2024-02-09 17:10     ` Bjorn Helgaas
2024-02-11 19:37       ` Serge Semin
2024-02-13  7:53         ` Manivannan Sadhasivam
2024-01-19 13:00 ` [PATCH v1 4/6] dmaengine: dw-edma: Move HDMA_V0_MAX_NR_CH definition to edma.h Mrinmay Sarkar
2024-02-02 10:47   ` Serge Semin
2024-02-02 12:26     ` Manivannan Sadhasivam [this message]
2024-01-19 13:00 ` [PATCH v1 5/6] PCI: qcom-ep: Provide number of read/write channel for HDMA Mrinmay Sarkar
2024-01-30  8:53   ` Manivannan Sadhasivam
2024-01-30 13:18     ` Mrinmay Sarkar
2024-01-19 13:00 ` [PATCH v1 6/6] PCI: epf-mhi: Add flag to enable HDMA for SA8775P Mrinmay Sarkar
2024-01-30  8:53   ` Manivannan Sadhasivam
2024-01-30 10:00 ` [PATCH v1 0/6] Add Change to integrate HDMA with dwc ep driver Serge Semin

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=20240202122648.GD8020@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=fancer.lancer@gmail.com \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=jingoohan1@gmail.com \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=kw@linux.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mhi@lists.linux.dev \
    --cc=quic_krichai@quicinc.com \
    --cc=quic_msarkar@quicinc.com \
    --cc=quic_nayiluri@quicinc.com \
    --cc=quic_nitegupt@quicinc.com \
    --cc=quic_parass@quicinc.com \
    --cc=quic_ramkri@quicinc.com \
    --cc=quic_schintav@quicinc.com \
    --cc=quic_shazhuss@quicinc.com \
    --cc=quic_shijjose@quicinc.com \
    --cc=quic_vbadigan@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=vkoul@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.