Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4581462pxj; Wed, 12 May 2021 08:37:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIofEudWClwSybgmxGoBTLaPAzeJ1i9Om2DEERhy9ClW6iG1qv5w2C0txgh5iBCvItd3Rl X-Received: by 2002:a05:6402:3104:: with SMTP id dc4mr43116524edb.144.1620833852969; Wed, 12 May 2021 08:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620833852; cv=none; d=google.com; s=arc-20160816; b=NydBq6fVZe731Z6gkufOBAPj7YOeT4Z+ecKAu8t5MVYGySCd0rG/Sf0WDTubqCEt2i qnpSXLVksK3ODRVqyeVx9A1xAdWiGwZF9ogV1BzWgvAkBj9RYKNmNfqqOH9YbVGIzVTQ LP4m2hLmFOzDumC8ai3M1HKXdQQ9VPu2Xu/qcjU90pZ2y9y8JKCVYQnyxug1kOM6Qi1L QsuE9mL5vK+YzIIA/fAi5Ke0ECtCaV4wMEJMq3cr4faIrZQe42IJZu6qlIIQ1+x/Kgmt lm1IzbOrvXDJ5cG9TT1cvlHbSpBke0AhhODApU9cEMQedgHRfF0lzwHBCxqdmTf4eyfr FPFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Lv+suUJj3fgVX23QNPemZI04lq1nSDgRhBqafQPYktw=; b=moUFIPSQe6f031MmtTCJ0dV0J3gcR4kJ3j+jsSJEAA5ZQkA7twKQfzFH02UZTc99dQ YZr0xiwXWf96LULtVrlaFZxZR3g2Btnqr8Ri7R+1TJpemPKjO4is91EwKNAw5Ust8WJF qNujzmEfmDJ5fdA979BLG78k8t3R3LN0ECAnO0jnQAPZ8dYPwplx5wfI+y1EdkFlQHYN ssU6ar8HvNRJj4K76CTZk+jST86IEs57HEt+uDDuIpr7ZIQh5tc5ZTl5YZeEB3U7kcEd NlIPx3kakzfFUt3YMtYTyrs/huwgc6iWLBFRfMLBFrerXB9ggN7jGzT0EN+wFEqdFByM NeUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lkkeVkhY; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si267529ejj.296.2021.05.12.08.36.59; Wed, 12 May 2021 08:37:32 -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=@linuxfoundation.org header.s=korg header.b=lkkeVkhY; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234682AbhELPeL (ORCPT + 99 others); Wed, 12 May 2021 11:34:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:47650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234061AbhELPQA (ORCPT ); Wed, 12 May 2021 11:16:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5C4CC61981; Wed, 12 May 2021 15:05:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831927; bh=9m/TwkgxOlj5FNTpbQ7MuMQxwO46mEjF4yQitXn0H+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lkkeVkhYr5mKMcjPv3rtITsH5qxZYegRTCNRmiwoIvGV2dm/PYpUf6eocgzBcF+yU 7EE4TVt6nBPsit+rs8KkoDWWLNnZl0f9dXc1P8y3GvWRXg+fS69oDH2hcHDAwQ3Q5U Xs+qtHVxvVTwwyRGz/9pk/mX5AlK2AerCVaV104U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Annaliese McDermond Subject: [PATCH 5.10 037/530] sc16is7xx: Defer probe if device read fails Date: Wed, 12 May 2021 16:42:27 +0200 Message-Id: <20210512144820.964273287@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Annaliese McDermond commit 158e800e0fde91014812f5cdfb92ce812e3a33b4 upstream. A test was added to the probe function to ensure the device was actually connected and working before successfully completing a probe. If the device was actually there, but the I2C bus was not ready yet for whatever reason, the probe fails permanently. Change the probe so that we defer the probe on a regmap read failure so that we try the probe again when the dependent drivers are potentially loaded. This should not affect the case where the device truly isn't present because the probe will never successfully complete. Fixes: 2aa916e67db3 ("sc16is7xx: Read the LSR register for basic device presence check") Cc: stable@vger.kernel.org Signed-off-by: Annaliese McDermond Link: https://lore.kernel.org/r/010101787f9c3fd8-c1815c00-2d6b-4c85-a96a-a13e68597fda-000000@us-west-2.amazonses.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sc16is7xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1196,7 +1196,7 @@ static int sc16is7xx_probe(struct device ret = regmap_read(regmap, SC16IS7XX_LSR_REG << SC16IS7XX_REG_SHIFT, &val); if (ret < 0) - return ret; + return -EPROBE_DEFER; /* Alloc port structure */ s = devm_kzalloc(dev, struct_size(s, p, devtype->nr_uart), GFP_KERNEL);