Skip to content

Commit

Permalink
Automatic merge of 'master' into merge (2023-12-31 22:04)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Dec 31, 2023
2 parents b5aa3d6 + 453f5db commit 414e92a
Show file tree
Hide file tree
Showing 18 changed files with 388 additions and 165 deletions.
14 changes: 11 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9000,12 +9000,9 @@ K: (devm_)?gpio_regmap_(un)?register
GPIO SUBSYSTEM
M: Linus Walleij <linus.walleij@linaro.org>
M: Bartosz Golaszewski <brgl@bgdev.pl>
R: Andy Shevchenko <andy@kernel.org>
L: linux-gpio@vger.kernel.org
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
F: Documentation/ABI/obsolete/sysfs-gpio
F: Documentation/ABI/testing/gpio-cdev
F: Documentation/admin-guide/gpio/
F: Documentation/devicetree/bindings/gpio/
F: Documentation/driver-api/gpio/
Expand All @@ -9014,6 +9011,16 @@ F: include/dt-bindings/gpio/
F: include/linux/gpio.h
F: include/linux/gpio/
F: include/linux/of_gpio.h

GPIO UAPI
M: Bartosz Golaszewski <brgl@bgdev.pl>
R: Kent Gibson <warthog618@gmail.com>
L: linux-gpio@vger.kernel.org
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
F: Documentation/ABI/obsolete/sysfs-gpio
F: Documentation/ABI/testing/gpio-cdev
F: drivers/gpio/gpiolib-cdev.c
F: include/uapi/linux/gpio.h
F: tools/gpio/

Expand Down Expand Up @@ -10639,6 +10646,7 @@ F: drivers/gpio/gpio-pch.c
F: drivers/gpio/gpio-sch.c
F: drivers/gpio/gpio-sodaville.c
F: drivers/gpio/gpio-tangier.c
F: drivers/gpio/gpio-tangier.h

INTEL GVT-g DRIVERS (Intel GPU Virtualization)
M: Zhenyu Wang <zhenyuw@linux.intel.com>
Expand Down
6 changes: 4 additions & 2 deletions block/badblocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,12 +1312,14 @@ static int _badblocks_check(struct badblocks *bb, sector_t s, int sectors,
prev = prev_badblocks(bb, &bad, hint);

/* start after all badblocks */
if ((prev + 1) >= bb->count && !overlap_front(bb, prev, &bad)) {
if ((prev >= 0) &&
((prev + 1) >= bb->count) && !overlap_front(bb, prev, &bad)) {
len = sectors;
goto update_sectors;
}

if (overlap_front(bb, prev, &bad)) {
/* Overlapped with front badblocks record */
if ((prev >= 0) && overlap_front(bb, prev, &bad)) {
if (BB_ACK(p[prev]))
acked_badblocks++;
else
Expand Down
9 changes: 3 additions & 6 deletions drivers/platform/x86/intel/pmc/adl.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,13 @@ int adl_core_init(struct pmc_dev *pmcdev)
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
int ret;

pmcdev->suspend = cnl_suspend;
pmcdev->resume = cnl_resume;

pmc->map = &adl_reg_map;
ret = get_primary_reg_base(pmc);
if (ret)
return ret;

/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
pmc_core_send_ltr_ignore(pmcdev, 3);

return 0;
}
26 changes: 20 additions & 6 deletions drivers/platform/x86/intel/pmc/cnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,21 +204,35 @@ const struct pmc_reg_map cnp_reg_map = {
.etr3_offset = ETR3_OFFSET,
};

void cnl_suspend(struct pmc_dev *pmcdev)
{
/*
* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. To unblock PC10 during suspend,
* tell the PMC to ignore it.
*/
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
}

int cnl_resume(struct pmc_dev *pmcdev)
{
pmc_core_send_ltr_ignore(pmcdev, 3, 0);

return pmc_core_resume_common(pmcdev);
}

int cnp_core_init(struct pmc_dev *pmcdev)
{
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
int ret;

pmcdev->suspend = cnl_suspend;
pmcdev->resume = cnl_resume;

pmc->map = &cnp_reg_map;
ret = get_primary_reg_base(pmc);
if (ret)
return ret;

/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
pmc_core_send_ltr_ignore(pmcdev, 3);

return 0;
}
12 changes: 9 additions & 3 deletions drivers/platform/x86/intel/pmc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ static int pmc_core_pll_show(struct seq_file *s, void *unused)
}
DEFINE_SHOW_ATTRIBUTE(pmc_core_pll);

int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value)
int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value, int ignore)
{
struct pmc *pmc;
const struct pmc_reg_map *map;
Expand Down Expand Up @@ -498,7 +498,10 @@ int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value)
mutex_lock(&pmcdev->lock);

reg = pmc_core_reg_read(pmc, map->ltr_ignore_offset);
reg |= BIT(ltr_index);
if (ignore)
reg |= BIT(ltr_index);
else
reg &= ~BIT(ltr_index);
pmc_core_reg_write(pmc, map->ltr_ignore_offset, reg);

mutex_unlock(&pmcdev->lock);
Expand All @@ -521,7 +524,7 @@ static ssize_t pmc_core_ltr_ignore_write(struct file *file,
if (err)
return err;

err = pmc_core_send_ltr_ignore(pmcdev, value);
err = pmc_core_send_ltr_ignore(pmcdev, value, 1);

return err == 0 ? count : err;
}
Expand Down Expand Up @@ -1279,6 +1282,9 @@ static __maybe_unused int pmc_core_suspend(struct device *dev)
struct pmc_dev *pmcdev = dev_get_drvdata(dev);
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];

if (pmcdev->suspend)
pmcdev->suspend(pmcdev);

/* Check if the syspend will actually use S0ix */
if (pm_suspend_via_firmware())
return 0;
Expand Down
7 changes: 6 additions & 1 deletion drivers/platform/x86/intel/pmc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ struct pmc {
* @s0ix_counter: S0ix residency (step adjusted)
* @num_lpm_modes: Count of enabled modes
* @lpm_en_modes: Array of enabled modes from lowest to highest priority
* @suspend: Function to perform platform specific suspend
* @resume: Function to perform platform specific resume
*
* pmc_dev contains info about power management controller device.
Expand All @@ -379,6 +380,7 @@ struct pmc_dev {
u64 s0ix_counter;
int num_lpm_modes;
int lpm_en_modes[LPM_MAX_NUM_MODES];
void (*suspend)(struct pmc_dev *pmcdev);
int (*resume)(struct pmc_dev *pmcdev);

bool has_die_c6;
Expand Down Expand Up @@ -486,7 +488,7 @@ extern const struct pmc_bit_map *mtl_ioem_lpm_maps[];
extern const struct pmc_reg_map mtl_ioem_reg_map;

extern void pmc_core_get_tgl_lpm_reqs(struct platform_device *pdev);
extern int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value);
int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value, int ignore);

int pmc_core_resume_common(struct pmc_dev *pmcdev);
int get_primary_reg_base(struct pmc *pmc);
Expand All @@ -500,6 +502,9 @@ int tgl_core_init(struct pmc_dev *pmcdev);
int adl_core_init(struct pmc_dev *pmcdev);
int mtl_core_init(struct pmc_dev *pmcdev);

void cnl_suspend(struct pmc_dev *pmcdev);
int cnl_resume(struct pmc_dev *pmcdev);

#define pmc_for_each_mode(i, mode, pmcdev) \
for (i = 0, mode = pmcdev->lpm_en_modes[i]; \
i < pmcdev->num_lpm_modes; \
Expand Down
9 changes: 3 additions & 6 deletions drivers/platform/x86/intel/pmc/mtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,8 @@ static void mtl_d3_fixup(void)
static int mtl_resume(struct pmc_dev *pmcdev)
{
mtl_d3_fixup();
pmc_core_send_ltr_ignore(pmcdev, 3, 0);

return pmc_core_resume_common(pmcdev);
}

Expand All @@ -989,6 +991,7 @@ int mtl_core_init(struct pmc_dev *pmcdev)

mtl_d3_fixup();

pmcdev->suspend = cnl_suspend;
pmcdev->resume = mtl_resume;

pmcdev->regmap_list = mtl_pmc_info_list;
Expand All @@ -1002,11 +1005,5 @@ int mtl_core_init(struct pmc_dev *pmcdev)
return ret;
}

/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
pmc_core_send_ltr_ignore(pmcdev, 3);

return 0;
}
9 changes: 4 additions & 5 deletions drivers/platform/x86/intel/pmc/tgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,15 @@ int tgl_core_init(struct pmc_dev *pmcdev)
int ret;

pmc->map = &tgl_reg_map;

pmcdev->suspend = cnl_suspend;
pmcdev->resume = cnl_resume;

ret = get_primary_reg_base(pmc);
if (ret)
return ret;

pmc_core_get_tgl_lpm_reqs(pmcdev->pdev);
/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
pmc_core_send_ltr_ignore(pmcdev, 3);

return 0;
}

0 comments on commit 414e92a

Please sign in to comment.