Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6851592imu; Mon, 21 Jan 2019 17:45:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN7MK384JxLw6SGe9uRLovbZhg+ZDrpIb+JgFrhqkERKyPJCdyR2UdGv+E2is0oJjYnbaxxL X-Received: by 2002:a62:528e:: with SMTP id g136mr33123384pfb.111.1548121510206; Mon, 21 Jan 2019 17:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548121510; cv=none; d=google.com; s=arc-20160816; b=S6jz7tFDnmOr1FB1nJvdSp/T1wZ6jsudmZzSHU3StyqfDfGxNzuGmwQpBYD5axeQl7 2Wu7KGLWnq8FORnr8QWgWENrcXA8naqKevp1uny25/Sjs4LBRd+gkAcCGa6e/eKowZY1 FScIGhG6nikSeFcIGK8btIaGqgUZ26U+qI+YxD2Df4Ig+6aSeAtKcIGGuNhTDySyYWMV z8X2HSyX1CSz0mOKNk9GWpNW3YSO0eABL8Ri8ohhagoFECbagX31o4CwUhiXlC8m9r/I vxUwQhaL+QZDShR1wSw5ee5AiagdYJyF40JGrQHrH+dD3hhnJ/ivEavYPb40B+BmsgKG 2zmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=AU0OVBzEv86VK7EgJRn5vAUhEsJoDfssxU0tn+Y3tak=; b=WK8sJcdvPw48E6YbeWaUX7N0iAec5kBR0OJwcwErouXhbo1KaXuUz42wZNl+1baLfw k/5/3iCrTZSSuwjQKONTkC984gl4ZA4E8ZvcePsdxZnBLO7aA6lJn48LYYY1WqG30J+V TVvft6pJos7Lrxmrng0RRldZCpubmwfNofjptZ/GRrYw7rNpOmvdGWNHHZJz7oQTs4Wj Q91/UTD56Bd+f5Rx9VtKXRyQzTyq9vSbuIm772Yy1yz4kl+REWL6C+hI+/DlU1+uZFdD UNFX7869wSOehlhGj+KDaVEAYEWfmW0p47dfH4S8xgsnUwiu4OxHLyIOQuULbfAM9klT WaqA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si13637240pgh.368.2019.01.21.17.44.54; Mon, 21 Jan 2019 17:45:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbfAVBnu (ORCPT + 99 others); Mon, 21 Jan 2019 20:43:50 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:3477 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726435AbfAVBnt (ORCPT ); Mon, 21 Jan 2019 20:43:49 -0500 X-UUID: c565f9240bde470195deceea2951c217-20190122 X-UUID: c565f9240bde470195deceea2951c217-20190122 Received: from mtkcas35.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1515821922; Tue, 22 Jan 2019 09:43:37 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 22 Jan 2019 09:43:36 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 22 Jan 2019 09:43:35 +0800 Message-ID: <1548121414.4433.257.camel@mhfsdcap03> Subject: Re: [PATCH v4 5/6] usb: musb: Add musb_clearb/w() interface From: Min Guo To: Bin Liu CC: Rob Herring , Greg Kroah-Hartman , Mark Rutland , "Matthias Brugger" , Alan Stern , , , , , , , , Date: Tue, 22 Jan 2019 09:43:34 +0800 In-Reply-To: <20190121155929.GC30080@uda0271908> References: <1548073351-13739-1-git-send-email-min.guo@mediatek.com> <1548073351-13739-6-git-send-email-min.guo@mediatek.com> <20190121155929.GC30080@uda0271908> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bin, On Mon, 2019-01-21 at 09:59 -0600, Bin Liu wrote: > 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. Okay. > Regards, > -Bin.