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]
Date:   Fri, 20 Apr 2018 15:50:06 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     John Garry <john.garry@...wei.com>, rjw@...ysocki.net,
        linux-acpi@...r.kernel.org, lenb@...nel.org,
        mika.westerberg@...ux.intel.com, lorenzo.pieralisi@....com
Cc:     linux-kernel@...r.kernel.org, arnd@...db.de,
        graeme.gregory@...aro.org, helgaas@...nel.org, linuxarm@...wei.com,
        z.liuxinliang@...ilicon.com
Subject: Re: [RFC PATCH 2/2] HISI LPC: Add PNP device support

On Fri, 2018-04-20 at 18:07 +0800, John Garry wrote:
> Currently the driver creates an per-ACPI device mfd_cell
> for child devices. This does not suit devices which are
> PNP-compatible, as we expect PNP-compatible devices to
> derive PNP devices.
> 
> To add PNP device support, we continue to allow the PNP
> scan code to create the PNP device (which have the
> enumeration_by_parent flag set), but expect the PNP
> scan to defer adding the device to allow the host probe
> code to do this. In addition, no longer do we create an
> mfd_cell (platform_device) for PNP-compatible devices.
> 
> We take this approach so that host probe code can
> translate the IO resources of the PNP device prior
> to adding the device.

> +	list_for_each_entry(child, &adev->children, node) {
> +		if (acpi_is_pnp_device(child))
> +			continue;

This is good candidate for a separate helper macro

#define for_each_acpi_non_pnp_device(child, adev) \
...

(see, for example, for_each_pci_bridge() implementation as an example)

 
> +	list_for_each_entry(child, &adev->children, node) {

> +		if (!acpi_is_pnp_device(child))
> +			continue;

Ditto.

> +		/*
> +		 * Prior to adding the device, we need to translate
> the
> +		 * resources to logical PIO addresses.
> +		 */
> +		list_for_each_entry(pnp_res, &pnp_dev->resources,
> list) {
> +			struct resource *res = &pnp_res->res;
> +

> +			if (res->flags | IORESOURCE_IO)

What does this mean?

> +				hisi_lpc_acpi_xlat_io_res(child,
> adev, res);
> +		}

-- 
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ