Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756008AbbLDKql (ORCPT ); Fri, 4 Dec 2015 05:46:41 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38755 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752283AbbLDKqj (ORCPT ); Fri, 4 Dec 2015 05:46:39 -0500 Subject: Re: [PATCH RFC 3/3] lightnvm: fix media mgr registration To: Wenwei Tao References: <1449058583-27940-1-git-send-email-m@bjorling.me> <1449058583-27940-3-git-send-email-m@bjorling.me> Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Organization: Paletta Message-ID: <56616F0C.5080300@bjorling.me> Date: Fri, 4 Dec 2015 11:46:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1305 Lines: 38 > > +struct nvmm_type *nvm_init_mgr(struct nvm_dev *dev) >> +{ >> + struct nvmm_type *mt; >> + int ret; >> + >> + lockdep_assert_held(&nvm_lock); >> + >> + list_for_each_entry(mt, &nvm_mgrs, list) { >> + ret = mt->register_mgr(dev); >> + if (ret < 0) { >> + pr_err("nvm: media mgr failed to init (%d) on dev %s\n", >> + ret, dev->name); >> + return NULL; /* initialization failed */ > > Do we just return or continue to try next media manager ? In my commit > > commit d0a712ceb83ebaea32d520825ee7b997f59b168f > > Author: Wenwei Tao > > Date: Sat Nov 28 16:49:28 2015 +0100 > > lightnvm: missing nvm_lock acquire > > I use the second solution. > We just return. With the system blocks, there might now have been registered a media manager, and that is why it should just give up if nothing is found. On media manager module init, it will then attach appropriately. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/