Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1175346imu; Wed, 16 Jan 2019 14:09:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Ggb5h4ks4fZ5sldIpUqIhYZdWhm/5JilcTyl4C/wgK98bOWoRhC8LMhE6nGLYDOvzuwGZ X-Received: by 2002:a62:4549:: with SMTP id s70mr11986610pfa.233.1547676599416; Wed, 16 Jan 2019 14:09:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547676599; cv=none; d=google.com; s=arc-20160816; b=iIAABpZRISvLnEC6Aowd1C04kfNp6C+xKWxbM8dD3qKBXkaZZp43KY0I6Arqqr28C9 yFIX5ds6jUAnV+7/1nNKcgovL4JsKfhnU8S/5jJNmzaXmihAKA49YH10DQYoIUwuUZ8t VZ9+0QhaQZARDD5Y/yE0JL9vhOumuPP0hWjYNWGwH61ivmPzRXR3ICcYEJCo8JczejE9 UW22K9deNgxJB7YWtER/qwkFNqa2EV702NF0XMYfA2wfrfkWh117/XKh2HvshQMCV5DF PwxrSOxx/pHn/AQpR6vSTN1WFIEgI5xd8Sr0f0oCZNNy3fNyzged79HuH4hVNsHcTGlT RmGA== 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=qPKrUkrAIkB2XNH4Q+k0AA3gQLZgT3gnNmps+D3At18=; b=CiW8F0zYP8OyAQkCoiLh5WMRllMREVG190AjIA8jm+/UmX60Lmw4rUj86XJCcw/e8N VIedanuQgILsir9VV9U8r5lmMw94qzsYVyGXeRRK/PtpwAAZ1gwSB3lQOQDm7X6N6x99 XrkbGd9+cJ6v+rl6KpMcHu4qfS/sxg7k5XP6cyJBtb0hSsQcRrYGshDCchmcAMYtJ4Jk t7N8JVB/vd7T5wW6PI2ruFM3pnWkeicr1qmOgWIW19EyauR+OdpLjL0dGFxGaxZq0DAu lp3uJKiNovBeVwourUsIysIFLoYg/cd17rTREnIo+pAYOOIunygsXHUuw6f5fSVZFz+2 TtzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=f4cPDGrJ; 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 s36si7433168pld.46.2019.01.16.14.09.41; Wed, 16 Jan 2019 14:09:59 -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=f4cPDGrJ; 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 S2387714AbfAPN72 (ORCPT + 99 others); Wed, 16 Jan 2019 08:59:28 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:41484 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727935AbfAPN72 (ORCPT ); Wed, 16 Jan 2019 08:59:28 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0GDxENM098001; Wed, 16 Jan 2019 07:59:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547647154; bh=qPKrUkrAIkB2XNH4Q+k0AA3gQLZgT3gnNmps+D3At18=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=f4cPDGrJ7X8ejUO/J1U1FfA+RcQ99VNhqlUT9YZD0bFwytwNyuDFyWLfVGqJw92fB gAMO7KZrHEmABGY/BtuycUtAxxv4L7d4wJGmEGZGWnA958mMC/AImmTLFVBR5PP1b5 b6K+f5GhOTzHEUoHrCtkUtJo8b/YF49lHWbog2AE= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0GDxEBt054639 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Jan 2019 07:59:14 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 16 Jan 2019 07:59:14 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 16 Jan 2019 07:59:14 -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 x0GDxEBD009808; Wed, 16 Jan 2019 07:59:14 -0600 Date: Wed, 16 Jan 2019 07:59:14 -0600 From: Bin Liu To: Min Guo CC: Rob Herring , Greg Kroah-Hartman , Mark Rutland , Matthias Brugger , Alan Stern , , , , , , , Yonglong Wu Subject: Re: [PATCH v2 4/4] usb: musb: Add support for MediaTek musb controller Message-ID: <20190116135914.GF18026@uda0271908> Mail-Followup-To: Bin Liu , Min Guo , 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, Yonglong Wu References: <1547516626-5084-1-git-send-email-min.guo@mediatek.com> <1547516626-5084-5-git-send-email-min.guo@mediatek.com> <20190115203815.GD18026@uda0271908> <1547631542.4433.232.camel@mhfsdcap03> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1547631542.4433.232.camel@mhfsdcap03> 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 On Wed, Jan 16, 2019 at 05:39:02PM +0800, Min Guo wrote: > Hi Bin, > > On Tue, 2019-01-15 at 14:38 -0600, Bin Liu wrote: > > Hi Min, > > > > very close, thanks. > > Below I tried to explain a further cleanup in musb_clearb/w() and > > musb_get/set_toggle() implementation. Please let me know if it is not > > clear. > > > > Basically, we don't need musb_default_clearb/w(), just assign the > > musb_io function pointers to musb_readb/w(). > > > > Then the mtk platform musb_clearb/w() calls musb_readb/w() and > > musb_writeb/w() to handle W1C. > > Sorry to bother you again, I encounter a problem when prepare the patch. no problem at all. > The define of musb_clearb/w and musb_readb/w are difference as follow, > and cannot be directly assigned: > u8/u16 (*readb/w)(const void __iomem *addr, unsigned offset) > void (*clearb/w)(void __iomem *addr, unsigned int offset)) > > if modify clearb/w as: > u8/u16 (*clearb/w)(const void __iomem *addr, unsigned int offset)) > then musb_clear needs writeb/w the const addr. > Can I delete const in (*readb/w)? yes, please create a separate patch for it, and for readl() as well, and stating it is for implementing clearing W1C registers. Regards, -Bin.