mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Finn Thain <fthain@linux-m68k.org>
Cc: Michael Schmitz <schmitzmic@gmail.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] scsi: mac_scsi: Replace NO_IRQ by 0
Date: Thu, 6 Oct 2022 11:13:52 +0000	[thread overview]
Message-ID: <009bf4b2-ab5d-b583-20bd-8eee397e251a@csgroup.eu> (raw)
In-Reply-To: <5fb75ac2-678a-dd6e-2e68-7485b2d2ce5f@linux-m68k.org>



Le 06/10/2022 à 11:25, Finn Thain a écrit :
> On Thu, 6 Oct 2022, Christophe Leroy wrote:
> 
>> NO_IRQ is used to check the return of irq_of_parse_and_map().
>>
>> On some architecture NO_IRQ is 0, on other architectures it is -1.
>>
> 
> Yes. The core NCR5380 driver is used on ARM etc. where NO_IRQ is -1 as
> well as on powerpc where it is 0.
> 
>> irq_of_parse_and_map() returns 0 on error, independent of NO_IRQ.
>>
>> So use 0 instead of using NO_IRQ.
>>
> 
> Sorry, I must be missing something.

My mistake.

I started by removing NO_IRQ definition in powerpc and then fixed all 
build failures by replacing NO_IRQ by 0. Then I splitted the patch into 
one per subsystem, all with the same explaination.

Most places it was just a verification of the value returned by 
irq_of_parse_and_map() where it is obviously wrong to use NO_IRQ, 
especially on ARM where NO_IRQ doesn't match what irq_of_parse_and_map() 
returns in case on error.

But here in the mac_scsi driver it seems a bit different and I have a 
look more closely.


> 
> You seem to be saying that this driver could be re-used in the context of
> openfirmware/device trees if it avoided using the NO_IRQ. Do I have that
> right?
> 
> Or are you changing NO_IRQ semantics tree-wide for some reason explained
> somewhere else?

No, I only say that NO_IRQ doesn't match the value returned by 
irq_of_parse_and_map(). Ultimately I want to remove the #define NO_IRQ 
from arch/powerpc/include/asm/irq.h

That's to be linked to following message from Linus : 
https://lkml.org/lkml/2005/11/21/221

> 
> If it is the former, shouldn't you reverse the comment in
> arch/powerpc/include/asm/irq.h, which says the macro is to be used in the
> way this driver (and others) use it?
> 
> If it is the latter, shouldn't you address the use of NO_IRQ in the core
> NCR5380 driver rather than just this wrapper?

Yes I guess so.

> 
> Moreover, wouldn't it make more sense to fix the callers of
> irq_of_parse_and_map(), since they appear to be abusing the NO_IRQ macro?

Indeed. That's what is being done most places.

> 
> For example, drivers/ata/sata_dwc_460ex.c actually does #define NO_IRQ 0
> and then expects irq_of_parse_and_map() will somehow use the same value to
> mean the same thing...

It didn't pop up during the multi-build I did for powerpc, so I guess 
that driver is not used for powerpc ? In the ata subsystem I fixed 
pata_mpc52xx.

Thanks
Christophe

      reply	other threads:[~2022-10-06 11:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06  5:32 Christophe Leroy
2022-10-06  9:25 ` Finn Thain
2022-10-06 11:13   ` Christophe Leroy [this message]

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=009bf4b2-ab5d-b583-20bd-8eee397e251a@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=fthain@linux-m68k.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=schmitzmic@gmail.com \
    /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®