From patchwork Mon May 5 15:38:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 29652 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DAE27202E6 for ; Mon, 5 May 2014 15:38:26 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id oz11sf3609939veb.2 for ; Mon, 05 May 2014 08:38:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=4san62EE1HV0mInXBaP3j+n12Q/v7N2JFlYhDP+5BcM=; b=PNXQNYQOChuZ7RW0SvSsjRWNY4Nm6iXHxDNxfdwCMAjZj8y00yW674E5h/xfAPykrB hEChJhbenIV90Jznepa6KjkdOEjdTsJiXC+LFZHkI/JWUVLpprZlVNy+IaIqiJ5qwdyv Bzus4tWWqzo0R5Z1gu+xuLrI5G3M6D0iqZ2T65WwMOTMWBL8vzUVtV0H0TWwFMQT0pEG c8esfXzC0xVWEvjG5RRNItZ9BTRQI2zYMUZ34AXLgH3UrE/TSsw9cgihOIsj0JdEblj7 Qe66dfHtTQDHxHsUty7zxiT/xdnked1kob/aZd2ScdUJVkW8Iw9muNDn4UGvOrjYTyeM /Y1A== X-Gm-Message-State: ALoCoQmOH0zCR8aTMKC361tTTiYYtMhryhGIxN4oWGFPo4On3SGYipVWOM4sDc7uZE5h0PNOQw3z X-Received: by 10.58.22.70 with SMTP id b6mr17775136vef.13.1399304306309; Mon, 05 May 2014 08:38:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.145 with SMTP id g17ls394200qge.76.gmail; Mon, 05 May 2014 08:38:26 -0700 (PDT) X-Received: by 10.58.39.129 with SMTP id p1mr178678vek.69.1399304306194; Mon, 05 May 2014 08:38:26 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id ya4si1671892vec.109.2014.05.05.08.38.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 08:38:26 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id oz11so1229707veb.2 for ; Mon, 05 May 2014 08:38:26 -0700 (PDT) X-Received: by 10.52.227.138 with SMTP id sa10mr11676693vdc.25.1399304306078; Mon, 05 May 2014 08:38:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp149867vcb; Mon, 5 May 2014 08:38:25 -0700 (PDT) X-Received: by 10.182.60.65 with SMTP id f1mr2828635obr.78.1399304305299; Mon, 05 May 2014 08:38:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id we10si6460622obc.183.2014.05.05.08.38.24; Mon, 05 May 2014 08:38:24 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753946AbaEEPiQ (ORCPT + 27 others); Mon, 5 May 2014 11:38:16 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:47913 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbaEEPiO (ORCPT ); Mon, 5 May 2014 11:38:14 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s45Fc9Pj006753; Mon, 5 May 2014 10:38:09 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s45Fc9C3017284; Mon, 5 May 2014 10:38:09 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 5 May 2014 10:38:09 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s45Fc8Ya015357; Mon, 5 May 2014 10:38:09 -0500 Date: Mon, 5 May 2014 10:38:04 -0500 From: Felipe Balbi To: George Cherian CC: , , , , Subject: Re: [PATCH] usb: musb: dsps: Remove debugfs entry in musb_platform_exit Message-ID: <20140505153803.GD17875@saruman.home> Reply-To: References: <1399300384-4179-1-git-send-email-george.cherian@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1399300384-4179-1-git-send-email-george.cherian@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Mon, May 05, 2014 at 08:03:04PM +0530, George Cherian wrote: > Remove the dsps_debugfs entry as part of musb_platform_exit(). > Without this MUSB never gets probed if compiled built-in. > > Signed-off-by: George Cherian > --- > drivers/usb/musb/musb_dsps.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c > index 9d9acaa..9876374 100644 > --- a/drivers/usb/musb/musb_dsps.c > +++ b/drivers/usb/musb/musb_dsps.c > @@ -482,6 +482,7 @@ static int dsps_musb_exit(struct musb *musb) > struct dsps_glue *glue = dev_get_drvdata(dev->parent); > > del_timer_sync(&glue->timer); > + debugfs_remove_recursive(glue->dbgfs_root); already fixed: commit 0fca91b8a446d4a38b8f3d4772c4a8665ebcd7b2 Author: Daniel Mack Date: Wed Apr 2 11:46:51 2014 +0200 usb: musb: dsps: move debugfs_remove_recursive() When the platform initialization fails due to missing resources, it will return -EPROBE_DEFER after dsps_musb_init() has been called. dsps_musb_init() calls dsps_musb_dbg_init() to allocate the debugfs nodes. At a later point in time, the probe will be retried, and dsps_musb_dbg_init() will be called again. debugfs_create_dir() will fail this time, as the node already exists, and so the entire device probe will fail with -ENOMEM. Fix this by moving debugfs_remove_recursive() from dsps_remove() to the plaform's exit function, so it will be cleanly torn down when the probe fails. It also feels more natural this way, as .exit is the counterpart to .init. Signed-off-by: Daniel Mack Signed-off-by: Felipe Balbi diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 3372ded..e2fd263 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -470,8 +470,9 @@ static int dsps_musb_exit(struct musb *musb) struct dsps_glue *glue = dev_get_drvdata(dev->parent); del_timer_sync(&glue->timer); - usb_phy_shutdown(musb->xceiv); + debugfs_remove_recursive(glue->dbgfs_root); + return 0; } @@ -708,8 +709,6 @@ static int dsps_remove(struct platform_device *pdev) pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); - debugfs_remove_recursive(glue->dbgfs_root); - return 0; }