Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752784AbeABJ1v (ORCPT + 1 other); Tue, 2 Jan 2018 04:27:51 -0500 Received: from mail-lf0-f43.google.com ([209.85.215.43]:35706 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370AbeABJ1r (ORCPT ); Tue, 2 Jan 2018 04:27:47 -0500 X-Google-Smtp-Source: ACJfBoteXjPIlnKfNLBrEnVT4k7UkqWPP+D9LU9uzpEHZ8+8YsBmPsCk6UTGQGU6IAyB48/vVphwMg== Date: Tue, 2 Jan 2018 10:27:45 +0100 From: Johan Hovold To: "Ji-Ze Hong (Peter Hong)" Cc: Johan Hovold , gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "Ji-Ze Hong (Peter Hong)" Subject: Re: [PATCH V1 3/4] usb: serial: f81534: add output pin control Message-ID: <20180102092745.GG16993@localhost> References: <1510818369-10323-1-git-send-email-hpeter+linux_kernel@gmail.com> <1510818369-10323-3-git-send-email-hpeter+linux_kernel@gmail.com> <20171218160616.GC3374@localhost> <20171227103055.GN3374@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 02, 2018 at 11:24:26AM +0800, Ji-Ze Hong (Peter Hong) wrote: > Hi Johan, > > >> In this code, I'm only read/write 3 registers of 0x2ae8, 0x2a90, 0x2a80, > >> but some register will read/write more than once. Should I change the > >> code from port_probe() to attach() and re-write it as: > >> 1: read the 3 register > >> 2: change them will 12 pin desire value > >> 3: write it back > >> Is it ok? > > > > Do you expect these pins to ever be changed after probe? If not, then > > perhaps it can be moved to attach(), but otherwise I guess they should > > be set at port_probe(). By using shadow registers, you should be able to > > reduce the number of device accesses, but perhaps it's not worth the > > complexity. > > > > Do you have a rough idea about how long these register updates take? I > > was just worried that these changes will add up to really long probe > > times. > > > > I had measured the time of the loop in f81534_set_port_output_pin() via > getnstimeofday() with 685.410 ~ 3681.682us per port, but normally with > 600~800us per port. So I prefer remain the current method of > f81534_set_port_output_pin(). Is it ok? That should be fine. Thanks for verifying. Johan