From patchwork Thu Mar 14 00:30:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 2267071 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id BC6E03FCF6 for ; Thu, 14 Mar 2013 00:30:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933439Ab3CNAaR (ORCPT ); Wed, 13 Mar 2013 20:30:17 -0400 Received: from cantor2.suse.de ([195.135.220.15]:39593 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932609Ab3CNAaQ convert rfc822-to-8bit (ORCPT ); Wed, 13 Mar 2013 20:30:16 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 74B88A51B8; Thu, 14 Mar 2013 01:30:14 +0100 (CET) Subject: Re: [PATCH] USB: ehci-s5p: Fix phy reset Mime-Version: 1.0 (Apple Message framework v1278) From: Alexander Graf In-Reply-To: Date: Thu, 14 Mar 2013 01:30:09 +0100 Cc: "linux-kernel@vger.kernel.org" , linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dmueller@suse.de, Vivek Gautam , Jingoo Han , Alan Stern , Kukjin Kim , Felipe Balbi , Greg Kroah-Hartman Message-Id: References: <1363136988-3704-1-git-send-email-agraf@suse.de> To: Doug Anderson X-Mailer: Apple Mail (2.1278) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org On 13.03.2013, at 18:59, Doug Anderson wrote: > Alexander, > > On Wed, Mar 13, 2013 at 10:45 AM, Alexander Graf wrote: >> >>>> + gpio_free(gpio); >>> >>> Freeing the gpio is a little on the iffy side since you actually care >>> about keeping the value. Perhaps you can change this to >>> devm_gpio_request_one() and avoid the free? I was about to submit a >>> patch to do just that (since otherwise you run into trouble if you >>> ever defer the probe) but then ran across your patch. >> >> I could also just return it when the function exits and only free it when we exit the probe function with a negative value. The reason I put it in here was that on probe deferral, the pin simply gets blocked. >> >> However, I could probably also just completely take the gpio_free() out of this patch and resubmit, as it should be pretty much unrelated. Then you can patch it properly. > > Sure, if you want to resubmit without the gpio_free() I'll submit a > new patch atop yours with the change to devm and people can see if > they like it... Hrm. So when I remove the gpio_free() again, I can't find the USB hub anymore. If I however postpone the whole reset procedure until after the potential deferral, it works (see patch below). Any idea what is going on here? Alex To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index f692f70..b29b2b8 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c @@ -136,8 +136,6 @@ static int s5p_ehci_probe(struct platform_device *pdev) if (!pdev->dev.coherent_dma_mask) pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); - s5p_setup_vbus_gpio(pdev); - s5p_ehci = devm_kzalloc(&pdev->dev, sizeof(struct s5p_ehci_hcd), GFP_KERNEL); if (!s5p_ehci) @@ -157,6 +155,8 @@ static int s5p_ehci_probe(struct platform_device *pdev) s5p_ehci->otg = phy->otg; } + s5p_setup_vbus_gpio(pdev); + s5p_ehci->dev = &pdev->dev; hcd = usb_create_hcd(&s5p_ehci_hc_driver, &pdev->dev,--