linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: vitor <Vitor.Soares@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Przemyslaw Gaj <pgaj@cadence.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Sekhar Nori <nsekhar@ti.com>, Wolfram Sang <wsa@the-dreams.de>,
	Linux I2C <linux-i2c@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	gregkh <gregkh@linuxfoundation.org>,
	Przemyslaw Sroka <psroka@cadence.com>,
	Arkadiusz Golec <agolec@cadence.com>,
	Alan Douglas <adouglas@cadence.com>,
	Bartosz Folta <bfolta@cadence.com>, Damian Kos <dkos@cadence.com>,
	"Alicja Jurasik-Urbaniak" <alicja@cadence.com>,
	Cyprian Wronka <cwronka@cadence.com>,
	Suresh Punnoose <sureshp@cadence.com>,
	Rafal Ciepiela <rafalc@cadence.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Nishanth Menon <nm@ti.com>, Rob Herring <robh+dt@kernel.org>,
	Pawel Moll <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	DTML <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Xiang Lin <Xiang.Lin@synaptics.com>,
	Peter Rosin <peda@axentia.se>
Subject: Re: [PATCH v6 01/10] i3c: Add core I3C infrastructure
Date: Thu, 6 Sep 2018 18:06:43 +0200	[thread overview]
Message-ID: <20180906180643.3b1420fc@bbrezillon> (raw)
In-Reply-To: <5a2ed122-b56f-421b-34e0-74ef551b76b8@synopsys.com>

On Thu, 6 Sep 2018 16:17:58 +0100
vitor <Vitor.Soares@synopsys.com> wrote:

> Hi Boris,
> 
> 
> On 06-09-2018 15:14, Boris Brezillon wrote:
> > On Thu, 6 Sep 2018 14:50:03 +0100
> > vitor <Vitor.Soares@synopsys.com> wrote:
> >  
> >> Hi,
> >>
> >>
> >> On 06-09-2018 14:20, Boris Brezillon wrote:  
> >>> On Thu, 6 Sep 2018 15:14:37 +0200
> >>> Boris Brezillon <boris.brezillon@bootlin.com> wrote:
> >>>     
> >>>> On Thu, 6 Sep 2018 14:59:46 +0200
> >>>> Arnd Bergmann <arnd@arndb.de> wrote:
> >>>>     
> >>>>> On Thu, Sep 6, 2018 at 2:43 PM Przemyslaw Gaj <pgaj@cadence.com> wrote:  
> >>>>>> Hi Boris, Vitor,
> >>>>>>
> >>>>>> This repository does not contain full kernel sources, but it should be enough to discuss mastership request feature.
> >>>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_przemekgaj_i3c-2Dlinux_commit_d54fe68a9d3e573c0c454a2c6f1afafc20142ec5&d=DwICAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=qVuU64u9x77Y0Kd0PhDK_lpxFgg6PK9PateHwjb_DY0&m=Q9DWw3KGmshGw0f5QTiffbpbESyUlPx6KmASuDBtX9Y&s=HHE_y1kyMszJvP_tSP9JkDlPYxDywBeHwkMGgCR11uI&e=
> >>>>>>
> >>>>>> Please keep in mind that this is initial version, but mastership works correctly. I added one property to DT to reflect relationship between masters.
> >>>>>> It is possible to request mastership on demand (using sysfs. Useful in case when Linux machine is equipped only with secondary master controller) or automatically change operation mode when device driver wants to read/write something from/to device.
> >>>>>>
> >>>>>> I'm sure I will have to rework something because this was implemented on sources from PATCH v4. I saw that Boris released v7 yesterday :)  
> >>>>> Can you explain the reason for having a user space interface and DT property?
> >>>>> I thought we had concluded earlier that we wouldn't need that, but it's possible
> >>>>> that I missed something in the discussion since then.  
> >>>> I don't think the sysfs knob is needed, this being said, after thinking
> >>>> a bit more about mastership handover and the secondary master case, I
> >>>> think we have something important to solve.
> >>>>
> >>>> When a master is not in control of the bus, it gets informed of devices
> >>>> present on the bus by monitoring DAA or DEFSLVS broadcast events. That
> >>>> means the secondary master should populate the bus with I3C/I2C devices
> >>>> on such events, but that's not enough, because DEFSLVS/DAA do not
> >>>> provide all device info.Some of them (like read/write/ibi limitations)
> >>>> require extra CCC commands, and, to send those CCC commands, the
> >>>> secondary master must claim the bus. We could add a case where we
> >>>> declare devices as partially discovered until the master acquires
> >>>> ownership of the bus, but that means part of the data returned by
> >>>> i3c_device_get_info() will be inaccurate, which might have an impact on
> >>>> some i3c driver ->probe() functions.  
> >>> Hm, one possible solution would be to register partially discovered
> >>> devices to the device model and let i3c_device_get_info() claim the bus
> >>> and request missing data when needed. This way, if the driver needs to
> >>> call i3c_device_get_info() in its probe path, it should work just fine.  
> >> Why don't use the i3c_master_add_i3c_dev_locked that job? It create,
> >> attach and retrieve the device info.  
> > When will you call i3c_master_add_i3c_dev_locked()? After receiving a
> > DEFSLVS interrupt/event? When that happens you're not in control of the
> > bus, which means you'll have to force bus ownership handover. Is this
> > really what we want?
> >
> > These are not rhetorical questions, I'm really asking for your opinion
> > here.  
> What I understand from last discussion was that every time that device 
> need to do something (private messages) on the bus and don't have the 
> bus control it should force ownership handover.
> If my understanding is correct this can be also applied to CCC commands.

Sure, but the question is more, when do we want to do that?

> 
> >  
> >> This can be triggered after the secondary master receive ENEC MR until
> >> them is keep in the driver memory.  
> > But that means no-one will actually trigger a mastership request,
> > because devices won't be registered until all info are available. If we
> > take this path, we should have a way to explicitly trigger a mastership
> > request (sysfs knob or any other means).  
> By the current flow that we have now, we enable the IBI events at the 
> end of .do_daa. At this time the main master bus is initialized with all 
> devices.
> 
>  From the point of view of secondary master, it first participate on DAA 
> process, next it send its info (Main master do 
> i3c_master_retrieve_dev_info()) and them receive DEFSLVS. In the stage 
> it cannot request the bus mastership it need the MR enable.

You mean the broadcast ENEC(MR) event, right? Then yes, this one is
probably missing (or maybe I added it in the master controller driver,
I don't remember).

> 
> So, what I would suggest is to keep DEFSLVS data in secondary master 
> driver memory . When secondary master receive the MR enable, it can get 
> the bus ownership and do i3c_master_add_i3c_dev_locked() and each device 
> in DEFSLVS command. After this step delegate the bus ownership to the 
> main master.

That's an option, indeed.

> 
> What do you think about this?

Sounds like a good start. If MR is rejected by the master, we will just
keep all devices in an unregistered state. We can also add a sysfs
entry to manually re-trigger this operation in case the initial one
failed.

  reply	other threads:[~2018-09-06 16:07 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 15:29 [PATCH v6 00/10] Add the I3C subsystem Boris Brezillon
2018-07-19 15:29 ` [PATCH v6 01/10] i3c: Add core I3C infrastructure Boris Brezillon
2018-08-03 21:38   ` mshettel
2018-08-04  5:33     ` Boris Brezillon
2018-08-22 16:43   ` vitor
2018-08-24 12:39     ` Boris Brezillon
2018-08-24 17:52       ` vitor
2018-08-24 18:16         ` Boris Brezillon
2018-08-28 11:50           ` vitor
2018-08-28 12:02             ` Boris Brezillon
2018-08-28 12:55               ` Przemyslaw Gaj
2018-08-28 13:01                 ` Boris Brezillon
2018-08-29  7:41                   ` Przemyslaw Gaj
2018-08-28 13:03                 ` Boris Brezillon
2018-08-30 13:57                 ` vitor
2018-08-30 19:00                   ` Przemyslaw Gaj
2018-09-03  9:33                     ` vitor
2018-09-04 11:03                       ` Przemyslaw Gaj
2018-09-06 12:43                       ` Przemyslaw Gaj
2018-09-06 12:59                         ` Arnd Bergmann
2018-09-06 13:14                           ` Boris Brezillon
2018-09-06 13:20                             ` Boris Brezillon
2018-09-06 13:45                               ` Arnd Bergmann
2018-09-06 13:50                               ` vitor
2018-09-06 14:14                                 ` Boris Brezillon
2018-09-06 15:17                                   ` vitor
2018-09-06 16:06                                     ` Boris Brezillon [this message]
2018-09-06 16:17                                       ` Przemyslaw Gaj
2018-09-10 16:16                                         ` vitor
2018-09-07  7:51                                       ` Przemyslaw Gaj
2018-09-06 13:47                             ` Przemyslaw Gaj
2018-09-06 14:09                               ` Boris Brezillon
2018-09-06 14:20                                 ` Przemyslaw Gaj
2018-07-19 15:29 ` [PATCH v6 02/10] docs: driver-api: Add I3C documentation Boris Brezillon
2018-07-19 15:29 ` [PATCH v6 03/10] i3c: Add sysfs ABI spec Boris Brezillon
2018-07-19 15:29 ` [PATCH v6 04/10] dt-bindings: i3c: Document core bindings Boris Brezillon
2018-07-19 15:29 ` [PATCH v6 05/10] dt-bindings: i3c: Add macros to help fill I3C/I2C device's reg property Boris Brezillon
2018-07-19 15:29 ` [PATCH v6 06/10] MAINTAINERS: Add myself as the I3C subsystem maintainer Boris Brezillon
2018-07-19 15:29 ` [PATCH v6 07/10] i3c: master: Add driver for Cadence IP Boris Brezillon
2018-07-19 15:29 ` [PATCH v6 08/10] dt-bindings: i3c: Document Cadence I3C master bindings Boris Brezillon
2018-07-19 15:29 ` [PATCH v6 09/10] gpio: Add a driver for Cadence I3C GPIO expander Boris Brezillon
2018-07-19 15:29 ` [PATCH v6 10/10] dt-bindings: gpio: Add bindings for Cadence I3C gpio expander Boris Brezillon
2018-07-20  8:52 ` [PATCH v6 00/10] Add the I3C subsystem Arnd Bergmann
2018-07-20  9:57   ` Peter Rosin
2018-07-20 10:05     ` Boris Brezillon
2018-07-20 10:39       ` Peter Rosin
2018-07-20 10:12     ` Wolfram Sang
2018-07-20 10:57       ` Arnd Bergmann
2018-07-20 11:05         ` Wolfram Sang
2018-07-20 11:13         ` Peter Rosin
2018-07-20 11:28           ` Arnd Bergmann
2018-07-20 13:16             ` Peter Rosin
2018-07-20 15:41               ` Wolfram Sang
2018-07-24 14:14                 ` Arnd Bergmann
2018-07-24 15:57                   ` Wolfram Sang
2018-07-24 16:04                     ` Arnd Bergmann
2018-07-24 20:22                       ` Wolfram Sang
2018-07-24 16:07                     ` Boris Brezillon
2018-07-20 13:17             ` Boris Brezillon
2018-07-24 14:03               ` Arnd Bergmann
2018-07-24 14:28                 ` Boris Brezillon
2018-07-24 15:05                   ` Arnd Bergmann
2018-07-24 15:15                     ` Geert Uytterhoeven
2018-07-24 15:40                       ` Arnd Bergmann
2018-07-24 15:46                         ` Geert Uytterhoeven
2018-07-24 15:58                           ` Arnd Bergmann
2018-07-24 16:14                             ` Boris Brezillon
2018-07-24 16:25                               ` Arnd Bergmann
2018-07-24 16:54                                 ` Boris Brezillon
2018-07-24 20:21                                   ` Arnd Bergmann
2018-07-24 16:04                       ` Wolfram Sang

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=20180906180643.3b1420fc@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=Vitor.Soares@synopsys.com \
    --cc=Xiang.Lin@synaptics.com \
    --cc=adouglas@cadence.com \
    --cc=agolec@cadence.com \
    --cc=alicja@cadence.com \
    --cc=arnd@arndb.de \
    --cc=bfolta@cadence.com \
    --cc=corbet@lwn.net \
    --cc=cwronka@cadence.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dkos@cadence.com \
    --cc=galak@codeaurora.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=pawel.moll@arm.com \
    --cc=peda@axentia.se \
    --cc=pgaj@cadence.com \
    --cc=psroka@cadence.com \
    --cc=rafalc@cadence.com \
    --cc=robh+dt@kernel.org \
    --cc=sureshp@cadence.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wsa@the-dreams.de \
    /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).