Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4883a60
mtd: rawnand: gpmi: fix dst bit offset when extracting raw payload
sknsean Dec 21, 2020
0b2894c
scsi: docs: ABI: sysfs-driver-ufs: Add DeepSleep power mode
ahunter6 Jan 4, 2021
b112036
scsi: megaraid_sas: Fix MEGASAS_IOC_FIRMWARE regression
arndb Jan 4, 2021
5e6ddad
scsi: ufs: ufshcd-pltfrm depends on HAS_IOMEM
rddunlap Jan 6, 2021
901d01c
scsi: ibmvfc: Fix missing cast of ibmvfc_event pointer to u64 handle
tyreld Jan 6, 2021
4ee7ee5
scsi: ufs: Fix livelock of ufshcd_clear_ua_wluns()
Jan 7, 2021
eeb1b55
scsi: ufs: Fix tm request when non-fatal error happens
Jan 7, 2021
27b7c6e
i2c: tegra: Wait for config load atomically while in ISR
cyndis Jan 11, 2021
f2cb4b2
scsi: docs: ABI: sysfs-driver-ufs: Rectify table formatting
bulwahn Jan 11, 2021
72eeb7c
scsi: scsi_transport_srp: Don't block target in failfast state
mwilck Jan 11, 2021
b2b0f16
scsi: libfc: Avoid invoking response handler twice if ep is already c…
javed-h Dec 15, 2020
d6e3ae7
scsi: fnic: Fix memleak in vnic_dev_init_devcmd2
dinghaoliu Dec 25, 2020
3c97be6
mtd: rawnand: nandsim: Fix the logic when selecting Hamming soft ECC …
miquelraynal Jan 4, 2021
18f6261
mtd: rawnand: intel: check the mtd name only after setting the variable
xdarklight Jan 6, 2021
e708789
mtd: spinand: Fix MTD_OPS_AUTO_OOB requests
miquelraynal Jan 7, 2021
780e138
scsi: target: tcmu: Fix use-after-free of se_cmd->priv
kawasaki Jan 13, 2021
7649072
scsi: ibmvfc: Set default timeout to avoid crash during migration
bjking1 Jan 12, 2021
ebfd448
kunit: tool: Fix spelling of "diagnostic" in kunit_parser
sulix Dec 11, 2020
8db50be
Documentation: kunit: include example of a parameterized test
dlatypov Dec 16, 2020
09641f7
kunit: tool: surface and address more typing issues
dlatypov Jan 15, 2021
81c6030
kunit: tool: fix minor typing issue with None status
dlatypov Jan 15, 2021
2b8fdbb
kunit: tool: move kunitconfig parsing into __init__, make it optional
dlatypov Jan 15, 2021
bc1c204
i2c: bpmp-tegra: Ignore unknown I2C_M flags
cyndis Jan 12, 2021
2f3a082
i2c: tegra: Create i2c_writesl_vi() to use with VI I2C for filling TX…
Jan 12, 2021
1b2cfa2
i2c: octeon: check correct size of maximum RECV_LEN packet
Jan 9, 2021
b135b33
mtd: rawnand: omap: Use BCH private fields in the specific OOB layout
miquelraynal Jan 19, 2021
a416634
Revert "i2c: imx: Remove unused .id_table support"
fabioestevam Jan 20, 2021
9ecd1d2
i2c: sprd: depend on COMMON_CLK to fix compile tests
krzk Jan 17, 2021
929b979
Merge tag 'linux-kselftest-kunit-fixes-5.11-rc5' of git://git.kernel.…
torvalds Jan 23, 2021
15cfb0f
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…
torvalds Jan 23, 2021
077e81d
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/…
torvalds Jan 23, 2021
e1ae4b0
Merge branch 'mtd/fixes' of git://git.kernel.org/pub/scm/linux/kernel…
torvalds Jan 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions Documentation/ABI/testing/sysfs-driver-ufs
Original file line number Diff line number Diff line change
Expand Up @@ -916,21 +916,25 @@ Date: September 2014
Contact: Subhash Jadavani <subhashj@codeaurora.org>
Description: This entry could be used to set or show the UFS device
runtime power management level. The current driver
implementation supports 6 levels with next target states:
implementation supports 7 levels with next target states:

== ====================================================
0 an UFS device will stay active, an UIC link will
0 UFS device will stay active, UIC link will
stay active
1 an UFS device will stay active, an UIC link will
1 UFS device will stay active, UIC link will
hibernate
2 an UFS device will moved to sleep, an UIC link will
2 UFS device will be moved to sleep, UIC link will
stay active
3 an UFS device will moved to sleep, an UIC link will
3 UFS device will be moved to sleep, UIC link will
hibernate
4 an UFS device will be powered off, an UIC link will
4 UFS device will be powered off, UIC link will
hibernate
5 an UFS device will be powered off, an UIC link will
5 UFS device will be powered off, UIC link will
be powered off
6 UFS device will be moved to deep sleep, UIC link
will be powered off. Note, deep sleep might not be
supported in which case this value will not be
accepted
== ====================================================

What: /sys/bus/platform/drivers/ufshcd/*/rpm_target_dev_state
Expand All @@ -954,21 +958,25 @@ Date: September 2014
Contact: Subhash Jadavani <subhashj@codeaurora.org>
Description: This entry could be used to set or show the UFS device
system power management level. The current driver
implementation supports 6 levels with next target states:
implementation supports 7 levels with next target states:

== ====================================================
0 an UFS device will stay active, an UIC link will
0 UFS device will stay active, UIC link will
stay active
1 an UFS device will stay active, an UIC link will
1 UFS device will stay active, UIC link will
hibernate
2 an UFS device will moved to sleep, an UIC link will
2 UFS device will be moved to sleep, UIC link will
stay active
3 an UFS device will moved to sleep, an UIC link will
3 UFS device will be moved to sleep, UIC link will
hibernate
4 an UFS device will be powered off, an UIC link will
4 UFS device will be powered off, UIC link will
hibernate
5 an UFS device will be powered off, an UIC link will
5 UFS device will be powered off, UIC link will
be powered off
6 UFS device will be moved to deep sleep, UIC link
will be powered off. Note, deep sleep might not be
supported in which case this value will not be
accepted
== ====================================================

What: /sys/bus/platform/drivers/ufshcd/*/spm_target_dev_state
Expand Down
57 changes: 57 additions & 0 deletions Documentation/dev-tools/kunit/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,63 @@ There's more boilerplate involved, but it can:
* E.g. if we wanted to also test ``sha256sum``, we could add a ``sha256``
field and reuse ``cases``.

* be converted to a "parameterized test", see below.

Parameterized Testing
~~~~~~~~~~~~~~~~~~~~~

The table-driven testing pattern is common enough that KUnit has special
support for it.

Reusing the same ``cases`` array from above, we can write the test as a
"parameterized test" with the following.

.. code-block:: c

// This is copy-pasted from above.
struct sha1_test_case {
const char *str;
const char *sha1;
};
struct sha1_test_case cases[] = {
{
.str = "hello world",
.sha1 = "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed",
},
{
.str = "hello world!",
.sha1 = "430ce34d020724ed75a196dfc2ad67c77772d169",
},
};

// Need a helper function to generate a name for each test case.
static void case_to_desc(const struct sha1_test_case *t, char *desc)
{
strcpy(desc, t->str);
}
// Creates `sha1_gen_params()` to iterate over `cases`.
KUNIT_ARRAY_PARAM(sha1, cases, case_to_desc);

// Looks no different from a normal test.
static void sha1_test(struct kunit *test)
{
// This function can just contain the body of the for-loop.
// The former `cases[i]` is accessible under test->param_value.
char out[40];
struct sha1_test_case *test_param = (struct sha1_test_case *)(test->param_value);

sha1sum(test_param->str, out);
KUNIT_EXPECT_STREQ_MSG(test, (char *)out, test_param->sha1,
"sha1sum(%s)", test_param->str);
}

// Instead of KUNIT_CASE, we use KUNIT_CASE_PARAM and pass in the
// function declared by KUNIT_ARRAY_PARAM.
static struct kunit_case sha1_test_cases[] = {
KUNIT_CASE_PARAM(sha1_test, sha1_gen_params),
{}
};

.. _kunit-on-non-uml:

KUnit on non-UML architectures
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ config I2C_SIRF
config I2C_SPRD
tristate "Spreadtrum I2C interface"
depends on I2C=y && (ARCH_SPRD || COMPILE_TEST)
depends on COMMON_CLK
help
If you say yes to this option, support will be included for the
Spreadtrum I2C interface.
Expand Down
20 changes: 19 additions & 1 deletion drivers/i2c/busses/i2c-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,19 @@ static struct imx_i2c_hwdata vf610_i2c_hwdata = {

};

static const struct platform_device_id imx_i2c_devtype[] = {
{
.name = "imx1-i2c",
.driver_data = (kernel_ulong_t)&imx1_i2c_hwdata,
}, {
.name = "imx21-i2c",
.driver_data = (kernel_ulong_t)&imx21_i2c_hwdata,
}, {
/* sentinel */
}
};
MODULE_DEVICE_TABLE(platform, imx_i2c_devtype);

static const struct of_device_id i2c_imx_dt_ids[] = {
{ .compatible = "fsl,imx1-i2c", .data = &imx1_i2c_hwdata, },
{ .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, },
Expand Down Expand Up @@ -1330,7 +1343,11 @@ static int i2c_imx_probe(struct platform_device *pdev)
return -ENOMEM;

match = device_get_match_data(&pdev->dev);
i2c_imx->hwdata = match;
if (match)
i2c_imx->hwdata = match;
else
i2c_imx->hwdata = (struct imx_i2c_hwdata *)
platform_get_device_id(pdev)->driver_data;

/* Setup i2c_imx driver structure */
strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
Expand Down Expand Up @@ -1498,6 +1515,7 @@ static struct platform_driver i2c_imx_driver = {
.of_match_table = i2c_imx_dt_ids,
.acpi_match_table = i2c_imx_acpi_ids,
},
.id_table = imx_i2c_devtype,
};

static int __init i2c_adap_imx_init(void)
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-octeon-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target,
if (result)
return result;
if (recv_len && i == 0) {
if (data[i] > I2C_SMBUS_BLOCK_MAX + 1)
if (data[i] > I2C_SMBUS_BLOCK_MAX)
return -EPROTO;
length += data[i];
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-tegra-bpmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static int tegra_bpmp_xlate_flags(u16 flags, u16 *out)
flags &= ~I2C_M_RECV_LEN;
}

return (flags != 0) ? -EINVAL : 0;
return 0;
}

/**
Expand Down
24 changes: 22 additions & 2 deletions drivers/i2c/busses/i2c-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ static void i2c_writel(struct tegra_i2c_dev *i2c_dev, u32 val, unsigned int reg)
/* read back register to make sure that register writes completed */
if (reg != I2C_TX_FIFO)
readl_relaxed(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg));
else if (i2c_dev->is_vi)
readl_relaxed(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, I2C_INT_STATUS));
}

static u32 i2c_readl(struct tegra_i2c_dev *i2c_dev, unsigned int reg)
Expand All @@ -339,6 +341,21 @@ static void i2c_writesl(struct tegra_i2c_dev *i2c_dev, void *data,
writesl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg), data, len);
}

static void i2c_writesl_vi(struct tegra_i2c_dev *i2c_dev, void *data,
unsigned int reg, unsigned int len)
{
u32 *data32 = data;

/*
* VI I2C controller has known hardware bug where writes get stuck
* when immediate multiple writes happen to TX_FIFO register.
* Recommended software work around is to read I2C register after
* each write to TX_FIFO register to flush out the data.
*/
while (len--)
i2c_writel(i2c_dev, *data32++, reg);
}

static void i2c_readsl(struct tegra_i2c_dev *i2c_dev, void *data,
unsigned int reg, unsigned int len)
{
Expand Down Expand Up @@ -533,7 +550,7 @@ static int tegra_i2c_poll_register(struct tegra_i2c_dev *i2c_dev,
void __iomem *addr = i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg);
u32 val;

if (!i2c_dev->atomic_mode)
if (!i2c_dev->atomic_mode && !in_irq())
return readl_relaxed_poll_timeout(addr, val, !(val & mask),
delay_us, timeout_us);

Expand Down Expand Up @@ -811,7 +828,10 @@ static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev)
i2c_dev->msg_buf_remaining = buf_remaining;
i2c_dev->msg_buf = buf + words_to_transfer * BYTES_PER_FIFO_WORD;

i2c_writesl(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer);
if (i2c_dev->is_vi)
i2c_writesl_vi(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer);
else
i2c_writesl(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer);

buf += words_to_transfer * BYTES_PER_FIFO_WORD;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ static int gpmi_ecc_read_page_raw(struct nand_chip *chip, uint8_t *buf,
/* Extract interleaved payload data and ECC bits */
for (step = 0; step < nfc_geo->ecc_chunk_count; step++) {
if (buf)
nand_extract_bits(buf, step * eccsize, tmp_buf,
nand_extract_bits(buf, step * eccsize * 8, tmp_buf,
src_bit_off, eccsize * 8);
src_bit_off += eccsize * 8;

Expand Down
5 changes: 3 additions & 2 deletions drivers/mtd/nand/raw/intel-nand-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ static int ebu_nand_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct ebu_nand_controller *ebu_host;
struct nand_chip *nand;
struct mtd_info *mtd = NULL;
struct mtd_info *mtd;
struct resource *res;
char *resname;
int ret;
Expand Down Expand Up @@ -647,12 +647,13 @@ static int ebu_nand_probe(struct platform_device *pdev)
ebu_host->ebu + EBU_ADDR_SEL(cs));

nand_set_flash_node(&ebu_host->chip, dev->of_node);

mtd = nand_to_mtd(&ebu_host->chip);
if (!mtd->name) {
dev_err(ebu_host->dev, "NAND label property is mandatory\n");
return -EINVAL;
}

mtd = nand_to_mtd(&ebu_host->chip);
mtd->dev.parent = dev;
ebu_host->dev = dev;

Expand Down
7 changes: 3 additions & 4 deletions drivers/mtd/nand/raw/nandsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,9 @@ static int ns_attach_chip(struct nand_chip *chip)
{
unsigned int eccsteps, eccbytes;

chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
chip->ecc.algo = bch ? NAND_ECC_ALGO_BCH : NAND_ECC_ALGO_HAMMING;

if (!bch)
return 0;

Expand All @@ -2233,8 +2236,6 @@ static int ns_attach_chip(struct nand_chip *chip)
return -EINVAL;
}

chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
chip->ecc.algo = NAND_ECC_ALGO_BCH;
chip->ecc.size = 512;
chip->ecc.strength = bch;
chip->ecc.bytes = eccbytes;
Expand Down Expand Up @@ -2273,8 +2274,6 @@ static int __init ns_init_module(void)
nsmtd = nand_to_mtd(chip);
nand_set_controller_data(chip, (void *)ns);

chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
/* The NAND_SKIP_BBTSCAN option is necessary for 'overridesize' */
/* and 'badblocks' parameters to work */
chip->options |= NAND_SKIP_BBTSCAN;
Expand Down
15 changes: 9 additions & 6 deletions drivers/mtd/nand/raw/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/jiffies.h>
#include <linux/sched.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand-ecc-sw-bch.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/omap-dma.h>
Expand Down Expand Up @@ -1866,26 +1867,28 @@ static const struct mtd_ooblayout_ops omap_ooblayout_ops = {
static int omap_sw_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{
struct nand_chip *chip = mtd_to_nand(mtd);
struct nand_device *nand = mtd_to_nanddev(mtd);
const struct nand_ecc_sw_bch_conf *engine_conf = nand->ecc.ctx.priv;
int off = BADBLOCK_MARKER_LENGTH;

if (section >= chip->ecc.steps)
if (section >= engine_conf->nsteps)
return -ERANGE;

/*
* When SW correction is employed, one OMAP specific marker byte is
* reserved after each ECC step.
*/
oobregion->offset = off + (section * (chip->ecc.bytes + 1));
oobregion->length = chip->ecc.bytes;
oobregion->offset = off + (section * (engine_conf->code_size + 1));
oobregion->length = engine_conf->code_size;

return 0;
}

static int omap_sw_ooblayout_free(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{
struct nand_chip *chip = mtd_to_nand(mtd);
struct nand_device *nand = mtd_to_nanddev(mtd);
const struct nand_ecc_sw_bch_conf *engine_conf = nand->ecc.ctx.priv;
int off = BADBLOCK_MARKER_LENGTH;

if (section)
Expand All @@ -1895,7 +1898,7 @@ static int omap_sw_ooblayout_free(struct mtd_info *mtd, int section,
* When SW correction is employed, one OMAP specific marker byte is
* reserved after each ECC step.
*/
off += ((chip->ecc.bytes + 1) * chip->ecc.steps);
off += ((engine_conf->code_size + 1) * engine_conf->nsteps);
if (off >= mtd->oobsize)
return -ERANGE;

Expand Down
14 changes: 11 additions & 3 deletions drivers/mtd/nand/spi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ static int spinand_read_from_cache_op(struct spinand_device *spinand,
const struct nand_page_io_req *req)
{
struct nand_device *nand = spinand_to_nand(spinand);
struct mtd_info *mtd = spinand_to_mtd(spinand);
struct spi_mem_dirmap_desc *rdesc;
unsigned int nbytes = 0;
void *buf = NULL;
Expand Down Expand Up @@ -382,9 +383,16 @@ static int spinand_read_from_cache_op(struct spinand_device *spinand,
memcpy(req->databuf.in, spinand->databuf + req->dataoffs,
req->datalen);

if (req->ooblen)
memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
req->ooblen);
if (req->ooblen) {
if (req->mode == MTD_OPS_AUTO_OOB)
mtd_ooblayout_get_databytes(mtd, req->oobbuf.in,
spinand->oobbuf,
req->ooboffs,
req->ooblen);
else
memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
req->ooblen);
}

return 0;
}
Expand Down
Loading