mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 4/7] xen/events: remove some simple helpers from events_base.c
Date: Tue, 14 Nov 2023 09:28:46 +0100	[thread overview]
Message-ID: <54d307d7-6785-47b0-bc2a-698e46adc25f@suse.com> (raw)
In-Reply-To: <b7b705e6-584b-4655-b005-521be3f23c1e@epam.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1837 bytes --]

On 13.11.23 18:35, Oleksandr Tyshchenko wrote:
> 
> 
> On 16.10.23 09:28, Juergen Gross wrote:
> 
> 
> Hello Juergen.
> 
> 
>> The helper functions type_from_irq() and cpu_from_irq() are just one
>> line functions used only internally.
>>
>> Open code them where needed. At the same time modify and rename
>> get_evtchn_to_irq() to return a struct irq_info instead of the IRQ
>> number.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> 
> 
> [snip]
> 
> 
> 
>>
>> @@ -1181,15 +1172,16 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t evtchn, struct irq_chip *chip,
>>    {
>>    	int irq;
>>    	int ret;
>> +	struct irq_info *info;
>>    
>>    	if (evtchn >= xen_evtchn_max_channels())
>>    		return -ENOMEM;
> 
> 
> I assume this check is called here (*before* holding a lock) by
> intention, as evtchn_to_info() below contains the same check.

Yes.

> 
>>    
>>    	mutex_lock(&irq_mapping_update_lock);
>>    
>> -	irq = get_evtchn_to_irq(evtchn);
>> +	info = evtchn_to_info(evtchn) >
>> -	if (irq == -1) {
>> +	if (!info) {
>>    		irq = xen_allocate_irq_dynamic();
>>    		if (irq < 0)
>>    			goto out;
>> @@ -1212,8 +1204,8 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t evtchn, struct irq_chip *chip,
>>    		 */
>>    		bind_evtchn_to_cpu(evtchn, 0, false);
>>    	} else {
>> -		struct irq_info *info = info_for_irq(irq);
>> -		WARN_ON(info == NULL || info->type != IRQT_EVTCHN);
>> +		WARN_ON(info->type != IRQT_EVTCHN);
>> +		irq = info->irq;
>>    	}
> 
> 
> This hunk doesn't apply clearly to the latest state, because of
> "9e90e58c11b7 xen: evtchn: Allow shared registration of IRQ handers"
> went in. Please rebase.
> 
> 
> With that:
> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Thanks,


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2023-11-14  8:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16  6:28 [PATCH 0/7] xen/events: do some cleanups in events_base.c Juergen Gross
2023-10-16  6:28 ` [PATCH 1/7] xen/events: fix delayed eoi list handling Juergen Gross
2023-11-13 13:51   ` Oleksandr Tyshchenko
2023-10-16  6:28 ` [PATCH 2/7] xen/events: remove unused functions Juergen Gross
2023-11-13 14:20   ` Oleksandr Tyshchenko
2023-10-16  6:28 ` [PATCH 3/7] xen/events: reduce externally visible helper functions Juergen Gross
2023-11-13 15:53   ` Oleksandr Tyshchenko
2023-10-16  6:28 ` [PATCH 4/7] xen/events: remove some simple helpers from events_base.c Juergen Gross
2023-11-13 17:35   ` Oleksandr Tyshchenko
2023-11-14  8:28     ` Juergen Gross [this message]
2023-10-16  6:28 ` [PATCH 5/7] xen/events: drop xen_allocate_irqs_dynamic() Juergen Gross
2023-11-14  8:20   ` Oleksandr Tyshchenko
2023-11-14  8:35     ` Juergen Gross
2023-11-14 18:29       ` Oleksandr Tyshchenko
2023-10-16  6:28 ` [PATCH 6/7] xen/events: modify internal [un]bind interfaces Juergen Gross
2023-11-14 13:45   ` Oleksandr Tyshchenko
2023-10-16  6:28 ` [PATCH 7/7] xen/events: remove some info_for_irq() calls in pirq handling Juergen Gross
2023-11-14 18:16   ` Oleksandr Tyshchenko
2023-11-15  7:41     ` Juergen Gross
2023-11-13  7:14 ` [PATCH 0/7] xen/events: do some cleanups in events_base.c Juergen Gross

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=54d307d7-6785-47b0-bc2a-698e46adc25f@suse.com \
    --to=jgross@suse.com \
    --cc=Oleksandr_Tyshchenko@epam.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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®