From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Arnd Bergmann <arnd@arndb.de>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Alan Stern" <stern@rowland.harvard.edu>,
"Rafael J . Wysocki" <rafael@kernel.org>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
linux-kernel@vger.kernel.org,
Linux-Arch <linux-arch@vger.kernel.org>,
linux-pci@vger.kernel.org, "Arnd Bergmann" <arnd@kernel.org>,
linux-ide@vger.kernel.org
Subject: Re: [PATCH v3 02/38] ata: add HAS_IOPORT dependencies
Date: Fri, 28 Apr 2023 15:32:07 +0200 [thread overview]
Message-ID: <b2a60102b2e04c535bc16e9220ea00cb314090ab.camel@linux.ibm.com> (raw)
In-Reply-To: <2f07c421-7f9c-4e53-8bd5-46be07bb5c89@app.fastmail.com>
On Thu, 2023-03-16 at 16:21 +0100, Arnd Bergmann wrote:
> On Thu, Mar 16, 2023, at 00:57, Damien Le Moal wrote:
> > On 2023/03/15 20:36, Geert Uytterhoeven wrote:
>
> > Ah. OK. I see now. So indeed, applying the dependency on the entire ATA_SFF
> > group of drivers is very coarse.
>
>
> > Can you change this to apply the dependency per driver ?
>
> I think that will fail to build because of this function
> on architectures that drop their non-functional
> inb/outb helpers:
>
> int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev)
> {
> unsigned long bmdma = pci_resource_start(pdev, 4);
> u8 simplex;
>
> if (bmdma == 0)
> return -ENOENT;
>
> simplex = inb(bmdma + 0x02);
> outb(simplex & 0x60, bmdma + 0x02);
> simplex = inb(bmdma + 0x02);
> if (simplex & 0x80)
> return -EOPNOTSUPP;
> return 0;
> }
>
> This is only called from five pata drivers (ali, amd,
> cmd64x, netcell, serverworks), so an easy workaround
> would be to make sure those depend on HAS_IOPORT
> and enclose the function definition in an #ifdef.
>
> Arnd
There were a few additional inb()/outb() uses so a few more drivers had
to have the dependency added but for v4 it will no longer be on the
ATA_SFF option and I used your suggestion above for this function.
There was another call to it in ata_generic_init_one() that is only
done for PCI_VENDOR_ID_AL so I added an #ifdef CONFIG_PATA_ALI around
that.
Thanks,
Niklas
prev parent reply other threads:[~2023-04-28 13:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230314121216.413434-1-schnelle@linux.ibm.com>
2023-03-14 12:11 ` [PATCH v3 02/38] ata: add HAS_IOPORT dependencies Niklas Schnelle
2023-03-15 1:23 ` Damien Le Moal
2023-03-15 6:46 ` Arnd Bergmann
2023-03-15 7:15 ` Damien Le Moal
2023-03-15 7:15 ` Damien Le Moal
2023-03-15 8:39 ` Geert Uytterhoeven
2023-03-15 9:12 ` Damien Le Moal
2023-03-15 11:36 ` Geert Uytterhoeven
2023-03-15 23:57 ` Damien Le Moal
2023-03-16 15:21 ` Arnd Bergmann
2023-04-28 13:32 ` Niklas Schnelle [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=b2a60102b2e04c535bc16e9220ea00cb314090ab.camel@linux.ibm.com \
--to=schnelle@linux.ibm.com \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bhelgaas@google.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=rafael@kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=u.kleine-koenig@pengutronix.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