Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933752AbcKPBo3 (ORCPT ); Tue, 15 Nov 2016 20:44:29 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:34581 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981AbcKPBo2 (ORCPT ); Tue, 15 Nov 2016 20:44:28 -0500 MIME-Version: 1.0 In-Reply-To: <1478522920-108145-11-git-send-email-john.garry@huawei.com> References: <1478522920-108145-1-git-send-email-john.garry@huawei.com> <1478522920-108145-11-git-send-email-john.garry@huawei.com> From: Zhangfei Gao Date: Wed, 16 Nov 2016 09:44:26 +0800 Message-ID: Subject: Re: [PATCH 10/11] hisi_sas: use atomic64_t for hisi_sas_device.running_req To: John Garry Cc: martin.petersen@oracle.com, jejb@linux.vnet.ibm.com, linux-scsi@vger.kernel.org, linuxarm@huawei.com, "linux-kernel@vger.kernel.org" , John Garry Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 537 Lines: 14 On Mon, Nov 7, 2016 at 8:48 PM, John Garry wrote: > Sometimes the value of hisi_sas_device.running_req > would go negative unless we have the check for > running_req >= 0 before trying to decrement. > > This is because using running_req is not thread-safe. > > As such, the value for running_req may be actually incorrect, > so use atomic64_t instead. > > Signed-off-by: John Garry > Reviewed-by: Xiang Chen Reviewed-by: Zhangfei Gao