Received: by 10.223.185.116 with SMTP id b49csp392978wrg; Tue, 20 Feb 2018 00:53:22 -0800 (PST) X-Google-Smtp-Source: AH8x226pcI5eaj7CCGRjWHAJ/M51rxpVw+wpvEQiuwQ4mAFRGC8uBUhPdwpYxa0R6/KEdagRIukm X-Received: by 2002:a17:902:7d17:: with SMTP id z23-v6mr16642423pll.427.1519116802244; Tue, 20 Feb 2018 00:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519116802; cv=none; d=google.com; s=arc-20160816; b=JhzupnlD97bontGt1IQLzUG5/PwB7GS11iUK2ToMG/bIRlGZ6MuiF/cL5pm7BKpaw4 9r3uiZsFqXLz8C7y3XauV/QvXdhA0xfNMY67j485bLRVlZue6FjZgnfv1zU6IzJsbPVM kManITwLn6q/0A6y1kMqFwnTCRUQ9ncd+wn3wZDL+Vc8GPc1Cq4koO0U4pFVpkDrRumn Zqb58Qr5SlRHTx5WdQ2VI3oTqQVsiXdvAFHhI7Hg1PeQfHbGNio3buhhtxdkqUIF0hws UWdv2xgZzddOcI99pEO6Y3xDggxN0sgkkCyIdqs8AMx7nH7xuv/NmRu8t8HvUN88e63n tDQA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=GniATcjqQ9PklHSH2rT13lmcdccA2KeTIBpfUIwzwK0=; b=SKEZWtm8de9DR6FYpAZG79YEXRanMb9JLz5feO2ekphFRQfStT4+pKYXqV5oKHTHJt /j6XuPpv5UFEhHL5F6mq8NBJadA+qZWUsmvY5SYOn+FiaT6rYdZM1uZIE1NE0M+Js6X1 nz7Bk502fz2K7EfoUaF7x6gIblPFJ1KJGtwLp+5pFyGrbaXj3evAL1zran4O/0EVSqJI JKqKoKGXYBenKSH1GRJxEoiG6LQ33LBqLwVqv+veqY22NuY18nRH4NEl9ZIz7F4nCVsb oSNjmsKPAQ29THdhzm6wykY9dKBtIAaAMOI+bm4Kq7ykMpQPNTrXgDqytI0tQouFyBiR XQZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sZi678J8; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si4168811pgt.344.2018.02.20.00.53.06; Tue, 20 Feb 2018 00:53:22 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sZi678J8; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751324AbeBTIwZ (ORCPT + 99 others); Tue, 20 Feb 2018 03:52:25 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:45144 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703AbeBTIwY (ORCPT ); Tue, 20 Feb 2018 03:52:24 -0500 Received: by mail-qk0-f194.google.com with SMTP id g2so15449304qkd.12 for ; Tue, 20 Feb 2018 00:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GniATcjqQ9PklHSH2rT13lmcdccA2KeTIBpfUIwzwK0=; b=sZi678J8L1UrliSvB59VS0DPcS+u614m6kW409EY3OocysKbmVxiT6G5lywH1H2Pnk 7eT1JTNkzkrH5JVZRULPam9TXa6NDpAz00hDoxpyrjjjtcwR278Lu2c3+2TsbGvybkPW zfjl/CngxrHJgEWQIi4hcWSibYmhGe2ZM5kSK/rms/JVux4Du5V5XGykAuvhWKrfU9S+ jOexLRxRbBWyQJ7nLjFBMOXeIiwrQpr2A2iQLB0b75s0HyY4fMl5VbAM2WsZ5KZeyCWm fO6l4Fbe5dBSfsUdqaVSNt5PO0FaAD6vNo69K3Y6gBoRyeg6kaHAj5O3i9YxaWbbQ63D OZBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GniATcjqQ9PklHSH2rT13lmcdccA2KeTIBpfUIwzwK0=; b=kn1+k4A8hpCBskXIx2w6pk7mmoPmeD8V6B/KDiH6opV3lb3kofqdTllao7Q7+B4oTk +P9bAzFLreq+NHI6S1x7ajm29uFHRKrLKQVnDMAvHqRJPeSRoYt4bwpl3HvSwtGMDdNb Hh4LnFde7flTfkMjZehPR3yG4ZglA/jlpQU5jBzpeIw5NULi2boq4cBggLy9NVbUmUeL PTsNcsPJvN9Z+ARFxSlunbX1C4LQHF6FDIQ1aQbewcS26Mc5Sj6o94QoR9Rtf1ACjSP2 lvpnV1r7OlqZ20OJ4XXnLq/aa89IuXp8MEDClD8siZVkRVga+p76t8DAi0McmU/X4KmF jxvA== X-Gm-Message-State: APf1xPCsGonQsA9WnVsH8/QxBuJ2mv3cAsm2PvjRefDtfxI6yIpmn8JD OSgs8KRF7rvO12FbkwEDR2appggjodbDEITCx2w= X-Received: by 10.55.159.3 with SMTP id i3mr20541626qke.125.1519116743434; Tue, 20 Feb 2018 00:52:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.45.70 with HTTP; Tue, 20 Feb 2018 00:52:22 -0800 (PST) In-Reply-To: References: <20180219224043.21383-1-enric.balletbo@collabora.com> From: Enric Balletbo Serra Date: Tue, 20 Feb 2018 09:52:22 +0100 Message-ID: Subject: Re: [PATCH 2/6] mfd: cros_ec: free IRQ automatically To: Vincent Palatin Cc: Enric Balletbo i Serra , Lee Jones , Guenter Roeck , Gwendal Grignou , Benson Leung , LKML , kernel@collabora.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 Hi Vincent, 2018-02-20 9:00 GMT+01:00 Vincent Palatin : > On Mon, Feb 19, 2018 at 11:40 PM, Enric Balletbo i Serra > wrote: >> From: Vincent Palatin >> >> Free the IRQ we might have requested when removing the cros_ec device, >> so we can unload and reload the driver properly. >> >> Signed-off-by: Vincent Palatin >> Signed-off-by: Enric Balletbo i Serra >> --- >> drivers/mfd/cros_ec.c | 17 ++++++----------- >> 1 file changed, 6 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c >> index 74780f2964a1..d1a4fbee9380 100644 >> --- a/drivers/mfd/cros_ec.c >> +++ b/drivers/mfd/cros_ec.c >> @@ -119,9 +119,9 @@ int cros_ec_register(struct cros_ec_device *ec_dev) >> } >> >> if (ec_dev->irq) { >> - err = request_threaded_irq(ec_dev->irq, NULL, ec_irq_thread, >> - IRQF_TRIGGER_LOW | IRQF_ONESHOT, >> - "chromeos-ec", ec_dev); >> + err = devm_request_threaded_irq(dev, ec_dev->irq, NULL, >> + ec_irq_thread, IRQF_TRIGGER_LOW | IRQF_ONESHOT, >> + "chromeos-ec", ec_dev); >> if (err) { >> dev_err(dev, "Failed to request IRQ %d: %d", >> ec_dev->irq, err); >> @@ -135,7 +135,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) >> dev_err(dev, >> "Failed to register Embedded Controller subdevice %d\n", >> err); >> - goto fail_mfd; >> + return err; >> } >> >> if (ec_dev->max_passthru) { >> @@ -153,7 +153,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) >> dev_err(dev, >> "Failed to register Power Delivery subdevice %d\n", >> err); >> - goto fail_mfd; >> + return err; >> } >> } >> >> @@ -162,7 +162,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) >> if (err) { >> mfd_remove_devices(dev); >> dev_err(dev, "Failed to register sub-devices\n"); >> - goto fail_mfd; >> + return err; >> } >> } >> >> @@ -180,11 +180,6 @@ int cros_ec_register(struct cros_ec_device *ec_dev) >> cros_ec_acpi_install_gpe_handler(dev); >> >> return 0; >> - >> -fail_mfd: >> - if (ec_dev->irq) >> - free_irq(ec_dev->irq, ec_dev); >> - return err; >> } >> EXPORT_SYMBOL(cros_ec_register); > > > You need to remove the "free_irq(ec_dev->irq, ec_dev);" in cros_ec_remove() too. > as done there: > https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/866858/15/drivers/mfd/cros_ec.c > > it was missing originally but was added by: 'f58b14e6632a mfd: > cros_ec: Free IRQ on exit' > Many thanks to catch this. I'll wait a bit more for if I receive more feedback on the other patches and send a second version of this patchset. Regards, Enric > >> >> -- >> 2.16.1 >>