mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Maulik Shah (mkshah)" <quic_mkshah@quicinc.com>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <maz@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] irqchip/qcom-pdc: add support for v3.2 HW
Date: Wed, 23 Aug 2023 11:05:04 +0530	[thread overview]
Message-ID: <5d5ad774-3269-232a-db15-751726742460@quicinc.com> (raw)
In-Reply-To: <20230822-topic-sm8x50-upstream-pdc-ver-v2-1-3035b8d388f7@linaro.org>

Hi Neil,

@@ -142,8 +163,17 @@ static int qcom_pdc_gic_set_type(struct irq_data 
*d, unsigned int type)
>   		return -EINVAL;
>   	}
>   
> -	old_pdc_type = pdc_reg_read(IRQ_i_CFG, d->hwirq);
> -	pdc_reg_write(IRQ_i_CFG, d->hwirq, pdc_type);
> +	if (pdc_version < PDC_VERSION_3_2) {
> +		old_pdc_type = pdc_reg_read(IRQ_i_CFG, d->hwirq);
> +		pdc_reg_write(IRQ_i_CFG, d->hwirq, pdc_type);
> +	} else {
> +		u32 val;
> +
> +		val = pdc_reg_read(IRQ_i_CFG, d->hwirq);
> +		old_pdc_type = val & IRQ_i_CFG_TYPE_MASK;
> +		pdc_reg_write(IRQ_i_CFG, d->hwirq,
> +			      pdc_type | (val & IRQ_i_CFG_IRQ_ENABLE));
> +	}
While above is correct, i don't think we need version check in 
qcom_pdc_gic_set_type() as bits 0-2 are always for the type in old/new 
version as mentioned in v1.

Adding one line after reading old_pdc_type should be good enough.

   old_pdc_type = pdc_reg_read(IRQ_i_CFG, d->hwirq);
+ pdc_type |= (old_pdc_type & ~IRQ_i_CFG_TYPE_MASK);
> +			if (pdc_version < PDC_VERSION_3_2) {
> +				u32 irq_index, reg_index;
> +
> +				reg_index = (i + pdc_region[n].pin_base) >> 5;
> +				irq_index = (i + pdc_region[n].pin_base) & 0x1f;
> +				val = pdc_reg_read(IRQ_ENABLE_BANK, reg_index);
> +				val &= ~BIT(irq_index);
can use  __assign_bit(irq_index, &val, 0); here.
> +				pdc_reg_write(IRQ_ENABLE_BANK, reg_index, val);
> +			} else {
> +				u32 irq;
> +
> +				irq = i + pdc_region[n].pin_base;
> +				val = pdc_reg_read(IRQ_i_CFG, irq);
> +				val &= ~IRQ_i_CFG_IRQ_ENABLE;

__assign_bit(IRQ_i_CFG_IRQ_ENABLE, &val,  0); here.

other than this..
Reviewed-by: Maulik Shah <quic_mkshah@quicinc.com>

Thanks,
Maulik


  reply	other threads:[~2023-08-23  5:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  8:31 Neil Armstrong
2023-08-23  5:35 ` Maulik Shah (mkshah) [this message]
2023-08-23  7:46   ` Neil Armstrong
2023-08-23  8:25     ` Maulik Shah (mkshah)
2023-08-23  8:51       ` neil.armstrong
2023-08-23  9:19         ` Maulik Shah (mkshah)
2023-08-23  9:21           ` neil.armstrong

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=5d5ad774-3269-232a-db15-751726742460@quicinc.com \
    --to=quic_mkshah@quicinc.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --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

all inboxes | Powered by JetHome®