[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YhcL4fBYEWo7kpIS@matsya>
Date: Thu, 24 Feb 2022 10:08:57 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Akhil R <akhilrajeev@...dia.com>
Cc: Nathan Chancellor <nathan@...nel.org>,
"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>,
Pavan Kunapuli <pkunapuli@...dia.com>
Subject: Re: [PATCH v20 2/2] dmaengine: tegra: Add tegra gpcdma driver
On 24-02-22, 04:23, Akhil R wrote:
> > On Wed, Feb 23, 2022 at 03:49:09AM +0000, Akhil R wrote:
> > > 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.
dma_addr_t can be different on different arch so yes this 'can'
overflow, but since this driver would never be used on non ARM64, make
sense to put depends.
--
~Vinod
Powered by blists - more mailing lists