lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220615212531.gmyfxjwdmeukmnzz@mobilestation>
Date:   Thu, 16 Jun 2022 00:25:31 +0300
From:   Serge Semin <fancer.lancer@...il.com>
To:     Damien Le Moal <damien.lemoal@...nsource.wdc.com>
Cc:     Serge Semin <Sergey.Semin@...kalelectronics.ru>,
        Hans de Goede <hdegoede@...hat.com>,
        Jens Axboe <axboe@...nel.dk>, Hannes Reinecke <hare@...e.de>,
        Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
        Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
        Rob Herring <robh+dt@...nel.org>, linux-ide@...r.kernel.org,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v4 15/23] ata: ahci: Convert __ahci_port_base to
 accepting hpriv as arguments

On Tue, Jun 14, 2022 at 05:38:14PM +0900, Damien Le Moal wrote:
> On 6/10/22 17:17, Serge Semin wrote:
> > It may get required to retrieve the port-base address even before the
> 
> The port base address may be required even before the...
> 
> > ata_host instance is initialized and activated, for instance in the
> > ahci_save_initial_config() method which we about to update (consider this
> 
> s/we/we are

Got it. will be fixed in v5.

-Sergey

> 
> > modification as a preparation for that one). Seeing the __ahci_port_base()
> > function isn't used much it's the best candidate to provide the required
> > functionality. So let's convert it to accepting the ahci_host_priv
> > structure pointer.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@...kalelectronics.ru>
> > Reviewed-by: Hannes Reinecke <hare@...e.de>
> > ---
> >  drivers/ata/ahci.c | 2 +-
> >  drivers/ata/ahci.h | 7 ++++---
> >  2 files changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> > index 9bc8fa77e92f..d14d74649e0e 100644
> > --- a/drivers/ata/ahci.c
> > +++ b/drivers/ata/ahci.c
> > @@ -689,7 +689,7 @@ static void ahci_pci_init_controller(struct ata_host *host)
> >  			mv = 2;
> >  		else
> >  			mv = 4;
> > -		port_mmio = __ahci_port_base(host, mv);
> > +		port_mmio = __ahci_port_base(hpriv, mv);
> >  
> >  		writel(0, port_mmio + PORT_IRQ_MASK);
> >  
> > diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
> > index 0e66446a5883..8b9826533ae5 100644
> > --- a/drivers/ata/ahci.h
> > +++ b/drivers/ata/ahci.h
> > @@ -431,10 +431,9 @@ int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht);
> >  void ahci_error_handler(struct ata_port *ap);
> >  u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked);
> >  
> > -static inline void __iomem *__ahci_port_base(struct ata_host *host,
> > +static inline void __iomem *__ahci_port_base(struct ahci_host_priv *hpriv,
> >  					     unsigned int port_no)
> >  {
> > -	struct ahci_host_priv *hpriv = host->private_data;
> >  	void __iomem *mmio = hpriv->mmio;
> >  
> >  	return mmio + 0x100 + (port_no * 0x80);
> > @@ -442,7 +441,9 @@ static inline void __iomem *__ahci_port_base(struct ata_host *host,
> >  
> >  static inline void __iomem *ahci_port_base(struct ata_port *ap)
> >  {
> > -	return __ahci_port_base(ap->host, ap->port_no);
> > +	struct ahci_host_priv *hpriv = ap->host->private_data;
> > +
> > +	return __ahci_port_base(hpriv, ap->port_no);
> >  }
> >  
> >  static inline int ahci_nr_ports(u32 cap)
> 
> 
> -- 
> Damien Le Moal
> Western Digital Research

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ