Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6493209imu; Wed, 14 Nov 2018 02:19:51 -0800 (PST) X-Google-Smtp-Source: AJdET5euqsHBfUWC60LBEBjB21KrUl4/MVqe9iRPvshcB0++qnmJnUNCEYBb9s+YacYxJQmS5pIl X-Received: by 2002:a17:902:2cc1:: with SMTP id n59-v6mr1354454plb.26.1542190791004; Wed, 14 Nov 2018 02:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542190790; cv=none; d=google.com; s=arc-20160816; b=AJCwHip1L/m8bPr0YLkRmz7lPYxnyo4WWCntxC809D4I48TkR1+4/FlSJ1n+HIcLI5 dUe2SP8Y2Z1g9J/ddRErJmuAGkO7hZtXOR5udAG0VFWRUx/FimTC8IbbhL81w+Ixp0yN xm032fyJVxYsYgUxUIbvFHHnirn9LcKRwtFB816+FxwrFtghhIo4A/IxBG/0rmIGUnL1 oNFcL8i4L2XdeQo3Xi8UPqrs+JAtRd9yN4BzzOQuePkzOG/w9o9hhb8D13QRyX05Y8Aa WNqtijQlMzAeJPaYG4sp6IZsFtKWHzGefCxKmMrrVXz9tOcWM3xXPPsfusahcZbGieHP C5nA== 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; bh=vUOWWRUdPOgLydfoDpd64Ej+y+tIu5gUMS5ilrkwaVw=; b=sw7iZ8WjJkoEu3Fx9+X+1S/0a4MEOZUnEsMPh5Gp7j4GlT3FMZ5g4U6MoautbLuxoa F7iGhLhaHaSs1AB3FPXaGxnGha5HtvyV/ZoDOeMgw2HA2dVdRfpAKgbSpiQkReapC8eB mHJsf623IzUtx7QRw3YBu37sO8JVTk3EUGcutfUl3ZKJ4z8/AxEkzWiAuZH594cBsZ5L zKkjYpR2dYmz3HKdKpHVeybeD9idV2tqO36ipueltOnQTXhVRcrPBTTXG3LHuyauFJ9k CCP56YPMesguQIJsa1s0sdgDs8ZW3m9OoFuIMmbqIg3fdo98qP8QwhDGqdu73mVC++gr tXCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XalUSWO0; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z61-v6si24176771plb.46.2018.11.14.02.19.35; Wed, 14 Nov 2018 02:19:50 -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=@ti.com header.s=ti-com-17Q1 header.b=XalUSWO0; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732725AbeKNUVc (ORCPT + 99 others); Wed, 14 Nov 2018 15:21:32 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:48506 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732174AbeKNUVc (ORCPT ); Wed, 14 Nov 2018 15:21:32 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id wAEAI21w098431; Wed, 14 Nov 2018 04:18:02 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1542190682; bh=vUOWWRUdPOgLydfoDpd64Ej+y+tIu5gUMS5ilrkwaVw=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=XalUSWO0M6cOakPbhfhwn/Xg7I1GUXOyRU72lQNfuXU79cH+TYAjIBvv6n9ENeLtM 1U/daJfqu/xrzGvLsAiPiqiC+go5WbdRr0CVf8L1F8ogiGI0X2jnRdxp4anERz+ulW ofwSEAaVcpAAJHaXRItPs8/NTsfZc2rdrz+BDht0= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wAEAI2Mh021520 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Nov 2018 04:18:02 -0600 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 14 Nov 2018 04:18:01 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 14 Nov 2018 04:18:01 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wAEAHu9K018732; Wed, 14 Nov 2018 04:17:57 -0600 Subject: Re: [PATCH v1 1/5] drivercore: Revert "deferral race condition fix" To: Andy Shevchenko , Mark Brown CC: Andy Shevchenko , MyungJoo Ham , Chanwoo Choi , USB , Felipe Balbi , Guenter Roeck , "Krogerus, Heikki" , , Linux PM , "Rafael J. Wysocki" , Sebastian Reichel , Linux OMAP Mailing List , Darren Hart , Platform Driver , Greg Kroah-Hartman , Linux Kernel Mailing List , Chen-Yu Tsai , Hans de Goede , , Andrzej Hajda References: <20181110181101.24557-1-andriy.shevchenko@linux.intel.com> <1c2c1031-a6b4-cbce-ceed-c2ce229c204e@ti.com> <20181114003345.GV2089@sirena.org.uk> From: Peter Ujfalusi Message-ID: <262d8ef0-ead2-1ec8-d2e1-0c5f6497b1fb@ti.com> Date: Wed, 14 Nov 2018 12:19:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy, On 2018-11-14 10:45, Andy Shevchenko wrote: > On Wed, Nov 14, 2018 at 2:34 AM Mark Brown wrote: >> >> On Mon, Nov 12, 2018 at 06:11:26PM +0200, Peter Ujfalusi wrote: >> >>> if we revert the commit then the original issue will re-surfaces. afaik >>> it was not only audio which hit the 'last driver to be probed from the >>> deferred list would never probe, unless we provoke the kernel to load >>> additional module, or remove/reload the module' issue. >> >> Right, aren't we just going to be swapping one bug for another? > > Have anyone in possession of Davinchi tested most recent kernel with > this revert? I don't think it is related to daVinci, in fact we have seen the very same issue with OMAP4. Fwiw this was my initial patch http://lkml.iu.edu/hypermail/linux/kernel/1404.0/01603.html Grant based his change on this. Note the part in the commit message: "The issue has been observed on embedded systems with CONFIG_PREEMPT enabled, audio support built as modules and using nfsroot for root filesystem." as I recall I was only able to reproduce the stall with nfsroot and buildroot fs. The timings were different compared to MMC rootfs. Anyways the patch fixes a real race condition which is generic: We have driverA and driverB as modules. driverB needs driverA to be registered to a framework (no direct, hard dependency). 1. driverA starts to probe 2. driverB starts to probe 3. driverB can not continue as driverA is not registered itself to the framework -> driverB will defer 4. driverA registers to the framework 5. driverA probes successfully 6. driver core will prepare the deferred probe list (note: driverB is still in it's probe, not in the deferred list) 7. driverB returns from it's probe with -EPROBE_DEFER and here we are, driverB is alone in the deferred list and the list is not going to be tried as driverA and driverB were the last ones to probe. So, driverB is in the deferred list and stays there until other driver probes successfully as the deferred driver list only tried when a driver loads successfully (to see if that satisfy any of the deferred driver). We have evidence that this has happened, it is a generic issue given that now days we have more frameworks drivers are relying on. >>> Do I understand correctly that in your case you have two modules >>> (dwc3-pci and extcon-intel-mrfld) in a deferred probe loop, iow both of >>> the drivers returns -EPROBE_DEFER and they just spin? >> >>> If both is deferring, how this supposed to work? >> >> I'm struggling to follow the original explanation too :( > > Sorry, guys, I confused a nit myself. The bug is there, but > exxplanation is not fully corrent, indeed. I'll come back with more > details later. > - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki