From patchwork Sat Aug 1 17:19:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6922491 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7314C05AC for ; Sat, 1 Aug 2015 17:19:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E2AC20501 for ; Sat, 1 Aug 2015 17:19:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 262EA202B8 for ; Sat, 1 Aug 2015 17:19:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751405AbbHARTr (ORCPT ); Sat, 1 Aug 2015 13:19:47 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34193 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751015AbbHARTr (ORCPT ); Sat, 1 Aug 2015 13:19:47 -0400 Received: by pacan13 with SMTP id an13so60204284pac.1 for ; Sat, 01 Aug 2015 10:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pHCoC7a8nVNIxFtMLL8hJxEMgQIWLtcIrwr1SzFmcQ8=; b=UuGhq07wNsQzSXAVlojHirkiim6nfA9LcJeUFPchrhxjQNfCH2uZXWy3FSNwZSPKGt Pkk9rSJ9/uC9v7rrM2hCXoWTvXnCgAnyPF89sKCj3POp4KdDbfFCAtVdiWZft9AiTNo1 EGfVT/x2ihEeFkwzUKetr1qVH/9cLEUgAyA8ALVp+zM2kmNDUcRWL6h8/25SqKRVHAH+ 0Fs1/VKSNl+eAkGwEjSFaFHcBn3scx2UgihWx1V8ya7E8H8+m03ghAxSkgapFR2hH7mj Om079l7ut2alXppK+72NZgAvzeo78j+l9XL8/3chsahbDRQANkBEid8b5tBJa7P0ZhXW Sg1g== X-Received: by 10.68.253.232 with SMTP id ad8mr7821386pbd.115.1438449586667; Sat, 01 Aug 2015 10:19:46 -0700 (PDT) Received: from localhost.localdomain (KD113159139091.ppp-bb.dion.ne.jp. [113.159.139.91]) by smtp.gmail.com with ESMTPSA id tm3sm12259153pac.44.2015.08.01.10.19.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 01 Aug 2015 10:19:45 -0700 (PDT) From: Akinobu Mita To: linux-scsi@vger.kernel.org Cc: Akinobu Mita , Vinayak Holikatti , "James E.J. Bottomley" , Christoph Hellwig , Dolev Raviv , Sujit Reddy Thumma , Subhash Jadavani , Maya Erez , Sahitya Tummala , "Rafael J. Wysocki" Subject: [PATCH v2 2/6] scsi: ufs: fix unbalanced power.usage_count after reloading driver Date: Sun, 2 Aug 2015 02:19:16 +0900 Message-Id: <1438449560-4106-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438449560-4106-1-git-send-email-akinobu.mita@gmail.com> References: <1438449560-4106-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On driver removal, pm_runtime_get_sync() is called, but pm_runtime_put_*() is missed. So once the driver is reloaded, the device's power.usage_count is unbalanced and the idle callback for the device will never be called. Signed-off-by: Akinobu Mita Cc: Vinayak Holikatti Cc: "James E.J. Bottomley" Cc: Christoph Hellwig Cc: Dolev Raviv Cc: Sujit Reddy Thumma Cc: Subhash Jadavani Cc: Maya Erez Cc: Sahitya Tummala Cc: "Rafael J. Wysocki" Cc: linux-scsi@vger.kernel.org --- drivers/scsi/ufs/ufshcd-pltfrm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c index 7db9564..9beac71 100644 --- a/drivers/scsi/ufs/ufshcd-pltfrm.c +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c @@ -368,6 +368,7 @@ static int ufshcd_pltfrm_remove(struct platform_device *pdev) pm_runtime_get_sync(&(pdev)->dev); ufshcd_remove(hba); + pm_runtime_put_noidle(&pdev->dev); return 0; }