Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7043360ybi; Thu, 13 Jun 2019 08:37:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWPavbppKL0l7kdldlKs+lRlb2834uotUMouArC+rjVjXrR2usvyZJH9TBUjmO6jKGE/ag X-Received: by 2002:a17:902:2006:: with SMTP id n6mr31387730pla.232.1560440232410; Thu, 13 Jun 2019 08:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560440232; cv=none; d=google.com; s=arc-20160816; b=rikXUl+jXCR3OQSZ8L5wO7rz6J/EVwKlwsTD7HlGv3o58mgX3C1UVa1ic5Ivsityzk cpoSIVtMfjTK1RsL51ZqdNhKmLgJwAcuGSRY8QdQv75G6Z2sfpCnDEuYd9EqNp4HB6Vb A7hcGF5LXz4S/HN5fYf7x8wJVOpT85EEI2ewCjJoq9sqkzPr+ZP9m/AD1vBeIR/4iRgr xfa9MGPCDmIblMZ56q4UABx0MlLYdpaVgQQgv+Zn/Po1z5s8pSuxWlGDFpE62oM91sD1 uEmcBM/+Y0Sf2qpOjnAMz9D4TDbLSSrI5gYjZVnWQyb1cnm7QSvEHKuGXGcDj2d/79YK KywA== 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:dkim-signature; bh=aF7WfJBqic6Edz88lRv/0CL+oI9ZSIdnX+8VgBOn3LM=; b=j46MB7tt1Ckb6Ey7HX6RBrOSYJLf9IKKVTysGDeDRX0Twpo4VDZOq/OlQrzenTqfo7 gcYVE1xtg9fENf7CzpWszC6AXqn09C1PklxidfAVsgnP/WpUY4u8NkMiFtsx31ce0Mfm R8rG9YRnalMDA7i5iZ9r/MbIzPP+AbrY8B8WLSPWtdJdMUvLnjmVU5XGxLwOwZpjziWH XpQXipcmRbgbhkf7YKZuQUVT20sjs/tPF5hyD5oY/G+yeDeLNnmaaptLnySEdZJ8LdpJ VtOhW623QBUjbTSrGPJ71lECv7t6EalgCj+Q25pnuqi60IbZNQUlp+lgIM2ERwdP6v0O vCYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YFFG03IL; 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 a13si66015pgl.508.2019.06.13.08.36.56; Thu, 13 Jun 2019 08:37:12 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YFFG03IL; 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 S1727086AbfFMPgG (ORCPT + 99 others); Thu, 13 Jun 2019 11:36:06 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:34691 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731971AbfFMPf2 (ORCPT ); Thu, 13 Jun 2019 11:35:28 -0400 Received: by mail-io1-f68.google.com with SMTP id k8so17886380iot.1; Thu, 13 Jun 2019 08:35:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aF7WfJBqic6Edz88lRv/0CL+oI9ZSIdnX+8VgBOn3LM=; b=YFFG03ILxrBxA6EZc7HJyHTcZQG8lYtS0piFG6RoKFTL9WaRyzxFvfEfAYIJhj/ftv 9ExuTCWv50qCckQUHlJWT2UsUYTEATiFrwqXse8mop93NQaSCaMjFPtYLHL53CS1iBdu FSSVPGtnBTxP4GW8ocS4dqqaF8GUvpBrzW2/4wt80dCCxcvClhxqJh5SbP92pc3pYdQl jlJmooBJcmedVvhBjo+Q5iscUzsWXs4DECS3/+7zXE3IHqrut20IQRp4C0HcFKIYAcT7 4RLMs3kfUprhpOWBGSDxx6PuB5IH+dkxMni5cJQm3aX/POi0LH+cq45V7JYf6aWa4T1L TnxQ== 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=aF7WfJBqic6Edz88lRv/0CL+oI9ZSIdnX+8VgBOn3LM=; b=cwC3Bk0V8cUVTlb5qC7wk5kq7I3t9CVr4PqsCr8WSUiLGBZ/8WL/kMB4qdyIKVzRdH buJk1mKOFiQE6rRZFCCqpaPDj3OvnID4rpzBnr8aQ/WhlTk7rAouXapnq0psqZVA3dI6 s69WzM4VGxKNAnjXKZBOrI3R1QjfFFdzhCc0zyFVrci/GhM0kWzCgai47baHISfAB5hu C2MoXb5GmagXRFwL7t9WkcwxMrVuUFpv5UQmEHS+clEkEOVNTy8fgcl9Hr2EMdKeUR4p F243oO+9HFJzBpmgeIBaowsoc8vsm5TIJb9+YfhiwuEWyw6dqtOsUOTHz4hRwnQ5icaL sNNw== X-Gm-Message-State: APjAAAVljhOXp1qUwGhi/DMT7gFGRuHPtw4DlJ+98KZ/RWtwyTPuT8mk 6uLnARmf8hUPjByjS0T7cC9rr6wVLiMAECQhkNs= X-Received: by 2002:a5d:9047:: with SMTP id v7mr36860549ioq.18.1560440127125; Thu, 13 Jun 2019 08:35:27 -0700 (PDT) MIME-Version: 1.0 References: <20190525181329.18657-1-tiny.windzz@gmail.com> <20190525181329.18657-2-tiny.windzz@gmail.com> <20190527122752.uc7q6zkjti3zag4q@flea> <20190612154325.m6z7xsxlpdq4wkxv@flea> In-Reply-To: <20190612154325.m6z7xsxlpdq4wkxv@flea> From: Frank Lee Date: Thu, 13 Jun 2019 23:35:15 +0800 Message-ID: Subject: Re: [PATCH v3 1/3] thermal: sun8i: add thermal driver for h6 To: Maxime Ripard 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 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 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. In addition, when resuming from suspend, we need to enable the clock, so I think it is necessary to have a clock pointer. Yangtao > > Maxime > > -- > Maxime Ripard, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com