Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp102326lqe; Thu, 4 Apr 2024 00:26:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUoBXuMRjZWgIcNNDHcgyb8LA0uKUs15vvjHQHRRODeJzCV5KmdpoyJmiF4Yixpru4V9jIjW9794BVK2L2QQUU7/8YAlhVk45luKIfRug== X-Google-Smtp-Source: AGHT+IGaCEw9LH6qKQNwFwkuGDmphDIIWuJJ77cTAuNhiX0eOgUFo5OAV5DduWH7B+Bz/WMUhnGH X-Received: by 2002:a05:6214:f29:b0:696:92fc:5561 with SMTP id iw9-20020a0562140f2900b0069692fc5561mr1658012qvb.48.1712215607424; Thu, 04 Apr 2024 00:26:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712215607; cv=pass; d=google.com; s=arc-20160816; b=Ebf3eE6L/ZQpPTr87o3twTgtbBF3HkIbKeMPCv0mOE5wkogaK7jFRQRRyLfKSCqwZN ap34BSC6GqYMM53eKrTSH4Ii/KFmohvrd9YySEdaIZS4jBeFARdj8BXuqC+LUe2ULpOx YIPpVKLAuJmthlGPk7gnjz7YSJxqPxybnDtOI7o+hji3JUnGJY5wQBpRBqSExVwL7+bz BypNuR+D1xIek92G2IpnQdSwBSkMNm7QFGEbA75WckRfeL7A3WucIYON/AGHRuF6s2zq M341/j0LE1kNB66/avD47UUJesaRatFpBSEkPL4cntgS8d2kSudjSqesi4wKe7ZJQW0U 71rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=rO9l67DyNAYztIIepGRa+ILhoMRMSzC35pno11nJTs4=; fh=dmsis8dKoK2hUmLhOc7usK8xcsRAg9hnTuhoB1qBMWo=; b=bTernfdq6jisiSgh2tbMYD8/v5ewz0u643cF4Gx9iq+MkFN1k6/2rhp0jM9OUozV48 puNWxmfmoCCEXYIFX1cmNS8Z1NgRulg2tDXwfZ0SH5Jsl3VbLue/JdDOERn7wfYDW22P O2aXCuaoZZ3Hc5Fs+7G3k3QFNe86mRdiXtN+vuZ5nPnqBwS7JTRBgKq9benEsg4ro21f 6NJe8Md5+RMoanj1WfnRyq4uNNggYw8CHeVangcSVCQlIC58MTEuX0X3O+6zdsLF4796 p1EpOzDpWlsvA1uPZD47ETNO5PwnKaiAVJPOE9jN/MQ220KNNT031qMIDDY0ohwnQRGg WP4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bzE0cENk; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-131028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131028-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id cy20-20020a05621418d400b00699323a10b4si799079qvb.15.2024.04.04.00.26.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 00:26:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bzE0cENk; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-131028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131028-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 078A91C21895 for ; Thu, 4 Apr 2024 07:26:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2E1359B7E; Thu, 4 Apr 2024 07:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bzE0cENk" Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 6F1D342A85; Thu, 4 Apr 2024 07:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712215599; cv=none; b=WzuKfDdkt0Si2yL0T54aEsALq0c3LZ1ph6ITSaD4hSeaSRbgA/x959EKopteYYXtDlru/cvcE6+qJuiverCHPIvAbSvEsBkq3nbWo9+Txm2ZyGZqYFEUCvbANi/PBUmxC6GXLbW6hU9Yi2S2L7GUGORO03IlbX43h2RH2l+HGFI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712215599; c=relaxed/simple; bh=bxutVDq3jvxJ2/BdSIG6FsWWr1MXcCJ7bqlpB8XINAo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EPNF1LqmaouvcyCwqVzOGwbuUxW+XX6TDqTAmwa44Mc4gQUCBgju/zX899pYDarXTFtWwIiDNrUFBg1DxzUPXuOwztgs5XKGcsjf4mLV93gkDaxOleCsXveRz/YEEyS8GmsIwkqEg+d3dosodgSyxY6L9NUomuVZXD7jRT++dgs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bzE0cENk; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-516cbf3fe68so416302e87.0; Thu, 04 Apr 2024 00:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712215595; x=1712820395; 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=rO9l67DyNAYztIIepGRa+ILhoMRMSzC35pno11nJTs4=; b=bzE0cENkVPTHaMVduANnk10ZVjXgl5RrtNQPaTWcyH1yqQXJZ6Vi3cMCs9tfUNtOx9 LbiVOaQBfSAgephLysSyK6uE9IEaZPXM+XyAbdCkkIFUZLlDSzh9e4EsKqEVeHr7Iqf/ jXqOt6JZIRJOvxaHmecXNyJgjLWADBzX6Q/Dh2w8F2t86QdJ2ERXmnC9MYUYqSzUlU2w J3FZbUCI+TBBM9BjZMozasmAZse81FPD+o+bG6aGfH8BEWSi0NgYpE/XMQbCt7ffQpB4 Q8aUN/DcPvxjeozc2OoCig/HXC248jouUU06D7PAH9mSmcVbGPTzexBJNzIKq8JnV1tY eiPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712215596; x=1712820396; 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=rO9l67DyNAYztIIepGRa+ILhoMRMSzC35pno11nJTs4=; b=DWOn3luZhn38d0cpTRIAR7Xsv0J7x4pEtDY8Srs9WBj87sJWRLK5HiINZn1nuSJVvx VWyIZVLnGg9+82g2vOcN1E+RvtgmUA51IdXb66efsroJabRGCxeJmv+YTvCMhAvk/EY8 uEniWTS2OOp1JCeJuMj1ymzdqBz3f0hgT0k4PSUEX+8S3BonM9+uvMhk8sMYGfmackS1 5olhaaUTm47ba7WiftRNhrlkA/LJ7/JMdpaYwIm7+OVIAS+DOepBVUi3BMmNavF5W0eX 8QiEYmz24yHyHovDySkNDaF+4aAG4Z41W9w9M7A/qeuF/KEO277kxrJR7ObZlSIV3gOh 5Hqg== X-Forwarded-Encrypted: i=1; AJvYcCWKJ4jMkf3vEgX8gC0St1J+h1T6vtcVTyXYcvZBsypnZIped4SZJDsIFuVfAAcYfZgxPYf6HYqjqHkr9GYxwgXR3N5Lz7tUJknWk6t2cXzDz3+6GKjfSesApLjMw4423b8GHF1ItaYQN049zIdoaCMT6W4dQIUgbgr5pmoXk4L01NRz9Ds5WBt6 X-Gm-Message-State: AOJu0YxfFXDwZ9KXZourg/nhvfg2fHHYHaWQOk1jVj8bo0XJKuxOQLAX NZeX+T3E/j2pVfztpJRwE2V+OGPEHgoAIDGFXXM2lmPV1rQQDn0V X-Received: by 2002:a19:8c1c:0:b0:516:bead:a1b6 with SMTP id o28-20020a198c1c000000b00516beada1b6mr1050955lfd.5.1712215595243; Thu, 04 Apr 2024 00:26:35 -0700 (PDT) Received: from [172.16.183.82] ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id 13-20020ac2484d000000b005130ece9099sm2219235lfy.277.2024.04.04.00.26.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Apr 2024 00:26:34 -0700 (PDT) Message-ID: Date: Thu, 4 Apr 2024 10:26:34 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 0/6] Support ROHM BD96801 scalable PMIC Content-Language: en-US, en-GB To: Matti Vaittinen Cc: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Mark Brown , Wim Van Sebroeck , Guenter Roeck , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org References: From: Matti Vaittinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/2/24 16:07, Matti Vaittinen wrote: > Another "oddity" is that the PMIC has two physical IRQ lines. When I > last wrote this patch in 2021 I had some naming collison in debugfs for > the IRQ domains. Back then I used: > irq_domain_update_bus_token(intb_domain, DOMAIN_BUS_WIRED); > to work-around the issue. Now, when rebasing to v6.9-rc1 the naming > collision was gone and things seemed to work. However, it'd be great if > the IRQ code in MFD driver was reviewed by greater minds :) It appears my statement "things seemed to work" is a bit too optimistic. I am afraid my approach of having two separate IRQ domains for one device (and DT-node) is just somehow fundamentally wrong. It'd be great to learn what's the correct "ideology" here. It appears the naming collision is still there. My config just had the CONFIG_GENERIC_IRQ_DEBUGFS disabled. Enabling it shows the same naming collison: debugfs: File ':ocp:interconnect@48000000:segment@100000:target-module@9c000:i2c@0:pmic@60' in directory 'domains' already present! If I'm not mistaken the debugfs file name is generated from the device-tree node path+name. This is a subtle hint that it is not expected there are more than 1 IRQ-domain / device. I guess this kind of makes sense if we can have more than 1 HWIRQ handled by a single domain (I don't recall having to ever write such domain/IRQ-controller before, but I think it should be possible). I have now 3 new questions =) 1. Should we be able to have more than 1 IRQ domain / device? 2. Should regmap_irq support having more than 1 HWIRQ 3. If answer to 1 is "no" - should we protect against this somehow? (see why below). When CONFIG_GENERIC_IRQ_DEBUGFS is disabled, adding the two IRQ controllers with own IRQ domains (intb and errb here) to a single device is seemingly successful. I see no complaints / errors. Also, most of the IRQs seem to work - but not all. In my case trying to issue: cat /proc/interrupts will oops. Also, looking in the /sys/kernel/irq/ lists folders for all the "intb" and "errb" IRQs - but reading the files contained in these directories will cause an oops for all "errb" interrupts except for the first 16. Finally, if I use the irq_domain_update_bus_token(intb_domain, DOMAIN_BUS_WIRED); to add "-1" at the end of the "intb" - domain name resulting domains: :ocp:interconnect@48000000:segment@100000:target-module@9c000:i2c@0:pmic@60 :ocp:interconnect@48000000:segment@100000:target-module@9c000:i2c@0:pmic@60-1 then it seems that reading the IRQ information from the /proc/interrupts works as expected. Here I am making a wild guess that the name of the domain is used as a key for some data-lookups, and having two domains with a same name will either overwrite something or cause wrong domain data to be fetched. (This is just guessing for now). Any tips, hints or thoughts on this? Yours, -- Matti -- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~