From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA1BF47F46 for ; Wed, 10 Jan 2024 11:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="aXWv6Vmz" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-40e5535b8cfso8411695e9.0 for ; Wed, 10 Jan 2024 03:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1704887722; x=1705492522; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=p22+unadpjiuSy6RGYATC6dS70dMkUd0mDAJ61uro9I=; b=aXWv6VmzjH5x7RWHFSyBQC5qfCLssOfMva95/wI6S21LP0NBkVvstfZR+Gqm1V6dow KwsUt7hIY+F6IUPzZm1B2HAGtVmARYUMAO2Hx1Wx/i4jyWSRYgrKjr2Uq1WMbm53/Rw/ Ro8oQlAI6R8ATShhNYSEF/LBT4CLSR3ED3A7JL1F1EcT9uYYXuCXWcN9XRRYisPH+Kxf sxG0vLB5BW7rfn9ddWHmAHWfLnPz2AJpm5kDjQu9Df7RbAuZNb2A3kbFjbpk/Wpuo+sw jFwbXWEyex7fi5dwz+eDjCQuBxUFwfg26XM1x3iRM8CL9DZfzsqTKdKt/hi8+GKJlvfj LelQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704887722; x=1705492522; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=p22+unadpjiuSy6RGYATC6dS70dMkUd0mDAJ61uro9I=; b=JmdB2iARgP3du54gXlTGt4vGNGiNdAy9nySdRDKlyRBVHebefCrs8aut14SaW+KQb6 PqztiVXt2lSZLPoikaJFu5RGjPhVSltbBYPZvjhnaYzqITYgxEPh9PoDMw0Z8zq2J1bQ MnLf8UmJmn+iL91XMhQfwcoGl5aOlzcrDW4uNnK+6M381Vsy1TOt8HpJxmbQfL802f6W pVLUc6xMN9wIUz0l1V4TAqrzHpWPfg2QgUyGyvhdDNzGiimevq1QpiwI6UzqT1ahES9O tehqxmDRThdbJR7nXhnd22vAqEDZhg0gi0R+iXML+7yetxskrQEBfMNnnA0Z4JEE0876 YAZg== X-Gm-Message-State: AOJu0Ywo5oazva5Bu0rgn1Bws7TLnYN95foa8HYZGZyt0E5y05DsvsP4 ysYa42hODpsBNvCcvU7cXVjIYMVtExp1RA== X-Google-Smtp-Source: AGHT+IEce4ODuGwcEn2BKXeEu1OoSU3T5p4yP+WdC1xjqjakHlYuOMiREbeBunnkwWykVuXti0AI4A== X-Received: by 2002:a05:600c:84ca:b0:40e:52ce:f05 with SMTP id er10-20020a05600c84ca00b0040e52ce0f05mr482062wmb.70.1704887721880; Wed, 10 Jan 2024 03:55:21 -0800 (PST) Received: from [192.168.50.4] ([82.78.167.5]) by smtp.gmail.com with ESMTPSA id g4-20020adfa484000000b00336344c3c3fsm4739160wrb.90.2024.01.10.03.55.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 03:55:21 -0800 (PST) Message-ID: <3e430f8e-b327-485f-ae19-6f1938083dd3@tuxon.dev> Date: Wed, 10 Jan 2024 13:55:18 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v3 08/19] net: ravb: Move the IRQs get and request in the probe function Content-Language: en-US To: Sergey Shtylyov , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, p.zabel@pengutronix.de, yoshihiro.shimoda.uh@renesas.com, wsa+renesas@sang-engineering.com Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, geert+renesas@glider.be, Claudiu Beznea References: <20240105082339.1468817-1-claudiu.beznea.uj@bp.renesas.com> <20240105082339.1468817-9-claudiu.beznea.uj@bp.renesas.com> <02548b1b-d32c-78b1-f1b6-5fdb505d31bb@omp.ru> From: claudiu beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 09.01.2024 22:47, Sergey Shtylyov wrote: > On 1/8/24 11:58 AM, claudiu beznea wrote: > > [...] >>>> From: Claudiu Beznea >>>> >>>> The runtime PM implementation will disable clocks at the end of >>>> ravb_probe(). As some IP variants switch to reset mode as a result of >>>> setting module standby through clock disable APIs, to implement runtime PM >>>> the resource parsing and requesting are moved in the probe function and IP >>>> settings are moved in the open function. This is done because at the end of >>>> the probe some IP variants will switch anyway to reset mode and the >>>> registers content is lost. Also keeping only register specific operations >>>> in the ravb_open()/ravb_close() functions will make them faster. >>>> >>>> Commit moves IRQ requests to ravb_probe() to have all the IRQs ready when >>>> the interface is open. As now IRQs gets and requests are in a single place >>>> there is no need to keep intermediary data (like ravb_rx_irqs[] and >>>> ravb_tx_irqs[] arrays or IRQs in struct ravb_private). >>> >>> There's one thing that you probably didn't take into account: after >>> you call request_irq(), you should be able to handle your IRQ as it's >>> automatically unmasked, unless you pass IRQF_NO_AUTOEN to request_irq(). >>> Your device may be held i reset or even powered off but if you pass IRQF_SHARED to request_irq() (you do in a single IRQ config), you must >>> be prepared to get your device's registers read (in order to ascertain > > And, at least on arm32, reading a powered off (or not clocked?) device's > register causes an imprecise external abort exception -- which results in a > kernel oops... > >>> whether it's your IRQ or not). And you can't even pass IRQF_NO_AUTOEN >>> along with IRQF_SHARED, according to my reading of the IRQ code... >> >> Good point! >> >>>> This is a preparatory change to add runtime PM support for all IP variants. >>> >>> I don't readily see why this is necessary for the full-fledged RPM >>> support... >> >> I tried to speed up the ravb_open()/ravb_close() but missed the IRQF_SHARED > > I doubt that optimizing ravb_{open,close}() is worth pursuing, frankly... > >> IRQ. As there is only one IRQ requested w/ IRQF_SHARED, are you OK with >> still keeping the rest of IRQs handled as proposed by this patch? > > I'm not, as this doesn't really seem necessary for your main goal. > It's not clear in what state U-Boot leaves EtherAVB... Ok. One other reason I did this is, as commit message states, to keep resource parsing and allocation/freeing in probe/remove and hardware settings in open/close. Anyway, I'll revert all the changes IRQ related. Thank you, Claudiu Beznea > > [...] > > MBR, Sergey