Re: [PATCH usb 00/32] cleanup on resource check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Oct 30, 2014 at 06:42:08AM +0530, Varka Bhadram wrote:
> On Thursday 30 October 2014 02:43 AM, Alan Stern wrote:
> >On Wed, 29 Oct 2014, Varka Bhadram wrote:
> >
> >>This series removes the duplication of sanity check for
> >>platform_get_resource() return resource. It will be checked
> >>with devm_ioremap_resource()
> >>
> >>This series based on usb/master.
> >>
> >>Varka Bhadram (32):
> >>   host: ehci-atmel: remove duplicate check on resource
> >>   host: ehci-exynos: remove duplicate check on resource
> >>   host: ehci-fsl: remove duplicate check on resource
> >>   dwc3: core: remove duplicate check on resource
> >>   dwc3: dwc3-keystone: remove duplicate check on resource
> >>   renesas_usbhs: common: remove duplicate check on resource
> >>   phy: phy-rcar-usb: remove duplicate check on resource
> >>   musb: musb_dsps: remove duplicate check on resource
> >>   musb: musb_core: remove duplicate check on resource
> >>   host: xhci-plat: remove duplicate check on resource
> >>   host: uhci-platform: remove duplicate check on resource
> >>   host: ohci-st: remove duplicate check on resource
> >>   host: ohci-spear: remove duplicate check on resource
> >>   host: ehci-sh: remove duplicate check on resource
> >>   host: ohci-pxa27x: remove duplicate check on resource
> >>   host: ohci-platform: remove duplicate check on resource
> >>   host: ohci-octeon: remove duplicate check on resource
> >>   host: ohci-jz4740: remove duplicate check on resource
> >>   host: ohci-exynos: remove duplicate check on resource
> >>   host: ohci-da8xx: remove duplicate check on resource
> >>   host: ohci-at91: remove duplicate check on resource
> >>   host: ehci-w90x900: remove duplicate check on resource
> >>   host: ehci-tegra: remove duplicate check on resource
> >>   host: ehci-st: remove duplicate check on resource
> >>   host: ehci-spear: remove duplicate check on resource
> >>   host: ehci-sead3: remove duplicate check on resource
> >>   host: ehci-platform: remove duplicate check on resource
> >>   host: ehci-orion: remove duplicate check on resource
> >>   host: ehci-octeon: remove duplicate check on resource
> >>   host: ehci-mxc: remove duplicate check on resource
> >>   host: ehci-mv: remove duplicate check on resource
> >>   host: ehci-msm: remove duplicate check on resource
> >For all the ehci, ohci, and uhci changes:
> >
> >Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> 
> Thanx for your ACK.
> 
> >I didn't look carefully at the others, but the dwc3-core patch (4/32)
> >definitely seemed wrong.
> >
> I don't find any wrong in the code.

Really ? Look more carefuly

> static int dwc3_probe(struct platform_device *pdev)
> {
> 	struct device		*dev = &pdev->dev;
> 	struct dwc3_platform_data *pdata = dev_get_platdata(dev);
> 	struct device_node	*node = dev->of_node;
> 	struct resource		*res;
> 	struct dwc3		*dwc;
> 
> 	int			ret;
> 
> 	void __iomem		*regs;
> 	void			*mem;
> 
> 	mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
> 	if (!mem)
> 		return -ENOMEM;
> 
> 	dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1);
> 	dwc->mem = mem;
> 	dwc->dev = dev;
> 
> 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> 	if (!res) {
> 		dev_err(dev, "missing IRQ\n");
> 		return -ENODEV;
> 	}
> 	dwc->xhci_resources[1].start = res->start;
> 	dwc->xhci_resources[1].end = res->end;
> 	dwc->xhci_resources[1].flags = res->flags;
> 	dwc->xhci_resources[1].name = res->name;
> 
> 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> 	/*
> 	 * Request memory region but exclude xHCI regs,
> 	 * since it will be requested by the xhci-plat driver.
> 	 */
> 	regs = devm_ioremap_resource(dev, res);

because you moved this call here...

> 	if (IS_ERR(regs))
> 		return PTR_ERR(regs);
> 
> 	dwc->xhci_resources[0].start = res->start;
> 	dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
> 					DWC3_XHCI_REGS_END;
> 	dwc->xhci_resources[0].flags = res->flags;
> 	dwc->xhci_resources[0].name = res->name;
> 
> 	res->start += DWC3_GLOBALS_REGS_START;

... before doing this, you're now ioremapping the entire space
*INCLUDING* the XHCI address space, which means that you have just
broken every single platform using this driver in host mode.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux