From patchwork Thu Aug 23 10:32:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1366021 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 799FC3FC66 for ; Thu, 23 Aug 2012 10:45:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T4UqF-0002Mh-EY; Thu, 23 Aug 2012 10:40:49 +0000 Received: from na3sys009aog138.obsmtp.com ([74.125.149.19]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T4Un8-0000sh-Md for linux-arm-kernel@lists.infradead.org; Thu, 23 Aug 2012 10:37:36 +0000 Received: from mail-lb0-f174.google.com ([209.85.217.174]) (using TLSv1) by na3sys009aob138.postini.com ([74.125.148.12]) with SMTP ID DSNKUDYH7eJ0QUAb7Q62zcchxUMzRj9ZrBAo@postini.com; Thu, 23 Aug 2012 03:37:34 PDT Received: by lbbgj3 with SMTP id gj3so360275lbb.33 for ; Thu, 23 Aug 2012 03:37:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=2Orws3z26Lm7xF8eXvPvuEGB+ikKgQibOlNW4e72l+M=; b=BhauhBb4s3+r39eJgxMY1KJmpF6fjOvfkiN6EOQbFx3oB3yCGx9PqLhAjRa4mU6uGg vl1w8tXR2C4deHb0F3fbpxi5lVHL6ucpTCA3qGZrCYi49GMKCpdpsEnAL9xVWogScbsZ j/Kia7JnYCSPYYxh5wIiEo/GfKUuQq60tuRw24/8cwoT+yYAqh9224J/4iFI8f74vWER o1Gih4g44S1YblwBqSTGdkmZl1eIooeNFSmgBhVleWcDoMBzX/wJUwyIStwpRLb7oFLY r4lItBi9HhVQ5P9+An5cr0+FIN7tYN/KgkWOW+PgwOhU25GUC/MtzPlUClt3uDTDPOdY wrxw== Received: by 10.152.104.77 with SMTP id gc13mr1191451lab.31.1345718251641; Thu, 23 Aug 2012 03:37:31 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id fz8sm340636lbb.9.2012.08.23.03.37.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Aug 2012 03:37:30 -0700 (PDT) From: Felipe Balbi To: alan@linux.intel.com Subject: [PATCH v3 10/23] serial: omap: set dev->drvdata before enabling pm_runtime Date: Thu, 23 Aug 2012 13:32:50 +0300 Message-Id: <1345717983-18179-11-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1345717983-18179-1-git-send-email-balbi@ti.com> References: <1345717983-18179-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQncejeDnTS/ZmEdHsSFP7F0SvJdC6Az3Or/x53gHOQXBG7YrxFir5JPDXYoPNmZmjGRoa6k X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.19 listed in list.dnswl.org] 0.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kevin Hilman , Tony Lindgren , Linux Kernel Mailing List , Felipe Balbi , Santosh Shilimkar , linux-serial@vger.kernel.org, Sourav Poddar , Linux OMAP Mailing List , Shubhrajyoti Datta , Linux ARM Kernel Mailing List X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org by the time we call our first pm_runtme_get_sync() after enable pm_runtime, our resume method might be called. To avoid problems, we must make sure that our dev->drvdata is set correctly before our resume method gets called. Tested-by: Shubhrajyoti D Acked-by: Santosh Shilimkar Signed-off-by: Felipe Balbi --- drivers/tty/serial/omap-serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index e07afb3..9f709d4 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1300,6 +1300,7 @@ static int serial_omap_probe(struct platform_device *pdev) serial_omap_uart_wq = create_singlethread_workqueue(up->name); INIT_WORK(&up->qos_work, serial_omap_uart_qos_work); + platform_set_drvdata(pdev, up); pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, omap_up_info->autosuspend_timeout); @@ -1319,7 +1320,6 @@ static int serial_omap_probe(struct platform_device *pdev) pm_runtime_mark_last_busy(up->dev); pm_runtime_put_autosuspend(up->dev); - platform_set_drvdata(pdev, up); return 0; err_add_port: