Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6383068imu; Mon, 21 Jan 2019 08:01:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN6XoIf7KkyZYua4h1vDpOFJT78G5BxzcbTZmXe66Bi5ujTKTW0aTd77uUwocpH2dB+mZWVA X-Received: by 2002:a62:4641:: with SMTP id t62mr29855966pfa.141.1548086480303; Mon, 21 Jan 2019 08:01:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548086480; cv=none; d=google.com; s=arc-20160816; b=dHpEeoM8eFXng6HSbPuekgj92GOWwEsZoxWyyx9SkuVYNHEeVY8xEipU6FgNZB3eY2 ojqaMRAPaXcTcIiBpt32PHf1ycl+hVxfnPXSAikIxGTOIiWwVThi4ZckvKbtSrf5CLJO +TqU+58UWF7KJTp7z5d7rLLBdLrRHZVdhcs6QmVMAjImBPq5lTPSKhGDHNY3cbFfukaM sxczWwj0h/VD0K6U7eJm1YDhRL6MyHVmkzV9b1DlGbMfkPvsrzlXN4tBynmdldymE9zw YbkTcGnp5OpXzORrQaR+icgqrv88/fy2iMUm8vs7s4PzUXgevT+mun7GlA2ENzZ5OmLD OYRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=ZHPYsL2xkgsk70zv70n70ayT4Gz6Ev9RUwViMeg/gGo=; b=W23OmhLQJK8cE1a1yBQqq+f871tohkmig71IL9Toru58TDajahaMeoxsJ44NZ5e2dV SQztshqGTkx2afRf1R69t3icHjTvVIidLgoq6XZA+S9a75Q+27xEiU1HGAywkY7LTDG6 VynRbxzGbbBfWIsE+Ok1bTzbS9GITtF3OwTrSuoBxVYv8FfzyKJpS0CGKq9/M+LdukCA m010Rs6C2ZX/ND3P+92xsX9xHPNiTIO8ygWyUsJW43NfJu0uANnwCFbYKVGgz3ZGdxt6 myNUw6oIiEB+5GnwV77OTpDm4elggBcTVYqHqDubw/JmhPCi9d33jiTRqtfzpS2mpwSa TGow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yUFsRucj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7si13923231pfb.226.2019.01.21.08.01.04; Mon, 21 Jan 2019 08:01:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yUFsRucj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730381AbfAUP7u (ORCPT + 99 others); Mon, 21 Jan 2019 10:59:50 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:35044 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728761AbfAUP7t (ORCPT ); Mon, 21 Jan 2019 10:59:49 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0LFxT0r107484; Mon, 21 Jan 2019 09:59:29 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1548086369; bh=ZHPYsL2xkgsk70zv70n70ayT4Gz6Ev9RUwViMeg/gGo=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=yUFsRucjWrwpgVJzsPIsThNEoPsOzkv1qN9wfkyx/DGd0/e1B17HSyWiQE7cJLSAC BzBpLY79TYpW8IXDT8l7KzukDCH5lxCB9PmqL45sFI9TbWTdAQVUOrE09e/qQfFI7G /gIgdMxb9eaZqSKZfUX7Zp0kScmz6ji5q935vEfs= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0LFxTLh067437 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Jan 2019 09:59:29 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 21 Jan 2019 09:59:29 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 21 Jan 2019 09:59:29 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0LFxT47030421; Mon, 21 Jan 2019 09:59:29 -0600 Date: Mon, 21 Jan 2019 09:59:29 -0600 From: Bin Liu To: CC: Rob Herring , Greg Kroah-Hartman , Mark Rutland , Matthias Brugger , Alan Stern , , , , , , , , Subject: Re: [PATCH v4 5/6] usb: musb: Add musb_clearb/w() interface Message-ID: <20190121155929.GC30080@uda0271908> Mail-Followup-To: Bin Liu , min.guo@mediatek.com, Rob Herring , Greg Kroah-Hartman , Mark Rutland , Matthias Brugger , Alan Stern , chunfeng.yun@mediatek.com, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, tony@atomide.com, hdegoede@redhat.com References: <1548073351-13739-1-git-send-email-min.guo@mediatek.com> <1548073351-13739-6-git-send-email-min.guo@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1548073351-13739-6-git-send-email-min.guo@mediatek.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Min, On Mon, Jan 21, 2019 at 08:22:30PM +0800, min.guo@mediatek.com wrote: > From: Min Guo > > 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 > --- > 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.