Skip to content

Commit

Permalink
Merge tag 'staging-6.13-rc7' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are some small staging driver fixes that resolve some reported
  issues and have been in my tree for too long due to the holiday break.
  They resolve the following issues:

   - lots of gpib build-time fixes as reported by testers and 0-day

   - gpib logical fixes

   - mailmap fix

  All of these have been in linux-next for a while, with no reported
  issues other than the duplicated change"

* tag 'staging-6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: gpib: mite: remove unused global functions
  staging: gpib: refer to correct config symbol in tnt4882 Makefile
  mailmap: update Bingwu Zhang's email address
  staging: gpib: fix address space mixup
  staging: gpib: use ioport_map
  staging: gpib: fix pcmcia dependencies
  staging: gpib: add module author and description fields
  staging: gpib: fix Makefiles
  staging: gpib: make global 'usec_diff' functions static
  staging: gpib: Modify mismatched function name
  staging: gpib: Add lower bound check for secondary address
  staging: gpib: Fix erroneous removal of blank before newline
  • Loading branch information
Linus Torvalds committed Jan 12, 2025
2 parents 4bd9e3b + 6f79db0 commit 91fff6f
Show file tree
Hide file tree
Showing 41 changed files with 165 additions and 295 deletions.
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ Ben Widawsky <bwidawsk@kernel.org> <benjamin.widawsky@intel.com>
Benjamin Poirier <benjamin.poirier@gmail.com> <bpoirier@suse.de>
Benjamin Tissoires <bentiss@kernel.org> <benjamin.tissoires@gmail.com>
Benjamin Tissoires <bentiss@kernel.org> <benjamin.tissoires@redhat.com>
Bingwu Zhang <xtex@aosc.io> <xtexchooser@duck.com>
Bingwu Zhang <xtex@aosc.io> <xtex@xtexx.eu.org>
Bjorn Andersson <andersson@kernel.org> <bjorn@kryo.se>
Bjorn Andersson <andersson@kernel.org> <bjorn.andersson@linaro.org>
Bjorn Andersson <andersson@kernel.org> <bjorn.andersson@sonymobile.com>
Expand Down
8 changes: 6 additions & 2 deletions drivers/staging/gpib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ config GPIB_NI_PCI_ISA
depends on ISA_BUS || PCI || PCMCIA
depends on HAS_IOPORT
depends on !X86_PAE
depends on PCMCIA || !PCMCIA
depends on HAS_IOPORT_MAP
select GPIB_COMMON
select GPIB_NEC7210
help
Expand All @@ -89,6 +91,7 @@ config GPIB_CB7210
depends on HAS_IOPORT
depends on ISA_BUS || PCI || PCMCIA
depends on !X86_PAE
depends on PCMCIA || !PCMCIA
select GPIB_COMMON
select GPIB_NEC7210
help
Expand Down Expand Up @@ -177,6 +180,7 @@ config GPIB_HP82341
config GPIB_INES
tristate "INES"
depends on PCI || ISA_BUS || PCMCIA
depends on PCMCIA || !PCMCIA
depends on HAS_IOPORT
depends on !X86_PAE
select GPIB_COMMON
Expand All @@ -199,8 +203,8 @@ config GPIB_INES
called cb7210.

config GPIB_PCMCIA
bool "PCMCIA/Cardbus support for NI MC and Ines boards"
depends on PCCARD && (GPIB_NI_PCI_ISA || GPIB_CB7210 || GPIB_INES)
def_bool y
depends on PCMCIA && (GPIB_NI_PCI_ISA || GPIB_CB7210 || GPIB_INES)
help
Enable PCMCIA/CArdbus support for National Instruments,
measurement computing boards and Ines boards.
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/gpib/agilent_82350b/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

obj-m += agilent_82350b.o
obj-$(CONFIG_GPIB_AGILENT_82350B) += agilent_82350b.o
4 changes: 2 additions & 2 deletions drivers/staging/gpib/agilent_82350b/agilent_82350b.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ static int agilent_82350b_generic_attach(gpib_board_t *board, const gpib_board_c
GPIB_82350A_REGION));
dev_dbg(board->gpib_dev, "%s: gpib base address remapped to 0x%p\n",
driver_name, a_priv->gpib_base);
tms_priv->iobase = a_priv->gpib_base + TMS9914_BASE_REG;
tms_priv->mmiobase = a_priv->gpib_base + TMS9914_BASE_REG;
a_priv->sram_base = ioremap(pci_resource_start(a_priv->pci_device,
SRAM_82350A_REGION),
pci_resource_len(a_priv->pci_device,
Expand All @@ -724,7 +724,7 @@ static int agilent_82350b_generic_attach(gpib_board_t *board, const gpib_board_c
pci_resource_len(a_priv->pci_device, GPIB_REGION));
dev_dbg(board->gpib_dev, "%s: gpib base address remapped to 0x%p\n",
driver_name, a_priv->gpib_base);
tms_priv->iobase = a_priv->gpib_base + TMS9914_BASE_REG;
tms_priv->mmiobase = a_priv->gpib_base + TMS9914_BASE_REG;
a_priv->sram_base = ioremap(pci_resource_start(a_priv->pci_device, SRAM_REGION),
pci_resource_len(a_priv->pci_device, SRAM_REGION));
dev_dbg(board->gpib_dev, "%s: sram base address remapped to 0x%p\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/gpib/agilent_82357a/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

obj-m += agilent_82357a.o
obj-$(CONFIG_GPIB_AGILENT_82357A) += agilent_82357a.o


2 changes: 1 addition & 1 deletion drivers/staging/gpib/cb7210/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ccflags-$(CONFIG_GPIB_PCMCIA) := -DGPIB_PCMCIA
obj-m += cb7210.o
obj-$(CONFIG_GPIB_CB7210) += cb7210.o


12 changes: 6 additions & 6 deletions drivers/staging/gpib/cb7210/cb7210.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,12 +971,12 @@ int cb_pci_attach(gpib_board_t *board, const gpib_board_config_t *config)
switch (cb_priv->pci_chip) {
case PCI_CHIP_AMCC_S5933:
cb_priv->amcc_iobase = pci_resource_start(cb_priv->pci_device, 0);
nec_priv->iobase = (void *)(pci_resource_start(cb_priv->pci_device, 1));
nec_priv->iobase = pci_resource_start(cb_priv->pci_device, 1);
cb_priv->fifo_iobase = pci_resource_start(cb_priv->pci_device, 2);
break;
case PCI_CHIP_QUANCOM:
nec_priv->iobase = (void *)(pci_resource_start(cb_priv->pci_device, 0));
cb_priv->fifo_iobase = (unsigned long)nec_priv->iobase;
nec_priv->iobase = pci_resource_start(cb_priv->pci_device, 0);
cb_priv->fifo_iobase = nec_priv->iobase;
break;
default:
pr_err("cb7210: bug! unhandled pci_chip=%i\n", cb_priv->pci_chip);
Expand Down Expand Up @@ -1040,8 +1040,8 @@ int cb_isa_attach(gpib_board_t *board, const gpib_board_config_t *config)
return retval;
cb_priv = board->private_data;
nec_priv = &cb_priv->nec7210_priv;
if (request_region((unsigned long)config->ibbase, cb7210_iosize, "cb7210") == 0) {
pr_err("gpib: ioports starting at 0x%p are already in use\n", config->ibbase);
if (request_region(config->ibbase, cb7210_iosize, "cb7210") == 0) {
pr_err("gpib: ioports starting at 0x%u are already in use\n", config->ibbase);
return -EIO;
}
nec_priv->iobase = config->ibbase;
Expand Down Expand Up @@ -1471,7 +1471,7 @@ int cb_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t *config)
(unsigned long)curr_dev->resource[0]->start);
return -EIO;
}
nec_priv->iobase = (void *)(unsigned long)curr_dev->resource[0]->start;
nec_priv->iobase = curr_dev->resource[0]->start;
cb_priv->fifo_iobase = curr_dev->resource[0]->start;

if (request_irq(curr_dev->irq, cb7210_interrupt, IRQF_SHARED,
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/gpib/cb7210/cb7210.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ enum hs_regs {
HS_STATUS = 0x8, /* HS_STATUS register */
};

static inline unsigned long nec7210_iobase(const struct cb7210_priv *cb_priv)
static inline u32 nec7210_iobase(const struct cb7210_priv *cb_priv)
{
return (unsigned long)(cb_priv->nec7210_priv.iobase);
return cb_priv->nec7210_priv.iobase;
}

static inline int cb7210_page_in_bits(unsigned int page)
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/gpib/cec/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

obj-m += cec_gpib.o
obj-$(CONFIG_GPIB_CEC_PCI) += cec_gpib.o

4 changes: 2 additions & 2 deletions drivers/staging/gpib/cec/cec_gpib.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ int cec_pci_attach(gpib_board_t *board, const gpib_board_config_t *config)

cec_priv->plx_iobase = pci_resource_start(cec_priv->pci_device, 1);
pr_info(" plx9050 base address 0x%lx\n", cec_priv->plx_iobase);
nec_priv->iobase = (void *)(pci_resource_start(cec_priv->pci_device, 3));
pr_info(" nec7210 base address 0x%p\n", nec_priv->iobase);
nec_priv->iobase = pci_resource_start(cec_priv->pci_device, 3);
pr_info(" nec7210 base address 0x%x\n", nec_priv->iobase);

isr_flags |= IRQF_SHARED;
if (request_irq(cec_priv->pci_device->irq, cec_interrupt, isr_flags, "pci-gpib", board)) {
Expand Down
54 changes: 2 additions & 52 deletions drivers/staging/gpib/common/gpib_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,56 +116,6 @@ int io_timed_out(gpib_board_t *board)
return 0;
}

void writeb_wrapper(unsigned int value, void *address)
{
writeb(value, address);
};
EXPORT_SYMBOL(writeb_wrapper);

void writew_wrapper(unsigned int value, void *address)
{
writew(value, address);
};
EXPORT_SYMBOL(writew_wrapper);

unsigned int readb_wrapper(void *address)
{
return readb(address);
};
EXPORT_SYMBOL(readb_wrapper);

unsigned int readw_wrapper(void *address)
{
return readw(address);
};
EXPORT_SYMBOL(readw_wrapper);

#ifdef CONFIG_HAS_IOPORT
void outb_wrapper(unsigned int value, void *address)
{
outb(value, (unsigned long)(address));
};
EXPORT_SYMBOL(outb_wrapper);

void outw_wrapper(unsigned int value, void *address)
{
outw(value, (unsigned long)(address));
};
EXPORT_SYMBOL(outw_wrapper);

unsigned int inb_wrapper(void *address)
{
return inb((unsigned long)(address));
};
EXPORT_SYMBOL(inb_wrapper);

unsigned int inw_wrapper(void *address)
{
return inw((unsigned long)(address));
};
EXPORT_SYMBOL(inw_wrapper);
#endif

/* this is a function instead of a constant because of Suse
* defining HZ to be a function call to get_hz()
*/
Expand Down Expand Up @@ -536,7 +486,7 @@ int dvrsp(gpib_board_t *board, unsigned int pad, int sad,
return -1;
}

if (pad > MAX_GPIB_PRIMARY_ADDRESS || sad > MAX_GPIB_SECONDARY_ADDRESS) {
if (pad > MAX_GPIB_PRIMARY_ADDRESS || sad > MAX_GPIB_SECONDARY_ADDRESS || sad < -1) {
pr_err("gpib: bad address for serial poll");
return -1;
}
Expand Down Expand Up @@ -1623,7 +1573,7 @@ static int iobase_ioctl(gpib_board_config_t *config, unsigned long arg)

if (WARN_ON_ONCE(sizeof(void *) > sizeof(base_addr)))
return -EFAULT;
config->ibbase = (void *)(unsigned long)(base_addr);
config->ibbase = base_addr;

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/gpib/eastwood/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

obj-m += fluke_gpib.o
obj-$(CONFIG_GPIB_FLUKE) += fluke_gpib.o

12 changes: 6 additions & 6 deletions drivers/staging/gpib/eastwood/fluke_gpib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,12 +1011,12 @@ static int fluke_attach_impl(gpib_board_t *board, const gpib_board_config_t *con
}
e_priv->gpib_iomem_res = res;

nec_priv->iobase = ioremap(e_priv->gpib_iomem_res->start,
nec_priv->mmiobase = ioremap(e_priv->gpib_iomem_res->start,
resource_size(e_priv->gpib_iomem_res));
pr_info("gpib: iobase %lx remapped to %p, length=%d\n",
(unsigned long)e_priv->gpib_iomem_res->start,
nec_priv->iobase, (int)resource_size(e_priv->gpib_iomem_res));
if (!nec_priv->iobase) {
pr_info("gpib: mmiobase %llx remapped to %p, length=%d\n",
(u64)e_priv->gpib_iomem_res->start,
nec_priv->mmiobase, (int)resource_size(e_priv->gpib_iomem_res));
if (!nec_priv->mmiobase) {
dev_err(&fluke_gpib_pdev->dev, "Could not map I/O memory\n");
return -ENOMEM;
}
Expand Down Expand Up @@ -1107,7 +1107,7 @@ void fluke_detach(gpib_board_t *board)
gpib_free_pseudo_irq(board);
nec_priv = &e_priv->nec7210_priv;

if (nec_priv->iobase) {
if (nec_priv->mmiobase) {
fluke_paged_write_byte(e_priv, 0, ISR0_IMR0, ISR0_IMR0_PAGE);
nec7210_board_reset(nec_priv, board);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/gpib/eastwood/fluke_gpib.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ static inline uint8_t fluke_read_byte_nolock(struct nec7210_priv *nec_priv,
{
u8 retval;

retval = readl(nec_priv->iobase + register_num * nec_priv->offset);
retval = readl(nec_priv->mmiobase + register_num * nec_priv->offset);
return retval;
}

// don't use without locking nec_priv->register_page_lock
static inline void fluke_write_byte_nolock(struct nec7210_priv *nec_priv, uint8_t data,
int register_num)
{
writel(data, nec_priv->iobase + register_num * nec_priv->offset);
writel(data, nec_priv->mmiobase + register_num * nec_priv->offset);
}

static inline uint8_t fluke_paged_read_byte(struct fluke_priv *e_priv,
Expand Down
27 changes: 14 additions & 13 deletions drivers/staging/gpib/fmh_gpib/fmh_gpib.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <linux/slab.h>

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("GPIB Driver for fmh_gpib_core");
MODULE_AUTHOR("Frank Mori Hess <fmh6jj@gmail.com>");

static irqreturn_t fmh_gpib_interrupt(int irq, void *arg);
static int fmh_gpib_attach_holdoff_all(gpib_board_t *board, const gpib_board_config_t *config);
Expand Down Expand Up @@ -1419,15 +1421,14 @@ static int fmh_gpib_attach_impl(gpib_board_t *board, const gpib_board_config_t *
}
e_priv->gpib_iomem_res = res;

nec_priv->iobase = ioremap(e_priv->gpib_iomem_res->start,
nec_priv->mmiobase = ioremap(e_priv->gpib_iomem_res->start,
resource_size(e_priv->gpib_iomem_res));
if (!nec_priv->iobase) {
if (!nec_priv->mmiobase) {
dev_err(board->dev, "Could not map I/O memory for gpib\n");
return -ENOMEM;
}
dev_info(board->dev, "iobase 0x%lx remapped to %p, length=%ld\n",
(unsigned long)e_priv->gpib_iomem_res->start,
nec_priv->iobase, (unsigned long)resource_size(e_priv->gpib_iomem_res));
dev_info(board->dev, "iobase %pr remapped to %p\n",
e_priv->gpib_iomem_res, nec_priv->mmiobase);

res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma_fifos");
if (!res) {
Expand Down Expand Up @@ -1507,14 +1508,14 @@ void fmh_gpib_detach(gpib_board_t *board)
free_irq(e_priv->irq, board);
if (e_priv->fifo_base)
fifos_write(e_priv, 0, FIFO_CONTROL_STATUS_REG);
if (nec_priv->iobase) {
if (nec_priv->mmiobase) {
write_byte(nec_priv, 0, ISR0_IMR0_REG);
nec7210_board_reset(nec_priv, board);
}
if (e_priv->fifo_base)
iounmap(e_priv->fifo_base);
if (nec_priv->iobase)
iounmap(nec_priv->iobase);
if (nec_priv->mmiobase)
iounmap(nec_priv->mmiobase);
if (e_priv->dma_port_res) {
release_mem_region(e_priv->dma_port_res->start,
resource_size(e_priv->dma_port_res));
Expand Down Expand Up @@ -1564,12 +1565,12 @@ static int fmh_gpib_pci_attach_impl(gpib_board_t *board, const gpib_board_config
e_priv->gpib_iomem_res = &pci_device->resource[gpib_control_status_pci_resource_index];
e_priv->dma_port_res = &pci_device->resource[gpib_fifo_pci_resource_index];

nec_priv->iobase = ioremap(pci_resource_start(pci_device,
nec_priv->mmiobase = ioremap(pci_resource_start(pci_device,
gpib_control_status_pci_resource_index),
pci_resource_len(pci_device,
gpib_control_status_pci_resource_index));
dev_info(board->dev, "base address for gpib control/status registers remapped to 0x%p\n",
nec_priv->iobase);
nec_priv->mmiobase);

if (e_priv->dma_port_res->flags & IORESOURCE_MEM) {
e_priv->fifo_base = ioremap(pci_resource_start(pci_device,
Expand Down Expand Up @@ -1632,14 +1633,14 @@ void fmh_gpib_pci_detach(gpib_board_t *board)
free_irq(e_priv->irq, board);
if (e_priv->fifo_base)
fifos_write(e_priv, 0, FIFO_CONTROL_STATUS_REG);
if (nec_priv->iobase) {
if (nec_priv->mmiobase) {
write_byte(nec_priv, 0, ISR0_IMR0_REG);
nec7210_board_reset(nec_priv, board);
}
if (e_priv->fifo_base)
iounmap(e_priv->fifo_base);
if (nec_priv->iobase)
iounmap(nec_priv->iobase);
if (nec_priv->mmiobase)
iounmap(nec_priv->mmiobase);
if (e_priv->dma_port_res || e_priv->gpib_iomem_res)
pci_release_regions(to_pci_dev(board->dev));
if (board->dev)
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/gpib/fmh_gpib/fmh_gpib.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ static const unsigned int fifo_max_burst_length_mask = 0x00ff;
static inline uint8_t gpib_cs_read_byte(struct nec7210_priv *nec_priv,
unsigned int register_num)
{
return readb(nec_priv->iobase + register_num * nec_priv->offset);
return readb(nec_priv->mmiobase + register_num * nec_priv->offset);
}

static inline void gpib_cs_write_byte(struct nec7210_priv *nec_priv, uint8_t data,
unsigned int register_num)
{
writeb(data, nec_priv->iobase + register_num * nec_priv->offset);
writeb(data, nec_priv->mmiobase + register_num * nec_priv->offset);
}

static inline uint16_t fifos_read(struct fmh_priv *fmh_priv, int register_num)
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/gpib/gpio/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

obj-m += gpib_bitbang.o
obj-$(CONFIG_GPIB_GPIO) += gpib_bitbang.o


2 changes: 1 addition & 1 deletion drivers/staging/gpib/gpio/gpib_bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ struct bb_priv {
enum listener_function_state listener_state;
};

inline long usec_diff(struct timespec64 *a, struct timespec64 *b);
static inline long usec_diff(struct timespec64 *a, struct timespec64 *b);
static void bb_buffer_print(unsigned char *buffer, size_t length, int cmd, int eoi);
static void set_data_lines(u8 byte);
static u8 get_data_lines(void);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/gpib/hp_82335/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

obj-m += hp82335.o
obj-$(CONFIG_GPIB_HP82335) += hp82335.o


Loading

0 comments on commit 91fff6f

Please sign in to comment.