Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4130771pxf; Tue, 6 Apr 2021 08:35:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCzyAzzMxmpJBTFQ3D1WiFyqrx4V1xyxG0Ya9zosM2NEwhNSdWICAnTmibb7NPWkWIDcPz X-Received: by 2002:a17:906:a049:: with SMTP id bg9mr35024354ejb.186.1617723350717; Tue, 06 Apr 2021 08:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617723350; cv=none; d=google.com; s=arc-20160816; b=F1rx04XrJk7dObUoC1BtIsbm1zEe+nrtUmOA83VV2UmTqPSMMsxQ/1RQ3mNPEWD3kA 0AN4kBzaVQ9BfQ3cOhoY5wjbeyb5Fzu1D+ea9ePEFBzzUD60Yw4LrIBf1oR6lX03hDUL lgxrvfkkby6uqBnhbOjBlnGeKKtlmIMBV/NikonOy64kcW0NkeuQ3pjHa//CIF8KFkiG vLmMqkyS58my90//5Ua16Dk8TKa/F4WgRnyt9JwwduSKg+6gPEOeRza53DCcDSYd/SvF WKg3C3sujb5UZLfsAQmvwTM60LnZVUzUEQLUfRyYWjkDASjsYbHqfo1oBNhblCE5Muka IPMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=6kxgouY+vTopnyddfeFYlz4bGmxSvwI6aXPtC0I4ymI=; b=qQ5b7jvYvel2aRwOfvB/talC0MnoDGw5dT8+7zy8JQizQSTKZ+84w0l/5GYg38t4Pa fmWB9NDYeKWABAAk/tHgqC3MJSEbtF1cGq7rRY7I6b44IFV+oS+KcTH5G0cXElCpUwoL xZLAoL8jv7Iuq/+kL41OZtPJyNL/FQEbqyHpD2mxLoiNpu5O2p/tPw14HcuxlLqqj8BH nbHDE/ieXNShiPGw6Ypb9PQWRyCCx83qqbUJET/uUrSuiPxAo0n0olkj8/coFcAbHETx cJamspNkQFcxUQTWhY7d6xx2hxrPG0UEgMMg5G11QhIhaM7Py1FaybF6XigObmUQxVqj vrIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="ceti/8F3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si10647323edy.554.2021.04.06.08.35.27; Tue, 06 Apr 2021 08:35:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="ceti/8F3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234003AbhDFGRT (ORCPT + 99 others); Tue, 6 Apr 2021 02:17:19 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46004 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232287AbhDFGRS (ORCPT ); Tue, 6 Apr 2021 02:17:18 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20210406061710euoutp029017809439ef14202efe66721b9ba363~zMFRmmFy33006330063euoutp02C for ; Tue, 6 Apr 2021 06:17:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20210406061710euoutp029017809439ef14202efe66721b9ba363~zMFRmmFy33006330063euoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1617689830; bh=6kxgouY+vTopnyddfeFYlz4bGmxSvwI6aXPtC0I4ymI=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=ceti/8F3fRirnOqi6/7nV2YlBz2r0JCjiFtPn1oQfn/5ewxS1vNcoyfz1/9iK2Yrs G/nDFsNRo0+gxpoLRYrcalPSNFke6uG//bViutZGDCtPBXwXhoxvcwL3bdrzihGESf HGFQwOCnS1Llb6xOuBMUjo/MK2DqPqTI2akx4qpc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20210406061710eucas1p1ccfa6bfa7b4eb73c6dcfc0b2c2397d3f~zMFRfFOK32975229752eucas1p1W; Tue, 6 Apr 2021 06:17:10 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id EE.32.09444.5ECFB606; Tue, 6 Apr 2021 07:17:09 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20210406061709eucas1p1e8c4a2ad214fc3eec6e3c91c09607fed~zMFRDu2ML2972829728eucas1p1D; Tue, 6 Apr 2021 06:17:09 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210406061709eusmtrp2337a8e0a500d478fa32c67b0a23ee101~zMFRDINWU2270622706eusmtrp2o; Tue, 6 Apr 2021 06:17:09 +0000 (GMT) X-AuditID: cbfec7f4-dbdff700000024e4-7f-606bfce5573a Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 23.6C.08705.5ECFB606; Tue, 6 Apr 2021 07:17:09 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210406061709eusmtip147463ca24a3bca8c6459eba331cb0e1e~zMFQv9cZ-0978709787eusmtip1g; Tue, 6 Apr 2021 06:17:09 +0000 (GMT) Subject: Re: [PATCH] iio: buffer: use sysfs_attr_init() on allocated attrs To: Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Cc: jic23@kernel.org From: Marek Szyprowski Message-ID: <6c77abb2-0b6f-a745-0950-0be34d41913e@samsung.com> Date: Tue, 6 Apr 2021 08:17:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210402174226.630346-1-aardelean@deviqon.com> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42LZduznOd2nf7ITDLoO2Fi0PVexeNC0isli 3pF3LBaXd81hc2DxWLVzHbPHplWdbB6fN8kFMEdx2aSk5mSWpRbp2yVwZfTsvsBWcJWv4u7K jywNjMt4uhg5OSQETCTenehj72Lk4hASWMEo8enQfFYI5wujxLMpe6AynxklVr8+xg7T8rPz PxtEYjmjxOU7e1ggnI+MEl9XnmADqRIW8JJYt+8WWIeIQKbErWm/WUFsZgERiY+9W8HibAKG El1vu8DqeQXsJJ7PWsoIYrMIqEis+7EIrEZUIEli6aN/jBA1ghInZz5hAbE5BWwkNsycAzVT XmL72znMELa4xK0n85lADpIQ2MEh8XTKQ0aIs10kDr5rg7KFJV4d3wL1jozE/50wDc2MEg/P rWWHcHqAfmuaAdVhLXHn3C+gUzmAVmhKrN+lDxF2lLi4t48JJCwhwCdx460gxBF8EpO2TWeG CPNKdLQJQVSrScw6vg5u7cELl5gnMCrNQvLaLCTvzELyziyEvQsYWVYxiqeWFuempxYb5aWW 6xUn5haX5qXrJefnbmIEppTT/45/2cG4/NVHvUOMTByMhxglOJiVRHh39GYnCPGmJFZWpRb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wSnVwKRwTOgB4+yzi+7YNXv36zt+ 1maef31+Iv86m7zijtOhKpf/LTfdYnDi25I7D04lnftkx3Xo/haBtCsbM5u5RKYsn6Dsfeuf d+X/FT80rx1SmyeY8f8Rr8lBRc9gJ4ZD/TMdPNUU9jaVLQ9zUtm9pO60a+MfB4OMVNXHnnv3 au3My5U1yY/cb1MQWD99YYr/FG/9H+dmKVmv6mrZXeKi4vJIQShuUeEG06KgBbLHBb/Kr7z+ s1vbosxSr2VS3hmeYlt3zsCdB/dFupW5b5504YvZmz8H3h4p3fZ5w/KM8nmBjCqP/rzNnVyR qS+64CIfn++vZf4HuvZ9MTqW++vcv4keWg8jnC7+c3l8o7OVY4kSS3FGoqEWc1FxIgA5puS4 KAMAAA== X-CMS-MailID: 20210406061709eucas1p1e8c4a2ad214fc3eec6e3c91c09607fed X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20210402174237eucas1p1b117ceaf744e851703a229e87725f776 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20210402174237eucas1p1b117ceaf744e851703a229e87725f776 References: <20210402174226.630346-1-aardelean@deviqon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.04.2021 19:42, Alexandru Ardelean wrote: > When dynamically allocating sysfs attributes, it's a good idea to call > sysfs_attr_init() on them to initialize lock_class_keys. > This change does that. > > The lock_class_keys are set when the CONFIG_DEBUG_LOCK_ALLOC symbol is > enabled. Which is [likely] one reason why I did not see this during > development. > > I also am not able to see this even with CONFIG_DEBUG_LOCK_ALLOC enabled, > so this may [likely] be reproduce-able on some system configurations. > > This was reported via: > https://lore.kernel.org/linux-iio/CA+U=DsrsvGgXEF30-vXuXS_k=-mjSjiBwEEzwKb1hJVn1P98OA@mail.gmail.com/T/#u > > Fixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") > Reported-by: Marek Szyprowski > Signed-off-by: Alexandru Ardelean > --- > > @Marek: could you maybe test this on your setup? > > I haven't been able to reproduce this on mine. Works fine with this fix. Thanks! Tested-by: Marek Szyprowski > Thanks > Alex > > drivers/iio/industrialio-buffer.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c > index ee5aab9d4a23..06b2ea087408 100644 > --- a/drivers/iio/industrialio-buffer.c > +++ b/drivers/iio/industrialio-buffer.c > @@ -1309,6 +1309,7 @@ static struct attribute *iio_buffer_wrap_attr(struct iio_buffer *buffer, > iio_attr->buffer = buffer; > memcpy(&iio_attr->dev_attr, dattr, sizeof(iio_attr->dev_attr)); > iio_attr->dev_attr.attr.name = kstrdup_const(attr->name, GFP_KERNEL); > + sysfs_attr_init(&iio_attr->dev_attr.attr); > > list_add(&iio_attr->l, &buffer->buffer_attr_list); > Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland