From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "Rabara, Niravkumar L" <niravkumar.l.rabara@intel.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: Fri, 07 Feb 2025 14:22:01 +0100 [thread overview]
Message-ID: <87ikpl3n5y.fsf@bootlin.com> (raw)
In-Reply-To: <BL3PR11MB65320CBE12D13EBD3940CE44A2F12@BL3PR11MB6532.namprd11.prod.outlook.com> (Niravkumar L. Rabara's message of "Fri, 7 Feb 2025 09:12:44 +0000")
>> >> >> > My apologies for the confusion.
>> >> >> > Slave DMA terminology used in cadence nand controller bindings
>> >> >> > and driver is indeed confusing.
>> >> >> >
>> >> >> > To answer your question it is,
>> >> >> > 1 - External DMA (Generic DMA controller).
>> >> >> >
>> >> >> > Nand controller IP do not have embedded DMA controller (2 -
>> >> >> > peripheral
>> >> >> DMA).
>> >> >> >
>> >> >> > FYR, how external DMA is used.
>> >> >> > https://elixir.bootlin.com/linux/v6.13.1/source/drivers/mtd/nand
>> >> >> > /ra
>> >> >> > w/c
>> >> >> > adence-nand-controller.c#L1962
>> >> >>
>> >> >> In this case we should have a dmas property (and perhaps dma-names),
>> no?
>> >> >>
>> >> > No, I believe.
>> >> > Cadence NAND controller IP do not have dedicated handshake
>> >> > interface to connect with DMA controller.
>> >> > My understanding is dmas (and dma-names) are only used for the
>> >> > dedicated handshake interface between peripheral and the DMA
>> controller.
>> >>
>> >> I don't see well how you can defer if there is no resource to grab.
>> >> And if there is a resource to grab, why is it not described anywhere?
>> >>
>> >
>> > Since NAND controller do not have handshake interface with DMA
>> controller.
>> > Driver is using external DMA for memory-to-memory copy.
>>
>> I'm sorry you lost me again. What do you mean handshake? There is no
>> request line? There is no way the NAND controller can trigger DMA transfers?
>>
> Yes, I mean there is no request line, so there is no way the NAND controller can
> trigger DMA transfer.
>
> Sorry I used the terminology based on Synopsys DesignWare AXI DMA Controller
> that is used with Agilex5 SoCFPGA platform.
> https://github.com/torvalds/linux/blob/v6.14-rc1/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c#L1372
>
>> What do you mean mem-to-mem, how is this useful to the controller?
>>
> I mean system memory to/from NAND MMIO register address for page
> read/write data transfer.
>
> reg = <0x10b80000 0x10000>,
> <0x10840000 0x1000>; <--- This MMIO address block
> reg-names = "reg", "sdma";
>
>> > Your point is since the driver is using external DMA and it should be
>> > described in bindings?
>>
>> Yes. But maybe I still don't get it correctly.
>>
> dmas is an optional property in cadence nand controller bindings.
> https://github.com/torvalds/linux/blob/v6.14-rc1/Documentation/devicetree/bindings/mtd/cdns%2Chp-nfc.yaml#L36
> Does it need to change to required property in bindings?
On one side you have a dedicated MMIO region, which imply we should have
an external DMA engine that is probably generic. On the other side it
feels like only the NAND controller uses it and it should be pictured as
a peripheral DMA controller and in this case we should not use the DMA
engine API at all. Your case is something in between, I don't like it
much. Anyway, we cannot break bindings, so please respin the series
because I totally lost your initial target.
Miquèl
next prev parent reply other threads:[~2025-02-07 13:22 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
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 [this message]
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=87ikpl3n5y.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux@treblig.org \
--cc=niravkumar.l.rabara@intel.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