Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp760441ima; Wed, 6 Feb 2019 07:58:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IajV0g501P+Lfa8TispFAO2P6y4RwF/laTrP/agOMdmCUdA/kX4G+ngTg6SiIkzDREkFt4g X-Received: by 2002:a17:902:14b:: with SMTP id 69mr11067624plb.120.1549468709941; Wed, 06 Feb 2019 07:58:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549468709; cv=none; d=google.com; s=arc-20160816; b=vr7ILmZ9GNvp7MJXkA6wCKqhpzAR3OmN5sw8tkDXLgntykwdaeatEbybtLN6WVsYmC jIpaBFYDzQoqkFE52h2qUxPjQy5YQMy9WC746BpFpAsab4AENUnKKN6E0lNCMYbnNhOh 0o03JfI/lUsQ5udu4OBTRwJ1d9wU4zt2bk4zDdbXyPJ5vU9KSRkAS/3NOoUC4Loik5Jx /70gIpIWwwdTT3zn3VJdmgN0rQ9TeNdebq7oh4DpWP9iTeO8AJ/Ly+kogvzHSRRtA6b8 r5xSQiFScBEshGqgfn0X794dR5qEwyX6KA+rGpyHcP4ZLDG5QFeLrq2+c/7fYMzVVD9S OCgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:cc:to:subject:dkim-signature :dkim-filter; bh=eNC6D6N0xRQ/OOCneAYnwI9kOLXNUX5o4yfEDCEYo+Y=; b=aFPUc8S1e0cjMCy14q7HM7t1smF12oTG0vE7ZsaiD/xV75Aszwh2c7WsmfawYt+IXk 6HwjkUI6328A4sjiwJ+yeS5xA0AInu4K2Vcw4SkeIRBKme+1igATY2l/mQC8+4rwHq00 z9fkKBJOCO/ZHZ0gvxy7ro90GDB2HCs8eIVyC7S9oYbgDmmhYlaCAjzCzsmZw9yM4JYp cZmP59/RDQ0RQJN6GSmCGhzUKc7HjhymfIOfW/gWzJNxkAJ5g7Nlu4aKbncT4xf3MhQm pi+AI1MVLas9thzzkcmHgpzKuCYLwnB6gJJ9EXmck48IcBXii0Q3BU2c4YiXFdOnXolw 0K9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=axj13uwq; 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q207si5818911pgq.294.2019.02.06.07.58.13; Wed, 06 Feb 2019 07:58:29 -0800 (PST) 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=@samsung.com header.s=mail20170921 header.b=axj13uwq; 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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728437AbfBFPrd (ORCPT + 99 others); Wed, 6 Feb 2019 10:47:33 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:62024 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726914AbfBFPrd (ORCPT ); Wed, 6 Feb 2019 10:47:33 -0500 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190206154730epoutp01e26eca405b05d80de4e593db996d7593~A0Pt2JF1N3096730967epoutp01W; Wed, 6 Feb 2019 15:47:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190206154730epoutp01e26eca405b05d80de4e593db996d7593~A0Pt2JF1N3096730967epoutp01W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1549468050; bh=eNC6D6N0xRQ/OOCneAYnwI9kOLXNUX5o4yfEDCEYo+Y=; h=Subject:To:Cc:From:Date:In-reply-to:References:From; b=axj13uwqTzbZBXRlfEnxpWV/j7WEJINHiRpU1HUJtAoVRvjrhO3xeMS/ZhbUK+i1X DeTIPBer9UUVD3NGyqAJBiMJ389ROFaKUp1xk0/I4AxqGV7sTp2jT++5WO8k0hztuu M/Ugk/lz1MUwHs7hlZEy7ctlDoEm/lVkEmjviMCo= Received: from epsmges1p4.samsung.com (unknown [182.195.42.56]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190206154729epcas1p275164272b0e480c8f893e46df40c68a3~A0Psx2Yic1341013410epcas1p2o; Wed, 6 Feb 2019 15:47:29 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id F6.A6.04288.0910B5C5; Thu, 7 Feb 2019 00:47:29 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190206154727epcas1p26ea666eec2e64882e383b4b092c2ec65~A0Prrj9OV0572805728epcas1p2F; Wed, 6 Feb 2019 15:47:27 +0000 (GMT) X-AuditID: b6c32a38-bf7ff700000010c0-d8-5c5b0190f9b6 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 51.FD.04015.F810B5C5; Thu, 7 Feb 2019 00:47:27 +0900 (KST) Received: from [106.116.147.40] by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PMI00G8ZH6Z0520@mmp1.samsung.com>; Thu, 07 Feb 2019 00:47:27 +0900 (KST) Subject: Re: [PATCH] ASoC: dapm: Check for NULL widget in dapm_update_dai_unlocked To: Charles Keepax , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, "linux-samsung-soc@vger.kernel.org" , Marek Szyprowski From: Sylwester Nawrocki Message-id: Date: Wed, 06 Feb 2019 16:47:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-version: 1.0 In-reply-to: <20190206114545.GR3837@imbe.wolfsonmicro.main> Content-type: text/plain; charset="utf-8" Content-language: en-GB Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFKsWRmVeSWpSXmKPExsWy7bCmge5ExugYgx87mSyuXDzEZDH14RM2 iyutmxgtzp/fwG7x7UoHk8XlXXPYLGac38dksfbIXXaLzl39rBYbvq9ldODy2PC5ic1j56y7 7B6bVnWyeUyf85/RY9/bZWwefVtWMXqs33KVxePzJrkAjigum5TUnMyy1CJ9uwSujBe/G5gL fvNWPP16gKWBcTJ3FyMHh4SAicS7O0FdjFwcQgI7GCVOHj7FCuF8Z5Q4sKaPvYuRE6yo7857 ZojEbkaJyb1LGSGc+4wSLxduAqsSFgiRmD1lKSuILSIQLXFk8VwmkCJmgUNMEgsvXGUESbAJ GEr0Hu0Ds3kF7CR+TJzEBmKzCKhKXD98lQXEFhWIkDjc+w6qRlDix+R7YHFOAWuJFyeamEFs ZgFNiRdfJrFA2OISx+7fZISw5SU2r3kLdqqEwH82iY9THzNB/OAicWLtN2aIp6UlLh21hQhX S+za3g1V38Eo0XJhOzNEwlri8PGLrBBD+STefe1hhejllehoE4Io8ZDoW9zGAgmJ68wSnVd2 s01glJmF5O5ZSG6dheTWWUhuXcDIsopRLLWgODc9tdiwwESvODG3uDQvXS85P3cTIzjFaFns YNxzzucQowAHoxIPb8CtqBgh1sSy4srcQ4wSHMxKIrxvnwGFeFMSK6tSi/Lji0pzUosPMUpz sCi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bijERDLeai4kQA8ueiW5wCAAA= X-CMS-MailID: 20190206154727epcas1p26ea666eec2e64882e383b4b092c2ec65 CMS-TYPE: 101P X-CMS-RootMailID: 20190205211638epcas3p409823d4acac8073473153d745151ea5f References: <20190205211622.GA5891@kozik-lap> <844c3f34-f7db-6b26-169a-994922367c78@samsung.com> <20190206100549.GO3837@imbe.wolfsonmicro.main> <20190206105955.GP3837@imbe.wolfsonmicro.main> <20190206114545.GR3837@imbe.wolfsonmicro.main> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/6/19 12:45, Charles Keepax wrote: > Looking through I think this is an unrelated issue. Assuming the > driver in question is (sound/soc/samsung/i2s.c). Inside > i2s_trigger, there is a call to config_setup(i2s), which in turn > will call clk_get_rate if i2s->quirks contains the flag > QUIRK_NO_MUXPSR. > > The trigger callback can be made from an atomic context and > clk_get_rate will take the prepare lock of the clock. The clock > prepare lock is always a mutex which shouldn't be locked from an > atomic context. So it seems like this will fail whenever that > QUIRK_NO_MUXPSR flag is set, no idea what causes that to be set. > > It looks like this bug was introduced by this change: > > 647d04f8e07a ("ASoC: samsung: i2s: Ensure the RCLK rate is properly determined") Thanks or having a look at this. I somehow overlooked it before, there are multiple issues with that clk_get_rate() call. Apart of the problem described above config_setup() is already called with the i2s->lock spinlock held, exactly same spinlock that is passed to the clock API when registering a clock of which we try to get rate. :/ Presumably it works due to clk rate caching. Whether QUIRK_NO_MUXPSR flag is set or not depends on the HW type, it is not set for modern SoCs so most of the time we will hit the problem in I2S master configurations. As we are not using set_sysclk() of the CPU DAI I'm thinking about moving the clk_get_rate() call to the CPU DAI's hw_params() callback. The clock rate may be changed in hw_params() of an ASoC machine driver, and the CPU DAI needs to adjust to those changes. It feels like locking in that driver might need revisiting, there is quite a lot happening while holding a spinlock. -- Thanks, Sylwester