[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190722093059.GA29538@lst.de>
Date: Mon, 22 Jul 2019 11:30:59 +0200
From: Christoph Hellwig <hch@....de>
To: Marc Gonzalez <marc.w.gonzalez@...e.fr>
Cc: Minwoo Im <minwoo.im.dev@...il.com>,
MSM <linux-arm-msm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Stanimir Varbanov <svarbanov@...sol.com>,
Rob Clark <robdclark@...il.com>,
Stephen Boyd <sboyd@...nel.org>, Christoph Hellwig <hch@....de>
Subject: Re: [PATCH] firmware: qcom_scm: fix error for incompatible pointer
On Mon, Jul 22, 2019 at 10:38:55AM +0200, Marc Gonzalez wrote:
> > In file included from drivers/firmware/qcom_scm.c:12:0:
> > ./include/linux/dma-mapping.h:636:21: note: expected ‘dma_addr_t * {aka long long unsigned int *}’ but argument is of type ‘phys_addr_t * {aka unsigned int *}’
> > static inline void *dma_alloc_coherent(struct device *dev, size_t size,
> > ^~~~~~~~~~~~~~~~~~
> > ```
> >
> > We just can cast phys_addr_t to dma_addr_t here.
>
> IME, casting is rarely a proper solution.
*nod*
ptr_phys probably should be a dma_addr_t. Unless this driver is so
magic that it really wants a physical and not a dma address, in which
case it needs to use alloc_pages instead of dma_alloc_coherent
and then call page_to_phys on the returned page, and a very big comment
explaining why it is so special.
Powered by blists - more mailing lists