From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3650EC4360C for ; Wed, 25 Sep 2019 21:18:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 141F121D7B for ; Wed, 25 Sep 2019 21:18:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725306AbfIYVSR convert rfc822-to-8bit (ORCPT ); Wed, 25 Sep 2019 17:18:17 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:38913 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438188AbfIYVQO (ORCPT ); Wed, 25 Sep 2019 17:16:14 -0400 Received: by mail-pf1-f194.google.com with SMTP id v4so220085pff.6; Wed, 25 Sep 2019 14:16:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=de3fbBGdSjAywgr/PB5IcxlvkF6ameBKH/JnVp6bWFg=; b=PqX0yeyfDbNHfvX8H4fgvxuQHXgHT+R7JMM0nWOhIRf2gtxXP9Fbuz1v9p6bgYY3qD RXyVlHreVru4KtWqK6nStMeYslesFlWS8TrleAT2U2+bL4a6m+iNkEfyVfBomL1QohKj R7Aer0R64kq4MuebZ/N8ytiYCJJ7CmyuxaB3ycnG4WbgcpugRqYxeHzeDgKcxnmjgJMz SgfeZKaUvuLtDonduKf8f8YCqOmWlTnQLrXS1HCBBrUObyi0t5yU0Mtqttwow9LQnFqK TgkUR/70gsILoBifI7J+0phGYMPJmL/WZA5B92I2e6BdTVL75JGjTg91y/Z2ZbaByrND 4aHA== X-Gm-Message-State: APjAAAUe4j7g7YpBWdS+GzNYxt/FM049GYD6tkrjzuYIh27xTXEcj7tk YzLQpbWNaU2czn3ZlPjCCOE= X-Google-Smtp-Source: APXvYqyNjFPuJdsUXrt7xlRoloWvptMS5FptZ1aB7Hl1UY1rEKxym+yZkZyF1OrxJ2RTyxTPeYqazw== X-Received: by 2002:aa7:8813:: with SMTP id c19mr297331pfo.101.1569446173633; Wed, 25 Sep 2019 14:16:13 -0700 (PDT) Received: from ?IPv6:2620:15c:2c0:5:2d74:bb8d:dd9b:a53e? ([2620:15c:2c0:5:2d74:bb8d:dd9b:a53e]) by smtp.gmail.com with ESMTPSA id k66sm21530pjb.11.2019.09.25.14.16.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Sep 2019 14:16:12 -0700 (PDT) Subject: Re: [PATCH v4 06/25] ibtrs: client: main functionality From: Bart Van Assche To: Danil Kipnis Cc: Jack Wang , linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, Jens Axboe , Christoph Hellwig , Sagi Grimberg , Jason Gunthorpe , Doug Ledford , rpenyaev@suse.de, Jack Wang References: <20190620150337.7847-1-jinpuwang@gmail.com> <20190620150337.7847-7-jinpuwang@gmail.com> Message-ID: Date: Wed, 25 Sep 2019 14:16:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8BIT Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On 9/25/19 2:08 PM, Bart Van Assche wrote: > On 9/25/19 1:50 PM, Danil Kipnis wrote: >> On Wed, Sep 25, 2019 at 8:55 PM Bart Van Assche wrote: >>> There is plenty of code under drivers/base that calls get_device() and >>> put_device(). Are you sure that none of the code under drivers/base will >>> ever call get_device() and put_device() for the ibtrs client device? >> >> You mean how could multiple kernel modules share the same ibtrs >> session...? I really never thought that far... > > I meant something else: device_register() registers struct device > instances in multiple lists. The driver core may decide to iterate over > these lists and to call get_device() / put_device() on the devices it > finds in these lists. Examples of such functions are device_pm_add() (which is called indirectly by device_register()) and dpm_prepare(). Although it is unlikely that this code will be used in combination with suspend/resume, I don't think these drivers should be written such that it these are incompatible with the runtime power management code. Bart.