* [PATCH 0/2] hwmon: xgene: Support hwmon v2 @ 2017-09-21 17:17 Hoan Tran 2017-09-21 17:17 ` [PATCH 1/2] " Hoan Tran 2017-09-21 17:17 ` [PATCH 2/2] hwmon: xgene: Support PCC shared memory in IO region Hoan Tran 0 siblings, 2 replies; 6+ messages in thread From: Hoan Tran @ 2017-09-21 17:17 UTC (permalink / raw) To: Guenter Roeck, Jean Delvare Cc: linux-hwmon, linux-kernel, Itaru Kitayama, lho, kdinh, patches, Hoan Tran This patch supports xgene-hwmon v2 which uses the non-cachable memory as the PCC shared memory. Hoan Tran (2): hwmon: xgene: Support hwmon v2 hwmon: xgene: Support PCC shared memory in IO region drivers/hwmon/xgene-hwmon.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] hwmon: xgene: Support hwmon v2 2017-09-21 17:17 [PATCH 0/2] hwmon: xgene: Support hwmon v2 Hoan Tran @ 2017-09-21 17:17 ` Hoan Tran 2017-10-01 14:30 ` [1/2] " Guenter Roeck 2017-09-21 17:17 ` [PATCH 2/2] hwmon: xgene: Support PCC shared memory in IO region Hoan Tran 1 sibling, 1 reply; 6+ messages in thread From: Hoan Tran @ 2017-09-21 17:17 UTC (permalink / raw) To: Guenter Roeck, Jean Delvare Cc: linux-hwmon, linux-kernel, Itaru Kitayama, lho, kdinh, patches, Hoan Tran This patch supports xgene-hwmon v2 which uses the non-cachable memory as the PCC shared memory. Signed-off-by: Hoan Tran <hotran@apm.com> --- drivers/hwmon/xgene-hwmon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c index 9c0dbb8..5cd327e 100644 --- a/drivers/hwmon/xgene-hwmon.c +++ b/drivers/hwmon/xgene-hwmon.c @@ -761,6 +761,7 @@ static int xgene_hwmon_remove(struct platform_device *pdev) #ifdef CONFIG_ACPI static const struct acpi_device_id xgene_hwmon_acpi_match[] = { {"APMC0D29", 0}, + {"APMC0D8A", 0}, {}, }; MODULE_DEVICE_TABLE(acpi, xgene_hwmon_acpi_match); -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [1/2] hwmon: xgene: Support hwmon v2 2017-09-21 17:17 ` [PATCH 1/2] " Hoan Tran @ 2017-10-01 14:30 ` Guenter Roeck 0 siblings, 0 replies; 6+ messages in thread From: Guenter Roeck @ 2017-10-01 14:30 UTC (permalink / raw) To: hotran Cc: Jean Delvare, linux-hwmon, linux-kernel, Itaru Kitayama, lho, kdinh, patches On Thu, Sep 21, 2017 at 10:17:09AM -0700, hotran wrote: > This patch supports xgene-hwmon v2 which uses the non-cachable memory > as the PCC shared memory. > > Signed-off-by: Hoan Tran <hotran@apm.com> Applied to hwmon-next. Thanks, Guenter > --- > drivers/hwmon/xgene-hwmon.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c > index 9c0dbb8..5cd327e 100644 > --- a/drivers/hwmon/xgene-hwmon.c > +++ b/drivers/hwmon/xgene-hwmon.c > @@ -761,6 +761,7 @@ static int xgene_hwmon_remove(struct platform_device *pdev) > #ifdef CONFIG_ACPI > static const struct acpi_device_id xgene_hwmon_acpi_match[] = { > {"APMC0D29", 0}, > + {"APMC0D8A", 0}, > {}, > }; > MODULE_DEVICE_TABLE(acpi, xgene_hwmon_acpi_match); ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] hwmon: xgene: Support PCC shared memory in IO region 2017-09-21 17:17 [PATCH 0/2] hwmon: xgene: Support hwmon v2 Hoan Tran 2017-09-21 17:17 ` [PATCH 1/2] " Hoan Tran @ 2017-09-21 17:17 ` Hoan Tran 2017-10-01 14:31 ` [2/2] " Guenter Roeck 1 sibling, 1 reply; 6+ messages in thread From: Hoan Tran @ 2017-09-21 17:17 UTC (permalink / raw) To: Guenter Roeck, Jean Delvare Cc: linux-hwmon, linux-kernel, Itaru Kitayama, lho, kdinh, patches, Hoan Tran As the PCC shared memory could be in IO region which doesn't support caching, this patch simply uses ioremap() for IO region. Signed-off-by: Hoan Tran <hotran@apm.com> --- drivers/hwmon/xgene-hwmon.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c index 5cd327e..2dac1ed 100644 --- a/drivers/hwmon/xgene-hwmon.c +++ b/drivers/hwmon/xgene-hwmon.c @@ -32,6 +32,7 @@ #include <linux/kfifo.h> #include <linux/mailbox_controller.h> #include <linux/mailbox_client.h> +#include <linux/memblock.h> #include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> @@ -135,6 +136,14 @@ static u16 xgene_word_tst_and_clr(u16 *addr, u16 mask) return ret; } +static void __iomem *pcc_ioremap(phys_addr_t phys, size_t size) +{ + if (!memblock_is_memory(phys)) + return ioremap(phys, size); + + return memremap(phys, size, MEMREMAP_WB); +} + static int xgene_hwmon_pcc_rd(struct xgene_hwmon_dev *ctx, u32 *msg) { struct acpi_pcct_shared_memory *generic_comm_base = ctx->pcc_comm_addr; @@ -690,9 +699,8 @@ static int xgene_hwmon_probe(struct platform_device *pdev) */ ctx->comm_base_addr = cppc_ss->base_address; if (ctx->comm_base_addr) { - ctx->pcc_comm_addr = memremap(ctx->comm_base_addr, - cppc_ss->length, - MEMREMAP_WB); + ctx->pcc_comm_addr = pcc_ioremap(ctx->comm_base_addr, + cppc_ss->length); } else { dev_err(&pdev->dev, "Failed to get PCC comm region\n"); rc = -ENODEV; -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [2/2] hwmon: xgene: Support PCC shared memory in IO region 2017-09-21 17:17 ` [PATCH 2/2] hwmon: xgene: Support PCC shared memory in IO region Hoan Tran @ 2017-10-01 14:31 ` Guenter Roeck 2017-10-01 19:46 ` Guenter Roeck 0 siblings, 1 reply; 6+ messages in thread From: Guenter Roeck @ 2017-10-01 14:31 UTC (permalink / raw) To: hotran Cc: Jean Delvare, linux-hwmon, linux-kernel, Itaru Kitayama, lho, kdinh, patches On Thu, Sep 21, 2017 at 10:17:10AM -0700, hotran wrote: > As the PCC shared memory could be in IO region which doesn't > support caching, this patch simply uses ioremap() for IO region. > > Signed-off-by: Hoan Tran <hotran@apm.com> Applied to hwmon-next. Thanks, Guenter > --- > drivers/hwmon/xgene-hwmon.c | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c > index 5cd327e..2dac1ed 100644 > --- a/drivers/hwmon/xgene-hwmon.c > +++ b/drivers/hwmon/xgene-hwmon.c > @@ -32,6 +32,7 @@ > #include <linux/kfifo.h> > #include <linux/mailbox_controller.h> > #include <linux/mailbox_client.h> > +#include <linux/memblock.h> > #include <linux/module.h> > #include <linux/of.h> > #include <linux/platform_device.h> > @@ -135,6 +136,14 @@ static u16 xgene_word_tst_and_clr(u16 *addr, u16 mask) > return ret; > } > > +static void __iomem *pcc_ioremap(phys_addr_t phys, size_t size) > +{ > + if (!memblock_is_memory(phys)) > + return ioremap(phys, size); > + > + return memremap(phys, size, MEMREMAP_WB); > +} > + > static int xgene_hwmon_pcc_rd(struct xgene_hwmon_dev *ctx, u32 *msg) > { > struct acpi_pcct_shared_memory *generic_comm_base = ctx->pcc_comm_addr; > @@ -690,9 +699,8 @@ static int xgene_hwmon_probe(struct platform_device *pdev) > */ > ctx->comm_base_addr = cppc_ss->base_address; > if (ctx->comm_base_addr) { > - ctx->pcc_comm_addr = memremap(ctx->comm_base_addr, > - cppc_ss->length, > - MEMREMAP_WB); > + ctx->pcc_comm_addr = pcc_ioremap(ctx->comm_base_addr, > + cppc_ss->length); > } else { > dev_err(&pdev->dev, "Failed to get PCC comm region\n"); > rc = -ENODEV; ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [2/2] hwmon: xgene: Support PCC shared memory in IO region 2017-10-01 14:31 ` [2/2] " Guenter Roeck @ 2017-10-01 19:46 ` Guenter Roeck 0 siblings, 0 replies; 6+ messages in thread From: Guenter Roeck @ 2017-10-01 19:46 UTC (permalink / raw) To: hotran Cc: Jean Delvare, linux-hwmon, linux-kernel, Itaru Kitayama, lho, kdinh, patches On Sun, Oct 01, 2017 at 07:31:32AM -0700, Guenter Roeck wrote: > On Thu, Sep 21, 2017 at 10:17:10AM -0700, hotran wrote: > > As the PCC shared memory could be in IO region which doesn't > > support caching, this patch simply uses ioremap() for IO region. > > > > Signed-off-by: Hoan Tran <hotran@apm.com> > > Applied to hwmon-next. > Turns out this doesn't work. memblock_is_memory() is not exported and marked __init_memblock, and thus not qavailable for modules. Dropped. Guenter > Thanks, > Guenter > > > --- > > drivers/hwmon/xgene-hwmon.c | 14 +++++++++++--- > > 1 file changed, 11 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c > > index 5cd327e..2dac1ed 100644 > > --- a/drivers/hwmon/xgene-hwmon.c > > +++ b/drivers/hwmon/xgene-hwmon.c > > @@ -32,6 +32,7 @@ > > #include <linux/kfifo.h> > > #include <linux/mailbox_controller.h> > > #include <linux/mailbox_client.h> > > +#include <linux/memblock.h> > > #include <linux/module.h> > > #include <linux/of.h> > > #include <linux/platform_device.h> > > @@ -135,6 +136,14 @@ static u16 xgene_word_tst_and_clr(u16 *addr, u16 mask) > > return ret; > > } > > > > +static void __iomem *pcc_ioremap(phys_addr_t phys, size_t size) > > +{ > > + if (!memblock_is_memory(phys)) > > + return ioremap(phys, size); > > + > > + return memremap(phys, size, MEMREMAP_WB); > > +} > > + > > static int xgene_hwmon_pcc_rd(struct xgene_hwmon_dev *ctx, u32 *msg) > > { > > struct acpi_pcct_shared_memory *generic_comm_base = ctx->pcc_comm_addr; > > @@ -690,9 +699,8 @@ static int xgene_hwmon_probe(struct platform_device *pdev) > > */ > > ctx->comm_base_addr = cppc_ss->base_address; > > if (ctx->comm_base_addr) { > > - ctx->pcc_comm_addr = memremap(ctx->comm_base_addr, > > - cppc_ss->length, > > - MEMREMAP_WB); > > + ctx->pcc_comm_addr = pcc_ioremap(ctx->comm_base_addr, > > + cppc_ss->length); > > } else { > > dev_err(&pdev->dev, "Failed to get PCC comm region\n"); > > rc = -ENODEV; ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-10-01 19:46 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-09-21 17:17 [PATCH 0/2] hwmon: xgene: Support hwmon v2 Hoan Tran 2017-09-21 17:17 ` [PATCH 1/2] " Hoan Tran 2017-10-01 14:30 ` [1/2] " Guenter Roeck 2017-09-21 17:17 ` [PATCH 2/2] hwmon: xgene: Support PCC shared memory in IO region Hoan Tran 2017-10-01 14:31 ` [2/2] " Guenter Roeck 2017-10-01 19:46 ` Guenter Roeck
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox