linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] MCB Patches for 4.14
@ 2017-08-29 12:47 Johannes Thumshirn
  2017-08-29 12:47 ` [PATCH 1/2] MCB: add support for SC31 to mcb-lpc Johannes Thumshirn
  2017-08-29 12:47 ` [PATCH 2/2] mcb: Fix an error handling path in 'chameleon_parse_cells()' Johannes Thumshirn
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2017-08-29 12:47 UTC (permalink / raw)
  To: Greg KH
  Cc: Michael Moese, Christophe JAILLET, Linux Kernel Mailinglist,
	Johannes Thumshirn

Hi Greg,

Here are the collected MCB patches for Kernel v4.14.

Christophe's patch fixes an error handling issue and Michael introduces a new
device id for LPC bus attached MCB devices. I also tagged this patch for inclusion
into stable.

All of them have been in my git tree at
git://git.kernel.org/pub/scm/linux/kernel/git/jth/linux.git mcb-for-4.14


Byte,
	Johannes

Christophe JAILLET (1):
  mcb: Fix an error handling path in 'chameleon_parse_cells()'

Michael Moese (1):
  MCB: add support for SC31 to mcb-lpc

 drivers/mcb/mcb-lpc.c   | 15 +++++++++++++++
 drivers/mcb/mcb-parse.c |  6 ++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

-- 
2.12.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] MCB: add support for SC31 to mcb-lpc
  2017-08-29 12:47 [PATCH 0/2] MCB Patches for 4.14 Johannes Thumshirn
@ 2017-08-29 12:47 ` Johannes Thumshirn
  2017-08-29 12:47 ` [PATCH 2/2] mcb: Fix an error handling path in 'chameleon_parse_cells()' Johannes Thumshirn
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2017-08-29 12:47 UTC (permalink / raw)
  To: Greg KH
  Cc: Michael Moese, Christophe JAILLET, Linux Kernel Mailinglist,
	stable, Johannes Thumshirn

From: Michael Moese <michael.moese@men.de>

This patch adds the resources and DMI ID's for the MEN SC31,
which uses a different address region to map the LPC bus than
the one used for the existing SC24.

Signed-off-by: Michael Moese <michael.moese@men.de>
[jth add stable tag]
Cc: <stable@vger.kernel.org> (v4.9+)
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/mcb/mcb-lpc.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/mcb/mcb-lpc.c b/drivers/mcb/mcb-lpc.c
index d072c088ce73..945091a88354 100644
--- a/drivers/mcb/mcb-lpc.c
+++ b/drivers/mcb/mcb-lpc.c
@@ -114,6 +114,12 @@ static struct resource sc24_fpga_resource = {
 	.flags = IORESOURCE_MEM,
 };
 
+static struct resource sc31_fpga_resource = {
+	.start = 0xf000e000,
+	.end = 0xf000e000 + CHAM_HEADER_SIZE,
+	.flags = IORESOURCE_MEM,
+};
+
 static struct platform_driver mcb_lpc_driver = {
 	.driver		= {
 		.name = "mcb-lpc",
@@ -132,6 +138,15 @@ static const struct dmi_system_id mcb_lpc_dmi_table[] = {
 		.driver_data = (void *)&sc24_fpga_resource,
 		.callback = mcb_lpc_create_platform_device,
 	},
+	{
+		.ident = "SC31",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "MEN"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "14SC31"),
+		},
+		.driver_data = (void *)&sc31_fpga_resource,
+		.callback = mcb_lpc_create_platform_device,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(dmi, mcb_lpc_dmi_table);
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] mcb: Fix an error handling path in 'chameleon_parse_cells()'
  2017-08-29 12:47 [PATCH 0/2] MCB Patches for 4.14 Johannes Thumshirn
  2017-08-29 12:47 ` [PATCH 1/2] MCB: add support for SC31 to mcb-lpc Johannes Thumshirn
@ 2017-08-29 12:47 ` Johannes Thumshirn
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2017-08-29 12:47 UTC (permalink / raw)
  To: Greg KH
  Cc: Michael Moese, Christophe JAILLET, Linux Kernel Mailinglist,
	Johannes Thumshirn

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

If 'chameleon_get_bar()' fails, we will return 0, which mean success.
We should return the corresponding error code instead.

Remove the useless initialisation of 'ret' which was hiding the issue.
(if 'ret' is not set, gcc generates a warning ("warning: ‘ret’ may be used
uninitialized in this function"))

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/mcb/mcb-parse.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
index ee7fb6ec96bd..7369bda3442f 100644
--- a/drivers/mcb/mcb-parse.c
+++ b/drivers/mcb/mcb-parse.c
@@ -182,7 +182,7 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
 	int num_cells = 0;
 	uint32_t dtype;
 	int bar_count;
-	int ret = 0;
+	int ret;
 	u32 hsize;
 
 	hsize = sizeof(struct chameleon_fpga_header);
@@ -210,8 +210,10 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
 		 header->filename);
 
 	bar_count = chameleon_get_bar(&p, mapbase, &cb);
-	if (bar_count < 0)
+	if (bar_count < 0) {
+		ret = bar_count;
 		goto free_header;
+	}
 
 	for_each_chameleon_cell(dtype, p) {
 		switch (dtype) {
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-29 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 12:47 [PATCH 0/2] MCB Patches for 4.14 Johannes Thumshirn
2017-08-29 12:47 ` [PATCH 1/2] MCB: add support for SC31 to mcb-lpc Johannes Thumshirn
2017-08-29 12:47 ` [PATCH 2/2] mcb: Fix an error handling path in 'chameleon_parse_cells()' Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).