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: <87sg7544da.fsf@kernel.org>
Date:   Wed, 13 Jan 2021 10:40:01 +0200
From:   Felipe Balbi <balbi@...nel.org>
To:     Sandeep Maheswaram <sanm@...eaurora.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Stephen Boyd <swboyd@...omium.org>,
        Doug Anderson <dianders@...omium.org>,
        Matthias Kaehlcke <mka@...omium.org>
Cc:     linux-arm-msm@...r.kernel.org, linux-usb@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        Manu Gautam <mgautam@...eaurora.org>,
        Sandeep Maheswaram <sanm@...eaurora.org>
Subject: Re: [PATCH] usb: dwc3: qcom: Add shutdown callback for dwc3


Hi,

Sandeep Maheswaram <sanm@...eaurora.org> writes:
> This patch adds a shutdown callback to USB DWC QCOM driver to ensure that
> it is properly shutdown in reboot/shutdown path. This is required
> where SMMU address translation is enabled like on SC7180
> SoC and few others. If the hardware is still accessing memory after
> SMMU translation is disabled as part of SMMU shutdown callback in
> system reboot or shutdown path, then IOVAs(I/O virtual address)
> which it was using will go on the bus as the physical addresses which
> might result in unknown crashes (NoC/interconnect errors).
>
> Signed-off-by: Sandeep Maheswaram <sanm@...eaurora.org>

sounds like this is fixing a bug. Do you have a Fixes tag for it? Should
this go to stable?

> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index c703d55..a930e06 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -790,13 +790,11 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int dwc3_qcom_remove(struct platform_device *pdev)
> +static void __dwc3_qcom_teardown(struct dwc3_qcom *qcom)
>  {
> -	struct dwc3_qcom *qcom = platform_get_drvdata(pdev);
> -	struct device *dev = &pdev->dev;
>  	int i;
>  
> -	of_platform_depopulate(dev);
> +	of_platform_depopulate(qcom->dev);
>  
>  	for (i = qcom->num_clocks - 1; i >= 0; i--) {
>  		clk_disable_unprepare(qcom->clks[i]);
> @@ -807,12 +805,27 @@ static int dwc3_qcom_remove(struct platform_device *pdev)
>  	dwc3_qcom_interconnect_exit(qcom);
>  	reset_control_assert(qcom->resets);
>  
> -	pm_runtime_allow(dev);
> -	pm_runtime_disable(dev);
> +	pm_runtime_allow(qcom->dev);
> +	pm_runtime_disable(qcom->dev);
> +}

you can make the changes smaller by adding:

	struct device *dev = qcom->dev;

The nothing else needs to change in this function ;-)

-- 
balbi

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ