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] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bn39766q.fsf@linux.intel.com>
Date:	Fri, 10 Jun 2016 12:18:37 +0300
From:	Felipe Balbi <balbi@...nel.org>
To:	Roger Quadros <rogerq@...com>,
	Grygorii Strashko <grygorii.strashko@...com>
Cc:	tony@...mide.com, Joao.Pinto@...opsys.com,
	sergei.shtylyov@...entembedded.com, peter.chen@...escale.com,
	jun.li@...escale.com, yoshihiro.shimoda.uh@...esas.com,
	nsekhar@...com, b-liu@...com, linux-usb@...r.kernel.org,
	linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 5/5] usb: dwc3: core: cleanup IRQ resources


Hi,

Roger Quadros <rogerq@...com> writes:
> On 10/06/16 11:18, Felipe Balbi wrote:
>> 
>> Hi,
>> 
>> Roger Quadros <rogerq@...com> writes:
>>>> 	dwc->xhci_resource[1] = *res;
>>>
>>> Probably not as we don't want to change parent/child members.
>> 
>> oh, you had already replied. Sorry. This is correct
>> 
> np :).
>
> So what i'll do is get the irq via platform_get_irq() and friends
> and if it was a success use platform_get_resource() and friends
> to get struct resource and just edit the relevant parts for the
> XHCI irq resource.
>
> Sounds OK?
>
> something like this.
>
> +	int			ret, irq;
> +	struct resource		*res;
> +	struct platform_device	*dwc3_pdev = to_platform_device(dwc->dev);
> +
> +	irq = platform_get_irq_byname(dwc3_pdev, "host");
> +	if (irq == -EPROBE_DEFER)
> +		return irq;
> +
> +	if (irq <= 0) {
> +		irq = platform_get_irq_byname(dwc3_pdev, "dwc_usb3");
> +		if (irq == -EPROBE_DEFER)
> +			return irq;
> +
> +		if (irq <= 0) {
> +			irq = platform_get_irq(dwc3_pdev, 0);
> +			if (irq <= 0) {
> +				if (irq != -EPROBE_DEFER) {
> +					dev_err(dwc->dev,
> +						"missing host IRQ\n");
> +				}
> +				return irq;
> +			} else {
> +				res = platform_get_resource(dwc3_pdev,
> +							    IORESOURCE_IRQ, 0);
> +			}
> +		} else {
> +			res = platform_get_resource_byname(dwc3_pdev,
> +							   IORESOURCE_IRQ,
> +							   "dwc_usb3");
> +		}
> +
> +	} else {
> +		res = platform_get_resource_byname(dwc3_pdev, IORESOURCE_IRQ,
> +						   "host");
> +	}
> +
> +	dwc->xhci_resources[1].start = irq;
> +	dwc->xhci_resources[1].end = irq;
> +	dwc->xhci_resources[1].flags = res->flags;
> +	dwc->xhci_resources[1].name = res->name;

looks okay to me.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ