linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	aik@ozlabs.ru, Peter Hettkamp <peter.hettkamp@htp-tel.de>,
	agraf@suse.de, linux-kernel@vger.kernel.org, paulus@samba.org,
	mdroth@us.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/5] powerpc: Remove powerpc specific byteswap from bt8xx DVB driver
Date: Tue, 24 Mar 2015 13:32:48 +1100	[thread overview]
Message-ID: <1427164368.4770.310.camel@kernel.crashing.org> (raw)
In-Reply-To: <1422941785-22557-3-git-send-email-david@gibson.dropbear.id.au>

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@osg.samsung.com>
> Cc: Peter Hettkamp <peter.hettkamp@htp-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@kernel.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

  reply	other threads:[~2015-03-24  2:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03  5:36 [PATCH 0/5] powerpc: Get rid of redundant arch specific swab functions David Gibson
2015-02-03  5:36 ` [PATCH 1/5] powerpc: Move Power Macintosh drivers to generic byteswappers David Gibson
2015-02-03  5:36 ` [PATCH 2/5] powerpc: Remove powerpc specific byteswap from bt8xx DVB driver David Gibson
2015-03-24  2:32   ` Benjamin Herrenschmidt [this message]
2015-02-03  5:36 ` [PATCH 3/5] powerpc: Remove arch specific byteswappers from the MXC MMC driver David Gibson
2015-02-03  5:36 ` [PATCH 4/5] powerpc: Cleanup KVM emulated load/store endian handling David Gibson
2015-02-04 14:30   ` Alexander Graf
2015-02-03  5:36 ` [PATCH 5/5] powerpc: Remove unused st_le*() and ld_le* functions David Gibson
2015-02-04 11:54 ` [PATCH 0/5] powerpc: Get rid of redundant arch specific swab functions David Laight
2015-02-04 13:41   ` 'David Gibson'

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427164368.4770.310.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mchehab@osg.samsung.com \
    --cc=mdroth@us.ibm.com \
    --cc=paulus@samba.org \
    --cc=peter.hettkamp@htp-tel.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).