Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1746053pxb; Fri, 20 Aug 2021 12:58:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1xd3bRDkd5AVcnzPk4VQOnQbSaVsUp8QnEYK+zZfqHH/UiHXlkSSpV9rsQNxJ7qnTJDn1 X-Received: by 2002:a92:bf03:: with SMTP id z3mr14120708ilh.196.1629489497441; Fri, 20 Aug 2021 12:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629489497; cv=none; d=google.com; s=arc-20160816; b=ivI+OimuDJvBy1SUWYSHtnB4QqYf5zMmof2fAhrzHk313ZoAoe2uCzY9JRaQlATMZR C+JGpG8AXqtYHCtGDCjAMrntoaf/60JZGRGz0hZcbJEGcrS8u29ItC3u5NSlYNWvO0Wq jgzl5ieO6TF0/uVdzjGCpnP7fFuRdWOsAz+1dWhA9Fj5KWdDUDuU6NmRNsbtJcL96kYV ueW/Y38k3jNZI85YbMOF+vyMfEOmYns50fE7230qqb4Kul98pJu4VfuWf7Y1qZx0IYB/ puwBerx3v2wuMUYXv7kpTznOAJ+AGrA+h16FypGwQJdnJs3hddVpk/ESDRKBIxGb04fU 9CPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=VbTON6RvZeZhGJt6ehyn/UMw7061NqQ9ISQ7HVHxgAQ=; b=jjmyddqk3V77eK+bAGRni1y5CqZo1DhxzOr1wuXYJS/Y57KaYa4FMXcEweEzz436+C Jnl0oqx2NbWfCSzgTZqSIo0zb9UhxwrOuqbbRLccUmBzGm0cIF3eod17SXa4v/UWJKl/ RzW/M1jZBNHjcgMX/fZrrGf8AcFAzDdTDCl9z/ThDRq2O7uMw6a6ibw7+qA/PCMQunPu O+NRodkB30Cmu2iZE1TfyQcO5WkFRpejyMiLdfurrm+GvvytsMCquQax5kPp3Zj3oIp9 hXpI6+G+8y8LCgB8BXzPWq1OF6kp6X+L2f50Kkk4YfqW8j9ufwkQN0JIrXIafaZU3DGz dGKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Nz+M9aqA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si7073679ioh.29.2021.08.20.12.57.48; Fri, 20 Aug 2021 12:58:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Nz+M9aqA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238262AbhHTT5V (ORCPT + 99 others); Fri, 20 Aug 2021 15:57:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237764AbhHTT5U (ORCPT ); Fri, 20 Aug 2021 15:57:20 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA958C061575 for ; Fri, 20 Aug 2021 12:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VbTON6RvZeZhGJt6ehyn/UMw7061NqQ9ISQ7HVHxgAQ=; b=Nz+M9aqAdzrwVlpMtHBAoKM3sQ /MC1a1UMn1TH8I0i3RIECs05+soT9W1PjPzTbJ9rJrBlQZiWwYwPq5gPiNraa8QlgzaxsxKTtNK51 xfHrhec5YI34f1OJr5TdE25HisAWUsCmZJlfg36RHrmqUjwzulPaeZmFyCQjOLZek95gCw4CfmWlT +NwsZjpJZ7dW4R+GpB9sCknUYdpVqI5Cy28SWGT6seS6n8qKOZLjSm9RoGhsy/82Rwg4KCVU8B1K7 vj3/f3pKGq5u6+BekrrvIUuufXlQ8QjCnK+AZbqc6s1HEqxrDWtOgT5+qZjbt4NuQI6nmdeG+FTns mYHecTpA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mHAd0-00C0kX-OY; Fri, 20 Aug 2021 19:56:34 +0000 Date: Fri, 20 Aug 2021 12:56:34 -0700 From: Luis Chamberlain To: Christoph Hellwig Cc: Zhenyu Wang , Jason Gunthorpe , "dri-devel@lists.freedesktop.org" , Greg KH , "intel-gfx@lists.freedesktop.org" , Joonas Lahtinen , "linux-kernel@vger.kernel.org" , Jani Nikula , Gerd Hoffmann , "Vivi, Rodrigo" , "intel-gvt-dev@lists.freedesktop.org" , "Wang, Zhi A" , Jani Nikula Subject: Re: refactor the i915 GVT support Message-ID: References: <20210728175925.GU1721383@nvidia.com> <20210729072022.GB31896@lst.de> <20210803094315.GF13928@zhen-hp.sh.intel.com> <20210803143058.GA1721383@nvidia.com> <20210804052606.GG13928@zhen-hp.sh.intel.com> <20210816173458.GA9183@lst.de> <20210817010851.GW13928@zhen-hp.sh.intel.com> <20210817052203.GX13928@zhen-hp.sh.intel.com> <20210819082929.GB13928@zhen-hp.sh.intel.com> <20210820141724.GA29034@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210820141724.GA29034@lst.de> Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 20, 2021 at 04:17:24PM +0200, Christoph Hellwig wrote: > On Thu, Aug 19, 2021 at 04:29:29PM +0800, Zhenyu Wang wrote: > > I'm working on below patch to resolve this. But I met a weird issue in > > case when building i915 as module and also kvmgt module, it caused > > busy wait on request_module("kvmgt") when boot, it doesn't happen if > > building i915 into kernel. I'm not sure what could be the reason? > > Luis, do you know if there is a problem with a request_module from > a driver ->probe routine that is probably called by a module_init > function itself? Generally no, but you can easily foot yourself in the feet by creating cross dependencies and not dealing with them properly. I'd make sure to keep module initialization as simple as possible, and run whatever takes more time asynchronously, then use a state machine to allow you to verify where you are in the initialization phase or query it or wait for a completion with a timeout. It seems the code in question is getting some spring cleaning, and its unclear where the code is I can inspect. If there's a tree somewhere I can take a peak I'd be happy to review possible oddities that may stick out. My goto model for these sorts of problems is to abstract the issue *outside* of the driver in question and implement new selftests to try to reproduce. This serves two purposes, 1) helps with testing 2) may allow you to see the problem more clearly. Luis