[{"id":1770035,"web_url":"http://patchwork.ozlabs.org/comment/1770035/","msgid":"<20170918115052.4606d8e5@bbrezillon>","list_archive_url":null,"date":"2017-09-18T09:50:52","subject":"Re: [PATCH v2 4/9] mtd: nand: atmel: Avoid ECC errors when leaving\n\tbackup mode","submitter":{"id":63120,"url":"http://patchwork.ozlabs.org/api/people/63120/","name":"Boris Brezillon","email":"boris.brezillon@free-electrons.com"},"content":"Hi Romain,\n\nOn Fri, 15 Sep 2017 16:04:06 +0200\nRomain Izard <romain.izard.pro@gmail.com> wrote:\n\n> During backup mode, the contents of all registers will be cleared as the\n> SoC will be completely powered down. For a product that boots on NAND\n> Flash memory, the bootloader will obviously use the related controller\n> to read the Flash and correct any detected error in the memory, before\n> handling back control to the kernel's resuming entry point.\n> \n> In normal devices, it is up to the driver's suspend/resume code to\n> restore the registers in a valid state. But the PMECC is not a regular\n> device in the driver model when used with the legacy device tree binding\n> for the Atmel NAND controller, and suspend/resume code is not called.\n> \n> As in my case the bootloader leaves the PMECC controller in a programmed\n> state, and the controller is only reset at boot or after a NAND access,\n> the first NAND Flash access with the Atmel controller will report\n> uncorrectable ECC errors.\n> \n> To avoid this, systematically reset the PMECC controller before using\n> it.\n> \n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n> ---\n>  drivers/mtd/nand/atmel/pmecc.c | 11 +++--------\n>  1 file changed, 3 insertions(+), 8 deletions(-)\n> \n> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c\n> index 8c210a5776bc..8d1208f38025 100644\n> --- a/drivers/mtd/nand/atmel/pmecc.c\n> +++ b/drivers/mtd/nand/atmel/pmecc.c\n> @@ -777,6 +777,9 @@ int atmel_pmecc_enable(struct atmel_pmecc_user *user, int op)\n>  \n>  \tmutex_lock(&user->pmecc->lock);\n>  \n> +\twritel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);\n> +\twritel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);\n> +\n>  \tcfg = user->cache.cfg;\n>  \tif (op == NAND_ECC_WRITE)\n>  \t\tcfg |= PMECC_CFG_WRITE_OP;\n> @@ -797,10 +800,6 @@ EXPORT_SYMBOL_GPL(atmel_pmecc_enable);\n>  \n>  void atmel_pmecc_disable(struct atmel_pmecc_user *user)\n>  {\n> -\tstruct atmel_pmecc *pmecc = user->pmecc;\n> -\n> -\twritel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);\n> -\twritel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);\n\nSo know you leave the ECC engine enabled even when it's not in use? Not\nsure what kind of implication this has on power-consumption, but I\nthink I'd prefer to keep the write RST+DISABLE sequence in the disable\npath.\n\nHow about creating a atmel_pmecc_reset() function that you'd call from\nthe nand-controller resume hook. Something like:\n\nvoid atmel_pmecc_reset(struct atmel_pmecc *pmecc)\n{\n\twritel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);\n\twritel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);\n}\n\nThis way you can re-use the same function and call it from the probe\nand disable path as well.\n\nRegards,\n\nBoris\n\n>  \tmutex_unlock(&user->pmecc->lock);\n>  }\n>  EXPORT_SYMBOL_GPL(atmel_pmecc_disable);\n> @@ -856,10 +855,6 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,\n>  \t/* Disable all interrupts before registering the PMECC handler. */\n>  \twritel(0xffffffff, pmecc->regs.base + ATMEL_PMECC_IDR);\n>  \n> -\t/* Reset the ECC engine */\n> -\twritel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);\n> -\twritel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);\n> -\n>  \treturn pmecc;\n>  }\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=\"DqmsS6I2\"; 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 3xwhBt6PW1z9ryv\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 19:52:54 +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 1dtsjS-0002PV-3z; Mon, 18 Sep 2017 09:52:50 +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 1dtsi4-0001UH-GA; Mon, 18 Sep 2017 09:52:21 +0000","by mail.free-electrons.com (Postfix, from userid 110)\n\tid E863021D26; Mon, 18 Sep 2017 11:51:02 +0200 (CEST)","from bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 633C220F69;\n\tMon, 18 Sep 2017 11:50:52 +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:MIME-Version:References:In-Reply-To:\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=hhQJbSBIZ2BSkWS55PAdG6cxf6fThOKwEiD0Y0NoK28=;\n\tb=DqmsS6I28GvK3h\n\t3ynCWiDjGkNv34865GiZao0GaiBf3NV8zxvx7iqp1mHuhJvVFTSmHbbjgSd/gUoPS04g0HKJTLOOu\n\tvMKi3WVxb8HU1qseU2qDRHgQZCAD0MVffxdIm5BakYJiuuf+vqlNvQJkp+M89Oj9CEsy0PdzkuoTl\n\tW5ltaPsEwNVbXaxen1hIPmrUFpeXvDHcDNkXakpiLtb8/1r0NBNdC34dApTjbhS7P0nNh2tE+gyaS\n\tgnnMgZhxewzXgK7Xti8GCUwM5f7cBrtZdcmR7n/PctpZmLd752ZUjcwMaT+OCTil7Ab9xs73w1BKU\n\t/n4TWt+x42znKt3/axAw==;","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\tshortcircuit=ham autolearn=disabled version=3.4.0","Date":"Mon, 18 Sep 2017 11:50:52 +0200","From":"Boris Brezillon <boris.brezillon@free-electrons.com>","To":"Romain Izard <romain.izard.pro@gmail.com>","Subject":"Re: [PATCH v2 4/9] mtd: nand: atmel: Avoid ECC errors when leaving\n\tbackup mode","Message-ID":"<20170918115052.4606d8e5@bbrezillon>","In-Reply-To":"<20170915140411.31716-5-romain.izard.pro@gmail.com>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-5-romain.izard.pro@gmail.com>","X-Mailer":"Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170918_025125_606622_30BC9760 ","X-CRM114-Status":"GOOD (  22.52  )","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":"Michael Turquette <mturquette@baylibre.com>, linux-kernel@vger.kernel.org,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>,\n\tlinux-clk@vger.kernel.org, Josh Wu <rainyfeeling@outlook.com>,\n\tMarek 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, 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\tWenyou Yang <wenyou.yang@atmel.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tlinux-mtd@lists.infradead.org, \n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@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":1770045,"web_url":"http://patchwork.ozlabs.org/comment/1770045/","msgid":"<20170918120051.298bdabf@bbrezillon>","list_archive_url":null,"date":"2017-09-18T10:00:51","subject":"Re: [PATCH v2 5/9] mtd: nand: atmel: Report PMECC failures as errors","submitter":{"id":63120,"url":"http://patchwork.ozlabs.org/api/people/63120/","name":"Boris Brezillon","email":"boris.brezillon@free-electrons.com"},"content":"Hi Romain,\n\nOn Fri, 15 Sep 2017 16:04:07 +0200\nRomain Izard <romain.izard.pro@gmail.com> wrote:\n\n> It is not normal for the PMECC to fail when trying to fix ECC errors.\n> Report these cases as errors.\n\nI'm not sure we want to have ECC error messages at this level. ECC\nerrors are rather unusual but not impossible, and sometimes it's even\nnot a real error (I'm thinking of bitflips in erased pages for\nexample, which are not necessarily detected/fixed in hardware).\n\nIf we decide to print error messages when unfixable bitflips are\ndetected, it should be done in the nand-controller driver (somewhere\nalong those lines [1]).\n\nRegards,\n\nBoris\n\n[1]http://elixir.free-electrons.com/linux/latest/source/drivers/mtd/nand/atmel/nand-controller.c#L827\n\n> \n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n> ---\n>  drivers/mtd/nand/atmel/pmecc.c | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c\n> index 8d1208f38025..2a23f1ff945f 100644\n> --- a/drivers/mtd/nand/atmel/pmecc.c\n> +++ b/drivers/mtd/nand/atmel/pmecc.c\n> @@ -687,6 +687,8 @@ static int atmel_pmecc_err_location(struct atmel_pmecc_user *user)\n>  \t * Number of roots does not match the degree of smu\n>  \t * unable to correct error.\n>  \t */\n> +\tdev_err(pmecc->dev,\n> +\t\t\"PMECC: Impossible to calculate error location.\\n\");\n>  \treturn -EBADMSG;\n>  }\n>  \n> @@ -729,7 +731,7 @@ int atmel_pmecc_correct_sector(struct atmel_pmecc_user *user, int sector,\n>  \t\t\tptr = ecc + byte - sectorsize;\n>  \t\t\tarea = \"ECC\";\n>  \t\t} else {\n> -\t\t\tdev_dbg(pmecc->dev,\n> +\t\t\tdev_err(pmecc->dev,\n>  \t\t\t\t\"Invalid errpos value (%d, max is %d)\\n\",\n>  \t\t\t\terrpos, (sectorsize + eccbytes) * 8);\n>  \t\t\treturn -EINVAL;","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=\"AnxEJGfp\"; 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 3xwhNq4CkLz9s7c\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 20:01:31 +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 1dtsrn-00009M-SZ; Mon, 18 Sep 2017 10:01:27 +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 1dtsrj-0008Uw-O2; Mon, 18 Sep 2017 10:01:25 +0000","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 7B43B2084A; Mon, 18 Sep 2017 12:01:02 +0200 (CEST)","from bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id E319F20828;\n\tMon, 18 Sep 2017 12:00:51 +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:MIME-Version:References:In-Reply-To:\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=hpdB/qvDYEvUxqYd7jfugQwETuFmzEsUekFV2nmSDOk=;\n\tb=AnxEJGfpJ1ANCO\n\thRz+Q3zT3bDc02EqEXFJ4C42oLMGP84xj4YkoXXg8jowpqW87op5SKPRciOXO9QHE8gZMTqpq/d6G\n\tt4mxqMRDfNapb2eydpzJ1rDzHXnAjcyK0uNhURd7X95WUbBg882LWxLL2jKWlTaL5PCC5hOtxdVfE\n\tOLq264+6MfLSVV9EcWCHQMcM4bQMwGrQFP4NXlCyl7/mtTpeMSsKyeLPmKrSZlofm7ttPs3AqLUFp\n\tGADiXkWS27uC1U9P2d3mBPC5bJIe8h69M6fr6IF6Xv13jYAf22XWSc7iczzloWv0gfQkWbtpD38Vg\n\t8jBZjXAVmS5M7LMsojqQ==;","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":"Mon, 18 Sep 2017 12:00:51 +0200","From":"Boris Brezillon <boris.brezillon@free-electrons.com>","To":"Romain Izard <romain.izard.pro@gmail.com>","Subject":"Re: [PATCH v2 5/9] mtd: nand: atmel: Report PMECC failures as errors","Message-ID":"<20170918120051.298bdabf@bbrezillon>","In-Reply-To":"<20170915140411.31716-6-romain.izard.pro@gmail.com>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-6-romain.izard.pro@gmail.com>","X-Mailer":"Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170918_030123_997991_F0B479BC ","X-CRM114-Status":"GOOD (  17.44  )","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":"Michael Turquette <mturquette@baylibre.com>, linux-kernel@vger.kernel.org,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>,\n\tlinux-clk@vger.kernel.org, Josh Wu <rainyfeeling@outlook.com>,\n\tMarek 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, 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\tWenyou Yang <wenyou.yang@atmel.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tlinux-mtd@lists.infradead.org, \n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@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":1770789,"web_url":"http://patchwork.ozlabs.org/comment/1770789/","msgid":"<53aa7783-0ecf-1e68-1bf9-c470ba2f79eb@microchip.com>","list_archive_url":null,"date":"2017-09-19T09:29:12","subject":"Re: [PATCH v2 8/9] atmel_flexcom: Support backup mode","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 15/09/2017 at 16:04, Romain Izard wrote:\n> The controller used by a flexcom module is configured at boot, and left\n> alone after this. As the configuration will be lost after backup mode,\n> restore the state of the flexcom driver on resume.\n> \n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n\nTested-by: Nicolas Ferre <nicolas.ferre@microchip.com>\nOn sama5d2 Xplained board (i2c0 from flexcom 4).\nand obviously:\nAcked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n\nThanks Romain!\n\nRegards,\n\n> ---\n>  drivers/mfd/atmel-flexcom.c | 65 ++++++++++++++++++++++++++++++++++-----------\n>  1 file changed, 50 insertions(+), 15 deletions(-)\n> \n> diff --git a/drivers/mfd/atmel-flexcom.c b/drivers/mfd/atmel-flexcom.c\n> index 064bde9cff5a..ef1235c4a179 100644\n> --- a/drivers/mfd/atmel-flexcom.c\n> +++ b/drivers/mfd/atmel-flexcom.c\n> @@ -39,34 +39,44 @@\n>  #define FLEX_MR_OPMODE(opmode)\t(((opmode) << FLEX_MR_OPMODE_OFFSET) &\t\\\n>  \t\t\t\t FLEX_MR_OPMODE_MASK)\n>  \n> +struct atmel_flexcom {\n> +\tvoid __iomem *base;\n> +\tu32 opmode;\n> +\tstruct clk *clk;\n> +};\n>  \n>  static int atmel_flexcom_probe(struct platform_device *pdev)\n>  {\n>  \tstruct device_node *np = pdev->dev.of_node;\n> -\tstruct clk *clk;\n>  \tstruct resource *res;\n> -\tvoid __iomem *base;\n> -\tu32 opmode;\n> +\tstruct atmel_flexcom *afc;\n>  \tint err;\n> +\tu32 val;\n> +\n> +\tafc = devm_kzalloc(&pdev->dev, sizeof(*afc), GFP_KERNEL);\n> +\tif (!afc)\n> +\t\treturn -ENOMEM;\n>  \n> -\terr = of_property_read_u32(np, \"atmel,flexcom-mode\", &opmode);\n> +\tplatform_set_drvdata(pdev, afc);\n> +\n> +\terr = of_property_read_u32(np, \"atmel,flexcom-mode\", &afc->opmode);\n>  \tif (err)\n>  \t\treturn err;\n>  \n> -\tif (opmode < ATMEL_FLEXCOM_MODE_USART ||\n> -\t    opmode > ATMEL_FLEXCOM_MODE_TWI)\n> +\tif (afc->opmode < ATMEL_FLEXCOM_MODE_USART ||\n> +\t    afc->opmode > ATMEL_FLEXCOM_MODE_TWI)\n>  \t\treturn -EINVAL;\n>  \n>  \tres = platform_get_resource(pdev, IORESOURCE_MEM, 0);\n> -\tbase = devm_ioremap_resource(&pdev->dev, res);\n> -\tif (IS_ERR(base))\n> -\t\treturn PTR_ERR(base);\n> +\tafc->base = devm_ioremap_resource(&pdev->dev, res);\n> +\tif (IS_ERR(afc->base))\n> +\t\treturn PTR_ERR(afc->base);\n>  \n> -\tclk = devm_clk_get(&pdev->dev, NULL);\n> -\tif (IS_ERR(clk))\n> -\t\treturn PTR_ERR(clk);\n> +\tafc->clk = devm_clk_get(&pdev->dev, NULL);\n> +\tif (IS_ERR(afc->clk))\n> +\t\treturn PTR_ERR(afc->clk);\n>  \n> -\terr = clk_prepare_enable(clk);\n> +\terr = clk_prepare_enable(afc->clk);\n>  \tif (err)\n>  \t\treturn err;\n>  \n> @@ -76,9 +86,10 @@ static int atmel_flexcom_probe(struct platform_device *pdev)\n>  \t * inaccessible and are read as zero. Also the external I/O lines of the\n>  \t * Flexcom are muxed to reach the selected device.\n>  \t */\n> -\twritel(FLEX_MR_OPMODE(opmode), base + FLEX_MR);\n> +\tval = FLEX_MR_OPMODE(afc->opmode);\n> +\twritel(val, afc->base + FLEX_MR);\n>  \n> -\tclk_disable_unprepare(clk);\n> +\tclk_disable_unprepare(afc->clk);\n>  \n>  \treturn devm_of_platform_populate(&pdev->dev);\n>  }\n> @@ -89,10 +100,34 @@ static const struct of_device_id atmel_flexcom_of_match[] = {\n>  };\n>  MODULE_DEVICE_TABLE(of, atmel_flexcom_of_match);\n>  \n> +#ifdef CONFIG_PM_SLEEP\n> +static int atmel_flexcom_resume(struct device *dev)\n> +{\n> +\tstruct atmel_flexcom *afc = dev_get_drvdata(dev);\n> +\tint err;\n> +\tu32 val;\n> +\n> +\terr = clk_prepare_enable(afc->clk);\n> +\tif (err)\n> +\t\treturn err;\n> +\n> +\tval = FLEX_MR_OPMODE(afc->opmode),\n> +\twritel(val, afc->base + FLEX_MR);\n> +\n> +\tclk_disable_unprepare(afc->clk);\n> +\n> +\treturn 0;\n> +}\n> +#endif\n> +\n> +static SIMPLE_DEV_PM_OPS(atmel_flexcom_pm_ops, NULL,\n> +\t\t\t atmel_flexcom_resume);\n> +\n>  static struct platform_driver atmel_flexcom_driver = {\n>  \t.probe\t= atmel_flexcom_probe,\n>  \t.driver\t= {\n>  \t\t.name\t\t= \"atmel_flexcom\",\n> +\t\t.pm\t\t= &atmel_flexcom_pm_ops,\n>  \t\t.of_match_table\t= atmel_flexcom_of_match,\n>  \t},\n>  };\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=\"NIpeExlg\"; 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 3xxHdm5pr5z9s78\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 19:29:48 +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 1duEqb-0003VP-LM; Tue, 19 Sep 2017 09:29:41 +0000","from esa4.microchip.iphmx.com ([68.232.154.123])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duEpZ-00037I-Sn; Tue, 19 Sep 2017 09:28:47 +0000","from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t19 Sep 2017 02:28:03 -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\tTue, 19 Sep 2017 02:28:03 -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=qSveDy/f+8QS6cBS0+EQ2jLBF2ZQdCxDW9DUhd6/IDI=;\n\tb=NIpeExlggXK1Fg\n\tPdPlluqphWNGknC/Z1qGv6ZVPN23o5OypjRke3i3eQdE641drmT8c1RXu+SzdDzosK3t05eUzG9pX\n\tbLyW9mqF+WY0/Idj5MIgU430wMr2Szc+KOxpbz30YnN4wjv1n+MlLrilEpOa5HbyPhs2OKtmdJZQe\n\tELA4JgkkDHOAztSQkK1oolab8hrl3F+6wK8zO/V9tg36ISrvYHKMz6mXJ2fhFeOBJDt5TZQ+gnBCg\n\t88Y4KDQzmur+L1u734d6MIHMVZ7VCgzLKleXCfIR3cz5nLpAs2wQdktuImmpWzDRl0cC9LEZhX24r\n\tI4807Rf3LHBY8ekAIPNg==;","X-IronPort-AV":"E=Sophos;i=\"5.42,417,1500966000\"; d=\"scan'208\";a=\"6931727\"","Subject":"Re: [PATCH v2 8/9] atmel_flexcom: Support backup mode","To":"Romain Izard <romain.izard.pro@gmail.com>, Alexandre Belloni\n\t<alexandre.belloni@free-electrons.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>, Wenyou Yang\n\t<wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>,\n\tDavid Woodhouse\n\t<dwmw2@infradead.org>, Brian Norris <computersforpeace@gmail.com>, Marek\n\tVasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, \n\tThierry Reding <thierry.reding@gmail.com>, Richard Genoud\n\t<richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, \n\tAlan Stern <stern@rowland.harvard.edu>, Lee Jones <lee.jones@linaro.org>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-9-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<53aa7783-0ecf-1e68-1bf9-c470ba2f79eb@microchip.com>","Date":"Tue, 19 Sep 2017 11:29:12 +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":"<20170915140411.31716-9-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-20170919_022838_045919_6AC3F4AF ","X-CRM114-Status":"GOOD (  16.93  )","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.154.123 listed in list.dnswl.org]\n\t0.0 T_SPF_TEMPERROR        SPF: test of record failed (temperror)\n\t0.0 T_SPF_HELO_TEMPERROR SPF: test of HELO record failed (temperror)\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-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-serial@vger.kernel.org, linux-clk@vger.kernel.org,\n\tlinux-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":1770830,"web_url":"http://patchwork.ozlabs.org/comment/1770830/","msgid":"<380a15d6-c180-316f-a56b-011acd02df59@microchip.com>","list_archive_url":null,"date":"2017-09-19T10:19:33","subject":"Re: [PATCH v2 9/9] tty/serial: atmel: Prevent a warning on suspend","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 15/09/2017 at 16:04, Romain Izard wrote:\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\nTested-by: Nicolas Ferre <nicolas.ferre@microchip.com>\non sama5d2 Xplained.\n\nAcked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n\n> ---\n>  drivers/tty/serial/atmel_serial.c | 14 ++++++++++++++\n>  1 file changed, 14 insertions(+)\n> \n> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c\n> index 7551cab438ff..783af6648be0 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>  \tbool\t\t\thas_hw_timer;\n>  \tstruct timer_list\tuart_timer;\n>  \n> +\tbool\t\t\ttx_stopped;\n>  \tbool\t\t\tsuspended;\n>  \tunsigned int\t\tpending;\n>  \tunsigned int\t\tpending_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> +\tstruct atmel_uart_port *atmel_port = to_atmel_uart_port(port);\n> +\n> +\tif (atmel_port->tx_stopped)\n> +\t\treturn TIOCSER_TEMT;\n>  \treturn (atmel_uart_readl(port, ATMEL_US_CSR) & ATMEL_US_TXEMPTY) ?\n>  \t\tTIOCSER_TEMT :\n>  \t\t0;\n> @@ -485,6 +490,7 @@ static void atmel_stop_tx(struct uart_port *port)\n>  \t * is fully transmitted.\n>  \t */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS);\n> +\tatmel_port->tx_stopped = true;\n>  \n>  \t/* Disable interrupts */\n>  \tatmel_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>  \tif ((port->rs485.flags & SER_RS485_ENABLED) &&\n>  \t    !(port->rs485.flags & SER_RS485_RX_DURING_TX))\n>  \t\tatmel_start_rx(port);\n> +\n>  }\n>  \n>  /*\n> @@ -521,6 +528,7 @@ static void atmel_start_tx(struct uart_port *port)\n>  \n>  \t/* re-enable the transmitter */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);\n> +\tatmel_port->tx_stopped = false;\n>  }\n>  \n>  /*\n> @@ -1866,6 +1874,7 @@ static int atmel_startup(struct uart_port *port)\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n>  \t/* enable xmit & rcvr */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n> +\tatmel_port->tx_stopped = false;\n>  \n>  \tsetup_timer(&atmel_port->uart_timer,\n>  \t\t\tatmel_uart_timer_callback,\n> @@ -2122,6 +2131,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,\n>  \n>  \t/* disable receiver and transmitter */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS | ATMEL_US_RXDIS);\n> +\tatmel_port->tx_stopped = true;\n>  \n>  \t/* mode */\n>  \tif (port->rs485.flags & SER_RS485_ENABLED) {\n> @@ -2207,6 +2217,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,\n>  \tatmel_uart_writel(port, ATMEL_US_BRGR, quot);\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n> +\tatmel_port->tx_stopped = false;\n>  \n>  \t/* restore interrupts */\n>  \tatmel_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>  \t/* Make sure that tx path is actually able to send characters */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);\n> +\tatmel_port->tx_stopped = false;\n>  \n>  \tuart_console_write(port, s, count, atmel_console_putchar);\n>  \n> @@ -2511,6 +2523,7 @@ static int __init atmel_console_setup(struct console *co, char *options)\n>  {\n>  \tint ret;\n>  \tstruct uart_port *port = &atmel_ports[co->index].uart;\n> +\tstruct atmel_uart_port *atmel_port = to_atmel_uart_port(port);\n>  \tint baud = 115200;\n>  \tint bits = 8;\n>  \tint parity = 'n';\n> @@ -2528,6 +2541,7 @@ static int __init atmel_console_setup(struct console *co, char *options)\n>  \tatmel_uart_writel(port, ATMEL_US_IDR, -1);\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n> +\tatmel_port->tx_stopped = false;\n>  \n>  \tif (options)\n>  \t\tuart_parse_options(options, &baud, &parity, &bits, &flow);\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=\"W5/rnliU\"; 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 3xxJlF0gp9z9s3T\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 20:19:37 +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 1duFcr-0004Pe-82; Tue, 19 Sep 2017 10:19:33 +0000","from esa3.microchip.iphmx.com ([68.232.153.233])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duFc7-00043s-0L; Tue, 19 Sep 2017 10:18:48 +0000","from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t19 Sep 2017 03:18:24 -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\tTue, 19 Sep 2017 03:18: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=wxGb6v6C3ca+q+gBL49VDvhUzwSOK1Wvn3N8ADypd6Y=;\n\tb=W5/rnliUs+dDGH\n\t2c3Fsgvhgo0YdHvyqm9MzNp/DGQ8VreeEsRmFZz1zh1CqXqeAjwYwc/Bl1d7sOEc0cMFU9ykbUy6D\n\txI7xRVcu7X8eItFrJZI8k2Z/AxNa1e6YSpRVcVwLCcf137LBhYQ6AzHeO+AfOQUBulvj8wC4nMjTv\n\tEOBL5lvb1npSncUeHn3afDfPYJyNqDipYEQAdYXQf6ioN/ZGd7ikZIqqe1NatkZnv4q3jrBbv4EAI\n\tDa0IfsvwRaGsXuiedY3Tk2R4ZoMxP0v3ofnPuiKKoHQmCr/1jWo9Ut1wLyEf7zCNRZocdW4AVsUsE\n\tBshLc09BmUjc5oFbgBYg==;","X-IronPort-AV":"E=Sophos;i=\"5.42,417,1500966000\"; d=\"scan'208\";a=\"7163947\"","Subject":"Re: [PATCH v2 9/9] tty/serial: atmel: Prevent a warning on suspend","To":"Romain Izard <romain.izard.pro@gmail.com>, Alexandre Belloni\n\t<alexandre.belloni@free-electrons.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>, Wenyou Yang\n\t<wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>,\n\tDavid Woodhouse\n\t<dwmw2@infradead.org>, Brian Norris <computersforpeace@gmail.com>, Marek\n\tVasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, \n\tThierry Reding <thierry.reding@gmail.com>, Richard Genoud\n\t<richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, \n\tAlan Stern <stern@rowland.harvard.edu>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-10-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<380a15d6-c180-316f-a56b-011acd02df59@microchip.com>","Date":"Tue, 19 Sep 2017 12:19:33 +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":"<20170915140411.31716-10-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-20170919_031847_078601_2628F7D5 ","X-CRM114-Status":"GOOD (  18.47  )","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-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [68.232.153.233 listed in list.dnswl.org]\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-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-serial@vger.kernel.org, linux-clk@vger.kernel.org,\n\tlinux-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":1771153,"web_url":"http://patchwork.ozlabs.org/comment/1771153/","msgid":"<20170919152504.nhp5i734u75gb5gq@dell>","list_archive_url":null,"date":"2017-09-19T15:25:04","subject":"Re: [PATCH v2 8/9] atmel_flexcom: Support backup mode","submitter":{"id":12720,"url":"http://patchwork.ozlabs.org/api/people/12720/","name":"Lee Jones","email":"lee.jones@linaro.org"},"content":"On Tue, 19 Sep 2017, Nicolas Ferre wrote:\n\n> On 15/09/2017 at 16:04, Romain Izard wrote:\n> > The controller used by a flexcom module is configured at boot, and left\n> > alone after this. As the configuration will be lost after backup mode,\n> > restore the state of the flexcom driver on resume.\n> > \n> > Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n> \n> Tested-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n> On sama5d2 Xplained board (i2c0 from flexcom 4).\n> and obviously:\n> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n> \n> Thanks Romain!\n> \n> Regards,\n> \n> > ---\n> >  drivers/mfd/atmel-flexcom.c | 65 ++++++++++++++++++++++++++++++++++-----------\n> >  1 file changed, 50 insertions(+), 15 deletions(-)\n\nThis is the first time I've seen this patch.  Why's that?","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=\"NzHAcRgj\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"DdTtWYcC\"; 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 3xxRXd4K5fz9s7B\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 01:25:53 +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 1duKPF-0007qE-4V; Tue, 19 Sep 2017 15:25:49 +0000","from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duKOw-0006ZE-QJ for linux-arm-kernel@lists.infradead.org;\n\tTue, 19 Sep 2017 15:25:32 +0000","by mail-wm0-x22a.google.com with SMTP id 13so495035wmq.2\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tTue, 19 Sep 2017 08:25:09 -0700 (PDT)","from dell ([2.27.167.120]) by smtp.gmail.com with ESMTPSA id\n\tl15sm10986527wrl.47.2017.09.19.08.25.05\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tTue, 19 Sep 2017 08:25:06 -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: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=Sl98dd//old4MkxdZidkkZsKvt1Fo0GEwLeRcCe/oDU=;\n\tb=NzHAcRgjoSeg6i\n\ti2fANqq5BQ3n3bJn8RmLnT7vIbj+f1+mS2CRJnj1T0xBOUNEdO3PzAMjByvPqQWKBPjhvvYa+WZY/\n\tfd9gGuhN85RaLhXVpRyMNd8LbI1vQIU2Uv4OA8kPtQHw/sK/L7bRj83s1zRPl2MDrkaFeO3uwHDxr\n\t8oldehPrajiX5yTOEi8n+W5zUnnfql6mgkbc3hwLA/1yzw5rpR1rm5jheBGncFMTRikI6c6nJEBrF\n\tmI8EEjO+Elt291z2LZrr/2hwHoqiLd6TMtRl4LhTjeSq4ZWqW87H3ATSIXyK3NPUisHGwi+smy4Rl\n\tUNERnQByhFIpDCCzMsPQ==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=0hy1DNH6IUk/eooqqqoHDvi6UUKWF3Gz11ADsqtHBqE=;\n\tb=DdTtWYcCmfERD5JqFwYwqt3xe9hXFpRhh5WeesxzeYseCDdAgq+kiOHcW9+zrg0kj3\n\tzCJMWW0YmcJa0eVWdkfxwnPt8Tv9cZQ0b7M8bdA3XAzpfwVJN4QHQHJIzrVqR18/Xoht\n\tekN7KnjP+pU3yGbNpsmdm4ZVHG0FPxsJpJT2o="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=0hy1DNH6IUk/eooqqqoHDvi6UUKWF3Gz11ADsqtHBqE=;\n\tb=NfzqIaiVA0GDQ21qDdi+JpFhhRQ2CFMIPsueTMTyopCmYQb1u0W75jKN6KRNqI15qo\n\tvw1xDfnBj0ay6bsSlmoIr2KIjEDoSY+U1urVNW/3KAcH2Fth3owGMGPZ62pfmDY4iu9s\n\t7pAIATE38xmcxY7B92BckJUUBMRQognZ6komJFzNhM64I391yLUOv5fWr/iNYKlKqp/E\n\tov125KJNWX1YHtSaockoqL+82cYaVOGRmDqE/tQ21/QGyKeUUW6wi8gGtw4l56kpDyCa\n\tWaqhj+f71I0XjCgle/+A6ohgy9iyQ/QGvrgTh/i+gcIxlDnO6WtQLWOboSOBbMcSbxX9\n\tBuxg==","X-Gm-Message-State":"AHPjjUgetyU5/qb3cY5T6EkDu9X3BhlH0sGCpKrmBoaE3R538OmPFTgW\n\tUNAKfqUrxF7TKzoRGtwAH4j6OA==","X-Google-Smtp-Source":"AOwi7QBi6n4lc4LDz9UsKpFBc++szWHphAVzaqPFVmDr1y/UWgAOy58CzJ/IOLZkJx3yzYTVy424VQ==","X-Received":"by 10.28.48.71 with SMTP id w68mr1459949wmw.3.1505834708099;\n\tTue, 19 Sep 2017 08:25:08 -0700 (PDT)","Date":"Tue, 19 Sep 2017 16:25:04 +0100","From":"Lee Jones <lee.jones@linaro.org>","To":"Nicolas Ferre <nicolas.ferre@microchip.com>","Subject":"Re: [PATCH v2 8/9] atmel_flexcom: Support backup mode","Message-ID":"<20170919152504.nhp5i734u75gb5gq@dell>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-9-romain.izard.pro@gmail.com>\n\t<53aa7783-0ecf-1e68-1bf9-c470ba2f79eb@microchip.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<53aa7783-0ecf-1e68-1bf9-c470ba2f79eb@microchip.com>","User-Agent":"NeoMutt/20170113 (1.7.2)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170919_082531_074537_EF05D7ED ","X-CRM114-Status":"GOOD (  12.86  )","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 [2a00:1450:400c:c09:0:0:0:22a 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":"Michael Turquette <mturquette@baylibre.com>,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>,\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\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\tlinux-mtd@lists.infradead.org, \n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","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":1771678,"web_url":"http://patchwork.ozlabs.org/comment/1771678/","msgid":"<CAGkQfmM08UqpLoMegRGQwmamN=Z74fem9VWT5yGcSjkYdS5c=Q@mail.gmail.com>","list_archive_url":null,"date":"2017-09-20T08:30:31","subject":"Re: [PATCH v2 8/9] atmel_flexcom: 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-19 17:25 GMT+02:00 Lee Jones <lee.jones@linaro.org>:\n> On Tue, 19 Sep 2017, Nicolas Ferre wrote:\n>\n>> On 15/09/2017 at 16:04, Romain Izard wrote:\n>> > The controller used by a flexcom module is configured at boot, and left\n>> > alone after this. As the configuration will be lost after backup mode,\n>> > restore the state of the flexcom driver on resume.\n>> >\n>> > Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n>>\n>> Tested-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n>> On sama5d2 Xplained board (i2c0 from flexcom 4).\n>> and obviously:\n>> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n>>\n>> Thanks Romain!\n>>\n>> Regards,\n>>\n>> > ---\n>> >  drivers/mfd/atmel-flexcom.c | 65 ++++++++++++++++++++++++++++++++++-----------\n>> >  1 file changed, 50 insertions(+), 15 deletions(-)\n>\n> This is the first time I've seen this patch.  Why's that?\n>\n\nAs the patchset covers many subsystems, get_maintainers.pl provided a\nvery long list of both developpers and mailing lists (28). I thought it\nwas a good idea to shorten it a little. Bad idea. Sorry.\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=\"NdgqAKUc\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=infradead.org header.i=@infradead.org\n\theader.b=\"bzF7vF4y\"; \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=\"scEozuOl\"; \n\tdkim=neutral (0-bit key) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"tUhDWT2/\"; 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 3xxtJY0dFcz9sNr\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 18:31: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 1duaQC-0005Op-MH; Wed, 20 Sep 2017 08:31:52 +0000","from merlin.infradead.org ([2001:8b0:10b:1231::1])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duaPl-00058X-Eo for linux-arm-kernel@bombadil.infradead.org;\n\tWed, 20 Sep 2017 08:31:25 +0000","from mail-qt0-x22c.google.com ([2607:f8b0:400d:c0d::22c])\n\tby merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duaPh-0003fx-0C for linux-arm-kernel@lists.infradead.org;\n\tWed, 20 Sep 2017 08:31:23 +0000","by mail-qt0-x22c.google.com with SMTP id x54so2022908qth.12\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tWed, 20 Sep 2017 01:30:55 -0700 (PDT)","by 10.200.48.120 with HTTP; Wed, 20 Sep 2017 01:30:31 -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=d9HzktrljVFSEuw7NDy2cR6MwDF8TOCLB29Vd9qcGrc=;\n\tb=NdgqAKUcAoaKYQ\n\tsD7uuhfyBoi3+7v2RkTTX8v4gbFI0/lKyzIw19oSP+o9bQoSzKcih5oFUH5rXYQbXthtsX0cWFOsl\n\t60kzCV7dC5NWiHrLBWvvivNcW7Yb0Ld3B4Ibj993X22TFa32zReMb2jwyiEPBqhu1qPGj3rxBK3i5\n\tGzs/09UDSGEFbziM+8iu1tduhz6ivh602GmnbXHVQG0RIENTFMXDcKyI7QUKc6dAKPAjE99E/vue2\n\tW8D492trDZJg1zqde95H8A2FVqlnvSpt5SxFjNq2I7RyJkDmmAvl1LbNu5AKacwT80K9r1XvU1i+8\n\t3GAcZG4zVpQzyHH7YTRg==;","v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=merlin.20170209;\n\th=Content-Type:Cc:To:Subject:Message-ID:\n\tDate:From:References:In-Reply-To:Sender:MIME-Version:Reply-To:\n\tContent-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:\n\tResent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:\n\tList-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;\n\tbh=LpuSl7BpgJsU3oAPh1uH4RyFRnR92eJoq0bvYK5Oujg=;\n\tb=bzF7vF4yKcq1MYnt4oDGmC5k1\n\tGR1UrZtSWNXsAfAgqSaozx2rh7E98Sl3kixmFuJPrhyzwxbftfzx8vS1KuXEFVo5XEHz+2ZVs8DSR\n\t+Wm+9reXQu51Y6VoLmWtROnxdhw7kwxgSybFhxsVz9gUDIp7RjOgjRmFu28OWvSOteAmV7jC6HmFl\n\t4HpYlT8cVUy84f4erGrzJGO7AotIVvW0DvyKRWptwJkZQzIJCWpGJi3GZu+vNi2stJfJnRLuHyw4C\n\t2Aa8pOhogplcYvQE/lbUn75EPVeIjJG470UigwVRptDwBk4FT5z4JtWaW9z+Ajl7xZprxx3iRIs0x\n\tN3g+qLcYQ==;","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=LpuSl7BpgJsU3oAPh1uH4RyFRnR92eJoq0bvYK5Oujg=;\n\tb=scEozuOlZXsX4GsoCBl+ioz9IMb+sEctjK4YYCjtv8WnJ3QAUkXWOZoVLJsx47IJrS\n\ty/7VZgIq7sOKFin1yvKrytpmHv+Czsfyou77vsVOZiX0PZminUpjHoOnx2UrNqeZJGQc\n\tldWMJbXDcN5YAQ6oUrSjnOZQ5cra37WY7dBmc=","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=LpuSl7BpgJsU3oAPh1uH4RyFRnR92eJoq0bvYK5Oujg=;\n\tb=tUhDWT2/RBMXpuUCTDT4viHNt3V1ZdvQKO3++1CzF0t0WmgpTUnsze+ZVYYTAjs+ii\n\tbBnCouVAmQPI9Ee+bdZvVSe7TRzhFAEz3WqhB5J87SBcywEcme+F6W6ZrNB09Ud5o7HP\n\t6zBRlI8CkvVgM4jpNMXrcE8eFEURrkq/xrnkyDWGRJdBcCuDksBMxC3BmTav7krUEG9r\n\tdFix3C/MQMMeTNUvhXlSX5QyJFXtUKBqDPoZcPGeWhd26XfSs+KMKn7xb+SXcgvUP2tC\n\tMBH+iwQZHJzNe7m+RWTBzhhqpw9erUOaDc7AHyDorEU87RGZZRXXm4rXjY+3WRP0U+Pc\n\tvDLQ=="],"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=LpuSl7BpgJsU3oAPh1uH4RyFRnR92eJoq0bvYK5Oujg=;\n\tb=GQoDpii9ArhFlOhFrb+uUbXwJIZURdw3gvSb8UJS7fn1ZKi5kN+g2pke3POebKhhHG\n\tqPGI58/9wM3x31qSGRXRqT4GgrVGNRL657IL2WAJS2U7iQzR2RPhmBxTE4+y3zStKflG\n\t0s3Y5bkwqHpB/DDQNgkc3yER+I1M4feKT5eYeqGJX7ce2ME7DyIOFIYse1wGR2zmAHNd\n\tZDp2OP9qKym3ckm+jSClGVQAHWsnL3meLZwlALJS+J1JB9V4JvFP3XAfIRPSzbYlop10\n\tzVFevPCpddp2TRocXFcjh4LonQzRC7I0Kf34HLLLYAd+4KGZzeI89VZnq0OFuWDEXtAe\n\t3MqQ==","X-Gm-Message-State":"AHPjjUgocWSP7ZcNXD9B6OKq2h7+TxnT97Yk9UG9EY2iaOLXxENIAb08\n\t14+JbhLvpVDUTj8Fb/GdJItXfzCSFdZD4cZw20e9cQ==","X-Google-Smtp-Source":"AOwi7QD2qHwwFX5hcf6DrauayPdFa3S1WR/tk6LH0AnkqLdMz7va7oN9ov8C7I5Ac8vaC1baBWOk3Q6O9mvuhM11wmY=","X-Received":"by 10.237.42.79 with SMTP id k15mr6336986qtf.222.1505896251856; \n\tWed, 20 Sep 2017 01:30:51 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170919152504.nhp5i734u75gb5gq@dell>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-9-romain.izard.pro@gmail.com>\n\t<53aa7783-0ecf-1e68-1bf9-c470ba2f79eb@microchip.com>\n\t<20170919152504.nhp5i734u75gb5gq@dell>","From":"Romain Izard <romain.izard.pro@gmail.com>","Date":"Wed, 20 Sep 2017 10:30:31 +0200","X-Google-Sender-Auth":"MFips3p53529z0qRxwDTz-hlErk","Message-ID":"<CAGkQfmM08UqpLoMegRGQwmamN=Z74fem9VWT5yGcSjkYdS5c=Q@mail.gmail.com>","Subject":"Re: [PATCH v2 8/9] atmel_flexcom: Support backup mode","To":"Lee Jones <lee.jones@linaro.org>","X-Spam-Note":"CRM114 invocation failed","X-Spam-Score":"-1.8 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on merlin.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:22c listed in] [list.dnswl.org]\n\t0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level\n\tmail domains are different\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\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\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":"Michael Turquette <mturquette@baylibre.com>,\n\tLKML <linux-kernel@vger.kernel.org>,\n\tThierry Reding <thierry.reding@gmail.com>, \n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>,\n\tlinux-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\tWenyou Yang <wenyou.yang@atmel.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@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":1771703,"web_url":"http://patchwork.ozlabs.org/comment/1771703/","msgid":"<20170920091829.wftbjshog3ixvpmu@piout.net>","list_archive_url":null,"date":"2017-09-20T09:18:29","subject":"Re: [PATCH v2 8/9] atmel_flexcom: Support backup mode","submitter":{"id":26276,"url":"http://patchwork.ozlabs.org/api/people/26276/","name":"Alexandre Belloni","email":"alexandre.belloni@free-electrons.com"},"content":"On 20/09/2017 at 10:30:31 +0200, Romain Izard wrote:\n> 2017-09-19 17:25 GMT+02:00 Lee Jones <lee.jones@linaro.org>:\n> > On Tue, 19 Sep 2017, Nicolas Ferre wrote:\n> >\n> >> On 15/09/2017 at 16:04, Romain Izard wrote:\n> >> > The controller used by a flexcom module is configured at boot, and left\n> >> > alone after this. As the configuration will be lost after backup mode,\n> >> > restore the state of the flexcom driver on resume.\n> >> >\n> >> > Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n> >>\n> >> Tested-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n> >> On sama5d2 Xplained board (i2c0 from flexcom 4).\n> >> and obviously:\n> >> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n> >>\n> >> Thanks Romain!\n> >>\n> >> Regards,\n> >>\n> >> > ---\n> >> >  drivers/mfd/atmel-flexcom.c | 65 ++++++++++++++++++++++++++++++++++-----------\n> >> >  1 file changed, 50 insertions(+), 15 deletions(-)\n> >\n> > This is the first time I've seen this patch.  Why's that?\n> >\n> \n> As the patchset covers many subsystems, get_maintainers.pl provided a\n> very long list of both developpers and mailing lists (28). I thought it\n> was a good idea to shorten it a little. Bad idea. Sorry.\n> \n\nI think the correct way of handling that would have been to send each\npatch to the proper subsystem as there are no dependency here.","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=\"qoeXMvw/\"; 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 3xxvLv1qXtz9sP1\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 19:19:03 +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 1dub9o-0004qE-1K; Wed, 20 Sep 2017 09:19:00 +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 1dub9j-0004kB-Jc; Wed, 20 Sep 2017 09:18:58 +0000","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 2A8B620945; Wed, 20 Sep 2017 11:18:32 +0200 (CEST)","from localhost (cpe-98-151-125-52.hawaii.res.rr.com\n\t[98.151.125.52])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 2DC2020929;\n\tWed, 20 Sep 2017 11:18:31 +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=3nqjGrnv7FGG0k6bP88IwluQ7sszisZ8/BY+fb8VEXg=;\n\tb=qoeXMvw/+B1raw\n\t1wRMC1vMAWo8yZmTJ/PDnfZJocs9QRJd+hT6A+9NUUs690mEtHchxMQyppoNrD0Fm80LmucMgaYCf\n\tehGLHi221niqadheIdv9ch3/aPRABl8PMjsDZLPWmTYdc7IQl42qie8LxyKwwFPVoO8FuhYNbUfGh\n\typvPUWdCbFZsMcqnLHjbE44QomdZmoWN5AHRPgtBCkmVL3UF3h03Jn2VmqVg/Q1D64U/bHroOeamZ\n\tzh7JpgfUup9WBsEx8v9t+IMzi1zrAYpumNw5BsGC7eLjN8KoIj26qE6s/L6vNYsCBjzZ//14Jv85I\n\t0RlZaAD7XOZbE+jllAiw==;","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, 20 Sep 2017 11:18:29 +0200","From":"Alexandre Belloni <alexandre.belloni@free-electrons.com>","To":"Romain Izard <romain.izard.pro@gmail.com>","Subject":"Re: [PATCH v2 8/9] atmel_flexcom: Support backup mode","Message-ID":"<20170920091829.wftbjshog3ixvpmu@piout.net>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-9-romain.izard.pro@gmail.com>\n\t<53aa7783-0ecf-1e68-1bf9-c470ba2f79eb@microchip.com>\n\t<20170919152504.nhp5i734u75gb5gq@dell>\n\t<CAGkQfmM08UqpLoMegRGQwmamN=Z74fem9VWT5yGcSjkYdS5c=Q@mail.gmail.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<CAGkQfmM08UqpLoMegRGQwmamN=Z74fem9VWT5yGcSjkYdS5c=Q@mail.gmail.com>","User-Agent":"NeoMutt/20170609 (1.8.3)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170920_021855_808802_64FCB962 ","X-CRM114-Status":"GOOD (  18.06  )","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":"Michael Turquette <mturquette@baylibre.com>,\n\tLKML <linux-kernel@vger.kernel.org>,\n\tThierry Reding <thierry.reding@gmail.com>, \n\tlinux-mtd <linux-mtd@lists.infradead.org>,\n\tLee Jones <lee.jones@linaro.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\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>","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":1771925,"web_url":"http://patchwork.ozlabs.org/comment/1771925/","msgid":"<dabb8094-3489-3617-0b09-3aff247b34a2@gmail.com>","list_archive_url":null,"date":"2017-09-20T14:35:05","subject":"Re: [PATCH v2 9/9] tty/serial: atmel: Prevent a warning on suspend","submitter":{"id":810,"url":"http://patchwork.ozlabs.org/api/people/810/","name":"Richard Genoud","email":"richard.genoud@gmail.com"},"content":"On 15/09/2017 16:04, Romain Izard wrote:\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 | 14 ++++++++++++++\n>  1 file changed, 14 insertions(+)\n> \n> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c\n> index 7551cab438ff..783af6648be0 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>  \tbool\t\t\thas_hw_timer;\n>  \tstruct timer_list\tuart_timer;\n>  \n> +\tbool\t\t\ttx_stopped;\n>  \tbool\t\t\tsuspended;\n>  \tunsigned int\t\tpending;\n>  \tunsigned int\t\tpending_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> +\tstruct atmel_uart_port *atmel_port = to_atmel_uart_port(port);\n> +\n> +\tif (atmel_port->tx_stopped)\n> +\t\treturn TIOCSER_TEMT;\n>  \treturn (atmel_uart_readl(port, ATMEL_US_CSR) & ATMEL_US_TXEMPTY) ?\n>  \t\tTIOCSER_TEMT :\n>  \t\t0;\n> @@ -485,6 +490,7 @@ static void atmel_stop_tx(struct uart_port *port)\n>  \t * is fully transmitted.\n>  \t */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS);\n> +\tatmel_port->tx_stopped = true;\n>  \n>  \t/* Disable interrupts */\n>  \tatmel_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>  \tif ((port->rs485.flags & SER_RS485_ENABLED) &&\n>  \t    !(port->rs485.flags & SER_RS485_RX_DURING_TX))\n>  \t\tatmel_start_rx(port);\n> +\n>  }\nThis line feed is not needed.\nOtherwise,\n\nAcked-by: Richard Genoud <richard.genoud@gmail.com>\n\n>  \n>  /*\n> @@ -521,6 +528,7 @@ static void atmel_start_tx(struct uart_port *port)\n>  \n>  \t/* re-enable the transmitter */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);\n> +\tatmel_port->tx_stopped = false;\n>  }\n>  \n>  /*\n> @@ -1866,6 +1874,7 @@ static int atmel_startup(struct uart_port *port)\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n>  \t/* enable xmit & rcvr */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n> +\tatmel_port->tx_stopped = false;\n>  \n>  \tsetup_timer(&atmel_port->uart_timer,\n>  \t\t\tatmel_uart_timer_callback,\n> @@ -2122,6 +2131,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,\n>  \n>  \t/* disable receiver and transmitter */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS | ATMEL_US_RXDIS);\n> +\tatmel_port->tx_stopped = true;\n>  \n>  \t/* mode */\n>  \tif (port->rs485.flags & SER_RS485_ENABLED) {\n> @@ -2207,6 +2217,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,\n>  \tatmel_uart_writel(port, ATMEL_US_BRGR, quot);\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n> +\tatmel_port->tx_stopped = false;\n>  \n>  \t/* restore interrupts */\n>  \tatmel_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>  \t/* Make sure that tx path is actually able to send characters */\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);\n> +\tatmel_port->tx_stopped = false;\n>  \n>  \tuart_console_write(port, s, count, atmel_console_putchar);\n>  \n> @@ -2511,6 +2523,7 @@ static int __init atmel_console_setup(struct console *co, char *options)\n>  {\n>  \tint ret;\n>  \tstruct uart_port *port = &atmel_ports[co->index].uart;\n> +\tstruct atmel_uart_port *atmel_port = to_atmel_uart_port(port);\n>  \tint baud = 115200;\n>  \tint bits = 8;\n>  \tint parity = 'n';\n> @@ -2528,6 +2541,7 @@ static int __init atmel_console_setup(struct console *co, char *options)\n>  \tatmel_uart_writel(port, ATMEL_US_IDR, -1);\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);\n>  \tatmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);\n> +\tatmel_port->tx_stopped = false;\n>  \n>  \tif (options)\n>  \t\tuart_parse_options(options, &baud, &parity, &bits, &flow);\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 header.b=\"iA5Aayhl\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"urmuN6un\"; 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 3xy2NQ0BZ5z9sP1\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 00:35:46 +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 1dug6I-0000rs-L3; Wed, 20 Sep 2017 14:35:42 +0000","from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dug66-0000jc-Ct; Wed, 20 Sep 2017 14:35:36 +0000","by mail-wm0-x242.google.com with SMTP id e64so2641023wmi.2;\n\tWed, 20 Sep 2017 07:35:09 -0700 (PDT)","from [192.168.2.41] ([46.227.18.67])\n\tby smtp.googlemail.com with ESMTPSA id\n\tp46sm2093051wrb.46.2017.09.20.07.35.06\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 07:35:06 -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: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=kTqCYDVje/quh5n5TTd9NIEN9eFP/0QyuT8qfDzpFMI=;\n\tb=iA5Aayhlo2cL/b\n\ttT5W2mEioCM1U8FTlWTwJ9xTlyglunJ1dPZSmKBqt1CbbAhuOq4fB4d5YTNylfZe0ERWg1YnyEsXZ\n\tuFTosuUnCsQ8coxU87z+YCl8Vs0RmHkkA8I7Qa8W8/lYv7iOFcl3yw4rKBy1dzXz2j6XP6m+X6hKz\n\t+YoXaBPu5zU3/pX7TWbPq87Mk6iJhb6LX+RkcgRRnJ7TutyoEZNPA+aOT/Oj74JnbmIFnc93PF5d8\n\t0+tTMKMtBtvkohNt4VL7bvYNiogWmgtrqxmc675j2gQ5FLQpAnSF86Ev/AKIjH4BxwTvvD+KRZTAW\n\tWi6FGte67skqq2hmbOaA==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=EL3KOGJsVUMobalD+MGDTDBD9UYbhlqlobmZubT6b+8=;\n\tb=urmuN6unIvMl2ALEz7rasLydR+H89JT4Mtd5eLGLVUVXbyUb+chK1jQA6piADWfI+p\n\tsG7EfEaapPzQiXaoX/uueDaRYjVqX40tOSY5LRpU4Nx4hF7b4XT09QuKCDOaCgQKzZO2\n\tINhoiU6FZWmpqP975sRio07u/46cITgPH70+0goa6x5ZR0oJU4sf12ojDWuFYERg6T5J\n\tqCwNiq+mddyiVX4SGcotBoyUR9bT8yHVK0pZ0NBU9ZNQx2OIe91Allhn+smplSygF8F+\n\tbqnxEqXrvN7uW8R9Bfostq46/jpCo/u8jDYcV6MruGUa5Oujm7FURgHfWz4cAFowzlmM\n\tXHwQ=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=EL3KOGJsVUMobalD+MGDTDBD9UYbhlqlobmZubT6b+8=;\n\tb=Qpu65bgYXAScLfSAKML7jFVp2SG6ng6wfEa0yOFnyB0/tHfCKMnFTIMavFvzozxfQE\n\txIBemOCCbN3FtTECNlSAY/wt4LRYaNiZH1YHcoxKnfNz8QxgGYySQDvu1gpYu5dy+pox\n\tHiwi93YIqycucL7UYbhchcpXein5YqESpx8e3B4TiRCSY5G5HlIH5tNcOS8QslpTPG+J\n\tQ6u9tDmfwnCTu3GGHU+KljK8rc06IQDZyNYWMg7ixFCE+RWrW83i5EBFVWopZZeqwnvQ\n\tBQoF3OqEc9eyJsSrY1jFuCzGmDiyG5/PumY/vwewu0wkREMpj+x+RZmoVB6qcrIYDqmn\n\txg8g==","X-Gm-Message-State":"AHPjjUgtUWeEZy4L6iv5ukUXIvEQg9dd+nBnYWMcnyUiik2F05OfQUri\n\tvqsOESxnRCiOfJRFZX52fX2Ow5B+","X-Google-Smtp-Source":"AOwi7QCWR4DG9t4R7Lt/YKV+XmGrYWIED2XYvKAHlZb4HzBn0RAOf4JxX1WP9CtW7RHVn80oHDubtw==","X-Received":"by 10.28.74.89 with SMTP id x86mr4240580wma.57.1505918107891;\n\tWed, 20 Sep 2017 07:35:07 -0700 (PDT)","Subject":"Re: [PATCH v2 9/9] tty/serial: atmel: Prevent a warning on suspend","To":"Romain Izard <romain.izard.pro@gmail.com>,\n\tNicolas Ferre <nicolas.ferre@microchip.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.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\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\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tAlan Stern <stern@rowland.harvard.edu>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-10-romain.izard.pro@gmail.com>","From":"Richard Genoud <richard.genoud@gmail.com>","Message-ID":"<dabb8094-3489-3617-0b09-3aff247b34a2@gmail.com>","Date":"Wed, 20 Sep 2017 16:35:05 +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":"<20170915140411.31716-10-romain.izard.pro@gmail.com>","Content-Language":"fr","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170920_073530_602241_298E8D9D ","X-CRM114-Status":"GOOD (  20.55  )","X-Spam-Score":"-2.0 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 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 [2a00:1450:400c:c09:0:0:0:242 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 (richard.genoud[at]gmail.com)\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-pwm@vger.kernel.org, linux-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-serial@vger.kernel.org, linux-clk@vger.kernel.org,\n\tlinux-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":1772607,"web_url":"http://patchwork.ozlabs.org/comment/1772607/","msgid":"<CAGkQfmNg_oatA27xjZ57CsbntwPD893K=5bFb1gF1yp-wH-L1A@mail.gmail.com>","list_archive_url":null,"date":"2017-09-21T09:22:42","subject":"Re: [PATCH v2 5/9] mtd: nand: atmel: Report PMECC failures as errors","submitter":{"id":8236,"url":"http://patchwork.ozlabs.org/api/people/8236/","name":"Romain Izard","email":"romain.izard.pro@gmail.com"},"content":"2017-09-18 12:00 GMT+02:00 Boris Brezillon <boris.brezillon@free-electrons.com>:\n> Hi Romain,\n>\n> On Fri, 15 Sep 2017 16:04:07 +0200\n> Romain Izard <romain.izard.pro@gmail.com> wrote:\n>\n>> It is not normal for the PMECC to fail when trying to fix ECC errors.\n>> Report these cases as errors.\n>\n> I'm not sure we want to have ECC error messages at this level. ECC\n> errors are rather unusual but not impossible, and sometimes it's even\n> not a real error (I'm thinking of bitflips in erased pages for\n> example, which are not necessarily detected/fixed in hardware).\n>\n> If we decide to print error messages when unfixable bitflips are\n> detected, it should be done in the nand-controller driver (somewhere\n> along those lines [1]).\n>\n> Regards,\n>\n> Boris\n>\n> [1]http://elixir.free-electrons.com/linux/latest/source/drivers/mtd/nand/atmel/nand-controller.c#L827\n>\n>>\n>> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n>> ---\n>>  drivers/mtd/nand/atmel/pmecc.c | 4 +++-\n>>  1 file changed, 3 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c\n>> index 8d1208f38025..2a23f1ff945f 100644\n>> --- a/drivers/mtd/nand/atmel/pmecc.c\n>> +++ b/drivers/mtd/nand/atmel/pmecc.c\n>> @@ -687,6 +687,8 @@ static int atmel_pmecc_err_location(struct atmel_pmecc_user *user)\n>>        * Number of roots does not match the degree of smu\n>>        * unable to correct error.\n>>        */\n>> +     dev_err(pmecc->dev,\n>> +             \"PMECC: Impossible to calculate error location.\\n\");\n>>       return -EBADMSG;\n>>  }\n>>\n>> @@ -729,7 +731,7 @@ int atmel_pmecc_correct_sector(struct atmel_pmecc_user *user, int sector,\n>>                       ptr = ecc + byte - sectorsize;\n>>                       area = \"ECC\";\n>>               } else {\n>> -                     dev_dbg(pmecc->dev,\n>> +                     dev_err(pmecc->dev,\n>>                               \"Invalid errpos value (%d, max is %d)\\n\",\n>>                               errpos, (sectorsize + eccbytes) * 8);\n>>                       return -EINVAL;\n>\n\nOk, I will drop this patch.","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=\"uoVOMuCO\"; \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=\"ncVrtRfv\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"XqO9p0rv\"; 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 3xyWPm4xb7z9s3T\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 19:23:36 +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 1duxhk-00036c-1S; Thu, 21 Sep 2017 09:23:32 +0000","from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1duxhd-0002zc-QW for linux-arm-kernel@lists.infradead.org;\n\tThu, 21 Sep 2017 09:23:29 +0000","by mail-qt0-x22d.google.com with SMTP id q8so5306863qtb.5\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tThu, 21 Sep 2017 02:23:03 -0700 (PDT)","by 10.200.48.120 with HTTP; Thu, 21 Sep 2017 02:22:42 -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=FKPQtNpSp1dWVeIHBcDsQKD06LQ9RJaUac3NPtpSYSo=;\n\tb=uoVOMuCOS7cqTf\n\tXSk/mezKeLDLxpYIxQ7i/PN796/4wPu15mDMB+7B+/yLbbMEIdVUqgIYacnwZ6FNTpILq6vyO6EsX\n\tkwJmSt4Jk9IvJyYh3Le8Qm5Nd6v0mEje/hEzuex86nrpJUZMMawtA7a4PR3DlD6i2HV04faBKCgcT\n\t1l658BdtUrD5W9qxK5HW6D8AJII8yPuUzoluBGfr/aNEeA09DevarcZGh2t8HL1+pjAPAx7+KUy7n\n\topcOca2NWaGgqIds7nVpQsGtZfNIY3zpkxcCR8cUrMmyz7HUodGlJdhbHOhe8bP46BVJ4IqKtNv3D\n\t6TrfITUUtUh/xGUMmelA==;","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=c6X7dVqosB2yW1uzf9F6jergbkgC2nFFJvtWgvnJX/8=;\n\tb=ncVrtRfvzt/Nb31nIMMG1/rrAGcD6wNBfSNXVDyVklbWSXXY+VNcgCe9WDTbf7HyVO\n\tYjgKfRlX2cCITChs2aQ1H2LRMElumFJi2eY++1d1+wOpS17bPTkWBBXv/V9IH1bY5Q/t\n\tyxHJP6tSb8UM8zd6OVTkSicGp816nVCyTc+DU=","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=c6X7dVqosB2yW1uzf9F6jergbkgC2nFFJvtWgvnJX/8=;\n\tb=XqO9p0rvrIPDSw/Q16GnZiVe9ISKsdmopYx5DhRpcOWGEZNgMARwZ+EOn9/2HHEtqM\n\tzUwMdqO8G1+WnTholBc5QIBAndgG9N+9bUwNaakTMbnH/C1oftH1ircAorxc0TPYXAB0\n\tbcohRfaUGwjRm0o0RxOTu/4TDGelp9kH658WNDkczLPNfHrxUwVAwXd2IXzhXQOlf/sF\n\tktgRwFlfYVP2F3R8gV08atrfPdcXjKpyl0iHi047gsuJIuaGxOFRpFbItx0AzI9lG+kx\n\tq7yI5o0WNviP5d768SwPlghIJS9hJ1iR6s9a9lG65g2tyJy89DgY/HZ2stuUQNOLNLcg\n\tac9Q=="],"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=c6X7dVqosB2yW1uzf9F6jergbkgC2nFFJvtWgvnJX/8=;\n\tb=N+I6uG/h4TDFBpZSgEH3VV3ELXIUZiNf2ti1iTUEBIvS5hsrQfXJIbOxVgDBbDvlH8\n\tx57sNYGHmzAS8zlb8F1Bj2kOc3tSJbgDfMJVfn5Po2N5CnaClssM2oXyVwGVW6aAw368\n\t/x+Mxie97k0IbTKL3gR2SvvXkNQq/HGN7qfYHxWcMI1Qy8wpidOh8yBSxiSKpFaRtrRX\n\tetQS+caeNQrZUD16epmFUblhPSSZ+6f2KdndtX6IGOWWnCGqHMmaHFuZrQc7ZejSEcJg\n\tsRXPYkVW/SGOsUKSIfPGDIbmfwDTZzglWoI5Cq1PAtBChMEAu3/l4Zm+Gon4XP6AJEcT\n\tqj0g==","X-Gm-Message-State":"AHPjjUjJvBDdHj0z4GjQkZRWtR+4Z7zS0isjQ6nthN/8hhgcWT5b1uqO\n\tpX/LJDIuoeYSFEEt5j9E/ty6/gdkoUqISv3d3cOXxQ==","X-Google-Smtp-Source":"AOwi7QBa08wLJpC1KuwCqMB2ZOyG6KnMfw7GRokjfDY56VHJ68fKkoT+6AiAJfwwDilYqvgUyefAujgvanJKrGeN/PA=","X-Received":"by 10.237.62.79 with SMTP id m15mr2280325qtf.244.1505985782749; \n\tThu, 21 Sep 2017 02:23:02 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170918120051.298bdabf@bbrezillon>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-6-romain.izard.pro@gmail.com>\n\t<20170918120051.298bdabf@bbrezillon>","From":"Romain Izard <romain.izard.pro@gmail.com>","Date":"Thu, 21 Sep 2017 11:22:42 +0200","X-Google-Sender-Auth":"duAPxT4kaog8s8NZhWo0-mJIgx0","Message-ID":"<CAGkQfmNg_oatA27xjZ57CsbntwPD893K=5bFb1gF1yp-wH-L1A@mail.gmail.com>","Subject":"Re: [PATCH v2 5/9] mtd: nand: atmel: Report PMECC failures as errors","To":"Boris Brezillon <boris.brezillon@free-electrons.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170921_022326_123069_9A159DBC ","X-CRM114-Status":"GOOD (  19.52  )","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:22d 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":"Michael Turquette <mturquette@baylibre.com>,\n\tLKML <linux-kernel@vger.kernel.org>,\n\tThierry Reding <thierry.reding@gmail.com>, \n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>,\n\tlinux-clk@vger.kernel.org, Josh Wu <rainyfeeling@outlook.com>,\n\tMarek 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\tWenyou Yang <wenyou.yang@atmel.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@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":1773455,"web_url":"http://patchwork.ozlabs.org/comment/1773455/","msgid":"<d6359e89-7c78-fdec-fbab-eb885017ec58@microchip.com>","list_archive_url":null,"date":"2017-09-22T10:31:12","subject":"Re: [PATCH v2 3/9] 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 15/09/2017 at 16:04, Romain Izard wrote:\n> From: Romain Izard <romain.izard@mobile-devices.fr>\n> \n> When an AT91 programmable clock is declared in the device tree, register\n> it into the Power Management Controller driver. On entering suspend mode,\n> the driver saves and restores the Programmable Clock registers to support\n> the backup mode for these clocks.\n> \n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n\nRomain,\n\nSome nitpicking and one comment. But on the overall patch, here is my:\nAcked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n\nSee below:\n\n> ---\n> Changes in v2:\n> * register PCKs on clock startup\n> \n>  drivers/clk/at91/clk-programmable.c |  2 ++\n>  drivers/clk/at91/pmc.c              | 27 +++++++++++++++++++++++++++\n>  drivers/clk/at91/pmc.h              |  2 ++\n>  3 files changed, 31 insertions(+)\n> \n> diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c\n> index 85a449cf61e3..0e6aab1252fc 100644\n> --- a/drivers/clk/at91/clk-programmable.c\n> +++ b/drivers/clk/at91/clk-programmable.c\n> @@ -204,6 +204,8 @@ at91_clk_register_programmable(struct regmap *regmap,\n>  \tif (ret) {\n>  \t\tkfree(prog);\n>  \t\thw = ERR_PTR(ret);\n\nNit: \"else\" not needed.\n\n> +\t} else {\n> +\t\tpmc_register_pck(id);\n>  \t}\n>  \n>  \treturn hw;\n> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n> index 07dc2861ad3f..3910b7537152 100644\n> --- a/drivers/clk/at91/pmc.c\n> +++ b/drivers/clk/at91/pmc.c\n> @@ -22,6 +22,7 @@\n>  #include \"pmc.h\"\n>  \n>  #define PMC_MAX_IDS 128\n> +#define PMC_MAX_PCKS 8\n>  \n>  int of_at91_get_clk_range(struct device_node *np, const char *propname,\n>  \t\t\t  struct clk_range *range)\n> @@ -50,6 +51,7 @@ EXPORT_SYMBOL_GPL(of_at91_get_clk_range);\n>  static struct regmap *pmcreg;\n>  \n>  static u8 registered_ids[PMC_MAX_IDS];\n> +static u8 registered_pcks[PMC_MAX_PCKS];\n>  \n>  static struct\n>  {\n> @@ -66,8 +68,10 @@ static struct\n>  \tu32 pcr[PMC_MAX_IDS];\n>  \tu32 audio_pll0;\n>  \tu32 audio_pll1;\n> +\tu32 pckr[PMC_MAX_PCKS];\n>  } pmc_cache;\n>  \n> +/* Clock ID 0 is invalid */\n\n(read: so we can use the 0 value as an indicator that this place in the\ntable hasn't been filled, so unused)\n\n>  void pmc_register_id(u8 id)\n>  {\n>  \tint i;\n> @@ -82,6 +86,21 @@ void pmc_register_id(u8 id)\n>  \t}\n>  }\n>  \n> +/* Programmable Clock 0 is valid */\n\nI understand the rationale behind these ^^ two comments, but I would\nlike that it's more explicit. Saying that you will store the pck id as\n(id + 1) and that you would have to invert this operation while using\nthe stored id.\nMaybe add a comment about this transformation to the struct definition\nas well...\n\n\n> +void pmc_register_pck(u8 pck)\n> +{\n> +\tint i;\n> +\n> +\tfor (i = 0; i < PMC_MAX_PCKS; i++) {\n> +\t\tif (registered_pcks[i] == 0) {\n> +\t\t\tregistered_pcks[i] = pck + 1;\n> +\t\t\tbreak;\n> +\t\t}\n> +\t\tif (registered_pcks[i] == (pck + 1))\n> +\t\t\tbreak;\n> +\t}\n> +}\n> +\n>  static int pmc_suspend(void)\n>  {\n>  \tint i;\n> @@ -103,6 +122,10 @@ 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; registered_pcks[i]; i++) {\n> +\t\tu8 num = registered_pcks[i] - 1;\n\nNit: declaration are better made at the beginning of the function. This\nlead to a checkpatch warning:\n\"WARNING: Missing a blank line after declarations\"\n\n> +\t\tregmap_read(pmcreg, AT91_PMC_PCKR(num), &pmc_cache.pckr[num]);\n> +\t}\n>  \n>  \treturn 0;\n>  }\n> @@ -143,6 +166,10 @@ 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; registered_pcks[i]; i++) {\n> +\t\tu8 num = registered_pcks[i] - 1;\n\nDitto\n\n> +\t\tregmap_write(pmcreg, AT91_PMC_PCKR(num), pmc_cache.pckr[num]);\n> +\t}\n>  \n>  \tif (pmc_cache.uckr & AT91_PMC_UPLLEN)\n>  \t\tmask |= AT91_PMC_LOCKU;\n> diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h\n> index 858e8ef7e8db..d22b1fa9ecdc 100644\n> --- a/drivers/clk/at91/pmc.h\n> +++ b/drivers/clk/at91/pmc.h\n> @@ -31,8 +31,10 @@ int of_at91_get_clk_range(struct device_node *np, const char *propname,\n>  \n>  #ifdef CONFIG_PM\n>  void pmc_register_id(u8 id);\n> +void pmc_register_pck(u8 pck);\n>  #else\n>  static inline void pmc_register_id(u8 id) {}\n> +static inline void pmc_register_pck(u8 pck) {}\n>  #endif\n>  \n>  #endif /* __PMC_H_ */\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=\"FQYF8EUz\"; 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 3xz8rb4NRKz9s7h\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 20:30:39 +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 1dvLEC-00036R-6d; Fri, 22 Sep 2017 10:30:36 +0000","from esa3.microchip.iphmx.com ([68.232.153.233])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dvLE6-0002AQ-Kv; Fri, 22 Sep 2017 10:30:33 +0000","from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t22 Sep 2017 03:30:06 -0700","from [10.159.245.112] (10.10.76.4) by chn-sv-exch05.mchp-main.com\n\t(10.10.76.106) with Microsoft SMTP Server id 14.3.352.0;\n\tFri, 22 Sep 2017 03:30:05 -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=aYGQOwlAh7Rg9sr0YXJsxztvYsy/u8dBJqNSdzNddHM=;\n\tb=FQYF8EUzNBySu6\n\twZ7xt0P9LLfXHIqmtPAHnulTJ8hwnDbT6ns2TMYt8BMGjbf4X2ketMvYgAeh17+5EI3LdLX9+f7Z7\n\tXS2dvYn1ZWlGAbbTZfIjU+WtgKAaf+wSxzeI6oPHvvXdUpsMkbcTzk+69eb0FvwoiEFifYuk1sQHI\n\trzrZmoeIenHNUtz7ercdHhFnmZsz/epzJZIXMALuWd30mScmrkbgjyoPA+OuMiQEfkjomPo3dlxqX\n\t2MLD/s6YdWJ+TpaUpVU7l16ik3g0fvm959GJypOzTvq0x5B4Z+FDMimGdECWgJpveNbWZV4uqIvPi\n\tviv+5dNXUYkdWuAFTwMg==;","X-IronPort-AV":"E=Sophos;i=\"5.42,427,1500966000\"; d=\"scan'208\";a=\"7270387\"","Subject":"Re: [PATCH v2 3/9] clk: at91: pmc: Support backup for programmable\n\tclocks","To":"Romain Izard <romain.izard.pro@gmail.com>, Alexandre Belloni\n\t<alexandre.belloni@free-electrons.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>, Wenyou Yang\n\t<wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>,\n\tDavid Woodhouse\n\t<dwmw2@infradead.org>, Brian Norris <computersforpeace@gmail.com>, Marek\n\tVasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, \n\tThierry Reding <thierry.reding@gmail.com>, Richard Genoud\n\t<richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, \n\tAlan Stern <stern@rowland.harvard.edu>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-4-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<d6359e89-7c78-fdec-fbab-eb885017ec58@microchip.com>","Date":"Fri, 22 Sep 2017 12:31:12 +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":"<20170915140411.31716-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-20170922_033030_835347_A5012895 ","X-CRM114-Status":"GOOD (  19.26  )","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.153.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]","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-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-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":1773531,"web_url":"http://patchwork.ozlabs.org/comment/1773531/","msgid":"<20170922120532.jddabnd57yt3iowe@rfolt0960.corp.atmel.com>","list_archive_url":null,"date":"2017-09-22T12:05:32","subject":"Re: [PATCH v2 1/9] clk: at91: pmc: Wait for clocks when resuming","submitter":{"id":70920,"url":"http://patchwork.ozlabs.org/api/people/70920/","name":"Ludovic Desroches","email":"ludovic.desroches@microchip.com"},"content":"On Fri, Sep 15, 2017 at 04:04:03PM +0200, 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>\nAcked-by: Ludovic Desroches <ludovic.desroches@microchip.com>\n\nI faced the same issue because of the use of regmap_read_poll_timeout\nwhen timekeeping is not ready.\n\n\nLudovic\n\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>  }\n>  \n>  static struct syscore_ops pmc_syscore_ops = {\n> -- \n> 2.11.0\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=\"tU/3cJh1\"; 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 3xzC0P3mysz9sPk\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 22:07:33 +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 1dvMjy-00029A-7N; Fri, 22 Sep 2017 12:07:30 +0000","from esa3.microchip.iphmx.com ([68.232.153.233])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dvMjt-00025G-1C; Fri, 22 Sep 2017 12:07:27 +0000","from exsmtp02.microchip.com (HELO email.microchip.com)\n\t([198.175.253.38])\n\tby esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t22 Sep 2017 05:06:39 -0700","from localhost (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, 22 Sep 2017 05:06:38 -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: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=I71WkUjbzm8sdUHikM+ExJu6W1t9HpGI9sFKP7X6xjc=;\n\tb=tU/3cJh1NXWh2h\n\tXVJnk9d2UPzGIvQq+XPquzm36Nk5cYW5VNXFuPv3WCcdwJHAlup+fs1qGobG2XjhJGsY7DO3GZfUC\n\tD3Sr0mBYxg1Ic8CoRguBCyrJDOYiPNoAKgGV7Z6GcSXaWz4FPS3ODSlv7B6Nsvj85TnB8E/YS25dO\n\tZPpGEpdpi9y0Kd5aernQqZkBNqK9LaElC9bk3mVzqNmC1KKd1HmDYirIxcfWh9CSirNpRXoXyokMr\n\txJArAM8uRiW4ux9x3+hcRMlcZJQ5tEXYWhGi+39lIYujCrtCx+lJvPScGkGvU3hfqcRMC0mpM37eC\n\t5opY7DG+QsHdYOFWuZkQ==;","X-IronPort-AV":"E=Sophos;i=\"5.42,427,1500966000\"; d=\"scan'208\";a=\"7272402\"","Date":"Fri, 22 Sep 2017 14:05:32 +0200","From":"Ludovic Desroches <ludovic.desroches@microchip.com>","To":"Romain Izard <romain.izard.pro@gmail.com>","Subject":"Re: [PATCH v2 1/9] clk: at91: pmc: Wait for clocks when resuming","Message-ID":"<20170922120532.jddabnd57yt3iowe@rfolt0960.corp.atmel.com>","Mail-Followup-To":"Romain Izard <romain.izard.pro@gmail.com>,\n\tNicolas Ferre <nicolas.ferre@microchip.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>,\n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@codeaurora.org>,\n\tWenyou Yang <wenyou.yang@atmel.com>,\n\tJosh 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>, linux-clk@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-pwm@vger.kernel.org, linux-serial@vger.kernel.org,\n\tlinux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-2-romain.izard.pro@gmail.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20170915140411.31716-2-romain.izard.pro@gmail.com>","User-Agent":"NeoMutt/20170609 (1.8.3)","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170922_050725_168627_BA247342 ","X-CRM114-Status":"GOOD (  15.07  )","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.153.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]","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":"Michael Turquette <mturquette@baylibre.com>, linux-kernel@vger.kernel.org,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>,\n\tlinux-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, 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\tWenyou Yang <wenyou.yang@atmel.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tlinux-mtd@lists.infradead.org, \n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@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":1773540,"web_url":"http://patchwork.ozlabs.org/comment/1773540/","msgid":"<e5e1fb83-3106-3f8f-26d6-8b2d3cb4748a@microchip.com>","list_archive_url":null,"date":"2017-09-22T12:13:26","subject":"Re: [PATCH v2 1/9] 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 15/09/2017 at 16:04, 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\nAnd here is my:\nAcked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n\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>  }\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=\"gc6BCD0S\"; 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 3xzC714Ggnz9sRW\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 22:13:17 +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 1dvMpV-0005Gd-LN; Fri, 22 Sep 2017 12:13:13 +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 1dvMoz-0004vt-50; Fri, 22 Sep 2017 12:12:52 +0000","from exsmtp01.microchip.com (HELO email.microchip.com)\n\t([198.175.253.37])\n\tby esa2.microchip.iphmx.com with ESMTP/TLS/AES128-SHA;\n\t22 Sep 2017 05:12:19 -0700","from [10.159.245.112] (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com\n\t(10.10.76.37) with Microsoft SMTP Server id 14.3.352.0;\n\tFri, 22 Sep 2017 05:12:19 -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=na5S4gYwxqnOv39ispNd8Ru1TyIjQK7dpMn2UzAGRJE=;\n\tb=gc6BCD0S+YK+aK\n\tcGCZawVieeJfdZ76fkcCH7x8rtRNyGq4PR8woNP6bWei5zG+iX+O2Ok/aCe0cjj54vFhzIUtE3dyw\n\tVJQ+9G8U6ywuTN+2LP72sCtoLamt+y3xytD5ahhbWjEQx0d3RTObCfWg9NzAVETrYbWqjwanmIsVs\n\tST96bpmGDor+gq4LZUl3Fi8SgzZE4aQtQsyTho2Z1Z10djXSppkF4o9ukTYmwEw+lUggccEcNfEvM\n\t9Xb0ljF90zCqL6C4x0liOBKd6DZQEL/RqdstzGKRpE2+fuVTiHF5JEdPXR/IkGQtk0/GqEU/e5C9i\n\tBMvN4Nm0UzTCk0CbMjRA==;","X-IronPort-AV":"E=Sophos;i=\"5.42,427,1500966000\"; d=\"scan'208\";a=\"7216739\"","Subject":"Re: [PATCH v2 1/9] clk: at91: pmc: Wait for clocks when resuming","To":"Romain Izard <romain.izard.pro@gmail.com>, Alexandre Belloni\n\t<alexandre.belloni@free-electrons.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>, Wenyou Yang\n\t<wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>,\n\tDavid Woodhouse\n\t<dwmw2@infradead.org>, Brian Norris <computersforpeace@gmail.com>, Marek\n\tVasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, \n\tThierry Reding <thierry.reding@gmail.com>, Richard Genoud\n\t<richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, \n\tAlan Stern <stern@rowland.harvard.edu>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-2-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<e5e1fb83-3106-3f8f-26d6-8b2d3cb4748a@microchip.com>","Date":"Fri, 22 Sep 2017 14:13:26 +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":"<20170915140411.31716-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-20170922_051241_543545_8B2A8261 ","X-CRM114-Status":"GOOD (  14.00  )","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.149.84 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-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-serial@vger.kernel.org, linux-clk@vger.kernel.org,\n\tlinux-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":1773551,"web_url":"http://patchwork.ozlabs.org/comment/1773551/","msgid":"<90b0ce5e-d99e-7bba-0e6e-3d375053487d@microchip.com>","list_archive_url":null,"date":"2017-09-22T12:40:21","subject":"Re: [PATCH v2 6/9] ehci-atmel: Power down during suspend is normal","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 15/09/2017 at 16:04, Romain Izard wrote:\n> When an Atmel SoC is suspended with the backup mode, the USB bus will be\n> powered down. As this is expected, do not return an error to the driver\n> core when ehci_resume detects it.\n> \n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n> ---\n>  drivers/usb/host/ehci-atmel.c | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c\n> index 7440722bfbf0..2a8b9bdc0e57 100644\n> --- a/drivers/usb/host/ehci-atmel.c\n> +++ b/drivers/usb/host/ehci-atmel.c\n> @@ -205,7 +205,8 @@ static int __maybe_unused ehci_atmel_drv_resume(struct device *dev)\n>  \tstruct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd);\n>  \n>  \tatmel_start_clock(atmel_ehci);\n> -\treturn ehci_resume(hcd, false);\n> +\tehci_resume(hcd, false);\n> +\treturn 0;\n\nOk, I agree with that as the underlying function takes care about the\ncontroller, in any case (even for !B+S-R case). So we don't have any\nadded value to propagate this information.\n\nAcked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n\n>  }\n>  \n>  #ifdef CONFIG_OF\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=\"A1h6nLAk\"; 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 3xzCjs3K9Kz9sPk\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 22:40:01 +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 1dvNFM-0007CT-L5; Fri, 22 Sep 2017 12:39:56 +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 1dvNF3-0006vf-CD; Fri, 22 Sep 2017 12:39:38 +0000","from smtpout.microchip.com (HELO email.microchip.com)\n\t([198.175.253.82])\n\tby esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA;\n\t22 Sep 2017 05:39:14 -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:39:13 -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=yoWaBWlWn69peJz5XnY8q7XT9IB9lkKQdVZcQ4tNWsw=;\n\tb=A1h6nLAkSBTTQ4\n\tAYlhUIo135ptQI74zYzDT2A/frUfhHfrs0BfuXkv/qB73A9jJ9TQUy0NcXD08ItMyrYrtyaugn8Xr\n\tYiPtnY1KO0eipxsveyJrFXoGoTyUoJgOAkfYBGug6LkXP3EG4ooYThVrQSxezUcbHQ1CUkCl813g0\n\tYIi/6l038ayBUS9cyL+qiuIrpcJ3t2II4olNO3GUD4XSdkTxoUwPYNfCQ0pqmszxUzuZYr+Xm29XK\n\tMWAnMqKSAzm6qDQ03lDb/qPOd5yc0gHmsmEVdbHo4oGtviTTZULwjOFhDTAELqQ17d/AXNvUstOWq\n\tInpeQYUNjlCn5r6pyX+w==;","X-IronPort-AV":"E=Sophos;i=\"5.42,427,1500966000\"; d=\"scan'208\";a=\"7640420\"","Subject":"Re: [PATCH v2 6/9] ehci-atmel: Power down during suspend is normal","To":"Romain Izard <romain.izard.pro@gmail.com>, Alexandre Belloni\n\t<alexandre.belloni@free-electrons.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>, Wenyou Yang\n\t<wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>,\n\tDavid Woodhouse\n\t<dwmw2@infradead.org>, Brian Norris <computersforpeace@gmail.com>, Marek\n\tVasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, \n\tThierry Reding <thierry.reding@gmail.com>, Richard Genoud\n\t<richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, \n\tAlan Stern <stern@rowland.harvard.edu>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-7-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<90b0ce5e-d99e-7bba-0e6e-3d375053487d@microchip.com>","Date":"Fri, 22 Sep 2017 14:40:21 +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":"<20170915140411.31716-7-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-20170922_053937_470570_E9882EC7 ","X-CRM114-Status":"GOOD (  11.54  )","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-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-serial@vger.kernel.org, linux-clk@vger.kernel.org,\n\tlinux-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":1773556,"web_url":"http://patchwork.ozlabs.org/comment/1773556/","msgid":"<fa66d212-dbfb-08d4-1b2b-aaaa9f9d62de@microchip.com>","list_archive_url":null,"date":"2017-09-22T12:42:37","subject":"Re: [PATCH v2 7/9] pwm: atmel-tcb: Support backup mode","submitter":{"id":71036,"url":"http://patchwork.ozlabs.org/api/people/71036/","name":"Nicolas Ferre","email":"nicolas.ferre@microchip.com"},"content":"On 15/09/2017 at 16:04, Romain Izard wrote:\n> Save and restore registers for the PWM on suspend and resume, which\n> makes hibernation and backup modes possible.\n> \n> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n\nSeems good to me:\nAcked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n\n> ---\n>  drivers/pwm/pwm-atmel-tcb.c | 63 +++++++++++++++++++++++++++++++++++++++++++--\n>  1 file changed, 61 insertions(+), 2 deletions(-)\n> \n> diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c\n> index 75db585a2a94..acd3ce8ecf3f 100644\n> --- a/drivers/pwm/pwm-atmel-tcb.c\n> +++ b/drivers/pwm/pwm-atmel-tcb.c\n> @@ -37,11 +37,20 @@ struct atmel_tcb_pwm_device {\n>  \tunsigned period;\t\t/* PWM period expressed in clk cycles */\n>  };\n>  \n> +struct atmel_tcb_channel {\n> +\tu32 enabled;\n> +\tu32 cmr;\n> +\tu32 ra;\n> +\tu32 rb;\n> +\tu32 rc;\n> +};\n> +\n>  struct atmel_tcb_pwm_chip {\n>  \tstruct pwm_chip chip;\n>  \tspinlock_t lock;\n>  \tstruct atmel_tc *tc;\n>  \tstruct atmel_tcb_pwm_device *pwms[NPWM];\n> +\tstruct atmel_tcb_channel bkup[NPWM / 2];\n>  };\n>  \n>  static inline struct atmel_tcb_pwm_chip *to_tcb_chip(struct pwm_chip *chip)\n> @@ -175,12 +184,15 @@ static void atmel_tcb_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)\n>  \t * Use software trigger to apply the new setting.\n>  \t * If both PWM devices in this group are disabled we stop the clock.\n>  \t */\n> -\tif (!(cmr & (ATMEL_TC_ACPC | ATMEL_TC_BCPC)))\n> +\tif (!(cmr & (ATMEL_TC_ACPC | ATMEL_TC_BCPC))) {\n>  \t\t__raw_writel(ATMEL_TC_SWTRG | ATMEL_TC_CLKDIS,\n>  \t\t\t     regs + ATMEL_TC_REG(group, CCR));\n> -\telse\n> +\t\ttcbpwmc->bkup[group].enabled = 1;\n> +\t} else {\n>  \t\t__raw_writel(ATMEL_TC_SWTRG, regs +\n>  \t\t\t     ATMEL_TC_REG(group, CCR));\n> +\t\ttcbpwmc->bkup[group].enabled = 0;\n> +\t}\n>  \n>  \tspin_unlock(&tcbpwmc->lock);\n>  }\n> @@ -263,6 +275,7 @@ static int atmel_tcb_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)\n>  \t/* Use software trigger to apply the new setting */\n>  \t__raw_writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG,\n>  \t\t     regs + ATMEL_TC_REG(group, CCR));\n> +\ttcbpwmc->bkup[group].enabled = 1;\n>  \tspin_unlock(&tcbpwmc->lock);\n>  \treturn 0;\n>  }\n> @@ -445,10 +458,56 @@ static const struct of_device_id atmel_tcb_pwm_dt_ids[] = {\n>  };\n>  MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);\n>  \n> +#ifdef CONFIG_PM_SLEEP\n> +static int atmel_tcb_pwm_suspend(struct device *dev)\n> +{\n> +\tstruct platform_device *pdev = to_platform_device(dev);\n> +\tstruct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);\n> +\tvoid __iomem *base = tcbpwm->tc->regs;\n> +\tint i;\n> +\n> +\tfor (i = 0; i < (NPWM / 2); i++) {\n> +\t\tstruct atmel_tcb_channel *chan = &tcbpwm->bkup[i];\n> +\n> +\t\tchan->cmr = readl(base + ATMEL_TC_REG(i, CMR));\n> +\t\tchan->ra = readl(base + ATMEL_TC_REG(i, RA));\n> +\t\tchan->rb = readl(base + ATMEL_TC_REG(i, RB));\n> +\t\tchan->rc = readl(base + ATMEL_TC_REG(i, RC));\n> +\t}\n> +\treturn 0;\n> +}\n> +\n> +static int atmel_tcb_pwm_resume(struct device *dev)\n> +{\n> +\tstruct platform_device *pdev = to_platform_device(dev);\n> +\tstruct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);\n> +\tvoid __iomem *base = tcbpwm->tc->regs;\n> +\tint i;\n> +\n> +\tfor (i = 0; i < (NPWM / 2); i++) {\n> +\t\tstruct atmel_tcb_channel *chan = &tcbpwm->bkup[i];\n> +\n> +\t\twritel(chan->cmr, base + ATMEL_TC_REG(i, CMR));\n> +\t\twritel(chan->ra, base + ATMEL_TC_REG(i, RA));\n> +\t\twritel(chan->rb, base + ATMEL_TC_REG(i, RB));\n> +\t\twritel(chan->rc, base + ATMEL_TC_REG(i, RC));\n> +\t\tif (chan->enabled) {\n> +\t\t\twritel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG,\n> +\t\t\t\tbase + ATMEL_TC_REG(i, CCR));\n> +\t\t}\n> +\t}\n> +\treturn 0;\n> +}\n> +#endif\n> +\n> +static SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend,\n> +\t\t\t atmel_tcb_pwm_resume);\n> +\n>  static struct platform_driver atmel_tcb_pwm_driver = {\n>  \t.driver = {\n>  \t\t.name = \"atmel-tcb-pwm\",\n>  \t\t.of_match_table = atmel_tcb_pwm_dt_ids,\n> +\t\t.pm = &atmel_tcb_pwm_pm_ops,\n>  \t},\n>  \t.probe = atmel_tcb_pwm_probe,\n>  \t.remove = atmel_tcb_pwm_remove,\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=\"j8dZj5ZM\"; 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 3xzCmR4rQXz9sPk\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 22:42:15 +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 1dvNHX-0000mH-Pj; Fri, 22 Sep 2017 12:42:11 +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 1dvNHE-0000Uo-Od; Fri, 22 Sep 2017 12:41:54 +0000","from exsmtp01.microchip.com (HELO email.microchip.com)\n\t([198.175.253.37])\n\tby esa5.microchip.iphmx.com with ESMTP/TLS/AES128-SHA;\n\t22 Sep 2017 05:41:31 -0700","from [10.159.245.112] (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com\n\t(10.10.76.37) with Microsoft SMTP Server id 14.3.352.0;\n\tFri, 22 Sep 2017 05:41:29 -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=+JWewGw2Ne2JwNDxW9IWkck5vJab05KBMWV58FnhoHc=;\n\tb=j8dZj5ZMvzTwo9\n\tSYPrPhzdocmp3LlEDVxJZ5zUC4ts3vyMJzqYFXEMPi+Dx/kV2VmgsXfdcUAoj/QV7ecHrsurGEo7y\n\tI///zaKlPkefXCH1IO3SnCbt9AHHOCq+nnDs84tFODDY4jGl8lLJjuQ/NsK04lPrXzNjq0l4LAB2s\n\tKtMZEH78mVJHGtxrbL5dbJ7K+2akWD9VhgQaaNtn3PZcB4bny1X6+/FbVZz3vkIkaumEu59VfjQq9\n\tkjeCttF/5V29rxg5YlX0N5hdidGPwmyTtSfYU8v2Qv4XGVUgkgicDG9XAasvSnpi3qT2P/no4YWck\n\tvMb23ZW27ZF3VoPYMq6A==;","X-IronPort-AV":"E=Sophos;i=\"5.42,427,1500966000\"; d=\"scan'208\";a=\"4927720\"","Subject":"Re: [PATCH v2 7/9] pwm: atmel-tcb: Support backup mode","To":"Romain Izard <romain.izard.pro@gmail.com>, Alexandre Belloni\n\t<alexandre.belloni@free-electrons.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>, Wenyou Yang\n\t<wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>,\n\tDavid Woodhouse\n\t<dwmw2@infradead.org>, Brian Norris <computersforpeace@gmail.com>, Marek\n\tVasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>, \n\tThierry Reding <thierry.reding@gmail.com>, Richard Genoud\n\t<richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>, \n\tAlan Stern <stern@rowland.harvard.edu>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-8-romain.izard.pro@gmail.com>","From":"Nicolas Ferre <nicolas.ferre@microchip.com>","Organization":"microchip","Message-ID":"<fa66d212-dbfb-08d4-1b2b-aaaa9f9d62de@microchip.com>","Date":"Fri, 22 Sep 2017 14:42:37 +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":"<20170915140411.31716-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-20170922_054152_931789_9975CC41 ","X-CRM114-Status":"GOOD (  16.93  )","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-pwm@vger.kernel.org, linux-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-serial@vger.kernel.org, linux-clk@vger.kernel.org,\n\tlinux-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":1774509,"web_url":"http://patchwork.ozlabs.org/comment/1774509/","msgid":"<CAGkQfmOQ_5hb-OKWQxjboPS1V0v-jCPxyyDZyCyZLFYFoeXWbA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-25T08:25:35","subject":"Re: [PATCH v2 3/9] clk: at91: pmc: Support backup for programmable\n\tclocks","submitter":{"id":8236,"url":"http://patchwork.ozlabs.org/api/people/8236/","name":"Romain Izard","email":"romain.izard.pro@gmail.com"},"content":"2017-09-22 12:31 GMT+02:00 Nicolas Ferre <nicolas.ferre@microchip.com>:\n> On 15/09/2017 at 16:04, Romain Izard wrote:\n>> From: Romain Izard <romain.izard@mobile-devices.fr>\n>>\n>> When an AT91 programmable clock is declared in the device tree, register\n>> it into the Power Management Controller driver. On entering suspend mode,\n>> the driver saves and restores the Programmable Clock registers to support\n>> the backup mode for these clocks.\n>>\n>> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>\n>\n> Romain,\n>\n> Some nitpicking and one comment. But on the overall patch, here is my:\n> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n>\n> See below:\n>\n>> ---\n>> Changes in v2:\n>> * register PCKs on clock startup\n>>\n>>  drivers/clk/at91/clk-programmable.c |  2 ++\n>>  drivers/clk/at91/pmc.c              | 27 +++++++++++++++++++++++++++\n>>  drivers/clk/at91/pmc.h              |  2 ++\n>>  3 files changed, 31 insertions(+)\n>>\n>> diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c\n>> index 85a449cf61e3..0e6aab1252fc 100644\n>> --- a/drivers/clk/at91/clk-programmable.c\n>> +++ b/drivers/clk/at91/clk-programmable.c\n>> @@ -204,6 +204,8 @@ at91_clk_register_programmable(struct regmap *regmap,\n>>       if (ret) {\n>>               kfree(prog);\n>>               hw = ERR_PTR(ret);\n>\n> Nit: \"else\" not needed.\n>\nThis is a shared idiom in all the atmel clock drivers, so I prefer to keep\nit this way.\n\n>> +     } else {\n>> +             pmc_register_pck(id);\n>>       }\n>>\n>>       return hw;\n>> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\n>> index 07dc2861ad3f..3910b7537152 100644\n>> --- a/drivers/clk/at91/pmc.c\n>> +++ b/drivers/clk/at91/pmc.c\n>> @@ -22,6 +22,7 @@\n>>  #include \"pmc.h\"\n>>\n>>  #define PMC_MAX_IDS 128\n>> +#define PMC_MAX_PCKS 8\n>>\n>>  int of_at91_get_clk_range(struct device_node *np, const char *propname,\n>>                         struct clk_range *range)\n>> @@ -50,6 +51,7 @@ EXPORT_SYMBOL_GPL(of_at91_get_clk_range);\n>>  static struct regmap *pmcreg;\n>>\n>>  static u8 registered_ids[PMC_MAX_IDS];\n>> +static u8 registered_pcks[PMC_MAX_PCKS];\n>>\n>>  static struct\n>>  {\n>> @@ -66,8 +68,10 @@ static struct\n>>       u32 pcr[PMC_MAX_IDS];\n>>       u32 audio_pll0;\n>>       u32 audio_pll1;\n>> +     u32 pckr[PMC_MAX_PCKS];\n>>  } pmc_cache;\n>>\n>> +/* Clock ID 0 is invalid */\n>\n> (read: so we can use the 0 value as an indicator that this place in the\n> table hasn't been filled, so unused)\n>\n>>  void pmc_register_id(u8 id)\n>>  {\n>>       int i;\n>> @@ -82,6 +86,21 @@ void pmc_register_id(u8 id)\n>>       }\n>>  }\n>>\n>> +/* Programmable Clock 0 is valid */\n>\n> I understand the rationale behind these ^^ two comments, but I would\n> like that it's more explicit. Saying that you will store the pck id as\n> (id + 1) and that you would have to invert this operation while using\n> the stored id.\n> Maybe add a comment about this transformation to the struct definition\n> as well...\n>\n\nI will improve the comments for the next revision.\n\n>\n>> +void pmc_register_pck(u8 pck)\n>> +{\n>> +     int i;\n>> +\n>> +     for (i = 0; i < PMC_MAX_PCKS; i++) {\n>> +             if (registered_pcks[i] == 0) {\n>> +                     registered_pcks[i] = pck + 1;\n>> +                     break;\n>> +             }\n>> +             if (registered_pcks[i] == (pck + 1))\n>> +                     break;\n>> +     }\n>> +}\n>> +\n>>  static int pmc_suspend(void)\n>>  {\n>>       int i;\n>> @@ -103,6 +122,10 @@ static int pmc_suspend(void)\n>>               regmap_read(pmcreg, AT91_PMC_PCR,\n>>                           &pmc_cache.pcr[registered_ids[i]]);\n>>       }\n>> +     for (i = 0; registered_pcks[i]; i++) {\n>> +             u8 num = registered_pcks[i] - 1;\n>\n> Nit: declaration are better made at the beginning of the function. This\n> lead to a checkpatch warning:\n> \"WARNING: Missing a blank line after declarations\"\n>\n\nI'll fix this as well.\n\n>> +             regmap_read(pmcreg, AT91_PMC_PCKR(num), &pmc_cache.pckr[num]);\n>> +     }\n>>\n>>       return 0;\n>>  }\n>> @@ -143,6 +166,10 @@ static void pmc_resume(void)\n>>                            pmc_cache.pcr[registered_ids[i]] |\n>>                            AT91_PMC_PCR_CMD);\n>>       }\n>> +     for (i = 0; registered_pcks[i]; i++) {\n>> +             u8 num = registered_pcks[i] - 1;\n>\n> Ditto\n>\n>> +             regmap_write(pmcreg, AT91_PMC_PCKR(num), pmc_cache.pckr[num]);\n>> +     }\n>>\n>>       if (pmc_cache.uckr & AT91_PMC_UPLLEN)\n>>               mask |= AT91_PMC_LOCKU;\n>> diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h\n>> index 858e8ef7e8db..d22b1fa9ecdc 100644\n>> --- a/drivers/clk/at91/pmc.h\n>> +++ b/drivers/clk/at91/pmc.h\n>> @@ -31,8 +31,10 @@ int of_at91_get_clk_range(struct device_node *np, const char *propname,\n>>\n>>  #ifdef CONFIG_PM\n>>  void pmc_register_id(u8 id);\n>> +void pmc_register_pck(u8 pck);\n>>  #else\n>>  static inline void pmc_register_id(u8 id) {}\n>> +static inline void pmc_register_pck(u8 pck) {}\n>>  #endif\n>>\n>>  #endif /* __PMC_H_ */\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 header.b=\"h9lmvGm6\"; \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=\"u9FIJbWo\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"QC1fLgzK\"; 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 3y0xyL3vVrz9tXK\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 18:26:50 +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 1dwOix-0002UI-PJ; Mon, 25 Sep 2017 08:26:43 +0000","from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dwOiY-0001qC-6X for linux-arm-kernel@lists.infradead.org;\n\tMon, 25 Sep 2017 08:26:22 +0000","by mail-qk0-x232.google.com with SMTP id g128so5885475qke.13\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tMon, 25 Sep 2017 01:25:56 -0700 (PDT)","by 10.200.48.120 with HTTP; Mon, 25 Sep 2017 01:25:35 -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=/dxys6O4/0xBkIqFBqDlMFEdTSLU217WlwriZuYYzSA=;\n\tb=h9lmvGm67kpnFN\n\trEIkKQ2MDsxvdnBgA5jgCEuD7iO48ux1VJuGML7haFEwLWxHGgYYsBNVMoCJ1AurGKC4qd6Kcys5I\n\tNnnx2EAKzLCz4RWGV8ZLSMCWqOjj5ls6kT8HISXjBD1YHatF5NRU4yV7Wmu0lVE6ktwQCm//9gmsq\n\tnsc7O7VjiLgyJ7rRFRbBTC3fKe7M4WJ4VoR2CO9vLvFgn01EFviCzXBczDA9NIzMQsrngbLELivwO\n\tjA/29ySv8dr3Xe1U+abl8Szw61k46HV/HIqZwj+ixu5DQt2Gljnwn5InGmRIiZJVFjIYVhRCuMVf5\n\tWqTejkgXakOIG83/QgOQ==;","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=2e8+oWffspBbHMJrd9Dff9/rMtoYbYBla7l3jBGVGs0=;\n\tb=u9FIJbWoruJHGktylIkIpDwdKhN/aXzBv7CrxO4cDUWJWDvpnt8FCbhK1dp/rzkRTO\n\tLGWUUC2v2rbxTYYSAF0qVGKUNWaPGhqlID9qVUacJ2JRT4GlhEj18ctqiOWWczGIdLg9\n\tBWr0tsQghPxCsG1bO8zcz6H9ObrEiMPzSBIp8=","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=2e8+oWffspBbHMJrd9Dff9/rMtoYbYBla7l3jBGVGs0=;\n\tb=QC1fLgzKqfDIrdZOZb5WyX71qT/I0SJJOoUzF4NKHALgk/D/qX1Cs8r7qFAa9YOJm+\n\tTHgaIUVjb16Ov/eY50tJH3C/WDOun2Vrxy6qbZ8xJ4CDbdpTYbzmPcL6la0eO0To6yGa\n\tx52X2VoOwXKIeYnpZgRH+e/6yAtCbvlvzeGJuqr44nzf6JMWREfz4/HtU4yfFEKtQGP3\n\t/XhphCBQ09JWL3SJQ9xCXZK39hZxHiDZC6CNAt5NyNwhgZkLphxXmaWeqGgrV/yOFUGC\n\tYXTIJMpj7Souoe1aOkTCrNWtHQ1hy/c1YSzRyoTTt+Q3DnQvxvgHjQaruXUMgLu9USOR\n\t/ehA=="],"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=2e8+oWffspBbHMJrd9Dff9/rMtoYbYBla7l3jBGVGs0=;\n\tb=eDFY5wSAOqmILleY3co4QQnJYwJmJVV1ja1y0pgtNFhe5R6vihMNJ9nb/G0e3StfIR\n\tPPT82HYWbq2va+r01+ir7JspYfhxc/P6MW2l1YcahZSJLsf60lXLGelv1GaZjQl8l8oV\n\tvnWY8j4ItWOt7RJ+QRIlf4U3m//lox+9B/TovtFlD2zaa+jwHg77Xo0ju8KhV2BSo6kl\n\tEqPDcbT+5M370Mp8vSzap2cnPn8fPDx6/gEvtBPExkaSIDEVStOXXTqkgoiRGRPNMKtW\n\t6IQSQ6TBmku1pwJsF4AITlbcQPOqL+K2wrlzB7qPYMUP2ANBwxb0NZ8moT9j0Hi/920I\n\tfV1A==","X-Gm-Message-State":"AHPjjUg9kyugmfkXp3ejptH+9dTJAhOqyK5KTYYg+B/r3dAPfbFjLAPd\n\tqs27wWgikRi+9j1dn6j/7lNJMVF2ZvvX2PamF6/uUQ==","X-Google-Smtp-Source":"AOwi7QAZ353KisEOLiiZWWAjRLtDomceB0e6zs/k3T35vmLl+CPfjZx7Mswq3236QjVU6WpBkvnx7IU1EpxjaixGchQ=","X-Received":"by 10.55.154.4 with SMTP id c4mr9270814qke.131.1506327955703;\n\tMon, 25 Sep 2017 01:25:55 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<d6359e89-7c78-fdec-fbab-eb885017ec58@microchip.com>","References":"<20170915140411.31716-1-romain.izard.pro@gmail.com>\n\t<20170915140411.31716-4-romain.izard.pro@gmail.com>\n\t<d6359e89-7c78-fdec-fbab-eb885017ec58@microchip.com>","From":"Romain Izard <romain.izard.pro@gmail.com>","Date":"Mon, 25 Sep 2017 10:25:35 +0200","X-Google-Sender-Auth":"fyBRz7UOQm_YHyxzQiPq1I9ZrB0","Message-ID":"<CAGkQfmOQ_5hb-OKWQxjboPS1V0v-jCPxyyDZyCyZLFYFoeXWbA@mail.gmail.com>","Subject":"Re: [PATCH v2 3/9] clk: at91: pmc: Support backup for programmable\n\tclocks","To":"Nicolas Ferre <nicolas.ferre@microchip.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170925_012618_546638_51348D2E ","X-CRM114-Status":"GOOD (  24.23  )","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:232 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":"Michael Turquette <mturquette@baylibre.com>,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>,\n\tlinux-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\tlinux-mtd <linux-mtd@lists.infradead.org>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@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"}}]