From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matias Bjorling Subject: Re: [PATCH 5/5 v2] nvme: LightNVM support Date: Thu, 16 Apr 2015 19:17:47 +0200 Message-ID: <552FEEBB.2010106@bjorling.me> References: <1429101284-19490-1-git-send-email-m@bjorling.me> <1429101284-19490-6-git-send-email-m@bjorling.me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: hch@infradead.org, axboe@fb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, javier@paletta.io To: Keith Busch Return-path: Received: from mail-la0-f47.google.com ([209.85.215.47]:35285 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754316AbbDPRRx (ORCPT ); Thu, 16 Apr 2015 13:17:53 -0400 Received: by labbd9 with SMTP id bd9so61969886lab.2 for ; Thu, 16 Apr 2015 10:17:51 -0700 (PDT) In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Den 16-04-2015 kl. 16:55 skrev Keith Busch: > On Wed, 15 Apr 2015, Matias Bj=C3=B8rling wrote: >> @@ -2316,7 +2686,9 @@ static int nvme_dev_add(struct nvme_dev *dev) >> struct nvme_id_ctrl *ctrl; >> void *mem; >> dma_addr_t dma_addr; >> - int shift =3D NVME_CAP_MPSMIN(readq(&dev->bar->cap)) + 12; >> + u64 cap =3D readq(&dev->bar->cap); >> + int shift =3D NVME_CAP_MPSMIN(cap) + 12; >> + int nvm_cmdset =3D NVME_CAP_NVM(cap); > > The controller capabilities' command sets supported used here is the > right way to key off on support for this new command set, IMHO, but I= do > not see in this patch the command set being selected when the control= ler > is enabled I'll get that added. Wouldn't it just be that the command set always is= =20 selected? A NVMe controller can expose both normal and lightnvm=20 namespaces. So we would always enable it, if CAP bit is set. > > Also if we're going this route, I think we need to define this reserv= ed > bit in the spec, but I'm not sure how to help with that. Agree, we'll see how it can be proposed. > >> @@ -2332,6 +2704,7 @@ static int nvme_dev_add(struct nvme_dev *dev) >> ctrl =3D mem; >> nn =3D le32_to_cpup(&ctrl->nn); >> dev->oncs =3D le16_to_cpup(&ctrl->oncs); >> + dev->oacs =3D le16_to_cpup(&ctrl->oacs); > > I don't find OACS used anywhere in the rest of the patch. I think thi= s > must be left over from v1. Oops, yes, that's just a left over. > > Otherwise it looks pretty good to me, but I think it would be cleaner= if > the lightnvm stuff is not mixed in the same file with the standard nv= me > command set. We might end up splitting nvme-core in the future anyway > for command sets and transports. Will do. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html