lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <D288652A-C975-46D5-92D8-048463C15AAB@suse.de>
Date:	Thu, 14 Mar 2013 01:30:09 +0100
From:	Alexander Graf <agraf@...e.de>
To:	Doug Anderson <dianders@...omium.org>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	linux-usb@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
	dmueller@...e.de, Vivek Gautam <gautam.vivek@...sung.com>,
	Jingoo Han <jg1.han@...sung.com>,
	Alan Stern <stern@...land.harvard.edu>,
	Kukjin Kim <kgene.kim@...sung.com>,
	Felipe Balbi <balbi@...com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] USB: ehci-s5p: Fix phy reset


On 13.03.2013, at 18:59, Doug Anderson wrote:

> Alexander,
> 
> On Wed, Mar 13, 2013 at 10:45 AM, Alexander Graf <agraf@...e.de> 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


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,--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ