From patchwork Fri Mar 27 23:51:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6113021 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 69B4CBF4A6 for ; Fri, 27 Mar 2015 23:52:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 867AC203ED for ; Fri, 27 Mar 2015 23:52:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 99C63203EC for ; Fri, 27 Mar 2015 23:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752560AbbC0XwO (ORCPT ); Fri, 27 Mar 2015 19:52:14 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:33229 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbbC0XwM (ORCPT ); Fri, 27 Mar 2015 19:52:12 -0400 Received: by pdnc3 with SMTP id c3so110969958pdn.0 for ; Fri, 27 Mar 2015 16:52:11 -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=a9i5pq1VYqWkQ/e8RleaCEw2mtOsxNxJQMgOVEAn754=; b=wXE/mR8QQhU7ZFNnZkGVh/m5JgjzHASDPmsL2zNagCPtf19IDPa7YxdAXprXbyn4f+ wQH1v5toaAvy3r0vS73a9y0O4e4btu6Ocoe+KwA3NdBSI26hiMihE+jZSrmTggDYFlqH Fo9rCpD9BZ9DeuRT7zBVMY9i4VuOJR+ZVOCscW6o82cQ4e5uACVXtH3lMbbRkypTfCA9 VN1zSeaNuRc+77iWgi6JK2hTXt9JZ3T8WpM0dZzxq3vt87cmv6xAbW3hCSL45171eYpG EnwVGhM/qM4EO5OzWOpoYaC/ii6URJlnCsMLiKIENryKlSPJn7ZvsgDhJEXRSZDKy9I9 seAQ== X-Received: by 10.66.65.130 with SMTP id x2mr32768334pas.152.1427500331753; Fri, 27 Mar 2015 16:52:11 -0700 (PDT) Received: from localhost.localdomain (KD106168100169.ppp-bb.dion.ne.jp. [106.168.100.169]) by mx.google.com with ESMTPSA id d4sm3252532pdm.50.2015.03.27.16.52.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Mar 2015 16:52:10 -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 2/3] scsi: ufs: fix unbalanced power.usage_count after reloading driver Date: Sat, 28 Mar 2015 08:51:46 +0900 Message-Id: <1427500307-5649-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427500307-5649-1-git-send-email-akinobu.mita@gmail.com> References: <1427500307-5649-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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_sync() 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..4164108 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_sync(&pdev->dev); return 0; }