[{"id":1765480,"web_url":"http://patchwork.ozlabs.org/comment/1765480/","msgid":"<760d7c25-afa4-2242-a278-e0989bca5478@microchip.com>","list_archive_url":null,"date":"2017-09-08T16:03:23","subject":"Re: [PATCH v1 07/10] iio:adc:at91-sama5d2: Support backup mode","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 08/09/2017 at 17:36, Romain Izard wrote:\n> Support the backup mode for platform suspend, by restoring the hardware\n> registers on resume.\n> \n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n\nRomain,\n\nThanks for your series: definitively some of your patches need to be\nintegrated (I've merged some of them in our current linux-4.9-at91 branch.\nHowever, It seems that some of your additions have already been\nsubmitted and/or accepted by maintainers.\nFor instance an equivalent of this one seems already in Linus' tree:\n500a2eefd6b16ba141a8fb777ea6962d2eb65e3b (\"iio: adc: at91-sama5d2_adc:\nadd support for suspend/resume functionality\").\n\nPlease tell us if it fits what your observed on this driver (or others).\n\nRegards,\n\n> ---\n>  drivers/iio/adc/at91-sama5d2_adc.c | 71 ++++++++++++++++++++++++++++++++------\n>  1 file changed, 61 insertions(+), 10 deletions(-)\n> \n> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c\n> index e10dca3ed74b..f9718c863363 100644\n> --- a/drivers/iio/adc/at91-sama5d2_adc.c\n> +++ b/drivers/iio/adc/at91-sama5d2_adc.c\n> @@ -200,6 +200,7 @@ struct at91_adc_state {\n>  \tu32\t\t\t\tconversion_value;\n>  \tstruct at91_adc_soc_info\tsoc_info;\n>  \twait_queue_head_t\t\twq_data_available;\n> +\tunsigned int\t\t\tcurrent_rate;\n>  \t/*\n>  \t * lock to prevent concurrent 'single conversion' requests through\n>  \t * sysfs.\n> @@ -269,6 +270,8 @@ static void at91_adc_setup_samp_freq(struct at91_adc_state *st, unsigned freq)\n>  \tmr |= AT91_SAMA5D2_MR_PRESCAL(prescal);\n>  \tat91_adc_writel(st, AT91_SAMA5D2_MR, mr);\n>  \n> +\tst->current_rate = freq;\n> +\n>  \tdev_dbg(&indio_dev->dev, \"freq: %u, startup: %u, prescal: %u\\n\",\n>  \t\tfreq, startup, prescal);\n>  }\n> @@ -375,7 +378,9 @@ static int at91_adc_write_raw(struct iio_dev *indio_dev,\n>  \t    val > st->soc_info.max_sample_rate)\n>  \t\treturn -EINVAL;\n>  \n> +\tmutex_lock(&st->lock);\n>  \tat91_adc_setup_samp_freq(st, val);\n> +\tmutex_unlock(&st->lock);\n>  \n>  \treturn 0;\n>  }\n> @@ -386,6 +391,21 @@ static const struct iio_info at91_adc_info = {\n>  \t.driver_module = THIS_MODULE,\n>  };\n>  \n> +static void at91_adc_init_hw(struct at91_adc_state *st, unsigned int freq)\n> +{\n> +\tat91_adc_writel(st, AT91_SAMA5D2_CR, AT91_SAMA5D2_CR_SWRST);\n> +\tat91_adc_writel(st, AT91_SAMA5D2_IDR, 0xffffffff);\n> +\t/*\n> +\t * Transfer field must be set to 2 according to the datasheet and\n> +\t * allows different analog settings for each channel.\n> +\t */\n> +\tat91_adc_writel(st, AT91_SAMA5D2_MR,\n> +\t\t\tAT91_SAMA5D2_MR_TRANSFER(2) | AT91_SAMA5D2_MR_ANACH);\n> +\n> +\tat91_adc_setup_samp_freq(st, freq);\n> +\n> +}\n> +\n>  static int at91_adc_probe(struct platform_device *pdev)\n>  {\n>  \tstruct iio_dev *indio_dev;\n> @@ -482,16 +502,7 @@ static int at91_adc_probe(struct platform_device *pdev)\n>  \t\tgoto vref_disable;\n>  \t}\n>  \n> -\tat91_adc_writel(st, AT91_SAMA5D2_CR, AT91_SAMA5D2_CR_SWRST);\n> -\tat91_adc_writel(st, AT91_SAMA5D2_IDR, 0xffffffff);\n> -\t/*\n> -\t * Transfer field must be set to 2 according to the datasheet and\n> -\t * allows different analog settings for each channel.\n> -\t */\n> -\tat91_adc_writel(st, AT91_SAMA5D2_MR,\n> -\t\t\tAT91_SAMA5D2_MR_TRANSFER(2) | AT91_SAMA5D2_MR_ANACH);\n> -\n> -\tat91_adc_setup_samp_freq(st, st->soc_info.min_sample_rate);\n> +\tat91_adc_init_hw(st, st->soc_info.min_sample_rate);\n>  \n>  \tret = clk_prepare_enable(st->per_clk);\n>  \tif (ret)\n> @@ -541,12 +552,52 @@ static const struct of_device_id at91_adc_dt_match[] = {\n>  };\n>  MODULE_DEVICE_TABLE(of, at91_adc_dt_match);\n>  \n> +#ifdef CONFIG_PM_SLEEP\n> +static int at91_adc_suspend(struct device *dev)\n> +{\n> +\tstruct platform_device *pdev = to_platform_device(dev);\n> +\tstruct iio_dev *indio_dev = platform_get_drvdata(pdev);\n> +\tstruct at91_adc_state *st = iio_priv(indio_dev);\n> +\n> +\tclk_disable_unprepare(st->per_clk);\n> +\n> +\tregulator_disable(st->vref);\n> +\tregulator_disable(st->reg);\n> +\n> +\treturn 0;\n> +}\n> +\n> +static int at91_adc_resume(struct device *dev)\n> +{\n> +\tstruct platform_device *pdev = to_platform_device(dev);\n> +\tstruct iio_dev *indio_dev = platform_get_drvdata(pdev);\n> +\tstruct at91_adc_state *st = iio_priv(indio_dev);\n> +\tint err;\n> +\n> +\terr = regulator_enable(st->reg);\n> +\tif (err)\n> +\t\treturn err;\n> +\n> +\terr = regulator_enable(st->vref);\n> +\tif (err)\n> +\t\treturn err;\n> +\n> +\tat91_adc_init_hw(st, st->current_rate);\n> +\n> +\terr = clk_prepare_enable(st->per_clk);\n> +\treturn err;\n> +}\n> +#endif\n> +\n> +static SIMPLE_DEV_PM_OPS(at91_adc_pm_ops, at91_adc_suspend, at91_adc_resume);\n> +\n>  static struct platform_driver at91_adc_driver = {\n>  \t.probe = at91_adc_probe,\n>  \t.remove = at91_adc_remove,\n>  \t.driver = {\n>  \t\t.name = \"at91-sama5d2_adc\",\n>  \t\t.of_match_table = at91_adc_dt_match,\n> +\t\t.pm = &at91_adc_pm_ops,\n>  \t},\n>  };\n>  module_platform_driver(at91_adc_driver)\n>","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"HUGLPYjF\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xphtX6vjWz9t2V\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tSat,  9 Sep 2017 02:03:00 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dqLk7-0006iB-3l; Fri, 08 Sep 2017 16:02:55 +0000","from esa6.microchip.iphmx.com ([216.71.154.253])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dqLjq-0006UN-4W; Fri, 08 Sep 2017 16:02:40 +0000","from exsmtp02.microchip.com (HELO email.microchip.com)\n\t([198.175.253.38])\n\tby esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t08 Sep 2017 09:02:16 -0700","from [10.159.245.112] (10.10.76.4) by chn-sv-exch02.mchp-main.com\n\t(10.10.76.38) with Microsoft SMTP Server id 14.3.352.0;\n\tFri, 8 Sep 2017 09:02:15 -0700"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:\n\tMessage-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description\n\t:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=+zw8ijz2/9esgP8qWQm1Eqln6p71BJi7wmLbFPQNRhM=;\n\tb=HUGLPYjFhe1Sim\n\taexcZ0E/fYrglAj6AnSZCwa0b+bRu+u9o7fm1iaZMFJt6eLL1vccPTmR/IVRR8Onw4Q63e6eGsQsE\n\tLL2IicRysMrg6Yeduq9yrZCkF2kOp4gkbdXPcD5aXNr5RMemKUSqk5Rf5+3eJMDqlCfsCPqRU6BAL\n\t3rzP+HsDMFKTkKayasFPqpZyD0zk5c0M6eWrM7LCuaUZn/JhcGOnFLim3xqKFonclccInxIFUWFS6\n\tL5NiT048/SgaKaM81lhnb3UbilLhMdbgdCLf29W5eZrwceRvOuvGWEw+sBzUDtuwKQsyekno0r0ap\n\tKbai43CNZxsf2BdWQ03A==;","X-IronPort-AV":"E=Sophos;i=\"5.42,362,1500966000\"; d=\"scan'208\";a=\"4305421\"","Subject":"Re: [PATCH v1 07/10] iio:adc:at91-sama5d2: Support backup mode","To":"Romain Izard <romain.izard.pro@gmail.com>, Boris Brezillon\n\t<boris.brezillon@free-electrons.com>, Michael Turquette\n\t<mturquette@baylibre.com>, Stephen Boyd <sboyd@codeaurora.org>, Ludovic\n\tDesroches <ludovic.desroches@microchip.com>, Jonathan Cameron\n\t<jic23@kernel.org>, Wenyou Yang <wenyou.yang@atmel.com>, Josh Wu\n\t<rainyfeeling@outlook.com>, David Woodhouse <dwmw2@infradead.org>, Brian\n\tNorris <computersforpeace@gmail.com>,\n\tMarek Vasut <marek.vasut@gmail.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, Thierry Reding\n\t<thierry.reding@gmail.com>, Richard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, Alan Stern\n\t<stern@rowland.harvard.edu>, Eugen Hristev <Eugen.Hristev@microchip.com>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-8-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<760d7c25-afa4-2242-a278-e0989bca5478@microchip.com>","Date":"Fri, 8 Sep 2017 18:03:23 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170908153604.28383-8-romain.izard.pro@gmail.com>","Content-Language":"en-US","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170908_090238_252014_62F39DCC ","X-CRM114-Status":"GOOD (  17.40  )","X-Spam-Score":"-2.6 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.6 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [216.71.154.253 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-pwm@vger.kernel.org, linux-iio@vger.kernel.org,\n\tlinux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org, linux-serial@vger.kernel.org,\n\tlinux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1765493,"web_url":"http://patchwork.ozlabs.org/comment/1765493/","msgid":"<CAGkQfmNgo9kp90eOrrez70f2-kMSD5EzxRjxWi=THBCE9EL4YA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-08T16:21:33","subject":"Re: [PATCH v1 07/10] iio:adc:at91-sama5d2: Support backup mode","submitter":{"id":8236,"url":"http://patchwork.ozlabs.org/api/people/8236/","name":"Romain Izard","email":"romain.izard.pro@gmail.com"},"content":"2017-09-08 18:03 GMT+02:00 Nicolas Ferre <nicolas.ferre@microchip.com>:\n> On 08/09/2017 at 17:36, Romain Izard wrote:\n>> Support the backup mode for platform suspend, by restoring the hardware\n>> registers on resume.\n>>\n>> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n>\n> Romain,\n>\n> Thanks for your series: definitively some of your patches need to be\n> integrated (I've merged some of them in our current linux-4.9-at91 branch.\n> However, It seems that some of your additions have already been\n> submitted and/or accepted by maintainers.\n> For instance an equivalent of this one seems already in Linus' tree:\n> 500a2eefd6b16ba141a8fb777ea6962d2eb65e3b (\"iio: adc: at91-sama5d2_adc:\n> add support for suspend/resume functionality\").\n>\n> Please tell us if it fits what your observed on this driver (or others).\n>\n> Regards,\n>\n>> ---\n>>  drivers/iio/adc/at91-sama5d2_adc.c | 71 ++++++++++++++++++++++++++++++++------\n>>  1 file changed, 61 insertions(+), 10 deletions(-)\n>>\n>> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c\n>> index e10dca3ed74b..f9718c863363 100644\n>> --- a/drivers/iio/adc/at91-sama5d2_adc.c\n>> +++ b/drivers/iio/adc/at91-sama5d2_adc.c\n>> @@ -200,6 +200,7 @@ struct at91_adc_state {\n>>       u32                             conversion_value;\n>>       struct at91_adc_soc_info        soc_info;\n>>       wait_queue_head_t               wq_data_available;\n>> +     unsigned int                    current_rate;\n>>       /*\n>>        * lock to prevent concurrent 'single conversion' requests through\n>>        * sysfs.\n>> @@ -269,6 +270,8 @@ static void at91_adc_setup_samp_freq(struct at91_adc_state *st, unsigned freq)\n>>       mr |= AT91_SAMA5D2_MR_PRESCAL(prescal);\n>>       at91_adc_writel(st, AT91_SAMA5D2_MR, mr);\n>>\n>> +     st->current_rate = freq;\n>> +\n>>       dev_dbg(&indio_dev->dev, \"freq: %u, startup: %u, prescal: %u\\n\",\n>>               freq, startup, prescal);\n>>  }\n>> @@ -375,7 +378,9 @@ static int at91_adc_write_raw(struct iio_dev *indio_dev,\n>>           val > st->soc_info.max_sample_rate)\n>>               return -EINVAL;\n>>\n>> +     mutex_lock(&st->lock);\n>>       at91_adc_setup_samp_freq(st, val);\n>> +     mutex_unlock(&st->lock);\n>>\n>>       return 0;\n>>  }\n>> @@ -386,6 +391,21 @@ static const struct iio_info at91_adc_info = {\n>>       .driver_module = THIS_MODULE,\n>>  };\n>>\n>> +static void at91_adc_init_hw(struct at91_adc_state *st, unsigned int freq)\n>> +{\n>> +     at91_adc_writel(st, AT91_SAMA5D2_CR, AT91_SAMA5D2_CR_SWRST);\n>> +     at91_adc_writel(st, AT91_SAMA5D2_IDR, 0xffffffff);\n>> +     /*\n>> +      * Transfer field must be set to 2 according to the datasheet and\n>> +      * allows different analog settings for each channel.\n>> +      */\n>> +     at91_adc_writel(st, AT91_SAMA5D2_MR,\n>> +                     AT91_SAMA5D2_MR_TRANSFER(2) | AT91_SAMA5D2_MR_ANACH);\n>> +\n>> +     at91_adc_setup_samp_freq(st, freq);\n>> +\n>> +}\n>> +\n>>  static int at91_adc_probe(struct platform_device *pdev)\n>>  {\n>>       struct iio_dev *indio_dev;\n>> @@ -482,16 +502,7 @@ static int at91_adc_probe(struct platform_device *pdev)\n>>               goto vref_disable;\n>>       }\n>>\n>> -     at91_adc_writel(st, AT91_SAMA5D2_CR, AT91_SAMA5D2_CR_SWRST);\n>> -     at91_adc_writel(st, AT91_SAMA5D2_IDR, 0xffffffff);\n>> -     /*\n>> -      * Transfer field must be set to 2 according to the datasheet and\n>> -      * allows different analog settings for each channel.\n>> -      */\n>> -     at91_adc_writel(st, AT91_SAMA5D2_MR,\n>> -                     AT91_SAMA5D2_MR_TRANSFER(2) | AT91_SAMA5D2_MR_ANACH);\n>> -\n>> -     at91_adc_setup_samp_freq(st, st->soc_info.min_sample_rate);\n>> +     at91_adc_init_hw(st, st->soc_info.min_sample_rate);\n>>\n>>       ret = clk_prepare_enable(st->per_clk);\n>>       if (ret)\n>> @@ -541,12 +552,52 @@ static const struct of_device_id at91_adc_dt_match[] = {\n>>  };\n>>  MODULE_DEVICE_TABLE(of, at91_adc_dt_match);\n>>\n>> +#ifdef CONFIG_PM_SLEEP\n>> +static int at91_adc_suspend(struct device *dev)\n>> +{\n>> +     struct platform_device *pdev = to_platform_device(dev);\n>> +     struct iio_dev *indio_dev = platform_get_drvdata(pdev);\n>> +     struct at91_adc_state *st = iio_priv(indio_dev);\n>> +\n>> +     clk_disable_unprepare(st->per_clk);\n>> +\n>> +     regulator_disable(st->vref);\n>> +     regulator_disable(st->reg);\n>> +\n>> +     return 0;\n>> +}\n>> +\n>> +static int at91_adc_resume(struct device *dev)\n>> +{\n>> +     struct platform_device *pdev = to_platform_device(dev);\n>> +     struct iio_dev *indio_dev = platform_get_drvdata(pdev);\n>> +     struct at91_adc_state *st = iio_priv(indio_dev);\n>> +     int err;\n>> +\n>> +     err = regulator_enable(st->reg);\n>> +     if (err)\n>> +             return err;\n>> +\n>> +     err = regulator_enable(st->vref);\n>> +     if (err)\n>> +             return err;\n>> +\n>> +     at91_adc_init_hw(st, st->current_rate);\n>> +\n>> +     err = clk_prepare_enable(st->per_clk);\n>> +     return err;\n>> +}\n>> +#endif\n>> +\n>> +static SIMPLE_DEV_PM_OPS(at91_adc_pm_ops, at91_adc_suspend, at91_adc_resume);\n>> +\n>>  static struct platform_driver at91_adc_driver = {\n>>       .probe = at91_adc_probe,\n>>       .remove = at91_adc_remove,\n>>       .driver = {\n>>               .name = \"at91-sama5d2_adc\",\n>>               .of_match_table = at91_adc_dt_match,\n>> +             .pm = &at91_adc_pm_ops,\n>>       },\n>>  };\n>>  module_platform_driver(at91_adc_driver)\n>>\n\nPlease ignore this patch. The existing merged patch is better.\n\nBest regards,","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"WwttZ7J2\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=mobile-devices.fr header.i=@mobile-devices.fr\n\theader.b=\"wHn0NQPT\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"tTay87ea\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xpjKD4sGdz9s81\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tSat,  9 Sep 2017 02:22:40 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dqM3A-0000E7-Bi; Fri, 08 Sep 2017 16:22:36 +0000","from mail-qt0-x22e.google.com ([2607:f8b0:400d:c0d::22e])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dqM2p-0008MQ-P0 for linux-arm-kernel@lists.infradead.org;\n\tFri, 08 Sep 2017 16:22:19 +0000","by mail-qt0-x22e.google.com with SMTP id k2so7617870qte.2\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tFri, 08 Sep 2017 09:21:54 -0700 (PDT)","by 10.200.48.120 with HTTP; Fri, 8 Sep 2017 09:21:33 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=5fHXSFWjD/m9mq2FHVCqAuvecdBBmh2Z8gg6+A1YEdE=;\n\tb=WwttZ7J2KR6Z81\n\tsNJiVPZjCzVDOrWgLE8XNbhZ6P15aiOZxHPiithNCGoQKR8cwAd13hVCoWgdpZ5qDsQyeQZK25QGm\n\t/OOu4SZMjyyS16zr9DqGleDgKyt96LnGZa1toEH41951ah4A16fTFmh0+cW7XY0wNGY1xUWBfKjuC\n\t9Bg+O8PPNabkq65rBmzXg70381dYIzoyGrCXXICUTPLcZQv5GT9J1ntYTJzFcBe6tVm/IiZRqfiaD\n\tR/s6YXnHPF7+kHfJ8QN8Ejt1FqR7suZw2N/8unuBqikWEXXMxJapsm4mIsgHQuBlqEfAZ0iGVgPq3\n\tGDXWPlgW01CcsAV0JBIw==;","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=mobile-devices.fr; s=google;\n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=iCD0zyOs7bT2H5SBMqtaOOWyRXahmaN/GFO1QNuNoK8=;\n\tb=wHn0NQPTfXAq2SnKwur5D7g4Fzhhb1jJYr4M7eKUfkwcCVUyD7pbNXb4c9yGD0JVuy\n\tGOyc2ycxeWT7St7F+LBpt9As9ZyYX/syy6lHc7UhPJpU0ag+6dRx409fn1JfoJl694p8\n\tDbbCFLwnrwM3RKpeCXzmgqMiVqTSE7JOofgGs=","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=iCD0zyOs7bT2H5SBMqtaOOWyRXahmaN/GFO1QNuNoK8=;\n\tb=tTay87eam9PemUdw3TQ1utU+fePPb7nDmbbSG86J877HTP3zFwn1KmC8UoaWj922si\n\tojEoZLAnkLEsTvRPHXUqgA+AICTlynoUSzdaMp9oY3wpHMNB3Yst+AsxO0+oDjDp/PST\n\trgIE4e4F1EHg7B+VxA0QASWPjF73hWd0RbiKGVrPtVJKWTv5riPObJatziNmTROBSQ9o\n\trpCkjHP32FYdmmylaShRnSHpAFUA1wLoUjamf6qUPkO0fG5th3M7mBX3ep9hniUUuOBT\n\t51JGnakF+NZ5Jvs9C+zJJNWa8UAKwexSQABejaQaU33SXRfDVdpeFyJUr1H09rrK+oEG\n\te/bw=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=iCD0zyOs7bT2H5SBMqtaOOWyRXahmaN/GFO1QNuNoK8=;\n\tb=I8zgdTFBebztQWcmel8o+gwrLV+PQ2TPXNd1lcvTGq0ccWDVwYOr0lJt0d6SO0l4AP\n\tFmi8OewmCv4cWIA7qa6elXT9XsN5+sTRCZ4a0MalTIqwYXtNYq2SaOYO5fudPHLUuT2h\n\tba5Ds5YUAgN9bz6jnZu5qmQjtpOc2E0uIpko4s4+tqfMngf3mQ58LMkuCizvdr6hGbND\n\toAPXwgHaLoNqHtdj2G12zeWouKEGjRdQnX6fNCSwHDkoRGtcehgljpGi3oj6UFgvNKBC\n\tjcXqfUfBMMiwEFMvHoADQVvf2QmWwuH3NWTi6wIOdzokSudzCH+MODMts5dN7L8CWF4L\n\tY3/w==","X-Gm-Message-State":"AHPjjUhmx7Y5ummNHbirpCpNkyEwlh+KuH65s1QqTRDQKhKVaBsIIXN8\n\tGn0eDwHJzs7Wnp1k7GQ7xWelJoRwSwuga5zrOyaodg==","X-Google-Smtp-Source":"AOwi7QAdAuslY8C0Ghh9Jlvnhr3a9qk0334+gbdfppQ7eRl2i0tqA98MJeH8u/pFgwAPnEaDLYewAN45tm6T7Y3XiH8=","X-Received":"by 10.237.42.79 with SMTP id k15mr3053882qtf.222.1504887713771; \n\tFri, 08 Sep 2017 09:21:53 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<760d7c25-afa4-2242-a278-e0989bca5478@microchip.com>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-8-romain.izard.pro@gmail.com>\n\t<760d7c25-afa4-2242-a278-e0989bca5478@microchip.com>","From":"Romain Izard <romain.izard.pro@gmail.com>","Date":"Fri, 8 Sep 2017 18:21:33 +0200","X-Google-Sender-Auth":"FsXf9322IYlekeKIog0yF8caJGQ","Message-ID":"<CAGkQfmNgo9kp90eOrrez70f2-kMSD5EzxRjxWi=THBCE9EL4YA@mail.gmail.com>","Subject":"Re: [PATCH v1 07/10] iio:adc:at91-sama5d2: Support backup mode","To":"Nicolas Ferre <nicolas.ferre@microchip.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170908_092216_109881_E1EE4306 ","X-CRM114-Status":"GOOD (  19.02  )","X-Spam-Score":"-1.8 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.8 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2607:f8b0:400d:c0d:0:0:0:22e listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (romain.izard.pro[at]gmail.com)\n\t0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level\n\tmail domains are different\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain\n\t0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and\n\tEnvelopeFrom freemail headers are different","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-iio@vger.kernel.org, Michael Turquette <mturquette@baylibre.com>, \n\tThierry Reding <thierry.reding@gmail.com>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>, linux-clk@vger.kernel.org, \n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tJosh Wu <rainyfeeling@outlook.com>, Marek Vasut <marek.vasut@gmail.com>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tAlan Stern <stern@rowland.harvard.edu>, linux-serial@vger.kernel.org, \n\tlinux-pwm@vger.kernel.org,\n\tlinux-arm-kernel <linux-arm-kernel@lists.infradead.org>,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tlinux-usb@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,\n\tLKML <linux-kernel@vger.kernel.org>, \n\tWenyou Yang <wenyou.yang@atmel.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tEugen Hristev <Eugen.Hristev@microchip.com>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>,\n\tJonathan Cameron <jic23@kernel.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1766187,"web_url":"http://patchwork.ozlabs.org/comment/1766187/","msgid":"<CAGkQfmOBNYeYTrbzAZBZ6cC5==Pfm6pZnho-9P8ggPjMZXX4nA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-11T09:52:12","subject":"Re: [PATCH v1 10/10] tty/serial: atmel: Prevent a warning on suspend","submitter":{"id":8236,"url":"http://patchwork.ozlabs.org/api/people/8236/","name":"Romain Izard","email":"romain.izard.pro@gmail.com"},"content":"2017-09-08 17:36 GMT+02:00 Romain Izard <romain.izard.pro@gmail.com>:\n> The atmel serial port driver reported the following warning on suspend:\n> atmel_usart f8020000.serial: ttyS1: Unable to drain transmitter\n>\n> As the ATMEL_US_TXEMPTY status bit in ATMEL_US_CSR is always cleared\n> when the transmitter is disabled, we need to know the transmitter's\n> state to return the real fifo state. And as ATMEL_US_CR is write-only,\n> it is necessary to save the state of the transmitter in a local\n> variable, and update the variable when TXEN and TXDIS is written in\n> ATMEL_US_CR.\n>\n> After those changes, atmel_tx_empty can return \"empty\" on suspend, the\n> warning in uart_suspend_port disappears, and suspending is 20ms shorter\n> for each enabled Atmel serial port.\n>\n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n> ---\n>  drivers/tty/serial/atmel_serial.c | 13 +++++++++++++\n>  1 file changed, 13 insertions(+)\n>\n> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c\n> index 7551cab438ff..195c0d1b594e 100644\n> --- a/drivers/tty/serial/atmel_serial.c\n> +++ b/drivers/tty/serial/atmel_serial.c\n> @@ -171,6 +171,7 @@ struct atmel_uart_port {\n>         bool                    has_hw_timer;\n>         struct timer_list       uart_timer;\n>\n> +       bool                    tx_stopped;\n>         bool                    suspended;\n>         unsigned int            pending;\n>         unsigned int            pending_status;\n> @@ -380,6 +381,10 @@ static int atmel_config_rs485(struct uart_port *port,\n>   */\n>  static u_int atmel_tx_empty(struct uart_port *port)\n>  {\n> +       struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);\n> +\n> +       if (atmel_port->tx_stopped)\n> +               return TIOCSER_TEMT;\n>         return (atmel_uart_readl(port, ATMEL_US_CSR) & ATMEL_US_TXEMPTY) ?\n>                 TIOCSER_TEMT :\n>                 0;\n> @@ -485,6 +490,7 @@ static void atmel_stop_tx(struct uart_port *port)\n>          * is fully transmitted.\n>          */\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS);\n> +       atmel_port->tx_stopped = true;\n>\n>         /* Disable interrupts */\n>         atmel_uart_writel(port, ATMEL_US_IDR, atmel_port->tx_done_mask);\n> @@ -492,6 +498,7 @@ static void atmel_stop_tx(struct uart_port *port)\n>         if ((port->rs485.flags & SER_RS485_ENABLED) &&\n>             !(port->rs485.flags & SER_RS485_RX_DURING_TX))\n>                 atmel_start_rx(port);\n> +\n>  }\n>\n>  /*\n> @@ -521,6 +528,7 @@ static void atmel_start_tx(struct uart_port *port)\n>\n>         /* re-enable the transmitter */\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);\n> +       atmel_port->tx_stopped = false;\n>  }\n>\n>  /*\n> @@ -1866,6 +1874,7 @@ static int atmel_startup(struct uart_port *port)\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n>         /* enable xmit & rcvr */\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n> +       atmel_port->tx_stopped = false;\n>\n>         setup_timer(&atmel_port->uart_timer,\n>                         atmel_uart_timer_callback,\n> @@ -2122,6 +2131,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,\n>\n>         /* disable receiver and transmitter */\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS | ATMEL_US_RXDIS);\n> +       atmel_port->tx_stopped = true;\n>\n>         /* mode */\n>         if (port->rs485.flags & SER_RS485_ENABLED) {\n> @@ -2207,6 +2217,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,\n>         atmel_uart_writel(port, ATMEL_US_BRGR, quot);\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n> +       atmel_port->tx_stopped = false;\n>\n>         /* restore interrupts */\n>         atmel_uart_writel(port, ATMEL_US_IER, imr);\n> @@ -2450,6 +2461,7 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)\n>\n>         /* Make sure that tx path is actually able to send characters */\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);\n> +       atmel_port->tx_stopped = false;\n>\n>         uart_console_write(port, s, count, atmel_console_putchar);\n>\n> @@ -2528,6 +2540,7 @@ static int __init atmel_console_setup(struct console *co, char *options)\n>         atmel_uart_writel(port, ATMEL_US_IDR, -1);\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n>         atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n> +       atmel_port->tx_stopped = false;\n>\n>         if (options)\n>                 uart_parse_options(options, &baud, &parity, &bits, &flow);\n> --\n> 2.11.0\n>\n\nUnfortunately this patch was broken when I reported it from my branch to\nthe v4.13, as it does not build because of the missing declaration of\n'atmel_port' in 'atmel_console_setup'.\n\nI'll send a corrected version for v2.","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"EQg59UCN\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=mobile-devices.fr header.i=@mobile-devices.fr\n\theader.b=\"sSOB3XLV\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"cJyRr5iJ\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrNXj1cCGz9s7G\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tMon, 11 Sep 2017 19:53:25 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1drLP5-0008ES-2i; Mon, 11 Sep 2017 09:53:19 +0000","from mail-io0-x231.google.com ([2607:f8b0:4001:c06::231])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1drLOg-0007iE-Nf for linux-arm-kernel@lists.infradead.org;\n\tMon, 11 Sep 2017 09:53:06 +0000","by mail-io0-x231.google.com with SMTP id n69so21463221ioi.5\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tMon, 11 Sep 2017 02:52:33 -0700 (PDT)","by 10.202.78.68 with HTTP; Mon, 11 Sep 2017 02:52:12 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=/Nfc9TMsTRlUty0ocIccz1fGSvsBebcJ1sVeDQfzYvY=;\n\tb=EQg59UCN2gGFxd\n\tQEeWRPz2qtv3PPSsORCv6d8DkOlB1LvrbMjexHmZ4vabXsTDCPUOaNwosEPBZQbaJ8pU1Hb1cTlsw\n\tLjnj9q7g5LmAhrEToBMmDzxVs9fEDrKBu8wVGgN7YQPblLBocZjxxpb2rlVgRzIDENoJHFPZazEaQ\n\tDo/pIDQ/VVSggk3PoL7OGe3KXTengCozUhPNnuXR6AEJooo3Ts09vxWc9N+A3gxEaRCl0BeRahtY2\n\t0nCAOAjluc1WlVuGGC62ig7cESZETP6HPl6iwM9r/5vTT2LMwcVPmq4yOOcdkQWpXj5uV8WAZoZZv\n\tDjizgXxhg8vsKAiMUqPQ==;","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=mobile-devices.fr; s=google;\n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=QmWv6SUBu2Efj6pJ+AxjvuNZCr3UKMFQkAno+5fhgpo=;\n\tb=sSOB3XLVSbCc7bmRcBhJGB7/EI9ujLTKm4MbR0g1Tq18B5qB1JNu8EcsAqQ/N87ZuL\n\tmtrFqvWhW44QAlkKI88fHFTjutaYPHe23curwuCePVPh/pgcAZeuPusSasu5BlAeQ2gx\n\twxkf82bnCsjU5BQtRziq6PQFsAU6FJ9KmLPMs=","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=QmWv6SUBu2Efj6pJ+AxjvuNZCr3UKMFQkAno+5fhgpo=;\n\tb=cJyRr5iJbshbq5gfG7racGcpHS6Cwiv/zPj2mXQ/SIhlmf3xVS0ExN2AnT7IKM9Qmy\n\tjSchXIW0G4bIEvWSV5nPim39dsppGIvl1Sl56XPpO1ByH+UHB8lzW/Vyewv1MIdCJVG9\n\tDikIHY3dtQPS2JT8wZ5Nxuyk5lx2iUFxtl7lNBjKR8mGB01Rsn5CQw7w2h3RzbbNeVYd\n\tCekbAPEkzhKHTyETRpjILMnFCfvoefTRqbLP8T0BMzyA+P9H4vfoDwuUzs/F61ftm6cl\n\tFD3xIlMk1mtB9dtVTyIU8hDtTSTGx5UR6Cipq8ChTqdZCfLn6PaehEJq7DWPLJQIY8yK\n\tKkjQ=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=QmWv6SUBu2Efj6pJ+AxjvuNZCr3UKMFQkAno+5fhgpo=;\n\tb=of818qOELeQL0T8wDHtnOVAhxSu5oplh1ZZNQHPf3EC+xdZTo8bN8fLTKRLmN5qpzR\n\tuL1yvwHTKoTLTmfsSik2igXk0jH4TvaF/zxI6QpC+ODxlwGUWYlI2mL+mpOVd5JjloZk\n\tiLLIaixDwYTxW0+TLO/isqR3ZQv1Z8TWfL49hjBNhOUgBvK8eTUAp2OEzFjmFIPdWsg8\n\tbqH+g2rlhN3YUD/+c+VE5kZBS8wHBPjOD/ZHfZRpEbMz1j5F/jKxiupRaqYwO18/g6vX\n\t1qBewLUiGbgl0dGKHZAKFiHpAQIn/jr0JljMO9L7qRvy+H7qCqaU/AHTNbLQRvHP9YRD\n\tfDkw==","X-Gm-Message-State":"AHPjjUhEASCQ+xACh4P0H2kEb7Q1amsmYdZ+JeJgEHl0YZ03mOQDdQYb\n\tIM1KCuXB5UuxHdEqL77djVfZukoCgjOv","X-Google-Smtp-Source":"AOwi7QBwE7SEhp7nN3KLRdj9Odnxl4WHMxQ7WbayCtUdRcb1QKDhb8LwK6WDYr9lrY81HqNNpXuB4J/pmZRNFG2fIJU=","X-Received":"by 10.202.81.147 with SMTP id f141mr9936755oib.160.1505123552570;\n\tMon, 11 Sep 2017 02:52:32 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170908153604.28383-11-romain.izard.pro@gmail.com>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-11-romain.izard.pro@gmail.com>","From":"Romain Izard <romain.izard.pro@gmail.com>","Date":"Mon, 11 Sep 2017 11:52:12 +0200","X-Google-Sender-Auth":"fbg3wLgAXM8aSFC80ZhGE9IZhRs","Message-ID":"<CAGkQfmOBNYeYTrbzAZBZ6cC5==Pfm6pZnho-9P8ggPjMZXX4nA@mail.gmail.com>","Subject":"Re: [PATCH v1 10/10] tty/serial: atmel: Prevent a warning on suspend","To":"Nicolas Ferre <nicolas.ferre@microchip.com>, \n\tBoris Brezillon <boris.brezillon@free-electrons.com>, \n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@codeaurora.org>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tJonathan Cameron <jic23@kernel.org>, \n\tWenyou Yang <wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>, \n\tDavid Woodhouse <dwmw2@infradead.org>,\n\tBrian Norris <computersforpeace@gmail.com>, \n\tMarek Vasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, \n\tThierry Reding <thierry.reding@gmail.com>,\n\tRichard Genoud <richard.genoud@gmail.com>, \n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tAlan Stern <stern@rowland.harvard.edu>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170911_025255_674633_3DF1391E ","X-CRM114-Status":"GOOD (  21.47  )","X-Spam-Score":"-2.5 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.5 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow\n\ttrust [2607:f8b0:4001:c06:0:0:0:231 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (romain.izard.pro[at]gmail.com)\n\t0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level\n\tmail domains are different\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain\n\t0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and\n\tEnvelopeFrom freemail headers are different","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-pwm@vger.kernel.org, linux-iio@vger.kernel.org,\n\tlinux-usb@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>, linux-serial@vger.kernel.org, \n\tRomain Izard <romain.izard.pro@gmail.com>, linux-clk@vger.kernel.org, \n\tlinux-arm-kernel <linux-arm-kernel@lists.infradead.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1767829,"web_url":"http://patchwork.ozlabs.org/comment/1767829/","msgid":"<318420d4-044f-d018-f70e-3ed4fcfb0fd0@microchip.com>","list_archive_url":null,"date":"2017-09-13T12:10:41","subject":"Re: [PATCH v1 02/10] clk: at91: pmc: Save SCSR during suspend","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 08/09/2017 at 17:35, Romain Izard wrote:\n> The contents of the System Clock Status Register (SCSR) needs to be\n> restored into the System Clock Enable Register (SCER).\n> \n> As the bootloader will restore some clocks by itself, the issue can be\n> missed as only the USB controller, the LCD controller, the Image Sensor\n> controller and the programmable clocks will be impacted.\n> \n> Fix the obvious typo in the suspend/resume code, as the IMR register\n> does not need to be saved twice.\n> \n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n\nYes, it looks like a typo:\nAcked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n\nI didn't experienced the issue with LCD nor USB though.\n\nRegards,\n\n> ---\n>  drivers/clk/at91/pmc.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n> index 5c2b26de303e..07dc2861ad3f 100644\n> --- a/drivers/clk/at91/pmc.c\n> +++ b/drivers/clk/at91/pmc.c\n> @@ -86,7 +86,7 @@ static int pmc_suspend(void)\n>  {\n>  \tint i;\n>  \n> -\tregmap_read(pmcreg, AT91_PMC_IMR, &pmc_cache.scsr);\n> +\tregmap_read(pmcreg, AT91_PMC_SCSR, &pmc_cache.scsr);\n>  \tregmap_read(pmcreg, AT91_PMC_PCSR, &pmc_cache.pcsr0);\n>  \tregmap_read(pmcreg, AT91_CKGR_UCKR, &pmc_cache.uckr);\n>  \tregmap_read(pmcreg, AT91_CKGR_MOR, &pmc_cache.mor);\n> @@ -129,7 +129,7 @@ static void pmc_resume(void)\n>  \tif (pmc_cache.pllar != tmp)\n>  \t\tpr_warn(\"PLLAR was not configured properly by the firmware\\n\");\n>  \n> -\tregmap_write(pmcreg, AT91_PMC_IMR, pmc_cache.scsr);\n> +\tregmap_write(pmcreg, AT91_PMC_SCER, pmc_cache.scsr);\n>  \tregmap_write(pmcreg, AT91_PMC_PCER, pmc_cache.pcsr0);\n>  \tregmap_write(pmcreg, AT91_CKGR_UCKR, pmc_cache.uckr);\n>  \tregmap_write(pmcreg, AT91_CKGR_MOR, pmc_cache.mor);\n>","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"QwobIxpX\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsgTl6kmGz9sNV\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 22:10:19 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds6Uj-0001UZ-0m; Wed, 13 Sep 2017 12:10:17 +0000","from esa5.microchip.iphmx.com ([216.71.150.166])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds6UQ-0000NP-Cc; Wed, 13 Sep 2017 12:10:00 +0000","from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t13 Sep 2017 05:09:34 -0700","from [10.159.245.112] (10.10.76.4) by chn-sv-exch06.mchp-main.com\n\t(10.10.76.107) with Microsoft SMTP Server id 14.3.352.0;\n\tWed, 13 Sep 2017 05:09:33 -0700"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:\n\tMessage-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description\n\t:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=9Ie3ln+iX3JuBsTOtgFZ3YUhaXnNNnb3mLu8z6KVIY0=;\n\tb=QwobIxpXaOeG2u\n\tNdsTfitZjX4i0pQPLvCOdCHbgj6ouXUY7A6bvwVDRz8rand+kc6xZ5+WhrXTRRERzLpmDm8Hf7f2w\n\tWrbcuW7lCSV2u9UN/kO9XBZ1axF7Vd4gz9ggK6wX4Imuk39EQ5TQ93gKXU7Os6W4lLa4u+veOd4cP\n\tZ2LxmYxcrCDdjdMqXszdZFcfdVg0K/GupJV/2VzVSncYnIPvq0NhHFl5QOVtyisoqCedfcLI6CGno\n\tTajH3m6NMin78OS4KOkEUQY9C7ZXDEZ3IFbMSxeAuaV2E0SyWvigobieNqRz5xdej+nrjqZTLysGQ\n\t4NTbVSSgBq/a1XibMEFA==;","X-IronPort-AV":"E=Sophos;i=\"5.42,387,1500966000\"; d=\"scan'208\";a=\"4669448\"","Subject":"Re: [PATCH v1 02/10] clk: at91: pmc: Save SCSR during suspend","To":"Romain Izard <romain.izard.pro@gmail.com>, Boris Brezillon\n\t<boris.brezillon@free-electrons.com>, Michael Turquette\n\t<mturquette@baylibre.com>, Stephen Boyd <sboyd@codeaurora.org>, Ludovic\n\tDesroches <ludovic.desroches@microchip.com>, Jonathan Cameron\n\t<jic23@kernel.org>, Wenyou Yang <wenyou.yang@atmel.com>, Josh Wu\n\t<rainyfeeling@outlook.com>, David Woodhouse <dwmw2@infradead.org>, Brian\n\tNorris <computersforpeace@gmail.com>,\n\tMarek Vasut <marek.vasut@gmail.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, Thierry Reding\n\t<thierry.reding@gmail.com>, Richard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, Alan Stern\n\t<stern@rowland.harvard.edu>, Alexandre Belloni\n\t<alexandre.belloni@free-electrons.com>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-3-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<318420d4-044f-d018-f70e-3ed4fcfb0fd0@microchip.com>","Date":"Wed, 13 Sep 2017 14:10:41 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170908153604.28383-3-romain.izard.pro@gmail.com>","Content-Language":"en-US","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170913_050958_489072_14562889 ","X-CRM114-Status":"GOOD (  13.97  )","X-Spam-Score":"-2.6 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.6 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [216.71.150.166 listed in list.dnswl.org]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-pwm@vger.kernel.org, linux-iio@vger.kernel.org,\n\tlinux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org, linux-serial@vger.kernel.org,\n\tlinux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1767834,"web_url":"http://patchwork.ozlabs.org/comment/1767834/","msgid":"<14fb5261-bb03-a6bd-6653-2a2c655b04ee@microchip.com>","list_archive_url":null,"date":"2017-09-13T12:15:30","subject":"Re: [PATCH v1 01/10] clk: at91: pmc: Wait for clocks when resuming","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 08/09/2017 at 17:35, Romain Izard wrote:\n> Wait for the syncronization of all clocks when resuming, not only the\n> UPLL clock. Do not use regmap_read_poll_timeout, as it will call BUG()\n> when interrupts are masked, which is the case in here.\n> \n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n> ---\n>  drivers/clk/at91/pmc.c | 24 ++++++++++++++++--------\n>  1 file changed, 16 insertions(+), 8 deletions(-)\n> \n> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n> index 775af473fe11..5c2b26de303e 100644\n> --- a/drivers/clk/at91/pmc.c\n> +++ b/drivers/clk/at91/pmc.c\n> @@ -107,10 +107,20 @@ static int pmc_suspend(void)\n>  \treturn 0;\n>  }\n>  \n> +static bool pmc_ready(unsigned int mask)\n> +{\n> +\tunsigned int status;\n> +\n> +\tregmap_read(pmcreg, AT91_PMC_SR, &status);\n> +\n> +\treturn ((status & mask) == mask) ? 1 : 0;\n> +}\n> +\n>  static void pmc_resume(void)\n>  {\n> -\tint i, ret = 0;\n> +\tint i;\n>  \tu32 tmp;\n> +\tu32 mask = AT91_PMC_MCKRDY | AT91_PMC_LOCKA;\n>  \n>  \tregmap_read(pmcreg, AT91_PMC_MCKR, &tmp);\n>  \tif (pmc_cache.mckr != tmp)\n> @@ -134,13 +144,11 @@ static void pmc_resume(void)\n>  \t\t\t     AT91_PMC_PCR_CMD);\n>  \t}\n>  \n> -\tif (pmc_cache.uckr & AT91_PMC_UPLLEN) {\n> -\t\tret = regmap_read_poll_timeout(pmcreg, AT91_PMC_SR, tmp,\n> -\t\t\t\t\t       !(tmp & AT91_PMC_LOCKU),\n> -\t\t\t\t\t       10, 5000);\n> -\t\tif (ret)\n> -\t\t\tpr_crit(\"USB PLL didn't lock when resuming\\n\");\n> -\t}\n> +\tif (pmc_cache.uckr & AT91_PMC_UPLLEN)\n> +\t\tmask |= AT91_PMC_LOCKU;\n> +\n> +\twhile (!pmc_ready(mask))\n> +\t\tcpu_relax();\n\nOkay, but I would prefer to keep the timeout property in it. So we may\nneed to re-implement a timeout way-out here.\n\nRegards,\n\n>  }\n>  \n>  static struct syscore_ops pmc_syscore_ops = {\n>","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"oyK/SrPh\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsgbV3CPDz9sPk\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 22:15:18 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds6ZX-0003sL-5c; Wed, 13 Sep 2017 12:15:15 +0000","from esa1.microchip.iphmx.com ([68.232.147.91])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds6Z4-0002fp-4t; Wed, 13 Sep 2017 12:14:48 +0000","from exsmtp03.microchip.com (HELO email.microchip.com)\n\t([198.175.253.49])\n\tby esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t13 Sep 2017 05:14:23 -0700","from [10.159.245.112] (10.10.76.4) by chn-sv-exch03.mchp-main.com\n\t(10.10.76.49) with Microsoft SMTP Server id 14.3.352.0;\n\tWed, 13 Sep 2017 05:14:23 -0700"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:\n\tMessage-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description\n\t:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=Z7jhR3ebUm9rKWEdaHleu2ZxpKyFHsW89rfVDCR1K4g=;\n\tb=oyK/SrPhhWH0cw\n\tiTGUz48OrbAvtwdA7lYBfn8r29MaLGlkJVIPAFDPyfqeZ+a/gEL4p+X7jkNrNnJ0v179X4aCx9+cQ\n\tBKiNQ7Pkgff0VooEHhNsLmxHVzaNH8g+J4LgoQjimgvDMdEQ1rSUhJ+taAqtv9lK5nT/cJDXMbK5+\n\t/Ti5D+dj1IntiyTo4AEaUAALkH1GKiArEMUYP+SfNTYioAOMIr+vejU5efRmqwcoEKqXTJIMDhypy\n\tZfRPgOhU3DWarTJQKPV/4Dj+fruqNcrS3UgERSUta+V+H/7lIOOyHHKJAIo57ErawWTeQrgExVsCO\n\t0wW7hoG3adCSKipfwCsA==;","X-IronPort-AV":"E=Sophos;i=\"5.42,387,1500966000\"; d=\"scan'208\";a=\"7360655\"","Subject":"Re: [PATCH v1 01/10] clk: at91: pmc: Wait for clocks when resuming","To":"Romain Izard <romain.izard.pro@gmail.com>, Boris Brezillon\n\t<boris.brezillon@free-electrons.com>, Michael Turquette\n\t<mturquette@baylibre.com>, Stephen Boyd <sboyd@codeaurora.org>, Ludovic\n\tDesroches <ludovic.desroches@microchip.com>, Jonathan Cameron\n\t<jic23@kernel.org>, Wenyou Yang <wenyou.yang@atmel.com>, Josh Wu\n\t<rainyfeeling@outlook.com>, David Woodhouse <dwmw2@infradead.org>, Brian\n\tNorris <computersforpeace@gmail.com>,\n\tMarek Vasut <marek.vasut@gmail.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, Thierry Reding\n\t<thierry.reding@gmail.com>, Richard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, Alan Stern\n\t<stern@rowland.harvard.edu>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-2-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<14fb5261-bb03-a6bd-6653-2a2c655b04ee@microchip.com>","Date":"Wed, 13 Sep 2017 14:15:30 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170908153604.28383-2-romain.izard.pro@gmail.com>","Content-Language":"en-US","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170913_051446_339933_2F458848 ","X-CRM114-Status":"GOOD (  14.83  )","X-Spam-Score":"-2.6 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.6 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [68.232.147.91 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-pwm@vger.kernel.org, linux-iio@vger.kernel.org,\n\tlinux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org, linux-serial@vger.kernel.org,\n\tlinux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1767850,"web_url":"http://patchwork.ozlabs.org/comment/1767850/","msgid":"<b0c7e816-4a7c-609d-2bc7-281fc6ca751d@microchip.com>","list_archive_url":null,"date":"2017-09-13T12:29:35","subject":"Re: [PATCH v1 03/10] clk: at91: pmc: Support backup for programmable\n\tclocks","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 08/09/2017 at 17:35, Romain Izard wrote:\n> From: Romain Izard <romain.izard@mobile-devices.fr>\n> \n> Save and restore the System Clock and Programmable Clock register for\n> the backup use case.\n\n\"System Clock\" seems to be handled in another patch.\n\n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n> ---\n>  drivers/clk/at91/pmc.c | 5 +++++\n>  1 file changed, 5 insertions(+)\n> \n> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n> index 07dc2861ad3f..5421b03553ec 100644\n> --- a/drivers/clk/at91/pmc.c\n> +++ b/drivers/clk/at91/pmc.c\n> @@ -66,6 +66,7 @@ static struct\n>  \tu32 pcr[PMC_MAX_IDS];\n>  \tu32 audio_pll0;\n>  \tu32 audio_pll1;\n> +\tu32 pckr[3];\n\nSome products have different numbers of PCK (only 2 on at91sam9x5 for\ninstance)...\n\n>  } pmc_cache;\n>  \n>  void pmc_register_id(u8 id)\n> @@ -103,6 +104,8 @@ static int pmc_suspend(void)\n>  \t\tregmap_read(pmcreg, AT91_PMC_PCR,\n>  \t\t\t    &pmc_cache.pcr[registered_ids[i]]);\n>  \t}\n> +\tfor (i = 0; i < 3; i++)\n\nAnd it might be a good practice to have this constant value in a #define.\nWe have \"#define PROG_ID_MAX  7\" defined in\ndrivers/clk/at91/clk-programmable.c.\n\nRegards,\n\n\n> +\t\tregmap_read(pmcreg, AT91_PMC_PCKR(i), &pmc_cache.pckr[i]);\n>  \n>  \treturn 0;\n>  }\n> @@ -143,6 +146,8 @@ static void pmc_resume(void)\n>  \t\t\t     pmc_cache.pcr[registered_ids[i]] |\n>  \t\t\t     AT91_PMC_PCR_CMD);\n>  \t}\n> +\tfor (i = 0; i < 3; i++)\n> +\t\tregmap_write(pmcreg, AT91_PMC_PCKR(i), pmc_cache.pckr[i]);\n>  \n>  \tif (pmc_cache.uckr & AT91_PMC_UPLLEN)\n>  \t\tmask |= AT91_PMC_LOCKU;\n>","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"NeKkcrdE\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsgvk2FXSz9sPm\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 22:29:22 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds6n9-0001ki-FR; Wed, 13 Sep 2017 12:29:19 +0000","from esa2.microchip.iphmx.com ([68.232.149.84])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds6ms-0001VV-9K; Wed, 13 Sep 2017 12:29:03 +0000","from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa2.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t13 Sep 2017 05:28:29 -0700","from [10.159.245.112] (10.10.76.4) by chn-sv-exch07.mchp-main.com\n\t(10.10.76.108) with Microsoft SMTP Server id 14.3.352.0;\n\tWed, 13 Sep 2017 05:28:28 -0700"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:\n\tMessage-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description\n\t:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=K4IY4ZAUDjHZtYnQ3pGpaNjjRBRD4tU454kke9AtAiY=;\n\tb=NeKkcrdEKQQlDF\n\tnF83bloHWOo2NbKEs5l56XZB+uDazayhz0cibNgxzZDt9DedHaGgxs2pGBD8AMRHxF1yOxM7MHmkn\n\tZ65a+CjQD9gTX2DEYqapt72QJ/zWn7JTQC3NvnwxE2mmtcydXEvr5njr2cB86OEpYM27nmMopYr/M\n\tuY2XPCqcY410o/jh+lKcXCPLcBr1uByBRazgFh7RbWj4iTkzFB/LJ7Je/oGCzW8tHf/qeo830dk3G\n\tQJCLMBTrHy0egxWxxBatR8rZqlgGrnWBXNPZwym0CujIceYjYr8MRzENr3S+7abQJxQzRN1wvRcTV\n\tI/BVYXgpqHgO/EUR3RuQ==;","X-IronPort-AV":"E=Sophos;i=\"5.42,387,1500966000\"; d=\"scan'208\";a=\"6957384\"","Subject":"Re: [PATCH v1 03/10] clk: at91: pmc: Support backup for programmable\n\tclocks","To":"Romain Izard <romain.izard.pro@gmail.com>, Boris Brezillon\n\t<boris.brezillon@free-electrons.com>, Michael Turquette\n\t<mturquette@baylibre.com>, Stephen Boyd <sboyd@codeaurora.org>, Ludovic\n\tDesroches <ludovic.desroches@microchip.com>, Jonathan Cameron\n\t<jic23@kernel.org>, Wenyou Yang <wenyou.yang@atmel.com>, Josh Wu\n\t<rainyfeeling@outlook.com>, David Woodhouse <dwmw2@infradead.org>, Brian\n\tNorris <computersforpeace@gmail.com>,\n\tMarek Vasut <marek.vasut@gmail.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, Thierry Reding\n\t<thierry.reding@gmail.com>, Richard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, Alan Stern\n\t<stern@rowland.harvard.edu>, Alexandre Belloni\n\t<alexandre.belloni@free-electrons.com>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-4-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<b0c7e816-4a7c-609d-2bc7-281fc6ca751d@microchip.com>","Date":"Wed, 13 Sep 2017 14:29:35 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170908153604.28383-4-romain.izard.pro@gmail.com>","Content-Language":"en-US","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170913_052902_409021_E9CC2F8D ","X-CRM114-Status":"GOOD (  12.33  )","X-Spam-Score":"-2.6 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.6 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [68.232.149.84 listed in list.dnswl.org]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-pwm@vger.kernel.org, linux-iio@vger.kernel.org,\n\tlinux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org, linux-serial@vger.kernel.org,\n\tRomain Izard <romain.izard@mobile-devices.fr>,\n\tlinux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1768030,"web_url":"http://patchwork.ozlabs.org/comment/1768030/","msgid":"<20170913170310.grfv7j5xvh7chjdo@piout.net>","list_archive_url":null,"date":"2017-09-13T17:03:10","subject":"Re: [PATCH v1 03/10] clk: at91: pmc: Support backup for programmable\n\tclocks","submitter":{"id":26276,"url":"http://patchwork.ozlabs.org/api/people/26276/","name":"Alexandre Belloni","email":"alexandre.belloni@free-electrons.com"},"content":"On 13/09/2017 at 14:29:35 +0200, Nicolas Ferre wrote:\n> On 08/09/2017 at 17:35, Romain Izard wrote:\n> > From: Romain Izard <romain.izard@mobile-devices.fr>\n> > \n> > Save and restore the System Clock and Programmable Clock register for\n> > the backup use case.\n> \n> \"System Clock\" seems to be handled in another patch.\n> \n> > Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n> > ---\n> >  drivers/clk/at91/pmc.c | 5 +++++\n> >  1 file changed, 5 insertions(+)\n> > \n> > diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n> > index 07dc2861ad3f..5421b03553ec 100644\n> > --- a/drivers/clk/at91/pmc.c\n> > +++ b/drivers/clk/at91/pmc.c\n> > @@ -66,6 +66,7 @@ static struct\n> >  \tu32 pcr[PMC_MAX_IDS];\n> >  \tu32 audio_pll0;\n> >  \tu32 audio_pll1;\n> > +\tu32 pckr[3];\n> \n> Some products have different numbers of PCK (only 2 on at91sam9x5 for\n> instance)...\n> \n\nMy opinion is that it will be time to change that when multiple SoCs\nwill need to save their registers.","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"vBmLkPin\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsp0y5sTbz9s9Y\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 03:04:18 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dsB5D-0001tM-IW; Wed, 13 Sep 2017 17:04:15 +0000","from mail.free-electrons.com ([62.4.15.54])\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dsB4e-0001pJ-Pi; Wed, 13 Sep 2017 17:03:43 +0000","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 5F2012097F; Wed, 13 Sep 2017 19:03:17 +0200 (CEST)","from localhost (unknown [12.145.98.253])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id ADA03208E5;\n\tWed, 13 Sep 2017 19:03:16 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=Lh7L5gzqIHJyUa1grh0toqVBxQ8trJi1u8l5lYPRQsg=;\n\tb=vBmLkPinIBZK4d\n\t/BBvSsnBIpy0CB+TCbXiK2UWaRoM/shA9xU+g2N3pWn99wlqoO1nnAlVgp7VPuisBI8m2zzApQohV\n\tMPPnQmXUkEBTZPEbmoNla9kvRA9Ur0kNlsvw8Ik7c/vu+gvN7N07vmwXaiwkpx9GHF+47QsFZobA4\n\tsvKL040fB88LW6VHrjRU47BXwuJB8E9JVwi6UqBc2VdlcCkJqNdPMtDNM9C3WfyEDA/FgNureG/aJ\n\tVWB5D8SLjA+NuqRAvspZIYFhHChW1YFUVsS2mihtbJPkVC0+mKhdz8PrAzaoGR6+LWBi/o8iN+VNm\n\tswillCDLwItQXxAHS7zA==;","X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","Date":"Wed, 13 Sep 2017 19:03:10 +0200","From":"Alexandre Belloni <alexandre.belloni@free-electrons.com>","To":"Nicolas Ferre <nicolas.ferre@microchip.com>","Subject":"Re: [PATCH v1 03/10] clk: at91: pmc: Support backup for programmable\n\tclocks","Message-ID":"<20170913170310.grfv7j5xvh7chjdo@piout.net>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-4-romain.izard.pro@gmail.com>\n\t<b0c7e816-4a7c-609d-2bc7-281fc6ca751d@microchip.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<b0c7e816-4a7c-609d-2bc7-281fc6ca751d@microchip.com>","User-Agent":"NeoMutt/20170609 (1.8.3)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170913_100341_002211_4A2858C2 ","X-CRM114-Status":"GOOD (  13.76  )","X-Spam-Score":"-1.9 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-iio@vger.kernel.org, Michael Turquette <mturquette@baylibre.com>, \n\tThierry Reding <thierry.reding@gmail.com>, linux-mtd@lists.infradead.org,\n\tRomain Izard <romain.izard.pro@gmail.com>, linux-clk@vger.kernel.org, \n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tJosh Wu <rainyfeeling@outlook.com>, Marek Vasut <marek.vasut@gmail.com>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tAlan Stern <stern@rowland.harvard.edu>, linux-serial@vger.kernel.org, \n\tRomain Izard <romain.izard@mobile-devices.fr>,\n\tlinux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tlinux-usb@vger.kernel.org, \n\tStephen Boyd <sboyd@codeaurora.org>, linux-kernel@vger.kernel.org,\n\tWenyou Yang <wenyou.yang@atmel.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>,\n\tJonathan Cameron <jic23@kernel.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1768388,"web_url":"http://patchwork.ozlabs.org/comment/1768388/","msgid":"<CAGkQfmOZBi4tzUSEAD7J+w_v+pZ_yFgPRBaYaLnW-ptFZO0rvg@mail.gmail.com>","list_archive_url":null,"date":"2017-09-14T07:41:36","subject":"Re: [PATCH v1 03/10] clk: at91: pmc: Support backup for programmable\n\tclocks","submitter":{"id":68075,"url":"http://patchwork.ozlabs.org/api/people/68075/","name":"romain izard","email":"romain.izard@mobile-devices.fr"},"content":"2017-09-13 19:03 GMT+02:00 Alexandre Belloni\n<alexandre.belloni@free-electrons.com>:\n> On 13/09/2017 at 14:29:35 +0200, Nicolas Ferre wrote:\n>> On 08/09/2017 at 17:35, Romain Izard wrote:\n>> > From: Romain Izard <romain.izard@mobile-devices.fr>\n>> >\n>> > Save and restore the System Clock and Programmable Clock register for\n>> > the backup use case.\n>>\n>> \"System Clock\" seems to be handled in another patch.\n>>\n>> > Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n>> > ---\n>> >  drivers/clk/at91/pmc.c | 5 +++++\n>> >  1 file changed, 5 insertions(+)\n>> >\n>> > diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n>> > index 07dc2861ad3f..5421b03553ec 100644\n>> > --- a/drivers/clk/at91/pmc.c\n>> > +++ b/drivers/clk/at91/pmc.c\n>> > @@ -66,6 +66,7 @@ static struct\n>> >     u32 pcr[PMC_MAX_IDS];\n>> >     u32 audio_pll0;\n>> >     u32 audio_pll1;\n>> > +   u32 pckr[3];\n>>\n>> Some products have different numbers of PCK (only 2 on at91sam9x5 for\n>> instance)...\n>>\n>\n> My opinion is that it will be time to change that when multiple SoCs will\n> need to save their registers.\n>\nFor the next version, I'll add a #define. But as this code requires a\ndevice tree node with the compatible string \"atmel,sama5d2-pmc\", I believe\nthat we can ignore other chips for now.","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"Qg+QaykN\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=mobile-devices.fr header.i=@mobile-devices.fr\n\theader.b=\"LH7b/oAY\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xt9mL0S06z9t1t\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 17:54:42 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dsOyn-00031P-ND; Thu, 14 Sep 2017 07:54:33 +0000","from mail-qk0-x233.google.com ([2607:f8b0:400d:c09::233])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dsOmx-0005Jl-CB for linux-arm-kernel@lists.infradead.org;\n\tThu, 14 Sep 2017 07:42:24 +0000","by mail-qk0-x233.google.com with SMTP id b23so5605422qkg.1\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tThu, 14 Sep 2017 00:41:58 -0700 (PDT)","by 10.200.48.120 with HTTP; Thu, 14 Sep 2017 00:41:36 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=pid+qf/nMHl8QxnWvcbFVTfEUrdfmkop/ikanKgFoJA=;\n\tb=Qg+QaykNP+73AZ\n\t98vqIY01H+WV32tdQEcK6l6kBLhhy+rFuURKTG62HHXd0GVf14+qoK2QqPRQ6Dv2XKDYT5czCEafZ\n\tPEiqvPNA1MIKLjYlGN9SfJ/UXjbgspUwfrpAUBKDiW9lgLIIVn/TyIOh/QaSgrqE680Iw990vBoaY\n\tnrcR7suKthy/WMYUcgaJt18CpkYJmmA5Xwkp59mzrT+VD0OhUPOwuOU/MpfUbK3XnaiuhTIOvddcq\n\tWuM1AO3zGSBff8GueeQv/+vNtoRuN5AM0XDgNyYvJAq3HWQlmcLj1jG7iI2l+x7Lbwq7xOmzsotKG\n\t2Eqkg5riuwkE1FXDnxYw==;","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=mobile-devices.fr; s=google;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=/Wc0vcmET/0h2/TKJGTNBbso0HlS14Zu/QRlgRJXRFQ=;\n\tb=LH7b/oAYJIyKyo/uEesi8SgQh4W2dyUmj9Q1R6DKMh3d8PykskDuNRgCHURcpuFd8e\n\tev1MF0HjWAE58GEEMC6uLi7rZc1RxOn2vIq09C2RqBeffOntXMyZ92FrJugiozIfQx9q\n\ts6HrIoCwbBcEUzsOvGySjfglunyE2k8qI2gLA="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=/Wc0vcmET/0h2/TKJGTNBbso0HlS14Zu/QRlgRJXRFQ=;\n\tb=PzPCzwx5LMJ5I9BI5Vupy4Dad1dTNCUXSe653IkRYPBurrgZ6ONQqUtnDI7ncyODkd\n\tjo6v+CShXXRB1mEXYINFtJGzOWmJkvlkJJWxI4aFrbeic+Gl0LJXCcQ64kADrJUp/fY6\n\t4wqo+uRfz1bhLcEtLFH/lGzgfVnUd2QyoV4QYDRMAAGSuEVtoN+vhb/wFKxkJtpzLkem\n\tZ+cOVi6ehQg0qBmsQ6kAINERz4NsjnIs5cMab/60x4I78DLd3hAAOS+SWztNrredvkUi\n\tvtDnG+b72uI+iToHVPjJ4mEOF4qjBXJDLwBbr9e/EFR7BKbFzb2FSZwoWb9cpGNzkjdp\n\t6H0g==","X-Gm-Message-State":"AHPjjUh22jJfScX1rJMqAL3cjdjtRKxL7hF3b62iWAdXe8QBPfw1wRHQ\n\tyudkJZcbxF7OAKIKA8/SJHI2vy4i8/E/MDWlCdpCcg==","X-Google-Smtp-Source":"AOwi7QCUXmUyt6U89S40Nv6vV2FMp8ARJHIqO3z5xB0fcd1vPIZKbzD32hQOLnvnbO2R5J1wMo0LksYbnUtw9tviKSk=","X-Received":"by 10.55.154.4 with SMTP id c4mr1460213qke.131.1505374917344;\n\tThu, 14 Sep 2017 00:41:57 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170913170310.grfv7j5xvh7chjdo@piout.net>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-4-romain.izard.pro@gmail.com>\n\t<b0c7e816-4a7c-609d-2bc7-281fc6ca751d@microchip.com>\n\t<20170913170310.grfv7j5xvh7chjdo@piout.net>","From":"romain izard <romain.izard@mobile-devices.fr>","Date":"Thu, 14 Sep 2017 09:41:36 +0200","Message-ID":"<CAGkQfmOZBi4tzUSEAD7J+w_v+pZ_yFgPRBaYaLnW-ptFZO0rvg@mail.gmail.com>","Subject":"Re: [PATCH v1 03/10] clk: at91: pmc: Support backup for programmable\n\tclocks","To":"Alexandre Belloni <alexandre.belloni@free-electrons.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170914_004219_654017_C5267875 ","X-CRM114-Status":"GOOD (  14.38  )","X-Spam-Score":"-2.7 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.7 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow\n\ttrust [2607:f8b0:400d:c09:0:0:0:233 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-iio@vger.kernel.org, Michael Turquette <mturquette@baylibre.com>, \n\tThierry Reding <thierry.reding@gmail.com>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>, linux-clk@vger.kernel.org, \n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tJosh Wu <rainyfeeling@outlook.com>, Marek Vasut <marek.vasut@gmail.com>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tAlan Stern <stern@rowland.harvard.edu>, linux-serial@vger.kernel.org, \n\tlinux-pwm@vger.kernel.org,\n\tlinux-arm-kernel <linux-arm-kernel@lists.infradead.org>,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tlinux-usb@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,\n\tLKML <linux-kernel@vger.kernel.org>, \n\tWenyou Yang <wenyou.yang@atmel.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>,\n\tJonathan Cameron <jic23@kernel.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1768467,"web_url":"http://patchwork.ozlabs.org/comment/1768467/","msgid":"<dc318434-cf3e-6cb9-2072-7b8ec45aed97@microchip.com>","list_archive_url":null,"date":"2017-09-14T09:38:45","subject":"Re: [PATCH v1 03/10] clk: at91: pmc: Support backup for programmable\n\tclocks","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 14/09/2017 at 09:41, romain izard wrote:\n> 2017-09-13 19:03 GMT+02:00 Alexandre Belloni\n> <alexandre.belloni@free-electrons.com>:\n>> On 13/09/2017 at 14:29:35 +0200, Nicolas Ferre wrote:\n>>> On 08/09/2017 at 17:35, Romain Izard wrote:\n>>>> From: Romain Izard <romain.izard@mobile-devices.fr>\n>>>>\n>>>> Save and restore the System Clock and Programmable Clock register for\n>>>> the backup use case.\n>>>\n>>> \"System Clock\" seems to be handled in another patch.\n>>>\n>>>> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n>>>> ---\n>>>>  drivers/clk/at91/pmc.c | 5 +++++\n>>>>  1 file changed, 5 insertions(+)\n>>>>\n>>>> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n>>>> index 07dc2861ad3f..5421b03553ec 100644\n>>>> --- a/drivers/clk/at91/pmc.c\n>>>> +++ b/drivers/clk/at91/pmc.c\n>>>> @@ -66,6 +66,7 @@ static struct\n>>>>     u32 pcr[PMC_MAX_IDS];\n>>>>     u32 audio_pll0;\n>>>>     u32 audio_pll1;\n>>>> +   u32 pckr[3];\n>>>\n>>> Some products have different numbers of PCK (only 2 on at91sam9x5 for\n>>> instance)...\n>>>\n>>\n>> My opinion is that it will be time to change that when multiple SoCs will\n>> need to save their registers.\n>>\n> For the next version, I'll add a #define. But as this code requires a\n> device tree node with the compatible string \"atmel,sama5d2-pmc\", I believe\n> that we can ignore other chips for now.\n\nFair enough, let's go for this.\n\nBye,","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"me7805bu\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtD435QBfz9s0g\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 19:38:27 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dsQbH-0000oT-VN; Thu, 14 Sep 2017 09:38:23 +0000","from esa5.microchip.iphmx.com ([216.71.150.166])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dsQau-0000XB-ON; Thu, 14 Sep 2017 09:38:08 +0000","from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t14 Sep 2017 02:37:39 -0700","from [10.159.245.112] (10.10.76.4) by chn-sv-exch06.mchp-main.com\n\t(10.10.76.107) with Microsoft SMTP Server id 14.3.352.0;\n\tThu, 14 Sep 2017 02:37:37 -0700"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:\n\tMessage-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description\n\t:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=RrwozSNSuLQOwOYxy23OnWw9HU5/hNryKA6+rXUJYzA=;\n\tb=me7805buWRa9Va\n\tluJ7up9ZdI1aAvvNLDyZ+mezOaiS5wShJCufHN9UzEQ1yxmKA5yOxOuLgDRQIs0N3ZWiPelz6KG0n\n\tcOIrai/j4GIO4bWDqV/OhM2o+mTINuZ2eLW4Jeb8fO0y+zb3J8XbF9HBG4xyDbbCsoa6oltICdNGD\n\tIedwcocSp4gEqel8U4B/C6YUl314L0biIjmUXlzLi/YLlk8M3mizyXuPtrP+aUvdfS1U2ScNO3BFc\n\tq1dKMNq8WevDKeHUw8+aDzFXPSfVyfDdv+8nj3Wg6uWDqnK/sSponEiV0ZmhzF/P6JWUQYVq5tfY1\n\tWepo7uzroELki3VTsXuQ==;","X-IronPort-AV":"E=Sophos;i=\"5.42,392,1500966000\"; d=\"scan'208\";a=\"4701090\"","Subject":"Re: [PATCH v1 03/10] clk: at91: pmc: Support backup for programmable\n\tclocks","To":"romain izard <romain.izard@mobile-devices.fr>, Alexandre Belloni\n\t<alexandre.belloni@free-electrons.com>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-4-romain.izard.pro@gmail.com>\n\t<b0c7e816-4a7c-609d-2bc7-281fc6ca751d@microchip.com>\n\t<20170913170310.grfv7j5xvh7chjdo@piout.net>\n\t<CAGkQfmOZBi4tzUSEAD7J+w_v+pZ_yFgPRBaYaLnW-ptFZO0rvg@mail.gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<dc318434-cf3e-6cb9-2072-7b8ec45aed97@microchip.com>","Date":"Thu, 14 Sep 2017 11:38:45 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<CAGkQfmOZBi4tzUSEAD7J+w_v+pZ_yFgPRBaYaLnW-ptFZO0rvg@mail.gmail.com>","Content-Language":"en-US","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170914_023800_848687_419BB747 ","X-CRM114-Status":"GOOD (  10.62  )","X-Spam-Score":"-2.6 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.6 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [216.71.150.166 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-iio@vger.kernel.org, Michael Turquette <mturquette@baylibre.com>, \n\tThierry Reding <thierry.reding@gmail.com>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>, linux-clk@vger.kernel.org, \n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tJosh Wu <rainyfeeling@outlook.com>, Marek Vasut <marek.vasut@gmail.com>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tAlan Stern <stern@rowland.harvard.edu>, linux-serial@vger.kernel.org, \n\tlinux-pwm@vger.kernel.org,\n\tlinux-arm-kernel <linux-arm-kernel@lists.infradead.org>,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tlinux-usb@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,\n\tLKML <linux-kernel@vger.kernel.org>, \n\tWenyou Yang <wenyou.yang@atmel.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>,\n\tJonathan Cameron <jic23@kernel.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1768711,"web_url":"http://patchwork.ozlabs.org/comment/1768711/","msgid":"<CAGkQfmPB8b38=hJrtuKJ-Hiqdfx9dt5SQ5R7EBL9cJV5_eRmXQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-14T16:15:56","subject":"Re: [PATCH v1 01/10] clk: at91: pmc: Wait for clocks when resuming","submitter":{"id":8236,"url":"http://patchwork.ozlabs.org/api/people/8236/","name":"Romain Izard","email":"romain.izard.pro@gmail.com"},"content":"2017-09-13 14:15 GMT+02:00 Nicolas Ferre <nicolas.ferre@microchip.com>:\n> On 08/09/2017 at 17:35, Romain Izard wrote:\n>> Wait for the syncronization of all clocks when resuming, not only the\n>> UPLL clock. Do not use regmap_read_poll_timeout, as it will call BUG()\n>> when interrupts are masked, which is the case in here.\n>>\n>> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n>> ---\n>>  drivers/clk/at91/pmc.c | 24 ++++++++++++++++--------\n>>  1 file changed, 16 insertions(+), 8 deletions(-)\n>>\n>> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n>> index 775af473fe11..5c2b26de303e 100644\n>> --- a/drivers/clk/at91/pmc.c\n>> +++ b/drivers/clk/at91/pmc.c\n>> @@ -107,10 +107,20 @@ static int pmc_suspend(void)\n>>       return 0;\n>>  }\n>>\n>> +static bool pmc_ready(unsigned int mask)\n>> +{\n>> +     unsigned int status;\n>> +\n>> +     regmap_read(pmcreg, AT91_PMC_SR, &status);\n>> +\n>> +     return ((status & mask) == mask) ? 1 : 0;\n>> +}\n>> +\n>>  static void pmc_resume(void)\n>>  {\n>> -     int i, ret = 0;\n>> +     int i;\n>>       u32 tmp;\n>> +     u32 mask = AT91_PMC_MCKRDY | AT91_PMC_LOCKA;\n>>\n>>       regmap_read(pmcreg, AT91_PMC_MCKR, &tmp);\n>>       if (pmc_cache.mckr != tmp)\n>> @@ -134,13 +144,11 @@ static void pmc_resume(void)\n>>                            AT91_PMC_PCR_CMD);\n>>       }\n>>\n>> -     if (pmc_cache.uckr & AT91_PMC_UPLLEN) {\n>> -             ret = regmap_read_poll_timeout(pmcreg, AT91_PMC_SR, tmp,\n>> -                                            !(tmp & AT91_PMC_LOCKU),\n>> -                                            10, 5000);\n>> -             if (ret)\n>> -                     pr_crit(\"USB PLL didn't lock when resuming\\n\");\n>> -     }\n>> +     if (pmc_cache.uckr & AT91_PMC_UPLLEN)\n>> +             mask |= AT91_PMC_LOCKU;\n>> +\n>> +     while (!pmc_ready(mask))\n>> +             cpu_relax();\n>\n> Okay, but I would prefer to keep the timeout property in it. So we may\n> need to re-implement a timeout way-out here.\n>\n\nWe need to have a reference clock to measure the timeout delay. If we use\nthe kernel's timekeeping, it relies on the clocks that we are configuring in\nthis code. Moreover, my experience with the mainline code is that when\nsomething goes wrong, nothing will work. No oops or panic will be reported,\nthe device will just stop working.\n\nIn my case, I had obvious failures (it just stopped working unless I removed\nUSB wakeup or activated the console during suspend) but also very rare\nfailures, that occurred in the bootloader. Those issues were detected when\ntesting repeated suspend cycles for a night: the memory controller would\nnever enter the self-refresh mode during the resume sequence.\n\nThis led me to question the bootloader's code first, and I set up 4 boards\nwith the backup prototype code on v4.9 to verify that it was stable on\nsuspend. I've reached 1.5 million sleep cycles over 3 weeks without\nfailure, so this hinted towards the difference between the prototype and the\nbackup code provided for v4.12 (which contained the patch that got in\nv4.13). Once I integrated this patch, I've run the v4.12 code for 2 weeks\nwithout issue as well.\n\nIn the end, I don't want to touch this code if I do not have to, as checking\nthat it does not regress is really cumbersome.","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"K0wAsX57\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=mobile-devices.fr header.i=@mobile-devices.fr\n\theader.b=\"Nraoqsbb\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"U6xGwuE2\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtNw10YgPz9sCZ\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 02:17:04 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dsWp2-0006LC-42; Thu, 14 Sep 2017 16:17:00 +0000","from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dsWog-0005uS-Hh for linux-arm-kernel@lists.infradead.org;\n\tThu, 14 Sep 2017 16:16:41 +0000","by mail-qk0-x22e.google.com with SMTP id o77so839881qke.9\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tThu, 14 Sep 2017 09:16:17 -0700 (PDT)","by 10.200.48.120 with HTTP; Thu, 14 Sep 2017 09:15:56 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=+NZOgMnIwt3vFGOBRRukNiNFXmTXW+syh20ZNt1tEFg=;\n\tb=K0wAsX57PDoU8K\n\tQUYOSBRR4QIBLS0AD7DdSKL6RShDBtxPVrO3UFpGJeMLbqkzn900r8gE2SxJaCfaWNyzk0ase2nQ6\n\tCzYE4Bs2GR+XOVKSsaiylGABuGJwmlQPHwcHHj3HrnZIh7pQAKX0w23KCPP2Ga1BPBsPKFVq6KJg1\n\t8jWL2PY1yTHZsYnVuIrA842eEQNGxtPjhMuCMoLfAxE50IMXem2tDZA1Dr5gBZVhGceuz8cgrj+Eu\n\tdyeJ+kQow5nm7hVjALot81dsGJuNlL27kcwX4wjVLFk00htGfKwTnFFMpHjsvKVPhoL9KmAaVFeBP\n\t8+21jEO5HjVSuhfets2w==;","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=mobile-devices.fr; s=google;\n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=tTJeEMOG96M1/gM7ANlo2rSPxqO8YN7L+I/Svb8Xfb8=;\n\tb=NraoqsbbtqPolNvptjeKRs+TPIuvQ8+1H/W/GPqlJy97WEgIoT/bcNQVUPRHepXAyJ\n\t3cGs9sjPxDA0hVv3F1iPYPcGV5Q1gRSN6Jl9bEapUF6oXlq496mxs6MlSBh7x7kC1XOp\n\txOTFf9EpPvWptSpm4QZOVdVpW9akBMD9ErlE0=","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=tTJeEMOG96M1/gM7ANlo2rSPxqO8YN7L+I/Svb8Xfb8=;\n\tb=U6xGwuE27RlmXL81rIsoLpJo8cQ62eHlhihUOe5zMcH3bhuZF1wX2rmBz72ADal4U/\n\t9URTTi99n1f/TaoumfLHEdzcxN4isaunhlY5LVIExSTQonQAC1OkWN2j1m8huvpIdGDy\n\tTLBH5Bn3pzvK0Aqi1RozP4aPNsNzXh6wcUG+l0K1827/ZXe+OBcCCzTlL0Y4KrEPqMHa\n\t/v9/I4yAb5YjvZTzXe8ZpOq68ARLQKEbRO53XbJX0Gsf+NfoTPoqHUgBNOjE5lQnO0dF\n\tgLqDQg27dcFYW09o5mrMVsH9KeJ4zD8ULue++59ff88Y0ZgYnSAmmn0spPNTQrUfAGaL\n\t/CXw=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=tTJeEMOG96M1/gM7ANlo2rSPxqO8YN7L+I/Svb8Xfb8=;\n\tb=X3WQ3MTvufVuGPhebDtbDyp0AeaVVqknEMXlCwerEwfDKeNsW378fNGgK8i4L18hA3\n\t8tVh/5v37oO5n1j0H5U0uGzT+IQ8arqb5L23oFZzL/T+N8pf4eNmWVIFyGnTaOGOFGKd\n\tR7EqFMoex6tZ6Ide9bfuxiYmrQwGx66/dVzKcprs07b/vm1/AHc0CqipY8IyJiNM29aE\n\tB5NCVKgW1DG9b2SzO+l47CJ9eyn1PvFf8hf9d0X/32AgCskb7VZARx9LCWqCMlWmvWhd\n\tsTiR1liu7rteh0qvJd9bN7QbTh74bqtpK3q6PLoBNqtKoLb2cRraCgxep+frTl1+T9Sz\n\tFI3A==","X-Gm-Message-State":"AHPjjUhlbZlBsnZ5hdZSvqFI3XkzLfFDIMP4SfABvG6Sh1kHC+7JJCOo\n\tgxI9QXcfVPQ0G1b+wwPdMzpR0mQVmIoyiTN43orO6SBYLdc=","X-Google-Smtp-Source":"AOwi7QAFvQzF2mCBv4q7VimICXWtZw6XLnAUa1HlU4ZFf1ZzJLPu7ruvNGw8vxwPt6xvh1ydn/HBrUjlJraphD/b3aA=","X-Received":"by 10.55.154.4 with SMTP id c4mr3439034qke.131.1505405776449;\n\tThu, 14 Sep 2017 09:16:16 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<14fb5261-bb03-a6bd-6653-2a2c655b04ee@microchip.com>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-2-romain.izard.pro@gmail.com>\n\t<14fb5261-bb03-a6bd-6653-2a2c655b04ee@microchip.com>","From":"Romain Izard <romain.izard.pro@gmail.com>","Date":"Thu, 14 Sep 2017 18:15:56 +0200","X-Google-Sender-Auth":"0VmMrg41kK-3qGmWN5mBgkW_BPw","Message-ID":"<CAGkQfmPB8b38=hJrtuKJ-Hiqdfx9dt5SQ5R7EBL9cJV5_eRmXQ@mail.gmail.com>","Subject":"Re: [PATCH v1 01/10] clk: at91: pmc: Wait for clocks when resuming","To":"Nicolas Ferre <nicolas.ferre@microchip.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170914_091638_702191_5D20FDC0 ","X-CRM114-Status":"GOOD (  19.06  )","X-Spam-Score":"-2.5 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.5 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow\n\ttrust [2607:f8b0:400d:c09:0:0:0:22e listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (romain.izard.pro[at]gmail.com)\n\t0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level\n\tmail domains are different\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain\n\t0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and\n\tEnvelopeFrom freemail headers are different","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-iio@vger.kernel.org, Michael Turquette <mturquette@baylibre.com>, \n\tThierry Reding <thierry.reding@gmail.com>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>, linux-clk@vger.kernel.org, \n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tJosh Wu <rainyfeeling@outlook.com>, Marek Vasut <marek.vasut@gmail.com>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tAlan Stern <stern@rowland.harvard.edu>, linux-serial@vger.kernel.org, \n\tlinux-pwm@vger.kernel.org,\n\tlinux-arm-kernel <linux-arm-kernel@lists.infradead.org>,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tlinux-usb@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,\n\tLKML <linux-kernel@vger.kernel.org>, \n\tWenyou Yang <wenyou.yang@atmel.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>,\n\tJonathan Cameron <jic23@kernel.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}},{"id":1773535,"web_url":"http://patchwork.ozlabs.org/comment/1773535/","msgid":"<5ffaec74-db4a-d285-1241-ba47e74fb0b8@microchip.com>","list_archive_url":null,"date":"2017-09-22T12:12:13","subject":"Re: [PATCH v1 01/10] clk: at91: pmc: Wait for clocks when resuming","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 14/09/2017 at 18:15, Romain Izard wrote:\n> 2017-09-13 14:15 GMT+02:00 Nicolas Ferre <nicolas.ferre@microchip.com>:\n>> On 08/09/2017 at 17:35, Romain Izard wrote:\n>>> Wait for the syncronization of all clocks when resuming, not only the\n>>> UPLL clock. Do not use regmap_read_poll_timeout, as it will call BUG()\n>>> when interrupts are masked, which is the case in here.\n>>>\n>>> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n>>> ---\n>>>  drivers/clk/at91/pmc.c | 24 ++++++++++++++++--------\n>>>  1 file changed, 16 insertions(+), 8 deletions(-)\n>>>\n>>> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n>>> index 775af473fe11..5c2b26de303e 100644\n>>> --- a/drivers/clk/at91/pmc.c\n>>> +++ b/drivers/clk/at91/pmc.c\n>>> @@ -107,10 +107,20 @@ static int pmc_suspend(void)\n>>>       return 0;\n>>>  }\n>>>\n>>> +static bool pmc_ready(unsigned int mask)\n>>> +{\n>>> +     unsigned int status;\n>>> +\n>>> +     regmap_read(pmcreg, AT91_PMC_SR, &status);\n>>> +\n>>> +     return ((status & mask) == mask) ? 1 : 0;\n>>> +}\n>>> +\n>>>  static void pmc_resume(void)\n>>>  {\n>>> -     int i, ret = 0;\n>>> +     int i;\n>>>       u32 tmp;\n>>> +     u32 mask = AT91_PMC_MCKRDY | AT91_PMC_LOCKA;\n>>>\n>>>       regmap_read(pmcreg, AT91_PMC_MCKR, &tmp);\n>>>       if (pmc_cache.mckr != tmp)\n>>> @@ -134,13 +144,11 @@ static void pmc_resume(void)\n>>>                            AT91_PMC_PCR_CMD);\n>>>       }\n>>>\n>>> -     if (pmc_cache.uckr & AT91_PMC_UPLLEN) {\n>>> -             ret = regmap_read_poll_timeout(pmcreg, AT91_PMC_SR, tmp,\n>>> -                                            !(tmp & AT91_PMC_LOCKU),\n>>> -                                            10, 5000);\n>>> -             if (ret)\n>>> -                     pr_crit(\"USB PLL didn't lock when resuming\\n\");\n>>> -     }\n>>> +     if (pmc_cache.uckr & AT91_PMC_UPLLEN)\n>>> +             mask |= AT91_PMC_LOCKU;\n>>> +\n>>> +     while (!pmc_ready(mask))\n>>> +             cpu_relax();\n>>\n>> Okay, but I would prefer to keep the timeout property in it. So we may\n>> need to re-implement a timeout way-out here.\n>>\n> \n> We need to have a reference clock to measure the timeout delay. If we use\n> the kernel's timekeeping, it relies on the clocks that we are configuring in\n> this code. Moreover, my experience with the mainline code is that when\n> something goes wrong, nothing will work. No oops or panic will be reported,\n> the device will just stop working.\n> \n> In my case, I had obvious failures (it just stopped working unless I removed\n> USB wakeup or activated the console during suspend) but also very rare\n> failures, that occurred in the bootloader. Those issues were detected when\n> testing repeated suspend cycles for a night: the memory controller would\n> never enter the self-refresh mode during the resume sequence.\n> \n> This led me to question the bootloader's code first, and I set up 4 boards\n> with the backup prototype code on v4.9 to verify that it was stable on\n> suspend. I've reached 1.5 million sleep cycles over 3 weeks without\n> failure, so this hinted towards the difference between the prototype and the\n> backup code provided for v4.12 (which contained the patch that got in\n> v4.13). Once I integrated this patch, I've run the v4.12 code for 2 weeks\n> without issue as well.\n> \n> In the end, I don't want to touch this code if I do not have to, as checking\n> that it does not regress is really cumbersome.\n\nThe timeout was more for PLL like the one use for USB. I didn't want to\nblock only for USB PLL failure (which is kind of hypothetical, I admit).\nAnyway, I understand your arguments and taking into account the\nextensive tests that you've run, I agree with your approach. I'm adding\nmy Ack to the v2.\n\nThanks for having take the time to describe your debugging session: it's\nvaluable information for everybody.\n\nBest regards,","headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"RwheLkG5\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xzC5T4LGjz9sPm\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 22:11:57 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dvMoB-0004ZE-9P; Fri, 22 Sep 2017 12:11:51 +0000","from esa6.microchip.iphmx.com ([216.71.154.253])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dvMnr-0004IX-3k; Fri, 22 Sep 2017 12:11:32 +0000","from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t22 Sep 2017 05:11:07 -0700","from [10.159.245.112] (10.10.76.4) by chn-sv-exch04.mchp-main.com\n\t(10.10.76.105) with Microsoft SMTP Server id 14.3.352.0;\n\tFri, 22 Sep 2017 05:11:06 -0700"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:\n\tMessage-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description\n\t:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=xdkZ8qNThWzfRvSQsKfE7FDork/jKtCHcfDJYmVIHn4=;\n\tb=RwheLkG5HVDzaR\n\twx4v/P41tsKHxB3pHjfc/s71QQMAigFPoWstesSjjrsy5eFCV0rJCmX9COOKUuIwngD6s1EloCzwN\n\txW7jXw/SMlXBFhb6tc7NngUP2ShaNb/M4ZOJVA7NjcoeU9oKD77/tpbYOej9+1hF3BTTL6Py+/u7D\n\tpba99U79l1bqIdw0vIsjUWC8TuJztTvyNLZ6zWpc7fHf98kjyZ4RdYrHfiry1HUtiFT5f4JtePZDO\n\toff5BObbtOv9Z/XBAT5jwS2VyY54WSaC/Zvt96q4E0nBNl++9inbMrqUmPBrecxDkJwoXAXYnWHCl\n\tIzWMeWYuVV1nAgbvzOXA==;","X-IronPort-AV":"E=Sophos;i=\"5.42,427,1500966000\"; d=\"scan'208\";a=\"4673051\"","Subject":"Re: [PATCH v1 01/10] clk: at91: pmc: Wait for clocks when resuming","To":"Romain Izard <romain.izard.pro@gmail.com>","References":"<20170908153604.28383-1-romain.izard.pro@gmail.com>\n\t<20170908153604.28383-2-romain.izard.pro@gmail.com>\n\t<14fb5261-bb03-a6bd-6653-2a2c655b04ee@microchip.com>\n\t<CAGkQfmPB8b38=hJrtuKJ-Hiqdfx9dt5SQ5R7EBL9cJV5_eRmXQ@mail.gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<5ffaec74-db4a-d285-1241-ba47e74fb0b8@microchip.com>","Date":"Fri, 22 Sep 2017 14:12:13 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<CAGkQfmPB8b38=hJrtuKJ-Hiqdfx9dt5SQ5R7EBL9cJV5_eRmXQ@mail.gmail.com>","Content-Language":"en-US","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170922_051131_283149_9B8A17E3 ","X-CRM114-Status":"GOOD (  21.09  )","X-Spam-Score":"-2.6 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.6 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [216.71.154.253 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","Cc":"linux-iio@vger.kernel.org, Michael Turquette <mturquette@baylibre.com>, \n\tThierry Reding <thierry.reding@gmail.com>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>, linux-clk@vger.kernel.org, \n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tJosh Wu <rainyfeeling@outlook.com>, Marek Vasut <marek.vasut@gmail.com>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tAlan Stern <stern@rowland.harvard.edu>, linux-serial@vger.kernel.org, \n\tlinux-pwm@vger.kernel.org,\n\tlinux-arm-kernel <linux-arm-kernel@lists.infradead.org>,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tlinux-usb@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,\n\tLKML <linux-kernel@vger.kernel.org>, \n\tWenyou Yang <wenyou.yang@atmel.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>,\n\tJonathan Cameron <jic23@kernel.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"}}]