Received: by 10.223.185.116 with SMTP id b49csp1767611wrg; Thu, 15 Feb 2018 00:58:40 -0800 (PST) X-Google-Smtp-Source: AH8x2257aB6vl7YHfNA0vK1G6WbOcvByliUqRNtad94kKO0Y0/hC5fwiS4DdJqngaXdggCYbCSzP X-Received: by 10.99.51.77 with SMTP id z74mr1684107pgz.120.1518685120743; Thu, 15 Feb 2018 00:58:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518685120; cv=none; d=google.com; s=arc-20160816; b=fwPzc+VEDfIdVW3zebeeikPs/rfajToYCeKzZ30lWc0nLumqQWMOlLbQC8MAhV626T uIMJVSDR1bHWRrZm6NgdcRBj2fdV1WlQP+KOwHokv+FS427SOLQ+SHGuOCj8cgNRCbt4 n6yZxfZGGPq1BF1FP1AjaZRzXqIoYT+YHL8LYXde9SrmgixQfuO+dEQKCW2XWohEX9G3 tYzWzi6xGH2IP/NqI49154qAzUE25C7j0E63n0EWl//lhe8BJ6J21ZsBQpswAzajMQTI cmEDDTbJp9ahqyXKjH11AuwXHH7gujISXHZF4tXCXXyvKPduj3pFlOZ07OCRLHwcLtIv 6zYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=MfpuRhf1AebGodpp1xu/pErHwUSR1B94CWq2ZcaS8w0=; b=KEs9m/gs7BZx7Qg3eruFQI04/1PyUrFQlYS7abujGD+JEworESuEGr+wBdl2Da4m4n Ne4fLxbxe28fGX37GXF16TSaZGXPuNhhuIRs52ihl0qOW9HMc4ggMh7sbm/PqcjyIBPj LhcgQc9oEaqulJHn4XSTbtdKYjS2goxTzNG15KodA0foIa16dIOpqOJRb2GmNtGGq/Jc xR+mxysJHp0+JqcAPp0gXTznBhp8coE9CfYIShuD04KpGpHw0rjkPUMriYuaZk6DKez3 7hdeJSylaxNRZV3lNwnRZ46PeeN66KehkXYRpNJpgQ3QoBkQSIBVSq7ddV9hx1F7oSO+ mbvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=OB6z6/a8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8-v6si958918plo.17.2018.02.15.00.58.25; Thu, 15 Feb 2018 00:58:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=OB6z6/a8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755128AbeBOI5p (ORCPT + 99 others); Thu, 15 Feb 2018 03:57:45 -0500 Received: from mail-lf0-f47.google.com ([209.85.215.47]:39483 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754909AbeBOI5m (ORCPT ); Thu, 15 Feb 2018 03:57:42 -0500 Received: by mail-lf0-f47.google.com with SMTP id h78so25838057lfg.6 for ; Thu, 15 Feb 2018 00:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MfpuRhf1AebGodpp1xu/pErHwUSR1B94CWq2ZcaS8w0=; b=OB6z6/a8GxY9q/Diiz5/lTfMUf6kjbPf4ZTWTX3SIJm1TaZBtw1u+FAzPokFW99t7S roe75BdgzZXdEDbxcRsGFPSH0x1enIbFFBhiLeEDyA/DVS59ayXnoCfT5gVVoDDkFyuB vTTLIHma1nOfR0UzMEA7AKYajrZBJpEoGm1AHgfNHiV8MOkzcZ+66vTCGdZ3KyZxAmRS 9XIsVafjLz+ujTCsCDXWY0wrUqjb/0asCL7FKOLrLyxS+Bh3IsMFQuvVQzSHHCbFdi7X e3y16v+CjRzMb9Rm44cUixREfEPa8UcydzuUWSlP5hzIe/aqiMVwq4NiD7yNRB9pt7Ab 0kFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MfpuRhf1AebGodpp1xu/pErHwUSR1B94CWq2ZcaS8w0=; b=oe/6P7vXkMrf9GJpobQqVSIBlhZ0hDcKLMcxK+AqzKQwhDz6k+K+uZmBwULGyj3rnI 6iYyGsLzhEY+/r3XP9hDayIZyjhIQd4h5vRRNEOzN7ufDooJhvA+fMs66O1jpQyIBdXS xgaee/pAmIyHriysbwYwX6aXn6mzomuGga43utRoMXPr045x80hVgepOgXbZH4vCE9lV YlxkFRuq89zButR1bXDwJakRzeSVLYScmpMIU1v9DhxNuv/dNsVNu6/b7ICm90sBQw8b Y6oWDT2Y8tlO+eRKQm4VLroI+lhB/1dSSrOOA3a1Ex+SzscDORt4JDOh+h70q/cwKZ8y 0fbg== X-Gm-Message-State: APf1xPApRbRRrxvgkMp9+UrkuIdWEG6VaRuyhNIx9QVFRUfsbQo90CBZ Ym1KMRBVdAYA6fbV+ZA5J8pmJg== X-Received: by 10.46.18.148 with SMTP id 20mr1289701ljs.2.1518685061492; Thu, 15 Feb 2018 00:57:41 -0800 (PST) Received: from [192.168.0.10] (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.googlemail.com with ESMTPSA id r12sm3086333lff.20.2018.02.15.00.57.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 00:57:40 -0800 (PST) Subject: Re: [PATCH V2 4/4] nvme: lightnvm: add late setup of block size and metadata To: Javier Gonzalez Cc: "linux-block@vger.kernel.org" , LKML , "linux-nvme@lists.infradead.org" References: <20180209092719.10679-1-mb@lightnvm.io> <20180209092719.10679-5-mb@lightnvm.io> <098A1343-A9FB-47BD-A4B5-6E77A1861A4B@cnexlabs.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: Date: Thu, 15 Feb 2018 09:57:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <098A1343-A9FB-47BD-A4B5-6E77A1861A4B@cnexlabs.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/12/2018 09:21 PM, Javier Gonzalez wrote: > >> On 9 Feb 2018, at 01.27, Matias Bjørling wrote: >> >> The nvme driver sets up the size of the nvme namespace in two steps. >> First it initializes the device with standard logical block and >> metadata sizes, and then sets the correct logical block and metadata >> size. Due to the OCSSD 2.0 specification relies on the namespace to >> expose these sizes for correct initialization, let it be updated >> appropriately on the LightNVM side as well. >> >> Signed-off-by: Matias Bjørling >> --- >> > > This late initialization breaks ligthnvm's core init since the sector > size (csecs) is used on the first init part to set the logical block size. > > nvm_core_init -> blk_queue_logical_block_size(dev->q, dev_geo->c.csecs); > > We can do do a nvme_nvm_revalidate and set this on the revalidation path > instead of simply updating the info as in nvme_nvm_update_nvm_info().' I believe that is what the patch does (nvme_nvm_update_nvm_info is called from the nvme_revalidate_disk context). The nvm_core_init initialization of the block size is redundant and should be removed. I'll update the patch.