From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: [RFC] usb: add usb_fill_iso_urb() From: Greg Kroah-Hartman Message-Id: <20180713072923.GA31191@kroah.com> Date: Fri, 13 Jul 2018 09:29:23 +0200 To: Sebastian Andrzej Siewior Cc: Alan Stern , Laurent Pinchart , linux-media@vger.kernel.org, Mauro Carvalho Chehab , linux-usb@vger.kernel.org, tglx@linutronix.de, Takashi Iwai List-ID: T24gRnJpLCBKdWwgMTMsIDIwMTggYXQgMTI6MzU6MjdBTSArMDIwMCwgU2ViYXN0aWFuIEFuZHJ6 ZWogU2lld2lvciB3cm90ZToKPiBQcm92aWRlIHVzYl9maWxsX2lzb191cmIoKSBmb3IgdGhlIGlu aXRpYWxpc2F0aW9uIG9mIGlzb2Nocm9ub3VzIFVSQnMuCj4gV2UgYWxyZWFkeSBoYXZlIG9uZSBv ZiB0aGlzIGhlbHBlcnMgZm9yIGNvbnRyb2wsIGJ1bGsgYW5kIGludGVycnVwdGlibGUKPiBVUkIg dHlwZXMuIFRoaXMgaGVscHMgdG8ga2VlcCB0aGUgaW5pdGlhbGlzYXRpb24gb2YgdGhlIFVSQiBt ZW1iZXJzIGluCj4gb25lIHBsYWNlLgo+IFVwZGF0ZSB0aGUgZG9jdW1lbnRhdGlvbiBieSBhZGRp bmcgdGhpcyB0byB0aGUgYXZhaWxhYmxlIGluaXQgZnVuY3Rpb25zCj4gYW5kIHJlbW92ZSB0aGUg c3VnZ2VzdGlvbiB0byB1c2UgdGhlIGBfaW50XycgaGVscGVyIHdoaWNoIG1pZ2h0IHByb3ZpZGUK PiB3cm9uZyBlbmNvZGluZyBmb3IgdGhlIGBpbnRlcnZhbCcgbWVtYmVyLgo+IAo+IFRoaXMgbG9v a3MgbGlrZSBpdCB3b3VsZCBjb3ZlciBtb3N0IHVzZXJzIG5pY2VseS4gVGhlIHNvdW5kIHN1YnN5 c3RlbQo+IGluaXRp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GhpbmdzIGhhdmUgY2hhbmdlZCBzaW5jZSB0aGVuIGFuZCBwZW9wbGUg ZG8gaXQgYWxsIG1vcmUgaW4gYSAic3RhbmRhcmQiCndheSBhbmQgd2UgY2FuIHRha2UgYWR2YW50 YWdlIG9mIHRoaXMuICBCdXQgaXQgd291bGQgYmUgbmljZSB0byBzZWUKcHJvb2YgaXQgY2FuIGJl IHVzZWQgYmVmb3JlIHRha2luZyB0aGlzIHBhdGNoLgoKdGhhbmtzLAoKZ3JlZyBrLWgKLS0tClRv IHVuc3Vic2NyaWJlIGZyb20gdGhpcyBsaXN0OiBzZW5kIHRoZSBsaW5lICJ1bnN1YnNjcmliZSBs aW51eC11c2IiIGluCnRoZSBib2R5IG9mIGEgbWVzc2FnZSB0byBtYWpvcmRvbW9Admdlci5rZXJu ZWwub3JnCk1vcmUgbWFqb3Jkb21vIGluZm8gYXQgIGh0dHA6Ly92Z2VyLmtlcm5lbC5vcmcvbWFq b3Jkb21vLWluZm8uaHRtbAo= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:44000 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726655AbeGMHmt (ORCPT ); Fri, 13 Jul 2018 03:42:49 -0400 Date: Fri, 13 Jul 2018 09:29:23 +0200 From: Greg Kroah-Hartman To: Sebastian Andrzej Siewior Cc: Alan Stern , Laurent Pinchart , linux-media@vger.kernel.org, Mauro Carvalho Chehab , linux-usb@vger.kernel.org, tglx@linutronix.de, Takashi Iwai Subject: Re: [PATCH RFC] usb: add usb_fill_iso_urb() Message-ID: <20180713072923.GA31191@kroah.com> References: <20180620164945.xb24m7wlbtb6cys5@linutronix.de> <20180712223527.5nmxndignujo7smt@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712223527.5nmxndignujo7smt@linutronix.de> Sender: linux-media-owner@vger.kernel.org List-ID: On Fri, Jul 13, 2018 at 12:35:27AM +0200, Sebastian Andrzej Siewior wrote: > Provide usb_fill_iso_urb() for the initialisation of isochronous URBs. > We already have one of this helpers for control, bulk and interruptible > URB types. This helps to keep the initialisation of the URB members in > one place. > Update the documentation by adding this to the available init functions > and remove the suggestion to use the `_int_' helper which might provide > wrong encoding for the `interval' member. > > This looks like it would cover most users nicely. The sound subsystem > initialises the ->iso_frame_desc[].offset + length member (often) at a > different location and I'm not sure ->interval will work always as > expected. So we might need to overwrite those two in worst case. > > Some users also initialise ->iso_frame_desc[].actual_length but I don't > this is required since it is the return value. > > Signed-off-by: Sebastian Andrzej Siewior > --- > Documentation/driver-api/usb/URB.rst | 12 +++---- > include/linux/usb.h | 53 ++++++++++++++++++++++++++++ > 2 files changed, 59 insertions(+), 6 deletions(-) Do you have a few example patches of using this new function? Many many years ago we tried to create this function, but we gave up as it just didn't seem to work for the majority of the users of ISO packets. Maybe things have changed since then and people do it all more in a "standard" way and we can take advantage of this. But it would be nice to see proof it can be used before taking this patch. thanks, greg k-h