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, 19 Mar 2010 16:37:36 +0100
From:	Samuel Ortiz <sameo@...ux.intel.com>
To:	Florian Fainelli <florian@...nwrt.org>
Cc:	linux-kernel@...r.kernel.org, Wim Van Sebroeck <wim@...ana.be>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH 2/4 v2] MFD: add support for the RDC321x southbridge

Hi Florian,

My comments below:

On Thu, Mar 11, 2010 at 09:42:09AM +0100, Florian Fainelli wrote:
> +
> +static struct pci_dev *rdc321x_sb_pdev;
That's not very nice. I would have prefered to pass the pci_dev pointer along
with the platform data to the gpio and watchdog drivers. And then those could
call pci_read_config_dword() directly.


> +/*
> + * Unlocked PCI configuration space accessors
> + */
> +int rdc321x_pci_read(int reg, u32 *val)
> +{
> +	int err;
> +
> +	err = pci_read_config_dword(rdc321x_sb_pdev, reg, val);
> +	if (err)
> +		return err;
> +
> +	return err;
If you want to keep your static pci_dev pointer around, please replace this
routine with:

int rdc321x_pci_read(int reg, u32 *val)
{
	return pci_read_config_dword(rdc321x_sb_pdev, reg, val);
}


> +EXPORT_SYMBOL(rdc321x_pci_read);
> +
> +int rdc321x_pci_write(int reg, u32 val)
> +{
> +	int err;
> +
> +	err = pci_write_config_dword(rdc321x_sb_pdev, reg, val);
> +	if (err)
> +		return err;
> +
> +	return err;
> +}
Ditto.

> +static int __devinit rdc321x_sb_probe(struct pci_dev *pdev,
> +					const struct pci_device_id *ent)
> +{
> +	int err;
> +
> +	err = pci_enable_device(pdev);
> +	if (err) {
> +		printk(KERN_ERR "failed to enable device\n");
Please use dev_err()

> --- /dev/null
> +++ b/include/linux/mfd/rdc321x.h
> @@ -0,0 +1,24 @@
> +#ifndef __RDC321X_MFD_H
> +#define __RDC321X_MFD_H
> +
> +#include <linux/types.h>
> +
> +/* Offsets to be accessed in the southbridge PCI
> + * device configuration register */
> +#define RDC321X_WDT_CTRL	0x44
> +#define RDC321X_GPIO_CTRL_REG1	0x48
> +#define RDC321X_GPIO_DATA_REG1	0x4c
> +#define RDC321X_GPIO_CTRL_REG2	0x84
> +#define RDC321X_GPIO_DATA_REG2	0x88
> +
> +#define RDC321X_MAX_GPIO	58
As Wim pointed out, moving those definitions from rdc321x_defs.h to here
should be done in one patch, to avoid bisection breakage.
So, please merge the first patch of your serie with this one, and add a
watchdog driver fix that includes inux/mfd/rdc321x.h instead of
rdc321x_defs.h.

Cheers,
Samuel.


> +/* Definitions for the shared southbridge accessors */
> +int rdc321x_pci_write(int reg, u32 val);
> +int rdc321x_pci_read(int reg, u32 *val);
> +
> +struct rdc321x_gpio_pdata {
> +	unsigned max_gpios;
> +};
> +
> +#endif /* __RDC321X_MFD_H */

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ