[Intel-gfx] [PATCH 1/1] usb: typec: altmodes/displayport: reorder dp_altmode_configured()
Heikki Krogerus
heikki.krogerus at linux.intel.com
Fri Oct 8 08:09:35 UTC 2021
On Tue, Oct 05, 2021 at 09:32:57PM -0700, lindsey.stanpoor at gmail.com wrote:
> From: Cameron Nemo <cnemo at tutanota.com>
>
> A recent commit [1] introduced an unintended behavioral change by
> reordering certain function calls. The sysfs_notify call for
> pin_assignment should only be invoked when the dp_altmode_notify call
> returns 0, and in the dp->data.conf == 0 case.
>
> [1] https://lore.kernel.org/r/20210817215201.795062-8-hdegoede@redhat.com
You should refer the commit, not the mail. I think you could also use
the Fixes tag in this case, but then I guess Hans should pick this:
Fixes: fc27e04630e9 ("usb: typec: altmodes/displayport: Make dp_altmode_notify() more generic")
Either way, this is OK by me, so once you have cleaned the commit
message, please feel free to include my:
Reviewed-by: Heikki Krogerus <heikki.krogerus at linux.intel.com>
> Signed-off-by: Cameron Nemo <cnemo at tutanota.com>
> ---
> drivers/usb/typec/altmodes/displayport.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
> index c1d8c23baa39..a15ae78066e3 100644
> --- a/drivers/usb/typec/altmodes/displayport.c
> +++ b/drivers/usb/typec/altmodes/displayport.c
> @@ -154,10 +154,17 @@ static int dp_altmode_status_update(struct dp_altmode *dp)
>
> static int dp_altmode_configured(struct dp_altmode *dp)
> {
> + int ret;
> +
> sysfs_notify(&dp->alt->dev.kobj, "displayport", "configuration");
> +
> + ret = dp_altmode_notify(dp);
> + if (ret || !dp->data.conf)
> + return ret;
> +
> sysfs_notify(&dp->alt->dev.kobj, "displayport", "pin_assignment");
>
> - return dp_altmode_notify(dp);
> + return 0;
> }
>
> static int dp_altmode_configure_vdm(struct dp_altmode *dp, u32 conf)
> --
> 2.33.0
--
heikki
More information about the Intel-gfx
mailing list