[{"id":1790294,"web_url":"http://patchwork.ozlabs.org/comment/1790294/","msgid":"<20171019092919.GA7252@Asurada>","list_archive_url":null,"date":"2017-10-19T09:29:20","subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","submitter":{"id":36301,"url":"http://patchwork.ozlabs.org/api/people/36301/","name":"Nicolin Chen","email":"nicoleotsuka@gmail.com"},"content":"On Fri, Sep 15, 2017 at 12:10:13PM -0700, Nicolin Chen wrote:\n> Below is the call trace of tegra210_init_pllu() function:\n>   start_kernel()\n>   -> time_init()\n>   --> of_clk_init()\n>   ---> tegra210_clock_init()\n>   ----> tegra210_pll_init()\n>   -----> tegra210_init_pllu()\n> \n> Because the preemption is disabled in the start_kernel before calling\n> time_init, tegra210_init_pllu is actually in an atomic context while\n> it includes a readl_relaxed_poll_timeout that might sleep.\n> \n> So this patch just changes this readl_relaxed_poll_timeout() to its\n> atomic version.\n> \n> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>\n> Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>\n\nThierry, can you also take a look at this one? I sent a month ago. Thanks.\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-tegra\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-tegra-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-tegra-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"hIu7sXmv\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yHkDY090Mz9t42\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 19 Oct 2017 20:30:20 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752237AbdJSJ3y (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 19 Oct 2017 05:29:54 -0400","from mail-pg0-f65.google.com ([74.125.83.65]:56645 \"EHLO\n\tmail-pg0-f65.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751348AbdJSJ3v (ORCPT\n\t<rfc822;linux-tegra@vger.kernel.org>);\n\tThu, 19 Oct 2017 05:29:51 -0400","by mail-pg0-f65.google.com with SMTP id m18so6704036pgd.13;\n\tThu, 19 Oct 2017 02:29:51 -0700 (PDT)","from Asurada (c-73-231-2-134.hsd1.ca.comcast.net. [73.231.2.134])\n\tby smtp.gmail.com with ESMTPSA id\n\tx27sm28456863pfe.172.2017.10.19.02.29.49\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 19 Oct 2017 02:29:50 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=9d/ka6qI6iTUyXDGPZjdhl+7NzbnR4qqxb3XPwRB5k0=;\n\tb=hIu7sXmvyrTuvb1RC4N7EiQXGsoFHJt0ZUfHUOb0/yrALUCkqM50s70uNUriPsw71B\n\tBR3f9WQnFmjsrQHTFBZtXV9P22TcsbtEIEl7Q0lR4R+rB+al/3pGw1mIhpnasTqhc1KD\n\tdptYY/9Juo7HRVvRkbeUesU+bjLsxaGB9oERsWfL4syKTosh00ko2Rlo/y3+znKv41zI\n\tUZt6dw9MKgPR/nX5ZWQKeQ3uYwGHddX1a+kzocPLKvUuomUT64/Fjbqb2I8x7d/pBbT4\n\tSrkLrlTGmsjewgA4+op5um+IsQQWciCfIkhfDUCO3jiXf1tMFIjuPEHWVTyA9Ctk6MXD\n\tUdng==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=9d/ka6qI6iTUyXDGPZjdhl+7NzbnR4qqxb3XPwRB5k0=;\n\tb=i/7kjeDi0alh8YTPSKuywnF3LrYBgdCZ6Ui0M5l3E/onDJtxGhwplLbV8zmbmIBsF/\n\tkmUAUpZdkNPCAalO3E3XEybNdTaNL2epQUc3or63c30B2rVDpS2RHLnxPyF8TLppLoEa\n\tcBQp0hHIXw0m3VeisLgpKwa6i3scLcUFlHObpLQsCeUlcOgbHtRZBPdEJ17w7ADT0/Ky\n\tWpO5Qxkeh0Uwe2+zYnakRcGFsi4miLI1Uybab+GbXN7r8TJsvi2JoE0Gbgv2hu0CFvuH\n\toRFZPd7FtAfw9y48hTFudHzrdFX1X3fKYBicIW6lZTQgGGiS18ZPgBgv/hQn2qJxvEGR\n\tQkuw==","X-Gm-Message-State":"AMCzsaVqyu4X8HAFCIFrUwpmE59NuBzEG/78iE/jKlKvGGYMVEm5PYPx\n\tFZS5l3bEs8jPltDc85wir34=","X-Google-Smtp-Source":"ABhQp+Rb5APAxPDKfDibJmydmcemJ/EAxDdQvdltNchZKW2aD38zDc+0vp+0WBZPJ4QUGQapa/Kpuw==","X-Received":"by 10.98.150.149 with SMTP id s21mr912034pfk.151.1508405390997; \n\tThu, 19 Oct 2017 02:29:50 -0700 (PDT)","Date":"Thu, 19 Oct 2017 02:29:20 -0700","From":"Nicolin Chen <nicoleotsuka@gmail.com>","To":"thierry.reding@gmail.com, sboyd@codeaurora.org, pdeschrijver@nvidia.com","Cc":"linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,\n\tlinux-clk@vger.kernel.org, jonathanh@nvidia.com,\n\tmturquette@baylibre.com, pgaikwad@nvidia.com","Subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","Message-ID":"<20171019092919.GA7252@Asurada>","References":"<1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com>","User-Agent":"Mutt/1.5.22 (2013-10-16)","Sender":"linux-tegra-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-tegra.vger.kernel.org>","X-Mailing-List":"linux-tegra@vger.kernel.org"}},{"id":1790315,"web_url":"http://patchwork.ozlabs.org/comment/1790315/","msgid":"<20171019094422.GI9005@ulmo>","list_archive_url":null,"date":"2017-10-19T09:44:22","subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","submitter":{"id":26234,"url":"http://patchwork.ozlabs.org/api/people/26234/","name":"Thierry Reding","email":"thierry.reding@gmail.com"},"content":"On Thu, Oct 19, 2017 at 02:29:20AM -0700, Nicolin Chen wrote:\n> On Fri, Sep 15, 2017 at 12:10:13PM -0700, Nicolin Chen wrote:\n> > Below is the call trace of tegra210_init_pllu() function:\n> >   start_kernel()\n> >   -> time_init()\n> >   --> of_clk_init()\n> >   ---> tegra210_clock_init()\n> >   ----> tegra210_pll_init()\n> >   -----> tegra210_init_pllu()\n> > \n> > Because the preemption is disabled in the start_kernel before calling\n> > time_init, tegra210_init_pllu is actually in an atomic context while\n> > it includes a readl_relaxed_poll_timeout that might sleep.\n> > \n> > So this patch just changes this readl_relaxed_poll_timeout() to its\n> > atomic version.\n> > \n> > Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>\n> > Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>\n> \n> Thierry, can you also take a look at this one? I sent a month ago. Thanks.\n\nI'm wondering why we're not seeing a splat for this. Usually the kernel\nwill warn if you sleep during atomic context. Does this mean we're just\nnot hitting that case? readx_poll_timeout() has a might_sleep_if(), and\ntherefore it should always cause the splat.\n\nAny ideas why this has gone unnoticed for all this time?\n\nThierry","headers":{"Return-Path":"<linux-tegra-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-tegra-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"SkOlb8LL\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yHkXr0k13z9t6K\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 19 Oct 2017 20:44:28 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752530AbdJSJo1 (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 19 Oct 2017 05:44:27 -0400","from mail-qk0-f196.google.com ([209.85.220.196]:46617 \"EHLO\n\tmail-qk0-f196.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752458AbdJSJoZ (ORCPT\n\t<rfc822;linux-tegra@vger.kernel.org>);\n\tThu, 19 Oct 2017 05:44:25 -0400","by mail-qk0-f196.google.com with SMTP id k123so9599003qke.3;\n\tThu, 19 Oct 2017 02:44:25 -0700 (PDT)","from localhost\n\t(p200300E41BE4FD00CEAD5B94E1CFD280.dip0.t-ipconnect.de.\n\t[2003:e4:1be4:fd00:cead:5b94:e1cf:d280])\n\tby smtp.gmail.com with ESMTPSA id\n\tb26sm9221732qtc.39.2017.10.19.02.44.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tThu, 19 Oct 2017 02:44:24 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=Cyq3ExksSDLM3PRAE3NSMq+bY3cnLbFJXZ5D4Fb/xKo=;\n\tb=SkOlb8LLTpWJYtgHyvClRk7Ndfl1f9FwfMMR2+YxHlxuh2nwyVcFnxRXYtn+Djnzn6\n\tuYBwdDG8wknGt1pyDP47cdUZpuX/vhR/vcimGMmVKga1X8a7Ftj20TvQqgjUrRfp1tr+\n\tpJVhxUa3o0KKWW4xq5q19zAuEuJxQizUc7f66x/wT4xPE8uGBJKsUHDuMzCYJfklW4eo\n\tTZ7KCyHMGpBrYVXZ42Q6GX+vwuCynuJmAjIUQPpIjP7tTQjYfq0Mpo6BGSk94AIQ0yGQ\n\twQQd3dI4JnVrn0mf+whXTqBLQ4WIm85QO4fDBPNTsCz4widg0QvunWafZwmTdSC6suF5\n\tD9xA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=Cyq3ExksSDLM3PRAE3NSMq+bY3cnLbFJXZ5D4Fb/xKo=;\n\tb=lOj9cX7UkLqxnCQQeDXzyekePcmnKu7u5UBLQB8AYi32ibF8hjoXovbNbSRJL0TAEr\n\tU3qr8OQek2zK8ujrNJaUH+ZZJMaq0VK71d35ausv5mXrvWeljTuQQCFPZjhnipKrvHeR\n\ta4ktW9n3HHUht9ty4BEYbz0rsc99AHrAwm5RRPEjvdPemFzOXM1N13mjMISTVH320U/6\n\teqEne/Wwo9X4buaU0lnWzfWt2GYgz/GrStz62zDln18ICrj632XzUGGjXX+VMU4XizRU\n\t7K23p1VKL2gR44a8+SMzk6wxHgTX1ta+r4BCWsAIBkbuzDaI6+Z91foseiGh8g1TgxIV\n\tG9dg==","X-Gm-Message-State":"AMCzsaUjQhb+yWSrxBnmWhiFtZDBzpH4PzOXfZ203CC4sV0veuLIHlf9\n\thnU+Shg+/5BiUlt1gOOXR3U=","X-Google-Smtp-Source":"ABhQp+QhCEgTs5PiAAJ/TFTT/Ic0Ud5tlmimJArAMAuD8mjvfP88lTillV8YmxsTWtqEHma4ZmbKFg==","X-Received":"by 10.55.125.196 with SMTP id y187mr1195666qkc.180.1508406264719;\n\tThu, 19 Oct 2017 02:44:24 -0700 (PDT)","Date":"Thu, 19 Oct 2017 11:44:22 +0200","From":"Thierry Reding <thierry.reding@gmail.com>","To":"Nicolin Chen <nicoleotsuka@gmail.com>","Cc":"sboyd@codeaurora.org, pdeschrijver@nvidia.com,\n\tlinux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,\n\tlinux-clk@vger.kernel.org, jonathanh@nvidia.com,\n\tmturquette@baylibre.com, pgaikwad@nvidia.com","Subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","Message-ID":"<20171019094422.GI9005@ulmo>","References":"<1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com>\n\t<20171019092919.GA7252@Asurada>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"o7gdRJTuwFmWapyH\"","Content-Disposition":"inline","In-Reply-To":"<20171019092919.GA7252@Asurada>","User-Agent":"Mutt/1.9.1 (2017-09-22)","Sender":"linux-tegra-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-tegra.vger.kernel.org>","X-Mailing-List":"linux-tegra@vger.kernel.org"}},{"id":1790844,"web_url":"http://patchwork.ozlabs.org/comment/1790844/","msgid":"<20171019184223.GA7415@Asurada-Nvidia>","list_archive_url":null,"date":"2017-10-19T18:42:24","subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","submitter":{"id":36301,"url":"http://patchwork.ozlabs.org/api/people/36301/","name":"Nicolin Chen","email":"nicoleotsuka@gmail.com"},"content":"On Thu, Oct 19, 2017 at 11:44:22AM +0200, Thierry Reding wrote:\n> > > Below is the call trace of tegra210_init_pllu() function:\n> > >   start_kernel()\n> > >   -> time_init()\n> > >   --> of_clk_init()\n> > >   ---> tegra210_clock_init()\n> > >   ----> tegra210_pll_init()\n> > >   -----> tegra210_init_pllu()\n\n> I'm wondering why we're not seeing a splat for this. Usually the kernel\n> will warn if you sleep during atomic context. Does this mean we're just\n> not hitting that case?\n\nYes.\n\n> readx_poll_timeout() has a might_sleep_if(), and\n> therefore it should always cause the splat.\n\nThat's true as long as CONFIG_DEBUG_ATOMIC_SLEEP is enabled locally.\n\n> Any ideas why this has gone unnoticed for all this time?\n\nWe can see in the tegra210_init_pllu() function that it'll not call\ntegra210_enable_pllu() if pllu is already enabled (by bootloader).\n\nYou can verify it by adding an irqs_disabled() in this routine. The\nfunction is called during system-boot and suspend-n-resume. And both\ncases should be irqs_disabled().\n\nThanks\nNicolin\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-tegra\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-tegra-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-tegra-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"pTHCeWZl\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yHyV91HHDz9t3l\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 20 Oct 2017 05:42:57 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752345AbdJSSma (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 19 Oct 2017 14:42:30 -0400","from mail-pf0-f194.google.com ([209.85.192.194]:45828 \"EHLO\n\tmail-pf0-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751052AbdJSSm3 (ORCPT\n\t<rfc822;linux-tegra@vger.kernel.org>);\n\tThu, 19 Oct 2017 14:42:29 -0400","by mail-pf0-f194.google.com with SMTP id d28so7257812pfe.2;\n\tThu, 19 Oct 2017 11:42:29 -0700 (PDT)","from Asurada-Nvidia (searspoint.nvidia.com. [216.228.112.21])\n\tby smtp.gmail.com with ESMTPSA id\n\tm25sm20857079pfg.49.2017.10.19.11.42.27\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tThu, 19 Oct 2017 11:42:27 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=GMSdWXhB159mdI5mzUUDCtZgfXhsKTFBff14ETMRIfw=;\n\tb=pTHCeWZlhi6GaygZCKjA2Ul17kYOBja5KeAbkJRwx/QI9B5tllh32qhQQxn5X8H14q\n\tMAGKD13bDMrVj6tVL5d0xVG6nbbaMqm0KTwo/jO2MVxqiyddNhmqX9S9L+nq5BWYOoMr\n\tbCogki7awnTi22IhfawQrck2Mn/+fn3BUgXP/VjgFlsof+6cT5xhzAWPtZRBkFbA2ppg\n\tfak7dsJ0AstAHPzeY8xew5Q1cvdKWNNtTAj47qdmrAulffWhnNpNbggo6RE6/6oL6Qgn\n\t3A3g49pfcW+cNYkrFdJUQJEO4LMKptdRm869MWFcdwHw8aB35yh9b33Jiqx0hfcDpPPu\n\tEs5Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=GMSdWXhB159mdI5mzUUDCtZgfXhsKTFBff14ETMRIfw=;\n\tb=LDRSbPJo3lQxh9m1f5lYXdlNGvUm87FXtadBQvxlq8EjSxbTvbfrrWaWW03GYFfFL4\n\tMBmHynBDTZDLJdLqg97K0si3Wl7uteauuw2L5KdMk3vqV/Gh08FH2DR/Q/pdv6N+npdg\n\tTPUgEu7wXuQfgygyl2dohdwP5mnJSZdvGPOLmkZWM8o61nYHKKPYu+9QGRTSoEVHSAhD\n\tF8McSCjAN/lr3IncO2pumH9gjsUthSkECEjZ0ACtuJA3IWpsPoLBAl8n5JlBns4lhFA7\n\tlghV8rDolkU1vDH+niH80BDY8ZVhlKBcedmqUeXjq+BsRPtjDT/bxFFz4ezzYIDjxF8x\n\twG9Q==","X-Gm-Message-State":"AMCzsaXAeXsPJ6d/EBRlusTbUatviIX5P3XDqHwZmuDUZT1anurg98d4\n\t+3JiUDZXGo4PNuLhgy0W2lccFA==","X-Google-Smtp-Source":"ABhQp+THDirr0FmELf+hRm0jLB0LS9SpAtn4nXi9XpNPWw4XVCNoc9zFWHw9XH5MCiggbgyz49KMFg==","X-Received":"by 10.99.45.198 with SMTP id t189mr2113950pgt.286.1508438548305; \n\tThu, 19 Oct 2017 11:42:28 -0700 (PDT)","Date":"Thu, 19 Oct 2017 11:42:24 -0700","From":"Nicolin Chen <nicoleotsuka@gmail.com>","To":"Thierry Reding <thierry.reding@gmail.com>","Cc":"sboyd@codeaurora.org, pdeschrijver@nvidia.com,\n\tlinux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,\n\tlinux-clk@vger.kernel.org, jonathanh@nvidia.com,\n\tmturquette@baylibre.com, pgaikwad@nvidia.com","Subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","Message-ID":"<20171019184223.GA7415@Asurada-Nvidia>","References":"<1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com>\n\t<20171019092919.GA7252@Asurada> <20171019094422.GI9005@ulmo>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20171019094422.GI9005@ulmo>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Sender":"linux-tegra-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-tegra.vger.kernel.org>","X-Mailing-List":"linux-tegra@vger.kernel.org"}},{"id":1791037,"web_url":"http://patchwork.ozlabs.org/comment/1791037/","msgid":"<20171020001859.GA9196@Asurada-Nvidia>","list_archive_url":null,"date":"2017-10-20T00:19:01","subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","submitter":{"id":36301,"url":"http://patchwork.ozlabs.org/api/people/36301/","name":"Nicolin Chen","email":"nicoleotsuka@gmail.com"},"content":"On Thu, Oct 19, 2017 at 11:42:24AM -0700, Nicolin Chen wrote:\n> On Thu, Oct 19, 2017 at 11:44:22AM +0200, Thierry Reding wrote:\n> > > > Below is the call trace of tegra210_init_pllu() function:\n> > > >   start_kernel()\n> > > >   -> time_init()\n> > > >   --> of_clk_init()\n> > > >   ---> tegra210_clock_init()\n> > > >   ----> tegra210_pll_init()\n> > > >   -----> tegra210_init_pllu()\n> \n> > I'm wondering why we're not seeing a splat for this. Usually the kernel\n> > will warn if you sleep during atomic context. Does this mean we're just\n> > not hitting that case?\n> \n> Yes.\n> \n> > readx_poll_timeout() has a might_sleep_if(), and\n> > therefore it should always cause the splat.\n> \n> That's true as long as CONFIG_DEBUG_ATOMIC_SLEEP is enabled locally.\n> \n> > Any ideas why this has gone unnoticed for all this time?\n> \n> We can see in the tegra210_init_pllu() function that it'll not call\n> tegra210_enable_pllu() if pllu is already enabled (by bootloader).\n> \n> You can verify it by adding an irqs_disabled() in this routine. The\n> function is called during system-boot and suspend-n-resume. And both\n\nA correction: using mainline kernel, only system-boot as the commit log\ndescribes.\n\n> cases should be irqs_disabled().\n> \n> Thanks\n> Nicolin\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-tegra\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-tegra-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-tegra-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"NwDZJDEM\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yJ5y72Lpyz9t44\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 20 Oct 2017 11:19:11 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751455AbdJTATK (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 19 Oct 2017 20:19:10 -0400","from mail-pf0-f194.google.com ([209.85.192.194]:48741 \"EHLO\n\tmail-pf0-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751112AbdJTATJ (ORCPT\n\t<rfc822;linux-tegra@vger.kernel.org>);\n\tThu, 19 Oct 2017 20:19:09 -0400","by mail-pf0-f194.google.com with SMTP id b79so8406927pfk.5;\n\tThu, 19 Oct 2017 17:19:08 -0700 (PDT)","from Asurada-Nvidia (searspoint.nvidia.com. [216.228.112.21])\n\tby smtp.gmail.com with ESMTPSA id\n\tn72sm20158018pfi.92.2017.10.19.17.19.05\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tThu, 19 Oct 2017 17:19:07 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=Rl/URvnLKB00OKtKOLi3kT3VULAfIFvmznTUvfq0QVw=;\n\tb=NwDZJDEMgNdz4PQbFLNo29hGOOap+iwIv1p2KH1V4Nwq8uANPXG/nAPpqqkttPxfKS\n\tvEeA6IclQP7af1NAI9WkqItuYxMrUIfsYoYUOePzoEb5e3e9tJTyTJRm4V5oTBwnS77H\n\tawo2Hl3gbPo6SqIZv75YZIIpGDBQVaz1uOt1QriBizYDCe4XradFy74ddiSxJpr39SWR\n\tcTQOKFBCXlIdOpYr0TbOEuh3qErxlA2lTR3v9UKG1x2cUJZ9zHojxuIvRdJJSubRwFb5\n\tPQE11CLyIdi7dCjjElByGYGat4wBeO/SYx9QMTLsCPvdgvhkILi7JGIiiNruNK/I1KxB\n\t0NBg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=Rl/URvnLKB00OKtKOLi3kT3VULAfIFvmznTUvfq0QVw=;\n\tb=h/5diMmIGZy0opqz6pPKXnlPUqXgSDU5vzoMjfCdcy9EjHjXQNFrirzCz4OJSTJkDl\n\t2vL4Kzz9Irl4NjimgndXKwQLVcD6cc201YtcZaBIOA1A+12dqErznUF0RgKaOF3sky+Y\n\tTdko/u2AjWdXfuMgUTDW/nItN2YM5GF9L7iGcxw1fKgyi88ERr5uzFYZIZF4WN4kDd2U\n\tJ8VKl9FGGCjLb8MNMe0tzwwZaRx3pshazPpH0EwebFvZr7Ucvn2WCfyw7JvIfe224Iu2\n\tT6ujJFxb44fRnMNJbgNUsAM5g3a5Dtqfkk+3BXZDVSwdPK23QOUBChKdwrbchZQ02ayU\n\tuU6Q==","X-Gm-Message-State":"AMCzsaUMr3QmfSLFn7ewDfR1RNrBLHmxFfQCGWtprZDPdp11J49vfpxO\n\tZlf0snSXGQGR7ZHACKv9qXk=","X-Google-Smtp-Source":"ABhQp+RN2N64xDhQOTOmadS/oKoZUhqqZEwWwdP5UaDoKc0QYOyGCXhzT7VmUaL38C2/UQTCteQbdQ==","X-Received":"by 10.84.195.164 with SMTP id j33mr2752920pld.36.1508458748234; \n\tThu, 19 Oct 2017 17:19:08 -0700 (PDT)","Date":"Thu, 19 Oct 2017 17:19:01 -0700","From":"Nicolin Chen <nicoleotsuka@gmail.com>","To":"Thierry Reding <thierry.reding@gmail.com>","Cc":"sboyd@codeaurora.org, pdeschrijver@nvidia.com,\n\tlinux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,\n\tlinux-clk@vger.kernel.org, jonathanh@nvidia.com,\n\tmturquette@baylibre.com, pgaikwad@nvidia.com","Subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","Message-ID":"<20171020001859.GA9196@Asurada-Nvidia>","References":"<1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com>\n\t<20171019092919.GA7252@Asurada> <20171019094422.GI9005@ulmo>\n\t<20171019184223.GA7415@Asurada-Nvidia>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20171019184223.GA7415@Asurada-Nvidia>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Sender":"linux-tegra-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-tegra.vger.kernel.org>","X-Mailing-List":"linux-tegra@vger.kernel.org"}},{"id":1791305,"web_url":"http://patchwork.ozlabs.org/comment/1791305/","msgid":"<731a934a-4e78-b96d-239f-14cf83079605@nvidia.com>","list_archive_url":null,"date":"2017-10-20T10:20:24","subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","submitter":{"id":66273,"url":"http://patchwork.ozlabs.org/api/people/66273/","name":"Jon Hunter","email":"jonathanh@nvidia.com"},"content":"On 19/10/17 19:42, Nicolin Chen wrote:\n> On Thu, Oct 19, 2017 at 11:44:22AM +0200, Thierry Reding wrote:\n>>>> Below is the call trace of tegra210_init_pllu() function:\n>>>>   start_kernel()\n>>>>   -> time_init()\n>>>>   --> of_clk_init()\n>>>>   ---> tegra210_clock_init()\n>>>>   ----> tegra210_pll_init()\n>>>>   -----> tegra210_init_pllu()\n> \n>> I'm wondering why we're not seeing a splat for this. Usually the kernel\n>> will warn if you sleep during atomic context. Does this mean we're just\n>> not hitting that case?\n> \n> Yes.\n> \n>> readx_poll_timeout() has a might_sleep_if(), and\n>> therefore it should always cause the splat.\n> \n> That's true as long as CONFIG_DEBUG_ATOMIC_SLEEP is enabled locally.\n> \n>> Any ideas why this has gone unnoticed for all this time?\n> \n> We can see in the tegra210_init_pllu() function that it'll not call\n> tegra210_enable_pllu() if pllu is already enabled (by bootloader).\n\nI was thinking that same and so I clobbered the PLLU enable bit with\nu-boot, however, then the kernel appears to hang on boot when enabling\nthe PLL. So although this is probably a separate issue, I am curious if\nyou have booted the mainline with the PLLU disabled?\n\nCheers\nJon","headers":{"Return-Path":"<linux-tegra-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-tegra-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yJMLJ0qp9z9t6J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 20 Oct 2017 21:22:32 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752092AbdJTKWa (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 20 Oct 2017 06:22:30 -0400","from hqemgate15.nvidia.com ([216.228.121.64]:2768 \"EHLO\n\thqemgate15.nvidia.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751967AbdJTKW3 (ORCPT\n\t<rfc822;linux-tegra@vger.kernel.org>);\n\tFri, 20 Oct 2017 06:22:29 -0400","from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by\n\thqemgate15.nvidia.com\n\tid <B59e9ce4d0000>; Fri, 20 Oct 2017 03:22:05 -0700","from HQMAIL104.nvidia.com ([172.20.161.6])\n\tby hqpgpgate101.nvidia.com (PGP Universal service);\n\tFri, 20 Oct 2017 03:22:19 -0700","from UKMAIL101.nvidia.com (10.26.138.13) by HQMAIL104.nvidia.com\n\t(172.18.146.11) with Microsoft SMTP Server (TLS) id 15.0.1293.2;\n\tFri, 20 Oct 2017 10:20:29 +0000","from [10.21.132.144] (10.21.132.144) by UKMAIL101.nvidia.com\n\t(10.26.138.13) with Microsoft SMTP Server (TLS) id 15.0.1293.2;\n\tFri, 20 Oct 2017 10:20:25 +0000"],"X-PGP-Universal":"processed;\n\tby hqpgpgate101.nvidia.com on Fri, 20 Oct 2017 03:22:19 -0700","Subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","To":"Nicolin Chen <nicoleotsuka@gmail.com>,\n\tThierry Reding <thierry.reding@gmail.com>","CC":"<sboyd@codeaurora.org>, <pdeschrijver@nvidia.com>,\n\t<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>,\n\t<linux-clk@vger.kernel.org>, <mturquette@baylibre.com>,\n\t<pgaikwad@nvidia.com>","References":"<1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com>\n\t<20171019092919.GA7252@Asurada> <20171019094422.GI9005@ulmo>\n\t<20171019184223.GA7415@Asurada-Nvidia>","From":"Jon Hunter <jonathanh@nvidia.com>","Message-ID":"<731a934a-4e78-b96d-239f-14cf83079605@nvidia.com>","Date":"Fri, 20 Oct 2017 11:20:24 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.4.0","MIME-Version":"1.0","In-Reply-To":"<20171019184223.GA7415@Asurada-Nvidia>","X-Originating-IP":"[10.21.132.144]","X-ClientProxiedBy":"UKMAIL101.nvidia.com (10.26.138.13) To\n\tUKMAIL101.nvidia.com (10.26.138.13)","Content-Type":"text/plain; charset=\"utf-8\"","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Sender":"linux-tegra-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-tegra.vger.kernel.org>","X-Mailing-List":"linux-tegra@vger.kernel.org"}},{"id":1791376,"web_url":"http://patchwork.ozlabs.org/comment/1791376/","msgid":"<20171020113857.GA8628@ulmo>","list_archive_url":null,"date":"2017-10-20T11:38:57","subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","submitter":{"id":26234,"url":"http://patchwork.ozlabs.org/api/people/26234/","name":"Thierry Reding","email":"thierry.reding@gmail.com"},"content":"On Fri, Sep 15, 2017 at 12:10:13PM -0700, Nicolin Chen wrote:\n> Below is the call trace of tegra210_init_pllu() function:\n>   start_kernel()\n>   -> time_init()\n>   --> of_clk_init()\n>   ---> tegra210_clock_init()\n>   ----> tegra210_pll_init()\n>   -----> tegra210_init_pllu()\n> \n> Because the preemption is disabled in the start_kernel before calling\n> time_init, tegra210_init_pllu is actually in an atomic context while\n> it includes a readl_relaxed_poll_timeout that might sleep.\n> \n> So this patch just changes this readl_relaxed_poll_timeout() to its\n> atomic version.\n> \n> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>\n> Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>\n> ---\n> Changelog\n> v2:\n>  * Corrected a typo in the commit log\n>  * Added Peter's Acked-by.\n> \n>  drivers/clk/tegra/clk-tegra210.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n\nApplied, thanks.\n\nThierry","headers":{"Return-Path":"<linux-tegra-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-tegra-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Jv51UkVz\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yJP2b48hlz9t6C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 20 Oct 2017 22:39:03 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752991AbdJTLjC (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 20 Oct 2017 07:39:02 -0400","from mail-wm0-f66.google.com ([74.125.82.66]:47587 \"EHLO\n\tmail-wm0-f66.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752859AbdJTLjB (ORCPT\n\t<rfc822;linux-tegra@vger.kernel.org>);\n\tFri, 20 Oct 2017 07:39:01 -0400","by mail-wm0-f66.google.com with SMTP id t69so21385254wmt.2;\n\tFri, 20 Oct 2017 04:39:00 -0700 (PDT)","from localhost\n\t(p200300E41BE4FD00CEAD5B94E1CFD280.dip0.t-ipconnect.de.\n\t[2003:e4:1be4:fd00:cead:5b94:e1cf:d280])\n\tby smtp.gmail.com with ESMTPSA id\n\tf27sm1773889wrf.63.2017.10.20.04.38.58\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tFri, 20 Oct 2017 04:38:58 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=yY98978bliHTu8iCZopSlH6kFXyPjURrUu05eDZoNkg=;\n\tb=Jv51UkVzrSTUICwxWCYIoK5knaAzYKKC/KS2rB8mO41Ni4WkeOjni/AaPrZRJP7iQN\n\tv5yWDAFomrOyuWuiDNR8aGxfYTNsQUcaXjU3lDHig/sDJ0lrSWRx4JxqgLSbgunAaNOb\n\t4HueDEALuDhrxN9A25z8XJBlCErRjwCEavI89y1scepYBGWwpryy5yTXHJLQh8EQyjvq\n\t5o/hq1AgZjAUPwv/n/L7+LAZ20t0honPZ2coVsWeeBQrNng5DoY3AsRn+gLpxwMeMkVU\n\tfJ55Iksc0PzxQyzyfgr1p/PHjtG8MfZkNh6NaXThQw+vd8UXHda2JRauAR/KgJ5AAYsN\n\tP20g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=yY98978bliHTu8iCZopSlH6kFXyPjURrUu05eDZoNkg=;\n\tb=gluen0V5BNz7ZbpuKQxLFh9IOkrZnlvGUD+Bcdmjy5ZSJBb5rwu4tI/NrPckfkL2sM\n\t5vUDBihGWlrwGLgI/xxEoXuJyA1YPpr+Hva3Nv1IM3wAGUt21tpvuykkYLB/im6CgGrS\n\tGBGdbH0dRwT9YT9xEst8GzZ/5SDHWrIVIcKjBbpELN3hhf7iWAyCOZA9G6wOusJDuoYb\n\tCWC/mmXNOiOi/G509V76M9BYYwqseU6vsjAA+x/OeNaJWoOyQxNesq8JKq/hLwvBMwyP\n\tJwJlw3aA7fMUQl/zY8pQFTf5thYPP8fDEW75shBzVjpYWAazRnmOKuwDE/YUTJNeGFsr\n\tB/HA==","X-Gm-Message-State":"AMCzsaUKEdIGZAdUVFtoycFH0MiMHj4KxMwKWdglUYfKoZtC5gr9sJNG\n\ttHvWwYlOirf1TeurgU8Swr0=","X-Google-Smtp-Source":"ABhQp+R5fCZGuIpsNL0pF1pJcmxqJ8Lxe5ly/ZPRES2RUsia2PlHrnAWQ5Di2/VHm8TXaEWqNmWcXA==","X-Received":"by 10.28.170.9 with SMTP id t9mr1339280wme.148.1508499539628;\n\tFri, 20 Oct 2017 04:38:59 -0700 (PDT)","Date":"Fri, 20 Oct 2017 13:38:57 +0200","From":"Thierry Reding <thierry.reding@gmail.com>","To":"Nicolin Chen <nicoleotsuka@gmail.com>","Cc":"sboyd@codeaurora.org, pdeschrijver@nvidia.com,\n\tlinux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,\n\tlinux-clk@vger.kernel.org, jonathanh@nvidia.com,\n\tmturquette@baylibre.com, pgaikwad@nvidia.com","Subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","Message-ID":"<20171020113857.GA8628@ulmo>","References":"<1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"YiEDa0DAkWCtVeE4\"","Content-Disposition":"inline","In-Reply-To":"<1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com>","User-Agent":"Mutt/1.9.1 (2017-09-22)","Sender":"linux-tegra-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-tegra.vger.kernel.org>","X-Mailing-List":"linux-tegra@vger.kernel.org"}},{"id":1791662,"web_url":"http://patchwork.ozlabs.org/comment/1791662/","msgid":"<20171020182406.GA12980@Asurada-Nvidia>","list_archive_url":null,"date":"2017-10-20T18:24:07","subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","submitter":{"id":36301,"url":"http://patchwork.ozlabs.org/api/people/36301/","name":"Nicolin Chen","email":"nicoleotsuka@gmail.com"},"content":"On Fri, Oct 20, 2017 at 11:20:24AM +0100, Jon Hunter wrote:\n> \n> On 19/10/17 19:42, Nicolin Chen wrote:\n> > On Thu, Oct 19, 2017 at 11:44:22AM +0200, Thierry Reding wrote:\n> >>>> Below is the call trace of tegra210_init_pllu() function:\n> >>>>   start_kernel()\n> >>>>   -> time_init()\n> >>>>   --> of_clk_init()\n> >>>>   ---> tegra210_clock_init()\n> >>>>   ----> tegra210_pll_init()\n> >>>>   -----> tegra210_init_pllu()\n> > \n> >> I'm wondering why we're not seeing a splat for this. Usually the kernel\n> >> will warn if you sleep during atomic context. Does this mean we're just\n> >> not hitting that case?\n> > \n> > Yes.\n> > \n> >> readx_poll_timeout() has a might_sleep_if(), and\n> >> therefore it should always cause the splat.\n> > \n> > That's true as long as CONFIG_DEBUG_ATOMIC_SLEEP is enabled locally.\n> > \n> >> Any ideas why this has gone unnoticed for all this time?\n> > \n> > We can see in the tegra210_init_pllu() function that it'll not call\n> > tegra210_enable_pllu() if pllu is already enabled (by bootloader).\n> \n> I was thinking that same and so I clobbered the PLLU enable bit with\n> u-boot, however, then the kernel appears to hang on boot when enabling\n> the PLL. So although this is probably a separate issue, I am curious if\n> you have booted the mainline with the PLLU disabled?\n\nI am not sure if clearing the enable bit only would work. But the test\nbelow should be able to verify the situation -- setting the PLLU_BASE\nregister to its reset value.\n\ndiff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c\nindex ea695c4..2279373 100644\n--- a/drivers/clk/tegra/clk-tegra210.c\n+++ b/drivers/clk/tegra/clk-tegra210.c\n@@ -2602,6 +2602,7 @@ static int tegra210_init_pllu(void)\n \tu32 reg;\n \tint err;\n \n+\twritel_relaxed(0x1011902, clk_base + PLLU_BASE);\n\ttegra210_pllu_set_defaults(&pll_u_vco_params);\n\t/* skip initialization when pllu is in hw controlled mode */\n\treg = readl_relaxed(clk_base + PLLU_BASE);\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-tegra\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-tegra-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-tegra-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"D+DdPNqU\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yJZ253714z9t3l\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 21 Oct 2017 05:24:13 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752496AbdJTSYM (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 20 Oct 2017 14:24:12 -0400","from mail-pf0-f194.google.com ([209.85.192.194]:54949 \"EHLO\n\tmail-pf0-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752425AbdJTSYL (ORCPT\n\t<rfc822;linux-tegra@vger.kernel.org>);\n\tFri, 20 Oct 2017 14:24:11 -0400","by mail-pf0-f194.google.com with SMTP id n89so12161725pfk.11;\n\tFri, 20 Oct 2017 11:24:10 -0700 (PDT)","from Asurada-Nvidia (searspoint.nvidia.com. [216.228.112.21])\n\tby smtp.gmail.com with ESMTPSA id\n\tm25sm2852471pfg.49.2017.10.20.11.24.09\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tFri, 20 Oct 2017 11:24:09 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=ckPMJhHnRCxCGhKZ4PsRy+XoU7hgN80MnBmXqChdVkY=;\n\tb=D+DdPNqULKe1oU6NFbJwdSFOe3HKEV44s/2tgR8AZ970W1nYxXBVpOuFGwthtpu02J\n\tBJQ2sZ2vv6Udmlu8r0en31GSbt72q9IGBs+GQ5SBoxjD5w+TjO2kMI07IcrsMefKoGbn\n\t0YuxQWBtK+EEueIIl96rb8zuiRimkwu0ZFBe320zImJEMkH7CRlH8bCMbApPtTw8qjoT\n\tqIXrQpBPFlL5E5StWAwNbkEuCe5A/l2oYWwzTTq4JVOZmnGa7O4nqkcrYiSvIy6aOIWh\n\tHRduN8aTeDW2z+oRwJ59BCoVZST132E0rHHzUVI4CE5V/BxMwelB2zGAMbBZlVrtH1rQ\n\tvJfw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=ckPMJhHnRCxCGhKZ4PsRy+XoU7hgN80MnBmXqChdVkY=;\n\tb=s6BOj41EQITpdE32gXHA8ltI/Gtk7Xb0CdMVwIZaYL7wEhX8LCE98EUxeMdQoewO7c\n\t/vIIgONU2+ON56iUPk5Esg00xBThEpKLRbwjAkXleNO9M0b+A4mzpSnpOvqjB1byc8iq\n\tTzggt+RBp5J1b2pdt0U9A4AGppVtQG7tUvWXCw/HPnZ0JdiKIRrN1PVr3ttSFIrHJp8L\n\tA2cMHnGqYatfbSC5bWv4guWB4qGrjmPP/u79+s3hJOKgkHyxZPybNBeC04B4SDK+Yo70\n\t4wZ0PeOS6lTLOau7ZCeFSl4JCB8g63dR3v20qb2L/v6VfC0YeAMepmstBUI+hLXAlzw9\n\tIqpw==","X-Gm-Message-State":"AMCzsaUT33tvsfQebZ/vP34i2g2UrB7UhE8afWCASLV9HAfbljFMo0W5\n\tX/wtNwqID9sJFc0OC8c9piI=","X-Google-Smtp-Source":"ABhQp+RtTjxHGDNlxZe1x5Phzb3kSujhs15bv3R1UWaHd+OpFLXaPMKSJNig/8vftcQl2EeMKG/Zkw==","X-Received":"by 10.84.133.132 with SMTP id f4mr4797607plf.197.1508523850360; \n\tFri, 20 Oct 2017 11:24:10 -0700 (PDT)","Date":"Fri, 20 Oct 2017 11:24:07 -0700","From":"Nicolin Chen <nicoleotsuka@gmail.com>","To":"Jon Hunter <jonathanh@nvidia.com>","Cc":"Thierry Reding <thierry.reding@gmail.com>, sboyd@codeaurora.org,\n\tpdeschrijver@nvidia.com, linux-kernel@vger.kernel.org,\n\tlinux-tegra@vger.kernel.org, linux-clk@vger.kernel.org,\n\tmturquette@baylibre.com, pgaikwad@nvidia.com","Subject":"Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in\n\ttegra210_clock_init","Message-ID":"<20171020182406.GA12980@Asurada-Nvidia>","References":"<1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com>\n\t<20171019092919.GA7252@Asurada> <20171019094422.GI9005@ulmo>\n\t<20171019184223.GA7415@Asurada-Nvidia>\n\t<731a934a-4e78-b96d-239f-14cf83079605@nvidia.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<731a934a-4e78-b96d-239f-14cf83079605@nvidia.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Sender":"linux-tegra-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-tegra.vger.kernel.org>","X-Mailing-List":"linux-tegra@vger.kernel.org"}}]