···2233Supported adapters:44 * OpenCores.org I2C controller by Richard Herveille (see datasheet link)55- Datasheet: http://www.opencores.org/projects.cgi/web/i2c/overview55+ https://opencores.org/project/i2c/overview6677Author: Peter Korsgaard <jacmet@sunsite.dk>88
+8
MAINTAINERS
···1551315513S: Supported1551415514F: drivers/char/xillybus/15515155151551615516+XLP9XX I2C DRIVER1551715517+M: George Cherian <george.cherian@cavium.com>1551815518+M: Jan Glauber <jglauber@cavium.com>1551915519+L: linux-i2c@vger.kernel.org1552015520+W: http://www.cavium.com1552115521+S: Supported1552215522+F: drivers/i2c/busses/i2c-xlp9xx.c1552315523+1551615524XRA1403 GPIO EXPANDER1551715525M: Nandor Han <nandor.han@ge.com>1551815526M: Semi Malinen <semi.malinen@ge.com>
+4
arch/mips/kernel/process.c
···721721 if (value & ~known_bits)722722 return -EOPNOTSUPP;723723724724+ /* Setting FRE without FR is not supported. */725725+ if ((value & (PR_FP_MODE_FR | PR_FP_MODE_FRE)) == PR_FP_MODE_FRE)726726+ return -EOPNOTSUPP;727727+724728 /* Avoid inadvertently triggering emulation */725729 if ((value & PR_FP_MODE_FR) && raw_cpu_has_fpu &&726730 !(raw_current_cpu_data.fpu_id & MIPS_FPIR_F64))
···11511151}115211521153115311541154-static unsigned char eprom_try_esi(struct atm_dev *dev, unsigned short cmd,11551155- int offset, int swap)11541154+static int eprom_try_esi(struct atm_dev *dev, unsigned short cmd, int offset,11551155+ int swap)11561156{11571157 unsigned char buf[ZEPROM_SIZE];11581158 struct zatm_dev *zatm_dev;
···45554555 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {45564556 struct amdgpu_crtc *acrtc = NULL;45574557 struct amdgpu_dm_connector *aconnector = NULL;45584558- struct drm_connector_state *new_con_state = NULL;45594559- struct dm_connector_state *dm_conn_state = NULL;45584558+ struct drm_connector_state *drm_new_conn_state = NULL, *drm_old_conn_state = NULL;45594559+ struct dm_connector_state *dm_new_conn_state = NULL, *dm_old_conn_state = NULL;45604560 struct drm_plane_state *new_plane_state = NULL;4561456145624562 new_stream = NULL;···45774577 /* TODO This hack should go away */45784578 if (aconnector && enable) {45794579 // Make sure fake sink is created in plug-in scenario45804580- new_con_state = drm_atomic_get_connector_state(state,45804580+ drm_new_conn_state = drm_atomic_get_new_connector_state(state,45814581 &aconnector->base);45824582+ drm_old_conn_state = drm_atomic_get_old_connector_state(state,45834583+ &aconnector->base);4582458445834583- if (IS_ERR(new_con_state)) {45844584- ret = PTR_ERR_OR_ZERO(new_con_state);45854585+45864586+ if (IS_ERR(drm_new_conn_state)) {45874587+ ret = PTR_ERR_OR_ZERO(drm_new_conn_state);45854588 break;45864589 }4587459045884588- dm_conn_state = to_dm_connector_state(new_con_state);45914591+ dm_new_conn_state = to_dm_connector_state(drm_new_conn_state);45924592+ dm_old_conn_state = to_dm_connector_state(drm_old_conn_state);4589459345904594 new_stream = create_stream_for_sink(aconnector,45914595 &new_crtc_state->mode,45924592- dm_conn_state);45964596+ dm_new_conn_state);4593459745944598 /*45954599 * we can have no stream on ACTION_SET if a display···46994695 * We want to do dc stream updates that do not require a47004696 * full modeset below.47014697 */47024702- if (!enable || !aconnector || modereset_required(new_crtc_state))46984698+ if (!(enable && aconnector && new_crtc_state->enable &&46994699+ new_crtc_state->active))47034700 continue;47044701 /*47054702 * Given above conditions, the dc state cannot be NULL because:47064706- * 1. We're attempting to enable a CRTC. Which has a...47074707- * 2. Valid connector attached, and47084708- * 3. User does not want to reset it (disable or mark inactive,47094709- * which can happen on a CRTC that's already disabled).47104710- * => It currently exists.47034703+ * 1. We're in the process of enabling CRTCs (just been added47044704+ * to the dc context, or already is on the context)47054705+ * 2. Has a valid connector attached, and47064706+ * 3. Is currently active and enabled.47074707+ * => The dc stream state currently exists.47114708 */47124709 BUG_ON(dm_new_crtc_state->stream == NULL);4713471047144714- /* Color managment settings */47154715- if (dm_new_crtc_state->base.color_mgmt_changed) {47114711+ /* Scaling or underscan settings */47124712+ if (is_scaling_state_different(dm_old_conn_state, dm_new_conn_state))47134713+ update_stream_scaling_settings(47144714+ &new_crtc_state->mode, dm_new_conn_state, dm_new_crtc_state->stream);47154715+47164716+ /*47174717+ * Color management settings. We also update color properties47184718+ * when a modeset is needed, to ensure it gets reprogrammed.47194719+ */47204720+ if (dm_new_crtc_state->base.color_mgmt_changed ||47214721+ drm_atomic_crtc_needs_modeset(new_crtc_state)) {47164722 ret = amdgpu_dm_set_regamma_lut(dm_new_crtc_state);47174723 if (ret)47184724 goto fail;
···8282 struct dispc_clock_info *dispc_cinfo)8383{8484 int i;8585- struct sdi_clk_calc_ctx ctx = { .sdi = sdi };8585+ struct sdi_clk_calc_ctx ctx;86868787 /*8888 * DSS fclk gives us very few possibilities, so finding a good pixel···9595 bool ok;96969797 memset(&ctx, 0, sizeof(ctx));9898+9999+ ctx.sdi = sdi;100100+98101 if (pclk > 1000 * i * i * i)99102 ctx.pck_min = max(pclk - 1000 * i * i * i, 0lu);100103 else
+3-3
drivers/hwtracing/intel_th/msu.c
···733733 /* Reset the page to write-back before releasing */734734 set_memory_wb((unsigned long)win->block[i].bdesc, 1);735735#endif736736- dma_free_coherent(msc_dev(msc), size, win->block[i].bdesc,737737- win->block[i].addr);736736+ dma_free_coherent(msc_dev(msc)->parent->parent, size,737737+ win->block[i].bdesc, win->block[i].addr);738738 }739739 kfree(win);740740···769769 /* Reset the page to write-back before releasing */770770 set_memory_wb((unsigned long)win->block[i].bdesc, 1);771771#endif772772- dma_free_coherent(msc_dev(win->msc), PAGE_SIZE,772772+ dma_free_coherent(msc_dev(win->msc)->parent->parent, PAGE_SIZE,773773 win->block[i].bdesc, win->block[i].addr);774774 }775775
···11/*22 * i2c-ocores.c: I2C bus driver for OpenCores I2C controller33- * (http://www.opencores.org/projects.cgi/web/i2c/overview).33+ * (https://opencores.org/project/i2c/overview)44 *55 * Peter Korsgaard <jacmet@sunsite.dk>66 *
+1
drivers/iio/adc/Kconfig
···158158 depends on ARCH_AT91 || COMPILE_TEST159159 depends on HAS_IOMEM160160 depends on HAS_DMA161161+ select IIO_BUFFER161162 select IIO_TRIGGERED_BUFFER162163 help163164 Say yes here to build support for Atmel SAMA5D2 ADC which is
+24-51
drivers/iio/adc/ad7793.c
···348348static const u16 ad7797_sample_freq_avail[16] = {0, 0, 0, 123, 62, 50, 0,349349 33, 0, 17, 16, 12, 10, 8, 6, 4};350350351351-static ssize_t ad7793_read_frequency(struct device *dev,352352- struct device_attribute *attr,353353- char *buf)354354-{355355- struct iio_dev *indio_dev = dev_to_iio_dev(dev);356356- struct ad7793_state *st = iio_priv(indio_dev);357357-358358- return sprintf(buf, "%d\n",359359- st->chip_info->sample_freq_avail[AD7793_MODE_RATE(st->mode)]);360360-}361361-362362-static ssize_t ad7793_write_frequency(struct device *dev,363363- struct device_attribute *attr,364364- const char *buf,365365- size_t len)366366-{367367- struct iio_dev *indio_dev = dev_to_iio_dev(dev);368368- struct ad7793_state *st = iio_priv(indio_dev);369369- long lval;370370- int i, ret;371371-372372- ret = kstrtol(buf, 10, &lval);373373- if (ret)374374- return ret;375375-376376- if (lval == 0)377377- return -EINVAL;378378-379379- for (i = 0; i < 16; i++)380380- if (lval == st->chip_info->sample_freq_avail[i])381381- break;382382- if (i == 16)383383- return -EINVAL;384384-385385- ret = iio_device_claim_direct_mode(indio_dev);386386- if (ret)387387- return ret;388388- st->mode &= ~AD7793_MODE_RATE(-1);389389- st->mode |= AD7793_MODE_RATE(i);390390- ad_sd_write_reg(&st->sd, AD7793_REG_MODE, sizeof(st->mode), st->mode);391391- iio_device_release_direct_mode(indio_dev);392392-393393- return len;394394-}395395-396396-static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,397397- ad7793_read_frequency,398398- ad7793_write_frequency);399399-400351static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(401352 "470 242 123 62 50 39 33 19 17 16 12 10 8 6 4");402353···375424 ad7793_show_scale_available, NULL, 0);376425377426static struct attribute *ad7793_attributes[] = {378378- &iio_dev_attr_sampling_frequency.dev_attr.attr,379427 &iio_const_attr_sampling_frequency_available.dev_attr.attr,380428 &iio_dev_attr_in_m_in_scale_available.dev_attr.attr,381429 NULL···385435};386436387437static struct attribute *ad7797_attributes[] = {388388- &iio_dev_attr_sampling_frequency.dev_attr.attr,389438 &iio_const_attr_sampling_frequency_available_ad7797.dev_attr.attr,390439 NULL391440};···454505 *val -= offset;455506 }456507 return IIO_VAL_INT;508508+ case IIO_CHAN_INFO_SAMP_FREQ:509509+ *val = st->chip_info510510+ ->sample_freq_avail[AD7793_MODE_RATE(st->mode)];511511+ return IIO_VAL_INT;457512 }458513 return -EINVAL;459514}···494541 ad7793_calibrate_all(st);495542 break;496543 }544544+ break;545545+ case IIO_CHAN_INFO_SAMP_FREQ:546546+ if (!val) {547547+ ret = -EINVAL;548548+ break;549549+ }550550+551551+ for (i = 0; i < 16; i++)552552+ if (val == st->chip_info->sample_freq_avail[i])553553+ break;554554+555555+ if (i == 16) {556556+ ret = -EINVAL;557557+ break;558558+ }559559+560560+ st->mode &= ~AD7793_MODE_RATE(-1);561561+ st->mode |= AD7793_MODE_RATE(i);562562+ ad_sd_write_reg(&st->sd, AD7793_REG_MODE, sizeof(st->mode),563563+ st->mode);497564 break;498565 default:499566 ret = -EINVAL;
···144144 * Leave as soon as if exact resolution if reached.145145 * Otherwise the higher resolution below 32 bits is kept.146146 */147147+ fl->res = 0;147148 for (fosr = 1; fosr <= DFSDM_MAX_FL_OVERSAMPLING; fosr++) {148149 for (iosr = 1; iosr <= DFSDM_MAX_INT_OVERSAMPLING; iosr++) {149150 if (fast)···194193 }195194 }196195197197- if (!fl->fosr)196196+ if (!fl->res)198197 return -EINVAL;199198200199 return 0;···771770 struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);772771 struct stm32_dfsdm_filter *fl = &adc->dfsdm->fl_list[adc->fl_id];773772 struct stm32_dfsdm_channel *ch = &adc->dfsdm->ch_list[chan->channel];774774- unsigned int spi_freq = adc->spi_freq;773773+ unsigned int spi_freq;775774 int ret = -EINVAL;776775777776 switch (mask) {···785784 case IIO_CHAN_INFO_SAMP_FREQ:786785 if (!val)787786 return -EINVAL;788788- if (ch->src != DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL)787787+788788+ switch (ch->src) {789789+ case DFSDM_CHANNEL_SPI_CLOCK_INTERNAL:789790 spi_freq = adc->dfsdm->spi_master_freq;791791+ break;792792+ case DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_FALLING:793793+ case DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_RISING:794794+ spi_freq = adc->dfsdm->spi_master_freq / 2;795795+ break;796796+ default:797797+ spi_freq = adc->spi_freq;798798+ }790799791800 if (spi_freq % val)792801 dev_warn(&indio_dev->dev,
+1-1
drivers/iio/buffer/industrialio-buffer-dma.c
···587587 * Should be used as the set_length callback for iio_buffer_access_ops588588 * struct for DMA buffers.589589 */590590-int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length)590590+int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length)591591{592592 /* Avoid an invalid state */593593 if (length < 2)
+9-2
drivers/iio/buffer/kfifo_buf.c
···2222#define iio_to_kfifo(r) container_of(r, struct iio_kfifo, buffer)23232424static inline int __iio_allocate_kfifo(struct iio_kfifo *buf,2525- int bytes_per_datum, int length)2525+ size_t bytes_per_datum, unsigned int length)2626{2727 if ((length == 0) || (bytes_per_datum == 0))2828+ return -EINVAL;2929+3030+ /*3131+ * Make sure we don't overflow an unsigned int after kfifo rounds up to3232+ * the next power of 2.3333+ */3434+ if (roundup_pow_of_two(length) > UINT_MAX / bytes_per_datum)2835 return -EINVAL;29363037 return __kfifo_alloc((struct __kfifo *)&buf->kf, length,···7467 return 0;7568}76697777-static int iio_set_length_kfifo(struct iio_buffer *r, int length)7070+static int iio_set_length_kfifo(struct iio_buffer *r, unsigned int length)7871{7972 /* Avoid an invalid state */8073 if (length < 2)
···44334433 NL_SET_ERR_MSG_MOD(extack, "Can not put a VLAN on an OVS port");44344434 return -EINVAL;44354435 }44364436+ if (is_vlan_dev(upper_dev) &&44374437+ vlan_dev_vlan_id(upper_dev) == 1) {44384438+ NL_SET_ERR_MSG_MOD(extack, "Creating a VLAN device with VID 1 is unsupported: VLAN 1 carries untagged traffic");44394439+ return -EINVAL;44404440+ }44364441 break;44374442 case NETDEV_CHANGEUPPER:44384443 upper_dev = info->upper_dev;
+1-1
drivers/net/ethernet/natsemi/sonic.c
···8484 for (i = 0; i < SONIC_NUM_RRS; i++) {8585 dma_addr_t laddr = dma_map_single(lp->device, skb_put(lp->rx_skb[i], SONIC_RBSIZE),8686 SONIC_RBSIZE, DMA_FROM_DEVICE);8787- if (!laddr) {8787+ if (dma_mapping_error(lp->device, laddr)) {8888 while(i > 0) { /* free any that were mapped successfully */8989 i--;9090 dma_unmap_single(lp->device, lp->rx_laddr[i], SONIC_RBSIZE, DMA_FROM_DEVICE);
+2-2
drivers/net/ethernet/socionext/netsec.c
···16741674 if (ret)16751675 goto unreg_napi;1676167616771677- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)))16781678- dev_warn(&pdev->dev, "Failed to enable 64-bit DMA\n");16771677+ if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(40)))16781678+ dev_warn(&pdev->dev, "Failed to set DMA mask\n");1679167916801680 ret = register_netdev(ndev);16811681 if (ret) {
···15901590 struct iwl_trans *trans)15911591{15921592 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);15931593- int max_irqs, num_irqs, i, ret, nr_online_cpus;15931593+ int max_irqs, num_irqs, i, ret;15941594 u16 pci_cmd;1595159515961596 if (!trans->cfg->mq_rx_supported)15971597 goto enable_msi;1598159815991599- nr_online_cpus = num_online_cpus();16001600- max_irqs = min_t(u32, nr_online_cpus + 2, IWL_MAX_RX_HW_QUEUES);15991599+ max_irqs = min_t(u32, num_online_cpus() + 2, IWL_MAX_RX_HW_QUEUES);16011600 for (i = 0; i < max_irqs; i++)16021601 trans_pcie->msix_entries[i].entry = i;16031602···16221623 * Two interrupts less: non rx causes shared with FBQ and RSS.16231624 * More than two interrupts: we will use fewer RSS queues.16241625 */16251625- if (num_irqs <= nr_online_cpus) {16261626+ if (num_irqs <= max_irqs - 2) {16261627 trans_pcie->trans->num_rx_queues = num_irqs + 1;16271628 trans_pcie->shared_vec_mask = IWL_SHARED_IRQ_NON_RX |16281629 IWL_SHARED_IRQ_FIRST_RSS;16291629- } else if (num_irqs == nr_online_cpus + 1) {16301630+ } else if (num_irqs == max_irqs - 1) {16301631 trans_pcie->trans->num_rx_queues = num_irqs;16311632 trans_pcie->shared_vec_mask = IWL_SHARED_IRQ_NON_RX;16321633 } else {16331634 trans_pcie->trans->num_rx_queues = num_irqs - 1;16341635 }16361636+ WARN_ON(trans_pcie->trans->num_rx_queues > IWL_MAX_RX_HW_QUEUES);1635163716361638 trans_pcie->alloc_vecs = num_irqs;16371639 trans_pcie->msix_enabled = true;
+3-4
drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
···372372373373 /*374374 * Determine IFS values375375- * - Use TXOP_BACKOFF for probe and management frames except beacons375375+ * - Use TXOP_BACKOFF for management frames except beacons376376 * - Use TXOP_SIFS for fragment bursts377377 * - Use TXOP_HTTXOP for everything else378378 *379379 * Note: rt2800 devices won't use CTS protection (if used)380380 * for frames not transmitted with TXOP_HTTXOP381381 */382382- if ((ieee80211_is_mgmt(hdr->frame_control) &&383383- !ieee80211_is_beacon(hdr->frame_control)) ||384384- (tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE))382382+ if (ieee80211_is_mgmt(hdr->frame_control) &&383383+ !ieee80211_is_beacon(hdr->frame_control))385384 txdesc->u.ht.txop = TXOP_BACKOFF;386385 else if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT))387386 txdesc->u.ht.txop = TXOP_SIFS;
+1-1
drivers/nvme/host/Kconfig
···27272828config NVME_RDMA2929 tristate "NVM Express over Fabrics RDMA host driver"3030- depends on INFINIBAND_ADDR_TRANS && BLOCK3030+ depends on INFINIBAND && INFINIBAND_ADDR_TRANS && BLOCK3131 select NVME_CORE3232 select NVME_FABRICS3333 select SG_POOL
···27272828config NVME_TARGET_RDMA2929 tristate "NVMe over Fabrics RDMA target support"3030- depends on INFINIBAND_ADDR_TRANS3030+ depends on INFINIBAND && INFINIBAND_ADDR_TRANS3131 depends on NVME_TARGET3232 select SGL_ALLOC3333 help
+13-10
drivers/platform/x86/asus-wmi.c
···163163164164static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };165165166166+static bool ashs_present(void)167167+{168168+ int i = 0;169169+ while (ashs_ids[i]) {170170+ if (acpi_dev_found(ashs_ids[i++]))171171+ return true;172172+ }173173+ return false;174174+}175175+166176struct bios_args {167177 u32 arg0;168178 u32 arg1;···1035102510361026static void asus_wmi_rfkill_exit(struct asus_wmi *asus)10371027{10281028+ if (asus->driver->wlan_ctrl_by_user && ashs_present())10291029+ return;10301030+10381031 asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P5");10391032 asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P6");10401033 asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P7");···2132211921332120 pr_info("Number of fans: %d\n", asus->asus_hwmon_num_fans);21342121 return 0;21352135-}21362136-21372137-static bool ashs_present(void)21382138-{21392139- int i = 0;21402140- while (ashs_ids[i]) {21412141- if (acpi_dev_found(ashs_ids[i++]))21422142- return true;21432143- }21442144- return false;21452122}2146212321472124/*
···3030 struct clk *gphy_clk_gate;3131 struct reset_control *gphy_reset;3232 struct reset_control *gphy_reset2;3333- struct notifier_block gphy_reboot_nb;3433 void __iomem *membase;3534 char *fw_name;3635};···6263 {},6364};6465MODULE_DEVICE_TABLE(of, xway_gphy_match);6565-6666-static struct xway_gphy_priv *to_xway_gphy_priv(struct notifier_block *nb)6767-{6868- return container_of(nb, struct xway_gphy_priv, gphy_reboot_nb);6969-}7070-7171-static int xway_gphy_reboot_notify(struct notifier_block *reboot_nb,7272- unsigned long code, void *unused)7373-{7474- struct xway_gphy_priv *priv = to_xway_gphy_priv(reboot_nb);7575-7676- if (priv) {7777- reset_control_assert(priv->gphy_reset);7878- reset_control_assert(priv->gphy_reset2);7979- }8080-8181- return NOTIFY_DONE;8282-}83668467static int xway_gphy_load(struct device *dev, struct xway_gphy_priv *priv,8568 dma_addr_t *dev_addr)···186205 reset_control_deassert(priv->gphy_reset);187206 reset_control_deassert(priv->gphy_reset2);188207189189- /* assert the gphy reset because it can hang after a reboot: */190190- priv->gphy_reboot_nb.notifier_call = xway_gphy_reboot_notify;191191- priv->gphy_reboot_nb.priority = -1;192192-193193- ret = register_reboot_notifier(&priv->gphy_reboot_nb);194194- if (ret)195195- dev_warn(dev, "Failed to register reboot notifier\n");196196-197208 platform_set_drvdata(pdev, priv);198209199210 return ret;···193220194221static int xway_gphy_remove(struct platform_device *pdev)195222{196196- struct device *dev = &pdev->dev;197223 struct xway_gphy_priv *priv = platform_get_drvdata(pdev);198198- int ret;199199-200200- reset_control_assert(priv->gphy_reset);201201- reset_control_assert(priv->gphy_reset2);202224203225 iowrite32be(0, priv->membase);204226205227 clk_disable_unprepare(priv->gphy_clk_gate);206206-207207- ret = unregister_reboot_notifier(&priv->gphy_reboot_nb);208208- if (ret)209209- dev_warn(dev, "Failed to unregister reboot notifier\n");210228211229 return 0;212230}
+1-1
drivers/staging/lustre/lnet/Kconfig
···34343535config LNET_XPRT_IB3636 tristate "LNET infiniband support"3737- depends on LNET && PCI && INFINIBAND_ADDR_TRANS3737+ depends on LNET && PCI && INFINIBAND && INFINIBAND_ADDR_TRANS3838 default LNET && INFINIBAND3939 help4040 This option allows the LNET users to use infiniband as an
···404404{405405 unsigned long pfn = 0;406406 long ret, pinned = 0, lock_acct = 0;407407+ bool rsvd;407408 dma_addr_t iova = vaddr - dma->vaddr + dma->iova;408409409410 /* This code path is only user initiated */···415414 if (ret)416415 return ret;417416418418- if (is_invalid_reserved_pfn(*pfn_base)) {419419- struct vm_area_struct *vma;420420-421421- down_read(¤t->mm->mmap_sem);422422- vma = find_vma_intersection(current->mm, vaddr, vaddr + 1);423423- pinned = min_t(long, npage, vma_pages(vma));424424- up_read(¤t->mm->mmap_sem);425425- return pinned;426426- }427427-428417 pinned++;418418+ rsvd = is_invalid_reserved_pfn(*pfn_base);429419430420 /*431421 * Reserved pages aren't counted against the user, externally pinned432422 * pages are already counted against the user.433423 */434434- if (!vfio_find_vpfn(dma, iova)) {424424+ if (!rsvd && !vfio_find_vpfn(dma, iova)) {435425 if (!lock_cap && current->mm->locked_vm + 1 > limit) {436426 put_pfn(*pfn_base, dma->prot);437427 pr_warn("%s: RLIMIT_MEMLOCK (%ld) exceeded\n", __func__,···442450 if (ret)443451 break;444452445445- if (pfn != *pfn_base + pinned) {453453+ if (pfn != *pfn_base + pinned ||454454+ rsvd != is_invalid_reserved_pfn(pfn)) {446455 put_pfn(pfn, dma->prot);447456 break;448457 }449458450450- if (!vfio_find_vpfn(dma, iova)) {459459+ if (!rsvd && !vfio_find_vpfn(dma, iova)) {451460 if (!lock_cap &&452461 current->mm->locked_vm + lock_acct + 1 > limit) {453462 put_pfn(pfn, dma->prot);···466473467474unpin_out:468475 if (ret) {469469- for (pfn = *pfn_base ; pinned ; pfn++, pinned--)470470- put_pfn(pfn, dma->prot);476476+ if (!rsvd) {477477+ for (pfn = *pfn_base ; pinned ; pfn++, pinned--)478478+ put_pfn(pfn, dma->prot);479479+ }471480472481 return ret;473482 }
+24-13
drivers/vhost/net.c
···105105 /* vhost zerocopy support fields below: */106106 /* last used idx for outstanding DMA zerocopy buffers */107107 int upend_idx;108108- /* first used idx for DMA done zerocopy buffers */108108+ /* For TX, first used idx for DMA done zerocopy buffers109109+ * For RX, number of batched heads110110+ */109111 int done_idx;110112 /* an array of userspace buffers info */111113 struct ubuf_info *ubuf_info;···628626 return skb_queue_empty(&sk->sk_receive_queue);629627}630628629629+static void vhost_rx_signal_used(struct vhost_net_virtqueue *nvq)630630+{631631+ struct vhost_virtqueue *vq = &nvq->vq;632632+ struct vhost_dev *dev = vq->dev;633633+634634+ if (!nvq->done_idx)635635+ return;636636+637637+ vhost_add_used_and_signal_n(dev, vq, vq->heads, nvq->done_idx);638638+ nvq->done_idx = 0;639639+}640640+631641static int vhost_net_rx_peek_head_len(struct vhost_net *net, struct sock *sk)632642{633643 struct vhost_net_virtqueue *rvq = &net->vqs[VHOST_NET_VQ_RX];···649635 int len = peek_head_len(rvq, sk);650636651637 if (!len && vq->busyloop_timeout) {638638+ /* Flush batched heads first */639639+ vhost_rx_signal_used(rvq);652640 /* Both tx vq and rx socket were polled here */653641 mutex_lock_nested(&vq->mutex, 1);654642 vhost_disable_notify(&net->dev, vq);···778762 };779763 size_t total_len = 0;780764 int err, mergeable;781781- s16 headcount, nheads = 0;765765+ s16 headcount;782766 size_t vhost_hlen, sock_hlen;783767 size_t vhost_len, sock_len;784768 struct socket *sock;···806790 while ((sock_len = vhost_net_rx_peek_head_len(net, sock->sk))) {807791 sock_len += sock_hlen;808792 vhost_len = sock_len + vhost_hlen;809809- headcount = get_rx_bufs(vq, vq->heads + nheads, vhost_len,810810- &in, vq_log, &log,793793+ headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx,794794+ vhost_len, &in, vq_log, &log,811795 likely(mergeable) ? UIO_MAXIOV : 1);812796 /* On error, stop handling until the next kick. */813797 if (unlikely(headcount < 0))···878862 vhost_discard_vq_desc(vq, headcount);879863 goto out;880864 }881881- nheads += headcount;882882- if (nheads > VHOST_RX_BATCH) {883883- vhost_add_used_and_signal_n(&net->dev, vq, vq->heads,884884- nheads);885885- nheads = 0;886886- }865865+ nvq->done_idx += headcount;866866+ if (nvq->done_idx > VHOST_RX_BATCH)867867+ vhost_rx_signal_used(nvq);887868 if (unlikely(vq_log))888869 vhost_log_write(vq, vq_log, log, vhost_len);889870 total_len += vhost_len;···891878 }892879 vhost_net_enable_vq(net, vq);893880out:894894- if (nheads)895895- vhost_add_used_and_signal_n(&net->dev, vq, vq->heads,896896- nheads);881881+ vhost_rx_signal_used(nvq);897882 mutex_unlock(&vq->mutex);898883}899884
+3-7
fs/afs/security.c
···372372 mask, access, S_ISDIR(inode->i_mode) ? "dir" : "file");373373374374 if (S_ISDIR(inode->i_mode)) {375375- if (mask & MAY_EXEC) {375375+ if (mask & (MAY_EXEC | MAY_READ | MAY_CHDIR)) {376376 if (!(access & AFS_ACE_LOOKUP))377377 goto permission_denied;378378- } else if (mask & MAY_READ) {379379- if (!(access & AFS_ACE_LOOKUP))380380- goto permission_denied;381381- } else if (mask & MAY_WRITE) {378378+ }379379+ if (mask & MAY_WRITE) {382380 if (!(access & (AFS_ACE_DELETE | /* rmdir, unlink, rename from */383381 AFS_ACE_INSERT))) /* create, mkdir, symlink, rename to */384382 goto permission_denied;385385- } else {386386- BUG();387383 }388384 } else {389385 if (!(access & AFS_ACE_LOOKUP))
+10-9
fs/afs/vlclient.c
···2323 struct afs_uvldbentry__xdr *uvldb;2424 struct afs_vldb_entry *entry;2525 bool new_only = false;2626- u32 tmp, nr_servers;2626+ u32 tmp, nr_servers, vlflags;2727 int i, ret;28282929 _enter("");···5555 new_only = true;5656 }57575858+ vlflags = ntohl(uvldb->flags);5859 for (i = 0; i < nr_servers; i++) {5960 struct afs_uuid__xdr *xdr;6061 struct afs_uuid *uuid;···6564 if (tmp & AFS_VLSF_DONTUSE ||6665 (new_only && !(tmp & AFS_VLSF_NEWREPSITE)))6766 continue;6868- if (tmp & AFS_VLSF_RWVOL)6767+ if (tmp & AFS_VLSF_RWVOL) {6968 entry->fs_mask[i] |= AFS_VOL_VTM_RW;6969+ if (vlflags & AFS_VLF_BACKEXISTS)7070+ entry->fs_mask[i] |= AFS_VOL_VTM_BAK;7171+ }7072 if (tmp & AFS_VLSF_ROVOL)7173 entry->fs_mask[i] |= AFS_VOL_VTM_RO;7272- if (tmp & AFS_VLSF_BACKVOL)7373- entry->fs_mask[i] |= AFS_VOL_VTM_BAK;7474 if (!entry->fs_mask[i])7575 continue;7676···9189 for (i = 0; i < AFS_MAXTYPES; i++)9290 entry->vid[i] = ntohl(uvldb->volumeId[i]);93919494- tmp = ntohl(uvldb->flags);9595- if (tmp & AFS_VLF_RWEXISTS)9292+ if (vlflags & AFS_VLF_RWEXISTS)9693 __set_bit(AFS_VLDB_HAS_RW, &entry->flags);9797- if (tmp & AFS_VLF_ROEXISTS)9494+ if (vlflags & AFS_VLF_ROEXISTS)9895 __set_bit(AFS_VLDB_HAS_RO, &entry->flags);9999- if (tmp & AFS_VLF_BACKEXISTS)9696+ if (vlflags & AFS_VLF_BACKEXISTS)10097 __set_bit(AFS_VLDB_HAS_BAK, &entry->flags);10198102102- if (!(tmp & (AFS_VLF_RWEXISTS | AFS_VLF_ROEXISTS | AFS_VLF_BACKEXISTS))) {9999+ if (!(vlflags & (AFS_VLF_RWEXISTS | AFS_VLF_ROEXISTS | AFS_VLF_BACKEXISTS))) {103100 entry->error = -ENOMEDIUM;104101 __set_bit(AFS_VLDB_QUERY_ERROR, &entry->flags);105102 }
+1-1
fs/cifs/Kconfig
···197197198198config CIFS_SMB_DIRECT199199 bool "SMB Direct support (Experimental)"200200- depends on CIFS=m && INFINIBAND_ADDR_TRANS || CIFS=y && INFINIBAND_ADDR_TRANS=y200200+ depends on CIFS=m && INFINIBAND && INFINIBAND_ADDR_TRANS || CIFS=y && INFINIBAND=y && INFINIBAND_ADDR_TRANS=y201201 help202202 Enables SMB Direct experimental support for SMB 3.0, 3.02 and 3.1.1.203203 SMB Direct allows transferring SMB packets over RDMA. If unsure,
···5353 int (*request_update)(struct iio_buffer *buffer);54545555 int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd);5656- int (*set_length)(struct iio_buffer *buffer, int length);5656+ int (*set_length)(struct iio_buffer *buffer, unsigned int length);57575858 int (*enable)(struct iio_buffer *buffer, struct iio_dev *indio_dev);5959 int (*disable)(struct iio_buffer *buffer, struct iio_dev *indio_dev);···7272 */7373struct iio_buffer {7474 /** @length: Number of datums in buffer. */7575- int length;7575+ unsigned int length;76767777 /** @bytes_per_datum: Size of individual datum including timestamp. */7878- int bytes_per_datum;7878+ size_t bytes_per_datum;79798080 /**8181 * @access: Buffer access functions associated with the
···983983}984984985985/*986986- * See rt task throttoling, which is the only time a skip986986+ * See rt task throttling, which is the only time a skip987987 * request is cancelled.988988 */989989static inline void rq_clock_cancel_skipupdate(struct rq *rq)
+6-6
kernel/trace/trace.c
···893893EXPORT_SYMBOL_GPL(__trace_bputs);894894895895#ifdef CONFIG_TRACER_SNAPSHOT896896-static void tracing_snapshot_instance(struct trace_array *tr)896896+void tracing_snapshot_instance(struct trace_array *tr)897897{898898 struct tracer *tracer = tr->current_trace;899899 unsigned long flags;···949949 struct trace_buffer *size_buf, int cpu_id);950950static void set_buffer_entries(struct trace_buffer *buf, unsigned long val);951951952952-static int alloc_snapshot(struct trace_array *tr)952952+int tracing_alloc_snapshot_instance(struct trace_array *tr)953953{954954 int ret;955955···995995 struct trace_array *tr = &global_trace;996996 int ret;997997998998- ret = alloc_snapshot(tr);998998+ ret = tracing_alloc_snapshot_instance(tr);999999 WARN_ON(ret < 0);1000100010011001 return ret;···5408540854095409#ifdef CONFIG_TRACER_MAX_TRACE54105410 if (t->use_max_tr && !had_max_tr) {54115411- ret = alloc_snapshot(tr);54115411+ ret = tracing_alloc_snapshot_instance(tr);54125412 if (ret < 0)54135413 goto out;54145414 }···64516451 }64526452#endif64536453 if (!tr->allocated_snapshot) {64546454- ret = alloc_snapshot(tr);64546454+ ret = tracing_alloc_snapshot_instance(tr);64556455 if (ret < 0)64566456 break;64576457 }···71797179 return ret;7180718071817181 out_reg:71827182- ret = alloc_snapshot(tr);71827182+ ret = tracing_alloc_snapshot_instance(tr);71837183 if (ret < 0)71847184 goto out;71857185
···24312431 __split_huge_page_tail(head, i, lruvec, list);24322432 /* Some pages can be beyond i_size: drop them from page cache */24332433 if (head[i].index >= end) {24342434- __ClearPageDirty(head + i);24342434+ ClearPageDirty(head + i);24352435 __delete_from_page_cache(head + i, NULL);24362436 if (IS_ENABLED(CONFIG_SHMEM) && PageSwapBacked(head))24372437 shmem_uncharge(head->mapping->host, 1);
···323233333434config NET_9P_RDMA3535- depends on INET && INFINIBAND_ADDR_TRANS3535+ depends on INET && INFINIBAND && INFINIBAND_ADDR_TRANS3636 tristate "9P RDMA Transport (Experimental)"3737 help3838 This builds support for an RDMA transport.
+2-1
net/bridge/netfilter/ebtables.c
···19541954 int off, pad = 0;19551955 unsigned int size_kern, match_size = mwt->match_size;1956195619571957- strlcpy(name, mwt->u.name, sizeof(name));19571957+ if (strscpy(name, mwt->u.name, sizeof(name)) < 0)19581958+ return -EINVAL;1958195919591960 if (state->buf_kern_start)19601961 dst = state->buf_kern_start + state->buf_kern_offset;
···8899config RDS_RDMA1010 tristate "RDS over Infiniband"1111- depends on RDS && INFINIBAND_ADDR_TRANS1111+ depends on RDS && INFINIBAND && INFINIBAND_ADDR_TRANS1212 ---help---1313 Allow RDS to use Infiniband as a transport.1414 This transport supports RDMA operations.
+1-1
net/sched/cls_flower.c
···977977 return 0;978978979979errout_idr:980980- if (fnew->handle)980980+ if (!fold)981981 idr_remove(&head->handle_idr, fnew->handle);982982errout:983983 tcf_exts_destroy(&fnew->exts);
+1-1
net/sunrpc/Kconfig
···50505151config SUNRPC_XPRT_RDMA5252 tristate "RPC-over-RDMA transport"5353- depends on SUNRPC && INFINIBAND_ADDR_TRANS5353+ depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS5454 default SUNRPC && INFINIBAND5555 select SG_POOL5656 help
···111111A structure defining the number of CPUs.112112113113struct nr_cpus {114114- uint32_t nr_cpus_online;115114 uint32_t nr_cpus_available; /* CPUs not yet onlined */115115+ uint32_t nr_cpus_online;116116};117117118118 HEADER_CPUDESC = 8,···153153 HEADER_CPU_TOPOLOGY = 13,154154155155String lists defining the core and CPU threads topology.156156+The string lists are followed by a variable length array157157+which contains core_id and socket_id of each cpu.158158+The number of entries can be determined by the size of the159159+section minus the sizes of both string lists.156160157161struct {158162 struct perf_header_string_list cores; /* Variable length */159163 struct perf_header_string_list threads; /* Variable length */164164+ struct {165165+ uint32_t core_id;166166+ uint32_t socket_id;167167+ } cpus[nr]; /* Variable length records */160168};161169162170Example:
+24-6
tools/perf/tests/topology.c
···7070 session = perf_session__new(&data, false, NULL);7171 TEST_ASSERT_VAL("can't get session", session);72727373+ /* On platforms with large numbers of CPUs process_cpu_topology()7474+ * might issue an error while reading the perf.data file section7575+ * HEADER_CPU_TOPOLOGY and the cpu_topology_map pointed to by member7676+ * cpu is a NULL pointer.7777+ * Example: On s3907878+ * CPU 0 is on core_id 0 and physical_package_id 67979+ * CPU 1 is on core_id 1 and physical_package_id 38080+ *8181+ * Core_id and physical_package_id are platform and architecture8282+ * dependend and might have higher numbers than the CPU id.8383+ * This actually depends on the configuration.8484+ *8585+ * In this case process_cpu_topology() prints error message:8686+ * "socket_id number is too big. You may need to upgrade the8787+ * perf tool."8888+ *8989+ * This is the reason why this test might be skipped.9090+ */9191+ if (!session->header.env.cpu)9292+ return TEST_SKIP;9393+7394 for (i = 0; i < session->header.env.nr_cpus_avail; i++) {7495 if (!cpu_map__has(map, i))7596 continue;···11695{11796 char path[PATH_MAX];11897 struct cpu_map *map;119119- int ret = -1;9898+ int ret = TEST_FAIL;12099121100 TEST_ASSERT_VAL("can't get templ file", !get_temp(path));122101···131110 goto free_path;132111 }133112134134- if (check_cpu_topology(path, map))135135- goto free_map;136136- ret = 0;137137-138138-free_map:113113+ ret = check_cpu_topology(path, map);139114 cpu_map__put(map);115115+140116free_path:141117 unlink(path);142118 return ret;
···9696 /* Nothing to do, might as well just return */9797 if (decoder->packet_count == 0)9898 return 0;9999+ /*100100+ * The queueing process in function cs_etm_decoder__buffer_packet()101101+ * increments the tail *before* using it. This is somewhat counter102102+ * intuitive but it has the advantage of centralizing tail management103103+ * at a single location. Because of that we need to follow the same104104+ * heuristic with the head, i.e we increment it before using its105105+ * value. Otherwise the first element of the packet queue is not106106+ * used.107107+ */108108+ decoder->head = (decoder->head + 1) & (MAX_BUFFER - 1);99109100110 *packet = decoder->packet_buffer[decoder->head];101101-102102- decoder->head = (decoder->head + 1) & (MAX_BUFFER - 1);103111104112 decoder->packet_count--;105113
+18
tools/perf/util/intel-pt-decoder/insn.h
···208208 return insn_offset_displacement(insn) + insn->displacement.nbytes;209209}210210211211+#define POP_SS_OPCODE 0x1f212212+#define MOV_SREG_OPCODE 0x8e213213+214214+/*215215+ * Intel SDM Vol.3A 6.8.3 states;216216+ * "Any single-step trap that would be delivered following the MOV to SS217217+ * instruction or POP to SS instruction (because EFLAGS.TF is 1) is218218+ * suppressed."219219+ * This function returns true if @insn is MOV SS or POP SS. On these220220+ * instructions, single stepping is suppressed.221221+ */222222+static inline int insn_masking_exception(struct insn *insn)223223+{224224+ return insn->opcode.bytes[0] == POP_SS_OPCODE ||225225+ (insn->opcode.bytes[0] == MOV_SREG_OPCODE &&226226+ X86_MODRM_REG(insn->modrm.bytes[0]) == 2);227227+}228228+211229#endif /* _ASM_X86_INSN_H */