mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rabara, Niravkumar L" <niravkumar.l.rabara@intel.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	"linux@treblig.org" <linux@treblig.org>,
	Shen Lichuan <shenlichuan@vivo.com>,
	Jinjie Ruan <ruanjinjie@huawei.com>,
	"u.kleine-koenig@baylibre.com" <u.kleine-koenig@baylibre.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH v2 1/3] mtd: rawnand: cadence: support deferred prob when DMA is not ready
Date: Wed, 29 Jan 2025 09:17:29 +0000	[thread overview]
Message-ID: <BL3PR11MB653276DFD3339ADAADC70CCFA2EE2@BL3PR11MB6532.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87plkgpk8k.fsf@bootlin.com>

Hi Miquèl,


> -----Original Message-----
> From: Miquel Raynal <miquel.raynal@bootlin.com>
> Sent: Tuesday, 21 January, 2025 5:52 PM
> To: Rabara, Niravkumar L <niravkumar.l.rabara@intel.com>
> Cc: Richard Weinberger <richard@nod.at>; Vignesh Raghavendra
> <vigneshr@ti.com>; linux@treblig.org; Shen Lichuan <shenlichuan@vivo.com>;
> Jinjie Ruan <ruanjinjie@huawei.com>; u.kleine-koenig@baylibre.com; linux-
> mtd@lists.infradead.org; linux-kernel@vger.kernel.org; stable@vger.kernel.org
> Subject: Re: [PATCH v2 1/3] mtd: rawnand: cadence: support deferred prob when
> DMA is not ready
> 
> 
> Typo (prob) in the title.
> 
> > From: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>
> >
> > Use deferred driver probe in case the DMA driver is not probed.
> 
> Only devices are probed, not drivers.

I will fix the title and commit message in v3.
> 
> > --- a/drivers/mtd/nand/raw/cadence-nand-controller.c
> > +++ b/drivers/mtd/nand/raw/cadence-nand-controller.c
> > @@ -2908,7 +2908,7 @@ static int cadence_nand_init(struct cdns_nand_ctrl
> *cdns_ctrl)
> >  		if (!cdns_ctrl->dmac) {
> >  			dev_err(cdns_ctrl->dev,
> >  				"Unable to get a DMA channel\n");
> > -			ret = -EBUSY;
> > +			ret = -EPROBE_DEFER;
> 
> Does it work if there is no DMA channel provided? The bindings do not mention
> DMA channels as mandatory.
> 

The way Cadence NAND controller driver is written in such a way that it uses 
has_dma=1 as hardcoded value, indicating that slave DMA interface is connected
to DMA engine. However, it does not utilize the dedicated DMA channel information
from the device tree.

Driver works without external DMA interface i.e. has_dma=0. 
However current driver does not have a mechanism to configure it from device tree. 

> Also, wouldn't it be more pleasant to use another helper from the DMA core
> that returns a proper return code? So we now which one among -EBUSY, -
> ENODEV or -EPROBE_DEFER we get?
> 

Agree.
I will change to "dma_request_chan_by_mask" instead of "dma_request_channel "
so it can return a proper error code. 
  
		cdns_ctrl->dmac = dma_request_chan_by_mask(&mask);
		if (IS_ERR(cdns_ctrl->dmac)) {
			ret = PTR_ERR(cdns_ctrl->dmac);
			if (ret != -EPROBE_DEFER)
				dev_err(cdns_ctrl->dev,
					"Failed to get a DMA channel:%d\n",ret);
			goto disable_irq;
		}

Is this reasonable? 

Thanks,
Nirav

  reply	other threads:[~2025-01-29  9:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16  3:21 [PATCH v2 0/3] mtd: rawnand: cadence: improvement and fixes niravkumar.l.rabara
2025-01-16  3:21 ` [PATCH v2 1/3] mtd: rawnand: cadence: support deferred prob when DMA is not ready niravkumar.l.rabara
2025-01-21  9:52   ` Miquel Raynal
2025-01-29  9:17     ` Rabara, Niravkumar L [this message]
2025-01-29 10:02       ` Miquel Raynal
2025-01-30  3:51         ` Rabara, Niravkumar L
2025-01-30 15:19           ` Miquel Raynal
2025-02-04  7:48             ` Rabara, Niravkumar L
2025-02-04  9:20               ` Miquel Raynal
2025-02-04 10:43                 ` Rabara, Niravkumar L
2025-02-04 13:32                   ` Miquel Raynal
2025-02-04 14:11                     ` Rabara, Niravkumar L
2025-02-06 17:01                       ` Miquel Raynal
2025-02-07  9:12                         ` Rabara, Niravkumar L
2025-02-07 13:22                           ` Miquel Raynal
2025-01-16  3:21 ` [PATCH v2 2/3] mtd: rawnand: cadence: use dma_map_resource for sdma address niravkumar.l.rabara
2025-01-21  9:53   ` Miquel Raynal
2025-01-29  9:02     ` Rabara, Niravkumar L
2025-01-29  9:50       ` Miquel Raynal
2025-01-16  3:21 ` [PATCH v2 3/3] mtd: rawnand: cadence: fix incorrect dev context in dma_unmap_single niravkumar.l.rabara
2025-01-21  9:54   ` Miquel Raynal
2025-01-29  8:58     ` Rabara, Niravkumar L
2025-01-29  9:48       ` Miquel Raynal

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=BL3PR11MB653276DFD3339ADAADC70CCFA2EE2@BL3PR11MB6532.namprd11.prod.outlook.com \
    --to=niravkumar.l.rabara@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux@treblig.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=ruanjinjie@huawei.com \
    --cc=shenlichuan@vivo.com \
    --cc=stable@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=vigneshr@ti.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

all inboxes | Powered by JetHome®