Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp638233ybb; Fri, 3 Apr 2020 09:07:40 -0700 (PDT) X-Google-Smtp-Source: APiQypI/Ra/jF0Coy0mCpnoW5hR70Rcc8MNVypwdEDkdpKQtXcrCpOfO21QAVQCHfReIQkNFiRHc X-Received: by 2002:aca:af97:: with SMTP id y145mr3498835oie.24.1585930060632; Fri, 03 Apr 2020 09:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585930060; cv=none; d=google.com; s=arc-20160816; b=nX83apKokSbdBStpfERM2dkPuN6GdhMNNweOKsGZUngfD3waMdw2mx0DINaGQiPyL9 uccz+jQlfcuO87DjSuzY/ynvcJojT6rlE+EZs6lZgLsTN08DiuwWD3WBun8StvWtGw2I xoACBwoR1QXDFdLXbvzTbWpNniGotg9WnEctYxl7/Nb2e19N3tOLZiHQfnoPgTCOPBtW M7ekvmUCsEWmRvYez5WFxlymIwDoHp7UjCk/uPOFVdkA3DE+lgHH7lu9Ud/e4DfY9PRN gptBCe9EJ+6rJW3OyYsgIN5it8Al2N4uHF5KznGyZPv+UCpzKqv58dc3p4vZbZGWClLT antw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V5MB+WtQu9ahIUpMYQeTRqtUIiPA2kDNSM91G2ycfpU=; b=BGmj40vxKV0We3ilI/Pk6uUJD2OtvQYFFSxRX/FLmwyh2Mh9YteOOmbe+qh1oZppYw +XcVf0JVq3URO6AOBXhb2JOscahtVuITvzQdPpp5hpPWjV2BsZ1k45MVjfrKMcnxzpFs SA9e3yaO+zd2JHhwsD/VlFsCPrGJFs4FQMdE5iKH0Z/3tr1rk1hWB4RSKKIjXaemMVGL KlxteQ0gBuzlY9Lb6Lez5Ovv0/nt0HZsoHOCy+SGjODS4lP1/LYiY7dGwCyGYCMySHGW XO3fqSsZV4ph8RkWgaEJbC3+MqRetZShSojIfu4o22ZO9JPBMJZDf0Gd4Wbn9t9Qj9GG mpfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ABxkTteA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si4133789oth.222.2020.04.03.09.07.27; Fri, 03 Apr 2020 09:07:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ABxkTteA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404064AbgDCQGM (ORCPT + 99 others); Fri, 3 Apr 2020 12:06:12 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:50688 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403868AbgDCQGD (ORCPT ); Fri, 3 Apr 2020 12:06:03 -0400 Received: by mail-wm1-f66.google.com with SMTP id t128so7710124wma.0; Fri, 03 Apr 2020 09:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V5MB+WtQu9ahIUpMYQeTRqtUIiPA2kDNSM91G2ycfpU=; b=ABxkTteAogfNSTy7j/q/j0sEXQPVmkLLtJiuSPrb0xoJhhIAiUpG1/FtKfALP8DRvx pDhazkk5ik2t2rD1n/OOYr60bBZBk7sYGN+ntSlRnS131EfxxWKsNGdUXVNlFU8Oec/v 9SG1F53+VCl8NlpB+Z9nNzsEJ5h1+hkJsj067Bp0cyY4EqHk3f41bXdpuP5MrBmVgtHN qPBnZeCwFvASL2nKrQTSuPsoGRsRrbgqehDOYnLRJpNKYdGP87f7pchPdcw00ijM3/zn vgCsl6jPa2iHxLXA1omI7QGk44XMnSyTOAAjaUcbAFzn/heTtp7auLLAlfARbEJWb80d 5mUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V5MB+WtQu9ahIUpMYQeTRqtUIiPA2kDNSM91G2ycfpU=; b=VYBBilb4p0fZ9axQ6l2jf6zd5W2NWJXKfWPJbRYxo0C5Fwz72sp9aRIdbIIJcfdbgB O+e7ODufI6waiMmd++WgWMOppDgBqaKS6cNZu71A1+f3/FTIVISnndPY1LI3VjtIrmkn oExCLosBhF14N3Q++Jc6RV5MeP08N2N2dewQrHO9/F+T5HzEDciUqcxkIST5g7F0m97v 8yzbJPnlQR2E9Gd/u4vBDXGGPsNl+fq3bnG1z563YboWcUtaXUOQ5521T9RJUdsBluV5 cLHrH0x+kO7zW7NPnVmHii61SQEHvNWVYzN+aSElVXDdf9FVVePkLysUM9UEygoWtMfx +syA== X-Gm-Message-State: AGi0PuZBgj44mo35kAYsXN2EMdw4zT4rje4ZiZ6xCM0btUrBTWTcFeG4 YPcy3UZFLHD/vjyO20k8ay1tW6VD/M81 X-Received: by 2002:a05:600c:214b:: with SMTP id v11mr9492879wml.104.1585929961453; Fri, 03 Apr 2020 09:06:01 -0700 (PDT) Received: from ninjahost.lan (host-92-23-85-227.as13285.net. [92.23.85.227]) by smtp.gmail.com with ESMTPSA id l12sm12351426wrt.73.2020.04.03.09.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 09:06:01 -0700 (PDT) From: Jules Irenge To: linux-kernel@vger.kernel.org Cc: boqun.feng@gmail.com, Jens Axboe , linux-ide@vger.kernel.org (open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)) Subject: [PATCH 4/5] libata: Add missing annotation for ata_scsi_rbuf_get() and ata_scsi_rbuf_fill() Date: Fri, 3 Apr 2020 17:05:04 +0100 Message-Id: <20200403160505.2832-5-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200403160505.2832-1-jbi.octave@gmail.com> References: <0/5> <20200403160505.2832-1-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse reports a warning at ata_scsi_rbuf_fill() and ata_scsi_rbuf_get() warning: context imbalance in ata_scsi_rbuf_get() - wrong count at exit warning: context imbalance in ata_scsi_rbuf_fill() - unexpected unlock The root cause is the missing annotation at ata_scsi_rbuf_fill() and ata_scsi_rbuf_get() Add the missing __acquires(&ata_scsi_rbuf_lock) Add the missing __releases(&ata_scsi_rbuf_lock) Signed-off-by: Jules Irenge --- drivers/ata/libata-scsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index eb2eb599e602..3436b782053d 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -2082,6 +2082,7 @@ struct ata_scsi_args { */ static void *ata_scsi_rbuf_get(struct scsi_cmnd *cmd, bool copy_in, unsigned long *flags) + __acquires(&ata_scsi_rbuf_lock) { spin_lock_irqsave(&ata_scsi_rbuf_lock, *flags); @@ -2106,6 +2107,7 @@ static void *ata_scsi_rbuf_get(struct scsi_cmnd *cmd, bool copy_in, */ static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, bool copy_out, unsigned long *flags) + __releases(&ata_scsi_rbuf_lock) { if (copy_out) sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), -- 2.24.1