From patchwork Tue Aug 21 12:16:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1354861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 941BBDFB34 for ; Tue, 21 Aug 2012 12:27:52 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T3nUv-0006Cg-Pb; Tue, 21 Aug 2012 12:23:54 +0000 Received: from na3sys009aog113.obsmtp.com ([74.125.149.209]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T3nRp-0004RH-8x for linux-arm-kernel@lists.infradead.org; Tue, 21 Aug 2012 12:20:42 +0000 Received: from mail-lb0-f181.google.com ([209.85.217.181]) (using TLSv1) by na3sys009aob113.postini.com ([74.125.148.12]) with SMTP ID DSNKUDN9F5V7OMvdUC9H1mPX+7ng81zAd9Kf@postini.com; Tue, 21 Aug 2012 05:20:41 PDT Received: by lbbgk1 with SMTP id gk1so4082683lbb.12 for ; Tue, 21 Aug 2012 05:20:37 -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=93Y4XRM5vV7v9JHr+6cEHM6ZXvyzMkalMaev9tOr0iw=; b=F7SZ5BsVn+roHLJq3dYdxcaGnxtkre+TYvBDXQjYDSt2Ccf35Mwe61T1VEx47VXrxm /JKumXNjdvGpKBDEZ7tMO95fD/B3QF1w9cqvBqMFR2m8Wmx4uSPXgLZQ9IMMZYpHDTgJ CyhoWzTVgg5CbSpnW69iQ6t0qR7DjuWri5VTleH0RRkNMG2YpfnjHSezNucmJboWjm62 Lqx/BvWyy3fmRMX4X7En82iUUSoBDrwg9I9i2f+/rohs4jtPhkXgmQ65pUpHa35spReB w1B9XlKZUAZZ/4DpRatSj+xAEKO8CZQmxnhy34NsrFwzLWMpuPPPknwlwLF498hxmN4i tntQ== Received: by 10.112.82.66 with SMTP id g2mr7739193lby.15.1345551637870; Tue, 21 Aug 2012 05:20:37 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id sy1sm1366783lab.13.2012.08.21.05.20.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 05:20:37 -0700 (PDT) From: Felipe Balbi To: alan@linux.intel.com Subject: [PATCH v2 10/13] serial: omap: set dev->drvdata before enabling pm_runtime Date: Tue, 21 Aug 2012 15:16:08 +0300 Message-Id: <1345551371-18862-11-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1345551371-18862-1-git-send-email-balbi@ti.com> References: <1345540555-24359-1-git-send-email-balbi@ti.com> <1345551371-18862-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQkcfLEtDX7vxlJaes8G7cFm9Sml20m2yoi4RUyhbz7XXbznvJPMirskyf+KvG5OSfJlCLmU 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.209 listed in list.dnswl.org] -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, 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. 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 c272ecc..1aaba77 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1301,6 +1301,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); @@ -1320,7 +1321,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: