linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: chethan tn <chethantn@gmail.com>,
	Chethan T N <chethan.tumkur.narayan@intel.com>,
	Bluez mailing list <linux-bluetooth@vger.kernel.org>,
	"Bag, Amit K" <amit.k.bag@intel.com>,
	raghuram.hegde@intel.com, sukumar.ghorai@intel.com,
	rajatja@chromium.org
Subject: Re: [Patch v1] Bluetooth: Add Rfkill driver for Intel Bluetooth controller
Date: Thu, 8 Nov 2018 09:33:14 +0100	[thread overview]
Message-ID: <261DCD38-D597-404C-92F3-30FB4E40F1FB@holtmann.org> (raw)
In-Reply-To: <CAKdAkRQsmx_idHCUAVTvPpnEYFdS6a0C_oNdjBQms6cBe6OwBw@mail.gmail.com>

Hi Dmitry,

>>>>>> We are planning to further implement the followings, kindly please
>>>>>> provide your suggestions.
>>>>>> 1. To handle more than 1 Intel BT controller connected to platform,
>>>>>> will keep list of the objects in "static const struct acpi_device_id
>>>>>> intel_bt_rfkill_acpi_match[] ". And keep a list of "struct
>>>>>> intel_bt_rfkill_dev" for each of the acpi object.
>>>>>> 2.  With this implementation from user space RF kill for the device
>>>>>> object is achieved, however need to map the rfkill object with the
>>>>>> corresponding "hdev" so that on error from the controller kernel can
>>>>>> do the reset through this RF Kill driver.
>>>>> 
>>>>> I am confused, why you model a generic chip reset functionality via
>>>>> RFKill subsystem. As far as I understand, the issue is that you want to
>>>>> be able to reset the chip when it gets confused and not actually disable
>>>>> the chip/stop it from emitting RF signals.
>>>>> 
>>>>> I believe this functionality should be contained in the driver and you
>>>>> simply need to come with a way to tie the adapter instance with data in
>>>>> ACPI, probably based on physical USB connection.
>>>> 
>>>> it is impossible to do that in the driver since what the GPIO is doing is to push the USB device off the bus. So you actually see an USB disconnect and a new re-enumeration when it comes back. Meaning the driver knows nothing during that time.
>>> 
>>> The driver would know that it is in the middle of resetting the
>>> device. The fact that the device disappears from the bus is not a big
>>> deal. You just need to make sure you finish the reset task running
>>> before finishing teardown of the device in disconnect method.
>> 
>> it is a big deal and it is unpredictable. We can not magically assign resources to a device that is about to go away.
> 
> Nor should you. You allocate the resources at bind time.
> 
>> And more importantly you have no idea which device goes away.
> 
> What do you mean? The reset line goes to exactly one controller. You
> just need to find a way to describe it in ACPI. Probably attach to the
> device that describes USB port the controller is attached to?
> 
> This is not the first device hard-wired USB device that needs
> additional info supplied via ACPI or DT, and we already have a way to
> specify bindings in device tree for USB devices:
> Documentation/devicetree/bindings/usb/usb-device.txt and actually
> btusb itself: Documentation/devicetree/bindings/net/btusb.txt
> 
> Can we adopt the above to ACPI?

I have no heard from anybody on how that can be describe nor that it is for this hardware. So for the driver this binding between the GPIO and the USB interface / device does not exist.

>>>> This is a classic soft RFKILL switch like we have seen in the early Thinkpads.
>>> 
>>> It is not RFkill as, as far as I understand, it does not guarantee
>>> that it actually blocks the transmitter. It really is a reset line and
>>> its purpose is to unwedge the chip, not keep it in the off state. I do
>>> not think there is a reason to export this as RFkill switch to
>>> userspace and then build infrastructure to recognize that this is
>>> special kind of RFkill switch that can be used to work around issues
>>> in the controller. Have the driver assert and deassert it to kick
>>> itself off the bus, the USB hotplug will take care of the rest.
>> 
>> It is a RFKILL switch since the device looses power and with also turns RF off. As I said, this is the same as with the old Thinkpads where we have done exactly the same.
> 
> I believe you should not only look at the end result, but also at the
> purpose of the facility. What is being handled here I believe was not
> intended as a switch to turn device off.

It is powering off and powering on the device. It is a classical Bluetooth RFKILL switch. As I said, that is how we have treated this big-hammer approach to RFKILL since the Thinkpads started doing that.

Regards

Marcel


      reply	other threads:[~2018-11-08  8:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 13:56 [Patch v1] Bluetooth: Add Rfkill driver for Intel Bluetooth controller Chethan T N
2018-11-05  9:16 ` chethan tn
2018-11-07  1:44   ` Dmitry Torokhov
2018-11-07  7:28     ` Marcel Holtmann
2018-11-07 18:40       ` Dmitry Torokhov
2018-11-07 18:48         ` Marcel Holtmann
2018-11-07 19:16           ` Dmitry Torokhov
2018-11-08  8:33             ` Marcel Holtmann [this message]

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=261DCD38-D597-404C-92F3-30FB4E40F1FB@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=amit.k.bag@intel.com \
    --cc=chethan.tumkur.narayan@intel.com \
    --cc=chethantn@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=raghuram.hegde@intel.com \
    --cc=rajatja@chromium.org \
    --cc=sukumar.ghorai@intel.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 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).