lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM5PR12MB1850C245826D8229E63141A0C03D9@DM5PR12MB1850.namprd12.prod.outlook.com>
Date:   Thu, 24 Feb 2022 04:23:27 +0000
From:   Akhil R <akhilrajeev@...dia.com>
To:     Nathan Chancellor <nathan@...nel.org>
CC:     "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Krishna Yarlagadda <kyarlagadda@...dia.com>,
        Laxman Dewangan <ldewangan@...dia.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
        "p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
        Rajesh Gumasta <rgumasta@...dia.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "thierry.reding@...il.com" <thierry.reding@...il.com>,
        "vkoul@...nel.org" <vkoul@...nel.org>,
        Pavan Kunapuli <pkunapuli@...dia.com>
Subject: RE: [PATCH v20 2/2] dmaengine: tegra: Add tegra gpcdma driver

> 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@...dia.com>
> > > > Signed-off-by: Pavan Kunapuli <pkunapuli@...dia.com>
> > > > Co-developed-by: Rajesh Gumasta <rgumasta@...dia.com>
> > > > Signed-off-by: Rajesh Gumasta <rgumasta@...dia.com>
> > > > Signed-off-by: Akhil R <akhilrajeev@...dia.com>
> > > > Reviewed-by: Jon Hunter <jonathanh@...dia.com>
> > > > Reviewed-by: Dmitry Osipenko <digetx@...il.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@...dia.com>");
> > > > +MODULE_AUTHOR("Rajesh Gumasta <rgumasta@...dia.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.
I see some drivers using 'depends on ARM64'. I guess probably we could
use that to avoid this warning. The driver is only supported for arm64 Tegra
systems as of now.

Thanks,
Akhil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ