All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Mikel Astiz <Mikel.Astiz@bmw-carit.de>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Mikel Astiz <mikel.astiz.oss@gmail.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Subject: RE: [PATCH v0 4/6] Bluetooth: Simplify outgoing SCO scheduling code
Date: Thu, 12 Apr 2012 11:52:32 +0200	[thread overview]
Message-ID: <1334224352.16897.140.camel@aeonflux> (raw)
In-Reply-To: <66BD268F973E3544A665E5F503FB38B71AFB764678@DC01.bmw-carit.intra>

Hi Mikel,

> > > > >> All data produced by userspace is sent to the controller without
> > > > >> any flow control. This was also the case before this patch, but
> > > > >> now it's more obvious and readable.
> > > > >
> > > > > as in the previous patch. You can only do this if you make sure
> > > > > that the controller does not have flow control enabled. You need
> > > > > another basic check here to ensure this first. Otherwise a lot of
> > > > > things
> > > > might break.
> > >
> > > These patches should break nothing for several reasons:
> > >
> > > 1. HCI SCO flow control is NOT enabled by default, as described in
> > the spec volume 2 part E section 7.3.37.
> > >
> > > 2. The kernel does not read or write this parameter, which means it
> > wouldn't even know if the controller would have it enabled for some
> > strange reason (however I haven't managed to find any controller that
> > even supports this).
> > 
> > this does not mean we just remove code now. We should start fixing that
> > and read the setting actually.
> > 
> > > > It also seems to remove any quote/fairness of the scheduling,
> > > > actually Im not sure how it works because it sends the frames
> > > > regardless of the number of available slots/buffers indicated by
> > > > sco_cnt, I also wonder how it will scale with multiple SCO
> > > > connections, even though it is quite rare to have more than one who
> > > > knows what crazy ideas people will come.
> > > >
> > >
> > > 3. The previous implementation in the kernel seems to be totally
> > useless, given that sco_cnt is never updated (grep for "sco_cnt--" or
> > check hci_sched_sco() and hci_sched_esco()). So the idea of a quota is
> > just an illusion here.
> > >
> > > Maybe I'm missing something here, that's why I need your feedback :-)
> > >
> > > In a nutshell: if some controller does support SCO flow control, it
> > would be straightforward to support it in the Kernel (I actually have
> > an implementation but wasn't able to test it).
> > >
> > > If the controller doesn't have this feature, which is the most common
> > case, then we either do in the kernel (time-based), in userspace, or
> > both. For the moment I just propose to do it in userspace, as we've
> > been doing recently despite the illusion I mention above.
> > >
> > > Regarding multiple SCOs, it's not a problem at all. It's actually
> > what I'm trying to achieve with these patches.
> > 
> > Lets read the settings first and see what current controllers are
> > doing.
> > That part needs to be fixed first. It is something we have been lazy
> > and ignoring it.
> > 
> 
> We don't actually need to read anything because the feature is disabled by default. As I said, that's clear in the specification.

you have no idea in what state your controller is when we are not
sending HCI Reset. And there are still some controllers where we do not
do that.

> We might try to write it (set it to 1) but this is not supported by the main controller manufacturers (to be confirmed, but that's the feedback I have). Some controllers list this feature in the supported command list (section 6.27 octet 10 bit 4), but still it's not possible to enable it.
> 
> So I don't really get why we should complicate the kernel code for something that is very rare, and that probably never actually worked.
> 
> Userspace code needs to do flow control anyway (time-based), and I don't think we want it in two different places.
> 
> The only reasonable alternative I see is that the kernel would do flow control always, with or without hardware support. As I already said, this should be quite simple, but still we are adding lines of code without any real benefit.

I do not wanna remove code from the kernel that seemed to be reasonable.
Just extend it with your case.

Regards

Marcel



  reply	other threads:[~2012-04-12  9:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11  6:48 [PATCH v0 0/6] Multiple Bluetooth SCO connections Mikel Astiz
2012-04-11  6:48 ` [PATCH v0 1/6] Bluetooth: Use unsigned int instead of signed int Mikel Astiz
2012-04-11  9:21   ` Marcel Holtmann
2012-04-13 21:59   ` Gustavo Padovan
2012-04-11  6:48 ` [PATCH v0 2/6] Bluetooth: Remove unnecessary check Mikel Astiz
2012-04-11  9:22   ` Marcel Holtmann
2012-04-13 22:01   ` Gustavo Padovan
2012-04-11  6:48 ` [PATCH v0 3/6] Bluetooth: Remove unused HCI event handling Mikel Astiz
2012-04-11  9:23   ` Marcel Holtmann
2012-04-11 15:27     ` Mikel Astiz
2012-04-11  6:48 ` [PATCH v0 4/6] Bluetooth: Simplify outgoing SCO scheduling code Mikel Astiz
2012-04-11  9:24   ` Marcel Holtmann
2012-04-11 11:43     ` Luiz Augusto von Dentz
2012-04-11 15:23       ` Mikel Astiz
2012-04-11 15:34         ` Marcel Holtmann
2012-04-12  5:58           ` Mikel Astiz
2012-04-12  9:52             ` Marcel Holtmann [this message]
2012-04-11  6:48 ` [PATCH v0 5/6] Bluetooth: btusb: Dynamic alternate setting Mikel Astiz
2012-04-11  9:26   ` Marcel Holtmann
2012-04-16 21:46   ` Gustavo Padovan
2012-04-17  9:26     ` Marcel Holtmann
2012-04-17 10:47       ` Gustavo Padovan
2012-04-11  6:48 ` [PATCH v0 6/6] Bluetooth: Remove outgoing MTU check Mikel Astiz

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=1334224352.16897.140.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=Mikel.Astiz@bmw-carit.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=mikel.astiz.oss@gmail.com \
    /path/to/YOUR_REPLY

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

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