From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com ([134.134.136.65]:27978 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933604AbcJZNfz (ORCPT ); Wed, 26 Oct 2016 09:35:55 -0400 Date: Wed, 26 Oct 2016 16:35:50 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: dri-devel@lists.freedesktop.org Cc: "Kirill A . Shutemov" , stable@vger.kernel.org, Carlos Santa Subject: Re: [PATCH v2 3/4] drm/dp/mst: Clear port->pdt when tearing down the i2c adapter Message-ID: <20161026133550.GF4617@intel.com> References: <1477472755-15288-4-git-send-email-ville.syrjala@linux.intel.com> <1477488633-16544-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1477488633-16544-1-git-send-email-ville.syrjala@linux.intel.com> Sender: stable-owner@vger.kernel.org List-ID: On Wed, Oct 26, 2016 at 04:30:33PM +0300, ville.syrjala@linux.intel.com wrote: > From: Ville Syrj�l� > > The i2c adapter is only relevant for some peer device types, so > let's clear the pdt if it's still the same as the old_pdt when we > tear down the i2c adapter. > > I don't really like this design pattern of updating port->whatever > before doing the accompanying changes and passing around old_whatever > to figure stuff out. Would make much more sense to me to the pass the > new value around and only update the port->whatever when things are > consistent. But let's try to work with what we have right now. > > v2: Clear port->pdt in the caller, if needed (Daniel) > > Cc: Daniel Vetter > Cc: stable@vger.kernel.org > Cc: Carlos Santa > Cc: Kirill A. Shutemov > Tested-by: Carlos Santa (v1) > Tested-by: Kirill A. Shutemov (v1) > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97666 > Signed-off-by: Ville Syrj�l� > --- > drivers/gpu/drm/drm_dp_mst_topology.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c > index 04e457117980..ba13f9d8720b 100644 > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > @@ -914,6 +914,7 @@ static void drm_dp_destroy_port(struct kref *kref) > /* no need to clean up vcpi > * as if we have no connector we never setup a vcpi */ > drm_dp_port_teardown_pdt(port, port->pdt); > + port->pdt = DP_PEER_DEVICE_NONE; And naturally I forgot to amend the commit message w.r.t. this guy. We don't really need to do this here, but I figured I'd try to be a bit more consistent by having it, just to avoid accidental mistakes if/when someone changes this stuff again later. > } > kfree(port); > } > @@ -2919,6 +2920,7 @@ static void drm_dp_destroy_connector_work(struct work_struct *work) > mgr->cbs->destroy_connector(mgr, port->connector); > > drm_dp_port_teardown_pdt(port, port->pdt); > + port->pdt = DP_PEER_DEVICE_NONE; > > if (!port->input && port->vcpi.vcpi > 0) { > drm_dp_mst_reset_vcpi_slots(mgr, port); > -- > 2.7.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrj�l� Intel OTC