All of lore.kernel.org
 help / color / mirror / Atom feed
From: Enric Balletbo Serra <eballetbo@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: "Daniel Kurtz" <djkurtz@chromium.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	stonea168@163.com,
	"ML dri-devel" <dri-devel@lists.freedesktop.org>,
	"Ajay Kumar" <ajaykumar.rs@samsung.com>,
	"Vincent Palatin" <vpalatin@chromium.org>,
	"cawa cheng" <cawa.cheng@mediatek.com>,
	"Russell King" <rmk+kernel@arm.linux.org.uk>,
	"Thierry Reding" <treding@nvidia.com>,
	devicetree <devicetree@vger.kernel.org>,
	"Jitao Shi" <jitao.shi@mediatek.com>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Rob Herring" <robh+dt@kernel.org>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	"Yingjoe Chen" <yingjoe.chen@mediatek.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Eddie Huang (黃智傑)" <eddie.huang@mediatek.com>,
	LAKML <linux-arm-kernel@lists.infradead.org>,
	"Rahul Sharma" <rahul.sharma@samsung.com>,
	srv_heupstream <srv_heupstream@mediatek.com>,
	"Emil Velikov" <emil.l.velikov@gmail.com>,
	"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"Kumar Gala" <galak@codeaurora.org>,
	"Andy Yan" <andy.yan@rock-chips.com>
Subject: Re: [PATCH 2/2 v16] drm/bridge: Add I2C based driver for ps8640 bridge
Date: Thu, 4 Aug 2016 12:35:59 +0200	[thread overview]
Message-ID: <CAFqH_53PgPs3_h7XNFEu4u0W6GW7vyWCNFf2vq8Yn7sH2LbFwA@mail.gmail.com> (raw)
In-Reply-To: <CAKMK7uEkUOq1CB3tj_1Qx50fBpw9B39+c3asX6MPNexT=dv9fA@mail.gmail.com>

2016-07-12 12:13 GMT+02:00 Daniel Vetter <daniel@ffwll.ch>:
> On Wed, Jun 29, 2016 at 6:31 AM, Daniel Kurtz <djkurtz@chromium.org> wrote:
>> On Fri, Jun 17, 2016 at 3:14 AM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
>>>> +static ssize_t ps8640_update_fw_store(struct device *dev,
>>>> +                                     struct device_attribute *attr,
>>>> +                                     const char *buf, size_t count)
>>>> +{
>>>> +       struct i2c_client *client = to_i2c_client(dev);
>>>> +       struct ps8640 *ps_bridge = i2c_get_clientdata(client);
>>>> +       const struct firmware *fw;
>>>> +       int error;
>>>> +
>>>> +       error = request_firmware(&fw, PS_FW_NAME, dev);
>>> Can the device operate without a firmware ? If not, why is the
>>> firmware loaded so later/after user interaction (via sysfs) ? I don't
>>> recall any other driver in DRM to use such an approach.
>>
>> The PS8640 has internal flash, so it should always already have a
>> working firmware.
>> This sysfs interface is useful for user space initiated field firmware updates.
>
> Might be better to just do a request_firmware on driver load, and
> simply proceed if it's not there. Adding a sysfs interface (which is
> abi) seems way too much overkill for this imo. If you want to upgrade
> the firmware you can then just drop it into the right directory, with
> no further interaction needed.

IMHO I'm not sure if for this use case request_firmware on driver load
is a good idea. Flash the non-volatile internal chip can be a slow
operation and if you forget to remove the firmware after drop it into
the right directory apart from slow down the driver probe you can
damage the chip depending on the write endurance of the chip.

This sysfs interface is used on other subsystems when there is a
non-volatile memory, as example you can see at [1], [2]. Unfortunately
not all are using the same sysfs interface and maybe this should be
standardized (maybe it's an opportunity to define it)

Regards,
 Enric

[1] http://lxr.free-electrons.com/source/drivers/input/touchscreen/wdt87xx_i2c.c#L922
[2] http://lxr.free-electrons.com/source/drivers/scsi/pm8001/pm8001_ctl.c#L732


> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Enric Balletbo Serra <eballetbo@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	stonea168@163.com,
	"ML dri-devel" <dri-devel@lists.freedesktop.org>,
	"Ajay Kumar" <ajaykumar.rs@samsung.com>,
	"Vincent Palatin" <vpalatin@chromium.org>,
	"cawa cheng" <cawa.cheng@mediatek.com>,
	"Yingjoe Chen" <yingjoe.chen@mediatek.com>,
	"Thierry Reding" <treding@nvidia.com>,
	devicetree <devicetree@vger.kernel.org>,
	"Jitao Shi" <jitao.shi@mediatek.com>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Rob Herring" <robh+dt@kernel.org>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	"Russell King" <rmk+kernel@arm.linux.org.uk>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Eddie Huang (黃智傑)" <eddie.huang@mediatek.com>,
	LAKML <linux-arm-kernel@lists.infradead.org>,
	"Rahul Sharma" <rahul.sharma@samsung.com>,
	srv_heupstream <srv_heupstream@mediatek.com>
Subject: Re: [PATCH 2/2 v16] drm/bridge: Add I2C based driver for ps8640 bridge
Date: Thu, 4 Aug 2016 12:35:59 +0200	[thread overview]
Message-ID: <CAFqH_53PgPs3_h7XNFEu4u0W6GW7vyWCNFf2vq8Yn7sH2LbFwA@mail.gmail.com> (raw)
In-Reply-To: <CAKMK7uEkUOq1CB3tj_1Qx50fBpw9B39+c3asX6MPNexT=dv9fA@mail.gmail.com>

2016-07-12 12:13 GMT+02:00 Daniel Vetter <daniel@ffwll.ch>:
> On Wed, Jun 29, 2016 at 6:31 AM, Daniel Kurtz <djkurtz@chromium.org> wrote:
>> On Fri, Jun 17, 2016 at 3:14 AM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
>>>> +static ssize_t ps8640_update_fw_store(struct device *dev,
>>>> +                                     struct device_attribute *attr,
>>>> +                                     const char *buf, size_t count)
>>>> +{
>>>> +       struct i2c_client *client = to_i2c_client(dev);
>>>> +       struct ps8640 *ps_bridge = i2c_get_clientdata(client);
>>>> +       const struct firmware *fw;
>>>> +       int error;
>>>> +
>>>> +       error = request_firmware(&fw, PS_FW_NAME, dev);
>>> Can the device operate without a firmware ? If not, why is the
>>> firmware loaded so later/after user interaction (via sysfs) ? I don't
>>> recall any other driver in DRM to use such an approach.
>>
>> The PS8640 has internal flash, so it should always already have a
>> working firmware.
>> This sysfs interface is useful for user space initiated field firmware updates.
>
> Might be better to just do a request_firmware on driver load, and
> simply proceed if it's not there. Adding a sysfs interface (which is
> abi) seems way too much overkill for this imo. If you want to upgrade
> the firmware you can then just drop it into the right directory, with
> no further interaction needed.

IMHO I'm not sure if for this use case request_firmware on driver load
is a good idea. Flash the non-volatile internal chip can be a slow
operation and if you forget to remove the firmware after drop it into
the right directory apart from slow down the driver probe you can
damage the chip depending on the write endurance of the chip.

This sysfs interface is used on other subsystems when there is a
non-volatile memory, as example you can see at [1], [2]. Unfortunately
not all are using the same sysfs interface and maybe this should be
standardized (maybe it's an opportunity to define it)

Regards,
 Enric

[1] http://lxr.free-electrons.com/source/drivers/input/touchscreen/wdt87xx_i2c.c#L922
[2] http://lxr.free-electrons.com/source/drivers/scsi/pm8001/pm8001_ctl.c#L732


> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: eballetbo@gmail.com (Enric Balletbo Serra)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2 v16] drm/bridge: Add I2C based driver for ps8640 bridge
Date: Thu, 4 Aug 2016 12:35:59 +0200	[thread overview]
Message-ID: <CAFqH_53PgPs3_h7XNFEu4u0W6GW7vyWCNFf2vq8Yn7sH2LbFwA@mail.gmail.com> (raw)
In-Reply-To: <CAKMK7uEkUOq1CB3tj_1Qx50fBpw9B39+c3asX6MPNexT=dv9fA@mail.gmail.com>

2016-07-12 12:13 GMT+02:00 Daniel Vetter <daniel@ffwll.ch>:
> On Wed, Jun 29, 2016 at 6:31 AM, Daniel Kurtz <djkurtz@chromium.org> wrote:
>> On Fri, Jun 17, 2016 at 3:14 AM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
>>>> +static ssize_t ps8640_update_fw_store(struct device *dev,
>>>> +                                     struct device_attribute *attr,
>>>> +                                     const char *buf, size_t count)
>>>> +{
>>>> +       struct i2c_client *client = to_i2c_client(dev);
>>>> +       struct ps8640 *ps_bridge = i2c_get_clientdata(client);
>>>> +       const struct firmware *fw;
>>>> +       int error;
>>>> +
>>>> +       error = request_firmware(&fw, PS_FW_NAME, dev);
>>> Can the device operate without a firmware ? If not, why is the
>>> firmware loaded so later/after user interaction (via sysfs) ? I don't
>>> recall any other driver in DRM to use such an approach.
>>
>> The PS8640 has internal flash, so it should always already have a
>> working firmware.
>> This sysfs interface is useful for user space initiated field firmware updates.
>
> Might be better to just do a request_firmware on driver load, and
> simply proceed if it's not there. Adding a sysfs interface (which is
> abi) seems way too much overkill for this imo. If you want to upgrade
> the firmware you can then just drop it into the right directory, with
> no further interaction needed.

IMHO I'm not sure if for this use case request_firmware on driver load
is a good idea. Flash the non-volatile internal chip can be a slow
operation and if you forget to remove the firmware after drop it into
the right directory apart from slow down the driver probe you can
damage the chip depending on the write endurance of the chip.

This sysfs interface is used on other subsystems when there is a
non-volatile memory, as example you can see at [1], [2]. Unfortunately
not all are using the same sysfs interface and maybe this should be
standardized (maybe it's an opportunity to define it)

Regards,
 Enric

[1] http://lxr.free-electrons.com/source/drivers/input/touchscreen/wdt87xx_i2c.c#L922
[2] http://lxr.free-electrons.com/source/drivers/scsi/pm8001/pm8001_ctl.c#L732


> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-08-04 11:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02  9:57 [PATCH 1/2 v16] Documentation: bridge: Add documentation for ps8640 DT properties Jitao Shi
2016-06-02  9:57 ` Jitao Shi
2016-06-02  9:57 ` Jitao Shi
2016-06-02  9:57 ` [PATCH 2/2 v16] drm/bridge: Add I2C based driver for ps8640 bridge Jitao Shi
2016-06-02  9:57   ` Jitao Shi
2016-06-02  9:57   ` Jitao Shi
2016-06-14  8:09   ` Daniel Kurtz
2016-06-14  8:09     ` Daniel Kurtz
2016-06-14  8:09     ` Daniel Kurtz
2016-06-16 19:14   ` Emil Velikov
2016-06-16 19:14     ` Emil Velikov
2016-06-16 19:14     ` Emil Velikov
2016-06-29  4:31     ` Daniel Kurtz
2016-06-29  4:31       ` Daniel Kurtz
2016-06-29  4:31       ` Daniel Kurtz
2016-07-12 10:13       ` Daniel Vetter
2016-07-12 10:13         ` Daniel Vetter
2016-07-12 10:13         ` Daniel Vetter
2016-08-04 10:35         ` Enric Balletbo Serra [this message]
2016-08-04 10:35           ` Enric Balletbo Serra
2016-08-04 10:35           ` Enric Balletbo Serra
2016-08-04 10:58           ` Daniel Vetter
2016-08-04 10:58             ` Daniel Vetter
2016-08-04 10:58             ` Daniel Vetter
2016-08-04 12:23         ` Russell King - ARM Linux
2016-08-04 12:23           ` Russell King - ARM Linux
2016-08-04 12:23           ` Russell King - ARM Linux

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=CAFqH_53PgPs3_h7XNFEu4u0W6GW7vyWCNFf2vq8Yn7sH2LbFwA@mail.gmail.com \
    --to=eballetbo@gmail.com \
    --cc=ajaykumar.rs@samsung.com \
    --cc=andy.yan@rock-chips.com \
    --cc=cawa.cheng@mediatek.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eddie.huang@mediatek.com \
    --cc=emil.l.velikov@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jitao.shi@mediatek.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=pawel.moll@arm.com \
    --cc=rahul.sharma@samsung.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=srv_heupstream@mediatek.com \
    --cc=stonea168@163.com \
    --cc=treding@nvidia.com \
    --cc=vpalatin@chromium.org \
    --cc=yingjoe.chen@mediatek.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.