Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2927445imm; Fri, 19 Oct 2018 02:01:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Dj+Flj5GOMChNBtUXi4pTRcz3d7PilExd40syU4PRJfVAgslqrJ5SCVyH7SGD0mBhz/mR X-Received: by 2002:a63:5747:: with SMTP id h7-v6mr31894473pgm.423.1539939666850; Fri, 19 Oct 2018 02:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539939666; cv=none; d=google.com; s=arc-20160816; b=rTKPBLlkAT4v8PzHyFRQvh2YaNnOO35X4AAf3ZSc62b8FJuSkeD/a9YBAbiDhCgTkM xfci9H9H0oPQzp4SGfBJDdH9HgBMeAuxngBZx8tOLTV0nQfWRh/n4ZkORzJBh9vPmBoL AZeDFa3ii1yb8j/4Ct9q4G3Yno6BiHZI/4f8VTBb9C2pfmYy1KRiE7jyh9ojhZZiZIFQ Pr6mPBoZLxE30THTrMdfh/r2vomEo6yk99EdIXnVXU+Rg0bdR+7JGzEovzYqxU89ZV9H xN31h56JE/nLohQuaSoGJjvxUZHGRz9NrptiNyXo4nS58USfA6GcUMWKt0mFcLy50gdT t9Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=YMI9msDTtLIVIcksoFH2H/JbHD5f0MZn/HZlpmN37ow=; b=RGGA2UnZtPijO7k+zDVsPg/9muKkGiDX/NyKQg8XfzS7TkH5nf4M+LHgVrASyGwoi6 3fVJT/rHubbtImUWx/Rq7OgevVoDNyDVldGJw99OHTNb3k7/ssxs4qBfZAcNccTV0tlD qO9WOnHhVnrPh9jsbf5quFFseYWPURgESNK9n0agn3UCSGs5y8BzntYYQAQR+PeXiBnj jS6nxUx8Py3AaDI4w58Mw0t7UTNrW7r4LHu5fSVIV9diGdf0KD4Hjdc9kYe+u1neW9Q0 EtJa9ju4UYnMRMagdxxKPKWpMDt1/KHEVDAhDZsWvembw3Wy1o+88FSiIv4fcy9hRhiQ Iwxw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si22936749plt.4.2018.10.19.02.00.50; Fri, 19 Oct 2018 02:01:06 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727343AbeJSRFN (ORCPT + 99 others); Fri, 19 Oct 2018 13:05:13 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:56062 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726653AbeJSRFM (ORCPT ); Fri, 19 Oct 2018 13:05:12 -0400 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.23/8.16.0.23) with SMTP id w9J8x777014581; Fri, 19 Oct 2018 03:59:59 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail3.cirrus.com ([87.246.76.56]) by mx0b-001ae601.pphosted.com with ESMTP id 2n3es40ju7-1; Fri, 19 Oct 2018 03:59:59 -0500 Received: from EX17.ad.cirrus.com (ex17.ad.cirrus.com [172.20.9.81]) by mail3.cirrus.com (Postfix) with ESMTP id 06979611C8A7; Fri, 19 Oct 2018 04:02:18 -0500 (CDT) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Fri, 19 Oct 2018 09:59:58 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id w9J8xwPn031397; Fri, 19 Oct 2018 09:59:58 +0100 From: Charles Keepax To: CC: , , Subject: [PATCH 2/2] i2c: Clear client->irq in i2c_device_remove Date: Fri, 19 Oct 2018 09:59:58 +0100 Message-ID: <20181019085958.32694-2-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181019085958.32694-1-ckeepax@opensource.cirrus.com> References: <20181019085958.32694-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=691 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810190082 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The IRQ will be mapped in i2c_device_probe only if client->irq is zero and i2c_device_remove does not clear this. When rebinding an I2C device, whos IRQ provider has also been rebound this means that an IRQ mapping will never be created, causing the I2C device to fail to acquire its IRQ. Fix this issue by clearing client->irq in i2c_device_remove, forcing i2c_device_probe to lookup the mapping again. Signed-off-by: Charles Keepax --- drivers/i2c/i2c-core-base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 656f0a6fe3adf..28460f6a60cc1 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -430,6 +430,8 @@ static int i2c_device_remove(struct device *dev) dev_pm_clear_wake_irq(&client->dev); device_init_wakeup(&client->dev, false); + client->irq = 0; + return status; } -- 2.11.0