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] [day] [month] [year] [list]
Message-ID: <1427164368.4770.310.camel@kernel.crashing.org>
Date:	Tue, 24 Mar 2015 13:32:48 +1100
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	David Gibson <david@...son.dropbear.id.au>
Cc:	mpe@...erman.id.au, paulus@...ba.org, agraf@...e.de, aik@...abs.ru,
	mdroth@...ibm.com, linuxppc-dev@...ts.ozlabs.org,
	linux-kernel@...r.kernel.org,
	Mauro Carvalho Chehab <mchehab@....samsung.com>,
	Peter Hettkamp <peter.hettkamp@...-tel.de>
Subject: Re: [PATCH 2/5] powerpc: Remove powerpc specific byteswap from
 bt8xx DVB driver

On Tue, 2015-02-03 at 16:36 +1100, David Gibson wrote:
> The bt8xx PCI DVB driver includes a powerpc specific hack, using one of
> the powerpc specific byteswapping functions in an IO helper macro.
> 
> There's no reason to use the powerpc specific function instead of a
> generic byteswap, so this patch removes it.  I'm not sure if the powerpc
> specific memory barrier is required, so I'm leaving that in.
> 
> Cc: Mauro Carvalho Chehab <mchehab@....samsung.com>
> Cc: Peter Hettkamp <peter.hettkamp@...-tel.de>

In fact there's no reason for the powerpc specific bits in this driver
(they might have been useful 15 years ago but they definitely aren't
anymore), I'll replace this with the patch with:

(Mauro, unless you holler ASAP, I'll just put this in my tree along
with David series due to various cross-dependencies, ie, he removes
those old crufty powerpc-specific leXX_to/from_cpu we had).


media/bt8xx: Remove old powerpc cruft

The powerpc arch code enables PCI_COMMAND_MEMORY (and has done so for
more than 10 years at least !) on pci_enable_device() and the hackery
on the MMIO accessor is useless as well, our writel does everything
this driver should need.

Signed-off-by: Benjamin Herrenschmidt <benh@...nel.crashing.org>
---
 drivers/media/pci/bt8xx/bt878.c | 12 ------------
 drivers/media/pci/bt8xx/bt878.h | 11 -----------
 2 files changed, 23 deletions(-)

diff --git a/drivers/media/pci/bt8xx/bt878.c b/drivers/media/pci/bt8xx/bt878.c
index 0939d39..8aa7266 100644
--- a/drivers/media/pci/bt8xx/bt878.c
+++ b/drivers/media/pci/bt8xx/bt878.c
@@ -416,9 +416,6 @@ static int bt878_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
 	int result = 0;
 	unsigned char lat;
 	struct bt878 *bt;
-#if defined(__powerpc__)
-	unsigned int cmd;
-#endif
 	unsigned int cardid;
 
 	printk(KERN_INFO "bt878: Bt878 AUDIO function found (%d).\n",
@@ -461,15 +458,6 @@ static int bt878_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
 	printk("irq: %d, latency: %d, memory: 0x%lx\n",
 	       bt->irq, lat, bt->bt878_adr);
 
-
-#if defined(__powerpc__)
-	/* on OpenFirmware machines (PowerMac at least), PCI memory cycle */
-	/* response on cards with no firmware is not enabled by OF */
-	pci_read_config_dword(dev, PCI_COMMAND, &cmd);
-	cmd = (cmd | PCI_COMMAND_MEMORY);
-	pci_write_config_dword(dev, PCI_COMMAND, cmd);
-#endif
-
 #ifdef __sparc__
 	bt->bt878_mem = (unsigned char *) bt->bt878_adr;
 #else
diff --git a/drivers/media/pci/bt8xx/bt878.h b/drivers/media/pci/bt8xx/bt878.h
index d19b592..49af240 100644
--- a/drivers/media/pci/bt8xx/bt878.h
+++ b/drivers/media/pci/bt8xx/bt878.h
@@ -142,18 +142,7 @@ void bt878_start(struct bt878 *bt, u32 controlreg, u32 op_sync_orin,
 		u32 irq_err_ignore);
 void bt878_stop(struct bt878 *bt);
 
-#if defined(__powerpc__)	/* big-endian */
-static inline void io_st_le32(volatile unsigned __iomem *addr, unsigned val)
-{
-	st_le32(addr, val);
-	eieio();
-}
-
-#define bmtwrite(dat,adr)  io_st_le32((adr),(dat))
-#define bmtread(adr)       ld_le32((adr))
-#else
 #define bmtwrite(dat,adr)  writel((dat), (adr))
 #define bmtread(adr)       readl(adr)
-#endif
 
 #endif


--
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