Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp663643ybi; Fri, 14 Jun 2019 01:03:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMdb0Tqfuh2pgE0xPGYfnDvZylzGA2/p3a+lvx2bIdkp4n4l/0jQdwEga9N5Jk5KLz1aoV X-Received: by 2002:a17:90a:a407:: with SMTP id y7mr9753112pjp.97.1560499416014; Fri, 14 Jun 2019 01:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560499416; cv=none; d=google.com; s=arc-20160816; b=rscl2fo4j+QdAxg6z6C/9AgKQJ6xTT4349bYBsaQOpQl9h1Vy7yeztsPsbguab866j nlFE14jarysfaI7UT2fHfZfmyU3sHb3iT9R5z4iCfEzfL2unlLIQmF8xAL8bUNrNmKRO qka2UJ4vSXmchBbbuuw9xlqkca+r/7uzzXiUSt744Vx57M8eDqH+7gB03ELRJ8+iDQZL PEIbN9iWX2jc89QK26jzJPExK+Zg3tbDYD011yKhuBjm70FTxvERFEwaDQDyYilQCJnC Xd7zbKclWn3TBh5G+jtenC/IjAMJKJvXamjP+Ky6d7R0DODgADFyTZDTkL6hRTI/vS47 qGRQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ny6GwMqVLsw4DvhC1kVJu1I3awZF8x0ppTjC52Nw+P8=; b=oo78GClryraGOkk2EYWBvyj3XroW9ft3bRKyel558slQJGJbUk+7WALgAlHYjvr90r LKjQBZ0VvJx3m/5wVL1alzvg79Nx8575D7a/UyZXOeT8d9Qwx8PTCW8jXcfeFYpcniLC 8oPxwTa4fAUeSUmcF5PVTE+H8q008npIOEy8cRGZnA7IJXa+qBLXWzPZnVdkDq4RGYvO HuQGc0aBjhndu9ScA1YcY02k+WnvG2fNHj7cbQep3suAGXsEZVBAUCcixHJY1BjNr7uq 0yyJw7vHMnHhhUs0COr9s3HpUq+0A8boPoEbmhMqpiJCUWWMpNil3AKcEulEQMcelQ1M HRvA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si1834692pga.131.2019.06.14.01.03.18; Fri, 14 Jun 2019 01:03:35 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726218AbfFNICK (ORCPT + 99 others); Fri, 14 Jun 2019 04:02:10 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:46167 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbfFNICK (ORCPT ); Fri, 14 Jun 2019 04:02:10 -0400 X-Originating-IP: 90.88.23.150 Received: from localhost (aaubervilliers-681-1-81-150.w90-88.abo.wanadoo.fr [90.88.23.150]) (Authenticated sender: maxime.ripard@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 33ACCE000E; Fri, 14 Jun 2019 08:02:01 +0000 (UTC) Date: Fri, 14 Jun 2019 10:02:00 +0200 From: Maxime Ripard To: Frank Lee Cc: rui.zhang@intel.com, Eduardo Valentin , Daniel Lezcano , Rob Herring , Mark Rutland , Chen-Yu Tsai , David Miller , Mauro Carvalho Chehab , Greg Kroah-Hartman , Linus Walleij , Nicolas Ferre , paulmck@linux.ibm.com, Linux PM , devicetree , Linux ARM , Linux Kernel Mailing List Subject: Re: [PATCH v3 1/3] thermal: sun8i: add thermal driver for h6 Message-ID: <20190614080200.fc3mah5q3mmihxa5@flea> References: <20190525181329.18657-1-tiny.windzz@gmail.com> <20190525181329.18657-2-tiny.windzz@gmail.com> <20190527122752.uc7q6zkjti3zag4q@flea> <20190612154325.m6z7xsxlpdq4wkxv@flea> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dxk6xy5el3dsgg5j" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --dxk6xy5el3dsgg5j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Thu, Jun 13, 2019 at 11:35:15PM +0800, Frank Lee wrote: > On Thu, Jun 13, 2019 at 9:26 PM Maxime Ripard wrote: > > > > On Fri, Jun 07, 2019 at 09:34:44PM +0800, Frank Lee wrote: > > > On Mon, May 27, 2019 at 8:27 PM Maxime Ripard wrote: > > > > > + ret = devm_request_threaded_irq(dev, irq, NULL, > > > > > + tmdev->chip->irq_thread, > > > > > + IRQF_ONESHOT, "ths", tmdev); > > > > > + if (ret) > > > > > + return ret; > > > > > > > > Is there any particular reason to use a threaded interrupt? > > > > > > Just to improve real-time. > > > > What do you mean by real-time here? If anything, that will increase > > the latency of the interrupts here. > > > > And in preempt-rt, regular top-half interrupts will be forced into a > > threaded interrupt anyway. > > > > > > > +static int sun8i_ths_remove(struct platform_device *pdev) > > > > > +{ > > > > > + struct ths_device *tmdev = platform_get_drvdata(pdev); > > > > > + > > > > > + clk_disable_unprepare(tmdev->bus_clk); > > > > > > > > I know that we discussed that already, but I'm not sure why you switch > > > > back to a regular call to regmap_init_mmio, while regmap_init_mmio_clk > > > > will take care of enabling and disabling the bus clock for you? > > > > > > It seems that regmap_init_mmio_clk just get clk and prepare clk > > > but no enable. > > > > At init time, yes. But it will enable it only when you access the > > registers, which is what you want anyway. > > But after accessing the register, it turns the clock off, which > affects the ad conversion and the occurrence of the interrupt. Ah, so that's how it works. Yeah, it makes sense then. > In addition, when resuming from suspend, we need to enable > the clock, so I think it is necessary to have a clock pointer. Yep, indeed. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --dxk6xy5el3dsgg5j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXQNUbwAKCRDj7w1vZxhR xTHXAQDbQy0XDEjBIuIG+GZONRc1Ot+viplVAkNIuNN7+kFqRQD/VS0rr3UB9Kuc LhxMlX6QWweIU+7DDpUsc+GtkieIvAY= =PMaQ -----END PGP SIGNATURE----- --dxk6xy5el3dsgg5j--