Received: by 10.223.185.116 with SMTP id b49csp4166483wrg; Mon, 26 Feb 2018 12:24:26 -0800 (PST) X-Google-Smtp-Source: AH8x225hRoPKNFy5Z1NyYIh5+zX+HTubrFTNW/aq7CDQxfhrbCQBPsXiBpVDXtFNjQbiZnR0DHJa X-Received: by 10.101.98.85 with SMTP id q21mr9197190pgv.182.1519676666500; Mon, 26 Feb 2018 12:24:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519676666; cv=none; d=google.com; s=arc-20160816; b=NrTxhtws3mUFwlbaNxwpuVcZCSer7Rlyb83ZfW5GGL7p+pnCkQ5hs8G1pj7r4th8N8 0131FMbe7+7ImNI3wAP7y7IdVzUdXIApi6vDPSloDluYoh1B2wjZi/2aCQPhEW5vSzLj kb7TKRpiuSmAaWpCyBPg/hH41ZXnfUYcjYz6zUT6y2EFUSOp6E3odeRa4DnS2bYRpLiC /zmcwFjExgNa8ULQuCOrTdtgNv/O8c1bBNA8+vumAK+Gcv48gbW2bwAvdo1FNXT0tKsS CsbGH3YOF0NcqZccgYrcLnxQlNMA5kl/yUP70pRbpxu18b0Ckuz3qSdRPr3k4fip7p7S ea2w== 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=P7QHFSssHPxeqVi52deINguJ0YTjCj/45elannTq5Ow=; b=sGZ/pMMWwE0t7Y5MwcxsoncnxduJW5aHKgiEKNX+UDWQjXSZGwAN6yLyQY6ttMHCqe U6s9PwU25ZvuhKfV1u7jIThuvGcP9x/Cx/21ItTUJhBfEeo8YqGNS873sH/CKRG/U1Pm Vna1VKbEckg4xWizJX4F93bRuwMf0Ykt+wRh/4NdVJxUXmHPK37oAXNBjywpXhIoZQeH GDgJJKshs4dzq1xhTk+ExZK7qkBAs7XSs6U3dxU5I/FGP+qsgNUEgt8sXRtzyIHXx1iS ji2na4OgJpfmO6o8uF6X60KLtC/qa6LtD2D45F4Tq91wbqzqfa72t+shs7WQHSqHUPfr Xq9g== 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 o5si2345607pfh.390.2018.02.26.12.24.09; Mon, 26 Feb 2018 12:24:26 -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 S1752692AbeBZUXe (ORCPT + 99 others); Mon, 26 Feb 2018 15:23:34 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34832 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbeBZUXc (ORCPT ); Mon, 26 Feb 2018 15:23:32 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1CA5FF1F; Mon, 26 Feb 2018 20:23:31 +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.14 15/54] 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: <20180226202145.139357900@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202144.375869933@linuxfoundation.org> References: <20180226202144.375869933@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.14-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);