On 4/20/2018 11:54 PM, Harry Wentland wrote: > On 2018-04-17 02:57 AM, Shirish S wrote: >> The dp aux channel cannot read messages of size greater >> than 16 bytes, this patch adds quirks feild accordingly >> at the initialization of the adaptor. > Is this in response to a bug? Yes, its in continuation to the dm_dp_aux_transfer() return bug but also with an intention to clean up. Currently we are in a more reactive mode, i.e., in dm_dp_aux_transfer() we have a WARN_ON for the message size, i.e., at this time the i2c framework has already created a list of msg->sizes's, however by adding a quirk not only can we get rid of the WARN_ON but also ensure that the i2c framework knows about it and do not let form message reads > 16 bytes. > > I don't see any other DRM driver using quirks like this, even though they also wouldn't be able to transfer more than 16 bytes when using i2c-over-aux. This makes me wonder why we need it. > > Harry > >> Signed-off-by: Shirish S <shirish.s at amd.com> >> --- >> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c >> index 782491e..f7d6d9a 100644 >> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c >> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c >> @@ -464,10 +464,15 @@ static const struct drm_dp_mst_topology_cbs dm_mst_cbs = { >> .register_connector = dm_dp_mst_register_connector >> }; >> >> +/* I2C adapter quirks, max read len is 16 bytes. */ >> +static const struct i2c_adapter_quirks dm_dp_aux_quirks = { >> + .max_read_len = 128, >> +}; >> void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, >> struct amdgpu_dm_connector *aconnector) >> { >> aconnector->dm_dp_aux.aux.name = "dmdc"; >> + aconnector->dm_dp_aux.aux.ddc.quirks = &dm_dp_aux_quirks; >> aconnector->dm_dp_aux.aux.dev = dm->adev->dev; >> aconnector->dm_dp_aux.aux.transfer = dm_dp_aux_transfer; >> aconnector->dm_dp_aux.ddc_service = aconnector->dc_link->ddc; >>