From patchwork Tue Aug 21 09:15:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1353361 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 7C2A540210 for ; Tue, 21 Aug 2012 09:27:44 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T3kgn-00043F-ND; Tue, 21 Aug 2012 09:23:58 +0000 Received: from na3sys009aog133.obsmtp.com ([74.125.149.82]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T3kda-00025b-LQ for linux-arm-kernel@lists.infradead.org; Tue, 21 Aug 2012 09:20:39 +0000 Received: from mail-lb0-f181.google.com ([209.85.217.181]) (using TLSv1) by na3sys009aob133.postini.com ([74.125.148.12]) with SMTP ID DSNKUDNS3VAkJ5S6LFCqwA3G6UcDHbZh3j2d@postini.com; Tue, 21 Aug 2012 02:20:38 PDT Received: by lbbgk1 with SMTP id gk1so3764485lbb.40 for ; Tue, 21 Aug 2012 02:20:28 -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=iHdp1nzecBbCkRhS792+W4QGAAVHJ2UTSc6hjgTaZw0=; b=BxSJ4Maq8uVL0gatzNkBSD7eaqDWvG4RPTQJ2nKBVia7ygk5Qez+9PFgHx5b1tnCZm 9eyy5XtLMB4jmYFnPTW4+496BGIEklyyMy4zlUs2ZC4yXxUDlty3ua31INR7KWdKAagh Ojs1OGJmtUL1DIGow1REO0ESYtscN43zV8AVKnSZKuJvc0rY/N1wAcB3X9tqi2yYivZx H7wrM9ALFEj+Fb4RWONzOgWLVJ2zMwC81o8S3ORq/lPZpx0aplM6Btnqv60jlCzJ2DFy 80FUgcmH/mV64TjJrHjy8oOk1rKpdx722poQN18Uq2m+cMkCUqn2fAhS4VTkbmmFB92m 6NRQ== Received: by 10.112.37.8 with SMTP id u8mr7382178lbj.30.1345540828259; Tue, 21 Aug 2012 02:20:28 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id h8sm281499lbi.13.2012.08.21.02.20.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 02:20:27 -0700 (PDT) From: Felipe Balbi To: alan@linux.intel.com Subject: [RFC/PATCH 11/13] serial: omap: set dev->drvdata before enabling pm_runtime Date: Tue, 21 Aug 2012 12:15:53 +0300 Message-Id: <1345540555-24359-12-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.12.rc3 In-Reply-To: <1345540555-24359-1-git-send-email-balbi@ti.com> References: <1345540555-24359-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQlG6MUQpTGkkW8EqERBrHMgc8rU7jOJAEH/N+vRLctmep2ElftzNQJp8gfChjuWLQLFtQc9 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.82 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. 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 458d77c..ba9cdf1 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1298,6 +1298,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); @@ -1317,7 +1318,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: