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: <20190121155929.GC30080@uda0271908>
Date:   Mon, 21 Jan 2019 09:59:29 -0600
From:   Bin Liu <b-liu@...com>
To:     <min.guo@...iatek.com>
CC:     Rob Herring <robh+dt@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Mark Rutland <mark.rutland@....com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Alan Stern <stern@...land.harvard.edu>,
        <chunfeng.yun@...iatek.com>, <linux-usb@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>, <tony@...mide.com>,
        <hdegoede@...hat.com>
Subject: Re: [PATCH v4 5/6] usb: musb: Add musb_clearb/w() interface

Hi Min,

On Mon, Jan 21, 2019 at 08:22:30PM +0800, min.guo@...iatek.com wrote:
> From: Min Guo <min.guo@...iatek.com>
> 
> Delete the const attribute of addr parameter in readb/w/l hooks, these
> changes are for implementing clearing W1C registers.
> Replace musb_readb/w with musb_clearb/w to clear the interrupt status.
> 
> Signed-off-by: Min Guo <min.guo@...iatek.com>
> ---
> new patch based on v3:
> ---
>  drivers/usb/musb/musb_core.c | 32 +++++++++++++++++++++++---------
>  drivers/usb/musb/musb_core.h |  8 ++++++--
>  drivers/usb/musb/musb_io.h   |  8 +++++---
>  drivers/usb/musb/musbhsdma.c |  3 +++
>  drivers/usb/musb/sunxi.c     |  4 ++--
>  drivers/usb/musb/tusb6010.c  |  2 +-
>  6 files changed, 40 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 2fe5225..5ef8848 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c

[snip]

> diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
> index b2394a7..7bf91cb 100644
> --- a/drivers/usb/musb/musbhsdma.c
> +++ b/drivers/usb/musb/musbhsdma.c
> @@ -286,6 +286,9 @@ irqreturn_t dma_controller_irq(int irq, void *private_data)
>  
>  	int_hsdma = musb_readb(mbase, MUSB_HSDMA_INTR);
>  
> +	/* clear pending interrupts by manual */
> +	musb_clearb(musb->mregs, MUSB_HSDMA_INTR);
> +

Make musb_clearb/w() return the value of the _read() instead of
_write(), so that we don't have to read twice here. The value of
_write() is not used anyway.

The change above can be:

	int_hsdma = musb_clearb(mbase, MUSB_HSDMA_INTR);

Please see my comments in 6/6 for details.

Regards,
-Bin.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ