From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Kleine-Budde Subject: Re: [PATCH net-next-2.6 v3] can: Topcliff: PCH_CAN driver: Add Flow control, Date: Thu, 25 Nov 2010 13:08:42 +0100 Message-ID: <4CEE51CA.8010402@pengutronix.de> References: <4CE2434B.5050701@dsn.okisemi.com> <4CE27796.2000206@pengutronix.de> <007401cb87b1$a773b3d0$66f8800a@maildom.okisemi.com> <4CE64167.2030405@pengutronix.de> <003201cb8a02$f05b15e0$66f8800a@maildom.okisemi.com> <4CEA2986.4080607@pengutronix.de> <000b01cb8b6b$d7542a90$66f8800a@maildom.okisemi.com> <4CED0650.7030004@pengutronix.de> <001b01cb8c98$d06aaa00$66f8800a@maildom.okisemi.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7968328211468646051==" Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, Samuel Ortiz , margie.foster-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, yong.y.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org, kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, joel.clark-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, qi.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, "David S. Miller" , Christian Pellegrin , Wolfgang Grandegger To: Tomoya MORINAGA Return-path: In-Reply-To: <001b01cb8c98$d06aaa00$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: socketcan-core-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org Errors-To: socketcan-core-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org List-Id: netdev.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============7968328211468646051== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigEF8E6FA0CEF6759DD0AFD3F9" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigEF8E6FA0CEF6759DD0AFD3F9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 11/25/2010 01:03 PM, Tomoya MORINAGA wrote: > On Wednesday, November 24, 2010 9:34 PM, Marc Kleine-Budde wrote : >> On 11/24/2010 01:09 AM, Tomoya MORINAGA wrote: >>> On Monday, November 22, 2010 5:27 PM, Marc Kleine-Budde wrote: >>>>>>>> Still we have the busy waiting in the TX path. Maybe you can mov= e the >>>>>>>> waiting before accessing the if[1] and remove the busy waiting h= ere. >>>>>>> I can't understand your saying. >>>>>>> For transmitting data, calling pch_can_rw_msg_obj is mandatory. >>>>>> Yes, but the busy wait is not needed. It should be enough to do th= e >>>>>> busy-waiting _before_ accessing the if[1]. >>>>> >>>>> Do you mean we should create other pch_can_rw_msg_obj which doesn't= have busy wait ? >>>> ACK, and this non busy waiting is use in the TX path. But you add a = busy >>>> wait only function before accessing the if[1] in the TX path. >>> >>> The "busy waiting" of pch_can_rw_msg_obj is for next processing acces= ses to Message object. >>> If deleting this busy waiting, next processing can access to Message = object, regardless previous transfer doesn't >>> complete yet. >>> Thus, I think, the "busy waiting" is necessary. >> >> Yes, it's necessary, but not where it is done currently. >> Let me outline how I think the TX path should look like: >> >> pch_xmit() { >> take_care_about_flow_control(); >> prepare_can_frame_to_be_copied_to_tx_if(); >> >> /* most likely we don't have to wait here */ >> wait_until_tx_if_is_ready(); >> >> copy_can_frame_to_tx_if(); >> >> /* trigger tx in hardware */ >> send_tx_if_but_dont_do_busywait(); >> >> /* tx_if is busy now, but before we access it, we'll check tx_if is re= ady */ >> } >=20 > This Tx path also has Read-Modify-Write for MessageRAM access. > Do you mean Tx path shouldn't have Read-Modify-Write ? Why do you Read-Modify-Write for TX? Naively speaking you just need to push your Data into a Mail/IF/Whatever and push the send button. Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | --------------enigEF8E6FA0CEF6759DD0AFD3F9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkzuUcoACgkQjTAFq1RaXHN0mwCfc6Ph3bRd0E90dVNVBtBc6Gy6 eo8AnAowXty9cxu9sYOX+D2I5Sjh9aC1 =Ur55 -----END PGP SIGNATURE----- --------------enigEF8E6FA0CEF6759DD0AFD3F9-- --===============7968328211468646051== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Socketcan-core mailing list Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org https://lists.berlios.de/mailman/listinfo/socketcan-core --===============7968328211468646051==--