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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181005.145043.1753276054031656255.davem@davemloft.net>
Date:   Fri, 05 Oct 2018 14:50:43 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     sunil.kovvuri@...il.com
Cc:     netdev@...r.kernel.org, arnd@...db.de, linux-soc@...r.kernel.org,
        sgoutham@...vell.com, amakarov@...vell.com, lbartosik@...vell.com
Subject: Re: [PATCH v6 04/15] octeontx2-af: Add mailbox support infra

From: sunil.kovvuri@...il.com
Date: Thu,  4 Oct 2018 23:51:47 +0530

> +int otx2_mbox_init(struct otx2_mbox *mbox, void *hwbase, struct pci_dev *pdev,
> +		   void *reg_base, int direction, int ndevs)
> +{
> +	int devid;
> +	struct otx2_mbox_dev *mdev;

Please order local variable declarations from longest to shortest line.

Please audit your entire series for this problem.

> +int otx2_mbox_busy_poll_for_rsp(struct otx2_mbox *mbox, int devid)
> +{
> +	struct otx2_mbox_dev *mdev = &mbox->dev[devid];
> +	unsigned long timeout = jiffies + 1 * HZ;
> +
> +	while (!time_after(jiffies, timeout)) {
> +		if (mdev->num_msgs == mdev->msgs_acked)
> +			return 0;
> +		cpu_relax();
> +	}
> +	return -EIO;
> +}

Probably not a good idea to poll something in the kernel for an entire
second.  Please add a preemption point like a usleep() or similar.
cpu_relax() does not yield the cpu to the scheduler.

Thank you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ