Re: [PATCH v2 4/4] Staging: rts5208: Fix a format specifier for dev_err
Hi Micky, in the latest linux-tree sources, lun field in struct scsi_device from include/scsi/scsi_device.h is a u64: unsigned int id, channel; u64 lun; unsigned int manufacturer; so we get a compiler warning if we keep the %u specifier. Regards, Fabio On Tue, Jul 8, 2014 at 4:13 AM, micky micky_ch...@realsil.com.cn wrote: On 07/07/2014 03:10 PM, Fabio Falzoi wrote: Fix an incorrect use of the %d format specifier in dev_err that caused a warning. Signed-off-by: Fabio Falzoi fabio.falzo...@gmail.com --- drivers/staging/rts5208/rtsx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index 4f5f7a3..9aae7ac 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -463,14 +463,14 @@ static int rtsx_control_thread(void *__dev) * the maximum known LUN */ else if (chip-srb-device-id) { - dev_err(dev-pci-dev, Bad target number (%d:%d)\n, + dev_err(dev-pci-dev, Bad target number (%d:%llu)\n, here exist some compile warning. drivers/staging/rts5208/rtsx.c:468:5: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat] chip-srb-device-id, chip-srb-device-lun); chip-srb-result = DID_BAD_TARGET 16; } else if (chip-srb-device-lun chip-max_lun) { - dev_err(dev-pci-dev, Bad LUN (%d:%d)\n, + dev_err(dev-pci-dev, Bad LUN (%d:%llu)\n, chip-srb-device-id, chip-srb-device-lun); chip-srb-result = DID_BAD_TARGET 16; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/4] Staging: rts5208: Replace custom macro with print_hex_dump_bytes
Hi, here exist some checkpatch errors. Best Regards. micky. Yes, you'are right, I'm gonna fix it, thanks. On Tue, Jul 8, 2014 at 4:12 AM, micky micky_ch...@realsil.com.cn wrote: On 07/07/2014 03:10 PM, Fabio Falzoi wrote: Use print_hex_dump_bytes to have memory properly dumped only when DEBUG is defined. Signed-off-by: Fabio Falzoi fabio.falzo...@gmail.com --- drivers/staging/rts5208/ms.c| 4 ++-- drivers/staging/rts5208/rtsx_chip.c | 4 ++-- drivers/staging/rts5208/rtsx_scsi.c | 9 - drivers/staging/rts5208/sd.c| 6 +++--- drivers/staging/rts5208/trace.h | 10 +- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index 2476d22..0a33043 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -307,7 +307,7 @@ static int ms_read_bytes(struct rtsx_chip *chip, if ((tpc == PRO_READ_SHORT_DATA) (data_len == 8)) { pr_debug(Read format progress:\n); - RTSX_DUMP(ptr, cnt); + rtsx_hex_dump(ptr, cnt); } return STATUS_SUCCESS; @@ -1910,7 +1910,7 @@ RE_SEARCH: ptr = rtsx_get_cmd_data(chip); pr_debug(Boot block data:\n); - RTSX_DUMP(ptr, 16); + rtsx_hex_dump(ptr, 16); /* Block ID error * HEADER_ID0, HEADER_ID1 diff --git a/drivers/staging/rts5208/rtsx_chip.c b/drivers/staging/rts5208/rtsx_chip.c index 8f447ef..761e83c 100644 --- a/drivers/staging/rts5208/rtsx_chip.c +++ b/drivers/staging/rts5208/rtsx_chip.c @@ -1299,8 +1299,8 @@ int rtsx_write_cfg_seq(struct rtsx_chip *chip, u8 func, u16 addr, u8 *buf, } } - RTSX_DUMP(mask, dw_len * 4); - RTSX_DUMP(data, dw_len * 4); + rtsx_hex_dump(mask, dw_len * 4); + rtsx_hex_dump(data, dw_len * 4); for (i = 0; i dw_len; i++) { retval = rtsx_write_cfg_dw(chip, func, aligned_addr + i * 4, diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c index fd3c2e7..8269a02 100644 --- a/drivers/staging/rts5208/rtsx_scsi.c +++ b/drivers/staging/rts5208/rtsx_scsi.c @@ -40,7 +40,8 @@ void scsi_show_command(struct scsi_cmnd *srb) { char *what = NULL; - int i, unknown_cmd = 0; + int unknown_cmd = 0; + size_t len; switch (srb-cmnd[0]) { case TEST_UNIT_READY: @@ -319,10 +320,8 @@ void scsi_show_command(struct scsi_cmnd *srb) pr_debug(Command %s (%d bytes)\n, what, srb-cmd_len); if (unknown_cmd) { - pr_debug(); - for (i = 0; i srb-cmd_len i 16; i++) - pr_debug( %02x, srb-cmnd[i]); - pr_debug(\n); + len = min_t(size_t, srb-cmd_len, 16); + rtsx_hex_dump(srb-cmnd, len); } } diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index 96acd39..2f50f9c 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -426,7 +426,7 @@ static int sd_check_csd(struct rtsx_chip *chip, char check_wp) memcpy(sd_card-raw_csd, rsp + 1, 15); pr_debug(CSD Response:\n); - RTSX_DUMP(sd_card-raw_csd, 16); + rtsx_hex_dump(sd_card-raw_csd, 16); csd_ver = (rsp[1] 0xc0) 6; pr_debug(csd_ver = %d\n, csd_ver); @@ -1059,7 +1059,7 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, TRACE_RET(chip, STATUS_FAIL); } - RTSX_DUMP(buf, 64); + rtsx_hex_dump(buf, 64); if (func_group == NO_ARGUMENT) { sd_card-func_group1_mask = buf[0x0D]; @@ -2107,7 +2107,7 @@ static int sd_check_wp_state(struct rtsx_chip *chip) } pr_debug(ACMD13:\n); - RTSX_DUMP(buf, 64); + rtsx_hex_dump(buf, 64); sd_card_type = ((u16)buf[2] 8) | buf[3]; pr_debug(sd_card_type = 0x%04x\n, sd_card_type); diff --git a/drivers/staging/rts5208/trace.h b/drivers/staging/rts5208/trace.h index 7fcb459..8386a20 100644 --- a/drivers/staging/rts5208/trace.h +++ b/drivers/staging/rts5208/trace.h @@ -82,12 +82,12 @@ static inline char *filename(char *path) #define TRACE_GOTO(chip, label) goto label #endif -#ifdef CONFIG_RTS5208_DEBUG -#define RTSX_DUMP(buf, buf_len)\ - print_hex_dump(KERN_DEBUG, KBUILD_MODNAME : , \ - DUMP_PREFIX_NONE, 16, 1, (buf), (buf_len), false) +#ifdef DEBUG +#define rtsx_hex_dump(buf, len)\ + print_hex_dump_bytes(KBUILD_MODNAME : , DUMP_PREFIX_NONE, buf, len) #else -#define RTSX_DUMP(buf, buf_len) +#define rtsx_hex_dump(buf, len)\ + do {;}while(0) Hi, here exist some checkpatch errors. Best Regards. micky. #endif #endif /* __REALTEK_RTSX_TRACE_H */
[PATCH] staging: wlan-ng: Use net_device_stats from struct net_device
Instead of using an own copy of struct net_device_stats in struct wlandevice, use stats from struct net_device. Also remove the thus unnecessary .ndo_get_stats function, as it would now just return netdev-stats, which is the default in dev_get_stats(). Furthermore, convert prefix increment of stats counters to the more common postfix increment idiom. Signed-off-by: Tobias Klauser tklau...@distanz.ch --- drivers/staging/wlan-ng/hfa384x_usb.c | 18 +++ drivers/staging/wlan-ng/p80211netdev.c | 40 ++ drivers/staging/wlan-ng/p80211netdev.h | 1 - drivers/staging/wlan-ng/prism2sta.c| 2 +- 4 files changed, 17 insertions(+), 44 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 07cee56..2f63e0c 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3158,8 +3158,8 @@ static void hfa384x_usbin_callback(struct urb *urb) /* Check for short packet */ if (urb-actual_length == 0) { - ++(wlandev-linux_stats.rx_errors); - ++(wlandev-linux_stats.rx_length_errors); + wlandev-netdev-stats.rx_errors++; + wlandev-netdev-stats.rx_length_errors++; action = RESUBMIT; } break; @@ -3169,7 +3169,7 @@ static void hfa384x_usbin_callback(struct urb *urb) wlandev-netdev-name); if (!test_and_set_bit(WORK_RX_HALT, hw-usb_flags)) schedule_work(hw-usb_work); - ++(wlandev-linux_stats.rx_errors); + wlandev-netdev-stats.rx_errors++; action = ABORT; break; @@ -3180,12 +3180,12 @@ static void hfa384x_usbin_callback(struct urb *urb) !timer_pending(hw-throttle)) { mod_timer(hw-throttle, jiffies + THROTTLE_JIFFIES); } - ++(wlandev-linux_stats.rx_errors); + wlandev-netdev-stats.rx_errors++; action = ABORT; break; case -EOVERFLOW: - ++(wlandev-linux_stats.rx_over_errors); + wlandev-netdev-stats.rx_over_errors++; action = RESUBMIT; break; @@ -3204,7 +3204,7 @@ static void hfa384x_usbin_callback(struct urb *urb) default: pr_debug(urb status=%d, transfer flags=0x%x\n, urb-status, urb-transfer_flags); - ++(wlandev-linux_stats.rx_errors); + wlandev-netdev-stats.rx_errors++; action = RESUBMIT; break; } @@ -3712,7 +3712,7 @@ static void hfa384x_usbout_callback(struct urb *urb) if (!test_and_set_bit (WORK_TX_HALT, hw-usb_flags)) schedule_work(hw-usb_work); - ++(wlandev-linux_stats.tx_errors); + wlandev-netdev-stats.tx_errors++; break; } @@ -3728,7 +3728,7 @@ static void hfa384x_usbout_callback(struct urb *urb) mod_timer(hw-throttle, jiffies + THROTTLE_JIFFIES); } - ++(wlandev-linux_stats.tx_errors); + wlandev-netdev-stats.tx_errors++; netif_stop_queue(wlandev-netdev); break; } @@ -3741,7 +3741,7 @@ static void hfa384x_usbout_callback(struct urb *urb) default: netdev_info(wlandev-netdev, unknown urb-status=%d\n, urb-status); - ++(wlandev-linux_stats.tx_errors); + wlandev-netdev-stats.tx_errors++; break; } /* switch */ } diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 00b186c..29afa57 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -92,7 +92,6 @@ /* netdevice method functions */ static int p80211knetdev_init(netdevice_t *netdev); -static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev); static int p80211knetdev_open(netdevice_t *netdev); static int p80211knetdev_stop(netdevice_t *netdev); static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, @@ -134,30 +133,6 @@ static int p80211knetdev_init(netdevice_t *netdev) } /* -* p80211knetdev_get_stats -* -* Statistics retrieval for linux netdevices. Here we're reporting -* the Linux
[PATCH] staging: gdm72xx: Use net_device_stats from struct net_device
Instead of using an own copy of struct net_device_stats in struct nic, use stats from struct net_device. Also remove the thus unnecessary .ndo_get_stats function, as it would now just return netdev-stats, which is the default in dev_get_stats(). Signed-off-by: Tobias Klauser tklau...@distanz.ch --- drivers/staging/gdm72xx/gdm_wimax.c | 17 - drivers/staging/gdm72xx/gdm_wimax.h | 1 - 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index 4148013..6f44798 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -359,8 +359,8 @@ int gdm_wimax_send_tx(struct sk_buff *skb, struct net_device *dev) return ret; } - nic-stats.tx_packets++; - nic-stats.tx_bytes += skb-len - HCI_HEADER_SIZE; + dev-stats.tx_packets++; + dev-stats.tx_bytes += skb-len - HCI_HEADER_SIZE; kfree_skb(skb); return ret; } @@ -445,13 +445,6 @@ static int gdm_wimax_set_mac_addr(struct net_device *dev, void *p) return 0; } -static struct net_device_stats *gdm_wimax_stats(struct net_device *dev) -{ - struct nic *nic = netdev_priv(dev); - - return nic-stats; -} - static int gdm_wimax_open(struct net_device *dev) { struct nic *nic = netdev_priv(dev); @@ -707,7 +700,6 @@ static int gdm_wimax_get_prepared_info(struct net_device *dev, char *buf, static void gdm_wimax_netif_rx(struct net_device *dev, char *buf, int len) { - struct nic *nic = netdev_priv(dev); struct sk_buff *skb; int ret; @@ -720,8 +712,8 @@ static void gdm_wimax_netif_rx(struct net_device *dev, char *buf, int len) } skb_reserve(skb, 2); - nic-stats.rx_packets++; - nic-stats.rx_bytes += len; + dev-stats.rx_packets++; + dev-stats.rx_bytes += len; memcpy(skb_put(skb, len), buf, len); @@ -877,7 +869,6 @@ static struct net_device_ops gdm_netdev_ops = { .ndo_stop = gdm_wimax_close, .ndo_set_config = gdm_wimax_set_config, .ndo_start_xmit = gdm_wimax_tx, - .ndo_get_stats = gdm_wimax_stats, .ndo_set_mac_address= gdm_wimax_set_mac_addr, .ndo_do_ioctl = gdm_wimax_ioctl, }; diff --git a/drivers/staging/gdm72xx/gdm_wimax.h b/drivers/staging/gdm72xx/gdm_wimax.h index 7e2c888..798dcc3 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.h +++ b/drivers/staging/gdm72xx/gdm_wimax.h @@ -46,7 +46,6 @@ struct phy_dev { struct nic { struct net_device *netdev; struct phy_dev *phy_dev; - struct net_device_stats stats; struct data_s sdk_data[SIOC_DATA_MAX]; #if defined(CONFIG_WIMAX_GDM72XX_QOS) struct qos_cb_s qos; -- 2.0.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: et131x: Use net_device_stats from struct net_device
Instead of using an own copy of struct net_device_stats in struct et131x_adapter, use stats from struct net_device. Signed-off-by: Tobias Klauser tklau...@distanz.ch --- drivers/staging/et131x/et131x.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 08356b6..ada0243 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -532,8 +532,6 @@ struct et131x_adapter { /* Stats */ struct ce_stats stats; - - struct net_device_stats net_stats; }; static int eeprom_wait_ready(struct pci_dev *pdev, u32 *status) @@ -2618,7 +2616,7 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) return NULL; } - adapter-net_stats.rx_bytes += rfd-len; + adapter-netdev-stats.rx_bytes += rfd-len; memcpy(skb_put(skb, rfd-len), fbr-virt[buff_index], rfd-len); @@ -2666,7 +2664,7 @@ static void et131x_handle_recv_interrupt(struct et131x_adapter *adapter) continue; /* Increment the number of packets we received */ - adapter-net_stats.rx_packets++; + adapter-netdev-stats.rx_packets++; /* Set the status on the packet, either resources or success */ if (rx_ring-num_ready_recv RFD_LOW_WATER_MARK) @@ -3037,7 +3035,7 @@ static int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev) dev_kfree_skb_any(skb); skb = NULL; - adapter-net_stats.tx_dropped++; + adapter-netdev-stats.tx_dropped++; } else { status = send_packet(skb, adapter); if (status != 0 status != -ENOMEM) { @@ -3046,7 +3044,7 @@ static int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev) */ dev_kfree_skb_any(skb); skb = NULL; - adapter-net_stats.tx_dropped++; + adapter-netdev-stats.tx_dropped++; } } } @@ -3065,7 +3063,7 @@ static inline void free_send_packet(struct et131x_adapter *adapter, { unsigned long flags; struct tx_desc *desc = NULL; - struct net_device_stats *stats = adapter-net_stats; + struct net_device_stats *stats = adapter-netdev-stats; struct tx_ring *tx_ring = adapter-tx_ring; u64 dma_addr; @@ -3110,7 +3108,7 @@ static inline void free_send_packet(struct et131x_adapter *adapter, /* Add the TCB to the Ready Q */ spin_lock_irqsave(adapter-tcb_ready_qlock, flags); - adapter-net_stats.tx_packets++; + stats-tx_packets++; if (tx_ring-tcb_qtail) tx_ring-tcb_qtail-next = tcb; @@ -4134,7 +4132,7 @@ out: static struct net_device_stats *et131x_stats(struct net_device *netdev) { struct et131x_adapter *adapter = netdev_priv(netdev); - struct net_device_stats *stats = adapter-net_stats; + struct net_device_stats *stats = adapter-netdev-stats; struct ce_stats *devstat = adapter-stats; stats-rx_errors = devstat-rx_length_errs + @@ -4426,7 +4424,7 @@ static void et131x_tx_timeout(struct net_device *netdev) tcb-index, tcb-flags); - adapter-net_stats.tx_errors++; + adapter-netdev-stats.tx_errors++; /* perform reset of tx/rx */ et131x_disable_txrx(netdev); -- 2.0.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: fix checkpatch error/warning in r819xU_phy.c
On Tue, Jul 08, 2014 at 11:34:18AM +0530, sanjeev sharma wrote: From: sanjeevs1 sanjeev_sha...@mentor.com ^ No. This is a patch to the r819xU_phy.c file that fixes up all the Error/Warning found by the checkpatch.pl tool Split it into one thing per patch. Signed-off-by: Sanjeev Sharma sanjeev_sha...@mentor.com --- drivers/staging/rtl8192u/r819xU_phy.c | 76 +-- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c index 02554c9..1dd1c1e 100644 --- a/drivers/staging/rtl8192u/r819xU_phy.c +++ b/drivers/staging/rtl8192u/r819xU_phy.c @@ -101,16 +101,15 @@ void rtl8192_setBBreg(struct net_device *dev, u32 reg_addr, u32 bitmask, } else { write_nic_dword(dev, reg_addr, data); } - return; } /** * function: This function reads specific bits from BB register * input: net_device *dev - *u32reg_addr //target addr to be readback - *u32bitmask//taget bit pos to be readback - * output:none - * return:u32data //the readback register value + * u32 reg_addr //target addr to be readback + * u32 bitmask//taget bit pos to be readback + * output: none + * return: u32 data //the readback register value * notice: **/ u32 rtl8192_QueryBBReg(struct net_device *dev, u32 reg_addr, u32 bitmask) @@ -192,7 +191,7 @@ static u32 rtl8192_phy_RFSerialRead(struct net_device *dev, /* TODO: we should not delay such a long time. Ask for help from SD3 */ - usleep_range(1000, 1000); + usleep_range(1000, 2000); No. ret = rtl8192_QueryBBReg(dev, pPhyReg-rfLSSIReadBack, bLSSIReadBackData); @@ -281,7 +280,6 @@ static void rtl8192_phy_RFSerialWrite(struct net_device *dev, priv-RfReg0Value[eRFPath] 16); } } - return; } /** @@ -332,7 +330,6 @@ void rtl8192_phy_SetRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath, rtl8192_phy_RFSerialWrite(dev, eRFPath, reg_addr, data); } } - return; } /** @@ -481,9 +478,9 @@ static void phy_FwRFSerialWrite(struct net_device *dev, /** * function: This function reads BB parameters from header file we generate, *and do register read/write - * input: net_device *dev - * output:none - * return:none + * input:net_device *dev + * output: none + * return: none * notice:BB parameters may change all the time, so please make *sure it has been synced with the newest. */ @@ -513,7 +510,6 @@ void rtl8192_phy_configmac(struct net_device *dev) rtl8192_setBBreg(dev, pdwArray[i], pdwArray[i+1], pdwArray[i+2]); } - return; } /** @@ -559,7 +555,6 @@ void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType) rtl819XAGCTAB_Array[i+1]); } } - return; } /** @@ -746,11 +741,11 @@ u8 rtl8192_phy_checkBBAndRF(struct net_device *dev, HW90_BLOCK_E CheckBlock, bMask12Bits, WriteData[i]); /* TODO: we should not delay for such a long time. Ask SD3 */ - usleep_range(1000, 1000); + usleep_range(1000, 2000); reg = rtl8192_phy_QueryRFReg(dev, eRFPath, WriteAddr[HW90_BLOCK_RF], bMask12Bits); - usleep_range(1000, 1000); + usleep_range(1000, 2000); Don't do this without a better explanation and testing. break; default: @@ -846,7 +841,6 @@ static void rtl8192_BB_Config_ParaFile(struct net_device *dev) priv-bCckHighPower = (u8)rtl8192_QueryBBReg(dev, rFPGA0_XA_HSSIParameter2, 0x200); - return;
[PATCH] staging: gdm72xx: Remove unnecessary memset of netdev private data
The memory for struct net_device private data is allocated using kzalloc/vzalloc in alloc_netdev_mqs, thus there is no need to zero it again in the driver. Signed-off-by: Tobias Klauser tklau...@distanz.ch --- drivers/staging/gdm72xx/gdm_wimax.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index 6f44798..47e1dd9 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -893,8 +893,6 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev) memcpy(dev-dev_addr, gdm_wimax_macaddr, sizeof(gdm_wimax_macaddr)); nic = netdev_priv(dev); - memset(nic, 0, sizeof(*nic)); - nic-netdev = dev; nic-phy_dev = phy_dev; phy_dev-netdev = dev; -- 2.0.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/5] staging:iio:hmc5843: Split hmc5843.c to multiple files
When you compare the old and new versions of hmc5843_read_raw() then it appears there is a bug fix or something which hasn't been documentented in the changelog. -static int hmc5843_read_raw(struct iio_dev *indio_dev, - struct iio_chan_spec const *chan, - int *val, int *val2, long mask) -{ - struct hmc5843_data *data = iio_priv(indio_dev); - int rval; - int ret; - - switch (mask) { - case IIO_CHAN_INFO_RAW: - return hmc5843_read_measurement(data, chan-scan_index, val); - case IIO_CHAN_INFO_SCALE: - ret = regmap_read(data-regmap, HMC5843_CONFIG_REG_B, rval); - if (ret 0) - return ret; - *val = 0; - *val2 = data-variant-regval_to_nanoscale[rval HMC5843_RANGE_GAIN_OFFSET]; - return IIO_VAL_INT_PLUS_NANO; - case IIO_CHAN_INFO_SAMP_FREQ: - ret = regmap_read(data-regmap, HMC5843_CONFIG_REG_A, rval); - if (ret 0) - return ret; - rval = HMC5843_RATE_MASK; ^ HMC5843_RATE_MASK is 0x1c. - *val = data-variant-regval_to_samp_freq[rval][0]; - *val2 = data-variant-regval_to_samp_freq[rval][1]; - return IIO_VAL_INT_PLUS_MICRO; - } - return -EINVAL; -} +static int hmc5843_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int *val, int *val2, long mask) +{ + struct hmc5843_data *data = iio_priv(indio_dev); + int rval; + int ret; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + return hmc5843_read_measurement(data, chan-scan_index, val); + case IIO_CHAN_INFO_SCALE: + ret = regmap_read(data-regmap, HMC5843_CONFIG_REG_B, rval); + if (ret 0) + return ret; + rval = HMC5843_RANGE_GAIN_OFFSET; + *val = 0; + *val2 = data-variant-regval_to_nanoscale[rval]; + return IIO_VAL_INT_PLUS_NANO; + case IIO_CHAN_INFO_SAMP_FREQ: + ret = regmap_read(data-regmap, HMC5843_CONFIG_REG_A, rval); + if (ret 0) + return ret; + rval = HMC5843_RATE_OFFSET; HMC5843_RATE_OFFSET is 0x02. + *val = data-variant-regval_to_samp_freq[rval][0]; + *val2 = data-variant-regval_to_samp_freq[rval][1]; + return IIO_VAL_INT_PLUS_MICRO; + } + return -EINVAL; +} Ideally this patch would be a straight move and no code changes. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 04/10] lib/vsprintf: add %*pE[achnops] format specifier
On Mon, 2014-07-07 at 09:50 -0700, Joe Perches wrote: On Mon, 2014-07-07 at 18:21 +0300, Andy Shevchenko wrote: diff --git a/lib/vsprintf.c b/lib/vsprintf.c [] static noinline_for_stack +char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, +const char *fmt) [] + if (spec.field_width == 0) + /* nothing to print */ + return buf; [] + len = spec.field_width 0 ? 1 : spec.field_width; If field_width is not specified, emit a single byte? A single byte to be escaped (it might be \000, for example, on output). Perhaps better if -1 was accepted by string_escape_mem as a strlen request or just ignored as a 0 length is above. Would it be any benefit here? fyi: hex_string emits nothing on printk(%ph, buf); Works just fine. How did you check it? pr_info(%ph\n, in); = test_string_helpers: 1b (I suppose \n flushes a buffer for me.) -- Andy Shevchenko andriy.shevche...@intel.com Intel Finland Oy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 5/5] staging:nvec: Add missing blank line after declarations.
Looks ok. If you wanted it probably would have been better to fold patches 3, 4, and 5 together but this is ok too. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/4] Staging: rts5208: Replace custom macro with print_hex_dump_bytes
On Tue, Jul 08, 2014 at 08:23:02AM +0200, Fabio Falzoi wrote: Hi, here exist some checkpatch errors. Best Regards. micky. Yes, you'are right, I'm gonna fix it, thanks. And leave out the semi-colon as well. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 04/10] lib/vsprintf: add %*pE[achnops] format specifier
On Mon, 2014-07-07 at 09:25 -0700, Joe Perches wrote: [trivial notes] Thanks! Fixed locally, though am waiting for few more days if any other comment comes. On Mon, 2014-07-07 at 18:21 +0300, Andy Shevchenko wrote: This allows user to print a given buffer as esaped string. The rules applied as an escaped accordingly to the mix of the flags provided by additional format letters. rules are applied according to an optional mix of flags For example, if the given buffer: 1b 62 20 5c 43 07 22 90 0d 5d The result strings could be: would be %*pE\eb \C\a\220\r] Maybe say something about ssid's here. Mentioned in the printk-formats.txt part. or maybe add an %*pES just for the ssid type. I gave a thought to it, and it seems to me we will increase complexity of the code to get none beneficial. The SSID in most cases has a variable-length, thus we will pass it anyway, what else could be differ here? Default set of flags? diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt [] @@ -70,6 +70,34 @@ DMA addresses types dma_addr_t: For printing a dma_addr_t type which can vary based on build options, regardless of the width of the CPU data path. Passed by reference. +Raw buffer as an escaped string: + + %*pE[achnops] + + For printing raw buffer as an escaped string. For the following buffer + + 1b 62 20 5c 43 07 22 90 0d 5d + + few examples show how the conversion could be done (the result string + without embraced quotes): 'embraced' is a bit of an awkward word choice. Maybe surrounding. + + %*pE\eb \C\a\220\r] Oh, the initial commit log comments above are really for this block Phrasing is a bit different, though I rephrased above sentence. + %*pEhp \x1bb \C\x07\x90\x0d] + %*pEa \e\142\040\\\103\a\042\220\r\135 + + The converion rules are defined by combination of the following flags conversion + (see string_escape_mem() kernel documentation for the details): + a - ESCAPE_ANY + c - ESCAPE_SPECIAL + h - ESCAPE_HEX + n - ESCAPE_NULL + o - ESCAPE_OCTAL + p - ESCAPE_NP + s - ESCAPE_SPACE + By default ESCAPE_ANY_NP is used. + + If field width is ommited the 1 byte only will be escaped. omitted -- Andy Shevchenko andriy.shevche...@intel.com Intel Finland Oy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 02/13] staging: rtl8188eu: Remove function rtw_alloc_etherdev()
On Tue, Jul 08, 2014 at 12:10:02AM +0530, navin patidar wrote: rtw_alloc_etherdev() is used in rtw_init_netdev() but never gets called because old_padapter is never NULL. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/include/osdep_service.h |1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c |4 +--- drivers/staging/rtl8188eu/os_dep/osdep_service.c | 23 - 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h index 95131fe..a52dcd5 100644 --- a/drivers/staging/rtl8188eu/include/osdep_service.h +++ b/drivers/staging/rtl8188eu/include/osdep_service.h @@ -164,7 +164,6 @@ struct rtw_netdev_priv_indicator { }; struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv); -struct net_device *rtw_alloc_etherdev(int sizeof_priv); #define rtw_netdev_priv(netdev) \ (((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))-priv) diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index b0c38a4..c7a44ab 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -707,14 +707,12 @@ static const struct device_type wlan_type = { struct net_device *rtw_init_netdev(struct adapter *old_padapter) { struct adapter *padapter; - struct net_device *pnetdev; + struct net_device *pnetdev = NULL; RT_TRACE(_module_os_intfs_c_, _drv_info_, (+init_net_dev\n)); if (old_padapter != NULL) pnetdev = rtw_alloc_etherdev_with_old_priv(sizeof(struct adapter), (void *)old_padapter); Next time just remove the pointless NULL check as well. It still falls under the one thing per patch rule because it's closely related. It makes the code more clear and it even makes the patch easier to review. - else - pnetdev = rtw_alloc_etherdev(sizeof(struct adapter)); regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v2] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
-Original Message- From: driverdev-devel-boun...@linuxdriverproject.org [mailto:driverdev- devel-boun...@linuxdriverproject.org] On Behalf Of Dexuan Cui Sent: Friday, June 27, 2014 5:35 AM To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; driverdev- de...@linuxdriverproject.org; plagn...@jcrosoft.com; tomi.valkei...@ti.com; linux-fb...@vger.kernel.org; o...@aepfle.de; a...@canonical.com; jasow...@redhat.com Cc: Haiyang Zhang Subject: [PATCH v2] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic Currently the VSC has no chance to notify the VSP of the dirty rectangle on VM panic because the notification work is done in a workqueue, and in panic() the kernel typically ends up in an infinite loop, and a typical kernel config has CONFIG_PREEMPT_VOLUNTARY=y and CONFIG_PREEMPT is not set, so a context switch can't happen in panic() and the workqueue won't have a chance to run. As a result, the VM Connection window can't refresh until it's closed and we re-connect to the VM. We can register a handler on panic_notifier_list: the handler can notify the VSC and switch the framebuffer driver to a synchronous mode, meaning the VSC flushes any future framebuffer change to the VSP immediately. v2: removed the MS-TFS line in the commit message Signed-off-by: Dexuan Cui de...@microsoft.com Reviewed-by: Haiyang Zhang haiya...@microsoft.com Hi Greg, Tomi, Jean and all, Any new comment for the patch? Thanks, -- Dexuan --- drivers/video/fbdev/hyperv_fb.c | 58 ++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index e23392e..291d171 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -226,11 +226,16 @@ struct hvfb_par { u8 recv_buf[MAX_VMBUS_PKT_SIZE]; }; +static struct fb_info *hvfb_info; + static uint screen_width = HVFB_WIDTH; static uint screen_height = HVFB_HEIGHT; static uint screen_depth; static uint screen_fb_size; +/* If true, the VSC notifies the VSP on every framebuffer change */ +static bool synchronous_fb; + /* Send message to Hyper-V host */ static inline int synthvid_send(struct hv_device *hdev, struct synthvid_msg *msg) @@ -532,6 +537,20 @@ static void hvfb_update_work(struct work_struct *w) schedule_delayed_work(par-dwork, HVFB_UPDATE_DELAY); } +static int hvfb_on_panic(struct notifier_block *nb, + unsigned long e, void *p) +{ + if (hvfb_info) + synthvid_update(hvfb_info); + + synchronous_fb = true; + + return NOTIFY_DONE; +} + +static struct notifier_block hvfb_panic_nb = { + .notifier_call = hvfb_on_panic, +}; /* Framebuffer operation handlers */ @@ -582,14 +601,41 @@ static int hvfb_blank(int blank, struct fb_info *info) return 1; /* get fb_blank to set the colormap to all black */ } +static void hvfb_cfb_fillrect(struct fb_info *p, + const struct fb_fillrect *rect) +{ + cfb_fillrect(p, rect); + + if (unlikely(synchronous_fb)) + synthvid_update(p); +} + +static void hvfb_cfb_copyarea(struct fb_info *p, + const struct fb_copyarea *area) +{ + cfb_copyarea(p, area); + + if (unlikely(synchronous_fb)) + synthvid_update(p); +} + +static void hvfb_cfb_imageblit(struct fb_info *p, + const struct fb_image *image) +{ + cfb_imageblit(p, image); + + if (unlikely(synchronous_fb)) + synthvid_update(p); +} + static struct fb_ops hvfb_ops = { .owner = THIS_MODULE, .fb_check_var = hvfb_check_var, .fb_set_par = hvfb_set_par, .fb_setcolreg = hvfb_setcolreg, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, + .fb_fillrect = hvfb_cfb_fillrect, + .fb_copyarea = hvfb_cfb_copyarea, + .fb_imageblit = hvfb_cfb_imageblit, .fb_blank = hvfb_blank, }; @@ -801,6 +847,9 @@ static int hvfb_probe(struct hv_device *hdev, par-fb_ready = true; + hvfb_info = info; + atomic_notifier_chain_register(panic_notifier_list, hvfb_panic_nb); + return 0; error: @@ -820,6 +869,9 @@ static int hvfb_remove(struct hv_device *hdev) struct fb_info *info = hv_get_drvdata(hdev); struct hvfb_par *par = info-par; + atomic_notifier_chain_unregister(panic_notifier_list, hvfb_panic_nb); + hvfb_info = NULL; + par-update = false; par-fb_ready = false; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel ___ devel mailing list
Re: [PATCH v2] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
Don't use likely/unlikely unless you have benchmark numbers to show that it makes a speed up. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] hyperv: Add netpoll support
In order to have at least a netconsole to debug kernel issues on Windows Azure this patch implements netpoll support. Sending packets is easy, netvsc_start_xmit() does already everything needed. To receive we need to trigger the channel callback which is usally called via tasklet_schedule(). Signed-off-by: Richard Weinberger rich...@nod.at --- drivers/net/hyperv/netvsc_drv.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 4fd71b7..367b71e 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -736,6 +736,17 @@ static int netvsc_set_mac_addr(struct net_device *ndev, void *p) return err; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void netvsc_poll_controller(struct net_device *net) +{ + struct net_device_context *net_device_ctx = netdev_priv(net); + struct hv_device *dev = net_device_ctx-device_ctx; + + local_bh_disable(); + netvsc_channel_cb(dev-channel); + local_bh_enable(); +} +#endif static const struct ethtool_ops ethtool_ops = { .get_drvinfo= netvsc_get_drvinfo, @@ -751,6 +762,9 @@ static const struct net_device_ops device_ops = { .ndo_validate_addr =eth_validate_addr, .ndo_set_mac_address = netvsc_set_mac_addr, .ndo_select_queue = netvsc_select_queue, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = netvsc_poll_controller, +#endif }; /* -- 2.0.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: fix checkpatch error/warning in r819xU_phy.c
On Tue, Jul 08, 2014 at 03:18:40PM +0530, sanjeev sharma wrote: Hi Dan, On Tue, Jul 8, 2014 at 1:13 PM, Dan Carpenter dan.carpen...@oracle.com wrote: On Tue, Jul 08, 2014 at 11:34:18AM +0530, sanjeev sharma wrote: From: sanjeevs1 sanjeev_sha...@mentor.com ^ No. This is a patch to the r819xU_phy.c file that fixes up all the Error/Warning found by the checkpatch.pl tool Split it into one thing per patch. you mean to say Error and Warning should be fixed in separate patches ? patch 1: remove useless returns patch 2: too long lines patch 3: fix sleep ranges etc. /* TODO: we should not delay such a long time. Ask for help from SD3 */ - usleep_range(1000, 1000); + usleep_range(1000, 2000); No. usleep_range(1000, 1001); Above could be best fit to resolve the checkpatch error because usleep_range() shouldn't use min ==max args; what you would suggest ? Just leave it alone until someone who knows the answer and has the hardware can change it. Adapter-HalFunc.LedControlHandler(Adapter, LED_CTL_NO_LINK); + Adapter-HalFunc.LedControlHandler + (Adapter, LED_CTL_NO_LINK); The original was more readable. Don't we need to focus on Warning rather then readability ? No. Readability first. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Status of RMI4 drivers?
On 06/07/14 21:12, Dmitry Torokhov wrote: On Sat, Jul 5, 2014 at 8:39 PM, Greg KH gre...@linuxfoundation.org wrote: On Sat, Jul 05, 2014 at 04:37:37PM +0100, Alan Cox wrote: On Fri, 2014-07-04 at 21:48 +0300, Kristina Martšenko wrote: Hi, I'm going over some older drivers in the staging tree and wanted to ask about cptm1217 and ste_rmi4. They've been in staging for three and a half years now, waiting for the upstream Synaptics RMI4 drivers. From what I understand, the RMI4 development is happening in the synaptics-rmi4 branch of Dmitry's git tree. Does anyone have any idea when the RMI4 code might be ready and get merged properly? How is that going? I'd be quite happy to move cptm1217 out of staging, however its now been there so many years waiting the rumoured RMI4 driver that I don't have hardware to do any testing on it, so it would need to be a straight move. Kristina found a driver here: https://git.kernel.org/cgit/linux/kernel/git/dtor/input.git/log/?h=synaptics-rmi4 Dmitry, what's the status of ever getting that code merged into the tree? I was supposed to uprev the driver to the latest kernel and start merging it, unfortunately last month and a half was quite a mess. Hopefully now I should have more time since I can do bunch of this work during normal hours. Good to know, thanks. So what happens to the staging drivers once you merge the driver? Will their devices be supported by the new driver or will someone have to merge their functionality into the new driver (and test it)? Kristina ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging:nvec: Fix several coding style warnings
Hi Guillaume, On Tue, 8 Jul 2014 00:31:32 +0200 Guillaume Clement gclem...@baobob.org wrote: This fixes several warnings in the nvec staging driver. Pawel Lebioda already sent a patch series to fix these issues a few days ago. From a first look, your patch series looks identical. Thanks anyway for taking your time. Marc Marc Dietrich marvi...@gmx.de ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 8/8] staging: rtl8712: remove inapplicable comment
On Tue, Jun 24, 2014 at 10:52:41PM -0400, James A Shackleford wrote: Signed-off-by: James A Shackleford sh...@linux.com --- drivers/staging/rtl8712/osdep_service.h |5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index 77b1443..3dfc473 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -95,11 +95,6 @@ static inline void _set_workitem(_workitem *pwork) #define BIT(x) (1 (x)) #endif -/* -For the following list_xxx operations, -caller must guarantee the atomic context. -Otherwise, there will be racing condition. -*/ static inline u32 _down_sema(struct semaphore *sema) { if (down_interruptible(sema)) This function sucks obviously just like the wrappers you deleted earlier. Only one of the callers checks the return value. TODO-list: 2014-07-08: rtl8712: delete _down_sema(). regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: wlan-ng/hfa384x_usb.c: add blank line after declarations
On Wed, Jun 25, 2014 at 11:25:33PM +0800, Cheng-Wei Lee wrote: This patch fixes the following checkpatch.pl issues in hfa384x_usb.c: WARNING: Missing a blank line after declarations Signed-off-by: Quentin Lee lee.rhaps...@gmail.com --- drivers/staging/wlan-ng/hfa384x_usb.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 07cee56..99e2f2d 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3533,7 +3533,7 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb) } done: - return; + pr_debug(hfa384x_usbin_rx: done\n); Don't add this stuff. Just delete the useless label. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Question about patches for bcm
On Thu, Jun 26, 2014 at 04:42:11PM +0200, Matthias Beyer wrote: Hi, I have a question related to some patches I send in. (I send them to de...@driverdev.osuosl.org, but they show up in the archives of this list... so I'm asking here) I send 6 patch sets since the beginning of the month. Some of them where reviewed, some not. None of them is upstream by now. Did something got stuck? If there is no comment that means everyone else approves and Greg has not gotten to them. Normally I review patches when they are sent to the list and comment on some. I have been away so I haven't reviewed all your patches yet. I did some research and found a message in the archives[0] related to the bcm driver. It seems that there is still work in progress on this driver, so I guess my patches are not obsolete, right? I think most places in the world are not using wi-max so this driver is going to be obsolete in 3-5 years but not yet entirely. My second iteration would contain some refactoring of the type / member names, moving headers around, maybe splitting files, etc. Is this okay for you? Yes, that is fine. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[patch] staging: rtl8188eu: use GFP_ATOMIC under spinlock
We're holding a spinlock here so we can't do sleeping allocations. The call tree is: rtw_sta_flush() -- takes spin_lock_bh(pstapriv-asoc_list_lock); -- ap_free_sta() -- rtw_clearstakey_cmd() Originally these calls were rtw_zmalloc() and then we switched them to kzalloc() in fadbe0cd5292 ('staging: rtl8188eu:Remove rtw_zmalloc(), wrapper for kzalloc()') and that made the bugs show up for my static checker. The original code was buggy as well but my static checker couldn't parse it. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index aeaa873..1222b9b 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1106,20 +1106,20 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue) if (!enqueue) { clear_cam_entry(padapter, entry); } else { - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); + ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); if (ph2c == NULL) { res = _FAIL; goto exit; } - psetstakey_para = kzalloc(sizeof(struct set_stakey_parm), GFP_KERNEL); + psetstakey_para = kzalloc(sizeof(struct set_stakey_parm), GFP_ATOMIC); if (psetstakey_para == NULL) { kfree(ph2c); res = _FAIL; goto exit; } - psetstakey_rsp = kzalloc(sizeof(struct set_stakey_rsp), GFP_KERNEL); + psetstakey_rsp = kzalloc(sizeof(struct set_stakey_rsp), GFP_ATOMIC); if (psetstakey_rsp == NULL) { kfree(ph2c); kfree(psetstakey_para); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/4] staging: xillybus: Remove sparse error on IS_ERR()
On Sat, Jul 05, 2014 at 12:45:10PM +0300, Eli Billauer wrote: IS_ERR() expects a non-__iomem pointer. This should be fixed in the latest versions of Sparse. Don't make the code worse to work around bugs in the tools. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/4] staging: xillybus: Remove sparse error on IS_ERR()
Hi, Indeed -- I upgraded to sparse 0.5.0, and there's no need for this fix anymore. I'll start keeping track of sparse's git repo from now on. Dan -- Thanks for pointing this out. Greg -- Please don't apply this patch. Eli On 08/07/14 14:36, Dan Carpenter wrote: On Sat, Jul 05, 2014 at 12:45:10PM +0300, Eli Billauer wrote: IS_ERR() expects a non-__iomem pointer. This should be fixed in the latest versions of Sparse. Don't make the code worse to work around bugs in the tools. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Status of RMI4 drivers?
On Tue, Jul 8, 2014 at 12:12 PM, Kristina Martšenko kristina.martse...@gmail.com wrote: On 06/07/14 21:12, Dmitry Torokhov wrote: I was supposed to uprev the driver to the latest kernel and start merging it, unfortunately last month and a half was quite a mess. Hopefully now I should have more time since I can do bunch of this work during normal hours. Good to know, thanks. So what happens to the staging drivers once you merge the driver? Will their devices be supported by the new driver or will someone have to merge their functionality into the new driver (and test it)? I can do that once the touchscreen portions are in place. I'm just not quite familiar with the structure of the new RMI4 framework so I will need some time on it. Yours, Linus Walleij ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Anybody working on tidspbridge?
On 29/06/14 19:42, Greg KH wrote: On Fri, Jun 20, 2014 at 07:05:17PM +0300, Kristina Martšenko wrote: On 20/06/14 18:43, Kristina Martšenko wrote: Hi Omar, I'm helping Greg do a bit of cleanup in the staging tree. I noticed that nobody seems to have worked towards moving tidspbridge out of staging in over a year. Are there any plans to clean it up and move it out soon? Because otherwise we're going to have to delete the driver, as we don't want staging to become a permanent place for unfinished code. Thanks, Kristina Omar's email address in tidspbridge's TODO file seems to be outdated. Resending to more recent addresses which hopefully won't bounce. Given the total lack of response here, I suggest just deleting the driver. No one has ever done the real work that is going to be required to get this code out of staging. It has had build errors causing it to not even be usable for some kernel versions with no one noticing, so I doubt anyone cares about it anymore here. Cc'ing some more people who might be interested. If no one offers to work on the driver in the next couple of days, I'll send a patch to remove it. Kristina ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Anybody working on tidspbridge?
Hello, Given the total lack of response here, I suggest just deleting the driver. No one has ever done the real work that is going to be required to get this code out of staging. It has had build errors causing it to not even be usable for some kernel versions with no one noticing, so I doubt anyone cares about it anymore here. Cc'ing some more people who might be interested. If no one offers to work on the driver in the next couple of days, I'll send a patch to remove it. I'm using the driver (with kernel 3.7) and it works reasonably well for me; removing it seems a bit harsh regards, p. -- Peter Meerwald +43-664-218 (mobile) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/5] staging:iio:hmc5843: Split hmc5843.c to multiple files
On Tue, Jul 08, 2014 at 11:23:51AM +0300, Dan Carpenter wrote: When you compare the old and new versions of hmc5843_read_raw() then it appears there is a bug fix or something which hasn't been documentented in the changelog. -static int hmc5843_read_raw(struct iio_dev *indio_dev, - struct iio_chan_spec const *chan, - int *val, int *val2, long mask) -{ - struct hmc5843_data *data = iio_priv(indio_dev); - int rval; - int ret; - - switch (mask) { - case IIO_CHAN_INFO_RAW: - return hmc5843_read_measurement(data, chan-scan_index, val); - case IIO_CHAN_INFO_SCALE: - ret = regmap_read(data-regmap, HMC5843_CONFIG_REG_B, rval); - if (ret 0) - return ret; - *val = 0; - *val2 = data-variant-regval_to_nanoscale[rval HMC5843_RANGE_GAIN_OFFSET]; - return IIO_VAL_INT_PLUS_NANO; - case IIO_CHAN_INFO_SAMP_FREQ: - ret = regmap_read(data-regmap, HMC5843_CONFIG_REG_A, rval); - if (ret 0) - return ret; - rval = HMC5843_RATE_MASK; ^ HMC5843_RATE_MASK is 0x1c. - *val = data-variant-regval_to_samp_freq[rval][0]; - *val2 = data-variant-regval_to_samp_freq[rval][1]; - return IIO_VAL_INT_PLUS_MICRO; - } - return -EINVAL; -} +static int hmc5843_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int *val, int *val2, long mask) +{ + struct hmc5843_data *data = iio_priv(indio_dev); + int rval; + int ret; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + return hmc5843_read_measurement(data, chan-scan_index, val); + case IIO_CHAN_INFO_SCALE: + ret = regmap_read(data-regmap, HMC5843_CONFIG_REG_B, rval); + if (ret 0) + return ret; + rval = HMC5843_RANGE_GAIN_OFFSET; + *val = 0; + *val2 = data-variant-regval_to_nanoscale[rval]; + return IIO_VAL_INT_PLUS_NANO; + case IIO_CHAN_INFO_SAMP_FREQ: + ret = regmap_read(data-regmap, HMC5843_CONFIG_REG_A, rval); + if (ret 0) + return ret; + rval = HMC5843_RATE_OFFSET; HMC5843_RATE_OFFSET is 0x02. + *val = data-variant-regval_to_samp_freq[rval][0]; + *val2 = data-variant-regval_to_samp_freq[rval][1]; + return IIO_VAL_INT_PLUS_MICRO; + } + return -EINVAL; +} Ideally this patch would be a straight move and no code changes. regards, dan carpenter It seems I forgot to change the first commit when I discovered this bug. I will resend fixed version within few minutes. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 2/5] staging:iio:hmc5843: Split hmc5843.c to multiple files
This patch splits hmc5843.c to multiple files - the interface-agnostic hmc5843_core.c, i2c specific hmc5843_i2c.c and header file hmc5843.h. This is another step to add support of SPI-enabled hmc5983. Signed-off-by: Josef Gajdusek a...@atx.name --- drivers/staging/iio/magnetometer/Kconfig| 16 +- drivers/staging/iio/magnetometer/Makefile | 3 +- drivers/staging/iio/magnetometer/hmc5843.c | 702 drivers/staging/iio/magnetometer/hmc5843.h | 75 +++ drivers/staging/iio/magnetometer/hmc5843_core.c | 598 drivers/staging/iio/magnetometer/hmc5843_i2c.c | 106 6 files changed, 793 insertions(+), 707 deletions(-) delete mode 100644 drivers/staging/iio/magnetometer/hmc5843.c create mode 100644 drivers/staging/iio/magnetometer/hmc5843.h create mode 100644 drivers/staging/iio/magnetometer/hmc5843_core.c create mode 100644 drivers/staging/iio/magnetometer/hmc5843_i2c.c diff --git a/drivers/staging/iio/magnetometer/Kconfig b/drivers/staging/iio/magnetometer/Kconfig index ad88d61..28c2612 100644 --- a/drivers/staging/iio/magnetometer/Kconfig +++ b/drivers/staging/iio/magnetometer/Kconfig @@ -5,15 +5,23 @@ menu Magnetometer sensors config SENSORS_HMC5843 tristate Honeywell HMC5843/5883/5883L 3-Axis Magnetometer - depends on I2C + depends on (I2C || SPI_MASTER) select IIO_BUFFER select IIO_TRIGGERED_BUFFER - select REGMAP_I2C + select SENSORS_HMC5843_I2C if (I2C) help Say Y here to add support for the Honeywell HMC5843, HMC5883 and HMC5883L 3-Axis Magnetometer (digital compass). - To compile this driver as a module, choose M here: the module - will be called hmc5843. + This driver can also be compiled as a set of modules. + If so, these modules will be created: + - hmc5843_core (core functions) + - hmc5843_i2c (support for HMC5843, HMC5883 and HMC5883L) + +config SENSORS_HMC5843_I2C + tristate + depends on I2C + depends on SENSORS_HMC5843 + select REGMAP_I2C endmenu diff --git a/drivers/staging/iio/magnetometer/Makefile b/drivers/staging/iio/magnetometer/Makefile index f9bfb2e..65baf1c 100644 --- a/drivers/staging/iio/magnetometer/Makefile +++ b/drivers/staging/iio/magnetometer/Makefile @@ -2,4 +2,5 @@ # Makefile for industrial I/O Magnetometer sensors # -obj-$(CONFIG_SENSORS_HMC5843) += hmc5843.o +obj-$(CONFIG_SENSORS_HMC5843) += hmc5843_core.o +obj-$(CONFIG_SENSORS_HMC5843_I2C) += hmc5843_i2c.o diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c deleted file mode 100644 index a458160..000 --- a/drivers/staging/iio/magnetometer/hmc5843.c +++ /dev/null @@ -1,702 +0,0 @@ -/* Copyright (C) 2010 Texas Instruments -Author: Shubhrajyoti Datta shubhrajy...@ti.com -Acknowledgement: Jonathan Cameron ji...@kernel.org for valuable inputs. - -Support for HMC5883 and HMC5883L by Peter Meerwald pme...@pmeerw.net. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include linux/module.h -#include linux/i2c.h -#include linux/regmap.h -#include linux/iio/iio.h -#include linux/iio/sysfs.h -#include linux/iio/trigger_consumer.h -#include linux/iio/buffer.h -#include linux/iio/triggered_buffer.h -#include linux/delay.h - -#define HMC5843_CONFIG_REG_A 0x00 -#define HMC5843_CONFIG_REG_B 0x01 -#define HMC5843_MODE_REG 0x02 -#define HMC5843_DATA_OUT_MSB_REGS 0x03 -#define HMC5843_STATUS_REG 0x09 -#define HMC5843_ID_REG 0x0a -#define HMC5843_ID_END 0x0c - -enum hmc5843_ids { - HMC5843_ID, - HMC5883_ID, - HMC5883L_ID, -}; - -/* - * Range gain settings in (+-)Ga - * Beware: HMC5843 and HMC5883 have different recommended sensor field - * ranges; default corresponds to +-1.0 Ga and +-1.3 Ga, respectively - */ -#define HMC5843_RANGE_GAIN_OFFSET 0x05 -#define HMC5843_RANGE_GAIN_DEFAULT 0x01 -#define HMC5843_RANGE_GAINS8 -#define HMC5843_RANGE_GAIN_MASK0xe0 - -/* Device status */ -#define HMC5843_DATA_READY 0x01 -#define
[PATCH v3 3/5] staging:iio:hmc5843: register - value arrays now can have different lengths
Changed structure of struct hmc5843_chip_info to include length of translation arrays. Code previously using #defined constant has been changed accordingly. This allows to integrate devices which do have different amounts of available rates/scales. Signed-off-by: Josef Gajdusek a...@atx.name --- drivers/staging/iio/magnetometer/hmc5843_core.c | 34 + 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c b/drivers/staging/iio/magnetometer/hmc5843_core.c index d9695e3..e3a6b2e 100644 --- a/drivers/staging/iio/magnetometer/hmc5843_core.c +++ b/drivers/staging/iio/magnetometer/hmc5843_core.c @@ -39,7 +39,6 @@ */ #define HMC5843_RANGE_GAIN_OFFSET 0x05 #define HMC5843_RANGE_GAIN_DEFAULT 0x01 -#define HMC5843_RANGE_GAINS8 #define HMC5843_RANGE_GAIN_MASK0xe0 /* Device status */ @@ -59,7 +58,6 @@ */ #define HMC5843_RATE_OFFSET0x02 #define HMC5843_RATE_DEFAULT 0x04 -#define HMC5843_RATES 7 #define HMC5843_RATE_MASK 0x1c /* Device measurement configuration */ @@ -69,15 +67,15 @@ #define HMC5843_MEAS_CONF_MASK 0x03 /* Scaling factors: 1000/Gain */ -static const int hmc5843_regval_to_nanoscale[HMC5843_RANGE_GAINS] = { +static const int hmc5843_regval_to_nanoscale[] = { 6173, 7692, 10309, 12821, 18868, 21739, 25641, 35714 }; -static const int hmc5883_regval_to_nanoscale[HMC5843_RANGE_GAINS] = { +static const int hmc5883_regval_to_nanoscale[] = { 7812, 9766, 13021, 16287, 24096, 27701, 32573, 45662 }; -static const int hmc5883l_regval_to_nanoscale[HMC5843_RANGE_GAINS] = { +static const int hmc5883l_regval_to_nanoscale[] = { 7299, 9174, 12195, 15152, 22727, 25641, 30303, 43478 }; @@ -94,11 +92,11 @@ static const int hmc5883l_regval_to_nanoscale[HMC5843_RANGE_GAINS] = { * 6 | 50| 75 * 7 | Not used | Not used */ -static const int hmc5843_regval_to_samp_freq[7][2] = { +static const int hmc5843_regval_to_samp_freq[][2] = { {0, 50}, {1, 0}, {2, 0}, {5, 0}, {10, 0}, {20, 0}, {50, 0} }; -static const int hmc5883_regval_to_samp_freq[7][2] = { +static const int hmc5883_regval_to_samp_freq[][2] = { {0, 75}, {1, 50}, {3, 0}, {7, 50}, {15, 0}, {30, 0}, {75, 0} }; @@ -107,7 +105,9 @@ static const int hmc5883_regval_to_samp_freq[7][2] = { struct hmc5843_chip_info { const struct iio_chan_spec *channels; const int (*regval_to_samp_freq)[2]; + const int n_regval_to_samp_freq; const int *regval_to_nanoscale; + const int n_regval_to_nanoscale; }; /* The lower two bits contain the current conversion mode */ @@ -248,7 +248,7 @@ static ssize_t hmc5843_show_samp_freq_avail(struct device *dev, size_t len = 0; int i; - for (i = 0; i HMC5843_RATES; i++) + for (i = 0; i data-variant-n_regval_to_samp_freq; i++) len += scnprintf(buf + len, PAGE_SIZE - len, %d.%d , data-variant-regval_to_samp_freq[i][0], data-variant-regval_to_samp_freq[i][1]); @@ -278,7 +278,7 @@ static int hmc5843_get_samp_freq_index(struct hmc5843_data *data, { int i; - for (i = 0; i HMC5843_RATES; i++) + for (i = 0; i data-variant-n_regval_to_samp_freq; i++) if (val == data-variant-regval_to_samp_freq[i][0] val2 == data-variant-regval_to_samp_freq[i][1]) return i; @@ -307,7 +307,7 @@ static ssize_t hmc5843_show_scale_avail(struct device *dev, size_t len = 0; int i; - for (i = 0; i HMC5843_RANGE_GAINS; i++) + for (i = 0; i data-variant-n_regval_to_nanoscale; i++) len += scnprintf(buf + len, PAGE_SIZE - len, 0.%09d , data-variant-regval_to_nanoscale[i]); @@ -327,7 +327,7 @@ static int hmc5843_get_scale_index(struct hmc5843_data *data, int val, int val2) if (val != 0) return -EINVAL; - for (i = 0; i HMC5843_RANGE_GAINS; i++) + for (i = 0; i data-variant-n_regval_to_nanoscale; i++) if (val2 == data-variant-regval_to_nanoscale[i]) return i; @@ -480,17 +480,29 @@ static const struct hmc5843_chip_info hmc5843_chip_info_tbl[] = { [HMC5843_ID] = { .channels = hmc5843_channels, .regval_to_samp_freq = hmc5843_regval_to_samp_freq, + .n_regval_to_samp_freq = + ARRAY_SIZE(hmc5843_regval_to_samp_freq), .regval_to_nanoscale = hmc5843_regval_to_nanoscale, + .n_regval_to_nanoscale = + ARRAY_SIZE(hmc5843_regval_to_nanoscale), }, [HMC5883_ID] = { .channels
[PATCH v3 4/5] staging:iio:hmc5843: Add support for i2c hmc5983
This patch adds support for the hmc5983 i2c interface. This chip is almost identical to the hmc5883. The difference being added temperature compensation, additional available sample rate (220Hz) and an SPI interface. Signed-off-by: Josef Gajdusek a...@atx.name --- drivers/staging/iio/magnetometer/Kconfig| 2 +- drivers/staging/iio/magnetometer/hmc5843.h | 1 + drivers/staging/iio/magnetometer/hmc5843_core.c | 20 +--- drivers/staging/iio/magnetometer/hmc5843_i2c.c | 5 +++-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/staging/iio/magnetometer/Kconfig b/drivers/staging/iio/magnetometer/Kconfig index 28c2612..32c69c0 100644 --- a/drivers/staging/iio/magnetometer/Kconfig +++ b/drivers/staging/iio/magnetometer/Kconfig @@ -16,7 +16,7 @@ config SENSORS_HMC5843 This driver can also be compiled as a set of modules. If so, these modules will be created: - hmc5843_core (core functions) - - hmc5843_i2c (support for HMC5843, HMC5883 and HMC5883L) + - hmc5843_i2c (support for HMC5843, HMC5883, HMC5883L and HMC5983) config SENSORS_HMC5843_I2C tristate diff --git a/drivers/staging/iio/magnetometer/hmc5843.h b/drivers/staging/iio/magnetometer/hmc5843.h index 4e3cce3..c36041a 100644 --- a/drivers/staging/iio/magnetometer/hmc5843.h +++ b/drivers/staging/iio/magnetometer/hmc5843.h @@ -29,6 +29,7 @@ enum hmc5843_ids { HMC5843_ID, HMC5883_ID, HMC5883L_ID, + HMC5983_ID, }; struct hmc5843_data { diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c b/drivers/staging/iio/magnetometer/hmc5843_core.c index e3a6b2e..c89ea54 100644 --- a/drivers/staging/iio/magnetometer/hmc5843_core.c +++ b/drivers/staging/iio/magnetometer/hmc5843_core.c @@ -101,6 +101,11 @@ static const int hmc5883_regval_to_samp_freq[][2] = { {75, 0} }; +static const int hmc5983_regval_to_samp_freq[][2] = { + {0, 75}, {1, 50}, {3, 0}, {7, 50}, {15, 0}, {30, 0}, + {75, 0}, {220, 0} +}; + /* Describe chip variants */ struct hmc5843_chip_info { const struct iio_chan_spec *channels; @@ -457,7 +462,7 @@ static const struct iio_chan_spec hmc5843_channels[] = { IIO_CHAN_SOFT_TIMESTAMP(3), }; -/* Beware: Y and Z are exchanged on HMC5883 */ +/* Beware: Y and Z are exchanged on HMC5883 and 5983 */ static const struct iio_chan_spec hmc5883_channels[] = { HMC5843_CHANNEL(X, 0), HMC5843_CHANNEL(Z, 1), @@ -504,6 +509,15 @@ static const struct hmc5843_chip_info hmc5843_chip_info_tbl[] = { .n_regval_to_nanoscale = ARRAY_SIZE(hmc5883l_regval_to_nanoscale), }, + [HMC5983_ID] = { + .channels = hmc5883_channels, + .regval_to_samp_freq = hmc5983_regval_to_samp_freq, + .n_regval_to_samp_freq = + ARRAY_SIZE(hmc5983_regval_to_samp_freq), + .regval_to_nanoscale = hmc5883l_regval_to_nanoscale, + .n_regval_to_nanoscale = + ARRAY_SIZE(hmc5883l_regval_to_nanoscale), + } }; static int hmc5843_init(struct hmc5843_data *data) @@ -516,7 +530,7 @@ static int hmc5843_init(struct hmc5843_data *data) if (ret 0) return ret; if (id[0] != 'H' || id[1] != '4' || id[2] != '3') { - dev_err(data-dev, no HMC5843/5883/5883L sensor\n); + dev_err(data-dev, no HMC5843/5883/5883L/5983 sensor\n); return -ENODEV; } @@ -606,5 +620,5 @@ int hmc5843_common_remove(struct iio_dev *indio_dev) EXPORT_SYMBOL(hmc5843_common_remove); MODULE_AUTHOR(Shubhrajyoti Datta shubhrajy...@ti.com); -MODULE_DESCRIPTION(HMC5843/5883/5883L core driver); +MODULE_DESCRIPTION(HMC5843/5883/5883L/5983 core driver); MODULE_LICENSE(GPL); diff --git a/drivers/staging/iio/magnetometer/hmc5843_i2c.c b/drivers/staging/iio/magnetometer/hmc5843_i2c.c index b3c92d9..753c914 100644 --- a/drivers/staging/iio/magnetometer/hmc5843_i2c.c +++ b/drivers/staging/iio/magnetometer/hmc5843_i2c.c @@ -1,5 +1,5 @@ /* - * i2c driver for hmc5843/5843/5883/5883l + * i2c driver for hmc5843/5843/5883/5883l/5983 * * Split from hmc5843.c * Copyright (C) Josef Gajdusek a...@atx.name @@ -79,6 +79,7 @@ static const struct i2c_device_id hmc5843_id[] = { { hmc5843, HMC5843_ID }, { hmc5883, HMC5883_ID }, { hmc5883l, HMC5883L_ID }, + { hmc5983, HMC5983_ID }, { } }; MODULE_DEVICE_TABLE(i2c, hmc5843_id); @@ -102,5 +103,5 @@ static struct i2c_driver hmc5843_driver = { module_i2c_driver(hmc5843_driver); MODULE_AUTHOR(Josef Gajdusek a...@atx.name); -MODULE_DESCRIPTION(HMC5843/5883/5883L i2c driver); +MODULE_DESCRIPTION(HMC5843/5883/5883L/5983 i2c driver); MODULE_LICENSE(GPL); -- 1.8.5.5 ___ devel mailing list de...@linuxdriverproject.org
[PATCH v3 5/5] staging:iio:hmc5843: Add support for spi hmc5983
This patch adds support for the hmc5983 spi interface. This chip is almost identical to the hmc5883. The difference being added temperature compensation, additional available sample rate (220Hz) and an SPI interface. Signed-off-by: Josef Gajdusek a...@atx.name --- drivers/staging/iio/magnetometer/Kconfig | 8 ++ drivers/staging/iio/magnetometer/Makefile | 1 + drivers/staging/iio/magnetometer/hmc5843_spi.c | 105 + 3 files changed, 114 insertions(+) create mode 100644 drivers/staging/iio/magnetometer/hmc5843_spi.c diff --git a/drivers/staging/iio/magnetometer/Kconfig b/drivers/staging/iio/magnetometer/Kconfig index 32c69c0..bc5c355 100644 --- a/drivers/staging/iio/magnetometer/Kconfig +++ b/drivers/staging/iio/magnetometer/Kconfig @@ -9,6 +9,7 @@ config SENSORS_HMC5843 select IIO_BUFFER select IIO_TRIGGERED_BUFFER select SENSORS_HMC5843_I2C if (I2C) + select SENSORS_HMC5843_SPI if (SPI_MASTER) help Say Y here to add support for the Honeywell HMC5843, HMC5883 and HMC5883L 3-Axis Magnetometer (digital compass). @@ -17,6 +18,7 @@ config SENSORS_HMC5843 If so, these modules will be created: - hmc5843_core (core functions) - hmc5843_i2c (support for HMC5843, HMC5883, HMC5883L and HMC5983) + - hmc5843_spi (support for HMC5983) config SENSORS_HMC5843_I2C tristate @@ -24,4 +26,10 @@ config SENSORS_HMC5843_I2C depends on SENSORS_HMC5843 select REGMAP_I2C +config SENSORS_HMC5843_SPI + tristate + depends on SPI_MASTER + depends on SENSORS_HMC5843 + select REGMAP_SPI + endmenu diff --git a/drivers/staging/iio/magnetometer/Makefile b/drivers/staging/iio/magnetometer/Makefile index 65baf1c..33761a1 100644 --- a/drivers/staging/iio/magnetometer/Makefile +++ b/drivers/staging/iio/magnetometer/Makefile @@ -4,3 +4,4 @@ obj-$(CONFIG_SENSORS_HMC5843) += hmc5843_core.o obj-$(CONFIG_SENSORS_HMC5843_I2C) += hmc5843_i2c.o +obj-$(CONFIG_SENSORS_HMC5843_SPI) += hmc5843_spi.o diff --git a/drivers/staging/iio/magnetometer/hmc5843_spi.c b/drivers/staging/iio/magnetometer/hmc5843_spi.c new file mode 100644 index 000..3f71ee0 --- /dev/null +++ b/drivers/staging/iio/magnetometer/hmc5843_spi.c @@ -0,0 +1,105 @@ +/* + * SPI driver for hmc5983 + * + * Copyright (C) Josef Gajdusek a...@atx.name + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * */ + +#include linux/module.h +#include linux/spi/spi.h +#include linux/iio/iio.h + +#include hmc5843.h + +struct regmap_config hmc5843_spi_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + + .rd_table = hmc5843_readable_table, + .wr_table = hmc5843_writable_table, + .volatile_table = hmc5843_volatile_table, + + /* Autoincrement address pointer */ + .read_flag_mask = 0xc0, + + .cache_type = REGCACHE_RBTREE, +}; + +static int hmc5843_spi_probe(struct spi_device *spi) +{ + struct hmc5843_data *data; + struct iio_dev *indio_dev; + int ret; + + indio_dev = devm_iio_device_alloc(spi-dev, sizeof(*data)); + if (indio_dev == NULL) + return -ENOMEM; + + spi-mode = SPI_MODE_3; + spi-max_speed_hz = 800; + spi-bits_per_word = 8; + ret = spi_setup(spi); + if (ret) + return ret; + + spi_set_drvdata(spi, indio_dev); + + data = iio_priv(indio_dev); + data-dev = spi-dev; + data-regmap = devm_regmap_init_spi(spi, hmc5843_spi_regmap_config); + + indio_dev-dev.parent = spi-dev; + + return hmc5843_common_probe(indio_dev, HMC5983_ID); +} + +static int hmc5843_spi_remove(struct spi_device *spi) +{ + struct iio_dev *indio_dev = spi_get_drvdata(spi); + return hmc5843_common_remove(indio_dev); +} + +#ifdef CONFIG_PM_SLEEP +static int hmc5843_spi_suspend(struct device *dev) +{ + return hmc5843_common_suspend(spi_get_drvdata(to_spi_device(dev))); +} + +static int hmc5843_spi_resume(struct device *dev) +{ + return hmc5843_common_resume(spi_get_drvdata(to_spi_device(dev))); +} + +static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops, + hmc5843_spi_suspend, hmc5843_spi_resume); +#define HMC5843_PM_OPS (hmc5843_pm_ops) +#else +#define HMC5843_PM_OPS NULL +#endif + + +static const struct spi_device_id hmc5843_id[] = { + { hmc5983, HMC5983_ID }, + { } +}; + +static struct spi_driver hmc5843_driver = { + .driver = { + .name = hmc5843, + .pm = HMC5843_PM_OPS, + .owner = THIS_MODULE, + }, + .id_table = hmc5843_id, + .probe = hmc5843_spi_probe, +
[PATCH] staging: rtl8192ee: Correct bitmask in comparsion
The issue is discovered by static checker. The proposed change (0x000c0 - 0x000c) is likely correct because: 1. 16-bit `map` holds value coming from struct ieee80211_vht_mcs_info.tx_mcs_map, which is described so: TX MCS map 2 bits for each stream, total 8 streams. The changed code refers to case of 2 TX streams, and 0x000c mask filters two bits related to the second stream. Some codelines below 0x0003 mask is used to test first stream. 2. Mask 0x000c is used 3 more times in that place. 3. Specifying 5 digits of hex value is uncommon, especially while working with `u16` variable. So likely the trailing zero is a typo. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78041 Reported-by: David Binderman dcb...@hotmail.com Signed-off-by: Andrey Utkin andrey.krieger.ut...@gmail.com --- drivers/staging/rtl8192ee/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192ee/base.c b/drivers/staging/rtl8192ee/base.c index a7c69f7..71ed12e 100644 --- a/drivers/staging/rtl8192ee/base.c +++ b/drivers/staging/rtl8192ee/base.c @@ -827,7 +827,7 @@ static u8 _rtl_get_vht_highest_n_rate(struct ieee80211_hw *hw, u16 map = le16_to_cpu(sta-vht_cap.vht_mcs.tx_mcs_map); if ((get_rf_type(rtlphy) == RF_2T2R) - (map 0x000c) != 0x000c0) { + (map 0x000c) != 0x000c) { if ((map 0x000c) 2 == IEEE80211_VHT_MCS_SUPPORT_0_7) hw_rate = rtlpriv-cfg-maps[RTL_RC_VHT_RATE_2SS_MCS7]; -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: ft1000-usb: check for errors in card_send_command
kmalloc() result check was lacking. Fixing that required also changing card_send_command() return type from void to int, and checking its return code everywhere. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78561 Reported-by: Maksymilian Arciemowicz m...@cert.cx Signed-off-by: Andrey Utkin andrey.krieger.ut...@gmail.com --- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 6 +++--- drivers/staging/ft1000/ft1000-usb/ft1000_hw.c| 25 +--- drivers/staging/ft1000/ft1000-usb/ft1000_usb.h | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c index a8945b7..9f4c785 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c @@ -482,14 +482,14 @@ static long ft1000_ioctl(struct file *file, unsigned int command, /* Connect Message */ DEBUG(FT1000:ft1000_ioctl: IOCTL_FT1000_CONNECT\n); ConnectionMsg[79] = 0xfc; - card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c); + result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c); break; case IOCTL_DISCONNECT: /* Disconnect Message */ DEBUG(FT1000:ft1000_ioctl: IOCTL_FT1000_DISCONNECT\n); ConnectionMsg[79] = 0xfd; - card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c); + result = card_send_command(ft1000dev, (unsigned short *)ConnectionMsg, 0x4c); break; case IOCTL_GET_DSP_STAT_CMD: /* DEBUG(FT1000:ft1000_ioctl: IOCTL_FT1000_GET_DSP_STAT called\n); */ @@ -652,7 +652,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command, } pmsg++; ppseudo_hdr = (struct pseudo_hdr *)pmsg; - card_send_command(ft1000dev,(unsigned short*)dpram_data,total_len+2); + result = card_send_command(ft1000dev,(unsigned short*)dpram_data,total_len+2); ft1000dev-app_info[app_index].nTxMsg++; diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c index b6a7708..7012e09 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c @@ -322,18 +322,23 @@ static void card_reset_dsp(struct ft1000_usb *ft1000dev, bool value) * ptempbuffer - command buffer * size - command buffer size */ -void card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer, +int card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer, int size) { + int ret; unsigned short temp; unsigned char *commandbuf; DEBUG(card_send_command: enter card_send_command... size=%d\n, size); commandbuf = kmalloc(size + 2, GFP_KERNEL); + if (!commandbuf) + return -ENOMEM; memcpy((void *)commandbuf + 2, (void *)ptempbuffer, size); - ft1000_read_register(ft1000dev, temp, FT1000_REG_DOORBELL); + ret = ft1000_read_register(ft1000dev, temp, FT1000_REG_DOORBELL); + if (ret) + return ret; if (temp 0x0100) usleep_range(900, 1100); @@ -345,19 +350,23 @@ void card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer, if (size % 4) size += 4 - (size % 4); - ft1000_write_dpram32(ft1000dev, 0, commandbuf, size); + ret = ft1000_write_dpram32(ft1000dev, 0, commandbuf, size); + if (ret) + return ret; usleep_range(900, 1100); - ft1000_write_register(ft1000dev, FT1000_DB_DPRAM_TX, + ret = ft1000_write_register(ft1000dev, FT1000_DB_DPRAM_TX, FT1000_REG_DOORBELL); + if (ret) + return ret; usleep_range(900, 1100); - ft1000_read_register(ft1000dev, temp, FT1000_REG_DOORBELL); + ret = ft1000_read_register(ft1000dev, temp, FT1000_REG_DOORBELL); #if 0 if ((temp 0x0100) == 0) DEBUG(card_send_command: Message sent\n); #endif - + return ret; } /* load or reload the DSP */ @@ -1375,8 +1384,10 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size) *pmsg++ = convert.wrd; *pmsg++ = htons(info-DrvErrNum); - card_send_command(dev, (unsigned char *)tempbuffer[0], + status = card_send_command(dev, (unsigned char *)tempbuffer[0], (u16)(0x0012 + PSEUDOSZ)); + if (status) + goto out; info-DrvErrNum = 0; }
[PATCH] [media] davinci-vpfe: Fix retcode check
Use signed type to check correctly for negative error code. The issue was reported with static analyser: [linux-3.13/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:270]: (style) A pointer can not be negative so it is either pointless or an error to check if it is. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=69071 Reported-by: David Binderman dcb...@hotmail.com Signed-off-by: Andrey Utkin andrey.krieger.ut...@gmail.com --- drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c index b2daf5e..e326032 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c @@ -254,7 +254,7 @@ int config_ipipe_hw(struct vpfe_ipipe_device *ipipe) void __iomem *ipipe_base = ipipe-base_addr; struct v4l2_mbus_framefmt *outformat; u32 color_pat; - u32 ipipe_mode; + int ipipe_mode; u32 data_path; /* enable clock to IPIPE */ -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [media] davinci-vpfe: Fix retcode check
2014-07-08 16:08 GMT+02:00 Andrey Utkin andrey.krieger.ut...@gmail.com: Use signed type to check correctly for negative error code. The issue was reported with static analyser: [linux-3.13/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:270]: (style) A pointer can not be negative so it is either pointless or an error to check if it is. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=69071 Reported-by: David Binderman dcb...@hotmail.com Signed-off-by: Andrey Utkin andrey.krieger.ut...@gmail.com Hmm, while it is true that get_ipipe_mode returns an int, but the consequent call to regw_ip takes an u32 as its second argument. Did it cause a build warning for you? (Can't really check since I don't have ARM cross compilers close-by) If not, then: Reviewed-by: Levente Kurusa lkur...@redhat.com Thanks, Levente Kurusa ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] solo6x10: expose encoder quantization setting as V4L2 control
solo6*10 boards have configurable quantization parameter which takes values from 0 to 31, inclusively. This change enables setting it with ioctl VIDIOC_S_CTRL with id V4L2_CID_MPEG_VIDEO_H264_MIN_QP. --- drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c index b8ff113..bf6eb06 100644 --- a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c @@ -,6 +,9 @@ static int solo_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_GOP_SIZE: solo_enc-gop = ctrl-val; return 0; + case V4L2_CID_MPEG_VIDEO_H264_MIN_QP: + solo_enc-qp = ctrl-val; + return 0; case V4L2_CID_MOTION_THRESHOLD: solo_enc-motion_thresh = ctrl-val; if (!solo_enc-motion_global || !solo_enc-motion_enabled) @@ -1260,6 +1263,8 @@ static struct solo_enc_dev *solo_enc_alloc(struct solo_dev *solo_dev, V4L2_CID_SHARPNESS, 0, 15, 1, 0); v4l2_ctrl_new_std(hdl, solo_ctrl_ops, V4L2_CID_MPEG_VIDEO_GOP_SIZE, 1, 255, 1, solo_dev-fps); + v4l2_ctrl_new_std(hdl, solo_ctrl_ops, + V4L2_CID_MPEG_VIDEO_H264_MIN_QP, 0, 31, 1, SOLO_DEFAULT_QP); v4l2_ctrl_new_custom(hdl, solo_motion_threshold_ctrl, NULL); v4l2_ctrl_new_custom(hdl, solo_motion_enable_ctrl, NULL); v4l2_ctrl_new_custom(hdl, solo_osd_text_ctrl, NULL); -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] solo6x10: update GOP size, QP immediately
Previously, it was needed to reopen device to update GOP size and quantization parameter. Now we update device registers with new values immediately. --- drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c index bf6eb06..14f933f 100644 --- a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c @@ -1110,9 +1110,13 @@ static int solo_s_ctrl(struct v4l2_ctrl *ctrl) ctrl-val); case V4L2_CID_MPEG_VIDEO_GOP_SIZE: solo_enc-gop = ctrl-val; + solo_reg_write(solo_dev, SOLO_VE_CH_GOP(solo_enc-ch), solo_enc-gop); + solo_reg_write(solo_dev, SOLO_VE_CH_GOP_E(solo_enc-ch), solo_enc-gop); return 0; case V4L2_CID_MPEG_VIDEO_H264_MIN_QP: solo_enc-qp = ctrl-val; + solo_reg_write(solo_dev, SOLO_VE_CH_QP(solo_enc-ch), solo_enc-qp); + solo_reg_write(solo_dev, SOLO_VE_CH_QP_E(solo_enc-ch), solo_enc-qp); return 0; case V4L2_CID_MOTION_THRESHOLD: solo_enc-motion_thresh = ctrl-val; -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [media] davinci-vpfe: Fix retcode check
2014-07-08 17:32 GMT+03:00 Levente Kurusa lkur...@redhat.com: Hmm, while it is true that get_ipipe_mode returns an int, but the consequent call to regw_ip takes an u32 as its second argument. Did it cause a build warning for you? (Can't really check since I don't have ARM cross compilers close-by) If not, then: Cannot say for sure would compiler complain. I also haven't really checked it, and unfortunately even haven't succeeded to make a config that would build that code. But i believe that warning is still better than misbehaviour. -- Andrey Utkin ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192ee: Correct bitmask in comparsion
On Tue, Jul 08, 2014 at 04:54:59PM +0300, Andrey Utkin wrote: The issue is discovered by static checker. The proposed change (0x000c0 - 0x000c) is likely correct because: 1. 16-bit `map` holds value coming from struct ieee80211_vht_mcs_info.tx_mcs_map, which is described so: TX MCS map 2 bits for each stream, total 8 streams. The changed code refers to case of 2 TX streams, and 0x000c mask filters two bits related to the second stream. Some codelines below 0x0003 mask is used to test first stream. 2. Mask 0x000c is used 3 more times in that place. 3. Specifying 5 digits of hex value is uncommon, especially while working with `u16` variable. So likely the trailing zero is a typo. This changelog is perfect. Thanks. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [media] davinci-vpfe: Fix retcode check
On Tue, Jul 08, 2014 at 04:32:57PM +0200, Levente Kurusa wrote: 2014-07-08 16:08 GMT+02:00 Andrey Utkin andrey.krieger.ut...@gmail.com: Use signed type to check correctly for negative error code. The issue was reported with static analyser: [linux-3.13/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c:270]: (style) A pointer can not be negative so it is either pointless or an error to check if it is. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=69071 Reported-by: David Binderman dcb...@hotmail.com Signed-off-by: Andrey Utkin andrey.krieger.ut...@gmail.com Hmm, while it is true that get_ipipe_mode returns an int, but the consequent call to regw_ip takes an u32 as its second argument. Did it cause a build warning for you? It won't cause a compile warning. (Can't really check since I don't have ARM cross compilers close-by) Make a small test program and test. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] solo6x10: expose encoder quantization setting as V4L2 control
On Tue, Jul 08, 2014 at 05:30:33PM +0300, Andrey Utkin wrote: solo6*10 boards have configurable quantization parameter which takes values from 0 to 31, inclusively. This change enables setting it with ioctl VIDIOC_S_CTRL with id V4L2_CID_MPEG_VIDEO_H264_MIN_QP. Both of these two need signed-off-by lines. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] solo6x10: expose encoder quantization setting as V4L2 control
solo6*10 boards have configurable quantization parameter which takes values from 0 to 31, inclusively. This change enables setting it with ioctl VIDIOC_S_CTRL with id V4L2_CID_MPEG_VIDEO_H264_MIN_QP. Signed-off-by: Andrey Utkin andrey.ut...@corp.bluecherry.net --- drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c index b8ff113..bf6eb06 100644 --- a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c @@ -,6 +,9 @@ static int solo_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_GOP_SIZE: solo_enc-gop = ctrl-val; return 0; + case V4L2_CID_MPEG_VIDEO_H264_MIN_QP: + solo_enc-qp = ctrl-val; + return 0; case V4L2_CID_MOTION_THRESHOLD: solo_enc-motion_thresh = ctrl-val; if (!solo_enc-motion_global || !solo_enc-motion_enabled) @@ -1260,6 +1263,8 @@ static struct solo_enc_dev *solo_enc_alloc(struct solo_dev *solo_dev, V4L2_CID_SHARPNESS, 0, 15, 1, 0); v4l2_ctrl_new_std(hdl, solo_ctrl_ops, V4L2_CID_MPEG_VIDEO_GOP_SIZE, 1, 255, 1, solo_dev-fps); + v4l2_ctrl_new_std(hdl, solo_ctrl_ops, + V4L2_CID_MPEG_VIDEO_H264_MIN_QP, 0, 31, 1, SOLO_DEFAULT_QP); v4l2_ctrl_new_custom(hdl, solo_motion_threshold_ctrl, NULL); v4l2_ctrl_new_custom(hdl, solo_motion_enable_ctrl, NULL); v4l2_ctrl_new_custom(hdl, solo_osd_text_ctrl, NULL); -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] solo6x10: update GOP size, QP immediately
Previously, it was needed to reopen device to update GOP size and quantization parameter. Now we update device registers with new values immediately. Signed-off-by: Andrey Utkin andrey.ut...@corp.bluecherry.net --- drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c index bf6eb06..14f933f 100644 --- a/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c +++ b/drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c @@ -1110,9 +1110,13 @@ static int solo_s_ctrl(struct v4l2_ctrl *ctrl) ctrl-val); case V4L2_CID_MPEG_VIDEO_GOP_SIZE: solo_enc-gop = ctrl-val; + solo_reg_write(solo_dev, SOLO_VE_CH_GOP(solo_enc-ch), solo_enc-gop); + solo_reg_write(solo_dev, SOLO_VE_CH_GOP_E(solo_enc-ch), solo_enc-gop); return 0; case V4L2_CID_MPEG_VIDEO_H264_MIN_QP: solo_enc-qp = ctrl-val; + solo_reg_write(solo_dev, SOLO_VE_CH_QP(solo_enc-ch), solo_enc-qp); + solo_reg_write(solo_dev, SOLO_VE_CH_QP_E(solo_enc-ch), solo_enc-qp); return 0; case V4L2_CID_MOTION_THRESHOLD: solo_enc-motion_thresh = ctrl-val; -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [media] davinci-vpfe: Fix retcode check
Hi Andrey, Thanks for the patch! On Tue, Jul 8, 2014 at 3:58 PM, Andrey Utkin andrey.krieger.ut...@gmail.com wrote: 2014-07-08 17:32 GMT+03:00 Levente Kurusa lkur...@redhat.com: Hmm, while it is true that get_ipipe_mode returns an int, but the consequent call to regw_ip takes an u32 as its second argument. Did it cause a build warning for you? (Can't really check since I don't have ARM cross compilers close-by) If not, then: Cannot say for sure would compiler complain. I also haven't really checked it, and unfortunately even haven't succeeded to make a config that would build that code. But i believe that warning is still better than misbehaviour. It wont cause any compile warning. Applied for v3.17 Thanks, --Prabhakar Lad ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 04/10] lib/vsprintf: add %*pE[achnops] format specifier
On Tue, 2014-07-08 at 11:24 +0300, Andy Shevchenko wrote: On Mon, 2014-07-07 at 09:50 -0700, Joe Perches wrote: Perhaps better if -1 was accepted by string_escape_mem as a strlen request or just ignored as a 0 length is above. Would it be any benefit here? Dunno, it was just a thought for you. fyi: hex_string emits nothing on printk(%ph, buf); Works just fine. How did you check it? By not reading the code correctly. So what you have is fine. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/4] Staging: rts5208: Replace custom macro with print_hex_dump_bytes
On Tue, 2014-07-08 at 11:45 +0300, Dan Carpenter wrote: On Tue, Jul 08, 2014 at 08:23:02AM +0200, Fabio Falzoi wrote: I'm gonna fix it, thanks. And leave out the semi-colon as well. another way to do this is: static void rtsx_hex_dump(void *buf, size_t len) { #if DEBUG print_hex_dump_bytes(KBUILD_MODNAME : , DUMP_PREFIX_NONE, buf, len); #endif } ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: unisys: remove all proc entries from virtpci
This patch removes all proc entries from virtpci Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virtpci/virtpci.c | 309 +-- 1 file changed, 1 insertion(+), 308 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 5ab17e7..7d840b0 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -34,7 +34,6 @@ #include linux/list.h #include linux/slab.h #include linux/mod_devicetable.h -#include linux/proc_fs.h #include linux/if_ether.h #include linux/version.h #include version.h @@ -100,18 +99,7 @@ static int virtpci_device_suspend(struct device *dev, pm_message_t state); static int virtpci_device_resume(struct device *dev); static int virtpci_device_probe(struct device *dev); static int virtpci_device_remove(struct device *dev); -static ssize_t virt_proc_write(struct file *file, const char __user *buffer, - size_t count, loff_t *ppos); -static ssize_t info_proc_read(struct file *file, char __user *buf, - size_t len, loff_t *offset); -static const struct file_operations proc_virt_fops = { - .write = virt_proc_write, -}; - -static const struct file_operations proc_info_fops = { - .read = info_proc_read, -}; /*/ /* Globals */ @@ -152,19 +140,6 @@ static DEFINE_RWLOCK(VpcidevListLock); /* filled in with info about this driver, wrt it servicing client busses */ static ULTRA_VBUS_DEVICEINFO Bus_DriverInfo; -/* virtpci_proc_dir_entry is used to create the proc entry directory - * for virtpci - */ -static struct proc_dir_entry *virtpci_proc_dir; -/* virt_proc_entry is used to tell virtpci to add/delete vhbas/vnics/vbuses */ -static struct proc_dir_entry *virt_proc_entry; -/* info_proc_entry is used to tell virtpci to display current info - * kept in the driver - */ -static struct proc_dir_entry *info_proc_entry; -#define VIRT_PROC_ENTRY_FN virt -#define INFO_PROC_ENTRY_FN info -#define DIR_PROC_ENTRY virtpci struct virtpci_busdev { struct device virtpci_bus_device; @@ -1402,274 +1377,6 @@ void virtpci_unregister_driver(struct virtpci_driver *drv) EXPORT_SYMBOL_GPL(virtpci_unregister_driver); /*/ -/* proc filesystem functions*/ -/*/ -struct print_vbus_info { - int *length; - char *buf; -}; - -static int print_vbus(struct device *vbus, void *data) -{ - struct print_vbus_info *p = (struct print_vbus_info *) data; - int l = *(p-length); - - *(p-length) = l + sprintf(p-buf + l, bus_id:%s\n, dev_name(vbus)); - return 0; /* no error */ -} - -static ssize_t info_proc_read(struct file *file, char __user *buf, - size_t len, loff_t *offset) -{ - int length = 0; - struct virtpci_dev *tmpvpcidev; - unsigned long flags; - struct print_vbus_info printparam; - char *vbuf; - loff_t pos = *offset; - - if (pos 0) - return -EINVAL; - - if (pos 0 || !len) - return 0; - - vbuf = kzalloc(len, GFP_KERNEL); - if (!vbuf) - return -ENOMEM; - - length += sprintf(vbuf + length, CHANSOCK is not defined.\n); - - length += sprintf(vbuf + length, \n Virtual PCI Bus devices\n); - printparam.length = length; - printparam.buf = vbuf; - if (bus_for_each_dev(virtpci_bus_type, NULL, -(void *) printparam, print_vbus)) - LOGERR(delete of all vbus failed\n); - - length += sprintf(vbuf + length, \n Virtual PCI devices\n); - read_lock_irqsave(VpcidevListLock, flags); - tmpvpcidev = VpcidevListHead; - while (tmpvpcidev) { - if (tmpvpcidev-devtype == VIRTHBA_TYPE) { - length += sprintf(vbuf + length, [%d:%d] VHba:%08x:%08x max-config:%d-%d-%d-%d, - tmpvpcidev-busNo, tmpvpcidev-deviceNo, - tmpvpcidev-scsi.wwnn.wwnn1, - tmpvpcidev-scsi.wwnn.wwnn2, - tmpvpcidev-scsi.max.max_channel, - tmpvpcidev-scsi.max.max_id, - tmpvpcidev-scsi.max.max_lun, - tmpvpcidev-scsi.max.cmd_per_lun); - } else { - length += sprintf(vbuf + length, [%d:%d] VNic:%02x:%02x:%02x:%02x:%02x:%02x num_rcv_bufs:%d mtu:%d, - tmpvpcidev-busNo, tmpvpcidev-deviceNo, -
Re: [PATCH 2/2] staging: unisys: added virtpci info entry
On Tue, Jul 08, 2014 at 01:21:31PM -0400, Erik Arfvidson wrote: - + /*debug_fs file and direcroty removal*/ + debugfs_remove(info_debugfs_entry); + debugfs_remove(virtpci_debugfs_dir); Odd indentation, comment style, and spelling typos :( Also, you can just remove the directory recursivly, no need to save, and then remove, the individual files. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] hyperv: Add netpoll support
-Original Message- From: Richard Weinberger [mailto:rich...@nod.at] Sent: Tuesday, July 8, 2014 5:32 AM To: KY Srinivasan; Haiyang Zhang Cc: de...@linuxdriverproject.org; net...@vger.kernel.org; linux- ker...@vger.kernel.org; Richard Weinberger Subject: [PATCH] hyperv: Add netpoll support In order to have at least a netconsole to debug kernel issues on Windows Azure this patch implements netpoll support. Sending packets is easy, netvsc_start_xmit() does already everything needed. To receive we need to trigger the channel callback which is usally called via tasklet_schedule(). Signed-off-by: Richard Weinberger rich...@nod.at --- drivers/net/hyperv/netvsc_drv.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 4fd71b7..367b71e 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -736,6 +736,17 @@ static int netvsc_set_mac_addr(struct net_device *ndev, void *p) return err; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void netvsc_poll_controller(struct net_device *net) +{ + struct net_device_context *net_device_ctx = netdev_priv(net); + struct hv_device *dev = net_device_ctx-device_ctx; + + local_bh_disable(); + netvsc_channel_cb(dev-channel); This can only poll the primary channel not the sub channels. Thanks, - Haiyang ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: unisys: added virtpci info entry
On Tue, Jul 08, 2014 at 01:21:31PM -0400, Erik Arfvidson wrote: This patch adds the virtpci debugfs directory and the info entry inside of it. Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virtpci/virtpci.c | 122 ++- 1 file changed, 118 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 7d840b0..6c0aa96 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -37,6 +37,7 @@ #include linux/if_ether.h #include linux/version.h #include version.h + #include linux/debugfs.h #include guestlinuxdebug.h #include timskmodutils.h @@ -100,6 +101,12 @@ static int virtpci_device_resume(struct device *dev); static int virtpci_device_probe(struct device *dev); static int virtpci_device_remove(struct device *dev); +static ssize_t info_debugfs_read(struct file *file, char __user *buf, + size_t len, loff_t *offset); + +static const struct file_operations debugfs_info_fops = { + .read = info_debugfs_read, +}; /*/ /* Globals */ @@ -139,7 +146,19 @@ static DEFINE_RWLOCK(VpcidevListLock); /* filled in with info about this driver, wrt it servicing client busses */ static ULTRA_VBUS_DEVICEINFO Bus_DriverInfo; - + /*/ + /* DebugFS entries */ + /*/ +/* dentry is used to create the debugfs entry directory + * for virtpci + */ +static struct dentry *virtpci_debugfs_dir; +static struct dentry *info_debugfs_entry; +/* info_debugfs_entry is used to tell virtpci to display current info + * kept in the driver + */ +#define DIR_DEBUGFS_ENTRY virtpci +#define INFO_DEBUGFS_ENTRY_FN info struct virtpci_busdev { struct device virtpci_bus_device; @@ -588,7 +607,8 @@ static void delete_all(void) /* deletes all vnics or vhbas * returns 0 failure, 1 success, */ -static int delete_all_virt(VIRTPCI_DEV_TYPE devtype, struct del_vbus_guestpart *delparams) +static int delete_all_virt(VIRTPCI_DEV_TYPE devtype, + struct del_vbus_guestpart *delparams) { int i; unsigned char busid[BUS_ID_SIZE]; @@ -1375,6 +1395,95 @@ void virtpci_unregister_driver(struct virtpci_driver *drv) DBGINF(Leaving\n); } EXPORT_SYMBOL_GPL(virtpci_unregister_driver); +/*/ +/* debugfs filesystem functions */ +/*/ +struct print_vbus_info { + int *length; + char *buf; +}; + +static int print_vbus(struct device *vbus, void *data) +{ + struct print_vbus_info *p = (struct print_vbus_info *) data; Remove the space after the cast to remind that casting is high precedence. struct print_vbus_info *p = (struct print_vbus_info *)data; + int l = *(p-length); Remove the extra parens. int l = *p-length; + + *(p-length) = l + sprintf(p-buf + l, bus_id:%s\n, dev_name(vbus)); You don't really need the l at all. *p-length += sprintf(p-buf + *p-length, bus_id:%s\n, dev_name(vbus)); + return 0; /* no error */ +} + +static ssize_t info_debugfs_read(struct file *file, char __user *buf, + size_t len, loff_t *offset) +{ + int length = 0; length is going to be confusing because we already have len. + struct virtpci_dev *tmpvpcidev; + unsigned long flags; + struct print_vbus_info printparam; + char *vbuf; + loff_t pos = *offset; + + if (pos 0) + return -EINVAL; + + if (pos 0 || !len) + return 0; I don't understand the point of updating *offset and then not allowing pos 0. (This could be because I haven't paid attention as well though). + + vbuf = kzalloc(len, GFP_KERNEL); + if (!vbuf) + return -ENOMEM; + + length += sprintf(vbuf + length, CHANSOCK is not defined.\n); This is memory corruption here because we don't verify that len is large enough for the string. None of the sprintf() calls have checking. + + length += sprintf(vbuf + length, \n Virtual PCI Bus devices\n); + printparam.length = length; + printparam.buf = vbuf; + if (bus_for_each_dev(virtpci_bus_type, NULL, + (void *) printparam, print_vbus)) + LOGERR(delete of all vbus failed\n); delete? Probably cut and paste bug. + + length += sprintf(vbuf + length, \n Virtual PCI devices\n); +
RE: [PATCH] hyperv: Add netpoll support
-Original Message- From: Richard Weinberger [mailto:rich...@nod.at] Sent: Tuesday, July 8, 2014 2:32 AM To: KY Srinivasan; Haiyang Zhang Cc: de...@linuxdriverproject.org; net...@vger.kernel.org; linux- ker...@vger.kernel.org; Richard Weinberger Subject: [PATCH] hyperv: Add netpoll support In order to have at least a netconsole to debug kernel issues on Windows Azure this patch implements netpoll support. Sending packets is easy, netvsc_start_xmit() does already everything needed. To receive we need to trigger the channel callback which is usally called via tasklet_schedule(). Signed-off-by: Richard Weinberger rich...@nod.at --- drivers/net/hyperv/netvsc_drv.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 4fd71b7..367b71e 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -736,6 +736,17 @@ static int netvsc_set_mac_addr(struct net_device *ndev, void *p) return err; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void netvsc_poll_controller(struct net_device *net) { + struct net_device_context *net_device_ctx = netdev_priv(net); + struct hv_device *dev = net_device_ctx-device_ctx; + + local_bh_disable(); + netvsc_channel_cb(dev-channel); + local_bh_enable(); +} +#endif Each channel is bound to a specific VCPU in the guest and the channel callback is expected to be delivered on the VCPU the channel is bound to. This code is not satisfying that requirement. Regards, K. Y ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: unisys: added virtpci info entry
This patch adds the virtpci debugfs directory and the info entry inside of it. Signed-off-by: Erik Arfvidson erik.arfvid...@unisys.com Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com --- drivers/staging/unisys/virtpci/virtpci.c | 122 ++- 1 file changed, 118 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 7d840b0..6c0aa96 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -37,6 +37,7 @@ #include linux/if_ether.h #include linux/version.h #include version.h + #include linux/debugfs.h #include guestlinuxdebug.h #include timskmodutils.h @@ -100,6 +101,12 @@ static int virtpci_device_resume(struct device *dev); static int virtpci_device_probe(struct device *dev); static int virtpci_device_remove(struct device *dev); +static ssize_t info_debugfs_read(struct file *file, char __user *buf, + size_t len, loff_t *offset); + +static const struct file_operations debugfs_info_fops = { + .read = info_debugfs_read, +}; /*/ /* Globals */ @@ -139,7 +146,19 @@ static DEFINE_RWLOCK(VpcidevListLock); /* filled in with info about this driver, wrt it servicing client busses */ static ULTRA_VBUS_DEVICEINFO Bus_DriverInfo; - + /*/ + /* DebugFS entries */ + /*/ +/* dentry is used to create the debugfs entry directory + * for virtpci + */ +static struct dentry *virtpci_debugfs_dir; +static struct dentry *info_debugfs_entry; +/* info_debugfs_entry is used to tell virtpci to display current info + * kept in the driver + */ +#define DIR_DEBUGFS_ENTRY virtpci +#define INFO_DEBUGFS_ENTRY_FN info struct virtpci_busdev { struct device virtpci_bus_device; @@ -588,7 +607,8 @@ static void delete_all(void) /* deletes all vnics or vhbas * returns 0 failure, 1 success, */ -static int delete_all_virt(VIRTPCI_DEV_TYPE devtype, struct del_vbus_guestpart *delparams) +static int delete_all_virt(VIRTPCI_DEV_TYPE devtype, + struct del_vbus_guestpart *delparams) { int i; unsigned char busid[BUS_ID_SIZE]; @@ -1375,6 +1395,95 @@ void virtpci_unregister_driver(struct virtpci_driver *drv) DBGINF(Leaving\n); } EXPORT_SYMBOL_GPL(virtpci_unregister_driver); +/*/ +/* debugfs filesystem functions */ +/*/ +struct print_vbus_info { + int *length; + char *buf; +}; + +static int print_vbus(struct device *vbus, void *data) +{ + struct print_vbus_info *p = (struct print_vbus_info *) data; + int l = *(p-length); + + *(p-length) = l + sprintf(p-buf + l, bus_id:%s\n, dev_name(vbus)); + return 0; /* no error */ +} + +static ssize_t info_debugfs_read(struct file *file, char __user *buf, + size_t len, loff_t *offset) +{ + int length = 0; + struct virtpci_dev *tmpvpcidev; + unsigned long flags; + struct print_vbus_info printparam; + char *vbuf; + loff_t pos = *offset; + + if (pos 0) + return -EINVAL; + + if (pos 0 || !len) + return 0; + + vbuf = kzalloc(len, GFP_KERNEL); + if (!vbuf) + return -ENOMEM; + + length += sprintf(vbuf + length, CHANSOCK is not defined.\n); + + length += sprintf(vbuf + length, \n Virtual PCI Bus devices\n); + printparam.length = length; + printparam.buf = vbuf; + if (bus_for_each_dev(virtpci_bus_type, NULL, +(void *) printparam, print_vbus)) + LOGERR(delete of all vbus failed\n); + + length += sprintf(vbuf + length, \n Virtual PCI devices\n); + read_lock_irqsave(VpcidevListLock, flags); + tmpvpcidev = VpcidevListHead; + while (tmpvpcidev) { + if (tmpvpcidev-devtype == VIRTHBA_TYPE) { + length += sprintf(vbuf + length, + [%d:%d] VHba:%08x:%08x max-config:%d-%d-%d-%d, + tmpvpcidev-busNo, tmpvpcidev-deviceNo, + tmpvpcidev-scsi.wwnn.wwnn1, + tmpvpcidev-scsi.wwnn.wwnn2, + tmpvpcidev-scsi.max.max_channel, + tmpvpcidev-scsi.max.max_id, + tmpvpcidev-scsi.max.max_lun, + tmpvpcidev-scsi.max.cmd_per_lun); + } else { + length +=
Re: [PATCH] hyperv: Add netpoll support
Am 08.07.2014 20:01, schrieb KY Srinivasan: -Original Message- From: Richard Weinberger [mailto:rich...@nod.at] Sent: Tuesday, July 8, 2014 2:32 AM To: KY Srinivasan; Haiyang Zhang Cc: de...@linuxdriverproject.org; net...@vger.kernel.org; linux- ker...@vger.kernel.org; Richard Weinberger Subject: [PATCH] hyperv: Add netpoll support In order to have at least a netconsole to debug kernel issues on Windows Azure this patch implements netpoll support. Sending packets is easy, netvsc_start_xmit() does already everything needed. To receive we need to trigger the channel callback which is usally called via tasklet_schedule(). Signed-off-by: Richard Weinberger rich...@nod.at --- drivers/net/hyperv/netvsc_drv.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 4fd71b7..367b71e 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -736,6 +736,17 @@ static int netvsc_set_mac_addr(struct net_device *ndev, void *p) return err; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void netvsc_poll_controller(struct net_device *net) { +struct net_device_context *net_device_ctx = netdev_priv(net); +struct hv_device *dev = net_device_ctx-device_ctx; + +local_bh_disable(); +netvsc_channel_cb(dev-channel); +local_bh_enable(); +} +#endif Each channel is bound to a specific VCPU in the guest and the channel callback is expected to be delivered on the VCPU the channel is bound to. This code is not satisfying that requirement. But struct hv_device has only one channel attribute. How does this work with multiple VCPUs? Anyways, what solution to you propose? Thanks, //richard ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] hyperv: Add netpoll support
Am 08.07.2014 19:55, schrieb Haiyang Zhang: -Original Message- From: Richard Weinberger [mailto:rich...@nod.at] Sent: Tuesday, July 8, 2014 5:32 AM To: KY Srinivasan; Haiyang Zhang Cc: de...@linuxdriverproject.org; net...@vger.kernel.org; linux- ker...@vger.kernel.org; Richard Weinberger Subject: [PATCH] hyperv: Add netpoll support In order to have at least a netconsole to debug kernel issues on Windows Azure this patch implements netpoll support. Sending packets is easy, netvsc_start_xmit() does already everything needed. To receive we need to trigger the channel callback which is usally called via tasklet_schedule(). Signed-off-by: Richard Weinberger rich...@nod.at --- drivers/net/hyperv/netvsc_drv.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 4fd71b7..367b71e 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -736,6 +736,17 @@ static int netvsc_set_mac_addr(struct net_device *ndev, void *p) return err; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void netvsc_poll_controller(struct net_device *net) +{ +struct net_device_context *net_device_ctx = netdev_priv(net); +struct hv_device *dev = net_device_ctx-device_ctx; + +local_bh_disable(); +netvsc_channel_cb(dev-channel); This can only poll the primary channel not the sub channels. Sub channels in terms of one channel per VCPU as KY said? *confused*, //richard ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Anybody working on tidspbridge?
Hi Peter, On 07/08/2014 09:36 AM, Greg KH wrote: On Tue, Jul 08, 2014 at 03:03:58PM +0200, Peter Meerwald wrote: Hello, Given the total lack of response here, I suggest just deleting the driver. No one has ever done the real work that is going to be required to get this code out of staging. It has had build errors causing it to not even be usable for some kernel versions with no one noticing, so I doubt anyone cares about it anymore here. Cc'ing some more people who might be interested. If no one offers to work on the driver in the next couple of days, I'll send a patch to remove it. I'm using the driver (with kernel 3.7) and it works reasonably well for me; removing it seems a bit harsh. Using it is different from being able to maintain the code and move it out of the staging tree. Also, 3.7 is really old and obsolete, not much we can do with that kernel version :) Are you able to work on the code and do the effort needed to get it out of the staging tree? If so, great, if not, we are going to have to delete it, sorry. I agree with Greg here. In fact, the current TODO does not do enough justice to the amount of work required to make it even work on the latest kernel. Most of the TIers who worked on this driver have moved on as Kristina would have figured with her bounced emails. So I do suggest that this driver be deleted from the kernel tree. If there are enough number of folks using it (not sure how many are out there), it can be worked on out-of-tree and brought back in a cleaner fashion rather than keeping a broken stale driver in the kernel. regards Suman ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] hyperv: Add netpoll support
-Original Message- From: Richard Weinberger [mailto:rich...@nod.at] Sent: Tuesday, July 8, 2014 2:40 PM To: Haiyang Zhang; KY Srinivasan Cc: de...@linuxdriverproject.org; net...@vger.kernel.org; linux- ker...@vger.kernel.org Subject: Re: [PATCH] hyperv: Add netpoll support Am 08.07.2014 19:55, schrieb Haiyang Zhang: -Original Message- From: Richard Weinberger [mailto:rich...@nod.at] Sent: Tuesday, July 8, 2014 5:32 AM To: KY Srinivasan; Haiyang Zhang Cc: de...@linuxdriverproject.org; net...@vger.kernel.org; linux- ker...@vger.kernel.org; Richard Weinberger Subject: [PATCH] hyperv: Add netpoll support In order to have at least a netconsole to debug kernel issues on Windows Azure this patch implements netpoll support. Sending packets is easy, netvsc_start_xmit() does already everything needed. To receive we need to trigger the channel callback which is usally called via tasklet_schedule(). Signed-off-by: Richard Weinberger rich...@nod.at --- drivers/net/hyperv/netvsc_drv.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 4fd71b7..367b71e 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -736,6 +736,17 @@ static int netvsc_set_mac_addr(struct net_device *ndev, void *p) return err; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void netvsc_poll_controller(struct net_device *net) +{ + struct net_device_context *net_device_ctx = netdev_priv(net); + struct hv_device *dev = net_device_ctx-device_ctx; + + local_bh_disable(); + netvsc_channel_cb(dev-channel); This can only poll the primary channel not the sub channels. Sub channels in terms of one channel per VCPU as KY said? *confused*, Since it's used only for debugging, polling the subchannels may not be necessary. Regarding the CPU binding, KY will reply you in another email. Thanks, - Haiyang ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: unisys: added virtpci info entry
Hi, Thanks for the comments and suggestions, I'll get them fixed and send it in the new patch. Cheers, Erik ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] hyperv: Add netpoll support
Am 08.07.2014 22:03, schrieb KY Srinivasan: The VCPU the channel is bound to is available in the channel state. You could use the following code Fragment to ensure that the call is made on the right cpu: smp_call_function_single(dev-channel-target_cpu, netvsc_channel_cb, dev-channel, true); This won't work as netpoll runs with IRQs disabled. -ndo_poll_controller() has to make sure that SKBs can be received and transmitted while IRQs are off. I thought calling the channel callback by hand would be enough to receive SKBs. Thanks, //richard ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 0/4] Staging: rts5208: Use standard debug features
Use standard debug features instead of relying on the custom configuration option CONFIG_RTS5208_DEBUG and a series of home grown macros. Changes in v3: * defined rtsx_hex_dump as a static inline function to avoid checkpatch errors Changes in v2: * defined rtsx_hex_dump macro to produce output only if DEBUG is defined Fabio Falzoi (4): Staging: rts5208: Replace custom macro with pr_debug Staging: rts5208: Replace custom macro with print_hex_dump_bytes Staging: rts5208: Remove CONFIG_RTS5208_DEBUG option Staging: rts5208: Fix a format specifier for dev_err drivers/staging/rts5208/Kconfig | 7 -- drivers/staging/rts5208/debug.h | 43 --- drivers/staging/rts5208/ms.c | 144 drivers/staging/rts5208/rtsx.c | 8 +- drivers/staging/rts5208/rtsx.h | 1 - drivers/staging/rts5208/rtsx_card.c | 72 ++-- drivers/staging/rts5208/rtsx_card.h | 1 - drivers/staging/rts5208/rtsx_chip.c | 134 +++--- drivers/staging/rts5208/rtsx_scsi.c | 45 drivers/staging/rts5208/rtsx_transport.c | 45 drivers/staging/rts5208/sd.c | 186 +++ drivers/staging/rts5208/spi.c| 8 +- drivers/staging/rts5208/trace.h | 15 ++- drivers/staging/rts5208/xd.c | 121 ++-- 14 files changed, 393 insertions(+), 437 deletions(-) delete mode 100644 drivers/staging/rts5208/debug.h -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 2/4] Staging: rts5208: Replace custom macro with print_hex_dump_bytes
Use print_hex_dump_bytes to have memory properly dumped only when DEBUG is defined. Signed-off-by: Fabio Falzoi fabio.falzo...@gmail.com --- drivers/staging/rts5208/ms.c| 4 ++-- drivers/staging/rts5208/rtsx_chip.c | 4 ++-- drivers/staging/rts5208/rtsx_scsi.c | 9 - drivers/staging/rts5208/sd.c| 6 +++--- drivers/staging/rts5208/trace.h | 11 +-- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index 2476d22..0a33043 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -307,7 +307,7 @@ static int ms_read_bytes(struct rtsx_chip *chip, if ((tpc == PRO_READ_SHORT_DATA) (data_len == 8)) { pr_debug(Read format progress:\n); - RTSX_DUMP(ptr, cnt); + rtsx_hex_dump(ptr, cnt); } return STATUS_SUCCESS; @@ -1910,7 +1910,7 @@ RE_SEARCH: ptr = rtsx_get_cmd_data(chip); pr_debug(Boot block data:\n); - RTSX_DUMP(ptr, 16); + rtsx_hex_dump(ptr, 16); /* Block ID error * HEADER_ID0, HEADER_ID1 diff --git a/drivers/staging/rts5208/rtsx_chip.c b/drivers/staging/rts5208/rtsx_chip.c index 8f447ef..761e83c 100644 --- a/drivers/staging/rts5208/rtsx_chip.c +++ b/drivers/staging/rts5208/rtsx_chip.c @@ -1299,8 +1299,8 @@ int rtsx_write_cfg_seq(struct rtsx_chip *chip, u8 func, u16 addr, u8 *buf, } } - RTSX_DUMP(mask, dw_len * 4); - RTSX_DUMP(data, dw_len * 4); + rtsx_hex_dump(mask, dw_len * 4); + rtsx_hex_dump(data, dw_len * 4); for (i = 0; i dw_len; i++) { retval = rtsx_write_cfg_dw(chip, func, aligned_addr + i * 4, diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c index fd3c2e7..8269a02 100644 --- a/drivers/staging/rts5208/rtsx_scsi.c +++ b/drivers/staging/rts5208/rtsx_scsi.c @@ -40,7 +40,8 @@ void scsi_show_command(struct scsi_cmnd *srb) { char *what = NULL; - int i, unknown_cmd = 0; + int unknown_cmd = 0; + size_t len; switch (srb-cmnd[0]) { case TEST_UNIT_READY: @@ -319,10 +320,8 @@ void scsi_show_command(struct scsi_cmnd *srb) pr_debug(Command %s (%d bytes)\n, what, srb-cmd_len); if (unknown_cmd) { - pr_debug(); - for (i = 0; i srb-cmd_len i 16; i++) - pr_debug( %02x, srb-cmnd[i]); - pr_debug(\n); + len = min_t(size_t, srb-cmd_len, 16); + rtsx_hex_dump(srb-cmnd, len); } } diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index 96acd39..2f50f9c 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -426,7 +426,7 @@ static int sd_check_csd(struct rtsx_chip *chip, char check_wp) memcpy(sd_card-raw_csd, rsp + 1, 15); pr_debug(CSD Response:\n); - RTSX_DUMP(sd_card-raw_csd, 16); + rtsx_hex_dump(sd_card-raw_csd, 16); csd_ver = (rsp[1] 0xc0) 6; pr_debug(csd_ver = %d\n, csd_ver); @@ -1059,7 +1059,7 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, TRACE_RET(chip, STATUS_FAIL); } - RTSX_DUMP(buf, 64); + rtsx_hex_dump(buf, 64); if (func_group == NO_ARGUMENT) { sd_card-func_group1_mask = buf[0x0D]; @@ -2107,7 +2107,7 @@ static int sd_check_wp_state(struct rtsx_chip *chip) } pr_debug(ACMD13:\n); - RTSX_DUMP(buf, 64); + rtsx_hex_dump(buf, 64); sd_card_type = ((u16)buf[2] 8) | buf[3]; pr_debug(sd_card_type = 0x%04x\n, sd_card_type); diff --git a/drivers/staging/rts5208/trace.h b/drivers/staging/rts5208/trace.h index 7fcb459..6a85415 100644 --- a/drivers/staging/rts5208/trace.h +++ b/drivers/staging/rts5208/trace.h @@ -82,12 +82,11 @@ static inline char *filename(char *path) #define TRACE_GOTO(chip, label)goto label #endif -#ifdef CONFIG_RTS5208_DEBUG -#define RTSX_DUMP(buf, buf_len)\ - print_hex_dump(KERN_DEBUG, KBUILD_MODNAME : , \ - DUMP_PREFIX_NONE, 16, 1, (buf), (buf_len), false) -#else -#define RTSX_DUMP(buf, buf_len) +static inline void rtsx_hex_dump(const void *buf, size_t len) +{ +#ifdef DEBUG + print_hex_dump_bytes(KBUILD_MODNAME : , DUMP_PREFIX_NONE, buf, len); #endif +} #endif /* __REALTEK_RTSX_TRACE_H */ -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 3/4] Staging: rts5208: Remove CONFIG_RTS5208_DEBUG option
CONFIG_RTS5208_DEBUG is no more needed, we rely on dynamic debug config options instead. Signed-off-by: Fabio Falzoi fabio.falzo...@gmail.com --- drivers/staging/rts5208/Kconfig | 7 --- drivers/staging/rts5208/sd.c| 5 + 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/rts5208/Kconfig b/drivers/staging/rts5208/Kconfig index 055655c..05c990f 100644 --- a/drivers/staging/rts5208/Kconfig +++ b/drivers/staging/rts5208/Kconfig @@ -6,10 +6,3 @@ config RTS5208 PCI-E card reader rts5208/rts5288. If this driver is compiled as a module, it will be named rts5208. - -config RTS5208_DEBUG - bool Realtek PCI-E Card Reader RTS5208/5288 verbose debug - depends on RTS5208 - help - Say Y here in order to have the rts5208 code generate - verbose debugging messages. diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index 2f50f9c..4b51ee4 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -811,12 +811,10 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) PHASE_NOT_RESET); RTSX_WRITE_REG(chip, CLK_CTL, CHANGE_CLK, 0); } else { -#ifdef CONFIG_RTS5208_DEBUG rtsx_read_register(chip, SD_VP_CTL, val); pr_debug(SD_VP_CTL: 0x%x\n, val); rtsx_read_register(chip, SD_DCMPS_CTL, val); pr_debug(SD_DCMPS_CTL: 0x%x\n, val); -#endif if (ddr_rx) { RTSX_WRITE_REG(chip, SD_VP_CTL, PHASE_CHANGE, @@ -862,12 +860,11 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) return STATUS_SUCCESS; Fail: -#ifdef CONFIG_RTS5208_DEBUG rtsx_read_register(chip, SD_VP_CTL, val); pr_debug(SD_VP_CTL: 0x%x\n, val); rtsx_read_register(chip, SD_DCMPS_CTL, val); pr_debug(SD_DCMPS_CTL: 0x%x\n, val); -#endif + rtsx_write_register(chip, SD_DCMPS_CTL, DCMPS_CHANGE, 0); rtsx_write_register(chip, SD_VP_CTL, PHASE_CHANGE, 0); wait_timeout(10); -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 4/4] Staging: rts5208: Fix a format specifier for dev_err
Fix an incorrect use of the %d format specifier in dev_err that caused a warning. Signed-off-by: Fabio Falzoi fabio.falzo...@gmail.com --- drivers/staging/rts5208/rtsx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index 4f5f7a3..9aae7ac 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -463,14 +463,14 @@ static int rtsx_control_thread(void *__dev) * the maximum known LUN */ else if (chip-srb-device-id) { - dev_err(dev-pci-dev, Bad target number (%d:%d)\n, + dev_err(dev-pci-dev, Bad target number (%d:%llu)\n, chip-srb-device-id, chip-srb-device-lun); chip-srb-result = DID_BAD_TARGET 16; } else if (chip-srb-device-lun chip-max_lun) { - dev_err(dev-pci-dev, Bad LUN (%d:%d)\n, + dev_err(dev-pci-dev, Bad LUN (%d:%llu)\n, chip-srb-device-id, chip-srb-device-lun); chip-srb-result = DID_BAD_TARGET 16; -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
On Tue, Jul 08, 2014 at 10:17:48PM +, Dexuan Cui wrote: -Original Message- From: Dan Carpenter [mailto:dan.carpen...@oracle.com] Sent: Tuesday, July 8, 2014 17:27 PM To: Dexuan Cui Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; driverdev- de...@linuxdriverproject.org; plagn...@jcrosoft.com; tomi.valkei...@ti.com; linux-fb...@vger.kernel.org; o...@aepfle.de; a...@canonical.com; jasow...@redhat.com; Haiyang Zhang Subject: Re: [PATCH v2] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic Don't use likely/unlikely unless you have benchmark numbers to show that it makes a speed up. regards, dan carpenter Hi Dan, Here the variable 'synchronous_fb' is only set to true when the system panics. So before the system panics, it's always 'unlikely'. :-) Then take advantage of gcc's and your processor's prediction, which knows that 0 is the common case and will choose to do the right thing here. Dan is right, never put those markings in your code unless you can benchmark the difference. Which means in reality, never put them in your code. thanks, gerg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: binder: add vm_fault handler
On Mon, Jun 02, 2014 at 06:17:59PM +0530, Vinayak Menon wrote: An issue was observed when a userspace task exits. The page which hits error here is the zero page. In binder mmap, the whole of vma is not mapped. On a task crash, when debuggerd reads the binder regions, the unmapped areas fall to do_anonymous_page in handle_pte_fault, due to the absence of a vm_fault handler. This results in zero page being mapped. Later in zap_pte_range, vm_normal_page returns zero page in the case of VM_MIXEDMAP and it results in the error. BUG: Bad page map in process mediaserver pte:9dff379f pmd:9bfbd831 page:c0ed8e60 count:1 mapcount:-1 mapping: (null) index:0x0 page flags: 0x404(referenced|reserved) addr:40c3f000 vm_flags:10220051 anon_vma: (null) mapping:d9fe0764 index:fd vma-vm_ops-fault: (null) vma-vm_file-f_op-mmap: binder_mmap+0x0/0x274 CPU: 0 PID: 1463 Comm: mediaserver Tainted: GW3.10.17+ #1 [c001549c] (unwind_backtrace+0x0/0x11c) from [c001200c] (show_stack+0x10/0x14) [c001200c] (show_stack+0x10/0x14) from [c0103d78] (print_bad_pte+0x158/0x190) [c0103d78] (print_bad_pte+0x158/0x190) from [c01055f0] (unmap_single_vma+0x2e4/0x598) [c01055f0] (unmap_single_vma+0x2e4/0x598) from [c010618c] (unmap_vmas+0x34/0x50) [c010618c] (unmap_vmas+0x34/0x50) from [c010a9e4] (exit_mmap+0xc8/0x1e8) [c010a9e4] (exit_mmap+0xc8/0x1e8) from [c00520f0] (mmput+0x54/0xd0) [c00520f0] (mmput+0x54/0xd0) from [c005972c] (do_exit+0x360/0x990) [c005972c] (do_exit+0x360/0x990) from [c0059ef0] (do_group_exit+0x84/0xc0) [c0059ef0] (do_group_exit+0x84/0xc0) from [c0066de0] (get_signal_to_deliver+0x4d4/0x548) [c0066de0] (get_signal_to_deliver+0x4d4/0x548) from [c0011500] (do_signal+0xa8/0x3b8) Add a vm_fault handler which returns VM_FAULT_SIGBUS, and prevents the wrong fallback to do_anonymous_page. Signed-off-by: Vinayak Menon vinayakm.l...@gmail.com --- drivers/staging/android/binder.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) Given a lack of objections, I'll go merge this... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 00/10] staging: rtl8723au: Fix USB macro functions
On Tue, Jul 01, 2014 at 12:06:59PM +0200, jes.soren...@redhat.com wrote: From: Jes Sorensen jes.soren...@redhat.com Greg, Here is v2 of patch 08/10 Sanitize USB read/write functions it should fix the 'do not do DMA on the stack' issue with the original version. With this patch 09/10 is valid again. I didn't want to resend the full set again to reduce list noise, but if you prefer that, just let me know and I can do that. I think I got it right with this patch, thanks for the update. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] hyperv: Add netpoll support
Am 09.07.2014 00:47, schrieb Francois Romieu: Richard Weinberger rich...@nod.at : [...] This won't work as netpoll runs with IRQs disabled. -ndo_poll_controller() has to make sure that SKBs can be received and transmitted while IRQs are off. I thought calling the channel callback by hand would be enough to receive SKBs. What are you taking about ? netconsole does not need to receive. Isn't netconsole is only one user of netpoll? Of course netconsole needs only to transmit SKBs. But if you look at other -ndo_poll_controller implementations you'll notice that they care also about receiving. hyperv start_xmit handler almost does its own Tx completion as you have noticed. The situation is imho close to a virtual device one as was veth in bb446c19fefd7b4435adb12a9dd7666adc5b553a. Bad commit reference: bb446c19fefd7b4435adb12a9dd7666adc5b553a :-( Thanks, //richard ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] hyperv: Add netpoll support
Richard Weinberger rich...@nod.at : [...] This won't work as netpoll runs with IRQs disabled. -ndo_poll_controller() has to make sure that SKBs can be received and transmitted while IRQs are off. I thought calling the channel callback by hand would be enough to receive SKBs. What are you taking about ? netconsole does not need to receive. hyperv start_xmit handler almost does its own Tx completion as you have noticed. The situation is imho close to a virtual device one as was veth in bb446c19fefd7b4435adb12a9dd7666adc5b553a. -- Ueimor ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 054/115] staging: ced1401: remove typedef for TRANSAREA
On Mon, Jun 30, 2014 at 12:00:46PM +0200, Luca Ellero wrote: Signed-off-by: Luca Ellero luca.ell...@brickedbrain.com --- drivers/staging/ced1401/ced_ioc.c | 21 - drivers/staging/ced1401/usb1401.c |9 ++--- drivers/staging/ced1401/usb1401.h |6 +++--- 3 files changed, 21 insertions(+), 15 deletions(-) This patch fails to apply for some odd reason :( Which is why it is generally a bad idea to send huge series of patches all at once. So, I've applied your first 53, please go back, fix this up, and resend the rest that I did not apply. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] hyperv: Add netpoll support
Am 09.07.2014 00:47, schrieb Francois Romieu: Richard Weinberger rich...@nod.at : [...] This won't work as netpoll runs with IRQs disabled. -ndo_poll_controller() has to make sure that SKBs can be received and transmitted while IRQs are off. I thought calling the channel callback by hand would be enough to receive SKBs. What are you taking about ? netconsole does not need to receive. hyperv start_xmit handler almost does its own Tx completion as you have noticed. The situation is imho close to a virtual device one as was veth in bb446c19fefd7b4435adb12a9dd7666adc5b553a. Ah, net-next.git. My first (in-house) patch had the same empty poll controller as tun.c and now veth.c have. If we are fine with tx only, I'll happily resend an updated patch with an empty poll controller. :-) Thanks, //richard ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: bcm: add missing blank lines after declarations
On Fri, Jul 04, 2014 at 10:30:27PM +0200, Pawel Lebioda wrote: This patch fixes almost all 'missing blank line after declaration' warnings reported by checkpatch.pl for drivers/staging/bcm. Signed-off-by: Pawel Lebioda pawel.lebiod...@gmail.com Reviewed-by: Matthias Beyer m...@beyermatthias.de This patch no longer applies due to other changes in this file by other developers. Can you refresh it against my latest staging-next branch of the staging.git tree and resend? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 01/18] staging: comedi: ni_65xx: filter interval register is 32-bit
On Thu, Jun 26, 2014 at 12:05:07PM -0700, H Hartley Sweeten wrote: According to the register programming manual, the filter interval register is 32-bit. Fix the writes to this register. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Reviewed-by: Ian Abbott abbo...@mev.co.uk --- drivers/staging/comedi/drivers/ni_65xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) This patch fails to apply, are we out of sync? I've now taken all comedi patches, care to refresh against my tree when you get a chance and resend? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/3 V2] staging: cxt1e1: Remove useless OS_phystov() and OS_vtophys()
On Mon, Jun 30, 2014 at 03:56:11PM +0900, Daeseok Youn wrote: OS_phystov()/OS_vtophys() are replaced with phys_to_virt()/virt_to_phys(). Signed-off-by: Daeseok Youn daeseok.y...@gmail.com --- V2: use virt_to_phys()/phys_to_virt() instead of __pa()/__va(). drivers/staging/cxt1e1/musycc.c | 16 drivers/staging/cxt1e1/pmcc4_drv.c | 12 ++-- drivers/staging/cxt1e1/sbecom_inline_linux.h | 19 --- 3 files changed, 14 insertions(+), 33 deletions(-) This driver has been deleted from the tree, so the patches do not apply :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: cxt1e1: remove null test before kfree
On Fri, Jul 04, 2014 at 09:58:15PM +0200, Fabian Frederick wrote: Fix checkpatch warning: WARNING: kfree(NULL) is safe this check is probably not required Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Daeseok Youn daeseok.y...@gmail.com Cc: de...@driverdev.osuosl.org Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/staging/cxt1e1/pmcc4_drv.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) This driver has been deleted in the tree, sorry. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 2/4] Staging: rts5208: Replace custom macro with print_hex_dump_bytes
On Tue, Jul 08, 2014 at 11:38:30PM +0200, Fabio Falzoi wrote: Use print_hex_dump_bytes to have memory properly dumped only when DEBUG is defined. Signed-off-by: Fabio Falzoi fabio.falzo...@gmail.com --- drivers/staging/rts5208/ms.c| 4 ++-- drivers/staging/rts5208/rtsx_chip.c | 4 ++-- drivers/staging/rts5208/rtsx_scsi.c | 9 - drivers/staging/rts5208/sd.c| 6 +++--- drivers/staging/rts5208/trace.h | 11 +-- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index 2476d22..0a33043 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -307,7 +307,7 @@ static int ms_read_bytes(struct rtsx_chip *chip, if ((tpc == PRO_READ_SHORT_DATA) (data_len == 8)) { pr_debug(Read format progress:\n); - RTSX_DUMP(ptr, cnt); + rtsx_hex_dump(ptr, cnt); } return STATUS_SUCCESS; @@ -1910,7 +1910,7 @@ RE_SEARCH: ptr = rtsx_get_cmd_data(chip); pr_debug(Boot block data:\n); - RTSX_DUMP(ptr, 16); + rtsx_hex_dump(ptr, 16); /* Block ID error * HEADER_ID0, HEADER_ID1 diff --git a/drivers/staging/rts5208/rtsx_chip.c b/drivers/staging/rts5208/rtsx_chip.c index 8f447ef..761e83c 100644 --- a/drivers/staging/rts5208/rtsx_chip.c +++ b/drivers/staging/rts5208/rtsx_chip.c @@ -1299,8 +1299,8 @@ int rtsx_write_cfg_seq(struct rtsx_chip *chip, u8 func, u16 addr, u8 *buf, } } - RTSX_DUMP(mask, dw_len * 4); - RTSX_DUMP(data, dw_len * 4); + rtsx_hex_dump(mask, dw_len * 4); + rtsx_hex_dump(data, dw_len * 4); for (i = 0; i dw_len; i++) { retval = rtsx_write_cfg_dw(chip, func, aligned_addr + i * 4, diff --git a/drivers/staging/rts5208/rtsx_scsi.c b/drivers/staging/rts5208/rtsx_scsi.c index fd3c2e7..8269a02 100644 --- a/drivers/staging/rts5208/rtsx_scsi.c +++ b/drivers/staging/rts5208/rtsx_scsi.c @@ -40,7 +40,8 @@ void scsi_show_command(struct scsi_cmnd *srb) { char *what = NULL; - int i, unknown_cmd = 0; + int unknown_cmd = 0; + size_t len; switch (srb-cmnd[0]) { case TEST_UNIT_READY: @@ -319,10 +320,8 @@ void scsi_show_command(struct scsi_cmnd *srb) pr_debug(Command %s (%d bytes)\n, what, srb-cmd_len); if (unknown_cmd) { - pr_debug(); - for (i = 0; i srb-cmd_len i 16; i++) - pr_debug( %02x, srb-cmnd[i]); - pr_debug(\n); + len = min_t(size_t, srb-cmd_len, 16); + rtsx_hex_dump(srb-cmnd, len); } } diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index 96acd39..2f50f9c 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -426,7 +426,7 @@ static int sd_check_csd(struct rtsx_chip *chip, char check_wp) memcpy(sd_card-raw_csd, rsp + 1, 15); pr_debug(CSD Response:\n); - RTSX_DUMP(sd_card-raw_csd, 16); + rtsx_hex_dump(sd_card-raw_csd, 16); csd_ver = (rsp[1] 0xc0) 6; pr_debug(csd_ver = %d\n, csd_ver); @@ -1059,7 +1059,7 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, u8 mode, TRACE_RET(chip, STATUS_FAIL); } - RTSX_DUMP(buf, 64); + rtsx_hex_dump(buf, 64); if (func_group == NO_ARGUMENT) { sd_card-func_group1_mask = buf[0x0D]; @@ -2107,7 +2107,7 @@ static int sd_check_wp_state(struct rtsx_chip *chip) } pr_debug(ACMD13:\n); - RTSX_DUMP(buf, 64); + rtsx_hex_dump(buf, 64); sd_card_type = ((u16)buf[2] 8) | buf[3]; pr_debug(sd_card_type = 0x%04x\n, sd_card_type); diff --git a/drivers/staging/rts5208/trace.h b/drivers/staging/rts5208/trace.h index 7fcb459..6a85415 100644 --- a/drivers/staging/rts5208/trace.h +++ b/drivers/staging/rts5208/trace.h @@ -82,12 +82,11 @@ static inline char *filename(char *path) #define TRACE_GOTO(chip, label) goto label #endif -#ifdef CONFIG_RTS5208_DEBUG -#define RTSX_DUMP(buf, buf_len) \ - print_hex_dump(KERN_DEBUG, KBUILD_MODNAME : , \ -DUMP_PREFIX_NONE, 16, 1, (buf), (buf_len), false) -#else -#define RTSX_DUMP(buf, buf_len) +static inline void rtsx_hex_dump(const void *buf, size_t len) +{ +#ifdef DEBUG + print_hex_dump_bytes(KBUILD_MODNAME : , DUMP_PREFIX_NONE, buf, len); #endif +} What a mess. What's wrong with just using the %*ph modifier in dev_dbg() like other drivers do? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/4] Staging: rts5208: Replace custom macro with pr_debug
On Tue, Jul 08, 2014 at 11:38:29PM +0200, Fabio Falzoi wrote: Use pr_debug macro to control tracing verbosity through dynamic debug facility. For almost all of these, you should use dev_dbg() instead, as you have access to a struct device (well, you should have, you might have to dig for it...) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/1] staging: lustre: libcfs: nidstrings.c - use ARRAY_SIZE macro
On Wed, Jul 02, 2014 at 04:23:55PM +0530, Anil Belur wrote: From: Anil Belur ask...@gmail.com - this patch replaces sizeof(a)/sizeof(a[0]) with the ARRAY_SIZE macro to get the number of nidstrings (and netstrfns) - v2: also for netstrfns Signed-off-by: Anil Belur ask...@gmail.com Someone sent this same patch just before you did, sorry :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] hyperv: Add netpoll support
Richard Weinberger rich...@nod.at : Am 09.07.2014 00:47, schrieb Francois Romieu: [...] What are you taking about ? netconsole does not need to receive. Isn't netconsole is only one user of netpoll ? Out of tree users are irrelevant. See netpoll related comments in cd6362befe4cc7bf589a5236d2a780af2d47bcc9 Of course netconsole needs only to transmit SKBs. But if you look at other -ndo_poll_controller implementations you'll notice that they care also about receiving. It's just the long, illuminating history of netpoll :o) Some limited Rx netpoll support may be done but it needs more work than was originally advertised. hyperv start_xmit handler almost does its own Tx completion as you have noticed. The situation is imho close to a virtual device one as was veth in bb446c19fefd7b4435adb12a9dd7666adc5b553a. Bad commit reference: bb446c19fefd7b4435adb12a9dd7666adc5b553a Sorry, it currently belongs to davem's net-next. -- Ueimor ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/8] Drivers: scsi: storvsc: Bug fixes and improvements
In this patch set I have fixed a few bugs and implemented some enhancements. K. Y. Srinivasan (8): Drivers: scsi: storvsc: Change the limits to reflect the values on the host Drivers: scsi: storvsc: Filter commands based on the storage protocol version Drivers: scsi: storvsc: Fix a bug in handling VMBUS protocol version Drivers: scsi: storvsc: Filter WRITE_SAME_16 Drivers: scsi: storvsc: Fix a bug in the handling of SRB status flags Drivers: scsi: storvsc: Implement an abort handler drivers: scsi: storvsc: Set srb_flags in all cases drivers: scsi: storvsc: Correctly handle TEST_UNIT_READY failure drivers/scsi/storvsc_drv.c | 125 --- 1 files changed, 93 insertions(+), 32 deletions(-) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/8] Drivers: scsi: storvsc: Filter commands based on the storage protocol version
Going forward it is possible that some of the commands that are not currently implemented will be implemented on future Windows hosts. Make command filtering depend on the host version. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Cc: sta...@vger.kernel.org --- drivers/scsi/storvsc_drv.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 2e4131c..759853c 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1556,9 +1556,14 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) struct vmscsi_request *vm_srb; struct stor_mem_pools *memp = scmnd-device-hostdata; - if (!storvsc_scsi_cmd_ok(scmnd)) { - scmnd-scsi_done(scmnd); - return 0; + if (vmstor_current_major = VMSTOR_WIN8_MAJOR) { + /* +* On legacy hosts filter unimplemented commands. +*/ + if (!storvsc_scsi_cmd_ok(scmnd)) { + scmnd-scsi_done(scmnd); + return 0; + } } request_size = sizeof(struct storvsc_cmd_request); -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/8] Drivers: scsi: storvsc: Fix a bug in the handling of SRB status flags
SRB status can have additional information. Mask these out before processing SRB status. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Cc: sta...@vger.kernel.org --- drivers/scsi/storvsc_drv.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 428dbda..8f1b263 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -299,11 +299,14 @@ enum storvsc_request_type { */ #define SRB_STATUS_AUTOSENSE_VALID 0x80 +#define SRB_STATUS_QUEUE_FROZEN0x40 #define SRB_STATUS_INVALID_LUN 0x20 #define SRB_STATUS_SUCCESS 0x01 #define SRB_STATUS_ABORTED 0x02 #define SRB_STATUS_ERROR 0x04 +#define SRB_STATUS(status) \ + (status ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) /* * This is the end of Protocol specific defines. */ @@ -1007,7 +1010,7 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb, void (*process_err_fn)(struct work_struct *work); bool do_work = false; - switch (vm_srb-srb_status) { + switch (SRB_STATUS(vm_srb-srb_status)) { case SRB_STATUS_ERROR: /* * If there is an error; offline the device since all -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/8] Drivers: scsi: storvsc: Filter WRITE_SAME_16
Host does not handle WRITE_SAME_16; filter this command out. This patch is required to handle large devices (greater than 2 TB disks). Signed-off-by: K. Y. Srinivasan k...@microsoft.com Cc: sta...@vger.kernel.org --- drivers/scsi/storvsc_drv.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index d9d8051..428dbda 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1529,6 +1529,7 @@ static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) switch (scsi_op) { /* the host does not handle WRITE_SAME, log accident usage */ case WRITE_SAME: + case WRITE_SAME_16: /* * smartd sends this command and the host does not handle * this. So, don't send it. -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/8] Drivers: scsi: storvsc: Fix a bug in handling VMBUS protocol version
Based on the negotiated VMBUS protocol version, we adjust the size of the storage protocol messages. The two sizes we currently handle or pre-win8 and post-win8. Win WS2012 R2, we are negotiating higher VMBUS protocol version than the win8 version. Make adjustments to correctly handle this. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Cc: sta...@vger.kernel.org --- drivers/scsi/storvsc_drv.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 759853c..d9d8051 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1751,19 +1751,19 @@ static int storvsc_probe(struct hv_device *device, * set state to properly communicate with the host. */ - if (vmbus_proto_version == VERSION_WIN8) { - sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE; - vmscsi_size_delta = 0; - vmstor_current_major = VMSTOR_WIN8_MAJOR; - vmstor_current_minor = VMSTOR_WIN8_MINOR; - } else { + if ((vmbus_proto_version == VERSION_WS2008) || +(vmbus_proto_version == VERSION_WIN7)) { sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE; vmscsi_size_delta = sizeof(struct vmscsi_win8_extension); vmstor_current_major = VMSTOR_WIN7_MAJOR; vmstor_current_minor = VMSTOR_WIN7_MINOR; + } else { + sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE; + vmscsi_size_delta = 0; + vmstor_current_major = VMSTOR_WIN8_MAJOR; + vmstor_current_minor = VMSTOR_WIN8_MINOR; } - host = scsi_host_alloc(scsi_driver, sizeof(struct hv_host_device)); if (!host) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/8] Drivers: scsi: storvsc: Change the limits to reflect the values on the host
Hyper-V hosts can support multiple targets and multiple channels and larger number of LUNs per target. Update the code to reflect this. With this patch we can correctly enumerate all the paths in a multi-path storage environment. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Cc: sta...@vger.kernel.org --- drivers/scsi/storvsc_drv.c | 53 --- 1 files changed, 39 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 9969fa1..2e4131c 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -331,16 +331,19 @@ static int storvsc_timeout = 180; static void storvsc_on_channel_callback(void *context); /* - * In Hyper-V, each port/path/target maps to 1 scsi host adapter. In - * reality, the path/target is not used (ie always set to 0) so our - * scsi host adapter essentially has 1 bus with 1 target that contains - * up to 256 luns. + * In Hyper-V, each port/path/target maps to 1 scsi host adapter. */ -#define STORVSC_MAX_LUNS_PER_TARGET64 -#define STORVSC_MAX_TARGETS1 -#define STORVSC_MAX_CHANNELS 1 +#define STORVSC_MAX_LUNS_PER_TARGET255 +#define STORVSC_MAX_TARGETS2 +#define STORVSC_MAX_CHANNELS 8 +#define STORVSC_FC_MAX_LUNS_PER_TARGET 255 +#define STORVSC_FC_MAX_TARGETS 128 +#define STORVSC_FC_MAX_CHANNELS8 +#define STORVSC_IDE_MAX_LUNS_PER_TARGET64 +#define STORVSC_IDE_MAX_TARGETS1 +#define STORVSC_IDE_MAX_CHANNELS 1 struct storvsc_cmd_request { struct list_head entry; @@ -1690,7 +1693,7 @@ static struct scsi_host_template scsi_driver = { .slave_alloc = storvsc_device_alloc, .slave_destroy =storvsc_device_destroy, .slave_configure = storvsc_device_configure, - .cmd_per_lun = 1, + .cmd_per_lun = 255, /* 64 max_queue * 1 target */ .can_queue =STORVSC_MAX_IO_REQUESTS*STORVSC_MAX_TARGETS, .this_id = -1, @@ -1789,12 +1792,34 @@ static int storvsc_probe(struct hv_device *device, host_dev-path = stor_device-path_id; host_dev-target = stor_device-target_id; - /* max # of devices per target */ - host-max_lun = STORVSC_MAX_LUNS_PER_TARGET; - /* max # of targets per channel */ - host-max_id = STORVSC_MAX_TARGETS; - /* max # of channels */ - host-max_channel = STORVSC_MAX_CHANNELS - 1; + switch (dev_id-driver_data) { + case SFC_GUID: + /* max # of devices per target */ + host-max_lun = STORVSC_FC_MAX_LUNS_PER_TARGET; + /* max # of targets per channel */ + host-max_id = STORVSC_FC_MAX_TARGETS; + /* max # of channels */ + host-max_channel = STORVSC_FC_MAX_CHANNELS - 1; + break; + + case SCSI_GUID: + /* max # of devices per target */ + host-max_lun = STORVSC_MAX_LUNS_PER_TARGET; + /* max # of targets per channel */ + host-max_id = STORVSC_MAX_TARGETS; + /* max # of channels */ + host-max_channel = STORVSC_MAX_CHANNELS - 1; + break; + + default: + /* max # of devices per target */ + host-max_lun = STORVSC_IDE_MAX_LUNS_PER_TARGET; + /* max # of targets per channel */ + host-max_id = STORVSC_IDE_MAX_TARGETS; + /* max # of channels */ + host-max_channel = STORVSC_IDE_MAX_CHANNELS - 1; + break; + } /* max cmd length */ host-max_cmd_len = STORVSC_MAX_CMD_LEN; -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: speakup: main.c - use time_after()
On Tue, Jul 01, 2014 at 12:30:22PM +0530, Anil Belur wrote: From: Anil Belur ask...@gmail.com - this patch fixes jiffies comparision with a safer function to prevent any overflows Signed-off-by: Anil Belur ask...@gmail.com --- drivers/staging/speakup/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) This change is already in my tree, what branch are you working against? greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 8/8] drivers: scsi: storvsc: Correctly handle TEST_UNIT_READY failure
On some Windows hosts on FC SANs, TEST_UNIT_READY can return SRB_STATUS_ERROR. Correctly handle this. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Cc: sta...@vger.kernel.org --- drivers/scsi/storvsc_drv.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 6540fb6..9afdd6d 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1023,6 +1023,13 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb, case ATA_12: set_host_byte(scmnd, DID_PASSTHROUGH); break; + /* +* On Some Windows hosts TEST_UNIT_READY command can return +* SRB_STATUS_ERROR, let the upper level code deal with it +* based on the sense information. +*/ + case TEST_UNIT_READY: + break; default: set_host_byte(scmnd, DID_TARGET_FAILURE); } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/8] Drivers: scsi: storvsc: Implement an abort handler
Implement a simple abort handler. The host does not support Abort; just ensure that all inflight I/Os have been accounted for. Signed-off-by: K. Y. Srinivasan k...@microsoft.com --- drivers/scsi/storvsc_drv.c | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 8f1b263..82fb590 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1524,6 +1524,27 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) return SUCCESS; } +static int storvsc_host_abort_handler(struct scsi_cmnd *scmnd) +{ + struct hv_host_device *host_dev = shost_priv(scmnd-device-host); + struct hv_device *device = host_dev-dev; + + struct storvsc_device *stor_device; + + + stor_device = get_out_stor_device(device); + if (!stor_device) + return FAILED; + + /* +* Just wait for all in flight I/O's to complete. +*/ + + storvsc_wait_to_drain(stor_device); + + return SUCCESS; +} + static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) { bool allowed = true; @@ -1699,6 +1720,7 @@ static struct scsi_host_template scsi_driver = { .bios_param = storvsc_get_chs, .queuecommand = storvsc_queuecommand, .eh_host_reset_handler =storvsc_host_reset_handler, + .eh_abort_handler = storvsc_host_abort_handler, .slave_alloc = storvsc_device_alloc, .slave_destroy =storvsc_device_destroy, .slave_configure = storvsc_device_configure, -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/8] drivers: scsi: storvsc: Set srb_flags in all cases
Correctly set SRB flags for all valid I/O directions. Some IHV drivers on the Windows host require this. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Cc: sta...@vger.kernel.org --- drivers/scsi/storvsc_drv.c | 12 +--- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 82fb590..6540fb6 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1613,26 +1613,24 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) vm_srb = cmd_request-vstor_packet.vm_srb; vm_srb-win8_extension.time_out_value = 60; + vm_srb-win8_extension.srb_flags |= + (SRB_FLAGS_QUEUE_ACTION_ENABLE | + SRB_FLAGS_DISABLE_SYNCH_TRANSFER); /* Build the SRB */ switch (scmnd-sc_data_direction) { case DMA_TO_DEVICE: vm_srb-data_in = WRITE_TYPE; vm_srb-win8_extension.srb_flags |= SRB_FLAGS_DATA_OUT; - vm_srb-win8_extension.srb_flags |= - (SRB_FLAGS_QUEUE_ACTION_ENABLE | - SRB_FLAGS_DISABLE_SYNCH_TRANSFER); break; case DMA_FROM_DEVICE: vm_srb-data_in = READ_TYPE; vm_srb-win8_extension.srb_flags |= SRB_FLAGS_DATA_IN; - vm_srb-win8_extension.srb_flags |= - (SRB_FLAGS_QUEUE_ACTION_ENABLE | - SRB_FLAGS_DISABLE_SYNCH_TRANSFER); break; default: vm_srb-data_in = UNKNOWN_TYPE; - vm_srb-win8_extension.srb_flags = 0; + vm_srb-win8_extension.srb_flags |= (SRB_FLAGS_DATA_IN | +SRB_FLAGS_DATA_OUT); break; } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Asus TX201LA Driver for rtl8821ae
On Wed, Jul 09, 2014 at 02:34:12AM +0200, Mario wrote: linux-next.git-v3.14-drivers-staging rtl8821ae in conjunction with their linux-firmware-4c7327a35767c2133600376380c867dff3cbaa1c-rtlwifi It went wonderfully with uname-r (3.14.3-200.fc20.x86_64). Today, however, came update (3.15.3-200.fc20.x86_64 ) And well, my Asus TX201LA is offline in WIFI mode. Your driver does not work anymore, and the statement of the source: (http:// www.linlap.com/asus_transformer_book_trio_tx201la) Kernel 3.15, the rtl8821ae is supported in the kernel, is not true today. The error message reads their driver installation [mario @ tx201la linux-next.git-v3.14-drivers-staging rtl8821ae] $ make make-C / lib/modules/3.15.3-200.fc20.x86_64/build SUBDIRS = / home/mario/ Downloads/linux-next.git-v3.14-drivers-staging-rtl8821ae CONFIG_R8821AE = m modules Why are you messing around with an external kernel module? Also, as you are using Fedora, please go ask this on their mailing lists, there's not much I can do here with that kernel version, sorry. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: android: logger: fixes not useful else warnings This patch fixes WARNING: else is not generally useful after a break or return
OK, I will have another try. However I have a question. As I'm from China, should I use the name in my identity card or I can use my own English name which getting used to? Says, Qinjia Huang(ID card) or Kinka Huang? Thanks 2014-07-08 8:51 GMT+08:00 Greg Kroah-Hartman g...@kroah.com: Your subject has the info that should be here in the body of the changelog entry. On Fri, Jul 04, 2014 at 12:09:23AM +0800, kinka wrote: Signed-off-by: kinka kinkabr...@gmail.com I need a real name for any kernel submission, please read Documentation/SubmittingPatches for the details. also, someone just sent this same change in before you, sorry. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v2] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
-Original Message- From: Dan Carpenter [mailto:dan.carpen...@oracle.com] Sent: Tuesday, July 8, 2014 17:27 PM To: Dexuan Cui Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; driverdev- de...@linuxdriverproject.org; plagn...@jcrosoft.com; tomi.valkei...@ti.com; linux-fb...@vger.kernel.org; o...@aepfle.de; a...@canonical.com; jasow...@redhat.com; Haiyang Zhang Subject: Re: [PATCH v2] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic Don't use likely/unlikely unless you have benchmark numbers to show that it makes a speed up. regards, dan carpenter Hi Dan, Here the variable 'synchronous_fb' is only set to true when the system panics. So before the system panics, it's always 'unlikely'. :-) Then take advantage of gcc's and your processor's prediction, which knows that 0 is the common case and will choose to do the right thing here. Dan is right, never put those markings in your code unless you can benchmark the difference. Which means in reality, never put them in your code. gerg k-h OK, let me send out a v3 patch, which will remove the unlikely. Thanks, -- Dexuan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
Currently the VSC has no chance to notify the VSP of the dirty rectangle on VM panic because the notification work is done in a workqueue, and in panic() the kernel typically ends up in an infinite loop, and a typical kernel config has CONFIG_PREEMPT_VOLUNTARY=y and CONFIG_PREEMPT is not set, so a context switch can't happen in panic() and the workqueue won't have a chance to run. As a result, the VM Connection window can't refresh until it's closed and we re-connect to the VM. We can register a handler on panic_notifier_list: the handler can notify the VSC and switch the framebuffer driver to a synchronous mode, meaning the VSC flushes any future framebuffer change to the VSP immediately. v2: removed the MS-TFS line in the commit message v3: remove some 'unlikely' markings Signed-off-by: Dexuan Cui de...@microsoft.com Reviewed-by: Haiyang Zhang haiya...@microsoft.com --- drivers/video/fbdev/hyperv_fb.c | 58 ++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index e23392e..a7b98e1 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -226,11 +226,16 @@ struct hvfb_par { u8 recv_buf[MAX_VMBUS_PKT_SIZE]; }; +static struct fb_info *hvfb_info; + static uint screen_width = HVFB_WIDTH; static uint screen_height = HVFB_HEIGHT; static uint screen_depth; static uint screen_fb_size; +/* If true, the VSC notifies the VSP on every framebuffer change */ +static bool synchronous_fb; + /* Send message to Hyper-V host */ static inline int synthvid_send(struct hv_device *hdev, struct synthvid_msg *msg) @@ -532,6 +537,20 @@ static void hvfb_update_work(struct work_struct *w) schedule_delayed_work(par-dwork, HVFB_UPDATE_DELAY); } +static int hvfb_on_panic(struct notifier_block *nb, + unsigned long e, void *p) +{ + if (hvfb_info) + synthvid_update(hvfb_info); + + synchronous_fb = true; + + return NOTIFY_DONE; +} + +static struct notifier_block hvfb_panic_nb = { + .notifier_call = hvfb_on_panic, +}; /* Framebuffer operation handlers */ @@ -582,14 +601,41 @@ static int hvfb_blank(int blank, struct fb_info *info) return 1; /* get fb_blank to set the colormap to all black */ } +static void hvfb_cfb_fillrect(struct fb_info *p, + const struct fb_fillrect *rect) +{ + cfb_fillrect(p, rect); + + if (synchronous_fb) + synthvid_update(p); +} + +static void hvfb_cfb_copyarea(struct fb_info *p, + const struct fb_copyarea *area) +{ + cfb_copyarea(p, area); + + if (synchronous_fb) + synthvid_update(p); +} + +static void hvfb_cfb_imageblit(struct fb_info *p, + const struct fb_image *image) +{ + cfb_imageblit(p, image); + + if (synchronous_fb) + synthvid_update(p); +} + static struct fb_ops hvfb_ops = { .owner = THIS_MODULE, .fb_check_var = hvfb_check_var, .fb_set_par = hvfb_set_par, .fb_setcolreg = hvfb_setcolreg, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, + .fb_fillrect = hvfb_cfb_fillrect, + .fb_copyarea = hvfb_cfb_copyarea, + .fb_imageblit = hvfb_cfb_imageblit, .fb_blank = hvfb_blank, }; @@ -801,6 +847,9 @@ static int hvfb_probe(struct hv_device *hdev, par-fb_ready = true; + hvfb_info = info; + atomic_notifier_chain_register(panic_notifier_list, hvfb_panic_nb); + return 0; error: @@ -820,6 +869,9 @@ static int hvfb_remove(struct hv_device *hdev) struct fb_info *info = hv_get_drvdata(hdev); struct hvfb_par *par = info-par; + atomic_notifier_chain_unregister(panic_notifier_list, hvfb_panic_nb); + hvfb_info = NULL; + par-update = false; par-fb_ready = false; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: android: logger: fixes not useful else warnings This patch fixes WARNING: else is not generally useful after a break or return
On Wed, Jul 09, 2014 at 09:41:42AM +0800, 黄钦佳 wrote: OK, I will have another try. However I have a question. As I'm from China, should I use the name in my identity card or I can use my own English name which getting used to? Says, Qinjia Huang(ID card) or Kinka Huang? Your real name please, ideally the one the government thinks you use :) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
2014-06-09 14:01 GMT+04:00 Ian Abbott abbo...@mev.co.uk: On 2014-06-07 14:56, Anton Protopopov wrote: Added a check of the return value of the kobject_set_name function. Signed-off-by: Anton Protopopov a.s.protopo...@gmail.com --- drivers/staging/comedi/comedi_fops.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) Reviewed-by: Ian Abbott abbo...@mev.co.uk This patch was lost, I guess? -- -=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/1] staging: lustre: libcfs: nidstrings.c - use ARRAY_SIZE macro
On Wednesday 09 July 2014 05:18 AM, Greg KH wrote: Someone sent this same patch just before you did, sorry :( Ah - no worries - sorry for the noise. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: speakup: main.c - use time_after()
On Wednesday 09 July 2014 05:21 AM, Greg KH wrote: This change is already in my tree, what branch are you working against? greg k-h Hi Greg, I am using staging.git. I try to make sure and rebase any changes in my branch with staging-next before sending out the patches. Not sure, if I am missing anything. staging/mastercd3de83 Linux 3.16-rc4 staging/staging-linus bdac8ca Merge tag 'iio-fixes-for-3.16c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus staging/staging-next dd3fde1 staging: speakup: speakup_dectlk.c - use time_before_eq() staging/work-temp 5b14fc7 staging: rtl8821ae: Fix rtl8821ae/hw.h pointer declaration style Looks like your tree may be ahead with many commits :) Regards, Anil ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
On Wed, Jul 09, 2014 at 08:24:06AM +0400, Anton Protopopov wrote: 2014-06-09 14:01 GMT+04:00 Ian Abbott abbo...@mev.co.uk: On 2014-06-07 14:56, Anton Protopopov wrote: Added a check of the return value of the kobject_set_name function. Signed-off-by: Anton Protopopov a.s.protopo...@gmail.com --- drivers/staging/comedi/comedi_fops.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) Reviewed-by: Ian Abbott abbo...@mev.co.uk This patch was lost, I guess? I don't seem to have it anymore in my inbox, please resend. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: speakup: main.c - use time_after()
On Wed, Jul 09, 2014 at 09:57:06AM +0530, Anil Shashikumar Belur wrote: On Wednesday 09 July 2014 05:21 AM, Greg KH wrote: This change is already in my tree, what branch are you working against? greg k-h Hi Greg, I am using staging.git. I try to make sure and rebase any changes in my branch with staging-next before sending out the patches. Not sure, if I am missing anything. staging/mastercd3de83 Linux 3.16-rc4 staging/staging-linus bdac8ca Merge tag 'iio-fixes-for-3.16c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus staging/staging-next dd3fde1 staging: speakup: speakup_dectlk.c - use time_before_eq() staging/work-temp 5b14fc7 staging: rtl8821ae: Fix rtl8821ae/hw.h pointer declaration style Looks like your tree may be ahead with many commits :) Yes, please work against my staging-next branch of that tree. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
09.07.2014 08:28, gregkh пишет: On Wed, Jul 09, 2014 at 08:24:06AM +0400, Anton Protopopov wrote: 2014-06-09 14:01 GMT+04:00 Ian Abbott abbo...@mev.co.uk: On 2014-06-07 14:56, Anton Protopopov wrote: Added a check of the return value of the kobject_set_name function. Signed-off-by: Anton Protopopov a.s.protopo...@gmail.com --- drivers/staging/comedi/comedi_fops.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) Reviewed-by: Ian Abbott abbo...@mev.co.uk This patch was lost, I guess? I don't seem to have it anymore in my inbox, please resend. greg k-h Added a check of the return value of the kobject_set_name function. Signed-off-by: Anton Protopopov a.s.protopo...@gmail.com --- drivers/staging/comedi/comedi_fops.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 9d99fb3..dfeefa2 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2597,7 +2597,14 @@ static int __init comedi_init(void) return -EIO; cdev_init(comedi_cdev, comedi_fops); comedi_cdev.owner = THIS_MODULE; - kobject_set_name(comedi_cdev.kobj, comedi); + + retval = kobject_set_name(comedi_cdev.kobj, comedi); + if (retval) { + unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0), +COMEDI_NUM_MINORS); + return retval; + } + if (cdev_add(comedi_cdev, MKDEV(COMEDI_MAJOR, 0), COMEDI_NUM_MINORS)) { unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0), COMEDI_NUM_MINORS); -- 1.8.3.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel