Received: by 10.223.185.116 with SMTP id b49csp5165022wrg; Wed, 7 Mar 2018 07:20:40 -0800 (PST) X-Google-Smtp-Source: AG47ELv5BeWgw/RmiJsji3m2v5C7STIM2Xd5tCfqCD/pZpulrv4J/3xfwUuCMLok8GCAJtQPWbJs X-Received: by 10.101.97.207 with SMTP id j15mr18138340pgv.266.1520436040495; Wed, 07 Mar 2018 07:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520436040; cv=none; d=google.com; s=arc-20160816; b=0NVkitNqmg4h0fo7WktRidZFDWbtUcgiWc0kgCcAo1ytXHip+HYGOn+FwLAXMoViMl h3zd1l24FTK0YurscX/eE7+kZrdYO3CfyDl3KCbhuP3s5QCMhC7Gig10AJcz4LNP12RV ei3/h8Z7jRooJOUyKdU1OteOh8kGbLeT8d88Fo0nx2ud7uBmgzWdLyFU+OQsjkwTiKDN KDWRR3sqSQ8dj/Z0ajylJfygF2bmddWvj4nxVy9+knLwBtBCMM20Iqdx05S7AICtMHO8 x5DyYFKEZr7SaF58FF7S1jggdM8+hq4wAhOz/6uXpmHANAXJ/FSmfs6QPfnRSqkCRSP3 eUDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=MzJfl/fWGdbuGiS1YjqPfwf/+019G81fc9iGsiu9Vks=; b=iWaG2SLmlE7Cu5n2td7UYmLBIX5+VcnXKr+oE6ZIR/7R3YwGflbmhL+lhZhtjqfmUk o0CbMP0aW5YU2RR0gXCRQaxk16Y9os+qIi4CgpsswltAW0OE6Yd3LUDDTw41HNoLnQrs Ip+w1Xz5qwPLUEBQ1P2yjcSoXLQVzeBTYIMjfkCSbcyCnmJ2WI+5XI/Pt47WCeF5PzuC SrMPdY6KjMLGAveScUzAryzMoADCMp8KIuZD9JBPgFBJgnhvy/1TBNaFXoqf/naCXoDY uiWXQiaj7QBQPOfSRY7dsEeKCbEUBGrmca55ilO68kZOjQmaC98jeIs0oQYGLeYQHX70 kVcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kwdmTFnP; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si13726277pff.406.2018.03.07.07.20.25; Wed, 07 Mar 2018 07:20:40 -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=@linaro.org header.s=google header.b=kwdmTFnP; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754742AbeCGPSL (ORCPT + 99 others); Wed, 7 Mar 2018 10:18:11 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55999 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933612AbeCGPSG (ORCPT ); Wed, 7 Mar 2018 10:18:06 -0500 Received: by mail-wm0-f67.google.com with SMTP id q83so5490356wme.5 for ; Wed, 07 Mar 2018 07:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=MzJfl/fWGdbuGiS1YjqPfwf/+019G81fc9iGsiu9Vks=; b=kwdmTFnPMNcH57NZCy1kcOfjXjP+pCvuxXQLeuXrR5IAblCpInBZW6BmZgF9Z2Y4w0 G1j9cBtW+Yc9htscswOK4e5JAKu57txb4jI6GBmnXm13vudTKF95hdSaPc8PQm6/Yt9B rncOQwKlxrmXIVdCIepdQBb8wNnmaWM78PQ1w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=MzJfl/fWGdbuGiS1YjqPfwf/+019G81fc9iGsiu9Vks=; b=BToYafRAlA5V/TKrZu9dwxX9lrIUsYQcVefFc7S1QT45SjrspF9n7/44KKho7MgsYJ OwrJEXUBF+VXkhUnICBlPMoHUQaXPz2aZRK9DMzgfK51GivFMQ7znPGxkZSRngMXqwjr LdZC73Z6yGoNPKDhfzJHZTObbgOrLLrEg+69a8SMaCH9ypMOjP4OTFLOBZ10AmOXxgPc BrzPXBejmxrWg9mYFxHSuctAZSw5PZzJFvyjx7aBcgZDL+5X5hT+fiBp6HGrAPhRSQVc 3+a1BbRaJtJuVwjbT/YPc2uT3JwQPrb3zM895Bbk9+HhYToO+n+PJdXtZF9dukix7Vd0 JDZQ== X-Gm-Message-State: AElRT7F0X4gtLyaROCLQ/W5qwxR3oy8SsAJ24mwIh0cAvdjSYJdL6qJy 3xxOKio6ujKtwf/upjVFocSoTg== X-Received: by 10.28.45.9 with SMTP id t9mr14205681wmt.20.1520435885387; Wed, 07 Mar 2018 07:18:05 -0800 (PST) Received: from dell ([2.27.35.218]) by smtp.gmail.com with ESMTPSA id c78sm11734533wmd.45.2018.03.07.07.18.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Mar 2018 07:18:04 -0800 (PST) Date: Wed, 7 Mar 2018 15:18:02 +0000 From: Lee Jones To: Enric Balletbo Serra Cc: Vincent Palatin , Enric Balletbo i Serra , Guenter Roeck , Gwendal Grignou , Benson Leung , LKML , kernel@collabora.com Subject: Re: [PATCH 2/6] mfd: cros_ec: free IRQ automatically Message-ID: <20180307151802.lzibybov4qth6ksp@dell> References: <20180219224043.21383-1-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Feb 2018, Enric Balletbo Serra wrote: > 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. Hmm... rather than mess around any further with this set, would you be kind enough to pull all of the patches back into a single set and send them out threaded with a cover-letter please? I'm also going to un-apply 1/6 for completeness. -- Lee Jones Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog