From: Can Guo <quic_cang@quicinc.com>
To: Manivannan Sadhasivam <mani@kernel.org>, Arnd Bergmann <arnd@kernel.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Arnd Bergmann <arnd@arndb.de>, Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Bart Van Assche <bvanassche@acm.org>,
Avri Altman <avri.altman@wdc.com>, Bean Huo <beanhuo@micron.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
Thomas Gleixner <tglx@linutronix.de>,
<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH] scsi: ufs: qcom: fix platform_msi_domain_free_irqs() reference
Date: Mon, 30 Jan 2023 12:03:45 +0800 [thread overview]
Message-ID: <9ff005f0-0cef-65d6-6f69-8394f1ba3e3c@quicinc.com> (raw)
In-Reply-To: <20230127060221.GB7809@thinkpad>
Hi Mani and Arnd,
On 1/27/2023 2:02 PM, Manivannan Sadhasivam wrote:
> On Thu, Jan 26, 2023 at 10:17:31PM +0100, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> The newly added MSI support is mostly hidden inside of an #ifdef,
>> except for one line that now causes a build failure when MSI
>> is disabled:
>>
>> drivers/ufs/host/ufs-qcom.c: In function 'ufs_qcom_remove':
>> drivers/ufs/host/ufs-qcom.c:1698:9: error: implicit declaration of function 'platform_msi_domain_free_irqs' [-Werror=i]
>> 1698 | platform_msi_domain_free_irqs(hba->dev);
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Above that, the symbol that guards the other call was recently
>> removed, so that is all dead code at the moment.
>>
>> Remove the incorrect #ifdef and instead of a Kconfig dependency
>> to only allow building the driver when CONFIG_GENERIC_MSI_IRQ
>> is enabled. This symbol is always present when PCI_MSI
>> or ARM_GIC_V3_ITS are enabled, both of which should be present
>> on kernels that can run on Qualcomm SoCs.
>>
>> The 'select RESET_CONTROLLER' in combination with this dependency
>> unfortunately causes a dependency loop and this is a user-visible
>> symbol, so it's better to change both to 'depends on'.
>>
>> Fixes: 519b6274a777 ("scsi: ufs: qcom: Add MCQ ESI config vendor specific ops")
>> Fixes: 13e7accb81d6 ("genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
>
>> ---
>> Not sure if this is the best solution, both the GENERIC_MSI_IRQ
>> dependencies and the RESET_CONTROLLER dependencies are a bit
>> inconsistent already. Feel free to pick another approach that
>> addresses both of the bugs I found.
> I think your proposed solution works best at the moment.
>
> Thanks,
> Mani
>
>> ---
>> drivers/ufs/host/Kconfig | 3 ++-
>> drivers/ufs/host/ufs-qcom.c | 8 --------
>> 2 files changed, 2 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/ufs/host/Kconfig b/drivers/ufs/host/Kconfig
>> index 139064e70a34..663881437921 100644
>> --- a/drivers/ufs/host/Kconfig
>> +++ b/drivers/ufs/host/Kconfig
>> @@ -57,8 +57,9 @@ config SCSI_UFS_DWC_TC_PLATFORM
>> config SCSI_UFS_QCOM
>> tristate "QCOM specific hooks to UFS controller platform driver"
>> depends on SCSI_UFSHCD_PLATFORM && ARCH_QCOM
>> + depends on GENERIC_MSI_IRQ
>> + depends on RESET_CONTROLLER
>> select QCOM_SCM if SCSI_UFS_CRYPTO
>> - select RESET_CONTROLLER
>> help
>> This selects the QCOM specific additions to UFSHCD platform driver.
>> UFS host on QCOM needs some vendor specific configuration before
>> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
>> index 681da3ea7154..eb66b5f6cf19 100644
>> --- a/drivers/ufs/host/ufs-qcom.c
>> +++ b/drivers/ufs/host/ufs-qcom.c
>> @@ -1538,7 +1538,6 @@ static int ufs_qcom_get_outstanding_cqs(struct ufs_hba *hba,
>> return 0;
>> }
>>
>> -#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
>> static void ufs_qcom_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
>> {
>> struct device *dev = msi_desc_to_dev(desc);
>> @@ -1626,13 +1625,6 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
>> return ret;
>> }
>>
>> -#else
>> -static int ufs_qcom_config_esi(struct ufs_hba *hba)
>> -{
>> - return -EOPNOTSUPP;
>> -}
>> -#endif
>> -
>> /*
>> * struct ufs_hba_qcom_vops - UFS QCOM specific variant operations
>> *
>> --
>> 2.39.0
>>
Thank you for pointing to 13e7accb81d6 ("genirq: Get rid of
GENERIC_MSI_IRQ_DOMAIN"),
which I was not aware of. I am thinking about fixing it just like how
13e7accb81d6 ("genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN") is fixing
drivers/dma/qcom/hidma.c -
In ufs-qcom.c, use CONFIG_GENERIC_MSI_IRQ instead of
CONFIG_GENERIC_MSI_IRQ_DOMAIN,
and meanwhile add #ifdef check before calling
platform_msi_domain_free_irqs().
Please let me know your idea.
Thanks.
Regards,
Can Guo
next prev parent reply other threads:[~2023-01-30 4:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 21:17 [PATCH] scsi: ufs: qcom: fix platform_msi_domain_free_irqs() reference Arnd Bergmann
2023-01-27 6:02 ` Manivannan Sadhasivam
2023-01-30 4:03 ` Can Guo [this message]
2023-01-30 7:45 ` Manivannan Sadhasivam
2023-01-30 7:55 ` Can Guo
2023-02-04 1:17 ` Martin K. Petersen
2023-02-09 2:43 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9ff005f0-0cef-65d6-6f69-8394f1ba3e3c@quicinc.com \
--to=quic_cang@quicinc.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=jejb@linux.ibm.com \
--cc=jgg@ziepe.ca \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).