Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp880962ybz; Wed, 29 Apr 2020 11:01:59 -0700 (PDT) X-Google-Smtp-Source: APiQypKbX6RrQkv3cRb6ZR2E6xRtITMon4jO5YoAZA4vR3PpN7Wv6N78n6UbagGBs/WyvJ7C2ZcH X-Received: by 2002:a17:906:4c46:: with SMTP id d6mr3758726ejw.257.1588183319143; Wed, 29 Apr 2020 11:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588183319; cv=none; d=google.com; s=arc-20160816; b=YyN5k12lp1DstYntNULeAuiEb/qCRwKDnd5tNOBiYwyN68R7eORQrQgw8kullJ2GV+ 7kIZgbMtv8vRc/quEJPVRho26audFlVv1J9AbZnTtICbke36I0v7YDBgqIIDBddDmYVK i7JHWk+bvF2VAklQ6xO66tYV3YIX2+fekF7JcSHKHnHA8BRDbKYbWCShIsWhKvZSsacc YB9lkh9XBMfA9e0+t+QAImj46A1JKb2easY8gfD/fA0KqdX84CeVHDLkjqs7Z62TXlyq eULqPuCSoqd6F8NHMiQcvQrkZ6IvmaB2KLtI8U5GY9JcrB4tcRHD7cUtB58j2h2/ROg3 Gfaw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=LI2UMNoKvdzErBqZkiXgDOKX1/3b9iBYCblT+6AfgMI=; b=HvRxG22npnrC8uPJ4QTcyCPqEnLqe0XU4pof1/ObDBCqAxr0m1/uk9/q2yCBRFiQKC 6ca/v+dxw1wTA80BOOb1xCXUvgnB9osk6N6R9qIM4b3ZuUQbLT58pkt66+h4pFnbe9ZG SE4aFZIQXYH2VD87mkNl77eaZD2FiA55IUdoPlXEGVdyNwD/ubq4fY16PUcTTwplRR1H nLMQbVpynrg1Zwtox14ath63dZUEnoTm7CJun0bN40US/9/r6Ncs2tQhYIo8ulqiqXDZ XewGlVWrruMFIqLHaFshoIn298HxSir/e+5R5JWTY6FHjUoH2ti/W1RYmN5ZSH4Rex1Y kIuw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si4259063ejv.161.2020.04.29.11.01.21; Wed, 29 Apr 2020 11:01:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbgD2R72 (ORCPT + 99 others); Wed, 29 Apr 2020 13:59:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:41536 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbgD2R71 (ORCPT ); Wed, 29 Apr 2020 13:59:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3CF9DACC2; Wed, 29 Apr 2020 17:59:24 +0000 (UTC) Subject: Re: [PATCH v3 1/1] dma: actions: Fix lockdep splat for owl-dma To: Cristian Ciocaltea Cc: Manivannan Sadhasivam , Vinod Koul , Dan Williams , dmaengine@vger.kernel.org, linux-actions@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <2f3e665270b8d170ea19cc66c6f0c68bf8fe97ff.1588173497.git.cristian.ciocaltea@gmail.com> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Organization: SUSE Software Solutions Germany GmbH Message-ID: <87e4f05f-e942-2a39-1f87-fe01fb6c4248@suse.de> Date: Wed, 29 Apr 2020 19:59:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <2f3e665270b8d170ea19cc66c6f0c68bf8fe97ff.1588173497.git.cristian.ciocaltea@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 29.04.20 um 17:28 schrieb Cristian Ciocaltea: > When the kernel is built with lockdep support and the owl-dma driver is > used, the following message is shown: > > [ 2.496939] INFO: trying to register non-static key. > [ 2.501889] the code is fine but needs lockdep annotation. > [ 2.507357] turning off the locking correctness validator. > [ 2.512834] CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.6.3+ #15 > [ 2.519084] Hardware name: Generic DT based system > [ 2.523878] Workqueue: events_freezable mmc_rescan > [ 2.528681] [<801127f0>] (unwind_backtrace) from [<8010da58>] (show_stack+0x10/0x14) > [ 2.536420] [<8010da58>] (show_stack) from [<8080fbe8>] (dump_stack+0xb4/0xe0) > [ 2.543645] [<8080fbe8>] (dump_stack) from [<8017efa4>] (register_lock_class+0x6f0/0x718) > [ 2.551816] [<8017efa4>] (register_lock_class) from [<8017b7d0>] (__lock_acquire+0x78/0x25f0) > [ 2.560330] [<8017b7d0>] (__lock_acquire) from [<8017e5e4>] (lock_acquire+0xd8/0x1f4) > [ 2.568159] [<8017e5e4>] (lock_acquire) from [<80831fb0>] (_raw_spin_lock_irqsave+0x3c/0x50) > [ 2.576589] [<80831fb0>] (_raw_spin_lock_irqsave) from [<8051b5fc>] (owl_dma_issue_pending+0xbc/0x120) > [ 2.585884] [<8051b5fc>] (owl_dma_issue_pending) from [<80668cbc>] (owl_mmc_request+0x1b0/0x390) > [ 2.594655] [<80668cbc>] (owl_mmc_request) from [<80650ce0>] (mmc_start_request+0x94/0xbc) > [ 2.602906] [<80650ce0>] (mmc_start_request) from [<80650ec0>] (mmc_wait_for_req+0x64/0xd0) > [ 2.611245] [<80650ec0>] (mmc_wait_for_req) from [<8065aa10>] (mmc_app_send_scr+0x10c/0x144) > [ 2.619669] [<8065aa10>] (mmc_app_send_scr) from [<80659b3c>] (mmc_sd_setup_card+0x4c/0x318) > [ 2.628092] [<80659b3c>] (mmc_sd_setup_card) from [<80659f0c>] (mmc_sd_init_card+0x104/0x430) > [ 2.636601] [<80659f0c>] (mmc_sd_init_card) from [<8065a3e0>] (mmc_attach_sd+0xcc/0x16c) > [ 2.644678] [<8065a3e0>] (mmc_attach_sd) from [<8065301c>] (mmc_rescan+0x3ac/0x40c) > [ 2.652332] [<8065301c>] (mmc_rescan) from [<80143244>] (process_one_work+0x2d8/0x780) > [ 2.660239] [<80143244>] (process_one_work) from [<80143730>] (worker_thread+0x44/0x598) > [ 2.668323] [<80143730>] (worker_thread) from [<8014b5f8>] (kthread+0x148/0x150) > [ 2.675708] [<8014b5f8>] (kthread) from [<801010b4>] (ret_from_fork+0x14/0x20) > [ 2.682912] Exception stack(0xee8fdfb0 to 0xee8fdff8) > [ 2.687954] dfa0: 00000000 00000000 00000000 00000000 > [ 2.696118] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > [ 2.704277] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 > > The obvious fix would be to use 'spin_lock_init()' on 'pchan->lock' > before attempting to call 'spin_lock_irqsave()' in 'owl_dma_get_pchan()'. > > However, according to Manivannan Sadhasivam, 'pchan->lock' was supposed > to only protect 'pchan->vchan' while 'od->lock' does a similar job in > 'owl_dma_terminate_pchan'. > > Therefore, this patch will simply substitute 'pchan->lock' with 'od->lock' > and removes the 'lock' attribute in 'owl_dma_pchan' struct. > Please add: Fixes: 47e20577c24d ("dmaengine: Add Actions Semi Owl family S900 DMA driver") > Signed-off-by: Cristian Ciocaltea > Reviewed-by: Manivannan Sadhasivam > --- > Changes in v3: > * Get rid of the kerneldoc comment for the removed struct attribute > * Add the Reviewed-by tag in the commit message > > Changes in v2: > * Improve the fix as suggested by Manivannan Sadhasivam: substitute > 'pchan->lock' with 'od->lock' and get rid of the 'lock' attribute in > 'owl_dma_pchan' struct > * Update the commit message to reflect the changes > > drivers/dma/owl-dma.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) Otherwise no objections from my side, Acked-by: Andreas Färber Maybe the DMA maintainers can add those two lines when picking it up, to avoid a v4? Regards, Andreas -- SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer HRB 36809 (AG Nürnberg)