From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934544AbcECRl7 (ORCPT ); Tue, 3 May 2016 13:41:59 -0400 Received: from mail-qk0-f179.google.com ([209.85.220.179]:34459 "EHLO mail-qk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933831AbcECRl4 (ORCPT ); Tue, 3 May 2016 13:41:56 -0400 Subject: Re: [PATCH] lightnvm: pass dma address to hardware rather than pointer To: Arnd Bergmann , Keith Busch , Jens Axboe References: <1462288968-763853-1-git-send-email-arnd@arndb.de> Cc: =?UTF-8?Q?Javier_Gonz=c3=a1lez?= , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <5728E2E0.1000106@bjorling.me> Date: Tue, 3 May 2016 19:41:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1462288968-763853-1-git-send-email-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/03/2016 05:22 PM, Arnd Bergmann wrote: > A recent change to lightnvm added code to pass a kernel pointer > to the hardware, which gcc complained about: > > drivers/nvme/host/lightnvm.c: In function 'nvme_nvm_rqtocmd': > drivers/nvme/host/lightnvm.c:472:32: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] > c->ph_rw.metadata = cpu_to_le64(rqd->meta_list); > > It looks like this has no way of working anyway, so this changes > the code to pass the dma_address instead. This was most likely > what was intended here. Neither of the two are currently ever > written to, so the effect is the same for now. > > Signed-off-by: Arnd Bergmann > Fixes: a34b1eb78e21 ("lightnvm: enable metadata to be sent to device") > --- > drivers/nvme/host/lightnvm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c > index fadeb54bc7df..65de1e56e59a 100644 > --- a/drivers/nvme/host/lightnvm.c > +++ b/drivers/nvme/host/lightnvm.c > @@ -469,7 +469,7 @@ static inline void nvme_nvm_rqtocmd(struct request *rq, struct nvm_rq *rqd, > c->ph_rw.opcode = rqd->opcode; > c->ph_rw.nsid = cpu_to_le32(ns->ns_id); > c->ph_rw.spba = cpu_to_le64(rqd->ppa_addr.ppa); > - c->ph_rw.metadata = cpu_to_le64(rqd->meta_list); > + c->ph_rw.metadata = cpu_to_le64(rqd->dma_meta_list); > c->ph_rw.control = cpu_to_le16(rqd->flags); > c->ph_rw.length = cpu_to_le16(rqd->nr_pages - 1); > > Thanks Arnd, good catch. I haven't sent the 4.7 patches upstream yet. Do you want me to squash your patch into Javier's or keep it separately?