Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932385AbcLYOnb (ORCPT ); Sun, 25 Dec 2016 09:43:31 -0500 Received: from jbeekman.nl ([149.210.172.151]:33662 "EHLO daxilon.jbeekman.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932334AbcLYOn0 (ORCPT ); Sun, 25 Dec 2016 09:43:26 -0500 To: Scott Bauer , linux-nvme@lists.infradead.org References: <1482176149-2257-1-git-send-email-scott.bauer@intel.com> <1482176149-2257-5-git-send-email-scott.bauer@intel.com> Cc: Rafael.Antognolli@intel.com, axboe@fb.com, keith.busch@intel.com, jonathan.derrick@intel.com, viro@zeniv.linux.org.uk, hch@infradead.org, linux-kernel@vger.kernel.org, sagi@grimberg.me From: Jethro Beekman Message-ID: <3d8b8516-aac6-c11c-dbbb-47fc01308f8c@jbeekman.nl> Date: Sun, 25 Dec 2016 15:15:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <1482176149-2257-5-git-send-email-scott.bauer@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 77.174.21.92 X-SA-Exim-Mail-From: kernel@jbeekman.nl X-Spam-Report: Content analysis details: (-1.0 points, 5.0 required) pts rule name description --- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: lkml.org] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Subject: Re: [PATCH v3 4/5] nvme: Implement resume_from_suspend and SED Allocation code. Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 603 Lines: 16 On 19-12-16 20:35, Scott Bauer wrote: > @@ -1796,6 +1797,13 @@ static void nvme_reset_work(struct work_struct *work) > if (result) > goto out; > > + result = nvme_opal_initialize(&dev->ctrl); > + if (result) > + goto out; It seems you always try to intialize OPAL even if the drive doesn't support it. I think you should check if the device supports security commands and then see if it supports OPAL before calling this. See e.g. https://lkml.org/lkml/2016/6/19/139 . Ideally, this code would check all supported protocols and initialize the appropriate security device based on that. Jethro