From: Nathan Chancellor <nathan@kernel.org>
To: Akhil R <akhilrajeev@nvidia.com>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
Krishna Yarlagadda <kyarlagadda@nvidia.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
Rajesh Gumasta <rgumasta@nvidia.com>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
"vkoul@kernel.org" <vkoul@kernel.org>,
Pavan Kunapuli <pkunapuli@nvidia.com>
Subject: Re: [PATCH v20 2/2] dmaengine: tegra: Add tegra gpcdma driver
Date: Wed, 23 Feb 2022 11:43:48 -0700 [thread overview]
Message-ID: <YhaAZNaav720xXXx@dev-arch.archlinux-ax161> (raw)
In-Reply-To: <DM5PR12MB1850EF14473F9F941FB12506C03C9@DM5PR12MB1850.namprd12.prod.outlook.com>
On Wed, Feb 23, 2022 at 03:49:09AM +0000, Akhil R wrote:
> > Hi Akhil,
> >
> > On Mon, Feb 21, 2022 at 09:09:34PM +0530, Akhil R wrote:
> > > Adding GPC DMA controller driver for Tegra. The driver supports dma
> > > transfers between memory to memory, IO peripheral to memory and memory
> > > to IO peripheral.
> > >
> > > Co-developed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
> > > Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
> > > Co-developed-by: Rajesh Gumasta <rgumasta@nvidia.com>
> > > Signed-off-by: Rajesh Gumasta <rgumasta@nvidia.com>
> > > Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
> > > Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
> > > Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
> > > ---
> > > drivers/dma/Kconfig | 11 +
> > > drivers/dma/Makefile | 1 +
> > > drivers/dma/tegra186-gpc-dma.c | 1507
> > > ++++++++++++++++++++++++++++++++
> > > 3 files changed, 1519 insertions(+)
> > > create mode 100644 drivers/dma/tegra186-gpc-dma.c
> >
> > <snip>
> >
> > > +static const struct __maybe_unused dev_pm_ops tegra_dma_dev_pm_ops =
> > > +{
> >
> > The __maybe_unused cannot split the type ("struct dev_pm_ops") otherwise it
> > causes a clang warning:
> >
> > https://lore.kernel.org/r/202202221207.lQ53BwKp-lkp@intel.com/
> >
> > static const struct dev_pm_ops tegra_dma_dev_pm_ops __maybe_unused = {
> >
> > would look a litle better I think. However, is this attribute even needed? The
> > variable is unconditionally used below, so there should be no warning about it
> > being unused?
> >
> > Cheers,
> > Nathan
> >
> > > + SET_SYSTEM_SLEEP_PM_OPS(tegra_dma_pm_suspend,
> > > +tegra_dma_pm_resume) };
> > > +
> > > +static struct platform_driver tegra_dma_driver = {
> > > + .driver = {
> > > + .name = "tegra-gpcdma",
> > > + .pm = &tegra_dma_dev_pm_ops,
> > > + .of_match_table = tegra_dma_of_match,
> > > + },
> > > + .probe = tegra_dma_probe,
> > > + .remove = tegra_dma_remove,
> > > +};
> > > +
> > > +module_platform_driver(tegra_dma_driver);
> > > +
> > > +MODULE_DESCRIPTION("NVIDIA Tegra GPC DMA Controller driver");
> > > +MODULE_AUTHOR("Pavan Kunapuli <pkunapuli@nvidia.com>");
> > > +MODULE_AUTHOR("Rajesh Gumasta <rgumasta@nvidia.com>");
> > > +MODULE_LICENSE("GPL");
> > > --
> > > 2.17.1
> > >
> > >
>
> Hi Nathan,
>
> Thanks. Will update the same.
>
> I am getting notification for the below warning also.
>
> >> drivers/dma/tegra186-gpc-dma.c:898:53: warning: shift count >= width of type [-Wshift-count-overflow]
> FIELD_PREP(TEGRA_GPCDMA_HIGH_ADDR_DST_PTR, (dest >> 32));
> https://lore.kernel.org/all/202202230559.bLOEMEUh-lkp@intel.com/
>
> I suppose, this is because it is compiled against a different ARCH other than arm64.
> For arm64, the dma_addr_t is 64 bytes, and this warning does not occur.
> Could this be ignored for now? If not, could you suggest a fix, if possible?
I am not really familiar with the DMA API and dma_addr_t so I am not
sure about a proper fix.
You could cast dest to u64 to guarantee it is a type that can be shifted
by 32 but that might not be right for CONFIG_PHYS_ADDR_T_64BIT=n. If the
driver is not expected to run without CONFIG_PHYS_ADDR_T_64BIT, then
this is probably fine.
You could mark this driver 'depends on PHYS_ADDR_T_64BIT' if it cannot
run with CONFIG_ARCH_TEGRA=y + CONFIG_PHYS_ADDR_T_64BIT=n but I do not
see any other drivers that do that, which might mean that is not a
proper fix.
Please do not ignore the warning, as it will show up with ARCH=arm
allmodconfig, which has -Werror enabled.
Cheers,
Nathan
next prev parent reply other threads:[~2022-02-23 18:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-21 15:39 [PATCH v20 0/2] Add NVIDIA Tegra GPC-DMA driver Akhil R
2022-02-21 15:39 ` [PATCH v20 1/2] dt-bindings: dmaengine: Add doc for tegra gpcdma Akhil R
2022-02-21 15:39 ` [PATCH v20 2/2] dmaengine: tegra: Add tegra gpcdma driver Akhil R
2022-02-22 15:31 ` Nathan Chancellor
2022-02-23 3:49 ` Akhil R
2022-02-23 18:43 ` Nathan Chancellor [this message]
2022-02-24 4:23 ` Akhil R
2022-02-24 4:38 ` Vinod Koul
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=YhaAZNaav720xXXx@dev-arch.archlinux-ax161 \
--to=nathan@kernel.org \
--cc=akhilrajeev@nvidia.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kyarlagadda@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pkunapuli@nvidia.com \
--cc=rgumasta@nvidia.com \
--cc=robh+dt@kernel.org \
--cc=thierry.reding@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).