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>] [day] [month] [year] [list]
Date:	Fri, 12 Sep 2014 18:38:21 +0200
From:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To:	dinguyen@...nsource.altera.com
Cc:	paulz@...opsys.com, gregkh@...uxfoundation.org, balbi@...com,
	dinh.linux@...il.com, swarren@...dotorg.org, matthijs@...in.nl,
	r.baldyga@...sung.com, jg1.han@...sung.com,
	sachin.kamat@...aro.org, ben-linux@...ff.org,
	dianders@...omium.org, kever.yang@...k-chips.com,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv4 11/12] usb: dwc2: check that the host work queue is valid


[ added linux-kernel ML to cc: ]

Hi,

On Tuesday, August 26, 2014 11:20:02 AM dinguyen@...nsource.altera.com wrote:
> From: Dinh Nguyen <dinguyen@...nsource.altera.com>
> 
> The Host workqueue will not get initialized if the driver is configured for
> peripheral mode only. Thus we need to check for wq_otg before calling
> queue_work().

This should be done at the same time that gadget/host probing is merged
to preserve bisectability.

> Signed-off-by: Dinh Nguyen <dinguyen@...nsource.altera.com>
> Acked-by: Paul Zimmerman <paulz@...opsys.com>
> ---
>  drivers/usb/dwc2/core_intr.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c
> index 651785d..1240875 100644
> --- a/drivers/usb/dwc2/core_intr.c
> +++ b/drivers/usb/dwc2/core_intr.c
> @@ -287,9 +287,11 @@ static void dwc2_handle_conn_id_status_change_intr(struct dwc2_hsotg *hsotg)
>  	 * Release lock before scheduling workq as it holds spinlock during
>  	 * scheduling.
>  	 */
> -	spin_unlock(&hsotg->lock);
> -	queue_work(hsotg->wq_otg, &hsotg->wf_otg);
> -	spin_lock(&hsotg->lock);
> +	if (hsotg->wq_otg) {
> +		spin_unlock(&hsotg->lock);
> +		queue_work(hsotg->wq_otg, &hsotg->wf_otg);
> +		spin_lock(&hsotg->lock);
> +	}
>  
>  	/* Clear interrupt */
>  	writel(GINTSTS_CONIDSTSCHNG, hsotg->regs + GINTSTS);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
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