From patchwork Mon Feb 1 10:34:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= X-Patchwork-Id: 8177781 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6DD199F8AA for ; Mon, 1 Feb 2016 10:34:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C5972042B for ; Mon, 1 Feb 2016 10:34:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 008D420425 for ; Mon, 1 Feb 2016 10:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753483AbcBAKei (ORCPT ); Mon, 1 Feb 2016 05:34:38 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:38293 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752956AbcBAKeh (ORCPT ); Mon, 1 Feb 2016 05:34:37 -0500 Received: by mail-wm0-f45.google.com with SMTP id p63so63917861wmp.1 for ; Mon, 01 Feb 2016 02:34:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=l5cZVQbDRDMfaRMqzzD7PkBdaGll4Hp6WhStiFtG8i8=; b=qjX+yi3ycjJ8lbCAvJk8Y0udkjLZIyAoWPFHcWce/AeFTX9X3PL6oNEkIcv2cpXVtf O3sGJHya3RBQH9FX28gn7O9a0NEje5rZq8mEM9gUEPtc185iEUxcktSM1tUCg3G9/Hyt 70nJ+m5fjaHee7gRGn6F1uYgcScI0VLHArwaDnFRYywme5L3ysVfK88SU1r9ZhEdJWm5 ivNfd4kQcdbY/APzoAPChSfFPT+C9RMPjErXCBZwLl3q9+wRsiVASbTSGgpjBce7yPxp DHMwJRLFuXeNFdrMafUrOBr5tUKxWnCPEEc7Th7zLoFaaL/BDV4383Iio9nleQCGAmFG sw6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=l5cZVQbDRDMfaRMqzzD7PkBdaGll4Hp6WhStiFtG8i8=; b=LVBZ3pbMezplyXZYUtoY45+m9v8hCzPuMHEFUJ4QcJ6q3DwwJk+2VESficZYVOKSqw TENuwt+7nb+FEnw8EtYB/YkDYbl9kuVubfQdTOS4eHXY0bx+U2fYbLkuptpxDYP7N2NT +GWMEVW0Z6OaywCNUhp9tiBALGanj4sF9NPiVYlHjpVOZgxPfU8yGI5O2fgCzaokkopL v6Ka3bx+j6cH1IktwEQ2Hf/GfH0N6pqneIMXjizXzOSmg2mAq2IkGG2G1VFgzvBN/Slz zHyLmAulxE9LAQakj4ndlVbR4GfvCzQnAzahZOTA+d+AHrVOHqNr/iDU9GIHabDq8OE0 ZrQQ== X-Gm-Message-State: AG10YOTOPW7UfixFFZk+OGwfXw4fY1sNfW980L4l/vW9FcoxWXpBhh+QoXh6okzR3OpjTA== X-Received: by 10.194.78.175 with SMTP id c15mr22087107wjx.16.1454322876344; Mon, 01 Feb 2016 02:34:36 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id lh1sm28216482wjb.20.2016.02.01.02.34.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 02:34:35 -0800 (PST) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 1/2] lightnvm: warn if irqs are disabled in lock laddr Date: Mon, 1 Feb 2016 11:34:32 +0100 Message-Id: <1454322873-28687-1-git-send-email-javier@javigon.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a warning if irqs are disabled when locking a new address in rrpc. The typical path to a new request does not disable irqs, but this is not guaranteed in the future. Signed-off-by: Javier González --- drivers/lightnvm/rrpc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/lightnvm/rrpc.h b/drivers/lightnvm/rrpc.h index dfca5c4..c27283a 100644 --- a/drivers/lightnvm/rrpc.h +++ b/drivers/lightnvm/rrpc.h @@ -184,6 +184,8 @@ static int __rrpc_lock_laddr(struct rrpc *rrpc, sector_t laddr, sector_t laddr_end = laddr + pages - 1; struct rrpc_inflight_rq *rtmp; + WARN_ON(irqs_disabled()); + spin_lock_irq(&rrpc->inflights.lock); list_for_each_entry(rtmp, &rrpc->inflights.reqs, list) { if (unlikely(request_intersects(rtmp, laddr, laddr_end))) {