public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Takashi Iwai <tiwai@suse.de>
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 02/11] drm/udl: Add reset_resume
Date: Wed, 7 Sep 2022 08:58:53 +0200	[thread overview]
Message-ID: <YxhBLVyRmeUcxPIj@phenom.ffwll.local> (raw)
In-Reply-To: <20220906073951.2085-3-tiwai@suse.de>

On Tue, Sep 06, 2022 at 09:39:42AM +0200, Takashi Iwai wrote:
> From: Thomas Zimmermann <tzimmermann@suse.de>
> 
> Implement the reset_resume callback of struct usb_driver. Set the
> standard channel when called.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  drivers/gpu/drm/udl/udl_drv.c  | 11 +++++++++++
>  drivers/gpu/drm/udl/udl_drv.h  |  1 +
>  drivers/gpu/drm/udl/udl_main.c |  2 +-
>  3 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
> index 5703277c6f52..0ba88e5472a9 100644
> --- a/drivers/gpu/drm/udl/udl_drv.c
> +++ b/drivers/gpu/drm/udl/udl_drv.c
> @@ -32,6 +32,16 @@ static int udl_usb_resume(struct usb_interface *interface)
>  	return drm_mode_config_helper_resume(dev);
>  }
>  
> +static int udl_usb_reset_resume(struct usb_interface *interface)
> +{
> +	struct drm_device *dev = usb_get_intfdata(interface);
> +	struct udl_device *udl = to_udl(dev);
> +
> +	udl_select_std_channel(udl);
> +
> +	return drm_mode_config_helper_resume(dev);

Bit a bikeshed, but in the driver load case it would be neat to put the
call to udl_select_std_channel right above the call to
drm_mode_config_reset. But that is _really_ a bikeshed :-)

Also thanks for sending me on a bit a wild goose chase trying to figure
out what this reset_resume hook actually does and why.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> +}
> +
>  /*
>   * FIXME: Dma-buf sharing requires DMA support by the importing device.
>   *        This function is a workaround to make USB devices work as well.
> @@ -140,6 +150,7 @@ static struct usb_driver udl_driver = {
>  	.disconnect = udl_usb_disconnect,
>  	.suspend = udl_usb_suspend,
>  	.resume = udl_usb_resume,
> +	.reset_resume = udl_usb_reset_resume,
>  	.id_table = id_table,
>  };
>  module_usb_driver(udl_driver);
> diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
> index 28aaf75d71cf..37c14b0ff1fc 100644
> --- a/drivers/gpu/drm/udl/udl_drv.h
> +++ b/drivers/gpu/drm/udl/udl_drv.h
> @@ -95,6 +95,7 @@ int udl_render_hline(struct drm_device *dev, int log_bpp, struct urb **urb_ptr,
>  		     u32 byte_offset, u32 device_byte_offset, u32 byte_width);
>  
>  int udl_drop_usb(struct drm_device *dev);
> +int udl_select_std_channel(struct udl_device *udl);
>  
>  #define CMD_WRITE_RAW8   "\xAF\x60" /**< 8 bit raw write command. */
>  #define CMD_WRITE_RL8    "\xAF\x61" /**< 8 bit run length command. */
> diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
> index fdafbf8f3c3c..7d1e6bbc165c 100644
> --- a/drivers/gpu/drm/udl/udl_main.c
> +++ b/drivers/gpu/drm/udl/udl_main.c
> @@ -92,7 +92,7 @@ static int udl_parse_vendor_descriptor(struct udl_device *udl)
>  /*
>   * Need to ensure a channel is selected before submitting URBs
>   */
> -static int udl_select_std_channel(struct udl_device *udl)
> +int udl_select_std_channel(struct udl_device *udl)
>  {
>  	static const u8 set_def_chn[] = {0x57, 0xCD, 0xDC, 0xA7,
>  					 0x1C, 0x88, 0x5E, 0x15,
> -- 
> 2.35.3
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2022-09-07  6:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06  7:39 [PATCH v2 00/11] drm/udl: More fixes Takashi Iwai
2022-09-06  7:39 ` [PATCH v2 01/11] drm/udl: Restore display mode on resume Takashi Iwai
2022-09-06  7:39 ` [PATCH v2 02/11] drm/udl: Add reset_resume Takashi Iwai
2022-09-07  6:58   ` Daniel Vetter [this message]
2022-09-06  7:39 ` [PATCH v2 03/11] drm/udl: Enable damage clipping Takashi Iwai
2022-09-06  7:39 ` [PATCH v2 04/11] Revert "drm/udl: Kill pending URBs at suspend and disconnect" Takashi Iwai
2022-09-06  7:39 ` [PATCH v2 05/11] drm/udl: Suppress error print for -EPROTO at URB completion Takashi Iwai
2022-09-06  7:39 ` [PATCH v2 06/11] drm/udl: Increase the default URB list size to 20 Takashi Iwai
2022-09-06  7:39 ` [PATCH v2 07/11] drm/udl: Drop unneeded alignment Takashi Iwai
2022-09-07  7:29   ` Thomas Zimmermann
2022-09-08  7:01     ` Takashi Iwai
2022-09-06  7:39 ` [PATCH v2 08/11] drm/udl: Fix potential URB leaks Takashi Iwai
2022-09-06  7:39 ` [PATCH v2 09/11] drm/udl: Fix inconsistent urbs.count value during udl_free_urb_list() Takashi Iwai
2022-09-07  7:31   ` Thomas Zimmermann
2022-09-06  7:39 ` [PATCH v2 10/11] drm/udl: Don't re-initialize stuff at retrying the URB list allocation Takashi Iwai
2022-09-06  7:39 ` [PATCH v2 11/11] drm/udl: Sync pending URBs at the end of suspend Takashi Iwai
2022-09-07  7:34   ` Thomas Zimmermann

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=YxhBLVyRmeUcxPIj@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    --cc=tzimmermann@suse.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