Re: [linux-usb-devel] [Bugme-new] [Bug 8310] New: USB device names are not sanitized for UTF-8

2007-06-08 Thread Robert Marquardt
Alan Stern schrieb:

 The current Unicode usage in the kernel is not nearly as simple as you 
 seem to think.  It includes lots of local assumptions, features that 
 aren't documented or commented, special-purpose inline code, and so on.  
 Converting it all to use a single centralized library would be an 
 immense job.

It would benefit the kernel though. I see no reason not to do it just 
because it is a big job. At least the review where Unicode is handled in 
the kernel should be done. Otherwise no real assessment of the job to be 
done is possible.

 full handling of Unicode?  You must be kidding.  Do you have any idea 
 how difficult it is to do something as simple as converting between 
 lower- and uppercase?

If it is required somewhere in the kernel then it has to be implemented.
Yes, i know how hard it is. 100K of tables and 255K of source for a 
Pascal implementation i know. That includes a regular expression parser, 
but still it is a big chunk of source.
You may not ever see a file name in byzantine musical symbols, but there 
is no reason that a full implementation should not handle that. The 
trick is to find a way to reduce the size of the lib by selectively 
compiling out feature levels.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Printer Gadget / Device Class Driver

2007-06-08 Thread Greg KH
On Tue, Jun 05, 2007 at 08:49:54PM -0400, Craig W. Nadler wrote:
  The updated printer gadget driver is attached. The patch file is against 
  kernel version 2.6.21.3. Please see comments below.

Care to add a signed-off-by: so we can add it to the kernel tree?

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] reincarnation of /dev/ttyUSB0 as /dev/ttyUSB1

2007-06-08 Thread Greg KH
On Sun, Jun 03, 2007 at 07:01:33AM -0400, Uncle George wrote:
 Robert Hancock wrote:
 
   It's because you haven't done anything to handle the error which is 
 still persisting. Likely the only thing sane you can do in this case is 
 close the fd and try to reopen it later.
  
 This seems to be true, but not for what you might think.
 
 It appears that if u plug the USB/serial device back into the usb-hub, 
 the code creates a /dev/ttyUSB1 ( if you have not yet closed the 
 disconnected /dev/ttyUSB0. ) When you do close /dev/ttyUSB0, then the 
 device is erased from the /dev directory.
 
 Now /dev/ttyUSB1 is the device. And /dev/ttyUSB0 disappeared. This does 
 not seem proper. As now the program has no idea or capability to re-open 
 the GPS device.
 
 I have been informed that this was an approved kernel feature. Is this 
 suppose to happen? Or was it an unintended consequence?

The program knows that the tty device went away as it got the hangup
signal when it happened.  So it can let go of the device node at that
time so that when it comes back it will come back in the same name if
you really want it to.

But in reality, use HAL to enumerate the usb-serial devices to make sure
you know what is present.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [RFC] URBs and buffer management

2007-06-08 Thread Greg KH
On Tue, Jun 05, 2007 at 02:43:55PM +0200, Marcel Holtmann wrote:
 Hi Oliver,
 
 an alternate way would be to extend the usb_kill_anchored_urbs() with
 its own complete handler that gets called for every anchored URB. This
 would make it possible to cleanup the allocated buffers. I attached a
 patch for that, too.

No, that would mean an URB could have both its original and the 
additional
handler or only the additional handler called. That's increasing 
complexity,
not lowering it.
   
   depends on how you use it. I would only use the original complete
   handler to do the re-submission of the URB and the additional handler to
   free the allocated buffers. For that use case it works perfectly fine.
   
   To avoid confusion we could rename it to usb_release_t or something
   similar.
  
  One usage is a bit weak to add common code.
 
 this is why I wanna have a general solution for one-shot buffers.
 
It seems to me that freeing buffers in usbcore is the logical conclusion
of the pattern used in usb-skeleton. It may be used to avoid calling a
completion handler at all.
   
   I agree that it is the cleanest to free the buffers when URB is no
   longer in use. Normally that means that any allocated buffer for this
   URB is also not needed anymore.
   
   Actually I am happy with any solution that frees the driver from having
   to track the buffers for incoming endpoints used by an URB.
  
  I am fine with your original patch. Perhaps you should resend it.
 
 Greg, did you see that patch? Do you have any comments on it? If the
 solution is acceptable, I can complete the patch with the missing
 helpers and officially submit it.

Sorry, I missed it.  Care to CC: me on it?

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] USB: m66592-udc: peripheral controller driver for M66592

2007-06-08 Thread David Brownell
On Wednesday 09 May 2007, Yoshihiro Shimoda wrote:
 
 I would like to submit Renesas M66592 udc driver.
 
 The M66592 is Renesas USB 2.0 peripheral controller.
 This controller supports USB high-speed.

I always like to see more high speed controller drivers
work with Linux.  And vendors supporting Linux by
providing drivers for their hardware ... :)


Thanks ... I'm still looking at this.  Here's some quick feedback:

Overall it looks pretty clean.  There are some whitespace
bugs (indents should ONLY be tabs etc) but mostly it doesn't
look bad.

It looks a bit light on comments ... like, there really
aren't any.  In over 40 KBytes of code, I'm sure there
is at least one puzzling thing that will need comments
so that someone else can make sense of it... I did find
one comment though, which is completely unrelated to
what the code does:

 /* if complete is true, gadget driver complete function is not call */
 static void control_end(struct m66592 *m66592, unsigned ccpl)
 {
 m66592-ep[0].internal_ccpl = ccpl;
 pipe_start(m66592, 0);
 m66592_bset(m66592, M66592_CCPL, M66592_DCPCTR);
 }

Problem is, there is no complete flag, and nothing there
ever calls the complete() routine anyway.  I happened on
that call when wondering how some SET_FEATURE requests were
handled ... they seem to be dropped on the floor.


The alloc_buffer()/free_buffer() is wrong; it should be
returning dma-coherent memory.  But almost nobody seems
to get that right, and I'm thinking of just ripping those
calls out of the programming interface ... so for now I
won't worry about that.

It's OK not to have an unbind() method ... but it's not
OK to unregister a gadget driver without one.

Those suspend/resume methods are pointless -- remove them.
(The state they change is going to be removed soon.)

You should be able to report bus-powered status, so that
for example a device can consume power from USB (maybe to
recharge its battery or something).

 
 The driver has been tested Gadget Zero, Ethernet Gadget,
 File-backed Storage Gadget, and passed usbtest script.

And I imagine it took a bit of effort to get that working... :)


But not, I'm assuming, the highspeed electrical tests since
it doesn't support the relevant high speed test modes.
(Unless hardware automagic intercepts them?)

Or USBCV, since I don't think I noticed support for remote
wakeup, and I know that USBCV will test that ... you seem
to stall every attempt to set the remote wakeup feature,
and certainly can't report whether it's been set.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [patch 08/32] driver-core: dont free devt_attr till the device is released

2007-06-08 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
-

From: Tejun Heo [EMAIL PROTECTED]

Currently, devt_attr for the dev file is freed immediately on device
removal, but if the dev sysfs file is open when a device is removed,
sysfs will access its attribute structure for further access including
close resulting in jumping to garbled address.  Fix it by postponing
freeing devt_attr to device release time.

Note that devt_attr for class_device is already freed on release.

This bug is reported by Chris Rankin as bugzilla bug#8198.

Signed-off-by: Tejun Heo [EMAIL PROTECTED]
Cc: Chris Rankin [EMAIL PROTECTED]
Signed-off-by: Chris Wright [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
Applies well to 2.6.20 and 21.  As sysfs-immediate-disconnect doesn't
seem to be included in 2.6.22, this should be included in linus#master
too (applies well there as well).

 drivers/base/core.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- linux-2.6.20.13.orig/drivers/base/core.c
+++ linux-2.6.20.13/drivers/base/core.c
@@ -93,6 +93,9 @@ static void device_release(struct kobjec
 {
struct device * dev = to_dev(kobj);
 
+   kfree(dev-devt_attr);
+   dev-devt_attr = NULL;
+
if (dev-release)
dev-release(dev);
else if (dev-class  dev-class-dev_release)
@@ -650,10 +653,8 @@ void device_del(struct device * dev)
 
if (parent)
klist_del(dev-knode_parent);
-   if (dev-devt_attr) {
+   if (dev-devt_attr)
device_remove_file(dev, dev-devt_attr);
-   kfree(dev-devt_attr);
-   }
if (dev-class) {
sysfs_remove_link(dev-kobj, subsystem);
/* If this is not a fake compatible device, remove the

-- 

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] USB low-speed bulk transfers

2007-06-08 Thread Steinar H. Gunderson
On Thu, Jun 07, 2007 at 01:04:12PM -0400, Alan Stern wrote:
 Probably because you're not using UHCI.  The real question is, does it 
 work _with_ the patch?

I've tested the following patch combination:

  1. Your bulk - interrupt at low speed kludge.
  2. The usbmidi patch to enable interrupt transfers.
  3. A micro-patch to let usbmidi initialize low-speed USB devices.

I've only been testing it lightly, but as far as I can tell, both input and
output work well.

/* Steinar */
-- 
Homepage: http://www.sesse.net/

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] USB low-speed bulk transfers

2007-06-08 Thread Alan Stern
On Fri, 8 Jun 2007, Steinar H. Gunderson wrote:

 On Thu, Jun 07, 2007 at 01:04:12PM -0400, Alan Stern wrote:
  Probably because you're not using UHCI.  The real question is, does it 
  work _with_ the patch?
 
 I've tested the following patch combination:
 
   1. Your bulk - interrupt at low speed kludge.
   2. The usbmidi patch to enable interrupt transfers.
   3. A micro-patch to let usbmidi initialize low-speed USB devices.
 
 I've only been testing it lightly, but as far as I can tell, both input and
 output work well.

Okay, thanks.  I'll submit the bulk - interrupt patch for inclusion in 
the kernel.

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] 〜自宅から【安 定収入】を築く 〜6月期 募集要項〜

2007-06-08 Thread 在宅開業
独占広告―


   〜自宅から収入基盤を構築したい方を募集します〜

(2007年6月  45名 募集)



募集要項はこちらをご覧下さい。
    http://www.j-netshop.com/speed-4.html




   ≪募集概要≫
   今までこんな方々が参加されて収入を得られています


     ■サラリーマンを生涯続ける事に不安を感じている方、
  また、不満を感じている方。
  
    ■努力が自分の為に報われる仕事を探している

    ■子育てや家事をしながら空いた時間を利用して収入を得たい

    ■夢を現実に、不安を安定に等、向上心のある方




    ※未成年・学生は不可
 (今年の新卒者は資料請求までで卒業してからスタート)

    ※インターネット・メール レベルのパソコンスキル必須

    ※始める際は、インターネットが出来る環境と、電話は必要です。





特別な能力や資格は必要ありません。【希望者研修制度有】
  
まじめで真剣な方を募集しております。
   http://www.j-netshop.com/speed-4.html



随時説明会も開催しております。
参加希望の方は、お問い合わせフォームの、問い合わせ欄に、
お住まいの地域をお書きの上、資料請求願います。
一番近い会場とスケジュールをご案内いたします。

※3月〜5月期は新卒者多数応募の為、選考から漏れた方は、
 今回6月期は、早めに応募下さい。
 通常より多目の募集とさせていただきます。


---マガジン解除---

■メールマガジンの購読、解除について当メールマガジンは一括投稿サイ
  トへ投稿された方、無料投稿された方に配信させていただいております。
  投稿または登録した覚えのない方は、お手数ですが下記のURLよりお願い
  します。解除につきましては、2日から3日程お時間を頂くこともござ
  いますのでご了承ください。

  解除URL:http://formlan.com/form2/aoyama3/

■免責事項とお願いお客様ご依頼のPR本文中に含まれるHP情報等は、
   確認の上掲載しておりますが、トラブルが発生した場合、当方では一切の
   責任は負いかねます。PR投稿本文やHPリンクの内容等についてのクレ
   ーム、損害等は当方では一切受け付けておりません。 
★━━★

─PR─ 
┃オ┃ス┃ス┃メ┃ 急な出費に素早く対応! 三菱東京UFJ銀行系 モビット
┗━┗━┗━┗━┻━━

   §ネットで24時間申込可能!コールセンター24時間対応だから安心§
   ───

…┏━┓┏━━┓  ◆ご融資は1万円から最高300万円まで
…┗┓┃┃┏┓┃  ◆年利15.0-18.0%
……┃┃  ◆三菱東京UFJ銀行系だから安心
……┃┃┃┗┛┃
……┗┛┗━━┛秒で審査結果表示 『その場』でわかる!

 ↓お申込はコチラ↓[入会金・年会費・ATM手数料無料]
 http://px.a8.net/svt/ejp?a8mat=6M66T+F467OY+1I6+626XV

   *** いつでもどこでもキャッシング&ご返済 ***

   お近くの銀行、コンビニなど全国68,000台の提携ATMでご利用可能
※三菱東京UFJ銀行、プロミス、セブンイレブン(セブン銀行)、
 その他の都市銀行、地方銀行、コンビニでも利用できるから便利!
───

 

★━━★
このご案内は、提携マガジン一般広告購読希望者様とDigital-j.netにご参加
頂いている方に送信させて頂いております。 

発行元  :【K-NET】
 
E-Mail: [EMAIL PROTECTED]


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] 2.6.22-rc4-mm1

2007-06-08 Thread Alan Stern
On Thu, 7 Jun 2007, Greg KH wrote:

 On Thu, Jun 07, 2007 at 10:53:29AM -0400, Alan Stern wrote:
  To tell you the truth, I rather think there's not much point in keeping
  usb-try-to-debug-bug-8561.patch around.  Anything seriously wrong that
  it could catch ought to have shown up long ago.  And it is now clear
  that bug 8561 has nothing to do with this; it is a programming error
  common to many of the USB serial drivers.  (Still waiting to hear back 
  from Paulo Pereira whether the fix to the USB Option driver works...)
 
 What error in the usb-serial drivers are you speaking about?

The one addressed by usb-option-fix-usage-of-urb-status-abuse.patch.  I 
thought it might be worthwhile to spend some time fixing all of these.
Here's a quick summary showing the extent of the problem (note that 
not all the usages are in error):

$ grep EINPROGRESS drivers/usb/serial/*.c drivers/usb/misc/*.c
drivers/usb/serial/digi_acceleport.c:*   return 256 when -EINPROGRESS is 
set, as the line discipline
drivers/usb/serial/digi_acceleport.c:   while( 
oob_port-write_urb-status == -EINPROGRESS
drivers/usb/serial/digi_acceleport.c:   while( (port-write_urb-status 
== -EINPROGRESS
drivers/usb/serial/digi_acceleport.c:   while( oob_port-write_urb-status == 
-EINPROGRESS
drivers/usb/serial/digi_acceleport.c:   if( port-write_urb-status == 
-EINPROGRESS
drivers/usb/serial/digi_acceleport.c:   if( port-open_count  
port-write_urb-status != -EINPROGRESS
drivers/usb/serial/digi_acceleport.c:   if( port-write_urb-status == 
-EINPROGRESS
drivers/usb/serial/digi_acceleport.c:   if( port-write_urb-status == 
-EINPROGRESS
drivers/usb/serial/empeg.c: if (write_urb_pool[i]-status 
!= -EINPROGRESS) {
drivers/usb/serial/empeg.c: if (write_urb_pool[i]-status != 
-EINPROGRESS) {
drivers/usb/serial/empeg.c: if (write_urb_pool[i]-status == 
-EINPROGRESS) {
drivers/usb/serial/keyspan.c:   if (this_urb-status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c:   } while (urb-status != -EINPROGRESS);
drivers/usb/serial/keyspan.c:   if (this_urb-status != -EINPROGRESS)
drivers/usb/serial/keyspan.c:   if (this_urb-status != 
-EINPROGRESS)
drivers/usb/serial/keyspan.c:   if (urb  urb-status == -EINPROGRESS)
drivers/usb/serial/keyspan.c:   /*while (p_priv-outcont_urb-status == 
-EINPROGRESS) {
drivers/usb/serial/keyspan.c:   if (this_urb-status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c:   if (this_urb-status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c:   if (this_urb-status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c:   if (this_urb-status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c:   if (this_urb-status == -EINPROGRESS) {
drivers/usb/serial/keyspan_pda.c: *   urb status is -EINPROGRESS, meaning 
it cannot write at the moment
drivers/usb/serial/keyspan_pda.c:  again (the only sudden transition 
was the one from EINPROGRESS to
drivers/usb/serial/kl5kusb105.c:if 
(priv-write_urb_pool[i]-status != -EINPROGRESS) {
drivers/usb/serial/kl5kusb105.c:if 
(priv-write_urb_pool[i]-status == -EINPROGRESS) {
drivers/usb/serial/kl5kusb105.c:if 
(priv-write_urb_pool[i]-status != -EINPROGRESS) {
drivers/usb/serial/mos7720.c:   if (port-read_urb-status != -EINPROGRESS) {
drivers/usb/serial/mos7720.c:   if (mos7720_port-write_urb_pool[i]  
mos7720_port-write_urb_pool[i]-status == -EINPROGRESS)
drivers/usb/serial/mos7720.c:   if (mos7720_port-write_urb_pool[i]  
mos7720_port-write_urb_pool[i]-status != -EINPROGRESS)
drivers/usb/serial/mos7720.c:   if (mos7720_port-write_urb_pool[i]  
mos7720_port-write_urb_pool[i]-status != -EINPROGRESS) {
drivers/usb/serial/mos7720.c:   if (port-read_urb-status != -EINPROGRESS) {
drivers/usb/serial/mos7720.c:   if(port-read_urb-status != -EINPROGRESS) {
drivers/usb/serial/mos7840.c:   if (mos7840_port-read_urb-status != 
-EINPROGRESS) {
drivers/usb/serial/mos7840.c:   if (mos7840_port-read_urb-status != 
-EINPROGRESS) {
drivers/usb/serial/sierra.c:if (this_urb-status == -EINPROGRESS) {
drivers/usb/serial/sierra.c:if (this_urb  this_urb-status != 
-EINPROGRESS)
drivers/usb/serial/sierra.c:if (this_urb  this_urb-status == 
-EINPROGRESS)
drivers/usb/misc/adutux.c:  if 
(dev-interrupt_in_urb-status == -EINPROGRESS) {
drivers/usb/misc/adutux.c:  if (should_submit  
!dev-interrupt_in_urb-status==-EINPROGRESS) {
drivers/usb/misc/adutux.c:  if (dev-interrupt_out_urb-status == 
-EINPROGRESS) {
drivers/usb/misc/auerswald.c:urb-status= -EINPROGRESS;/* 
usb_submit_urb does this, too */
drivers/usb/misc/auerswald.c:   the result is 0 if the urb is cancelled, or 
-EINPROGRESS if
drivers/usb/misc/auerswald.c:   if (urb-status != -EINPROGRESS) {  
/* No callback?!! */
drivers/usb/misc/auerswald.c:-EINPROGRESS   during submission until 

[linux-usb-devel] Pending patches

2007-06-08 Thread Alan Stern
Greg:

Thanks for merging all those patches yesterday.  In fact you 
anticipated me on that usb-option-fix-usage-of-urb-status-abuse thing; 
I was waiting to get feedback from the OP before submitting it 
officially!

There is one patch outstanding: USB: Fix up bogus bInterval values in
endpoint descriptors (as904).

http://marc.info/?l=linux-usb-develm=117881905102712w=2

Is it still in your queue?

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [Bugme-new] [Bug 8310] New: USB device names are not sanitized for UTF-8

2007-06-08 Thread Alan Stern
On Fri, 8 Jun 2007, Nicolas Mailhot wrote:

 Le mardi 05 juin 2007 à 17:00 -0400, Alan Stern a écrit :
 
  Here's a patch.  Anybody see anything wrong with it?  I don't have any 
  devices with non-ASCII characters in the default language descriptors 
  for testing.  It would be nice if there was a library in the kernel to 
  do these sorts of conversions, but there doesn't appear to be.
  
  Nicolas, does it make your life any easier?
 
 The patch seems to work with my devices, but they only use one character
 outside ascii-7 (®), so it's a very limited test.

It's better than nothing.  Thank you.

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [Bugme-new] [Bug 8310] New: USB device names are not sanitized for UTF-8

2007-06-08 Thread Alan Stern
On Fri, 8 Jun 2007, Robert Marquardt wrote:

 Alan Stern schrieb:
 
  The current Unicode usage in the kernel is not nearly as simple as you 
  seem to think.  It includes lots of local assumptions, features that 
  aren't documented or commented, special-purpose inline code, and so on.  
  Converting it all to use a single centralized library would be an 
  immense job.
 
 It would benefit the kernel though. I see no reason not to do it just 
 because it is a big job. At least the review where Unicode is handled in 
 the kernel should be done. Otherwise no real assessment of the job to be 
 done is possible.

I have already done the review; how else could I have justified the
comments above?

  full handling of Unicode?  You must be kidding.  Do you have any idea 
  how difficult it is to do something as simple as converting between 
  lower- and uppercase?
 
 If it is required somewhere in the kernel then it has to be implemented.
 Yes, i know how hard it is. 100K of tables and 255K of source for a 
 Pascal implementation i know. That includes a regular expression parser, 
 but still it is a big chunk of source.
 You may not ever see a file name in byzantine musical symbols, but there 
 is no reason that a full implementation should not handle that. The 
 trick is to find a way to reduce the size of the lib by selectively 
 compiling out feature levels.

Well, I don't know whether case conversion of Unicode or UTF-8 strings
is needed anywhere in the kernel.  I don't propose to add routines to
handle it in the upcoming library.  If you want to add them, you are
welcome to do so -- assuming you can avoid provoking loud screams of
outrage from people who don't like the idea of adding 355K for a
relatively minor job.

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] ThinkPad T41 - Strange USB 2.0 behaviour

2007-06-08 Thread Alan Stern
On Fri, 8 Jun 2007, Jiri Kosina wrote:

 linux-usb-devel list added
 
 On Fri, 8 Jun 2007, Robert de Rooy wrote:
 
  Jiri Kosina wrote:
   On Thu, 7 Jun 2007, Robert de Rooy wrote:
  
 
Yes I figured it was a hardware problem, but that was not really the 
point
I was trying to raise ;). I would like, if possible for Linux to
automatically fallback to USB 1.1 like Windows does (preferably with a
suitable warning).

  
   What do you propose as a trigger for the kernel to fallback?
  
   You can work it around manually, just don't use ehci-hcd, can't you?
  
 
  Yes I can unload ehci-hcd, but I have one USB 2.0 device that strangely 
  enough
  DOES work as such, and unloading ehci-hcd will cause that also to run at 1.1
  speed.
  
  Clearly something is failing when plugging a device with ehci-hcd loaded, 
  the
  driver seems to keep retrying indefinitely. Instead it would be nice if 
  after
  a few tries it hands the device over to uhci-hcd. This seems to be the
  behaviour under Windows, so I was wondering if Linux could be made to do
  something similar.

Robert, it would help somewhat if you could build a kernel with 
CONFIG_USB_DEBUG turned on and post the dmesg log showing what happens 
when you plug in one of those non-working devices.

Yes, in principle Linux can be made to switch over to full speed when 
high speed fails.  But there are limitations: The switchover would work 
only for devices plugged directly into the computer, not for devices 
plugged into a high-speed hub.  And some Linux systems (not regular 
PCs) have EHCI implementations that don't allow such a switch -- or 
if they do, I'm not aware of how to accomplish it.

BTW, depending on the kind of failure the system does not keep 
retrying indefinitely.  It gives up after four attempts.

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Printer Gadget / 'Device Class' Driver

2007-06-08 Thread Craig Nadler
 On Tue, Jun 05, 2007 at 08:49:54PM -0400, Craig W. Nadler wrote:
  The updated printer gadget driver is attached. The patch file is
 against
  kernel version 2.6.21.3. Please see comments below.

 Care to add a signed-off-by: so we can add it to the kernel tree?

 thanks,

 greg k-h


Signed-off-by: Craig W. Nadler [EMAIL PROTECTED]

Best Regards,

Craig Nadler

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Printer Gadget / 'Device Class' Driver

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 12:19:43PM -0400, Craig Nadler wrote:
  On Tue, Jun 05, 2007 at 08:49:54PM -0400, Craig W. Nadler wrote:
   The updated printer gadget driver is attached. The patch file is
  against
   kernel version 2.6.21.3. Please see comments below.
 
  Care to add a signed-off-by: so we can add it to the kernel tree?
 
  thanks,
 
  greg k-h
 
 
 Signed-off-by: Craig W. Nadler [EMAIL PROTECTED]

Hm, no, I need the whole patch, with a good description of what it is
and does, and your signed-off-by, together, in order to be able to apply
it to the tree.

Take a look at Documentation/SubmittingPatches for more details.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] blank filenames in /sys/modules, kernel 2.6.21

2007-06-08 Thread Chuck Ebbert
We just found a file with this name in 2.6.21:

Directory name: /sys/module/nousb/parameters
File name:  

IOW the file has an empty name. Is this intentional?
It sure confuses updatedb...

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242715

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] blank filenames in /sys/modules, kernel 2.6.21

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 02:00:37PM -0400, Chuck Ebbert wrote:
 We just found a file with this name in 2.6.21:
 
 Directory name: /sys/module/nousb/parameters
 File name:  

Hm, something went wrong there, 'nousb' should not be a module.

Do you have the usbcore built into the kernel, or as a module?

 IOW the file has an empty name. Is this intentional?
 It sure confuses updatedb...
 
 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242715

I don't see the empty directory here:
/sys/module/nousb/parameters $ ls -la
total 0
drwxr-xr-x 2 root root0 Jun  8 11:04 .
drwxr-xr-x 3 root root0 Jun  4 16:59 ..
-r--r--r-- 1 root root 4096 Jun  8 11:04 usbcore.autosuspend

Care to send me a .config?

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] blank filenames in /sys/modules, kernel 2.6.21

2007-06-08 Thread Robert P. J. Day
On Fri, 8 Jun 2007, Chuck Ebbert wrote:

 We just found a file with this name in 2.6.21:

 Directory name: /sys/module/nousb/parameters
 File name:  

 IOW the file has an empty name. Is this intentional?
 It sure confuses updatedb...

 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242715

that appears to be the result of:

$ grep -r __module_param_call *
drivers/usb/core/usb.c:__module_param_call(, nousb, param_set_bool, 
param_get_bool, nousb, 0444);
include/linux/moduleparam.h:#define __module_param_call(prefix, name, set, get, 
arg, perm)  \
include/linux/moduleparam.h:__module_param_call(MODULE_PARAM_PREFIX, name, 
set, get, arg, perm)

  and from drivers/usb/core/usb.c:

/* format to disable USB on kernel command line is: nousb */
__module_param_call(, nousb, param_set_bool, param_get_bool, nousb, 0444);

  one has to wonder about the value of a macro that is invoked only
once throughout the entire tree.

rday
-- 

Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] blank filenames in /sys/modules, kernel 2.6.21

2007-06-08 Thread Pete Zaitcev
On Fri, 8 Jun 2007 11:32:32 -0700, Greg KH [EMAIL PROTECTED] wrote:

and from drivers/usb/core/usb.c:
  
  /* format to disable USB on kernel command line is: nousb */
  __module_param_call(, nousb, param_set_bool, param_get_bool, nousb, 
  0444);

 Pete added that back in December of 2005 (git-blame rocks...).  So what
 has changed recently to cause this to do different things in sysfs?
 
 Robert, what do you suggest we change this usage to look like?

Aww. I thought it was a nice patch, but my foresight was inadequate.

The problem I tried to fix was related to strncmp used in the code which
supported __setup(). Our installer, Anaconda, recognizes both nousb and
nousbstorage - in theory. In practice, passing nousbstorage switched
USB completely off because of improper strncmp(). If we back out my patch,
this problem is going to reoccur.

We might want to ask Jeremy Katz if nousbstorage is even used anymore,
then revert all this if not. Or, we can add a name somehow and live
with it visible in sysfs...

-- Pete

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Pending patches

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 10:37:28AM -0400, Alan Stern wrote:
 Greg:
 
 Thanks for merging all those patches yesterday.  In fact you 
 anticipated me on that usb-option-fix-usage-of-urb-status-abuse thing; 
 I was waiting to get feedback from the OP before submitting it 
 officially!
 
 There is one patch outstanding: USB: Fix up bogus bInterval values in
 endpoint descriptors (as904).
 
   http://marc.info/?l=linux-usb-develm=117881905102712w=2
 
 Is it still in your queue?

Hm, no, did you send it to me?

Actually, my queue is now empty of _all_ usb, pci, -stable, driver core,
and any other type of patches, so if you have sent me something and not
gotten a response back from me, please resend it.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] blank filenames in /sys/modules, kernel 2.6.21

2007-06-08 Thread Robert P. J. Day
On Fri, 8 Jun 2007, Pete Zaitcev wrote:

 On Fri, 8 Jun 2007 11:32:32 -0700, Greg KH [EMAIL PROTECTED] wrote:

 and from drivers/usb/core/usb.c:
  
   /* format to disable USB on kernel command line is: nousb */
   __module_param_call(, nousb, param_set_bool, param_get_bool, nousb, 
   0444);

  Pete added that back in December of 2005 (git-blame rocks...).  So what
  has changed recently to cause this to do different things in sysfs?
 
  Robert, what do you suggest we change this usage to look like?

 Aww. I thought it was a nice patch, but my foresight was inadequate.

 The problem I tried to fix was related to strncmp used in the code which
 supported __setup(). Our installer, Anaconda, recognizes both nousb and
 nousbstorage - in theory. In practice, passing nousbstorage switched
 USB completely off because of improper strncmp(). If we back out my patch,
 this problem is going to reoccur.

 We might want to ask Jeremy Katz if nousbstorage is even used anymore,
 then revert all this if not. Or, we can add a name somehow and live
 with it visible in sysfs...

there appears to be no reference to nousbstorage anywhere in the
tree.  go for it.

rday
-- 

Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] blank filenames in /sys/modules, kernel 2.6.21

2007-06-08 Thread Robert P. J. Day
On Fri, 8 Jun 2007, Greg KH wrote:

 On Fri, Jun 08, 2007 at 02:05:22PM -0400, Robert P. J. Day wrote:
  On Fri, 8 Jun 2007, Chuck Ebbert wrote:
 
   We just found a file with this name in 2.6.21:
  
   Directory name: /sys/module/nousb/parameters
   File name:  
  
   IOW the file has an empty name. Is this intentional?
   It sure confuses updatedb...
  
   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242715
 
  that appears to be the result of:
 
  $ grep -r __module_param_call *
  drivers/usb/core/usb.c:__module_param_call(, nousb, param_set_bool, 
  param_get_bool, nousb, 0444);
  include/linux/moduleparam.h:#define __module_param_call(prefix, name, set, 
  get, arg, perm)  \
  include/linux/moduleparam.h:__module_param_call(MODULE_PARAM_PREFIX, 
  name, set, get, arg, perm)
 
and from drivers/usb/core/usb.c:
 
  /* format to disable USB on kernel command line is: nousb */
  __module_param_call(, nousb, param_set_bool, param_get_bool, nousb, 
  0444);
 
one has to wonder about the value of a macro that is invoked only
  once throughout the entire tree.

 Pete added that back in December of 2005 (git-blame rocks...).  So what
 has changed recently to cause this to do different things in sysfs?

 Robert, what do you suggest we change this usage to look like?

um ... i'm fairly sure i'm totally the wrong person to be asked about
this, but what does any of the above have to do with disabling USB on
the kernel command line?  wouldn't you typically define a kernel
command line option with something like:
...
arch/i386/kernel/traps.c:__setup(kstack=, kstack_setup);
arch/i386/kernel/traps.c:__setup(code_bytes=, code_bytes_setup);
arch/i386/kernel/nmi.c:__setup(nmi_watchdog=, setup_nmi_watchdog);
arch/i386/kernel/reboot.c:__setup(reboot=, reboot_setup);
arch/i386/kernel/tsc.c:__setup(notsc, tsc_setup);
...

you know -- that sort of thing.  i mean, that's where *i'd* introduce
a nousb option.

rday
-- 

Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] blank filenames in /sys/modules, kernel 2.6.21

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 02:05:22PM -0400, Robert P. J. Day wrote:
 On Fri, 8 Jun 2007, Chuck Ebbert wrote:
 
  We just found a file with this name in 2.6.21:
 
  Directory name: /sys/module/nousb/parameters
  File name:  
 
  IOW the file has an empty name. Is this intentional?
  It sure confuses updatedb...
 
  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242715
 
 that appears to be the result of:
 
 $ grep -r __module_param_call *
 drivers/usb/core/usb.c:__module_param_call(, nousb, param_set_bool, 
 param_get_bool, nousb, 0444);
 include/linux/moduleparam.h:#define __module_param_call(prefix, name, set, 
 get, arg, perm)  \
 include/linux/moduleparam.h:__module_param_call(MODULE_PARAM_PREFIX, 
 name, set, get, arg, perm)
 
   and from drivers/usb/core/usb.c:
 
 /* format to disable USB on kernel command line is: nousb */
 __module_param_call(, nousb, param_set_bool, param_get_bool, nousb, 0444);
 
   one has to wonder about the value of a macro that is invoked only
 once throughout the entire tree.

Pete added that back in December of 2005 (git-blame rocks...).  So what
has changed recently to cause this to do different things in sysfs?

Robert, what do you suggest we change this usage to look like?

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] 2.6.22-rc4-mm1

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 10:06:21AM -0400, Alan Stern wrote:
 On Thu, 7 Jun 2007, Greg KH wrote:
 
  On Thu, Jun 07, 2007 at 10:53:29AM -0400, Alan Stern wrote:
   To tell you the truth, I rather think there's not much point in keeping
   usb-try-to-debug-bug-8561.patch around.  Anything seriously wrong that
   it could catch ought to have shown up long ago.  And it is now clear
   that bug 8561 has nothing to do with this; it is a programming error
   common to many of the USB serial drivers.  (Still waiting to hear back 
   from Paulo Pereira whether the fix to the USB Option driver works...)
  
  What error in the usb-serial drivers are you speaking about?
 
 The one addressed by usb-option-fix-usage-of-urb-status-abuse.patch.  I 
 thought it might be worthwhile to spend some time fixing all of these.
 Here's a quick summary showing the extent of the problem (note that 
 not all the usages are in error):

Ah, yeah, I cleaned up a lot of them a while ago, but they keep creaping
back.

I _really_ think we need to just get rid of that field and pass the
status in the urb callback.  That would fix this problem once and for
all.

But, from what I remember, the uhci host controller didn't make it easy
for me to acomplish this.  Or it might have been another host
controller, can't remember anymore...

So, anyone looking to make up some patches that touch every USB driver
in the tree?  I'd be glad to take them :)

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] USB: Fix up bogus bInterval values in endpoint descriptors

2007-06-08 Thread Alan Stern
This patch (as904) adds code to check for endpoint descriptor bInterval
values outside the legal limits.  Illegal values are set to 32 ms, which
seems like a reasonable default.

This fixes Bugzilla #8432.

Signed-off-by: Alan Stern [EMAIL PROTECTED]

---

Index: usb-2.6/drivers/usb/core/config.c
===
--- usb-2.6.orig/drivers/usb/core/config.c
+++ usb-2.6/drivers/usb/core/config.c
@@ -1,4 +1,5 @@
 #include linux/usb.h
+#include linux/usb/ch9.h
 #include linux/module.h
 #include linux/init.h
 #include linux/slab.h
@@ -49,7 +50,7 @@ static int usb_parse_endpoint(struct dev
unsigned char *buffer0 = buffer;
struct usb_endpoint_descriptor *d;
struct usb_host_endpoint *endpoint;
-   int n, i;
+   int n, i, j;
 
d = (struct usb_endpoint_descriptor *) buffer;
buffer += d-bLength;
@@ -84,6 +85,45 @@ static int usb_parse_endpoint(struct dev
memcpy(endpoint-desc, d, n);
INIT_LIST_HEAD(endpoint-urb_list);
 
+   /* If the bInterval value is outside the legal range,
+* set it to a default value: 32 ms */
+   i = 0;  /* i = min, j = max, n = default */
+   j = 255;
+   if (usb_endpoint_xfer_int(d)) {
+   i = 1;
+   switch (to_usb_device(ddev)-speed) {
+   case USB_SPEED_HIGH:
+   n = 9;  /* 32 ms = 2^(9-1) uframes */
+   j = 16;
+   break;
+   default:/* USB_SPEED_FULL or _LOW */
+   /* For low-speed, 10 ms is the official minimum.
+* But some overclocked devices might want faster
+* polling so we'll allow it. */
+   n = 32;
+   break;
+   }
+   } else if (usb_endpoint_xfer_isoc(d)) {
+   i = 1;
+   j = 16;
+   switch (to_usb_device(ddev)-speed) {
+   case USB_SPEED_HIGH:
+   n = 9;  /* 32 ms = 2^(9-1) uframes */
+   break;
+   default:/* USB_SPEED_FULL */
+   n = 6;  /* 32 ms = 2^(6-1) frames */
+   break;
+   }
+   }
+   if (d-bInterval  i || d-bInterval  j) {
+   dev_warn(ddev, config %d interface %d altsetting %d 
+   endpoint 0x%X has an invalid bInterval %d, 
+   changing to %d\n,
+   cfgno, inum, asnum,
+   d-bEndpointAddress, d-bInterval, n);
+   endpoint-desc.bInterval = n;
+   }
+
/* Skip over any Class Specific or Vendor Specific descriptors;
 * find the next endpoint or interface descriptor */
endpoint-extra = buffer;


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] usb: free DMA if enqueue fails

2007-06-08 Thread Pete Zaitcev
On Fri, 8 Jun 2007 11:58:47 -0700, Greg KH [EMAIL PROTECTED] wrote:

 Care to resend this with the needed signed-off-by and good changelog
 entry?

What was wrong with Release DMA resources if submission fails in
the HCD.? Maybe you want me to elaborate on the condition under which
it can fail? The patch was completely compliant with the format,
as much as I can see. All the discussion was below the tripple dash.

-- Pete

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH 2.6.21.4 1/1] ehci-hub: improved over-current recovery

2007-06-08 Thread Christian Engelmayer
From: Christian Engelmayer [EMAIL PROTECTED]

According to the USB Specification Revision 2.0 chapter 11.12.5
a hub experiencing an over-current condition must place all
affected ports in the powered-off state. It seems that some root
hubs need port power to be cycled by software in order to get back
to normal functionality after an over-current condition ... like
the EHCI implementation on an MPC8343E.

Signed-off-by: Christian Engelmayer [EMAIL PROTECTED]
Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
Reason for updating this patch: I think I made a mistake doing
the change in ehci_hub_status_data() and I think that should be
better done in ehci_hub_control().

Forcing port power down a bit later when the hub driver retrieves
the port status information has got the advantage that it also
catches the case when an OC fault occurs during booting up the
board. Doing it in ehci_hub_status_data() bears the risk that the
OCC is not recognized as it was already acked by the hub code
when scanning ports at initialization and it would need a second
OCC to get back to live by chance.

--- a/drivers/usb/host/ehci-hub.c.orig  2007-06-08 15:33:16.0 +0200
+++ b/drivers/usb/host/ehci-hub.c   2007-06-08 18:35:20.0 +0200
@@ -552,8 +552,23 @@ static int ehci_hub_control (
status |= 1  USB_PORT_FEAT_C_CONNECTION;
if (temp  PORT_PEC)
status |= 1  USB_PORT_FEAT_C_ENABLE;
-   if ((temp  PORT_OCC)  !ignore_oc)
+
+   if ((temp  PORT_OCC)  !ignore_oc){
status |= 1  USB_PORT_FEAT_C_OVER_CURRENT;
+  
+   /*
+* Hubs should disable port power on over-current.
+* However, not all EHCI implementations do this
+* automatically, even if they _do_ support per-port
+* power switching; they're allowed to just limit the
+* current.  khubd will turn the power back on.
+*/
+   if (HCS_PPC (ehci-hcs_params)){
+   ehci_writel(ehci,
+   temp  ~(PORT_RWC_BITS | PORT_POWER),
+   status_reg);
+   }
+   }
 
/* whoever resumes must GetPortStatus to complete it!! */
if (temp  PORT_RESUME) {


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] blank filenames in /sys/modules, kernel 2.6.21

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 02:44:12PM -0400, Robert P. J. Day wrote:
 On Fri, 8 Jun 2007, Greg KH wrote:
 
  On Fri, Jun 08, 2007 at 02:05:22PM -0400, Robert P. J. Day wrote:
   On Fri, 8 Jun 2007, Chuck Ebbert wrote:
  
We just found a file with this name in 2.6.21:
   
Directory name: /sys/module/nousb/parameters
File name:  
   
IOW the file has an empty name. Is this intentional?
It sure confuses updatedb...
   
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242715
  
   that appears to be the result of:
  
   $ grep -r __module_param_call *
   drivers/usb/core/usb.c:__module_param_call(, nousb, param_set_bool, 
   param_get_bool, nousb, 0444);
   include/linux/moduleparam.h:#define __module_param_call(prefix, name, 
   set, get, arg, perm)  \
   include/linux/moduleparam.h:__module_param_call(MODULE_PARAM_PREFIX, 
   name, set, get, arg, perm)
  
 and from drivers/usb/core/usb.c:
  
   /* format to disable USB on kernel command line is: nousb */
   __module_param_call(, nousb, param_set_bool, param_get_bool, nousb, 
   0444);
  
 one has to wonder about the value of a macro that is invoked only
   once throughout the entire tree.
 
  Pete added that back in December of 2005 (git-blame rocks...).  So what
  has changed recently to cause this to do different things in sysfs?
 
  Robert, what do you suggest we change this usage to look like?
 
 um ... i'm fairly sure i'm totally the wrong person to be asked about
 this, but what does any of the above have to do with disabling USB on
 the kernel command line?  wouldn't you typically define a kernel
 command line option with something like:
 ...
 arch/i386/kernel/traps.c:__setup(kstack=, kstack_setup);
 arch/i386/kernel/traps.c:__setup(code_bytes=, code_bytes_setup);
 arch/i386/kernel/nmi.c:__setup(nmi_watchdog=, setup_nmi_watchdog);
 arch/i386/kernel/reboot.c:__setup(reboot=, reboot_setup);
 arch/i386/kernel/tsc.c:__setup(notsc, tsc_setup);
 ...
 
 you know -- that sort of thing.  i mean, that's where *i'd* introduce
 a nousb option.

It's a module parameter as well as a kernel command line option, see
Pete's response.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] usb: free DMA if enqueue fails

2007-06-08 Thread Greg KH
On Fri, Jun 01, 2007 at 03:29:56PM -0400, Alan Stern wrote:
 On Fri, 1 Jun 2007, Pete Zaitcev wrote:
 
  Just for the record, I didn't find it just by looking. IBM filed a bug
  RH#236922 after they ran out of IOMMU. Our (older) uhci-hcd was rejecting
  bulk requests sent to interrupt endpoints, so running their management
  application on the GA kernel depletes sw-iommu.
  
   Do you think your new routine should be merged with urb_unlink()?   The 
   two always get called together.
  
  Probably a good idea. How about now?
 
 Looks good to me.

Care to resend this with the needed signed-off-by and good changelog
entry?

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] USB: Handle bogus low-speed Bulk endpoints

2007-06-08 Thread Alan Stern
A noticeable number of low-speed devices mistakenly include
descriptors for Bulk endpoints, which is forbidden by the USB spec.
In an attempt to make such devices more usable, this patch (as924)
converts the descriptors to Interrupt with an interval of 1 ms.

Signed-off-by: Alan Stern [EMAIL PROTECTED]

---

Index: usb-2.6/drivers/usb/core/config.c
===
--- usb-2.6.orig/drivers/usb/core/config.c
+++ usb-2.6/drivers/usb/core/config.c
@@ -124,6 +124,21 @@ static int usb_parse_endpoint(struct dev
endpoint-desc.bInterval = n;
}
 
+   /* Some buggy low-speed devices have Bulk endpoints, which is
+* explicitly forbidden by the USB spec.  In an attempt to make
+* them usable, we will try treating them as Interrupt endpoints.
+*/
+   if (to_usb_device(ddev)-speed == USB_SPEED_LOW 
+   usb_endpoint_xfer_bulk(d)) {
+   dev_warn(ddev, config %d interface %d altsetting %d 
+   endpoint 0x%X is Bulk; changing to Interrupt\n,
+   cfgno, inum, asnum, d-bEndpointAddress);
+   endpoint-desc.bmAttributes = USB_ENDPOINT_XFER_INT;
+   endpoint-desc.bInterval = 1;
+   if (le16_to_cpu(endpoint-desc.wMaxPacketSize)  8)
+   endpoint-desc.wMaxPacketSize = cpu_to_le16(8);
+   }
+
/* Skip over any Class Specific or Vendor Specific descriptors;
 * find the next endpoint or interface descriptor */
endpoint-extra = buffer;


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] 2.6.22-rc4-mm1

2007-06-08 Thread Alan Stern
On Fri, 8 Jun 2007, Greg KH wrote:

 I _really_ think we need to just get rid of that field and pass the
 status in the urb callback.  That would fix this problem once and for
 all.
 
 But, from what I remember, the uhci host controller didn't make it easy
 for me to acomplish this.  Or it might have been another host
 controller, can't remember anymore...
 
 So, anyone looking to make up some patches that touch every USB driver
 in the tree?  I'd be glad to take them :)

Tell you what -- I'll update the host controller drivers to remove 
them as an obstacle.  However I don't currently feel up to modifying 
the signatures for all the USB completion routines in the kernel; 
someone else will have to do that.

As a consolation prize, problems from abusing urb-status will decrease 
because the value won't change from -EINPROGRESS until immediately 
before the URB is passed to the completion handler.  Of course this 
won't solve all the races, but it might help reduce the bug reports...

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] usb: free DMA if enqueue fails

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 12:15:30PM -0700, Pete Zaitcev wrote:
 On Fri, 8 Jun 2007 11:58:47 -0700, Greg KH [EMAIL PROTECTED] wrote:
 
  Care to resend this with the needed signed-off-by and good changelog
  entry?
 
 What was wrong with Release DMA resources if submission fails in
 the HCD.? Maybe you want me to elaborate on the condition under which
 it can fail? The patch was completely compliant with the format,
 as much as I can see. All the discussion was below the tripple dash.

Hm, as it's now purged from my wueue, can you resend it?  Sorry if I
missed the fact that it looked correct :(

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] 2.6.22-rc4-mm1

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 03:40:22PM -0400, Alan Stern wrote:
 On Fri, 8 Jun 2007, Greg KH wrote:
 
  I _really_ think we need to just get rid of that field and pass the
  status in the urb callback.  That would fix this problem once and for
  all.
  
  But, from what I remember, the uhci host controller didn't make it easy
  for me to acomplish this.  Or it might have been another host
  controller, can't remember anymore...
  
  So, anyone looking to make up some patches that touch every USB driver
  in the tree?  I'd be glad to take them :)
 
 Tell you what -- I'll update the host controller drivers to remove 
 them as an obstacle.  However I don't currently feel up to modifying 
 the signatures for all the USB completion routines in the kernel; 
 someone else will have to do that.

Ok, fair enough, I'll handle that mess, I like that kind of thing :)

 As a consolation prize, problems from abusing urb-status will decrease 
 because the value won't change from -EINPROGRESS until immediately 
 before the URB is passed to the completion handler.  Of course this 
 won't solve all the races, but it might help reduce the bug reports...

No, I want to then rename that variable or just remove it from the urb
entirely to solve these problems once and for all.

But I'll take care of it if you can fix up the host controllers.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] usb: free DMA if enqueue fails

2007-06-08 Thread Pete Zaitcev
On Fri, 8 Jun 2007 12:37:46 -0700, Greg KH [EMAIL PROTECTED] wrote:

 Hm, as it's now purged from my wueue, can you resend it?  Sorry if I
 missed the fact that it looked correct :(

Will do in a moment. I thought that re-sending exactly same patch would
piss you off, but didn't know how to correct it.

-- Pete

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] OHCI: Fix machine check in ohci_hub_status_data

2007-06-08 Thread Johannes Berg
On Fri, 2007-04-20 at 11:33 -0400, Alan Stern wrote:
 This patch (as901) fixes an oversight in ohci-hcd.  The
 hub_status_data routine must not try to access the controller's
 memory-mapped registers if the controller is in a low-power state;
 such attempts will cause a crash on some architectures (such as PPC).

What ever happened to this? It doesn't *seem* to be in the current tree,
or am I missing something?

 Signed-off-by: Alan Stern [EMAIL PROTECTED]
 
 ---
 
 Index: usb-2.6/drivers/usb/host/ohci-hub.c
 ===
 --- usb-2.6.orig/drivers/usb/host/ohci-hub.c
 +++ usb-2.6/drivers/usb/host/ohci-hub.c
 @@ -417,6 +417,8 @@ ohci_hub_status_data (struct usb_hcd *hc
   unsigned long   flags;
  
   spin_lock_irqsave (ohci-lock, flags);
 + if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, hcd-flags))
 + goto done;
  
   /* undocumented erratum seen on at least rev D */
   if ((ohci-flags  OHCI_QUIRK_AMD756)
 
 


signature.asc
Description: This is a digitally signed message part
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] usb: free DMA mappings if enqueue fails

2007-06-08 Thread Pete Zaitcev
This patch releases DMA resources if enqueue fails in the HCD.

Linux had this bug ever since we converted from virt_to_bus for 2.4.
It is difficult to hit. A user would need a significant memory pressure
or some other unusual condition.

It was reported to me by IBM. They ran a management application for
RSA II adapters which sent Bulk requests to an Interrupt endpoint.
Submissions got rejected by HCD due to an invalid interval value
and the swiotlb pool became depleted in the matter of hours.

We fixed the invalid interval issue in devio.c separately, but this
seems to be a bug worth fixing as well.

Signed-off-by: Pete Zaitcev [EMAIL PROTECTED]

--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -901,17 +901,32 @@ EXPORT_SYMBOL (usb_calc_bus_time);
 
 /*-*/
 
-static void urb_unlink (struct urb *urb)
+static void urb_unlink(struct usb_hcd *hcd, struct urb *urb)
 {
unsigned long   flags;
+   int at_root_hub = (urb-dev == hcd-self.root_hub);
 
/* clear all state linking urb to this dev (and hcd) */
-
spin_lock_irqsave (hcd_data_lock, flags);
list_del_init (urb-urb_list);
spin_unlock_irqrestore (hcd_data_lock, flags);
-}
 
+   if (hcd-self.uses_dma  !at_root_hub) {
+   if (usb_pipecontrol (urb-pipe)
+!(urb-transfer_flags  URB_NO_SETUP_DMA_MAP))
+   dma_unmap_single (hcd-self.controller, urb-setup_dma,
+   sizeof (struct usb_ctrlrequest),
+   DMA_TO_DEVICE);
+   if (urb-transfer_buffer_length != 0
+!(urb-transfer_flags  URB_NO_TRANSFER_DMA_MAP))
+   dma_unmap_single (hcd-self.controller, 
+   urb-transfer_dma,
+   urb-transfer_buffer_length,
+   usb_pipein (urb-pipe)
+   ? DMA_FROM_DEVICE
+   : DMA_TO_DEVICE);
+   }
+}
 
 /* may be called in any context with a valid urb-dev usecount
  * caller surrenders ownership of urb
@@ -1014,7 +1029,7 @@ doit:
status = hcd-driver-urb_enqueue (hcd, ep, urb, mem_flags);
 done:
if (unlikely (status)) {
-   urb_unlink (urb);
+   urb_unlink(hcd, urb);
atomic_dec (urb-use_count);
if (urb-reject)
wake_up (usb_kill_urb_queue);
@@ -1384,29 +1399,7 @@ EXPORT_SYMBOL (usb_bus_start_enum);
  */
 void usb_hcd_giveback_urb (struct usb_hcd *hcd, struct urb *urb)
 {
-   int at_root_hub;
-
-   at_root_hub = (urb-dev == hcd-self.root_hub);
-   urb_unlink (urb);
-
-   /* lower level hcd code should use *_dma exclusively if the
-* host controller does DMA */
-   if (hcd-self.uses_dma  !at_root_hub) {
-   if (usb_pipecontrol (urb-pipe)
-!(urb-transfer_flags  URB_NO_SETUP_DMA_MAP))
-   dma_unmap_single (hcd-self.controller, urb-setup_dma,
-   sizeof (struct usb_ctrlrequest),
-   DMA_TO_DEVICE);
-   if (urb-transfer_buffer_length != 0
-!(urb-transfer_flags  URB_NO_TRANSFER_DMA_MAP))
-   dma_unmap_single (hcd-self.controller, 
-   urb-transfer_dma,
-   urb-transfer_buffer_length,
-   usb_pipein (urb-pipe)
-   ? DMA_FROM_DEVICE
-   : DMA_TO_DEVICE);
-   }
-
+   urb_unlink(hcd, urb);
usbmon_urb_complete (hcd-self, urb);
/* pass ownership to the completion handler */
urb-complete (urb);

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] OHCI: Fix machine check in ohci_hub_status_data

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 10:35:05PM +0200, Johannes Berg wrote:
 On Fri, 2007-04-20 at 11:33 -0400, Alan Stern wrote:
  This patch (as901) fixes an oversight in ohci-hcd.  The
  hub_status_data routine must not try to access the controller's
  memory-mapped registers if the controller is in a low-power state;
  such attempts will cause a crash on some architectures (such as PPC).
 
 What ever happened to this? It doesn't *seem* to be in the current tree,
 or am I missing something?

It's in my tree.  It will be sent to Linus after 2.6.22 is out.  Do you
think it needs to go in before 2.6.22 is final?  If so, Alan, do you
agree?

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] usb: free DMA if enqueue fails

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 01:26:43PM -0700, Pete Zaitcev wrote:
 On Fri, 8 Jun 2007 12:37:46 -0700, Greg KH [EMAIL PROTECTED] wrote:
 
  Hm, as it's now purged from my wueue, can you resend it?  Sorry if I
  missed the fact that it looked correct :(
 
 Will do in a moment. I thought that re-sending exactly same patch would
 piss you off, but didn't know how to correct it.

re-sending patches never pisses me off, it just means that I missed
something somewhere.  So feel free to keep pestering me, it keeps me
honest :)

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] usb: free DMA mappings if enqueue fails

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 01:37:49PM -0700, Pete Zaitcev wrote:
 This patch releases DMA resources if enqueue fails in the HCD.
 
 Linux had this bug ever since we converted from virt_to_bus for 2.4.
 It is difficult to hit. A user would need a significant memory pressure
 or some other unusual condition.
 
 It was reported to me by IBM. They ran a management application for
 RSA II adapters which sent Bulk requests to an Interrupt endpoint.
 Submissions got rejected by HCD due to an invalid interval value
 and the swiotlb pool became depleted in the matter of hours.
 
 We fixed the invalid interval issue in devio.c separately, but this
 seems to be a bug worth fixing as well.
 
 Signed-off-by: Pete Zaitcev [EMAIL PROTECTED]

Thanks, do you think this should go in before 2.6.22 is released?

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] OHCI: Fix machine check in ohci_hub_status_data

2007-06-08 Thread Johannes Berg
On Fri, 2007-06-08 at 13:47 -0700, Greg KH wrote:

 It's in my tree.  It will be sent to Linus after 2.6.22 is out.  Do you
 think it needs to go in before 2.6.22 is final?  If so, Alan, do you
 agree?

Ah ok. Well, I haven't seen the problem without my suspend patch (that
hasn't and isn't going in) yet, but it seems to be more of a timing
thing than an actual change I made. I don't see it blow up every time
even with my suspend patch either. I'd think the patch should go in, but
I guess nobody complained before so it doesn't seem to be much of a
problem in reality now.

johannes


signature.asc
Description: This is a digitally signed message part
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] OHCI: Fix machine check in ohci_hub_status_data

2007-06-08 Thread Alan Stern
On Fri, 8 Jun 2007, Greg KH wrote:

 On Fri, Jun 08, 2007 at 10:35:05PM +0200, Johannes Berg wrote:
  On Fri, 2007-04-20 at 11:33 -0400, Alan Stern wrote:
   This patch (as901) fixes an oversight in ohci-hcd.  The
   hub_status_data routine must not try to access the controller's
   memory-mapped registers if the controller is in a low-power state;
   such attempts will cause a crash on some architectures (such as PPC).
  
  What ever happened to this? It doesn't *seem* to be in the current tree,
  or am I missing something?
 
 It's in my tree.  It will be sent to Linus after 2.6.22 is out.  Do you
 think it needs to go in before 2.6.22 is final?  If so, Alan, do you
 agree?

Not only should it go into 2.6.22, it's also a candidate for as many 
-stable kernels as we care to support.  It should have been present 
ever since 2.6.15.

It may be that the conditions for triggering that machine check were 
added fairly recently.  Be that as it may, the patch is definitely 
correct and apparently needed now.

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] EHCI: fix bug in refcounting code

2007-06-08 Thread Alan Stern
This patch (as927) fixes a recently-introduced refcounting bug in
ehci-hcd.  It's important to remember the difference between
pre-decrement and post-decrement!

Signed-off-by: Alan Stern [EMAIL PROTECTED]
CC: David Brownell [EMAIL PROTECTED]

---

Index: usb-2.6/drivers/usb/host/ehci-mem.c
===
--- usb-2.6.orig/drivers/usb/host/ehci-mem.c
+++ usb-2.6/drivers/usb/host/ehci-mem.c
@@ -118,7 +118,7 @@ static inline struct ehci_qh *qh_get (st
 
 static inline void qh_put (struct ehci_qh *qh)
 {
-   if (!(qh-refcount--))
+   if (!--qh-refcount)
qh_destroy(qh);
 }
 


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] USB: introduce urb-core_status field

2007-06-08 Thread Alan Stern
This patch (as926) replaces urb-status with urb-core_status, in an
attempt to help prevent drivers from abusing the API by polling
urb-status.  The original field remains for use by drivers, but it
isn't set until an URB is about to be handed to its completion
routine.

Signed-off-by: Alan Stern [EMAIL PROTECTED]

---

On Fri, 8 Jun 2007, Greg KH wrote:

  Tell you what -- I'll update the host controller drivers to remove
  them as an obstacle.  However I don't currently feel up to modifying
  the signatures for all the USB completion routines in the kernel;   
  someone else will have to do that.
 
 Ok, fair enough, I'll handle that mess, I like that kind of thing :)

Here it is, little more than a search-and-replace.  Of course, the 
trick lies in knowing where to search and what that little more needs 
to be!

Alan Stern


Index: usb-2.6/drivers/usb/core/hcd.c
===
--- usb-2.6.orig/drivers/usb/core/hcd.c
+++ usb-2.6/drivers/usb/core/hcd.c
@@ -520,8 +520,8 @@ error:
/* any errors get returned through the urb completion */
local_irq_save (flags);
spin_lock (urb-lock);
-   if (urb-status == -EINPROGRESS)
-   urb-status = status;
+   if (urb-core_status == -EINPROGRESS)
+   urb-core_status = status;
spin_unlock (urb-lock);
usb_hcd_giveback_urb (hcd, urb);
local_irq_restore (flags);
@@ -559,10 +559,10 @@ void usb_hcd_poll_rh_status(struct usb_h
urb = hcd-status_urb;
if (urb) {
spin_lock(urb-lock);
-   if (urb-status == -EINPROGRESS) {
+   if (urb-core_status == -EINPROGRESS) {
hcd-poll_pending = 0;
hcd-status_urb = NULL;
-   urb-status = 0;
+   urb-core_status = 0;
urb-hcpriv = NULL;
urb-actual_length = length;
memcpy(urb-transfer_buffer, buffer, length);
@@ -606,8 +606,8 @@ static int rh_queue_status (struct usb_h
int len = 1 + (urb-dev-maxchild / 8);
 
spin_lock_irqsave (hcd_root_hub_lock, flags);
-   if (urb-status != -EINPROGRESS)/* already unlinked */
-   retval = urb-status;
+   if (urb-core_status != -EINPROGRESS)   /* already unlinked */
+   retval = urb-core_status;
else if (hcd-status_urb || urb-transfer_buffer_length  len) {
dev_dbg (hcd-self.controller, not queuing rh status urb\n);
retval = -EINVAL;
@@ -934,8 +934,8 @@ int usb_hcd_submit_urb (struct urb *urb,
 
/*
 * Atomically queue the urb,  first to our records, then to the HCD.
-* Access to urb-status is controlled by urb-lock ... changes on
-* i/o completion (normal or fault) or unlinking.
+* Access to urb-core_status is controlled by urb-lock ... changes
+* on I/O completion (normal or fault) or unlinking.
 */
 
// FIXME:  verify that quiescing hc works right (RH cleans up)
@@ -950,6 +950,7 @@ int usb_hcd_submit_urb (struct urb *urb,
else switch (hcd-state) {
case HC_STATE_RUNNING:
case HC_STATE_RESUMING:
+   urb-core_status = -EINPROGRESS;
list_add_tail (urb-urb_list, ep-urb_list);
status = 0;
break;
@@ -1081,7 +1082,7 @@ int usb_hcd_unlink_urb (struct urb *urb,
return -ENODEV;
 
/*
-* we contend for urb-status with the hcd core,
+* we contend for urb-core_status with the hcd core,
 * which changes it while returning the urb.
 *
 * Caller guaranteed that the urb pointer hasn't been freed, and
@@ -1114,7 +1115,7 @@ int usb_hcd_unlink_urb (struct urb *urb,
/* Any status except -EINPROGRESS means something already started to
 * unlink this URB from the hardware.  So there's no more work to do.
 */
-   if (urb-status != -EINPROGRESS) {
+   if (urb-core_status != -EINPROGRESS) {
retval = -EBUSY;
goto done;
}
@@ -1132,7 +1133,7 @@ int usb_hcd_unlink_urb (struct urb *urb,
set_bit(HCD_FLAG_SAW_IRQ, hcd-flags);
}
 
-   urb-status = status;
+   urb-core_status = status;
 
spin_unlock (hcd_data_lock);
spin_unlock_irqrestore (urb-lock, flags);
@@ -1176,15 +1177,15 @@ rescan:
int tmp;
 
/* the urb may already have been unlinked */
-   if (urb-status != -EINPROGRESS)
+   if (urb-core_status != -EINPROGRESS)
continue;
usb_get_urb (urb);
spin_unlock (hcd_data_lock);
 
spin_lock (urb-lock);
-   tmp = urb-status;
+   tmp = 

Re: [linux-usb-devel] usb: free DMA mappings if enqueue fails

2007-06-08 Thread Pete Zaitcev
On Fri, 8 Jun 2007 13:47:54 -0700, Greg KH [EMAIL PROTECTED] wrote:

 Thanks, do you think this should go in before 2.6.22 is released?

Considering that we had this bug for 5 years, 2 months won't make
a huge difference. It's not worth any extra effort, IMHO.

-- Pete

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] USB: introduce urb-core_status field

2007-06-08 Thread Pete Zaitcev
On Fri, 8 Jun 2007 17:12:05 -0400 (EDT), Alan Stern [EMAIL PROTECTED] wrote:

 + /* FIXME: The next line should be removed and the status passed
 +  * as an argument to urb-complete().
 +  */
 + urb-status = urb-core_status;

I was going to say Ewww one more field to already-bloated URB
but if we follow through on making status an argument, no problem.

-- Pete

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] USB: introduce urb-core_status field

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 05:12:05PM -0400, Alan Stern wrote:
 This patch (as926) replaces urb-status with urb-core_status, in an
 attempt to help prevent drivers from abusing the API by polling
 urb-status.  The original field remains for use by drivers, but it
 isn't set until an URB is about to be handed to its completion
 routine.

Hm, is there any way to keep this from being in the urb entirely?
Shouldn't this be an internal-to-the hcd type thing?

I say this as I worry people will just start using core_status instead
of status when we remove the status field.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] EHCI: fix bug in refcounting code

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 05:08:47PM -0400, Alan Stern wrote:
 This patch (as927) fixes a recently-introduced refcounting bug in
 ehci-hcd.  It's important to remember the difference between
 pre-decrement and post-decrement!
 
 Signed-off-by: Alan Stern [EMAIL PROTECTED]
 CC: David Brownell [EMAIL PROTECTED]

Recently-introduced where?  In mainline or due to a patch in my tree?
If it's in my tree, I should just merge this with the original patch so
no one ever hits the problem when doing a bisect.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] usb: free DMA mappings if enqueue fails

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 02:36:40PM -0700, Pete Zaitcev wrote:
 On Fri, 8 Jun 2007 13:47:54 -0700, Greg KH [EMAIL PROTECTED] wrote:
 
  Thanks, do you think this should go in before 2.6.22 is released?
 
 Considering that we had this bug for 5 years, 2 months won't make
 a huge difference. It's not worth any extra effort, IMHO.

Ok, thanks for letting me know.

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] OHCI: Fix machine check in ohci_hub_status_data

2007-06-08 Thread Greg KH
On Fri, Jun 08, 2007 at 05:05:41PM -0400, Alan Stern wrote:
 On Fri, 8 Jun 2007, Greg KH wrote:
 
  On Fri, Jun 08, 2007 at 10:35:05PM +0200, Johannes Berg wrote:
   On Fri, 2007-04-20 at 11:33 -0400, Alan Stern wrote:
This patch (as901) fixes an oversight in ohci-hcd.  The
hub_status_data routine must not try to access the controller's
memory-mapped registers if the controller is in a low-power state;
such attempts will cause a crash on some architectures (such as PPC).
   
   What ever happened to this? It doesn't *seem* to be in the current tree,
   or am I missing something?
  
  It's in my tree.  It will be sent to Linus after 2.6.22 is out.  Do you
  think it needs to go in before 2.6.22 is final?  If so, Alan, do you
  agree?
 
 Not only should it go into 2.6.22, it's also a candidate for as many 
 -stable kernels as we care to support.  It should have been present 
 ever since 2.6.15.

Ah, ok, thanks for letting me know, I'll move it up in my queue and add
it to the -stable queues too.

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] OHCI: Fix machine check in ohci_hub_status_data

2007-06-08 Thread Benjamin Herrenschmidt
On Fri, 2007-06-08 at 23:02 +0200, Johannes Berg wrote:
 On Fri, 2007-06-08 at 13:47 -0700, Greg KH wrote:
 
  It's in my tree.  It will be sent to Linus after 2.6.22 is out.  Do you
  think it needs to go in before 2.6.22 is final?  If so, Alan, do you
  agree?
 
 Ah ok. Well, I haven't seen the problem without my suspend patch (that
 hasn't and isn't going in) y

Well your patch need some changes to please Paulus but it would
still be nice to have them.

The main issue right now is that he wants the old code to still be there
triggered by the ioctl, and the new code be a duplicate. I think his
main issue is mostly that he hates the freezer and doesn't want it :-) 

Oh and he doesn't quite trust the people hacking the core PM stuff not
to break things all the time :-)

But once that work is done, it will be easier to consolidate bits until
the differences are down to mostly nothing and we can actually get rid
of the ioctl.

Ben.



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] ThinkPad T41 - Strange USB 2.0 behaviour

2007-06-08 Thread Robert de Rooy
Alan Stern wrote:
 Robert, it would help somewhat if you could build a kernel with 
 CONFIG_USB_DEBUG turned on and post the dmesg log showing what happens 
 when you plug in one of those non-working devices.
   
Sorry, yes I should have done that before...
 Yes, in principle Linux can be made to switch over to full speed when 
 high speed fails.  But there are limitations: The switchover would work 
 only for devices plugged directly into the computer, not for devices 
 plugged into a high-speed hub.  And some Linux systems (not regular 
 PCs) have EHCI implementations that don't allow such a switch -- or 
 if they do, I'm not aware of how to accomplish it.
   
Interesting, I have a USB 2.0 hub, but have not tried it, mainly because 
I need to find a power supply for it first.
But regardless if the hub works as USB 2.0 or 1.1, it could be that 
another hub behaves differently, just like I have one USB 2.0 memory key 
that still works as such.
 BTW, depending on the kind of failure the system does not keep 
 retrying indefinitely.  It gives up after four attempts.

 Alan Stern
***USB related boot messages with CONFIG_USB_DEBUG enabled
Jun  8 23:33:30 localhost kernel: USB Universal Host Controller 
Interface driver v3.0
Jun  8 23:33:30 localhost kernel: ACPI: PCI Interrupt :00:1d.0[A] - 
Link [LNKA] - GSI 11 (level, low) - IRQ 11
Jun  8 23:33:30 localhost kernel: uhci_hcd :00:1d.0: UHCI Host 
Controller
Jun  8 23:33:30 localhost kernel: uhci_hcd :00:1d.0: new USB bus 
registered, assigned bus number 1
Jun  8 23:33:30 localhost kernel: uhci_hcd :00:1d.0: detected 2 ports
Jun  8 23:33:30 localhost kernel: uhci_hcd :00:1d.0: irq 11, io base 
0x1800
Jun  8 23:33:30 localhost kernel: usb usb1: Product: UHCI Host Controller
Jun  8 23:33:30 localhost kernel: usb usb1: Manufacturer: Linux 
2.6.22-rc4 uhci_hcd
Jun  8 23:33:30 localhost kernel: usb usb1: SerialNumber: :00:1d.0
Jun  8 23:33:30 localhost kernel: usb usb1: configuration #1 chosen from 
1 choice
Jun  8 23:33:30 localhost kernel: hub 1-0:1.0: USB hub found
Jun  8 23:33:30 localhost kernel: hub 1-0:1.0: 2 ports detected
Jun  8 23:33:30 localhost kernel: ACPI: PCI Interrupt Link [LNKD] 
enabled at IRQ 11
Jun  8 23:33:30 localhost kernel: ACPI: PCI Interrupt :00:1d.1[B] - 
Link [LNKD] - GSI 11 (level, low) - IRQ 11
Jun  8 23:33:30 localhost kernel: uhci_hcd :00:1d.1: UHCI Host 
Controller
Jun  8 23:33:30 localhost kernel: uhci_hcd :00:1d.1: new USB bus 
registered, assigned bus number 2
Jun  8 23:33:30 localhost kernel: uhci_hcd :00:1d.1: detected 2 ports
Jun  8 23:33:30 localhost kernel: uhci_hcd :00:1d.1: irq 11, io base 
0x1820
Jun  8 23:33:30 localhost kernel: usb usb2: Product: UHCI Host Controller
Jun  8 23:33:30 localhost kernel: usb usb2: Manufacturer: Linux 
2.6.22-rc4 uhci_hcd
Jun  8 23:33:30 localhost kernel: usb usb2: SerialNumber: :00:1d.1
Jun  8 23:33:31 localhost kernel: usb usb2: configuration #1 chosen from 
1 choice
Jun  8 23:33:31 localhost rpcbind: cannot create socket for udp6
Jun  8 23:33:31 localhost kernel: hub 2-0:1.0: USB hub found
Jun  8 23:33:31 localhost kernel: hub 2-0:1.0: 2 ports detected
Jun  8 23:33:31 localhost rpcbind: cannot create socket for tcp6
Jun  8 23:33:31 localhost kernel: ACPI: PCI Interrupt Link [LNKC] 
enabled at IRQ 11
Jun  8 23:33:31 localhost kernel: ACPI: PCI Interrupt :00:1d.2[C] - 
Link [LNKC] - GSI 11 (level, low) - IRQ 11
Jun  8 23:33:31 localhost kernel: uhci_hcd :00:1d.2: UHCI Host 
Controller
Jun  8 23:33:31 localhost kernel: uhci_hcd :00:1d.2: new USB bus 
registered, assigned bus number 3
Jun  8 23:33:31 localhost kernel: uhci_hcd :00:1d.2: detected 2 ports
Jun  8 23:33:31 localhost kernel: uhci_hcd :00:1d.2: irq 11, io base 
0x1840
Jun  8 23:33:31 localhost kernel: usb usb3: Product: UHCI Host Controller
Jun  8 23:33:31 localhost kernel: usb usb3: Manufacturer: Linux 
2.6.22-rc4 uhci_hcd
Jun  8 23:33:31 localhost kernel: usb usb3: SerialNumber: :00:1d.2
Jun  8 23:33:31 localhost kernel: usb usb3: configuration #1 chosen from 
1 choice
Jun  8 23:33:31 localhost kernel: hub 3-0:1.0: USB hub found
Jun  8 23:33:31 localhost kernel: hub 3-0:1.0: 2 ports detected
Jun  8 23:33:31 localhost kernel: ACPI: PCI Interrupt Link [LNKH] 
enabled at IRQ 11
Jun  8 23:33:31 localhost kernel: ACPI: PCI Interrupt :00:1d.7[D] - 
Link [LNKH] - GSI 11 (level, low) - IRQ 11
Jun  8 23:33:31 localhost kernel: ehci_hcd :00:1d.7: EHCI Host 
Controller
Jun  8 23:33:31 localhost kernel: ehci_hcd :00:1d.7: new USB bus 
registered, assigned bus number 4
Jun  8 23:33:31 localhost kernel: ehci_hcd :00:1d.7: debug port 1
Jun  8 23:33:31 localhost kernel: ehci_hcd :00:1d.7: irq 11, io mem 
0xc000
Jun  8 23:33:31 localhost kernel: ehci_hcd :00:1d.7: USB 2.0 
started, EHCI 1.00, driver 10 Dec 2004
Jun  8 23:33:31 localhost kernel: usb usb4: Product: EHCI Host Controller
Jun  8 23:33:31 localhost kernel: usb usb4: 

Re: [linux-usb-devel] Large writes issue with Sierra Wireless modem

2007-06-08 Thread Greg KH
On Tue, Jun 05, 2007 at 03:26:07PM -0500, James Graves wrote:
 
 Hello all,
 
 We're seeing a strange problem when writing commands to a Sierra 
 Wireless USB modem.  It is a USB 1.1 device.
 
 We're sending some commands over the control channel for the modem. 
 Almost everything works fine.

How are you sending these commands?  The current in-kernel driver
doesn't support this from what I can see, right?

 However, when sending commands larger than 64 bytes, the rest of the 
 data (which was a part of that write) is corrupted, which we've seen 
 using a USB sniffer.

Corrupted where, coming from the host to the device?

Are you sure you aren't just forgetting to encode your data properly
as the device specs show that you need to do so?  I can dig up the
relevant reference if you need it.

 We have modified the userspace application so that it writes only up to 
 64 bytes at a time, sleeps a little, and then writes more.  This works 
 fine.

This sounds odd, what endpoint pair are you sending to?

 The strange part is that we've seen no issues with using the PPPD 
 application to connect to the Internet using the Sierra Wireless modem. 
   And it has got to be writing more than 64 bytes at a time, though that 
 is to a different device file (and therefore a different bulk endpoint).

Which device is this?

 The even stranger part is that the sierra.c driver doesn't make any 
 significant distinctions between the different USB bulk endpoints.  They 
 are mapped to their individual /dev/ttyUSBx device files, and that's it. 
   They all have the same number of URBs, and the code paths for all the 
 bulk endpoints are the same.

Yeah, that's why I'm confused :)

 So it isn't at all clear to me why everything would be fine with one 
 endpoint, and not with another.
 
 Unless the system is negotiating different transfer parameters for the 
 different endpoints (which aren't _exactly_ identical in hardware)...

The system doesn't do anything different, you have the code to prove
that.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [RFC] URBs and buffer management

2007-06-08 Thread Greg KH
On Mon, Jun 04, 2007 at 10:38:44AM +0200, Marcel Holtmann wrote:
 Hi,
 
 after the discussion with Oliver at the LinuxTag last week, I started to
 re-write the hci_usb driver to remove this ugly cruft around the URB
 management in the driver. The basic driver (without ISOC support) is
 working perfectly fine and thanks to the reference count of the URB and
 the new USB anchor extension it is a really small and simple driver now.
 
 However the buffer management for URBs that get re-submitted all the
 time is really ugly. It can be done inside the driver, but I think the
 USB core should provide some helpers here.
 
 The attached patch is an attempt to integrate the buffer into the URB
 and let the URB take care of freeing it when it is no longer needed.
 This might not be optimal for all drivers, but it helps to reduce a lot
 of code in many drivers. And of course the old method of allocating or
 providing an external buffer is still available.
 
 The main use cases are interrupt and bulk in endpoints where fragmented
 packets are used and the driver has to reassemble them. In this cases
 one or multiple URBs with and attached buffer can be used. When shutting
 down these URBs via an USB anchor, it will take care of freeing the
 buffers and the driver doesn't have to worry about.
 
 The patch misses setup routines for interrupt and ISOC URBs, but they
 are straight forward. Please let me know what you think.
 
 Regards
 
 Marcel
 

 diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
 index 94ea972..e683726 100644
 --- a/drivers/usb/core/urb.c
 +++ b/drivers/usb/core/urb.c
 @@ -11,6 +11,11 @@
  static void urb_destroy(struct kref *kref)
  {
   struct urb *urb = to_urb(kref);
 +
 + if (urb-transfer_flags  URB_FREE_BUFFER)
 + usb_buffer_free(urb-dev, urb-transfer_buffer_length,
 + urb-transfer_buffer, urb-transfer_dma);
 +
   kfree(urb);
  }
  
 @@ -478,6 +483,36 @@ void usb_kill_urb(struct urb *urb)

I like this portion, if we make it kfree() instead of usb_buffer_free.

   spin_unlock_irq(urb-lock);
  }
  
 +/**
 + * usb_setup_bulk_urb - macro to help initialize a bulk urb

snip

It seems this function is not needed as per the discussion in this
thread.

Care to resend this with just the above functionality?  It will let me
clean up a number of different drivers.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] udev hotplugging

2007-06-08 Thread Greg KH
On Mon, Jun 04, 2007 at 11:52:20AM -0500, Meher wrote:
 Hi,
 I tried the linux-hotplugging mailing list with this question but
 no one responded :( I am posting here hoping people working on USB
 would have definetly touched hotplugging.
 
 I am a newbie for hotplugging (been a user for a while but started
 a week back to try and understand what is happening underneath). I
 have seen messages from Greg that hotplug-ng will continue to exist in
 parallel with the udev-netlink approach. Are there any specific
 differences in both the approaches?

No, hotplug-ng is dead.  Don't use it at all, it's totally obsoleted
with a simple 1 line udev rule.

So, your further hotplug questions are obsolete now, sorry, just use
udev instead.

thanks,

greg k-h

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [patch] PS3: Fix USB return value

2007-06-08 Thread Geoff Levand
Fix a minor error on the return value of ps3_ehci_driver_register()
and ps3_ohci_driver_register() when running on non-PS3 systems.

Signed-off-by: Geoff Levand [EMAIL PROTECTED]
---
Hi Greg,

Testers found a problem with my latest PS3 USB patch.  Please
add it in.

-Geoff

 drivers/usb/host/ehci-ps3.c |2 +-
 drivers/usb/host/ohci-ps3.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -227,7 +227,7 @@ static int ps3_ehci_driver_register(stru
 {
return firmware_has_feature(FW_FEATURE_PS3_LV1)
? ps3_system_bus_driver_register(drv)
-   : -ENODEV;
+   : 0;
 }
 
 static void ps3_ehci_driver_unregister(struct ps3_system_bus_driver *drv)
--- a/drivers/usb/host/ohci-ps3.c
+++ b/drivers/usb/host/ohci-ps3.c
@@ -230,7 +230,7 @@ static int ps3_ohci_driver_register(stru
 {
return firmware_has_feature(FW_FEATURE_PS3_LV1)
? ps3_system_bus_driver_register(drv)
-   : -ENODEV;
+   : 0;
 }
 
 static void ps3_ohci_driver_unregister(struct ps3_system_bus_driver *drv)


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [Bugme-new] [Bug 8310] New: USB device names are not sanitized for UTF-8

2007-06-08 Thread Ken Moffat
On Fri, Jun 08, 2007 at 08:15:44AM +0200, Robert Marquardt wrote:
 Alan Stern schrieb:
 
  full handling of Unicode?  You must be kidding.  Do you have any idea 
  how difficult it is to do something as simple as converting between 
  lower- and uppercase?
 
 If it is required somewhere in the kernel then it has to be implemented.
 Yes, i know how hard it is. 100K of tables and 255K of source for a 
 Pascal implementation i know. That includes a regular expression parser, 
 but still it is a big chunk of source.

 Ignoring, for the moment, the question of why the *kernel* should
ever need to be able to in_general convert from lower- to uppercase,
the problem is harder than you imply.  Most of us think 'i' should
become 'I' but I'm fairly sure that turkish speakers think it should
be 'İ' (with a dot - 'I' for them is the uppercase version of 'ı'
without a dot).

Ken
-- 
das eine Mal als Tragödie, das andere Mal als Farce

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [GIT PATCH] USB fixes for 2.6.22-rc4

2007-06-08 Thread Greg KH
Here are some USB fixes against your 2.6.22-rc4 tree.

They fix a number of minor things and update some documentation and add
some usb-storage quirks, and make the config option a default that has
been tripping up some usbfs users with older udev configurations.

All of these have been in the -mm releases for a while.

Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6.git/

The full patches will be sent to the linux-usb-devel mailing list, if
anyone wants to see them.

thanks,

greg k-h


 Documentation/networking/00-INDEX   |2 +
 Documentation/networking/cxacru.txt |   84 +++
 drivers/usb/atm/cxacru.c|   52 +++---
 drivers/usb/class/usblp.c   |5 +-
 drivers/usb/core/Kconfig|   22 +
 drivers/usb/core/config.c   |   42 +-
 drivers/usb/gadget/epautoconf.c |2 +-
 drivers/usb/gadget/inode.c  |8 ++--
 drivers/usb/gadget/net2280.c|6 +-
 drivers/usb/gadget/omap_udc.c   |6 +-
 drivers/usb/gadget/rndis.c  |   35 +-
 drivers/usb/host/ohci-hub.c |2 +
 drivers/usb/storage/unusual_devs.h  |   21 -
 13 files changed, 222 insertions(+), 65 deletions(-)
 create mode 100644 Documentation/networking/cxacru.txt

---

Alan Stern (2):
  USB: Fix up bogus bInterval values in endpoint descriptors
  OHCI: Fix machine check in ohci_hub_status_data

Ben Collins (1):
  USB: UNUSUAL_DEV: Sync up some reported devices from Ubuntu

David Brownell (1):
  USB: usb gadgets avoid le{16,32}_to_cpup()

Kay Sievers (1):
  USB: set default y for CONFIG_USB_DEVICE_CLASS

Pete Zaitcev (1):
  usblp: Don't let suspend to kill -used

Simon Arlott (3):
  USB: cxacru: add Documentation file
  USB: cxacru: create sysfs attributes in atm_start instead of bind
  USB: cxacru: ignore error trying to start ADSL in atm_start


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH 1/9] USB: set default y for CONFIG_USB_DEVICE_CLASS

2007-06-08 Thread Greg Kroah-Hartman
From: Kay Sievers [EMAIL PROTECTED]

Signed-off-by: Kay Sievers [EMAIL PROTECTED]
Cc: bert hubert [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/usb/core/Kconfig |   22 +-
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index f493fb1..346fc03 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -40,21 +40,25 @@ config USB_DEVICEFS
 config USB_DEVICE_CLASS
bool USB device class-devices (DEPRECATED)
depends on USB
-   default n
+   default y
---help---
  Userspace access to USB devices is granted by device-nodes exported
  directly from the usbdev in sysfs. Old versions of the driver
  core and udev needed additional class devices to export device nodes.
 
  These additional devices are difficult to handle in userspace, if
- information about USB interfaces must be available. One device 
contains
- the device node, the other device contains the interface data. Both
- devices are at the same level in sysfs (siblings) and one can't access
- the other. The device node created directly by the usbdev is the 
parent
- device of the interface and therefore easily accessible from the 
interface
- event.
-
- This option provides backward compatibility if needed.
+ information about USB interfaces must be available. One device
+ contains the device node, the other device contains the interface
+ data. Both devices are at the same level in sysfs (siblings) and one
+ can't access the other. The device node created directly by the
+ usb device is the parent device of the interface and therefore
+ easily accessible from the interface event.
+
+ This option provides backward compatibility for libusb device
+ nodes (lsusb) when usbfs is not used, and the following udev rule
+ doesn't exist:
+   SUBSYSTEM==usb, ACTION==add, ENV{DEVTYPE}==usb_device, \
+   NAME=bus/usb/$env{BUSNUM}/$env{DEVNUM}, MODE=0644
 
 config USB_DYNAMIC_MINORS
bool Dynamic USB minor allocation (EXPERIMENTAL)
-- 
1.5.2.1


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH 2/9] usblp: Don't let suspend to kill -used

2007-06-08 Thread Greg Kroah-Hartman
From: Pete Zaitcev [EMAIL PROTECTED]

Suspend destroys refcounting for open/release.

Signed-off-by: Pete Zaitcev [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/usb/class/usblp.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 7b1edfe..6778f9a 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -347,10 +347,8 @@ static int handle_bidir (struct usblp *usblp)
if (usblp-bidir  usblp-used  !usblp-sleeping) {
usblp-readcount = 0;
usblp-readurb-dev = usblp-dev;
-   if (usb_submit_urb(usblp-readurb, GFP_KERNEL)  0) {
-   usblp-used = 0;
+   if (usb_submit_urb(usblp-readurb, GFP_KERNEL)  0)
return -EIO;
-   }
}
 
return 0;
@@ -412,6 +410,7 @@ static int usblp_open(struct inode *inode, struct file 
*file)
usblp-readurb-status = 0;
 
if (handle_bidir(usblp)  0) {
+   usblp-used = 0;
file-private_data = NULL;
retval = -EIO;
}
-- 
1.5.2.1


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH 3/9] USB: usb gadgets avoid le{16, 32}_to_cpup()

2007-06-08 Thread Greg Kroah-Hartman
From: David Brownell [EMAIL PROTECTED]

It turns out that le16_to_cpup() and le32_to_cpup() aren't always safe
to call with pointers into packed structures, since those are inlined
functions and GCC may lose the packed attribute.  So those references
can become unaligned kernel accesses, which are evil on some hardware.

This patch updates uses of those routines in the gadget stack.  The
references into packed structures can just use leXX_to_cpu(*x), which
in most cases is more natural.  Some other uses in RNDIS, mostly in
debug code, were wrong in the first place; those use get_unaligned().

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/usb/gadget/epautoconf.c |2 +-
 drivers/usb/gadget/inode.c  |8 
 drivers/usb/gadget/net2280.c|6 +++---
 drivers/usb/gadget/omap_udc.c   |6 +++---
 drivers/usb/gadget/rndis.c  |   35 ++-
 5 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index f28af06..6042364 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -132,7 +132,7 @@ ep_matches (
 * where it's an output parameter representing the full speed limit.
 * the usb spec fixes high speed bulk maxpacket at 512 bytes.
 */
-   max = 0x7ff  le16_to_cpup (desc-wMaxPacketSize);
+   max = 0x7ff  le16_to_cpu(desc-wMaxPacketSize);
switch (type) {
case USB_ENDPOINT_XFER_INT:
/* INT:  limit 64 bytes full speed, 1024 high speed */
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 188c74a..46d0e52 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1369,12 +1369,12 @@ config_buf (struct dev_data *dev, u8 type, unsigned 
index)
hs = !hs;
if (hs) {
dev-req-buf = dev-hs_config;
-   len = le16_to_cpup (dev-hs_config-wTotalLength);
+   len = le16_to_cpu(dev-hs_config-wTotalLength);
} else
 #endif
{
dev-req-buf = dev-config;
-   len = le16_to_cpup (dev-config-wTotalLength);
+   len = le16_to_cpu(dev-config-wTotalLength);
}
((u8 *)dev-req-buf) [1] = type;
return len;
@@ -1885,7 +1885,7 @@ dev_config (struct file *fd, const char __user *buf, 
size_t len, loff_t *ptr)
 
/* full or low speed config */
dev-config = (void *) kbuf;
-   total = le16_to_cpup (dev-config-wTotalLength);
+   total = le16_to_cpu(dev-config-wTotalLength);
if (!is_valid_config (dev-config) || total = length)
goto fail;
kbuf += total;
@@ -1894,7 +1894,7 @@ dev_config (struct file *fd, const char __user *buf, 
size_t len, loff_t *ptr)
/* optional high speed config */
if (kbuf [1] == USB_DT_CONFIG) {
dev-hs_config = (void *) kbuf;
-   total = le16_to_cpup (dev-hs_config-wTotalLength);
+   total = le16_to_cpu(dev-hs_config-wTotalLength);
if (!is_valid_config (dev-hs_config) || total = length)
goto fail;
kbuf += total;
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 52779c5..d975ecf 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -2440,9 +2440,9 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 
stat)
 
tmp = 0;
 
-#definew_value le16_to_cpup (u.r.wValue)
-#definew_index le16_to_cpup (u.r.wIndex)
-#definew_lengthle16_to_cpup (u.r.wLength)
+#definew_value le16_to_cpu(u.r.wValue)
+#definew_index le16_to_cpu(u.r.wIndex)
+#definew_lengthle16_to_cpu(u.r.wLength)
 
/* ack the irq */
writel (1  SETUP_PACKET_INTERRUPT, dev-regs-irqstat0);
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index b394e63..c4975a6 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -1651,9 +1651,9 @@ static void ep0_irq(struct omap_udc *udc, u16 irq_src)
UDC_EP_NUM_REG = 0;
} while (UDC_IRQ_SRC_REG  UDC_SETUP);
 
-#definew_value le16_to_cpup (u.r.wValue)
-#definew_index le16_to_cpup (u.r.wIndex)
-#definew_lengthle16_to_cpup (u.r.wLength)
+#definew_value le16_to_cpu(u.r.wValue)
+#definew_index le16_to_cpu(u.r.wIndex)
+#definew_lengthle16_to_cpu(u.r.wLength)
 
/* Delegate almost all control requests to the gadget driver,
 * except for a handful of ch9 status/feature requests that
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 6ec8cf1..708657c 100644
--- a/drivers/usb/gadget/rndis.c
+++ 

[linux-usb-devel] [PATCH 4/9] USB: UNUSUAL_DEV: Sync up some reported devices from Ubuntu

2007-06-08 Thread Greg Kroah-Hartman
From: Ben Collins [EMAIL PROTECTED]

UNUSUAL_DEV: Sync up some reported devices from Ubuntu

Various unusual dev entries accumulated from Ubuntu bug reports.

Signed-off-by: Ben Collins [EMAIL PROTECTED]
Cc: Alan Stern [EMAIL PROTECTED]
Signed-off-by: Phil Dibowitz [EMAIL PROTECTED]
---
 drivers/usb/storage/unusual_devs.h |   21 +++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/storage/unusual_devs.h 
b/drivers/usb/storage/unusual_devs.h
index d230ee7..54979c2 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1179,8 +1179,8 @@ UNUSUAL_DEV( 0x0a17, 0x006, 0x, 0x,
 US_SC_DEVICE, US_PR_DEVICE, NULL,
 US_FL_FIX_INQUIRY ),
 
-/* These are virtual windows driver CDs, which the zd1211rw driver 
automatically
- * converts into a WLAN devices. */
+/* These are virtual windows driver CDs, which the zd1211rw driver
+ * automatically converts into WLAN devices. */
 UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,
 ZyXEL,
 G-220F USB-WLAN Install,
@@ -1193,6 +1193,14 @@ UNUSUAL_DEV( 0x0ace, 0x20ff, 0x0101, 0x0101,
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_IGNORE_DEVICE ),
 
+/* SanDisk that has a second LUN for a driver ISO, reported by
+ * Ben Collins [EMAIL PROTECTED] */
+UNUSUAL_DEV( 0x0781, 0x5406, 0x, 0x,
+   SanDisk,
+   U3 Cruzer Micro driver ISO,
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
+   US_FL_SINGLE_LUN ),
+
 #ifdef CONFIG_USB_STORAGE_ISD200
 UNUSUAL_DEV(  0x0bf6, 0xa001, 0x0100, 0x0110,
ATI,
@@ -1271,6 +1279,15 @@ UNUSUAL_DEV( 0x0dd8, 0x1060, 0x, 0x,
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_FIX_INQUIRY ),
 
+/* Reported by Edward Chapman (taken from linux-usb mailing list)
+   Netac OnlyDisk Mini U2CV2 512MB USB 2.0 Flash Drive */
+UNUSUAL_DEV( 0x0dd8, 0xd202, 0x, 0x,
+   Netac,
+   USB Flash Disk,
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
+   US_FL_IGNORE_RESIDUE ),
+
+
 /* Patch by Stephan Walter [EMAIL PROTECTED]
  * I don't know why, but it works... */
 UNUSUAL_DEV( 0x0dda, 0x0001, 0x0012, 0x0012,
-- 
1.5.2.1


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH 5/9] USB: cxacru: add Documentation file

2007-06-08 Thread Greg Kroah-Hartman
From: Simon Arlott [EMAIL PROTECTED]

The sysfs attributes for exposing cxacru statistics/status information with
possible values is now explained in Documentation/networking/cxacru.txt
including information on the writable adsl_state attribute's commands and a
sample of the kernel log format.

Signed-off-by: Simon Arlott [EMAIL PROTECTED]
Cc: Duncan Sands [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 Documentation/networking/00-INDEX   |2 +
 Documentation/networking/cxacru.txt |   84 +++
 2 files changed, 86 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/networking/cxacru.txt

diff --git a/Documentation/networking/00-INDEX 
b/Documentation/networking/00-INDEX
index e06b6e3..153d84d 100644
--- a/Documentation/networking/00-INDEX
+++ b/Documentation/networking/00-INDEX
@@ -32,6 +32,8 @@ cops.txt
- info on the COPS LocalTalk Linux driver
 cs89x0.txt
- the Crystal LAN (CS8900/20-based) Ethernet ISA adapter driver
+cxacru.txt
+   - Conexant AccessRunner USB ADSL Modem
 de4x5.txt
- the Digital EtherWORKS DE4?? and DE5?? PCI Ethernet driver
 decnet.txt
diff --git a/Documentation/networking/cxacru.txt 
b/Documentation/networking/cxacru.txt
new file mode 100644
index 000..b074681
--- /dev/null
+++ b/Documentation/networking/cxacru.txt
@@ -0,0 +1,84 @@
+Firmware is required for this device: http://accessrunner.sourceforge.net/
+
+While it is capable of managing/maintaining the ADSL connection without the
+module loaded, the device will sometimes stop responding after unloading the
+driver and it is necessary to unplug/remove power to the device to fix this.
+
+Detected devices will appear as ATM devices named cxacru. In /sys/class/atm/
+these are directories named cxacruN where N is the device number. A symlink
+named device points to the USB interface device's directory which contains
+several sysfs attribute files for retrieving device statistics:
+
+* adsl_controller_version
+
+* adsl_headend
+* adsl_headend_environment
+   Information about the remote headend.
+
+* downstream_attenuation (dB)
+* downstream_bits_per_frame
+* downstream_rate (kbps)
+* downstream_snr_margin (dB)
+   Downstream stats.
+
+* upstream_attenuation (dB)
+* upstream_bits_per_frame
+* upstream_rate (kbps)
+* upstream_snr_margin (dB)
+* transmitter_power (dBm/Hz)
+   Upstream stats.
+
+* downstream_crc_errors
+* downstream_fec_errors
+* downstream_hec_errors
+* upstream_crc_errors
+* upstream_fec_errors
+* upstream_hec_errors
+   Error counts.
+
+* line_startable
+   Indicates that ADSL support on the device
+   is/can be enabled, see adsl_start.
+
+* line_status
+   initialising
+   down
+   attempting to activate
+   training
+   channel analysis
+   exchange
+   waiting
+   up
+
+   Changes between down and attempting to activate
+   if there is no signal.
+
+* link_status
+   not connected
+   connected
+   lost
+
+* mac_address
+
+* modulation
+   ANSI T1.413
+   ITU-T G.992.1 (G.DMT)
+   ITU-T G.992.2 (G.LITE)
+
+* startup_attempts
+   Count of total attempts to initialise ADSL.
+
+To enable/disable ADSL, the following can be written to the adsl_state file:
+   start
+   stop
+   restart (stops, waits 1.5s, then starts)
+   poll (used to resume status polling if it was disabled due to failure)
+
+Changes in adsl/line state are reported via kernel log messages:
+   [4942145.150704] ATM dev 0: ADSL state: running
+   [4942243.663766] ATM dev 0: ADSL line: down
+   [4942249.665075] ATM dev 0: ADSL line: attempting to activate
+   [4942253.654954] ATM dev 0: ADSL line: training
+   [4942255.666387] ATM dev 0: ADSL line: channel analysis
+   [4942259.656262] ATM dev 0: ADSL line: exchange
+   [2635357.696901] ATM dev 0: ADSL line: up (8128 kb/s down | 832 kb/s up)
-- 
1.5.2.1


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH 6/9] USB: cxacru: create sysfs attributes in atm_start instead of bind

2007-06-08 Thread Greg Kroah-Hartman
From: Simon Arlott [EMAIL PROTECTED]

Since usbatm doesn't set the usb_interface driver data until after calling
bind and heavy_init, it would be NULL when the sysfs attributes are read.
Reading the MAC address from atm_dev before atm_dev exists would have been
be possible too.

Calling create_device_file in atm_start will avoid this problem, and the
data is useless until the first status poll runs.  However, it must be
ready before a status poll does a printk on line status change otherwise
userspace could react before the files exist.

For completeness I've moved remove_device_file to atm_stop so it's not
called in unbind when it's not needed.  There's no point starting ADSL if
atm_start could still fail either.

Signed-off-by: Simon Arlott [EMAIL PROTECTED]
Cc: Duncan Sands [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/usb/atm/cxacru.c |   45 +
 1 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 30b7bfb..68cf582 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -629,10 +629,22 @@ static int cxacru_card_status(struct cxacru_data 
*instance)
return 0;
 }
 
+static void cxacru_remove_device_files(struct usbatm_data *usbatm_instance,
+   struct atm_dev *atm_dev)
+{
+   struct usb_interface *intf = usbatm_instance-usb_intf;
+
+   #define CXACRU_DEVICE_REMOVE_FILE(_name) \
+   device_remove_file(intf-dev, dev_attr_##_name);
+   CXACRU_ALL_FILES(REMOVE);
+   #undef CXACRU_DEVICE_REMOVE_FILE
+}
+
 static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
struct atm_dev *atm_dev)
 {
struct cxacru_data *instance = usbatm_instance-driver_data;
+   struct usb_interface *intf = usbatm_instance-usb_intf;
/*
struct atm_dev *atm_dev = usbatm_instance-atm_dev;
*/
@@ -649,6 +661,13 @@ static int cxacru_atm_start(struct usbatm_data 
*usbatm_instance,
return ret;
}
 
+   #define CXACRU_DEVICE_CREATE_FILE(_name) \
+   ret = device_create_file(intf-dev, dev_attr_##_name); \
+   if (unlikely(ret)) \
+   goto fail_sysfs;
+   CXACRU_ALL_FILES(CREATE);
+   #undef CXACRU_DEVICE_CREATE_FILE
+
/* start ADSL */
mutex_lock(instance-adsl_state_serialize);
ret = cxacru_cm(instance, CM_REQUEST_CHIP_ADSL_LINE_START, NULL, 0, 
NULL, 0);
@@ -680,6 +699,11 @@ static int cxacru_atm_start(struct usbatm_data 
*usbatm_instance,
if (start_polling)
cxacru_poll_status(instance-poll_work.work);
return 0;
+
+fail_sysfs:
+   usb_err(usbatm_instance, cxacru_atm_start: device_create_file failed 
(%d)\n, ret);
+   cxacru_remove_device_files(usbatm_instance, atm_dev);
+   return ret;
 }
 
 static void cxacru_poll_status(struct work_struct *work)
@@ -1065,13 +1089,6 @@ static int cxacru_bind(struct usbatm_data 
*usbatm_instance,
goto fail;
}
 
-   #define CXACRU_DEVICE_CREATE_FILE(_name) \
-   ret = device_create_file(intf-dev, dev_attr_##_name); \
-   if (unlikely(ret)) \
-   goto fail_sysfs;
-   CXACRU_ALL_FILES(CREATE);
-   #undef CXACRU_DEVICE_CREATE_FILE
-
usb_fill_int_urb(instance-rcv_urb,
usb_dev, usb_rcvintpipe(usb_dev, CXACRU_EP_CMD),
instance-rcv_buf, PAGE_SIZE,
@@ -1092,14 +1109,6 @@ static int cxacru_bind(struct usbatm_data 
*usbatm_instance,
 
return 0;
 
- fail_sysfs:
-   dbg(cxacru_bind: device_create_file failed (%d)\n, ret);
-
-   #define CXACRU_DEVICE_REMOVE_FILE(_name) \
-   device_remove_file(intf-dev, dev_attr_##_name);
-   CXACRU_ALL_FILES(REMOVE);
-   #undef CXACRU_DEVICE_REVOVE_FILE
-
  fail:
free_page((unsigned long) instance-snd_buf);
free_page((unsigned long) instance-rcv_buf);
@@ -1146,11 +1155,6 @@ static void cxacru_unbind(struct usbatm_data 
*usbatm_instance,
free_page((unsigned long) instance-snd_buf);
free_page((unsigned long) instance-rcv_buf);
 
-   #define CXACRU_DEVICE_REMOVE_FILE(_name) \
-   device_remove_file(intf-dev, dev_attr_##_name);
-   CXACRU_ALL_FILES(REMOVE);
-   #undef CXACRU_DEVICE_REVOVE_FILE
-
kfree(instance);
 
usbatm_instance-driver_data = NULL;
@@ -1231,6 +1235,7 @@ static struct usbatm_driver cxacru_driver = {
.heavy_init = cxacru_heavy_init,
.unbind = cxacru_unbind,
.atm_start  = cxacru_atm_start,
+   .atm_stop   = cxacru_remove_device_files,
.bulk_in= CXACRU_EP_DATA,
.bulk_out   = CXACRU_EP_DATA,
.rx_padding = 3,
-- 
1.5.2.1


-
This 

[linux-usb-devel] [PATCH 7/9] USB: cxacru: ignore error trying to start ADSL in atm_start

2007-06-08 Thread Greg Kroah-Hartman
From: Simon Arlott [EMAIL PROTECTED]

The sysfs adsl_status attribute ignores (aside from returning -EIO to the
user) any error sending a START/STOP command to the device and there is at
least one firmware which never sends a response but appears to work
regardless.  Therefore atm_start should also continue if an error is received
so that such firmware is usable.

The official Conexant driver doesn't expect a reply either but this is for
another device (E2 router) and a commonly used firmware does respond.

Also, there is no point in changing -ECONNRESET to -ETIMEDOUT since nothing
ever checks for either of these values.

Signed-off-by: Simon Arlott [EMAIL PROTECTED]
Cc: Duncan Sands [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/usb/atm/cxacru.c |7 +--
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 68cf582..8bcf7fe 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -476,8 +476,6 @@ static int cxacru_start_wait_urb(struct urb *urb, struct 
completion *done,
add_timer(timer);
wait_for_completion(done);
status = urb-status;
-   if (status == -ECONNRESET)
-   status = -ETIMEDOUT;
del_timer_sync(timer);
 
if (actual_length)
@@ -671,11 +669,8 @@ static int cxacru_atm_start(struct usbatm_data 
*usbatm_instance,
/* start ADSL */
mutex_lock(instance-adsl_state_serialize);
ret = cxacru_cm(instance, CM_REQUEST_CHIP_ADSL_LINE_START, NULL, 0, 
NULL, 0);
-   if (ret  0) {
+   if (ret  0)
atm_err(usbatm_instance, cxacru_atm_start: 
CHIP_ADSL_LINE_START returned %d\n, ret);
-   mutex_unlock(instance-adsl_state_serialize);
-   return ret;
-   }
 
/* Start status polling */
mutex_lock(instance-poll_state_serialize);
-- 
1.5.2.1


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH 8/9] USB: Fix up bogus bInterval values in endpoint descriptors

2007-06-08 Thread Greg Kroah-Hartman
From: Alan Stern [EMAIL PROTECTED]

This patch (as904) adds code to check for endpoint descriptor bInterval
values outside the legal limits.  Illegal values are set to 32 ms, which
seems like a reasonable default.

This fixes Bugzilla #8432.

Signed-off-by: Alan Stern [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/usb/core/config.c |   42 +-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 2d4fd53..dd34823 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -1,4 +1,5 @@
 #include linux/usb.h
+#include linux/usb/ch9.h
 #include linux/module.h
 #include linux/init.h
 #include linux/slab.h
@@ -49,7 +50,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, 
int inum,
unsigned char *buffer0 = buffer;
struct usb_endpoint_descriptor *d;
struct usb_host_endpoint *endpoint;
-   int n, i;
+   int n, i, j;
 
d = (struct usb_endpoint_descriptor *) buffer;
buffer += d-bLength;
@@ -84,6 +85,45 @@ static int usb_parse_endpoint(struct device *ddev, int 
cfgno, int inum,
memcpy(endpoint-desc, d, n);
INIT_LIST_HEAD(endpoint-urb_list);
 
+   /* If the bInterval value is outside the legal range,
+* set it to a default value: 32 ms */
+   i = 0;  /* i = min, j = max, n = default */
+   j = 255;
+   if (usb_endpoint_xfer_int(d)) {
+   i = 1;
+   switch (to_usb_device(ddev)-speed) {
+   case USB_SPEED_HIGH:
+   n = 9;  /* 32 ms = 2^(9-1) uframes */
+   j = 16;
+   break;
+   default:/* USB_SPEED_FULL or _LOW */
+   /* For low-speed, 10 ms is the official minimum.
+* But some overclocked devices might want faster
+* polling so we'll allow it. */
+   n = 32;
+   break;
+   }
+   } else if (usb_endpoint_xfer_isoc(d)) {
+   i = 1;
+   j = 16;
+   switch (to_usb_device(ddev)-speed) {
+   case USB_SPEED_HIGH:
+   n = 9;  /* 32 ms = 2^(9-1) uframes */
+   break;
+   default:/* USB_SPEED_FULL */
+   n = 6;  /* 32 ms = 2^(6-1) frames */
+   break;
+   }
+   }
+   if (d-bInterval  i || d-bInterval  j) {
+   dev_warn(ddev, config %d interface %d altsetting %d 
+   endpoint 0x%X has an invalid bInterval %d, 
+   changing to %d\n,
+   cfgno, inum, asnum,
+   d-bEndpointAddress, d-bInterval, n);
+   endpoint-desc.bInterval = n;
+   }
+
/* Skip over any Class Specific or Vendor Specific descriptors;
 * find the next endpoint or interface descriptor */
endpoint-extra = buffer;
-- 
1.5.2.1


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH 9/9] OHCI: Fix machine check in ohci_hub_status_data

2007-06-08 Thread Greg Kroah-Hartman
From: Alan Stern [EMAIL PROTECTED]

This patch (as901) fixes an oversight in ohci-hcd.  The
hub_status_data routine must not try to access the controller's
memory-mapped registers if the controller is in a low-power state;
such attempts will cause a crash on some architectures (such as PPC).

Signed-off-by: Alan Stern [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/usb/host/ohci-hub.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 216c9c9..bb9cc59 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -417,6 +417,8 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
unsigned long   flags;
 
spin_lock_irqsave (ohci-lock, flags);
+   if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, hcd-flags))
+   goto done;
 
/* undocumented erratum seen on at least rev D */
if ((ohci-flags  OHCI_QUIRK_AMD756)
-- 
1.5.2.1


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [Bugme-new] [Bug 8602] New: Computer becomes work too slowly when usb drive connected and after that

2007-06-08 Thread Andrew Morton
On Fri, 8 Jun 2007 21:29:13 -0700 [EMAIL PROTECTED] wrote:

 http://bugzilla.kernel.org/show_bug.cgi?id=8602
 
Summary: Computer becomes work too slowly when usb drive
 connected and after that
 Kernel Version: 2.6.19.2
 Status: NEW
   Severity: normal
  Owner: [EMAIL PROTECTED]
  Submitter: [EMAIL PROTECTED]
 
 
 I have old computer :) and bought VIA PCI USB controller. Mouse and 
 printer/scanner works fine, but when i connect a usb drive or card reader, 
 system becomes work very slowly. Deattach of usb drive/reader does not take 
 effect. Disabling udev,dbus and hal services does not take effect too :(
 
 
 Linux chek 2.6.19.2 #19 Wed May 23 19:42:29 NOVST 2007 i586 AMD-K6(tm) 3D 
 processor AuthenticAMD GNU/Linux
 
 Gnu C  3.4.6
 Gnu make   3.81
 binutils   2.17
 util-linux 2.12r
 mount  2.12r
 module-init-tools  3.2.2
 e2fsprogs  1.39
 PPP2.4.4
 Linux C Library libc.2.5
 Dynamic linker (ldd)   2.5
 Procps 3.2.7
 Net-tools  1.60
 Kbd1.12
 Sh-utils   6.7
 udev   103
 Modules Loaded nvidia
 
 lspci -vvv:
 =
 00:00.0 Host bridge: ALi Corporation M1541 (rev 04)
   Subsystem: ALi Corporation ALI M1541 Aladdin V/V+ AGP System Controller
   Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
 Stepping- 
 SERR- FastB2B-
   Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow TAbort- TAbort- 
 MAbort+ SERR- PERR-
   Latency: 32
   Region 0: Memory at d800 (32-bit, non-prefetchable) [size=64M]
   Capabilities: [b0] AGP version 1.0
   Status: RQ=28 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 
 64bit- FW- 
 AGP3- Rate=x1,x2
   Command: RQ=28 ArqSz=0 Cal=0 SBA- AGP+ GART64- 64bit- FW- 
 Rate=x1
 
 00:01.0 PCI bridge: ALi Corporation M1541 PCI to AGP Controller (rev 04) 
 (prog-if 00 [Normal decode])
   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
 Stepping- 
 SERR+ FastB2B-
   Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow TAbort- TAbort- 
 MAbort- SERR- PERR-
   Latency: 32
   Bus: primary=00, secondary=01, subordinate=01, sec-latency=32
   I/O behind bridge: f000-0fff
   Memory behind bridge: dc00-ddff
   Prefetchable memory behind bridge: de00-dfff
   Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast TAbort- TAbort- 
 MAbort+ SERR- PERR-
   BridgeCtl: Parity- SERR+ NoISA+ VGA+ MAbort- Reset- FastB2B-
 
 00:07.0 ISA bridge: ALi Corporation M1533/M1535 PCI to ISA Bridge [Aladdin 
 IV/V/V+] (rev c3)
   Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- 
 Stepping- 
 SERR- FastB2B-
   Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium TAbort- 
 TAbort+ 
 MAbort+ SERR- PERR-
   Latency: 0
 
 00:0d.0 IDE interface: ALi Corporation M5229 IDE (rev c1) (prog-if fa)
   Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
 Stepping- 
 SERR- FastB2B-
   Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium TAbort- 
 TAbort- 
 MAbort- SERR- PERR-
   Latency: 32 (500ns min, 1000ns max)
   Interrupt: pin A routed to IRQ 9
   Region 4: I/O ports at f000 [size=16]
 
 00:0e.0 Multimedia video controller: Brooktree Corporation Bt878 Video 
 Capture 
 (rev 11)
   Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
 Stepping- 
 SERR- FastB2B-
   Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium TAbort- 
 TAbort- 
 MAbort- SERR- PERR-
   Latency: 32 (4000ns min, 1ns max)
   Interrupt: pin A routed to IRQ 10
   Region 0: Memory at e0001000 (32-bit, prefetchable) [size=4K]
   Capabilities: [44] Vital Product Data
   Capabilities: [4c] Power Management version 2
   Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA 
 PME(D0-,D1-,D2-,D3hot-,D3cold-)
   Status: D0 PME-Enable- DSel=0 DScale=0 PME-
 
 00:0e.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 
 11)
   Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
 Stepping- 
 SERR- FastB2B-
   Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium TAbort- 
 TAbort- 
 MAbort- SERR- PERR-
   Latency: 32 (1000ns min, 63750ns max)
   Interrupt: pin A routed to IRQ 10
   Region 0: Memory at e0002000 (32-bit, prefetchable) [size=4K]
   Capabilities: [44] Vital Product Data
   Capabilities: [4c] Power Management version 2
   Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA 
 PME(D0-,D1-,D2-,D3hot-,D3cold-)
   Status: D0 PME-Enable- DSel=0 DScale=0 PME-
 
 00:0f.0 USB Controller: VIA Technologies, Inc. VT82x UHCI USB 1.1 
 Controller (rev 61) (prog-if 00 [UHCI])