Received: by 10.223.185.116 with SMTP id b49csp4184022wrg; Mon, 26 Feb 2018 12:45:12 -0800 (PST) X-Google-Smtp-Source: AG47ELu0wqh84QStMGHojaortLI8Vb1MIcCcmLTBLb/YWMKATrhgVmepr3zJLuTUfRPo3NO9TdqE X-Received: by 2002:a17:902:bd07:: with SMTP id p7-v6mr1786528pls.378.1519677912601; Mon, 26 Feb 2018 12:45:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519677912; cv=none; d=google.com; s=arc-20160816; b=nZPW3Fiagx3spEujkByPkb3r9RQPyKWWS6VCLdaAMfD1pkd/ViKvE0cxeIXdLJ0Zj6 s01sCo26Uv4yxVbCPtntPaXTHolyXmGDNWSxkVXVVZw1ZMe6BLCLCSaWMLmNIwrh8U9o hdlEzpMcqBdWYB4O/tkzyzDMyawFnSN49+7O6M9SOPivrJ8MLsNDqtY4/jt4+pbDXp34 sWQk48Jdc7EHeLtj1w0ecPKNsEqcqwwsLzDm8Y+4nuMAzwELSfg5NTviDixC6DRUFXkt cMFR4Elmzm5r+LEzL8EDNNE6RrZ2BUzg9MxV8asYntZPYNM8WgRT/A3bc0Dlr+mdtJdy 18Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=cESx/j5BudWOrRzNudP8uilrcUPrHpJLcIaFHOiW1nQ=; b=gJhd7gFb3JEjyuVkFPUEYKOuQ6FTfJj7ikPB5MpCXy1PbyzjM+CmRrhazdC3sKqgpk jlteaO9fPbu+a1tIXB26xUCKMPN9nC6bP6duVFrdk1EK99E2VHGfPks68t3BEuQyKXf7 ryLHXJRy7XZcmRHyEBwFWSRuk5ZEOzMuB0Tft+wr4sTojQ9mTVtPfRJkuAW4mp8jFLJq J/WXEtpLDJoRg2NT7eIdLhEoge+nhZCVgC2la1h9SXZJ8zMYaNu8/ATa1sM8xeidXrZZ 2l8hkKR5/+qVG2TzPDJd1RbjGtkdUOUOimRgY63jYEKlfD2s1Qy+6T8rgAYEaplpUrrt OX1w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si5971659pgn.272.2018.02.26.12.44.55; Mon, 26 Feb 2018 12:45:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753392AbeBZU01 (ORCPT + 99 others); Mon, 26 Feb 2018 15:26:27 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35706 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753350AbeBZU0Y (ORCPT ); Mon, 26 Feb 2018 15:26:24 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 599A4FFC; Mon, 26 Feb 2018 20:26:23 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Chanwoo Choi Subject: [PATCH 4.15 15/64] extcon: int3496: process id-pin first so that we start with the right status Date: Mon, 26 Feb 2018 21:21:52 +0100 Message-Id: <20180226202154.093855446@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202153.453363333@linuxfoundation.org> References: <20180226202153.453363333@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede commit 0434352d3d2e950cf5e743f6062abd87de22f960 upstream. Some other drivers may be waiting for our extcon to show-up, exiting their probe methods with -EPROBE_DEFER until we show up. These drivers will typically get the cable state directly after getting the extcon, this commit changes the int3496 code to wait for the initial processing of the id-pin to complete before exiting probe() with 0, which will cause devices waiting on the defered probe to get reprobed. This fixes a race where the initial work might still be running while other drivers were already calling extcon_get_state(). Fixes: 2f556bdb9f2e ("extcon: int3496: Add Intel INT3496 ACPI ... driver") Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede Signed-off-by: Chanwoo Choi Signed-off-by: Greg Kroah-Hartman --- drivers/extcon/extcon-intel-int3496.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/extcon/extcon-intel-int3496.c +++ b/drivers/extcon/extcon-intel-int3496.c @@ -153,8 +153,9 @@ static int int3496_probe(struct platform return ret; } - /* queue initial processing of id-pin */ + /* process id-pin so that we start with the right status */ queue_delayed_work(system_wq, &data->work, 0); + flush_delayed_work(&data->work); platform_set_drvdata(pdev, data);