linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
To: Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
Cc: "Pali Rohár" <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Sebastian Reichel" <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>,
	"Sebastian Reichel" <sre-GFxCN5SEZAc@public.gmane.org>,
	"kernel list"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	linux-omap <linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Tony Lindgren" <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	"Aaro Koskinen" <aaro.koskinen-X3B1VOXEql0@public.gmane.org>,
	"Ivaylo Dimitrov"
	<ivo.g.dimitrov.75-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: bluetooth: Add hci_h4p driver
Date: Sun, 14 Dec 2014 23:41:38 +0100	[thread overview]
Message-ID: <20141214224138.GA11447@amd> (raw)
In-Reply-To: <D1F25806-07C6-4876-8E62-A16CFB6827EA-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>

Hi!

> >>> Hacks surrounding bluetooth address were removed; this results in
> >>> working driver with address that is probably not unique.
> >> 
> >> Just set HCI_QUIRK_INVALID_BDADDR and let someone deal with that in userspace. You can use the btmgmt public-addr command for testing.
> >> 
> > 
> > Ok, it took me a while to figure out that --enable-experimental is
> > needed.
> > 
> > Then help was playing tricks with me:
> > 
> > For more information on the usage of each command use:
> >    btmgmt <command> --help
> > root@n900:/my/bluez-5.26/tools# ./btmgmt public-addr --help
> > Set Public Address for hci0 failed with status 0x0b (Rejected)
> > root@n900:/my/bluez-5.26/tools# ./btmgmt public-addr
> > Usage: btmgmt public-addr <address>
> 
> that is indeed confusing. Something went wrong with that tool. Just keep in mind that tool is just for internal testing by the developers. Someone would still need to write a proper integration with listening for the appropriate events and dig out the actual address from the memory location.
>

You have patch that helps that issues in the email :-).

> > root@n900:/my/bluez-5.26/tools# ./btmgmt public-addr 01:02:03:04:05:06
> > Set Public Address for hci0 failed with status 0x0b (Rejected)
> > 
> > Hmm. Since setting public address only works when interface is down,
> > and we lose all the settings during up, this does not work at all,
> > right?
> 
> It does keep it. The address is stored in hdev->public_addr which is actually different from hdev->bdaddr which is the current address in use.
> 
> However I am not sure that hdev->set_bdaddr is executed again. Same
> as hdev->setup is not executed twice. The controller loosing all
> states is something we have not yet encountered. At least not
> while the hci_dev stays around.

It looks like that's the exact issue. It seems to me like set_bdaddr
is actually called while the device is "down".

> I wonder if the drastic power off might be better hooked into a
> platform RFKILL switch. And with that you would just unregister
> hci_dev and re-register it when the RFKILL switch is unblocked.

Ok, so kernel currently wants bluetooth out of reset at 

> The other option is to introduce a quirk that allows running hdev->setup and hdev->set_bdaddr all the time when you bring up your device.
> 
> Another alternate idea for getting something upstream for testing is to ignore the whole firmware loading in the kernel and bring up the controller with HCI_QUIRK_EXTERNAL_CONFIG. Doing that would allow you to do bette testing and evolve the driver in small tests.
>

Actually, firmware loading is _not_ the biggest problem. That is
pretty self-contained now.

I guess I should just configure it at probe time, put it into reset
during rmmod, keep it out of reset otherwise, and see how it works.

Thanks,

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  parent reply	other threads:[~2014-12-14 22:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-13 22:37 bluetooth: Add hci_h4p driver Pavel Machek
2014-12-13 23:30 ` Marcel Holtmann
2014-12-13 23:51   ` Pavel Machek
2014-12-14  0:07     ` Marcel Holtmann
2014-12-14  9:47       ` Pavel Machek
2014-12-14 11:16   ` Pavel Machek
     [not found]   ` <570BAC61-3137-42E5-B4F8-A61AEED380DE-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
2014-12-14 10:40     ` Pavel Machek
2014-12-14 19:21     ` Pavel Machek
2014-12-14 20:28       ` Marcel Holtmann
     [not found]         ` <D1F25806-07C6-4876-8E62-A16CFB6827EA-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
2014-12-14 22:41           ` Pavel Machek [this message]
2014-12-14 21:52   ` Pavel Machek
2014-12-15 10:01 ` Oliver Neukum
2014-12-18 19:31   ` Pavel Machek
2014-12-18 20:10     ` Pavel Machek
2014-12-15 12:10 ` Marcel Holtmann
2014-12-19  9:50   ` Pavel Machek
2014-12-19  9:58     ` Marcel Holtmann
2014-12-20 15:48       ` Pavel Machek
2014-12-20 23:39         ` Marcel Holtmann
2014-12-20 20:23 ` [PATCH] " Pavel Machek
2014-12-20 20:43   ` Paul Bolle
2014-12-20 23:35   ` Marcel Holtmann
2014-12-23 12:00     ` Pavel Machek
2014-12-23 12:41     ` Pavel Machek

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=20141214224138.GA11447@amd \
    --to=pavel-+zi9xunit7i@public.gmane.org \
    --cc=aaro.koskinen-X3B1VOXEql0@public.gmane.org \
    --cc=ivo.g.dimitrov.75-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org \
    --cc=pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org \
    --cc=sre-GFxCN5SEZAc@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).