Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1500997ybk; Sun, 10 May 2020 19:09:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnwksqg9cO8uvIvlpA5YN8U4FMtgy6fz81aF1VCx3mM2GYR0ghAtCFa6KiKO2odnUbtUO8 X-Received: by 2002:aa7:d496:: with SMTP id b22mr2116500edr.301.1589162950092; Sun, 10 May 2020 19:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589162950; cv=none; d=google.com; s=arc-20160816; b=Ryyl1SrtsxeX+uoAlQBXQ5xsZMfWw4kYNAfLRmzbRtE8hNibjlisf466mPvBks4v2x b5n6FDimJHtvistdQ91eUxz9zSrax5t7I6hW3ZIAqTR7IR0+8Gkpe+Bd0LSypGePnVvQ osPubfPE9Ccx2bxP/tEaCm0Ic4V+hBKK8uiV7b+eOOnumzJ+y+GGxFptKsAFUszKcztI Iq97Z0UQkqDySb3PrrUwtcoy697iXZVNFBWy77tn7Lfg/hkSmZwIYqfvTzq9PoSAL0ad USB51i17p5r70Zp/dls8qHw3+VH9jVIYhDK8lz4PR2QpDIla4EH0G4yG6b/3OSgGVRLf jkKg== 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:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=3/qDGIPXlZ5ajDZKoARv35o24X5wav9G8zYPRJumN30=; b=oXR1an2yyJ4h/EbqwgZK/OA9u0PlA11wh9oJaEQtA/JG4rqZDeVJc0UROCJsNNKKpO LPK39l9u5QTAV20ZuIAS5Ug8gtiqhpgJe2WDxDNPFvRxp+BUHJsi4s8ex2nVVd8UUvwb OASp2pLm9N5hGX98ZftlVSq5D7vpHpuZOjU93hgxzE9Bjc3rYj42yqdJo4ByZ8geEBe1 7FwOetvfROdN5F/sD/twxkNw95X1rm/QYbFeLwJzkZOXvJNdqouhlMrH5ZYsMKs0PGaP MhlwTbm681ahCKWnKWwYLEUII12Kyboo/gcfQfevvZdL4KaOxbueAg1WiPn+ZUTWJ/iK Z4tQ== 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 a19si4896720edr.254.2020.05.10.19.08.38; Sun, 10 May 2020 19:09:10 -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 S1729327AbgEKCF5 (ORCPT + 99 others); Sun, 10 May 2020 22:05:57 -0400 Received: from esa3.mentor.iphmx.com ([68.232.137.180]:51944 "EHLO esa3.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729075AbgEKCF5 (ORCPT ); Sun, 10 May 2020 22:05:57 -0400 IronPort-SDR: aaREmatvyLFG1RDNziHAZ5oGgMBvz3oI4gpXxaa2OC9U7qW+lVWO2NxkDHWRBnR1bdy2MVmQoC GUcHeiyPcyMaFn25STG9TzDowO4Rdt97Dwt+psavv4Gq7oqAjC38XlYr1D+V0npaLy8zEwkEfD /Ob/5sqiYYLN6vBaGJeh/SB8mJ1tutu07vCG+Q8h/36G8eUNkh5qgUC82CjAtPtFj9hPhp4XZE X+OK2whN5kBimh7rhVSFZd98Ko4AVtk2fW19oU8dCagxUGZD+FkLpytrnIfCpg3QMWTpKXmmIU k5o= X-IronPort-AV: E=Sophos;i="5.73,378,1583222400"; d="scan'208";a="48704677" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 10 May 2020 18:05:55 -0800 IronPort-SDR: 6e6wRdJxlFS3+1c9zx6KqiiHZhYtgREtRJaDj2vKeBTLZWt+zuV09ogggmkvShy6nNhFivi6f3 z4nS0H8Mxm3PfG6FF8+GHwMlrr9jXLaGHWTAErE5QCOPz1ASgRG2yGkkPuy+P+QcjNk8UuLtiv lzkjOyW2YD293FdZkrpNctocuHvqPi/pXW0E6DpwxYGzEqaItUmSDTVSWPlOZZ/dXiyMfzBCcE eXtch0GLhBgiYxzG5+7TqvmWojsqHzoCzr6clsktQNEaESe2kspUuPLHUgECw3UBJ1hcgcUgA3 MxM= Subject: Re: [PATCH v11 33/56] Input: atmel_mxt_ts - delay enabling IRQ when not using regulators To: Dmitry Osipenko , , , , , CC: , , , References: <20200508055656.96389-1-jiada_wang@mentor.com> <20200508055656.96389-34-jiada_wang@mentor.com> <3a942afa-c047-2c88-1c8e-a90fa018738e@gmail.com> From: "Wang, Jiada" Message-ID: <6af23ae6-2f1c-0459-d2b6-1b01ddb0c3dc@mentor.com> Date: Mon, 11 May 2020 11:05:33 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <3a942afa-c047-2c88-1c8e-a90fa018738e@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Dmitry Thanks for your comment and test, can you let me know which platform (board) you are using for test, and DTS changes if you have added any. Thanks, Jiada On 2020/05/11 10:05, Dmitry Osipenko wrote: > 08.05.2020 08:56, Jiada Wang пишет: >> The path of enabling the IRQ in the probe function is not safe in level >> triggered operation, if it was already powered up and there is a message >> waiting on the device (eg finger down) because the object table has not yet >> been read. This forces the ISR into a hard loop. >> >> Delay enabling the interrupt until it is first needed, by set flag >> IRQ_NOAUTOEN. >> >> Signed-off-by: Jiada Wang >> CC: Dmitry Osipenko >> --- >> drivers/input/touchscreen/atmel_mxt_ts.c | 7 +++++-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c >> index 7c9a738e633a..ab4eceac8fe7 100644 >> --- a/drivers/input/touchscreen/atmel_mxt_ts.c >> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c >> @@ -3822,6 +3822,7 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) >> return error; >> } >> >> + irq_set_status_flags(client->irq, IRQ_NOAUTOEN); >> error = devm_request_threaded_irq(&client->dev, client->irq, >> NULL, mxt_interrupt, IRQF_ONESHOT, >> client->name, data); >> @@ -3831,17 +3832,19 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) >> } >> >> if (data->suspend_mode == MXT_SUSPEND_REGULATOR) { >> + enable_irq(data->irq); > > Hello Jiada, > > This change contradicts to the commit's message since enabling IRQ until > hardware has been fully powered-on and reset is not allowed. > >> error = mxt_probe_regulators(data); >> if (error) >> return error; >> + >> + disable_irq(data->irq); >> } else if (data->reset_gpio) { >> msleep(MXT_RESET_GPIO_TIME); >> gpiod_set_value(data->reset_gpio, 1); >> msleep(MXT_RESET_INVALID_CHG); >> } >> >> - disable_irq(data->irq); >> - >> error = mxt_initialize(data); >> if (error) >> return error; >> > > Secondly, I gave a try to this version of the series and unfortunately > it doesn't work at all: > > [ 125.928709] INFO: task systemd-udevd:184 blocked for more than 61 > seconds. > [ 125.929130] Not tainted > 5.7.0-rc4-next-20200508-00189-g0fe7f91d4a66-dirty #2206 > [ 125.929474] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" > disables this message. > [ 125.929900] systemd-udevd D 0 184 173 0x00000080 > [ 125.929921] [] (__schedule) from [] > (schedule+0x65/0xc0) > [ 125.929965] [] (schedule) from [] > (synchronize_irq+0x5b/0x7c) > [ 125.930001] [] (synchronize_irq) from [] > (mxt_stop+0x51/0xe0) > [ 125.930016] [] (mxt_stop) from [] > (mxt_input_close+0x13/0x34) > [ 125.930042] [] (mxt_input_close) from [] > (input_close_device+0x3d/0x5c) > [ 125.930063] [] (input_close_device) from [] > (evdev_release+0xa7/0xbc) > [ 125.930088] [] (evdev_release) from [] > (__fput+0x91/0x198) > [ 125.930121] [] (__fput) from [] > (task_work_run+0x73/0x90) > [ 125.930138] [] (task_work_run) from [] > (do_work_pending+0x381/0x430) > [ 125.930149] [] (do_work_pending) from [] > (slow_work_pending+0x9/0x18) > [ 125.930153] Exception stack(0xedd0ffb0 to 0xedd0fff8) > > Please test everything properly and fix it in the next version. > > BTW, it won't hurt to apply a spell-checker to the commit messages to > fix small typos. >