mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ji-Ze Hong (Peter Hong)" <hpeter@gmail.com>
To: Johan Hovold <johan@kernel.org>
Cc: gregkh@linuxfoundation.org,
	One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	tom_tsai@fintek.com.tw, peter_hong@fintek.com.tw,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Ji-Ze Hong (Peter Hong)" <hpeter+linux_kernel@gmail.com>
Subject: Re: [PATCH V9 1/1] usb:serial: Add Fintek F81532/534 driver
Date: Wed, 24 Aug 2016 14:36:51 +0800	[thread overview]
Message-ID: <3e42b288-2b98-f2aa-2758-321fee4cb65d@gmail.com> (raw)
In-Reply-To: <20160823095056.GI16896@localhost>

Hi Johan,

Johan Hovold 於 2016/8/23 下午 05:50 寫道:
> On Tue, Aug 23, 2016 at 04:23:44PM +0800, Ji-Ze Hong (Peter Hong) wrote:
>> Hi Johan,
>>
>> Johan Hovold 於 2016/8/22 下午 09:14 寫道:
>
> I'd say it's not worth trying to avoid that extra allocation, and there
> will be several further allocations done in the usb_control_msg path
> anyway. What you have today (i.e. in v9) is fine.

Ok, I'll keep set/get register the same with V9.


>>>> +		tty_port_num = f81534_phy_to_logic_port(serial, phy_port_num);
>>>> +		port = serial->port[tty_port_num];
>>>> +
>>>> +		/*
>>>> +		 * The device will send back all information when we submitted
>>>> +		 * a read URB (MSR/DATA/TX_EMPTY). But it maybe get callback
>>>> +		 * before port_probe() or after port_remove().
>>>> +		 *
>>>> +		 * So we'll verify the pointer. If the pointer is NULL, it's
>>>> +		 * mean the port not init complete and the block will skip.
>>>> +		 */
>>>> +		port_priv = usb_get_serial_port_data(port);
>>>
>>> Check if the port has been opened here instead, no need to store MSR for
>>> an unused port above.
>>
>> It's useless for MSR & Receive data when port is closed, but we need
>> the URB to receive TX empty flag. We may not received TX empty flag
>> if we don't process when port is closed. It'll make the port not
>> workable.
>
> But you explicitly clear the xmit fifo on open it seems?
>

The F81532/534 contains 2 blocks of H/W designs. One is a 16550A
compatible UART with 128 bytes FIFO, and another is a USB bridge with
DMA to access UART TX/RX FIFO and handle USB protocols.

The clear FIFO in f81534_open() is just clean UART TX/RX FIFO, not USB
bridge's RAM. So we must keep a read URB for get newest information via
USB bridge likes TX empty.

I'll try again to re-write the section as you mention, submit on first
open(), kill on last close() and test for some times. If had no other
issues, I'll apply to next patch, otherwise I'll preserve old method.

Thanks for your help.
-- 
With Best Regards,
Peter Hong

      reply	other threads:[~2016-08-24  6:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31  1:51 Ji-Ze Hong (Peter Hong)
2016-08-22 13:14 ` Johan Hovold
2016-08-23  8:23   ` Ji-Ze Hong (Peter Hong)
2016-08-23  9:50     ` Johan Hovold
2016-08-24  6:36       ` Ji-Ze Hong (Peter Hong) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e42b288-2b98-f2aa-2758-321fee4cb65d@gmail.com \
    --to=hpeter@gmail.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpeter+linux_kernel@gmail.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter_hong@fintek.com.tw \
    --cc=tom_tsai@fintek.com.tw \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome