Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754735AbbBBCi0 (ORCPT ); Sun, 1 Feb 2015 21:38:26 -0500 Received: from rtits2.realtek.com ([60.250.210.242]:51185 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754163AbbBBCiX convert rfc822-to-8bit (ORCPT ); Sun, 1 Feb 2015 21:38:23 -0500 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.52 with qID t122cFvA027205, This message is accepted by code: ctloc85258 From: Hayes Wang To: David Miller CC: "netdev@vger.kernel.org" , nic_swsd , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: RE: [PATCH net-next 1/7] r8152: adjust rx_bottom Thread-Topic: [PATCH net-next 1/7] r8152: adjust rx_bottom Thread-Index: AQHQNCzHp+COjrpcAkWYiP9rnzW4lZzIR54A//+CIwCAAIjHUIAHk4YAgAH/SiCACtC1IA== Date: Mon, 2 Feb 2015 02:38:14 +0000 Message-ID: <0835B3720019904CB8F7AA43166CEEB2EE80DE@RTITMBSV03.realtek.com.tw> References: <0835B3720019904CB8F7AA43166CEEB2EE6E76@RTITMBSV03.realtek.com.tw> <20150119.215220.720365670558757349.davem@davemloft.net> <0835B3720019904CB8F7AA43166CEEB2EE6E9F@RTITMBSV03.realtek.com.tw> <20150124.224342.425895080003524375.davem@davemloft.net> <0835B3720019904CB8F7AA43166CEEB2EE77A2@RTITMBSV03.realtek.com.tw> In-Reply-To: <0835B3720019904CB8F7AA43166CEEB2EE77A2@RTITMBSV03.realtek.com.tw> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.71.143] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2454 Lines: 56 > David Miller [mailto:davem@davemloft.net] > > Sent: Sunday, January 25, 2015 2:44 PM > > What keeps rtl_start_rx() from running in parallel with > > r8152_submit_rx(), or any other accessor of the RX agg->list? > > Forgive my poor English. I would try to describe them clearly. > The steps about the rx agg->list would be > 1. carrier on or autoresume occurs. > 2. Call rtl_start_rx(). > 3. Rx agg->list flows between device and tp->rx_done. > 4. carrier off or autosuspend occurs. > 5. call rtl_stop_rx(). > > The rtl_start_rx() would only be called when the linking > status is changed from off to on or the auto resume occurs. > And rtl_start_rx() would reinitialize the tp->rx_done and > all of the rx agg->list. After step 2, the rx agg->list > would flow between the usb host controller and the driver. > If r8152_submit_rx() is success, the driver wouldn't own the > rx agg->list until it is returned from the usb host controller. > If r8152_submit_rx() is fail, the driver would still own the > rx agg->list, and queue it to the tp->rx_done with spin lock > for next try. > > If the status stays in step 3, only the rx_bottom() would submit > the rx agg. The rtl_start_rx() wouldn't be called suddenly, > unless the linking down or auto suspend occur first and linking > on or auto resume occur again. If linking down or auto suspend > occur, rtl_stop_rx() would be called (step 5). After this step, > rx_bottom() wouldn't submit rx, and all rx agg->list would stop > flowing. That is, the tp->rx_done and all rx agg->list wouldn't > be changed until the next rtl_start_rx() is called. > > Therefore, the flow for each rx agg->list would be > a. submittd by rtl_start_rx(). > b. goto step c if success, otherwise goto step d. > c. completed by usb host controller. > d. queued to tp->rx_done with spin lock. > e. dequeue from tp->rx_done with spin lock by rx_botoom(). > f. goto step i if link down, otherwise goto step g. > g. submitted by rx_botoom(). > h. goto step b. > i. goto step a if link on. > > And the patch change the step g to g1. > g1. submitted by rx_botoom() if (!ret), otherwise goto step d. Excuse me. Any other question or suggestion for this patch? Best Regards, Hayes -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/