Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3190780imd; Mon, 29 Oct 2018 03:16:47 -0700 (PDT) X-Google-Smtp-Source: AJdET5dYKI/Yk5DBSdO7+sibrBNgWCEA0kHikwZ3R5tlHuUW8SjOrcOIDc5BbtIewwH8M6phTz4l X-Received: by 2002:a63:7418:: with SMTP id p24mr13418515pgc.196.1540808207399; Mon, 29 Oct 2018 03:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540808207; cv=none; d=google.com; s=arc-20160816; b=Bvp8gs52obC8gNTUwSewGq5r6hHwqzZdN/SvTq95ow8vB4PwL/nfJN71JY5eHAe1HA 7yGqdFvTBDWLdHue0jvfDaosnJxepAin9w0NhJ8PYwF4mPGdgAQTdwCx81aquQVPTHY9 8IZV5E1ZqObm0WkCB5GRiwugKvdyav0iD1EisjOKCOnK9NdCBUVADvh77IEV1Mbee3ve owGAgfoxyj/2ncMOArCbnemvRu6yui+XAfEI+ZgGRsgahidNrCDsU7VN/SHE/cWBO1Au 1rGDffW/fNic0Q50KO0k6MLaqcW7j4Co1l+9b3aWP8V9qTFF4XDx8xEvdk77e4Sra5n8 cQGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=wrptKfDyU25gGei8hDekoqMLYF7ix+QkUL+h8ja2Erg=; b=CZO6fIz3bjnyKa2F1dITfz9SvA1zy8CBhW+mKRy+ZAN8doZsWH2Q6tOXeGZ/oVpQHM 1b2jeTNhKLNxiPb1im9Xbp1gRpNnUgHvUwsQkQk8pcRw0Vvyd+0/o+C1TozT1H19en7D jlOLXKFv4AmH33Ebfqc7LGcdEPLB57Q04HCmWy16hv5QgcDmwpqbwa/z3ToM1eiDHish dojQ8dluF9Bka7lxbwqgGvUFGJ//kecY5TC3hZmpPKlMSW/ZtmqySX+yxTQtMk4boB84 pddBIXD8OsvEVEjIOgZkO0JRUsbA8aQ9RQSs9+jJEKI5LGmZ10RspPYrl3Hr3t+GvJYx pZZw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12-v6si19273946pls.367.2018.10.29.03.16.31; Mon, 29 Oct 2018 03:16:47 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729871AbeJ2TEA (ORCPT + 99 others); Mon, 29 Oct 2018 15:04:00 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:32888 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729613AbeJ2TEA (ORCPT ); Mon, 29 Oct 2018 15:04:00 -0400 Received: by mail-qt1-f194.google.com with SMTP id i15-v6so8510354qtr.0 for ; Mon, 29 Oct 2018 03:15:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wrptKfDyU25gGei8hDekoqMLYF7ix+QkUL+h8ja2Erg=; b=lXfKkiOox9xsiOOhnEVk+PRRxhfiBGjScz2hFCQdD3Wq+4k+hf3efb8GsFIy01v6BT mk1eEeUxibMdPAK36KmyAn803BaDNs/iosOa1+N9D55iX+Zqrly7VuhtOzEtNuZ11okO pZRIKWqgmAo1SnDs+dPsszMX6R6sJr40QgXIr0cyRWHiJGiCeuRVrxJuPXPbqE8huiLJ yyJFOsqfiHvJHsoB8H+dNpfE8Z8ojDvv3ewvbmrkaKjhjuFa9kALQ6Jlaw6vbe/KUh3g hGm9JMP/mylR1U/2jZWZEpz6A0eEwj3Epmn7qFmcufEekGxN2Yck5QUTQRO5Z60GOm69 1XzQ== X-Gm-Message-State: AGRZ1gJ6+MMTw62ii11wAB5WlgGYQCj05VdYlUhmtMYdCzL6JKup3VsY 0TEegZTwBI3YQJpabshaIgLREszoxiXaSpbjz+5n8Rwj X-Received: by 2002:a0c:9927:: with SMTP id h36mr1056341qvd.171.1540808158833; Mon, 29 Oct 2018 03:15:58 -0700 (PDT) MIME-Version: 1.0 References: <20181019085958.32694-1-ckeepax@opensource.cirrus.com> <20181019085958.32694-2-ckeepax@opensource.cirrus.com> <20181028223116.GJ1882@kunai> In-Reply-To: <20181028223116.GJ1882@kunai> From: Benjamin Tissoires Date: Mon, 29 Oct 2018 11:15:47 +0100 Message-ID: Subject: Re: [PATCH 2/2] i2c: Clear client->irq in i2c_device_remove To: Wolfram Sang Cc: ckeepax@opensource.cirrus.com, Linux I2C , lkml , patches@opensource.cirrus.com 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 On Sun, Oct 28, 2018 at 11:31 PM Wolfram Sang wrote: > > On Fri, Oct 19, 2018 at 09:59:58AM +0100, Charles Keepax wrote: > > 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 > > Adding Benjamin here again. Also, should there be a Fixes: tag? Not sure if the circumstances are preventing me to think straight, but how can you reprobe the i2c_device? And in all cases, for the Host notify part, having the IRQ already set shouldn't be an issue. So for the host notify case, this patch is fine, not entirely sure about the acpi or OF part of it. Cheers, Benjamin > > > --- > > 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 > >