[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 9/9] drivers/char: fix handling cable re-plug in XHCI console driver


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 6 Sep 2022 08:52:25 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ytRg+7SBo4U3Tgcagqli6pR6ip8yI/MJujbsIYjbjEA=; b=m2g4oBWcx0izBJ9UoRQe4Vdgl29Zwkqs4qTN3D8qQEkKBYWNmmghnJomEcAtZ8YX3TlhRwAtpx1TvC6TRhoUuLUmBvgkfweac9Iurjnyf79PKHSmU9p8m6Ig9hG18WmmkOPZdPV17M8vfvHJI2OgEn/xjABSe621jQKAcd0VVK7/8HHFVrgM34fdoyvEFnjx7bweC0HbAutGV5RfkliYs2DYooZ0THZoHkFju++luLrDJG8m7n/n8Akb6gR63Y6DVyZCVoDmSkhRmh5aqsH82UpMgydQu+fP7S2HUSGOOmOIOwn7aC2rNLJur+h70C9/b6SaQFZFVk5RA+oZKHDBEQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HdmDYn0PyVMUeuEMq6Rvkw5GKAIXQ93uWZK9sc9/oN2bjmoCHi5/rC0qdc61b2nC8pBcywrqDE1NxBMH0nW/1fxs1xAUDN/2Fv5/IKiKdv6BksEX4eSPx1V8HJVipQSvNkHJO31VyRD9c2FVfADd2MmJZFxaRCkwE0d1WUahWLi58dhKWeVsZTYULlCPVjaP7NlxQTk+8ESsm+hWpcACvgZY2P8SihAJWMCDgjfx6leweayua1uFT9LUdSiMs+HxT6JddJDo/wUYKF3euws7FxMRXCbNyHAnOqhziDwtdO/OnPBdl7N4sft4Lbs+8NfaPQmI+V6BssQ3D1mrLLScEw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: George Dunlap <George.Dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 06 Sep 2022 06:52:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.08.2022 17:44, Andrew Cooper wrote:
> On 26/08/2022 15:50, Jan Beulich wrote:
>> On 22.08.2022 17:27, Marek Marczykowski-Górecki wrote:
>>> @@ -1023,6 +1032,8 @@ static bool dbc_ensure_running(struct dbc *dbc)
>>>          writel(ctrl | (1U << DBC_CTRL_DRC), &reg->ctrl);
>>>          writel(readl(&reg->portsc) | (1U << DBC_PSC_PED), &reg->portsc);
>>>          wmb();
>>> +        dbc_ring_doorbell(dbc, dbc->dbc_iring.db);
>>> +        dbc_ring_doorbell(dbc, dbc->dbc_oring.db);
>>>      }
>> You retain the wmb() here, but ...
>>
>>> @@ -1066,8 +1073,7 @@ static void dbc_flush(struct dbc *dbc, struct 
>>> xhci_trb_ring *trb,
>>>          }
>>>      }
>>>  
>>> -    wmb();
>>> -    writel(db, &reg->db);
>>> +    dbc_ring_doorbell(dbc, trb->db);
>>>  }
>> ... you drop it here. Why the difference?
> 
> As a tangent, every single barrier in this file is buggy.  Should be
> smp_*() variants, not mandatory variants.
> 
> All (interesting) data is in plain WB cached memory, and the few BAR
> registers which are configured have a UC mapping which orders properly
> WRT other writes on x86.

But such drivers shouldn't be x86-specific when it comes to their use
of barriers. For this reason I specifically did not complain about any
of the barrier uses throughout the series (with the further thinking
of "better one too many than one too few").

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.