Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3834728imm; Mon, 18 Jun 2018 05:01:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL6c5DUuV72rNaYXEvg1k+x9C5wKOo5TVN6cbo8ERL6ajxgCH7jHKx2czFSLDIwQD7vAjPe X-Received: by 2002:a62:918:: with SMTP id e24-v6mr12945017pfd.30.1529323287259; Mon, 18 Jun 2018 05:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529323287; cv=none; d=google.com; s=arc-20160816; b=pglvPYwv/C60fF3JuDAg5IgDkpm6xqqkExI9MhAlYHlWpqMuwePyysi2qvh1glXKKV RmQYL/N1McBr9ulnFZqhFJBv+41QOIg6eEwv5VXU+qx3at8k2P2jmQnUWN2TAXXLrL7m 4RMFQCJGNmXAwHI1OHrgYOwJINEBons4p4g1xfjEiQWzcvjDB3YLPZgVG/FielMEr1ma 1Ac9e04A70qU9fxjX4AwG7uIeOn/3Qs907zUid1SliHnNUpstbx+Xind4692pOhrLduD FNisCxN1CjNl2B+rM02HDVjvcizRUin8v/C1B3xm8skk8KqAqqFU3JIaL0nKxLNqCDfT KtLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=qfH/ynuNmXMbPwEpUyf/OOGEWkwC7BmL0LcJQXbpDo8=; b=aWHHGhlzHoI+isTC0rtU+I9RvGgXRed+ZGOHM00C+0RnPK89jVeWnOadBE3flbww3q iGRorvOpJXIqOLuaF5EyJS53sv1hBoCia6/emsv0y9jEQxZlvvM9kt+qODpx8v6YYl6r OPukVa3tRv35ycqN4SArt9E4JpiJnWgpv0ZccCf83Pbsqu014f82r683eyFHnnJFzD6A KzwfqDcDX6dnS70weUGfgS+NxSZgt6G24BHIwuqBK2hlvsJEv17xOcw+9BXZUNIondf/ NXgerDVHW8awOXF8AYJfMhfqMThU74/+vBr+BcNbwcZGT+W19IMoZqRmW4X1ZovcbBQv AKCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y34-v6si14823379plb.17.2018.06.18.05.01.13; Mon, 18 Jun 2018 05:01:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934757AbeFRMAM (ORCPT + 99 others); Mon, 18 Jun 2018 08:00:12 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:63700 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933079AbeFRMAK (ORCPT ); Mon, 18 Jun 2018 08:00:10 -0400 X-IronPort-AV: E=Sophos;i="5.51,239,1526367600"; d="scan'208";a="15349764" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Jun 2018 05:00:09 -0700 Received: from [10.145.6.76] (10.10.76.4) by chn-sv-exch04.mchp-main.com (10.10.76.105) with Microsoft SMTP Server id 14.3.352.0; Mon, 18 Jun 2018 05:00:08 -0700 Subject: Re: [PATCH v2] mtd: atmel-quadspi: add suspend/resume hooks To: Marek Vasut , Boris Brezillon CC: , , , , , , , References: <1528101993-4772-1-git-send-email-claudiu.beznea@microchip.com> <20180618114920.654647c0@bbrezillon> <8474a744-5552-932f-7ba8-85b7d95368ea@gmail.com> From: Claudiu Beznea Message-ID: <0be344a2-9878-2b92-9436-bc2f4d4fd6e0@microchip.com> Date: Mon, 18 Jun 2018 15:00:06 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <8474a744-5552-932f-7ba8-85b7d95368ea@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.06.2018 12:53, Marek Vasut wrote: > On 06/18/2018 11:49 AM, Boris Brezillon wrote: >> Hi Claudiu, >> >> The subject prefix should be "mtd: spi-nor: atmel-quadspi: ". No need >> to send a new version just for that, I'll fix it when applying the >> patch. >> Hi Boris, Thank you! >> Looks good otherwise. Marek, any objection? If not, can you add your >> Acked-by? > > Will this work if you have ie. ubifs mounted on that QSPI NOR and you > suspect and resume during IO ? I think it would, but just curious if > there could be some problem. Hi Marek, I tested only with read/writes while suspending, simple scripts, but not having ubifs mounted on QSPI NOR. I will double check also with ubifs mounted on QSPI NOR and come back with the results. Thank you, Claudiu > >> Thanks, >> >> Boris >> >> On Mon, 4 Jun 2018 11:46:33 +0300 >> Claudiu Beznea wrote: >> >>> Implement suspend/resume hooks. >>> >>> Signed-off-by: Claudiu Beznea >>> --- >>> >>> Changes in v2: >>> - use __maybe_unused instead of #ifdef CONFIG_PM_SLEEP >>> >>> drivers/mtd/spi-nor/atmel-quadspi.c | 21 +++++++++++++++++++++ >>> 1 file changed, 21 insertions(+) >>> >>> diff --git a/drivers/mtd/spi-nor/atmel-quadspi.c b/drivers/mtd/spi-nor/atmel-quadspi.c >>> index 6c5708bacad8..ceaaef47f02e 100644 >>> --- a/drivers/mtd/spi-nor/atmel-quadspi.c >>> +++ b/drivers/mtd/spi-nor/atmel-quadspi.c >>> @@ -737,6 +737,26 @@ static int atmel_qspi_remove(struct platform_device *pdev) >>> return 0; >>> } >>> >>> +static int __maybe_unused atmel_qspi_suspend(struct device *dev) >>> +{ >>> + struct atmel_qspi *aq = dev_get_drvdata(dev); >>> + >>> + clk_disable_unprepare(aq->clk); >>> + >>> + return 0; >>> +} >>> + >>> +static int __maybe_unused atmel_qspi_resume(struct device *dev) >>> +{ >>> + struct atmel_qspi *aq = dev_get_drvdata(dev); >>> + >>> + clk_prepare_enable(aq->clk); >>> + >>> + return atmel_qspi_init(aq); >>> +} >>> + >>> +static SIMPLE_DEV_PM_OPS(atmel_qspi_pm_ops, atmel_qspi_suspend, >>> + atmel_qspi_resume); >>> >>> static const struct of_device_id atmel_qspi_dt_ids[] = { >>> { .compatible = "atmel,sama5d2-qspi" }, >>> @@ -749,6 +769,7 @@ static struct platform_driver atmel_qspi_driver = { >>> .driver = { >>> .name = "atmel_qspi", >>> .of_match_table = atmel_qspi_dt_ids, >>> + .pm = &atmel_qspi_pm_ops, >>> }, >>> .probe = atmel_qspi_probe, >>> .remove = atmel_qspi_remove, > >