From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Jani Nikula <jani.nikula@intel.com>,
<intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>
Cc: Naladala Ramanaidu <ramanaidu.naladala@intel.com>
Subject: Re: [PATCH v2 1/6] drm/i915/gmbus: move debugfs stuff at the end of the file
Date: Thu, 26 Nov 2026 18:31:53 +0530 [thread overview]
Message-ID: <3f3d63ba-d5d0-4b46-bf79-19ad3bffdb06@intel.com> (raw)
In-Reply-To: <aea3a014dcae0666a6336c075db34914dfc8ca57.1795607055.git.jani.nikula@intel.com>
On 11/25/2026 5:16 PM, Jani Nikula wrote:
> Basically everywhere the debugfs scaffolding is at the end of the file,
> as it invariably uses functions that come first. Follow suit in gmbus.
>
> Cc: Naladala Ramanaidu <ramanaidu.naladala@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Should've spotted this while reviewing the original series.
Change LGTM
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_gmbus.c | 154 ++++++++++-----------
> 1 file changed, 77 insertions(+), 77 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c
> index d43c81d362e6..70784e7dae2a 100644
> --- a/drivers/gpu/drm/i915/display/intel_gmbus.c
> +++ b/drivers/gpu/drm/i915/display/intel_gmbus.c
> @@ -898,83 +898,6 @@ static bool intel_gmbus_is_adapter(struct intel_connector *connector)
> return adapter && adapter->algo == &gmbus_algorithm;
> }
>
> -static int intel_force_bit_banging_show(struct seq_file *m, void *data)
> -{
> - struct intel_connector *connector = m->private;
> - struct intel_gmbus *bus = container_of(connector->base.ddc,
> - struct intel_gmbus, adapter);
> - struct intel_display *display = bus->display;
> - bool force_bit_banging;
> -
> - mutex_lock(&display->gmbus.mutex);
> - force_bit_banging = bus->debugfs_force_bit;
> - mutex_unlock(&display->gmbus.mutex);
> -
> - seq_printf(m, "%u\n", force_bit_banging);
> -
> - return 0;
> -}
> -
> -static ssize_t intel_force_bit_banging_write(struct file *file,
> - const char __user *ubuf,
> - size_t len, loff_t *offp)
> -{
> - struct seq_file *m = file->private_data;
> - struct intel_connector *connector = m->private;
> - struct intel_gmbus *bus = container_of(connector->base.ddc,
> - struct intel_gmbus, adapter);
> - struct intel_display *display = bus->display;
> - bool force_bit_banging;
> - bool changed = false;
> - u32 force_bit = 0;
> - int ret;
> -
> - ret = kstrtobool_from_user(ubuf, len, &force_bit_banging);
> - if (ret)
> - return ret;
> -
> - mutex_lock(&display->gmbus.mutex);
> - if (force_bit_banging != bus->debugfs_force_bit) {
> - bus->force_bit += force_bit_banging ? 1 : -1;
> - force_bit = bus->force_bit;
> - bus->debugfs_force_bit = force_bit_banging;
> - changed = true;
> - }
> - mutex_unlock(&display->gmbus.mutex);
> -
> - if (changed)
> - drm_dbg_kms(display->drm,
> - "%sabling bit-banging on %s. force bit now %d\n",
> - force_bit_banging ? "en" : "dis",
> - connector->base.ddc->name, force_bit);
> -
> - *offp += len;
> -
> - return len;
> -}
> -
> -static int intel_force_bit_banging_open(struct inode *inode, struct file *file)
> -{
> - return single_open(file, intel_force_bit_banging_show, inode->i_private);
> -}
> -
> -static const struct file_operations intel_force_bit_banging_fops = {
> - .owner = THIS_MODULE,
> - .open = intel_force_bit_banging_open,
> - .read = seq_read,
> - .llseek = seq_lseek,
> - .release = single_release,
> - .write = intel_force_bit_banging_write,
> -};
> -
> -void intel_gmbus_connector_debugfs_add(struct intel_connector *connector)
> -{
> - if (intel_gmbus_is_adapter(connector))
> - debugfs_create_file("intel_force_bit_banging", 0644,
> - connector->base.debugfs_entry, connector,
> - &intel_force_bit_banging_fops);
> -}
> -
> static void gmbus_lock_bus(struct i2c_adapter *adapter,
> unsigned int flags)
> {
> @@ -1144,3 +1067,80 @@ void intel_gmbus_irq_handler(struct intel_display *display)
> {
> wake_up_all(&display->gmbus.wait_queue);
> }
> +
> +static int intel_force_bit_banging_show(struct seq_file *m, void *data)
> +{
> + struct intel_connector *connector = m->private;
> + struct intel_gmbus *bus = container_of(connector->base.ddc,
> + struct intel_gmbus, adapter);
> + struct intel_display *display = bus->display;
> + bool force_bit_banging;
> +
> + mutex_lock(&display->gmbus.mutex);
> + force_bit_banging = bus->debugfs_force_bit;
> + mutex_unlock(&display->gmbus.mutex);
> +
> + seq_printf(m, "%u\n", force_bit_banging);
> +
> + return 0;
> +}
> +
> +static ssize_t intel_force_bit_banging_write(struct file *file,
> + const char __user *ubuf,
> + size_t len, loff_t *offp)
> +{
> + struct seq_file *m = file->private_data;
> + struct intel_connector *connector = m->private;
> + struct intel_gmbus *bus = container_of(connector->base.ddc,
> + struct intel_gmbus, adapter);
> + struct intel_display *display = bus->display;
> + bool force_bit_banging;
> + bool changed = false;
> + u32 force_bit = 0;
> + int ret;
> +
> + ret = kstrtobool_from_user(ubuf, len, &force_bit_banging);
> + if (ret)
> + return ret;
> +
> + mutex_lock(&display->gmbus.mutex);
> + if (force_bit_banging != bus->debugfs_force_bit) {
> + bus->force_bit += force_bit_banging ? 1 : -1;
> + force_bit = bus->force_bit;
> + bus->debugfs_force_bit = force_bit_banging;
> + changed = true;
> + }
> + mutex_unlock(&display->gmbus.mutex);
> +
> + if (changed)
> + drm_dbg_kms(display->drm,
> + "%sabling bit-banging on %s. force bit now %d\n",
> + force_bit_banging ? "en" : "dis",
> + connector->base.ddc->name, force_bit);
> +
> + *offp += len;
> +
> + return len;
> +}
> +
> +static int intel_force_bit_banging_open(struct inode *inode, struct file *file)
> +{
> + return single_open(file, intel_force_bit_banging_show, inode->i_private);
> +}
> +
> +static const struct file_operations intel_force_bit_banging_fops = {
> + .owner = THIS_MODULE,
> + .open = intel_force_bit_banging_open,
> + .read = seq_read,
> + .llseek = seq_lseek,
> + .release = single_release,
> + .write = intel_force_bit_banging_write,
> +};
> +
> +void intel_gmbus_connector_debugfs_add(struct intel_connector *connector)
> +{
> + if (intel_gmbus_is_adapter(connector))
> + debugfs_create_file("intel_force_bit_banging", 0644,
> + connector->base.debugfs_entry, connector,
> + &intel_force_bit_banging_fops);
> +}
next prev parent reply other threads:[~2026-11-26 13:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 11:46 [PATCH v2 0/6] drm/i915: gmbus refactors and str_enable_disable() usage Jani Nikula
2026-11-25 11:46 ` [PATCH v2 1/6] drm/i915/gmbus: move debugfs stuff at the end of the file Jani Nikula
2026-11-26 13:01 ` Nautiyal, Ankit K [this message]
2026-11-25 11:46 ` [PATCH v2 2/6] drm/i915/gmbus: pass struct i2c_adapter to debugfs functions Jani Nikula
2026-11-26 13:02 ` Nautiyal, Ankit K
2026-11-25 11:46 ` [PATCH v2 3/6] drm/i915/gmbus: remove and open-code intel_gmbus_is_adapter() Jani Nikula
2026-11-26 13:03 ` Nautiyal, Ankit K
2026-11-25 11:46 ` [PATCH v2 4/6] drm/i915/gmbus: deduplicate setting force bit-banging Jani Nikula
2026-11-26 13:07 ` Nautiyal, Ankit K
2026-11-25 11:46 ` [PATCH v2 5/6] drm/i915/display: don't be cute about printing enabling/disabling Jani Nikula
2026-11-26 13:23 ` Nautiyal, Ankit K
2026-11-25 11:46 ` [PATCH v2 6/6] drm/i915/display: use str_enable_disable() more Jani Nikula
2026-11-26 13:24 ` Nautiyal, Ankit K
2026-11-27 9:36 ` Jani Nikula
2026-11-25 12:05 ` ✓ CI.KUnit: success for drm/i915: gmbus refactors and str_enable_disable() usage Patchwork
2026-11-25 12:56 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-25 17:48 ` ✗ Xe.CI.FULL: failure " Patchwork
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=3f3d63ba-d5d0-4b46-bf79-19ad3bffdb06@intel.com \
--to=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=ramanaidu.naladala@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