From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751068AbdEAXJa (ORCPT ); Mon, 1 May 2017 19:09:30 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:33811 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750730AbdEAXJ3 (ORCPT ); Mon, 1 May 2017 19:09:29 -0400 MIME-Version: 1.0 In-Reply-To: <1493674015.30303.28.camel@hpe.com> References: <149355594185.9917.1577772489949690281.stgit@dwillia2-desk3.amr.corp.intel.com> <1493674015.30303.28.camel@hpe.com> From: Dan Williams Date: Mon, 1 May 2017 16:09:28 -0700 Message-ID: Subject: Re: [PATCH] libnvdimm: rework region badblocks clearing To: "Kani, Toshimitsu" Cc: "linux-nvdimm@lists.01.org" , "linux-kernel@vger.kernel.org" , "Jiang, Dave" , "Verma, Vishal L" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 1, 2017 at 2:26 PM, Kani, Toshimitsu wrote: > On Sun, 2017-04-30 at 05:39 -0700, Dan Williams wrote: >> Toshi noticed that the new support for a region-level badblocks >> missed the case where errors are cleared due to BTT I/O. >> >> An initial attempt to fix this ran into a "sleeping while atomic" >> warning due to taking the nvdimm_bus_lock() in the BTT I/O path to >> satisfy the locking requirements of __nvdimm_bus_badblocks_clear(). >> However, that lock is not needed since we are not acting any data >> that is subject to change due to a change of state of the bus / >> region. The badblocks instance has its own internal lock to handle >> mutations of the error list. >> >> So, to make it clear that we are just acting on region devices and >> don't need the lock rename __nvdimm_bus_badblocks_clear() to >> nvdimm_clear_badblocks_regions(). Eliminate the lock and consolidate >> all routines in drivers/nvdimm/bus.c. Also, make some cleanups to >> remove unnecessary casts, make the calling convention of >> nvdimm_clear_badblocks_regions() clearer by replacing struct resource >> with the minimal struct clear_badblocks_context, and use the >> DEVICE_ATTR macro. >> >> Cc: Dave Jiang >> Cc: Vishal Verma >> Reported-by: Toshi Kani >> Signed-off-by: Dan Williams > > Confirmed that the clear path to the region-level badblocks works with > the btt workaround and ndctl fix. > > Tested-by: Toshi Kani Thanks Toshi!