[PATCH] staging:xgifb:remove unused code
The variable data is assigned but never used in rest code. Signed-off-by: Ding Xiang --- drivers/staging/xgifb/vb_setmode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 50c8ea4..71bb9ca 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -727,7 +727,6 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex, tempax |= 0x40; xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax); - data = xgifb_reg_get(pVBInfo->P3d4, 0x07); tempax = 0; if (tempbx & 0x04) -- 2.5.0 . ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC PATCH v1 18/28] crypto: add AMD Platform Security Processor driver
On Mon, Aug 22, 2016 at 07:27:22PM -0400, Brijesh Singh wrote: > The driver to communicate with Secure Encrypted Virtualization (SEV) > firmware running within the AMD secure processor providing a secure key > management interface for SEV guests. > > Signed-off-by: Tom Lendacky > Signed-off-by: Brijesh Singh This driver doesn't seem to hook into the Crypto API at all, is there any reason why it should be in drivers/crypto? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging:xgifb:remove unused code
On Tue, Aug 23, 2016 at 03:26:50PM +0800, dingxiang wrote: > The variable data is assigned but never used in rest code. > > Signed-off-by: Ding Xiang > --- Your name in Signed-off-by: and From: doesnot match. > drivers/staging/xgifb/vb_setmode.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/staging/xgifb/vb_setmode.c > b/drivers/staging/xgifb/vb_setmode.c > index 50c8ea4..71bb9ca 100644 > --- a/drivers/staging/xgifb/vb_setmode.c > +++ b/drivers/staging/xgifb/vb_setmode.c > @@ -727,7 +727,6 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex, > tempax |= 0x40; > xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax); > - data = xgifb_reg_get(pVBInfo->P3d4, 0x07); > tempax = 0; > if (tempbx & 0x04) The patch will not apply. Its missing two blank lines which the original code has. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH resend] staging:xgifb:remove unused code
The variable data is assigned but never used in rest code. Signed-off-by: Ding Xiang --- drivers/staging/xgifb/vb_setmode.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 50c8ea4..71bb9ca 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -727,7 +727,6 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex, tempax |= 0x40; xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax); - data = xgifb_reg_get(pVBInfo->P3d4, 0x07); tempax = 0; if (tempbx & 0x04) -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend] staging:xgifb:remove unused code
On Tue, Aug 23, 2016 at 05:17:30PM +0800, Ding Xiang wrote: > The variable data is assigned but never used in rest code. > > Signed-off-by: Ding Xiang > --- The subject should have been [Patch v2] not resend. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2] staging:xgifb:remove unused code
The variable data is assigned but never used in rest code. Signed-off-by: Ding Xiang --- drivers/staging/xgifb/vb_setmode.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 50c8ea4..71bb9ca 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -727,7 +727,6 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex, tempax |= 0x40; xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax); - data = xgifb_reg_get(pVBInfo->P3d4, 0x07); tempax = 0; if (tempbx & 0x04) -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend] staging:xgifb:remove unused code
On Tue, Aug 23, 2016 at 05:17:30PM +0800, Ding Xiang wrote: > The variable data is assigned but never used in rest code. > > Signed-off-by: Ding Xiang > --- > drivers/staging/xgifb/vb_setmode.c |1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/drivers/staging/xgifb/vb_setmode.c > b/drivers/staging/xgifb/vb_setmode.c > index 50c8ea4..71bb9ca 100644 > --- a/drivers/staging/xgifb/vb_setmode.c > +++ b/drivers/staging/xgifb/vb_setmode.c > @@ -727,7 +727,6 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex, > tempax |= 0x40; > > xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax); > - data = xgifb_reg_get(pVBInfo->P3d4, 0x07); But this did something with the hardware, are you sure this doesn't break anything? Lots of hardware works with the sequence of: write something read something to make sure the write worked. Did you test this? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: i4l: icn: use memdup_user
Its better to use memdup_user which does the same thing which this code has implemented. Suggested-by: Fengguang Wu Signed-off-by: Sudip Mukherjee --- drivers/staging/i4l/icn/icn.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c index b2f4055..5312675 100644 --- a/drivers/staging/i4l/icn/icn.c +++ b/drivers/staging/i4l/icn/icn.c @@ -804,21 +804,16 @@ static int icn_loadboot(u_char __user *buffer, icn_card *card) { int ret; - u_char *codebuf; + void *codebuf; unsigned long flags; #ifdef BOOT_DEBUG printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) buffer); #endif - codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL); - if (!codebuf) { - printk(KERN_WARNING "icn: Could not allocate code buffer\n"); - ret = -ENOMEM; - goto out; - } - if (copy_from_user(codebuf, buffer, ICN_CODE_STAGE1)) { - ret = -EFAULT; - goto out_kfree; + codebuf = memdup_user(buffer, ICN_CODE_STAGE1); + if (IS_ERR(codebuf)) { + pr_warn("icn: Could not allocate code buffer\n"); + return PTR_ERR(codebuf); } if (!card->rvalid) { if (!request_region(card->port, ICN_PORTLEN, card->regname)) { @@ -902,7 +897,6 @@ icn_loadboot(u_char __user *buffer, icn_card *card) out_kfree: kfree(codebuf); -out: return ret; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: i4l: icn: use memdup_user
On Tue, Aug 23, 2016 at 03:57:34PM +0530, Sudip Mukherjee wrote: > Its better to use memdup_user which does the same thing which this > code has implemented. > > Suggested-by: Fengguang Wu > Signed-off-by: Sudip Mukherjee > --- > drivers/staging/i4l/icn/icn.c | 16 +--- > 1 file changed, 5 insertions(+), 11 deletions(-) > > diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c > index b2f4055..5312675 100644 > --- a/drivers/staging/i4l/icn/icn.c > +++ b/drivers/staging/i4l/icn/icn.c > @@ -804,21 +804,16 @@ static int > icn_loadboot(u_char __user *buffer, icn_card *card) > { > int ret; > - u_char *codebuf; > + void *codebuf; why did you change the type here? > unsigned long flags; > > #ifdef BOOT_DEBUG > printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) > buffer); > #endif > - codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL); > - if (!codebuf) { > - printk(KERN_WARNING "icn: Could not allocate code buffer\n"); > - ret = -ENOMEM; > - goto out; > - } > - if (copy_from_user(codebuf, buffer, ICN_CODE_STAGE1)) { > - ret = -EFAULT; > - goto out_kfree; > + codebuf = memdup_user(buffer, ICN_CODE_STAGE1); > + if (IS_ERR(codebuf)) { > + pr_warn("icn: Could not allocate code buffer\n"); Don't warn about something that already was warned about. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: i4l: icn: use memdup_user
On Tue, Aug 23, 2016 at 06:50:30AM -0400, Greg Kroah-Hartman wrote: > On Tue, Aug 23, 2016 at 03:57:34PM +0530, Sudip Mukherjee wrote: > > Its better to use memdup_user which does the same thing which this > > code has implemented. > > > > Suggested-by: Fengguang Wu > > Signed-off-by: Sudip Mukherjee > > --- > > drivers/staging/i4l/icn/icn.c | 16 +--- > > 1 file changed, 5 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c > > index b2f4055..5312675 100644 > > --- a/drivers/staging/i4l/icn/icn.c > > +++ b/drivers/staging/i4l/icn/icn.c > > @@ -804,21 +804,16 @@ static int > > icn_loadboot(u_char __user *buffer, icn_card *card) > > { > > int ret; > > - u_char *codebuf; > > + void *codebuf; > > why did you change the type here? type was changed as codebuf is only used with memdup_user() and memcpy_toio() and both of them takes void. I should have mentioned that in the commit message. Sending v2 with this change and after removing the warning. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: i4l: icn: fix memdup_user.cocci warnings
On Mon, Aug 22, 2016 at 09:19:36PM -0400, Greg KH wrote: On Tue, Aug 23, 2016 at 08:36:58AM +0800, kbuild test robot wrote: drivers/staging/i4l/icn/icn.c:813:11-18: WARNING opportunity for memdup_user Use memdup_user rather than duplicating its implementation This is a little bit restricted to reduce false positives Generated by: scripts/coccinelle/api/memdup_user.cocci CC: Sudip Mukherjee Signed-off-by: Fengguang Wu --- 0 files changed rule starting on line 17: position variables or mixed modifs interfere with comm_assoc isobool ( ( ( (unknown *to == NULL) >>> IS_ERR(rule starting on line 17:to) | !unknown *to >>> IS_ERR(rule starting on line 17:to) ) | (unknown *NULL == unknown *to) >>> IS_ERR(rule starting on line 17:to) ) || ...) There's no patch here, did something go wrong? Yes, the above error messages look like problems in the cocci script. CC Julia for possible inputs. Hi Julia, here is the context of the problem: tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing head: f5a9a15f8fd4168e415e94f5dce367f3cef08e03 commit: ee05e5f7113ea0b0db7eff7011a534c92fec2648 [251/347] staging: i4l: icn: donot assign in if statement coccinelle warnings: (new ones prefixed by >>) drivers/staging/i4l/icn/icn.c:813:11-18: WARNING opportunity for memdup_user Thanks, Fengguang ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: i4l: icn: use memdup_user
On Tue, Aug 23, 2016 at 04:28:12PM +0530, Sudip Mukherjee wrote: > On Tue, Aug 23, 2016 at 06:50:30AM -0400, Greg Kroah-Hartman wrote: > > On Tue, Aug 23, 2016 at 03:57:34PM +0530, Sudip Mukherjee wrote: > > > Its better to use memdup_user which does the same thing which this > > > code has implemented. > > > > > > Suggested-by: Fengguang Wu > > > Signed-off-by: Sudip Mukherjee > > > --- > > > drivers/staging/i4l/icn/icn.c | 16 +--- > > > 1 file changed, 5 insertions(+), 11 deletions(-) > > > > > > diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c > > > index b2f4055..5312675 100644 > > > --- a/drivers/staging/i4l/icn/icn.c > > > +++ b/drivers/staging/i4l/icn/icn.c > > > @@ -804,21 +804,16 @@ static int > > > icn_loadboot(u_char __user *buffer, icn_card *card) > > > { > > > int ret; > > > - u_char *codebuf; > > > + void *codebuf; > > > > why did you change the type here? > > type was changed as codebuf is only used with memdup_user() and > memcpy_toio() and both of them takes void. I should have mentioned > that in the commit message. Sending v2 with this change and after > removing the warning. No, please leave the type alone, you are changing it for no good reason (and in fact, it might be a bad change if anything else were to use that pointer...) greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: i4l: icn: use memdup_user
Its better to use memdup_user which does the same thing which this code has implemented. Also removed a related warning as we will be warned if allocation fails. Suggested-by: Fengguang Wu Signed-off-by: Sudip Mukherjee --- v2: removed type change done in v1, and removed a warning. drivers/staging/i4l/icn/icn.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c index b2f4055..415124f 100644 --- a/drivers/staging/i4l/icn/icn.c +++ b/drivers/staging/i4l/icn/icn.c @@ -810,16 +810,10 @@ icn_loadboot(u_char __user *buffer, icn_card *card) #ifdef BOOT_DEBUG printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) buffer); #endif - codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL); - if (!codebuf) { - printk(KERN_WARNING "icn: Could not allocate code buffer\n"); - ret = -ENOMEM; - goto out; - } - if (copy_from_user(codebuf, buffer, ICN_CODE_STAGE1)) { - ret = -EFAULT; - goto out_kfree; - } + codebuf = memdup_user(buffer, ICN_CODE_STAGE1); + if (IS_ERR(codebuf)) + return PTR_ERR(codebuf); + if (!card->rvalid) { if (!request_region(card->port, ICN_PORTLEN, card->regname)) { printk(KERN_WARNING @@ -902,7 +896,6 @@ icn_loadboot(u_char __user *buffer, icn_card *card) out_kfree: kfree(codebuf); -out: return ret; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH -next] staging: comedi: dt2811: fix non static symbol warnings
From: Wei Yongjun Fixes the following sparse warnings: drivers/staging/comedi/drivers/dt2811.c:99:20: warning: symbol 'dt2811_clk_dividers' was not declared. Should it be static? drivers/staging/comedi/drivers/dt2811.c:103:20: warning: symbol 'dt2811_clk_multipliers' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- drivers/staging/comedi/drivers/dt2811.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2811.c b/drivers/staging/comedi/drivers/dt2811.c index 8bbd938..fcd8547 100644 --- a/drivers/staging/comedi/drivers/dt2811.c +++ b/drivers/staging/comedi/drivers/dt2811.c @@ -96,11 +96,11 @@ *6 6 100 kHz 6 100 *7 12 50 kHz 7 1000 */ -const unsigned int dt2811_clk_dividers[] = { +static const unsigned int dt2811_clk_dividers[] = { 1, 10, 2, 3, 4, 5, 6, 12 }; -const unsigned int dt2811_clk_multipliers[] = { +static const unsigned int dt2811_clk_multipliers[] = { 1, 10, 100, 1000, 1, 10, 100, 1000 }; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH -next] staging: comedi: dt2811: fix non static symbol warnings
On Tue, Aug 23, 2016 at 03:02:21PM +, Wei Yongjun wrote: > From: Wei Yongjun > > drivers/staging/comedi/drivers/dt2811.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/comedi/drivers/dt2811.c > b/drivers/staging/comedi/drivers/dt2811.c > index 8bbd938..fcd8547 100644 > --- a/drivers/staging/comedi/drivers/dt2811.c > +++ b/drivers/staging/comedi/drivers/dt2811.c > @@ -96,11 +96,11 @@ > *6 6 100 kHz 6 100 > *7 12 50 kHz 7 1000 > */ > -const unsigned int dt2811_clk_dividers[] = { > +static const unsigned int dt2811_clk_dividers[] = { > 1, 10, 2, 3, 4, 5, 6, 12 > }; > > -const unsigned int dt2811_clk_multipliers[] = { > +static const unsigned int dt2811_clk_multipliers[] = { > 1, 10, 100, 1000, 1, 10, 100, 1000 > }; This has already been done by: 49c9d6ad68ae ("staging: comedi/drivers: Fixed sparse warnings") regards sudip > > > > > ___ > devel mailing list > de...@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: wlan-ng: Improved case statements in p80211req_mibset_mibget()
This patch improves code from p80211req_mibset_mibget() function by taking into account that every DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKeyX with X in {0, 1, 2, 3} is a bit mask where the (P80211DID_MASK_ITEM << P80211DID_LSB_ITEM) mask aka 0x0x0003f000 mask keeps bits representing the DID item number. To get this item number use P80211DID_ITEM(). Signed-off-by: Claudiu Beznea --- drivers/staging/wlan-ng/p80211req.c | 28 +--- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c index 4b84b56..3849637 100644 --- a/drivers/staging/wlan-ng/p80211req.c +++ b/drivers/staging/wlan-ng/p80211req.c @@ -185,26 +185,16 @@ static void p80211req_mibset_mibget(wlandevice_t *wlandev, u8 *key = mibitem->data + sizeof(p80211pstrd_t); switch (mibitem->did) { - case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0:{ + case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0: + case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1: + case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2: + case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3: if (!isget) - wep_change_key(wlandev, 0, key, pstr->len); - break; - } - case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1:{ - if (!isget) - wep_change_key(wlandev, 1, key, pstr->len); - break; - } - case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2:{ - if (!isget) - wep_change_key(wlandev, 2, key, pstr->len); - break; - } - case DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3:{ - if (!isget) - wep_change_key(wlandev, 3, key, pstr->len); - break; - } + wep_change_key(wlandev, + P80211DID_ITEM(mibitem->did) - 1, + key, pstr->len); + break; + case DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID:{ u32 *data = (u32 *) mibitem->data; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: ks7010: return on failure
On failure we were jumping to error_out0 where we were trying sdio_release_host() but at this point of execution we still have not done sdio_claim_host() and as a result host->claimed can still be 0. And if host->claimed is 0 then WARN_ON(!host->claimed) will give a warning. Moreover, if it is still not claimed then mmc_host->claim_cnt will be 0 and mmc_release_host() will do "if (--host->claim_cnt)" and thus the condition will become true. Lets just return the value on allocation failure instead of trying to release the host before claiming it. Signed-off-by: Sudip Mukherjee --- drivers/staging/ks7010/ks7010_sdio.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 47b69cb..7bcf1ea 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -776,10 +776,8 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv, /* buffer allocate */ rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL); - if (!rom_buf) { - rc = 3; - goto error_out0; - } + if (!rom_buf) + return 3; sdio_claim_host(card->func); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: ks7010: fix memory leak
If the firmware request failed we were just returning but we missed freeing the memory and releasing the MMC Host. Signed-off-by: Sudip Mukherjee --- drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 7bcf1ea..86cdebe 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -791,7 +791,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv, retval = request_firmware(&fw_entry, ROM_FILE, &priv->ks_wlan_hw.sdio_card->func->dev); if (retval) - return retval; + goto error_out0; length = fw_entry->size; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: android: ion: Do not BUG on handle client mismatch
On Mon, Aug 22, 2016 at 09:58:40AM -0700, Laura Abbott wrote: > The validate and BUG_ON are checking two slightly different things. > The BUG_ON is trying to catch blatantly wrong kernel users while the > validate is designed to catch races. I still think BUG is a fairly harsh way to "catch" blatantly wrong kernel users. Is the worry about kernel users modifying the handle? Can't they modify the client as well in that case? I was perhaps overzealous in removing the check altogether. Could we settle for a WARN_ON() and skipping the ref decrement? I think warning and leaking memory is preferrable to crashing the kernel. Best Regards, Johanna Abrahamsson ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] drivers: staging: rtl8723au: hal: Remove pointless test
This patch removes the pointless `else if` test. Signed-off-by: Matthias Beyer Reported-by: David Binderman --- drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index bfcbd7a..7f11521 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -3530,7 +3530,7 @@ bthci_CmdLinkStatusNotify( pBtMgnt->ExtConfig.linkInfo[i].BTProfile, pBtMgnt->ExtConfig.linkInfo[i].BTCoreSpec)); pTriple += 4; - } else if (pBtMgnt->ExtConfig.HCIExtensionVer >= 1) { + } else { pBtMgnt->ExtConfig.linkInfo[i].ConnectHandle = *((u16 *)&pTriple[0]); pBtMgnt->ExtConfig.linkInfo[i].BTProfile = pTriple[2]; pBtMgnt->ExtConfig.linkInfo[i].BTCoreSpec = pTriple[3]; -- 2.9.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] drivers: staging: rtl823au: hal: Remove pointless test
As reported by David Binderman, this test is useless as of if (a < 3) { /* ... */ } else if (a >= 3) { /* ... */ } so this patch removes the second check. Matthias Beyer (1): drivers: staging: rtl8723au: hal: Remove pointless test drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: octeon-usb: correct driver name in Kconfig help text
From: Randy Dunlap The module name in the Makefile and in the driver source file is octeon-hcd, so correct the Kconfig text to be the same. Signed-off-by: Randy Dunlap Cc: Aaro Koskinen --- drivers/staging/octeon-usb/Kconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-next-20160823.orig/drivers/staging/octeon-usb/Kconfig +++ linux-next-20160823/drivers/staging/octeon-usb/Kconfig @@ -6,5 +6,5 @@ config OCTEON_USB Networks' products in the Octeon family. To compile this driver as a module, choose M here. The module - will be called octeon-usb. + will be called octeon-hcd. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: android: ion: Do not BUG on handle client mismatch
On 08/23/2016 11:43 AM, Johanna Abrahamsson wrote: On Mon, Aug 22, 2016 at 09:58:40AM -0700, Laura Abbott wrote: The validate and BUG_ON are checking two slightly different things. The BUG_ON is trying to catch blatantly wrong kernel users while the validate is designed to catch races. I still think BUG is a fairly harsh way to "catch" blatantly wrong kernel users. Is the worry about kernel users modifying the handle? Can't they modify the client as well in that case? I was perhaps overzealous in removing the check altogether. Could we settle for a WARN_ON() and skipping the ref decrement? I think warning and leaking memory is preferrable to crashing the kernel. Best Regards, Johanna Abrahamsson It's pretty harsh because the users of Ion need a less than subtle hint that something is broken. From experience, warning and leaking memory just leads to a system that limps along and warnings that get ignored. At long as Ion is primarily used for Android, I think keeping the BUG makes sense. If Ion ever gets a large amount of use outside of Android, moving away from the bug would be appropriate. Thanks, Laura ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/8] Lustre fixes
HEre are some more recent Lustre fixes and a cleanup. Alexander Boyko (1): staging/lustre/mdc: fix panic at mdc_free_open() Andrew Perepechko (1): staging/lustre: avoid clearing i_nlink for inodes in use Dmitry Eremin (1): staging/lustre/llite: Fix suspicious dereference of pointer 'vma->vm_file' James Simmons (1): staging/lustre/o2iblnd: handle mixed page size configurations. John L. Hammond (2): staging/lustre: const correct set_lock_data() staging/lustre: release MGC device if connect fails Lokesh Nagappa Jaliminche (1): staging/lustre/llite: changes to avoid cache corruption Yang Sheng (1): staging/lustre/llite: check return value for obd_set_info_async .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c| 14 +++--- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h| 13 ++--- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 55 ++--- drivers/staging/lustre/lustre/include/obd.h| 7 +-- drivers/staging/lustre/lustre/include/obd_class.h | 28 +-- .../staging/lustre/lustre/include/obd_support.h| 2 + drivers/staging/lustre/lustre/llite/dcache.c | 55 - drivers/staging/lustre/lustre/llite/file.c | 4 +- .../staging/lustre/lustre/llite/llite_internal.h | 5 +- drivers/staging/lustre/lustre/llite/llite_lib.c| 10 drivers/staging/lustre/lustre/llite/llite_mmap.c | 2 - drivers/staging/lustre/lustre/llite/namei.c| 3 +- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 2 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c| 47 ++ drivers/staging/lustre/lustre/lov/lov_obd.c| 41 drivers/staging/lustre/lustre/mdc/mdc_internal.h | 6 +-- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 30 ++-- drivers/staging/lustre/lustre/mdc/mdc_request.c| 56 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c| 22 - 20 files changed, 108 insertions(+), 296 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/8] staging/lustre/llite: check return value for obd_set_info_async
From: Yang Sheng The return value is ignored in client_common_fill_super. Restore to check it and error out. Signed-off-by: Yang Sheng Reviewed-on: http://review.whamcloud.com/21125 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8360 Reviewed-by: Emoly Liu Reviewed-by: Bob Glossman Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/llite/llite_lib.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 72ff7c4..1ff788e 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -498,11 +498,21 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, err = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CHECKSUM), KEY_CHECKSUM, sizeof(checksum), &checksum, NULL); + if (err) { + CERROR("%s: Set checksum failed: rc = %d\n", + sbi->ll_dt_exp->exp_obd->obd_name, err); + goto out_root; + } cl_sb_init(sb); err = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CACHE_SET), KEY_CACHE_SET, sizeof(*sbi->ll_cache), sbi->ll_cache, NULL); + if (err) { + CERROR("%s: Set cache_set failed: rc = %d\n", + sbi->ll_dt_exp->exp_obd->obd_name, err); + goto out_root; + } sb->s_root = d_make_root(root); if (!sb->s_root) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/8] staging/lustre: avoid clearing i_nlink for inodes in use
From: Andrew Perepechko The patch removes find_cbdata callbacks and clear_nlink from dentry_iput path, since this piece of code makes a few races possible. The test case reproduces one of the possible races described in LU-7925: 1) two hard links are created for the same file 2) the test calls stat(2) for link #1 3) in the middle of 2) the test opens and closes link #2 4) in the middle of 2) the test drops the ldlm locks and forces dentry reclaim via vm.drop_caches=2 5) in the middle of 2) ll_d_iput() clears i_nlink for the inode 6) the initial stat(2) continues and copies the wrong i_nlink value into st_nlink Signed-off-by: Andrew Perepechko Seagate-bug-id: MRP-3271 Reviewed-on: http://review.whamcloud.com/19164 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7925 Reviewed-by: Wally Wang Reviewed-by: Lai Siyao Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/obd.h| 4 -- drivers/staging/lustre/lustre/include/obd_class.h | 25 -- .../staging/lustre/lustre/include/obd_support.h| 1 + drivers/staging/lustre/lustre/llite/dcache.c | 55 -- drivers/staging/lustre/lustre/llite/file.c | 2 + drivers/staging/lustre/lustre/lmv/lmv_obd.c| 42 - drivers/staging/lustre/lustre/lov/lov_obd.c| 41 drivers/staging/lustre/lustre/mdc/mdc_internal.h | 3 -- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 22 - drivers/staging/lustre/lustre/mdc/mdc_request.c| 1 - drivers/staging/lustre/lustre/osc/osc_request.c| 22 - 11 files changed, 3 insertions(+), 215 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index ed0fd41..f3d141b 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -896,8 +896,6 @@ struct obd_ops { struct niobuf_remote *remote, int pages, struct niobuf_local *local, struct obd_trans_info *oti, int rc); - int (*find_cbdata)(struct obd_export *, struct lov_stripe_md *, - ldlm_iterator_t it, void *data); int (*init_export)(struct obd_export *exp); int (*destroy_export)(struct obd_export *exp); @@ -958,8 +956,6 @@ struct cl_attr; struct md_ops { int (*getstatus)(struct obd_export *, struct lu_fid *); int (*null_inode)(struct obd_export *, const struct lu_fid *); - int (*find_cbdata)(struct obd_export *, const struct lu_fid *, - ldlm_iterator_t, void *); int (*close)(struct obd_export *, struct md_op_data *, struct md_open_data *, struct ptlrpc_request **); int (*create)(struct obd_export *, struct md_op_data *, diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 4f48968..9702ad4 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -1177,19 +1177,6 @@ static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp, return rc; } -static inline int obd_find_cbdata(struct obd_export *exp, - struct lov_stripe_md *lsm, - ldlm_iterator_t it, void *data) -{ - int rc; - - EXP_CHECK_DT_OP(exp, find_cbdata); - EXP_COUNTER_INCREMENT(exp, find_cbdata); - - rc = OBP(exp->exp_obd, find_cbdata)(exp, lsm, it, data); - return rc; -} - static inline void obd_import_event(struct obd_device *obd, struct obd_import *imp, enum obd_import_event event) @@ -1358,18 +1345,6 @@ static inline int md_null_inode(struct obd_export *exp, return rc; } -static inline int md_find_cbdata(struct obd_export *exp, -const struct lu_fid *fid, -ldlm_iterator_t it, void *data) -{ - int rc; - - EXP_CHECK_MD_OP(exp, find_cbdata); - EXP_MD_COUNTER_INCREMENT(exp, find_cbdata); - rc = MDP(exp->exp_obd, find_cbdata)(exp, fid, it, data); - return rc; -} - static inline int md_close(struct obd_export *exp, struct md_op_data *op_data, struct md_open_data *mod, struct ptlrpc_request **request) diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h index 4a9fe88..4d7a5c8 100644 --- a/drivers/staging/lustre/lustre/include/obd_support.h +++ b/drivers/staging/lustre/lustre/include/obd_support.h @@ -458,6 +458,7 @@ extern char obd_jobid_var[]; #define OBD_FAIL_LOV_INIT 0x1403 #define OBD_FAIL_GLIMPSE_DELAY 0x1404 #define OBD_FAIL_LLITE_XATTR_ENOMEM0x1405 +#define O
[PATCH 6/8] staging/lustre/llite: changes to avoid cache corruption
From: Lokesh Nagappa Jaliminche ll_find_alias is responsible for getting alias for inode which can be reused. Directories are assumed to have unique alias, where in case of non-directories there can be multiple aliases. In case of lustre there can be two type of aliases i.e. discon_alias and invalid_alias. Usage of discon_alias in case of non-directories may corrupt dcache and leads to kernel crash. Changes made to avoid use of discon_alias in case of non-directories. Seagate-bug-id: MRP-2739, MRP-3601 Signed-off-by: Lokesh Nagappa Jaliminche Reviewed-by: Ujjwal Lanjewar Reviewed-by: Ashish Purkar Reviewed-by: Andrew Perepechko Tested-by: Parinay Vijayprakash Kondekar Reviewed-on: http://review.whamcloud.com/17732 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7613 Reviewed-by: Niu Yawei Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/llite/namei.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 788a3f0..b7d448f 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -363,7 +363,8 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) LASSERT(alias != dentry); spin_lock(&alias->d_lock); - if (alias->d_flags & DCACHE_DISCONNECTED) + if ((alias->d_flags & DCACHE_DISCONNECTED) && + S_ISDIR(inode->i_mode)) /* LASSERT(last_discon == NULL); LU-405, bz 20055 */ discon_alias = alias; else if (alias->d_parent == dentry->d_parent && -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/8] staging/lustre/llite: Fix suspicious dereference of pointer 'vma->vm_file'
From: Dmitry Eremin Remove useless LASSERT(vma->vm_file) because of if it's NULL it will crash early in file_inode(vma->vm_file). Signed-off-by: Dmitry Eremin Reviewed-on: http://review.whamcloud.com/21171 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8372 Reviewed-by: John L. Hammond Reviewed-by: Bob Glossman Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/llite/llite_mmap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c index 9d03e79..37f82ed 100644 --- a/drivers/staging/lustre/lustre/llite/llite_mmap.c +++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c @@ -429,7 +429,6 @@ static void ll_vm_open(struct vm_area_struct *vma) struct inode *inode= file_inode(vma->vm_file); struct vvp_object *vob = cl_inode2vvp(inode); - LASSERT(vma->vm_file); LASSERT(atomic_read(&vob->vob_mmap_cnt) >= 0); atomic_inc(&vob->vob_mmap_cnt); } @@ -442,7 +441,6 @@ static void ll_vm_close(struct vm_area_struct *vma) struct inode *inode = file_inode(vma->vm_file); struct vvp_object *vob = cl_inode2vvp(inode); - LASSERT(vma->vm_file); atomic_dec(&vob->vob_mmap_cnt); LASSERT(atomic_read(&vob->vob_mmap_cnt) >= 0); } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/8] staging/lustre: const correct set_lock_data()
From: "John L. Hammond" Change the __u64 *cookie parameter of md_ops->set_lock_data() to const struct lustre_handle *lockh. Signed-off-by: John L. Hammond Reviewed-on: http://review.whamcloud.com/17072 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7403 Reviewed-by: Frank Zago Reviewed-by: James Simmons Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/obd.h | 3 ++- drivers/staging/lustre/lustre/include/obd_class.h| 3 ++- drivers/staging/lustre/lustre/llite/file.c | 2 +- drivers/staging/lustre/lustre/llite/llite_internal.h | 5 ++--- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 2 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 5 +++-- drivers/staging/lustre/lustre/mdc/mdc_internal.h | 3 ++- drivers/staging/lustre/lustre/mdc/mdc_locks.c| 8 drivers/staging/lustre/lustre/mdc/mdc_request.c | 5 ++--- 9 files changed, 19 insertions(+), 17 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index ac620fd..ed0fd41 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -1023,7 +1023,8 @@ struct md_ops { struct lookup_intent *); int (*clear_open_replay_data)(struct obd_export *, struct obd_client_handle *); - int (*set_lock_data)(struct obd_export *, __u64 *, void *, __u64 *); + int (*set_lock_data)(struct obd_export *, const struct lustre_handle *, +void *, __u64 *); enum ldlm_mode (*lock_match)(struct obd_export *, __u64, const struct lu_fid *, enum ldlm_type, diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 79fc041..4f48968 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -1610,7 +1610,8 @@ static inline int md_clear_open_replay_data(struct obd_export *exp, } static inline int md_set_lock_data(struct obd_export *exp, - __u64 *lockh, void *data, __u64 *bits) + const struct lustre_handle *lockh, + void *data, __u64 *bits) { EXP_CHECK_MD_OP(exp, set_lock_data); EXP_MD_COUNTER_INCREMENT(exp, set_lock_data); diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 55ccd84..13ff212 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -3629,7 +3629,7 @@ static int ll_layout_lock_set(struct lustre_handle *lockh, enum ldlm_mode mode, PFID(&lli->lli_fid), inode, reconf); /* in case this is a caching lock and reinstate with new inode */ - md_set_lock_data(sbi->ll_md_exp, &lockh->cookie, inode, NULL); + md_set_lock_data(sbi->ll_md_exp, lockh, inode, NULL); lock_res_and_lock(lock); lvb_ready = ldlm_is_lvb_ready(lock); diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index a5a3023..cbd5bc5 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -1243,7 +1243,7 @@ static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode, CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"%p for remote lock %#llx\n", PFID(ll_inode2fid(inode)), inode, handle.cookie); - md_set_lock_data(exp, &handle.cookie, inode, NULL); + md_set_lock_data(exp, &handle, inode, NULL); } handle.cookie = it->it_lock_handle; @@ -1251,8 +1251,7 @@ static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode, CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"%p for lock %#llx\n", PFID(ll_inode2fid(inode)), inode, handle.cookie); - md_set_lock_data(exp, &handle.cookie, inode, -&it->it_lock_bits); + md_set_lock_data(exp, &handle, inode, &it->it_lock_bits); it->it_lock_set = 1; } diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index 62f6bd0..85cc5cb 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -250,7 +250,7 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct mdt_body *mbody, ptlrpc_req_finished(req); } - md_set_lock_data(tgt->ltd_exp, &lockh->cookie, inode, NULL); + md_
[PATCH 7/8] staging/lustre: release MGC device if connect fails
From: "John L. Hammond" In lustre_fill_super() if lustre_start_mgc() fails then call lustre_common_put_super() to release a reference on the MGC device attached to the LSI. Signed-off-by: John L. Hammond Reviewed-on: http://review.whamcloud.com/20851 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8297 Reviewed-by: Andreas Dilger Reviewed-by: Mike Pershin Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index ae702ce..0273768 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -1144,7 +1144,7 @@ static int lustre_fill_super(struct super_block *sb, void *data, int silent) } else { rc = lustre_start_mgc(sb); if (rc) { - lustre_put_lsi(sb); + lustre_common_put_super(sb); goto out; } /* Connect and start */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/8] staging/lustre/mdc: fix panic at mdc_free_open()
From: Alexander Boyko Assertion was happened for open request when rq_replay is set to 1. ASSERTION(mod->mod_open_req->rq_replay == 0) But this situation is not fatal for client, and could happened when mdc_close() failed. The fix allow to free such requests. If mdc_close fail, MDS doesn`t receive close request from client. And in a worst case client would be evicted. The test recreates issue when mdc_close failed and client asserts: ASSERTION( mod->mod_open_req->rq_replay == 0 ) failed Signed-off-by: Alexander Boyko Seagate-bug-id: MRP-3156 Reviewed-on: http://review.whamcloud.com/17495 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5282 Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Signed-off-by: Oleg Drokin --- .../staging/lustre/lustre/include/obd_support.h| 1 + drivers/staging/lustre/lustre/mdc/mdc_request.c| 50 ++ 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h index 0c29a33..4a9fe88 100644 --- a/drivers/staging/lustre/lustre/include/obd_support.h +++ b/drivers/staging/lustre/lustre/include/obd_support.h @@ -402,6 +402,7 @@ extern char obd_jobid_var[]; #define OBD_FAIL_MDC_GETATTR_ENQUEUE 0x803 #define OBD_FAIL_MDC_RPCS_SEM 0x804 #define OBD_FAIL_MDC_LIGHTWEIGHT0x805 +#define OBD_FAIL_MDC_CLOSE 0x806 #define OBD_FAIL_MGS0x900 #define OBD_FAIL_MGS_ALL_REQUEST_NET 0x901 diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 91c0b45..8369afd 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -677,9 +677,15 @@ static void mdc_free_open(struct md_open_data *mod) imp_connect_disp_stripe(mod->mod_open_req->rq_import)) committed = 1; - LASSERT(mod->mod_open_req->rq_replay == 0); - - DEBUG_REQ(D_RPCTRACE, mod->mod_open_req, "free open request\n"); + /* +* No reason to asssert here if the open request has +* rq_replay == 1. It means that mdc_close failed, and +* close request wasn`t sent. It is not fatal to client. +* The worst thing is eviction if the client gets open lock +*/ + DEBUG_REQ(D_RPCTRACE, mod->mod_open_req, + "free open request rq_replay = %d\n", + mod->mod_open_req->rq_replay); ptlrpc_request_committed(mod->mod_open_req, committed); if (mod->mod_close_req) @@ -749,22 +755,10 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data, } *request = NULL; - req = ptlrpc_request_alloc(class_exp2cliimp(exp), req_fmt); - if (!req) - return -ENOMEM; - - rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_CLOSE); - if (rc) { - ptlrpc_request_free(req); - return rc; - } - - /* To avoid a livelock (bug 7034), we need to send CLOSE RPCs to a -* portal whose threads are not taking any DLM locks and are therefore -* always progressing -*/ - req->rq_request_portal = MDS_READPAGE_PORTAL; - ptlrpc_at_set_req_timeout(req); + if (OBD_FAIL_CHECK(OBD_FAIL_MDC_CLOSE)) + req = NULL; + else + req = ptlrpc_request_alloc(class_exp2cliimp(exp), req_fmt); /* Ensure that this close's handle is fixed up during replay. */ if (likely(mod)) { @@ -785,6 +779,23 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data, CDEBUG(D_HA, "couldn't find open req; expecting close error\n"); } + if (!req) { + /* +* TODO: repeat close after errors +*/ + CWARN("%s: close of FID "DFID" failed, file reference will be dropped when this client unmounts or is evicted\n", + obd->obd_name, PFID(&op_data->op_fid1)); + rc = -ENOMEM; + goto out; + } + + /* +* To avoid a livelock (bug 7034), we need to send CLOSE RPCs to a +* portal whose threads are not taking any DLM locks and are therefore +* always progressing +*/ + req->rq_request_portal = MDS_READPAGE_PORTAL; + ptlrpc_at_set_req_timeout(req); mdc_close_pack(req, op_data); @@ -830,6 +841,7 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data, } } +out: if (mod) { if (rc != 0) mod->mod_close_req = NULL; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: android: ion: ion.c fix parenthesis alignment
Fix checkpatch.pl warning about "Alignment should match open parenthesis". --- drivers/staging/android/ion/ion.c | 42 +++ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 88dd17e..291d5b8 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -174,10 +174,10 @@ static void ion_buffer_add(struct ion_device *dev, /* this function should only be called while dev->lock is held */ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, -struct ion_device *dev, -unsigned long len, -unsigned long align, -unsigned long flags) + struct ion_device *dev, + unsigned long len, + unsigned long align, + unsigned long flags) { struct ion_buffer *buffer; struct sg_table *table; @@ -331,7 +331,7 @@ static void ion_buffer_remove_from_handle(struct ion_buffer *buffer) } static struct ion_handle *ion_handle_create(struct ion_client *client, -struct ion_buffer *buffer) + struct ion_buffer *buffer) { struct ion_handle *handle; @@ -421,7 +421,7 @@ static struct ion_handle *ion_handle_lookup(struct ion_client *client, } static struct ion_handle *ion_handle_get_by_id_nolock(struct ion_client *client, - int id) + int id) { struct ion_handle *handle; @@ -581,7 +581,7 @@ static void *ion_buffer_kmap_get(struct ion_buffer *buffer) } vaddr = buffer->heap->ops->map_kernel(buffer->heap, buffer); if (WARN_ONCE(vaddr == NULL, - "heap->ops->map_kernel should return ERR_PTR on error")) + "heap->ops->map_kernel should return ERR_PTR on error")) return ERR_PTR(-EINVAL); if (IS_ERR(vaddr)) return vaddr; @@ -750,7 +750,7 @@ static const struct file_operations debug_client_fops = { }; static int ion_get_client_serial(const struct rb_root *root, - const unsigned char *name) +const unsigned char *name) { int serial = -1; struct rb_node *node; @@ -839,7 +839,7 @@ struct ion_client *ion_client_create(struct ion_device *dev, path = dentry_path(dev->clients_debug_root, buf, 256); pr_err("Failed to create client debugfs at %s/%s\n", - path, client->display_name); + path, client->display_name); } up_write(&dev->lock); @@ -907,7 +907,7 @@ static void ion_unmap_dma_buf(struct dma_buf_attachment *attachment, } void ion_pages_sync_for_device(struct device *dev, struct page *page, - size_t size, enum dma_data_direction dir) + size_t size, enum dma_data_direction dir) { struct scatterlist sg; @@ -947,7 +947,7 @@ static void ion_buffer_sync_for_device(struct ion_buffer *buffer, if (ion_buffer_page_is_dirty(page)) ion_pages_sync_for_device(dev, ion_buffer_page(page), - PAGE_SIZE, dir); + PAGE_SIZE, dir); ion_buffer_page_clean(buffer->pages + i); } @@ -1025,7 +1025,7 @@ static int ion_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) if (!buffer->heap->ops->map_user) { pr_err("%s: this heap does not define a method for mapping to userspace\n", - __func__); + __func__); return -EINVAL; } @@ -1116,7 +1116,7 @@ static struct dma_buf_ops dma_buf_ops = { }; struct dma_buf *ion_share_dma_buf(struct ion_client *client, - struct ion_handle *handle) + struct ion_handle *handle) { DEFINE_DMA_BUF_EXPORT_INFO(exp_info); struct ion_buffer *buffer; @@ -1291,9 +1291,9 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) struct ion_handle *handle; handle = ion_alloc(client, data.allocation.len, - data.allocation.align, - data.allocation.heap_id_mask, - data.allocation.flags); + data.allocation.align, +
Re: [PATCH 1/2] staging: android: ion: Do not BUG on handle client mismatch
On Tue, Aug 23, 2016 at 02:00:06PM -0700, Laura Abbott wrote: > It's pretty harsh because the users of Ion need a less than subtle hint > that something is broken. From experience, warning and leaking memory > just leads to a system that limps along and warnings that get ignored. > At long as Ion is primarily used for Android, I think keeping the > BUG makes sense. If Ion ever gets a large amount of use outside of > Android, moving away from the bug would be appropriate. Well, if Android users really are *that* ignorant of warning messages, I guess we'll keep the BUG_ON in ion_free. I'll refactor the patch to remove only the BUG_ON in ion_free_nolock as suggested. Best Regards, Johanna Abrahamsson ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 8/8] staging/lustre/o2iblnd: handle mixed page size configurations.
From: James Simmons Currently it is not possible to send LNet traffic between two nodes using infiniband hardware that have different page sizes for the case when RDMA fragments are used. When two nodes establish a connection they tell the other node the maximum number of RDMA fragments they support. The issue is that the units are pages, and 256 64K pages corresponds to 16MB of data, whereas a 4K page system is limited to messages with 1MB of data. The solution is to report over the wire the maximum number of fragments in 4K unites regardless of the native page size. The recipient then uses its native page size to translate into the maximum number of pages sized fragments it can send to the other node. Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/21304 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7650 Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Signed-off-by: Oleg Drokin --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c| 14 +++--- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h| 13 ++--- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 55 ++ 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index e93dbeb..c7a5d49 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -128,6 +128,7 @@ static int kiblnd_msgtype2size(int type) static int kiblnd_unpack_rd(struct kib_msg *msg, int flip) { struct kib_rdma_desc *rd; + int msg_size; int nob; int n; int i; @@ -146,12 +147,6 @@ static int kiblnd_unpack_rd(struct kib_msg *msg, int flip) n = rd->rd_nfrags; - if (n <= 0 || n > IBLND_MAX_RDMA_FRAGS) { - CERROR("Bad nfrags: %d, should be 0 < n <= %d\n", - n, IBLND_MAX_RDMA_FRAGS); - return 1; - } - nob = offsetof(struct kib_msg, ibm_u) + kiblnd_rd_msg_size(rd, msg->ibm_type, n); @@ -161,6 +156,13 @@ static int kiblnd_unpack_rd(struct kib_msg *msg, int flip) return 1; } + msg_size = kiblnd_rd_size(rd); + if (msg_size <= 0 || msg_size > LNET_MAX_PAYLOAD) { + CERROR("Bad msg_size: %d, should be 0 < n <= %d\n", + msg_size, LNET_MAX_PAYLOAD); + return 1; + } + if (!flip) return 0; diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index 3cf8942..1457697 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -113,8 +113,9 @@ extern struct kib_tunables kiblnd_tunables; #define IBLND_OOB_CAPABLE(v) ((v) != IBLND_MSG_VERSION_1) #define IBLND_OOB_MSGS(v) (IBLND_OOB_CAPABLE(v) ? 2 : 0) -#define IBLND_MSG_SIZE (4 << 10)/* max size of queued messages (inc hdr) */ -#define IBLND_MAX_RDMA_FRAGSLNET_MAX_IOV /* max # of fragments supported */ +#define IBLND_FRAG_SHIFT (PAGE_SHIFT - 12) /* frag size on wire is in 4K units */ +#define IBLND_MSG_SIZE (4 << 10) /* max size of queued messages (inc hdr) */ +#define IBLND_MAX_RDMA_FRAGS (LNET_MAX_PAYLOAD >> 12)/* max # of fragments supported in 4K size */ // /* derived constants... */ @@ -133,8 +134,8 @@ extern struct kib_tunables kiblnd_tunables; /* WRs and CQEs (per connection) */ #define IBLND_RECV_WRS(c) IBLND_RX_MSGS(c) #define IBLND_SEND_WRS(c) \ - ((c->ibc_max_frags + 1) * kiblnd_concurrent_sends(c->ibc_version, \ - c->ibc_peer->ibp_ni)) + (((c->ibc_max_frags + 1) << IBLND_FRAG_SHIFT) * \ + kiblnd_concurrent_sends(c->ibc_version, c->ibc_peer->ibp_ni)) #define IBLND_CQ_ENTRIES(c)(IBLND_RECV_WRS(c) + IBLND_SEND_WRS(c)) struct kib_hca_dev; @@ -609,14 +610,14 @@ kiblnd_cfg_rdma_frags(struct lnet_ni *ni) tunables = &ni->ni_lnd_tunables->lt_tun_u.lt_o2ib; mod = tunables->lnd_map_on_demand; - return mod ? mod : IBLND_MAX_RDMA_FRAGS; + return mod ? mod : IBLND_MAX_RDMA_FRAGS >> IBLND_FRAG_SHIFT; } static inline int kiblnd_rdma_frags(int version, struct lnet_ni *ni) { return version == IBLND_MSG_VERSION_1 ? - IBLND_MAX_RDMA_FRAGS : + (IBLND_MAX_RDMA_FRAGS >> IBLND_FRAG_SHIFT) : kiblnd_cfg_rdma_frags(ni); } diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index 1563428..3a86879 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -764,7 +764,6 @@ kiblnd_post
[PATCH v2 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent
Bus ids for VMBus devices in /sys/bus/vmbus/devices/ are not guaranteed to be persistent across reboot or kernel restart and this causes problems for some tools. E.g. kexec tools use these ids to identify NIC on kdump. Fix the issue by using if_instance from channel offer as the unique id instead of an auto incremented counter. Changes since v1: - Use if_instance instead of relid [K. Y. Srinivasan] Vitaly Kuznetsov (2): Drivers: hv: make VMBus bus ids persistent Drivers: hv: get rid of id in struct vmbus_channel drivers/hv/channel_mgmt.c | 2 -- drivers/hv/vmbus_drv.c| 4 ++-- include/linux/hyperv.h| 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] Drivers: hv: get rid of id in struct vmbus_channel
The auto incremented counter is not being used anymore, get rid of it. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 2 -- include/linux/hyperv.h| 3 --- 2 files changed, 5 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index b6c1211..4b4a41d 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -251,14 +251,12 @@ EXPORT_SYMBOL_GPL(vmbus_prep_negotiate_resp); */ static struct vmbus_channel *alloc_channel(void) { - static atomic_t chan_num = ATOMIC_INIT(0); struct vmbus_channel *channel; channel = kzalloc(sizeof(*channel), GFP_ATOMIC); if (!channel) return NULL; - channel->id = atomic_inc_return(&chan_num); channel->acquire_ring_lock = true; spin_lock_init(&channel->inbound_lock); spin_lock_init(&channel->lock); diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index b10954a..d9371a7 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -701,9 +701,6 @@ struct vmbus_device { }; struct vmbus_channel { - /* Unique channel id */ - int id; - struct list_head listentry; struct hv_device *device_obj; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] Drivers: hv: make VMBus bus ids persistent
Some tools use bus ids to identify devices and they count on the fact that these ids are persistent across reboot. This may be not true for VMBus as we use auto incremented counter from alloc_channel() as such id. Switch to using if_instance from channel offer, this id is supposed to be persistent. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index e82f7e1..ca7ae7a 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -961,8 +961,8 @@ int vmbus_device_register(struct hv_device *child_device_obj) { int ret = 0; - dev_set_name(&child_device_obj->device, "vmbus_%d", -child_device_obj->channel->id); + dev_set_name(&child_device_obj->device, "vmbus-%pUl", +child_device_obj->channel->offermsg.offer.if_instance.b); child_device_obj->device.bus = &hv_bus; child_device_obj->device.parent = &hv_acpi_dev->dev; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: android: ion: Do not BUG on handle client mismatch
The ion_free_nolock() function should not BUG on a handle client mismatch. Signed-off-by: Johanna Abrahamsson --- drivers/staging/android/ion/ion.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 291d5b8..575407d 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -550,8 +550,6 @@ static void ion_free_nolock(struct ion_client *client, { bool valid_handle; - BUG_ON(client != handle->client); - valid_handle = ion_handle_validate(client, handle); if (!valid_handle) { -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: android: ion: Remove valid_handle variable in ion_free_nolock
It is not neccessary to save the value of ion_handle_validate since it is only used once. Signed-off-by: Johanna Abrahamsson --- drivers/staging/android/ion/ion.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 575407d..deaa93a 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -548,11 +548,7 @@ EXPORT_SYMBOL(ion_alloc); static void ion_free_nolock(struct ion_client *client, struct ion_handle *handle) { - bool valid_handle; - - valid_handle = ion_handle_validate(client, handle); - - if (!valid_handle) { + if (!ion_handle_validate(client, handle)) { WARN(1, "%s: invalid handle passed to free.\n", __func__); return; } -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/2] staging: android: ion: cleanup of the ion_free_nolock function
This is a small cleanup of the ion_free_nolock() method. They are in a patchset because they depend lightly on each other, as in that patch 2 won't apply due to changes in the context. Since this is my first patchset please let me know if I am doing it wrong. v2: Kept the BUG_ON in ion_free as per request from Laura Abbott Johanna Abrahamsson (2): staging: android: ion: Do not BUG on handle client mismatch staging: android: ion: Remove valid_handle variable in ion_free_nolock drivers/staging/android/ion/ion.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/14] staging: fsl-mc: move resource pool init/cleanup into allocator
The resource pool init/cleanup functions logically belong in the allocator. Move them to the allocator and rename to reflect the move out of the dprc-driver. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dprc-driver.c | 55 ++- drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 49 drivers/staging/fsl-mc/include/mc-bus.h | 4 ++ 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index 83e72b3..89d53da 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -190,55 +190,6 @@ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev, } } -static void dprc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev) -{ - int pool_type; - struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev); - - for (pool_type = 0; pool_type < FSL_MC_NUM_POOL_TYPES; pool_type++) { - struct fsl_mc_resource_pool *res_pool = - &mc_bus->resource_pools[pool_type]; - - res_pool->type = pool_type; - res_pool->max_count = 0; - res_pool->free_count = 0; - res_pool->mc_bus = mc_bus; - INIT_LIST_HEAD(&res_pool->free_list); - mutex_init(&res_pool->mutex); - } -} - -static void dprc_cleanup_resource_pool(struct fsl_mc_device *mc_bus_dev, - enum fsl_mc_pool_type pool_type) -{ - struct fsl_mc_resource *resource; - struct fsl_mc_resource *next; - struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev); - struct fsl_mc_resource_pool *res_pool = - &mc_bus->resource_pools[pool_type]; - int free_count = 0; - - WARN_ON(res_pool->type != pool_type); - WARN_ON(res_pool->free_count != res_pool->max_count); - - list_for_each_entry_safe(resource, next, &res_pool->free_list, node) { - free_count++; - WARN_ON(resource->type != res_pool->type); - WARN_ON(resource->parent_pool != res_pool); - devm_kfree(&mc_bus_dev->dev, resource); - } - - WARN_ON(free_count != res_pool->free_count); -} - -static void dprc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev) -{ - int pool_type; - - for (pool_type = 0; pool_type < FSL_MC_NUM_POOL_TYPES; pool_type++) - dprc_cleanup_resource_pool(mc_bus_dev, pool_type); -} - /** * dprc_scan_objects - Discover objects in a DPRC * @@ -363,7 +314,7 @@ int dprc_scan_container(struct fsl_mc_device *mc_bus_dev) unsigned int irq_count; struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev); - dprc_init_all_resource_pools(mc_bus_dev); + fsl_mc_init_all_resource_pools(mc_bus_dev); /* * Discover objects in the DPRC: @@ -390,7 +341,7 @@ int dprc_scan_container(struct fsl_mc_device *mc_bus_dev) return 0; error: - dprc_cleanup_all_resource_pools(mc_bus_dev); + fsl_mc_cleanup_all_resource_pools(mc_bus_dev); return error; } EXPORT_SYMBOL_GPL(dprc_scan_container); @@ -802,7 +753,7 @@ static int dprc_remove(struct fsl_mc_device *mc_dev) dev_set_msi_domain(&mc_dev->dev, NULL); } - dprc_cleanup_all_resource_pools(mc_dev); + fsl_mc_cleanup_all_resource_pools(mc_dev); error = dprc_close(mc_dev->mc_io, 0, mc_dev->mc_handle); if (error < 0) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index 6550564..9695f44 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -668,6 +668,55 @@ void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev) } EXPORT_SYMBOL_GPL(fsl_mc_free_irqs); +void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev) +{ + int pool_type; + struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev); + + for (pool_type = 0; pool_type < FSL_MC_NUM_POOL_TYPES; pool_type++) { + struct fsl_mc_resource_pool *res_pool = + &mc_bus->resource_pools[pool_type]; + + res_pool->type = pool_type; + res_pool->max_count = 0; + res_pool->free_count = 0; + res_pool->mc_bus = mc_bus; + INIT_LIST_HEAD(&res_pool->free_list); + mutex_init(&res_pool->mutex); + } +} + +static void fsl_mc_cleanup_resource_pool(struct fsl_mc_device *mc_bus_dev, +enum fsl_mc_pool_type pool_type) +{ + struct fsl_mc_resource *resource; + struct fsl_mc_resource *next; + struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev); + struct fsl_mc_resource_pool *res_pool = + &mc_bus->resource_pools
[PATCH 10/14] staging: fsl-mc: move bus definitions from mc.h to mc-bus.h
move public bus-related definitions to the proper mc-bus.h header. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/include/mc-bus.h | 16 drivers/staging/fsl-mc/include/mc.h | 16 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/fsl-mc/include/mc-bus.h b/drivers/staging/fsl-mc/include/mc-bus.h index 7eba588..2cdb538 100644 --- a/drivers/staging/fsl-mc/include/mc-bus.h +++ b/drivers/staging/fsl-mc/include/mc-bus.h @@ -24,6 +24,13 @@ struct msi_domain_info; */ #define FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS 256 +#ifdef CONFIG_FSL_MC_BUS +#define dev_is_fsl_mc(_dev) ((_dev)->bus == &fsl_mc_bus_type) +#else +/* If fsl-mc bus is not present device cannot belong to fsl-mc bus */ +#define dev_is_fsl_mc(_dev) (0) +#endif + /** * struct fsl_mc_resource_pool - Pool of MC resources of a given * type @@ -93,4 +100,13 @@ void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev); void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev); +bool fsl_mc_bus_exists(void); + +void fsl_mc_get_root_dprc(struct device *dev, + struct device **root_dprc_dev); + +bool fsl_mc_is_root_dprc(struct device *dev); + +extern struct bus_type fsl_mc_bus_type; + #endif /* _FSL_MC_MCBUS_H_ */ diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h index b093aba..789e6a8 100644 --- a/drivers/staging/fsl-mc/include/mc.h +++ b/drivers/staging/fsl-mc/include/mc.h @@ -160,13 +160,6 @@ struct fsl_mc_device { #define to_fsl_mc_device(_dev) \ container_of(_dev, struct fsl_mc_device, dev) -#ifdef CONFIG_FSL_MC_BUS -#define dev_is_fsl_mc(_dev) ((_dev)->bus == &fsl_mc_bus_type) -#else -/* If fsl-mc bus is not present device cannot belong to fsl-mc bus */ -#define dev_is_fsl_mc(_dev) (0) -#endif - /* * module_fsl_mc_driver() - Helper macro for drivers that don't do * anything special in module init/exit. This eliminates a lot of @@ -188,11 +181,6 @@ int __must_check __fsl_mc_driver_register(struct fsl_mc_driver *fsl_mc_driver, void fsl_mc_driver_unregister(struct fsl_mc_driver *driver); -bool fsl_mc_bus_exists(void); - -void fsl_mc_get_root_dprc(struct device *dev, - struct device **root_dprc_dev); - int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, u16 mc_io_flags, struct fsl_mc_io **new_mc_io); @@ -211,8 +199,4 @@ int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev); void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev); -bool fsl_mc_is_root_dprc(struct device *dev); - -extern struct bus_type fsl_mc_bus_type; - #endif /* _FSL_MC_H_ */ -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/14] staging: fsl-mc: restructuring and cleanup
In preparation for moving this driver out of staging a review of the .h files intended to be public in include/linux/fsl turned up some needed cleanup. This patch series makes no functional changes to the driver, but does some restructuring to put public/private definitions in the right places and have a clear split between driver sub-components. -update the public mc.h and mc-bus.h files to contain only public definitions -move all private definitions to their corresponding .c files or to the new fsl-mc-private.h file for definitions private to the bus driver -rename some source files to improve clarity -create a new mc-io component to contain all APIs related to the mc-io abstraction -remove unneeded includes and forward definitions Stuart Yoder (14): staging: fsl-mc: rename mc-private.h to mc-bus.h staging: fsl-mc: improve naming of source files staging: fsl-mc: move allocator private definitions out of mc-bus.h staging: fsl-mc: move resource pool init/cleanup into allocator staging: fsl-mc: create private include for fsl-mc bus components staging: fsl-mc: move dprc-driver private definitions out of mc-bus.h staging: fsl-mc: move bus private definitions into fsl-mc-bus.c staging: fsl-mc: make fsl_mc_get_root_dprc public staging: fsl-mc: remove unneeded forward declarations staging: fsl-mc: move bus definitions from mc.h to mc-bus.h staging: fsl-mc: remove unneeded includes staging: fsl-mc: split mc-io definitions into a separate file staging: fsl-mc: explicitly include files where they are needed staging: fsl-mc: make order of includes consistent drivers/staging/fsl-mc/bus/Makefile| 7 +- drivers/staging/fsl-mc/bus/dpmcp.c | 1 + drivers/staging/fsl-mc/bus/dpmng.c | 1 + drivers/staging/fsl-mc/bus/dprc-driver.c | 67 + drivers/staging/fsl-mc/bus/dprc.c | 1 + .../bus/{mc-allocator.c => fsl-mc-allocator.c} | 202 - .../staging/fsl-mc/bus/{mc-bus.c => fsl-mc-bus.c} | 43 ++- .../staging/fsl-mc/bus/{mc-msi.c => fsl-mc-msi.c} | 4 +- drivers/staging/fsl-mc/bus/fsl-mc-private.h| 52 .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 4 +- drivers/staging/fsl-mc/bus/mc-io.c | 320 + drivers/staging/fsl-mc/bus/mc-sys.c| 155 +- .../fsl-mc/include/{mc-private.h => mc-bus.h} | 91 ++ drivers/staging/fsl-mc/include/mc-sys.h| 15 - drivers/staging/fsl-mc/include/mc.h| 20 -- 15 files changed, 520 insertions(+), 463 deletions(-) rename drivers/staging/fsl-mc/bus/{mc-allocator.c => fsl-mc-allocator.c} (80%) rename drivers/staging/fsl-mc/bus/{mc-bus.c => fsl-mc-bus.c} (94%) rename drivers/staging/fsl-mc/bus/{mc-msi.c => fsl-mc-msi.c} (98%) create mode 100644 drivers/staging/fsl-mc/bus/fsl-mc-private.h create mode 100644 drivers/staging/fsl-mc/bus/mc-io.c rename drivers/staging/fsl-mc/include/{mc-private.h => mc-bus.h} (53%) -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/14] staging: fsl-mc: create private include for fsl-mc bus components
The mc-bus.h header file is intended to be public for system related drivers that may need to make fsl-mc bus specific calls-- gic its, smmu, vfio. But, currently it contains definitions private/internal to the fsl-mc bus itself. Split those definitions out into a new fsl-mc bus private header. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dprc-driver.c | 1 + drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 1 + drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 1 + drivers/staging/fsl-mc/bus/fsl-mc-private.h | 44 +++ drivers/staging/fsl-mc/include/mc-bus.h | 23 -- 5 files changed, 47 insertions(+), 23 deletions(-) create mode 100644 drivers/staging/fsl-mc/bus/fsl-mc-private.h diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index 89d53da..576244b 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -16,6 +16,7 @@ #include #include #include "dprc-cmd.h" +#include "fsl-mc-private.h" struct dprc_child_objs { int child_count; diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index 9695f44..e865375 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -15,6 +15,7 @@ #include "../include/dpcon-cmd.h" #include "dpmcp-cmd.h" #include "dpmcp.h" +#include "fsl-mc-private.h" #include #define FSL_MC_IS_ALLOCATABLE(_obj_type) \ diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 975d30b..180ff07 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -20,6 +20,7 @@ #include #include "../include/dpmng.h" #include "../include/mc-sys.h" +#include "fsl-mc-private.h" #include "dprc-cmd.h" static struct kmem_cache *mc_dev_cache; diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-private.h b/drivers/staging/fsl-mc/bus/fsl-mc-private.h new file mode 100644 index 000..1479934 --- /dev/null +++ b/drivers/staging/fsl-mc/bus/fsl-mc-private.h @@ -0,0 +1,44 @@ +/* + * Freescale Management Complex (MC) bus private declarations + * + * Copyright (C) 2016 Freescale Semiconductor, Inc. + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ +#ifndef _FSL_MC_PRIVATE_H_ +#define _FSL_MC_PRIVATE_H_ + +int __must_check fsl_mc_device_add(struct dprc_obj_desc *obj_desc, + struct fsl_mc_io *mc_io, + struct device *parent_dev, + struct fsl_mc_device **new_mc_dev); + +void fsl_mc_device_remove(struct fsl_mc_device *mc_dev); + +int __init dprc_driver_init(void); + +void dprc_driver_exit(void); + +int __init fsl_mc_allocator_driver_init(void); + +void fsl_mc_allocator_driver_exit(void); + +int __must_check fsl_mc_resource_allocate(struct fsl_mc_bus *mc_bus, + enum fsl_mc_pool_type pool_type, + struct fsl_mc_resource + **new_resource); + +void fsl_mc_resource_free(struct fsl_mc_resource *resource); + +int fsl_mc_msi_domain_alloc_irqs(struct device *dev, +unsigned int irq_count); + +void fsl_mc_msi_domain_free_irqs(struct device *dev); + +int __init its_fsl_mc_msi_init(void); + +void its_fsl_mc_msi_cleanup(void); + +#endif /* _FSL_MC_PRIVATE_H_ */ diff --git a/drivers/staging/fsl-mc/include/mc-bus.h b/drivers/staging/fsl-mc/include/mc-bus.h index 2098b3c..8a32e55 100644 --- a/drivers/staging/fsl-mc/include/mc-bus.h +++ b/drivers/staging/fsl-mc/include/mc-bus.h @@ -102,13 +102,6 @@ struct fsl_mc_bus { #define to_fsl_mc_bus(_mc_dev) \ container_of(_mc_dev, struct fsl_mc_bus, mc_dev) -int __must_check fsl_mc_device_add(struct dprc_obj_desc *obj_desc, - struct fsl_mc_io *mc_io, - struct device *parent_dev, - struct fsl_mc_device **new_mc_dev); - -void fsl_mc_device_remove(struct fsl_mc_device *mc_dev); - int dprc_scan_container(struct fsl_mc_device *mc_bus_dev); int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev, @@ -122,13 +115,6 @@ int __init fsl_mc_allocator_driver_init(void); void fsl_mc_allocator_driver_exit(void); -int __must_check fsl_mc_resource_allocate(struct fsl_mc_bus *mc_bus, - enum fsl_mc_pool_type pool_type, - struct fsl_mc_resource - **new_resource); - -void fsl_mc_resource_free(struct fsl_mc_resource *resource); - struct irq_domain *fsl_mc_msi_create_irq_domain(struc
[PATCH 07/14] staging: fsl-mc: move bus private definitions into fsl-mc-bus.c
Move definitions that are private to fsl-mc-bus.c out of the public mc-bus.h and mc.h headers. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 33 + drivers/staging/fsl-mc/include/mc-bus.h | 28 drivers/staging/fsl-mc/include/mc.h | 5 - 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 180ff07..08363f8 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -26,6 +26,39 @@ static struct kmem_cache *mc_dev_cache; /** + * Default DMA mask for devices on a fsl-mc bus + */ +#define FSL_MC_DEFAULT_DMA_MASK(~0ULL) + +/** + * struct fsl_mc - Private data of a "fsl,qoriq-mc" platform device + * @root_mc_bus_dev: MC object device representing the root DPRC + * @num_translation_ranges: number of entries in addr_translation_ranges + * @translation_ranges: array of bus to system address translation ranges + */ +struct fsl_mc { + struct fsl_mc_device *root_mc_bus_dev; + u8 num_translation_ranges; + struct fsl_mc_addr_translation_range *translation_ranges; +}; + +/** + * struct fsl_mc_addr_translation_range - bus to system address translation + * range + * @mc_region_type: Type of MC region for the range being translated + * @start_mc_offset: Start MC offset of the range being translated + * @end_mc_offset: MC offset of the first byte after the range (last MC + * offset of the range is end_mc_offset - 1) + * @start_phys_addr: system physical address corresponding to start_mc_addr + */ +struct fsl_mc_addr_translation_range { + enum dprc_region_type mc_region_type; + u64 start_mc_offset; + u64 end_mc_offset; + phys_addr_t start_phys_addr; +}; + +/** * fsl_mc_bus_match - device to driver matching callback * @dev: the MC object device structure to match against * @drv: the device driver to search for matching MC object device id diff --git a/drivers/staging/fsl-mc/include/mc-bus.h b/drivers/staging/fsl-mc/include/mc-bus.h index 3f80506..9ea023b 100644 --- a/drivers/staging/fsl-mc/include/mc-bus.h +++ b/drivers/staging/fsl-mc/include/mc-bus.h @@ -29,34 +29,6 @@ struct irq_domain; struct msi_domain_info; /** - * struct fsl_mc - Private data of a "fsl,qoriq-mc" platform device - * @root_mc_bus_dev: MC object device representing the root DPRC - * @num_translation_ranges: number of entries in addr_translation_ranges - * @translation_ranges: array of bus to system address translation ranges - */ -struct fsl_mc { - struct fsl_mc_device *root_mc_bus_dev; - u8 num_translation_ranges; - struct fsl_mc_addr_translation_range *translation_ranges; -}; - -/** - * struct fsl_mc_addr_translation_range - bus to system address translation - * range - * @mc_region_type: Type of MC region for the range being translated - * @start_mc_offset: Start MC offset of the range being translated - * @end_mc_offset: MC offset of the first byte after the range (last MC - * offset of the range is end_mc_offset - 1) - * @start_phys_addr: system physical address corresponding to start_mc_addr - */ -struct fsl_mc_addr_translation_range { - enum dprc_region_type mc_region_type; - u64 start_mc_offset; - u64 end_mc_offset; - phys_addr_t start_phys_addr; -}; - -/** * struct fsl_mc_resource_pool - Pool of MC resources of a given * type * @type: type of resources in the pool diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h index 2d67535..ab439fa 100644 --- a/drivers/staging/fsl-mc/include/mc.h +++ b/drivers/staging/fsl-mc/include/mc.h @@ -112,11 +112,6 @@ struct fsl_mc_device_irq { #define FSL_MC_IS_DPRC 0x0001 /** - * Default DMA mask for devices on a fsl-mc bus - */ -#define FSL_MC_DEFAULT_DMA_MASK(~0ULL) - -/** * struct fsl_mc_device - MC object device object * @dev: Linux driver model device object * @dma_mask: Default DMA mask -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/14] staging: fsl-mc: remove unneeded forward declarations
Remove unneeded and duplicated forward declarations. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/include/mc-bus.h | 4 drivers/staging/fsl-mc/include/mc.h | 1 - 2 files changed, 5 deletions(-) diff --git a/drivers/staging/fsl-mc/include/mc-bus.h b/drivers/staging/fsl-mc/include/mc-bus.h index 9ea023b..7eba588 100644 --- a/drivers/staging/fsl-mc/include/mc-bus.h +++ b/drivers/staging/fsl-mc/include/mc-bus.h @@ -24,10 +24,6 @@ struct msi_domain_info; */ #define FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS 256 -struct device_node; -struct irq_domain; -struct msi_domain_info; - /** * struct fsl_mc_resource_pool - Pool of MC resources of a given * type diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h index a71342d..b093aba 100644 --- a/drivers/staging/fsl-mc/include/mc.h +++ b/drivers/staging/fsl-mc/include/mc.h @@ -21,7 +21,6 @@ struct fsl_mc_device; struct fsl_mc_io; -struct fsl_mc_bus; /** * struct fsl_mc_driver - MC object device driver object -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/14] staging: fsl-mc: rename mc-private.h to mc-bus.h
The definitions in mc-private.h are not strictly speaking 'private', they are bus-related definitions expected to be referenced by bus driver components as well as system components (gic, smmu, vfio). Rename mc-private.h to mc-bus.h to more accurately reflect expected use. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dprc-driver.c | 2 +- drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c| 2 +- drivers/staging/fsl-mc/bus/mc-allocator.c | 2 +- drivers/staging/fsl-mc/bus/mc-bus.c | 2 +- drivers/staging/fsl-mc/bus/mc-msi.c | 2 +- drivers/staging/fsl-mc/include/{mc-private.h => mc-bus.h} | 8 6 files changed, 9 insertions(+), 9 deletions(-) rename drivers/staging/fsl-mc/include/{mc-private.h => mc-bus.h} (97%) diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index 0523ba8..83e72b3 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -9,7 +9,7 @@ * warranty of any kind, whether express or implied. */ -#include "../include/mc-private.h" +#include "../include/mc-bus.h" #include "../include/mc-sys.h" #include #include diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c index d0c20d6..aac4379 100644 --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c @@ -9,7 +9,7 @@ * warranty of any kind, whether express or implied. */ -#include "../include/mc-private.h" +#include "../include/mc-bus.h" #include #include #include diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/mc-allocator.c index 0f50a07..3ebaecb 100644 --- a/drivers/staging/fsl-mc/bus/mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/mc-allocator.c @@ -8,7 +8,7 @@ * warranty of any kind, whether express or implied. */ -#include "../include/mc-private.h" +#include "../include/mc-bus.h" #include "../include/mc-sys.h" #include #include "../include/dpbp-cmd.h" diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/mc-bus.c index fe20c5d..975d30b 100644 --- a/drivers/staging/fsl-mc/bus/mc-bus.c +++ b/drivers/staging/fsl-mc/bus/mc-bus.c @@ -9,7 +9,7 @@ * warranty of any kind, whether express or implied. */ -#include "../include/mc-private.h" +#include "../include/mc-bus.h" #include #include #include diff --git a/drivers/staging/fsl-mc/bus/mc-msi.c b/drivers/staging/fsl-mc/bus/mc-msi.c index c7be156..6e39a98 100644 --- a/drivers/staging/fsl-mc/bus/mc-msi.c +++ b/drivers/staging/fsl-mc/bus/mc-msi.c @@ -9,7 +9,7 @@ * warranty of any kind, whether express or implied. */ -#include "../include/mc-private.h" +#include "../include/mc-bus.h" #include #include #include diff --git a/drivers/staging/fsl-mc/include/mc-private.h b/drivers/staging/fsl-mc/include/mc-bus.h similarity index 97% rename from drivers/staging/fsl-mc/include/mc-private.h rename to drivers/staging/fsl-mc/include/mc-bus.h index cab1ae9..7f847e6 100644 --- a/drivers/staging/fsl-mc/include/mc-private.h +++ b/drivers/staging/fsl-mc/include/mc-bus.h @@ -1,5 +1,5 @@ /* - * Freescale Management Complex (MC) bus private declarations + * Freescale Management Complex (MC) bus declarations * * Copyright (C) 2014 Freescale Semiconductor, Inc. * Author: German Rivera @@ -8,8 +8,8 @@ * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ -#ifndef _FSL_MC_PRIVATE_H_ -#define _FSL_MC_PRIVATE_H_ +#ifndef _FSL_MC_MCBUS_H_ +#define _FSL_MC_MCBUS_H_ #include "../include/mc.h" #include @@ -155,4 +155,4 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus, void fsl_mc_cleanup_irq_pool(struct fsl_mc_bus *mc_bus); -#endif /* _FSL_MC_PRIVATE_H_ */ +#endif /* _FSL_MC_MCBUS_H_ */ -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/14] staging: fsl-mc: make order of includes consistent
There are 3 kinds of headers included in the bus driver components-- misc linux/include files, public bus driver includes, and includes private to the bus driver. Cleanup the order and formatting of includes in the bus driver to be consistent: #include #include ../include/[file].h // public bus driver includes (eventually // destined for: linux/include/fsl) [blank line] #include "[file].h" // private bus driver includes Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dpmcp.c | 1 + drivers/staging/fsl-mc/bus/dpmng.c | 1 + drivers/staging/fsl-mc/bus/dprc-driver.c | 5 +++-- drivers/staging/fsl-mc/bus/dprc.c | 1 + drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 5 +++-- drivers/staging/fsl-mc/bus/fsl-mc-bus.c| 3 ++- drivers/staging/fsl-mc/bus/fsl-mc-msi.c| 2 +- drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 2 +- drivers/staging/fsl-mc/bus/mc-io.c | 2 +- drivers/staging/fsl-mc/bus/mc-sys.c| 6 +++--- 10 files changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpmcp.c b/drivers/staging/fsl-mc/bus/dpmcp.c index 0644017..bd63baa 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp.c +++ b/drivers/staging/fsl-mc/bus/dpmcp.c @@ -31,6 +31,7 @@ */ #include "../include/mc-sys.h" #include "../include/mc-cmd.h" + #include "dpmcp.h" #include "dpmcp-cmd.h" diff --git a/drivers/staging/fsl-mc/bus/dpmng.c b/drivers/staging/fsl-mc/bus/dpmng.c index 660bbe7..669f604 100644 --- a/drivers/staging/fsl-mc/bus/dpmng.c +++ b/drivers/staging/fsl-mc/bus/dpmng.c @@ -32,6 +32,7 @@ #include "../include/mc-sys.h" #include "../include/mc-cmd.h" #include "../include/dpmng.h" + #include "dpmng-cmd.h" /** diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index 5e34720..c5ee463 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -9,12 +9,13 @@ * warranty of any kind, whether express or implied. */ -#include "../include/mc-bus.h" -#include "../include/mc-sys.h" #include #include #include #include +#include "../include/mc-bus.h" +#include "../include/mc-sys.h" + #include "dprc-cmd.h" #include "fsl-mc-private.h" diff --git a/drivers/staging/fsl-mc/bus/dprc.c b/drivers/staging/fsl-mc/bus/dprc.c index c260549..ac4ed35 100644 --- a/drivers/staging/fsl-mc/bus/dprc.c +++ b/drivers/staging/fsl-mc/bus/dprc.c @@ -32,6 +32,7 @@ #include "../include/mc-sys.h" #include "../include/mc-cmd.h" #include "../include/dprc.h" + #include "dprc-cmd.h" /** diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index edcb5cc..2004fa7 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -8,13 +8,14 @@ * warranty of any kind, whether express or implied. */ +#include +#include #include "../include/mc-bus.h" #include "../include/mc-sys.h" -#include #include "../include/dpbp-cmd.h" #include "../include/dpcon-cmd.h" + #include "fsl-mc-private.h" -#include #define FSL_MC_IS_ALLOCATABLE(_obj_type) \ (strcmp(_obj_type, "dpbp") == 0 || \ diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 9023df3..03ebab8 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -9,7 +9,6 @@ * warranty of any kind, whether express or implied. */ -#include "../include/mc-bus.h" #include #include #include @@ -19,8 +18,10 @@ #include #include #include +#include "../include/mc-bus.h" #include "../include/dpmng.h" #include "../include/mc-sys.h" + #include "fsl-mc-private.h" #include "dprc-cmd.h" diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c index 7c20f60..cc19092 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c @@ -9,7 +9,6 @@ * warranty of any kind, whether express or implied. */ -#include "../include/mc-bus.h" #include #include #include @@ -17,6 +16,7 @@ #include #include #include +#include "../include/mc-bus.h" /* * Generate a unique ID identifying the interrupt (only used within the MSI diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c index 2586328..7a6ac64 100644 --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c @@ -9,7 +9,6 @@ * warranty of any kind, whether express or implied. */ -#include "../include/mc-bus.h" #include #include #include @@ -17,6 +16,7 @@ #include #include #include +#include "../include/mc-bus.h" static struct irq_chip its_
[PATCH 08/14] staging: fsl-mc: make fsl_mc_get_root_dprc public
fsl_mc_get_root_dprc is needed by other components (e.g. vfio) to find the root dprc Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 5 +++-- drivers/staging/fsl-mc/include/mc.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 08363f8..fda6a98 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -265,8 +265,8 @@ EXPORT_SYMBOL_GPL(fsl_mc_bus_exists); /** * fsl_mc_get_root_dprc - function to traverse to the root dprc */ -static void fsl_mc_get_root_dprc(struct device *dev, -struct device **root_dprc_dev) +void fsl_mc_get_root_dprc(struct device *dev, + struct device **root_dprc_dev) { if (WARN_ON(!dev)) { *root_dprc_dev = NULL; @@ -278,6 +278,7 @@ static void fsl_mc_get_root_dprc(struct device *dev, *root_dprc_dev = (*root_dprc_dev)->parent; } } +EXPORT_SYMBOL_GPL(fsl_mc_get_root_dprc); static int get_dprc_attr(struct fsl_mc_io *mc_io, int container_id, struct dprc_attributes *attr) diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h index ab439fa..a71342d 100644 --- a/drivers/staging/fsl-mc/include/mc.h +++ b/drivers/staging/fsl-mc/include/mc.h @@ -191,6 +191,9 @@ void fsl_mc_driver_unregister(struct fsl_mc_driver *driver); bool fsl_mc_bus_exists(void); +void fsl_mc_get_root_dprc(struct device *dev, + struct device **root_dprc_dev); + int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, u16 mc_io_flags, struct fsl_mc_io **new_mc_io); -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/14] staging: fsl-mc: split mc-io definitions into a separate file
An mc-io is a software abstraction of a dpmcp object (an MC portal). Routines to create/initialize/reset this portal abstraction were split between the allocator and mc-sys.c (MC command interface). Move mc-io/portal related definitions into one source file. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/Makefile | 1 + drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 140 drivers/staging/fsl-mc/bus/fsl-mc-private.h | 8 + drivers/staging/fsl-mc/bus/mc-io.c| 318 ++ drivers/staging/fsl-mc/bus/mc-sys.c | 147 drivers/staging/fsl-mc/include/mc-sys.h | 13 -- 6 files changed, 327 insertions(+), 300 deletions(-) create mode 100644 drivers/staging/fsl-mc/bus/mc-io.c diff --git a/drivers/staging/fsl-mc/bus/Makefile b/drivers/staging/fsl-mc/bus/Makefile index 5fb4c14..38716fd 100644 --- a/drivers/staging/fsl-mc/bus/Makefile +++ b/drivers/staging/fsl-mc/bus/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_FSL_MC_BUS) += mc-bus-driver.o mc-bus-driver-objs := fsl-mc-bus.o \ mc-sys.o \ + mc-io.o \ dprc.o \ dpmng.o \ dprc-driver.o \ diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index e865375..edcb5cc 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -13,8 +13,6 @@ #include #include "../include/dpbp-cmd.h" #include "../include/dpcon-cmd.h" -#include "dpmcp-cmd.h" -#include "dpmcp.h" #include "fsl-mc-private.h" #include @@ -258,144 +256,6 @@ out_unlock: EXPORT_SYMBOL_GPL(fsl_mc_resource_free); /** - * fsl_mc_portal_allocate - Allocates an MC portal - * - * @mc_dev: MC device for which the MC portal is to be allocated - * @mc_io_flags: Flags for the fsl_mc_io object that wraps the allocated - * MC portal. - * @new_mc_io: Pointer to area where the pointer to the fsl_mc_io object - * that wraps the allocated MC portal is to be returned - * - * This function allocates an MC portal from the device's parent DPRC, - * from the corresponding MC bus' pool of MC portals and wraps - * it in a new fsl_mc_io object. If 'mc_dev' is a DPRC itself, the - * portal is allocated from its own MC bus. - */ -int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, - u16 mc_io_flags, - struct fsl_mc_io **new_mc_io) -{ - struct fsl_mc_device *mc_bus_dev; - struct fsl_mc_bus *mc_bus; - phys_addr_t mc_portal_phys_addr; - size_t mc_portal_size; - struct fsl_mc_device *dpmcp_dev; - int error = -EINVAL; - struct fsl_mc_resource *resource = NULL; - struct fsl_mc_io *mc_io = NULL; - - if (mc_dev->flags & FSL_MC_IS_DPRC) { - mc_bus_dev = mc_dev; - } else { - if (WARN_ON(!dev_is_fsl_mc(mc_dev->dev.parent))) - return error; - - mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent); - } - - mc_bus = to_fsl_mc_bus(mc_bus_dev); - *new_mc_io = NULL; - error = fsl_mc_resource_allocate(mc_bus, FSL_MC_POOL_DPMCP, &resource); - if (error < 0) - return error; - - error = -EINVAL; - dpmcp_dev = resource->data; - if (WARN_ON(!dpmcp_dev)) - goto error_cleanup_resource; - - if (dpmcp_dev->obj_desc.ver_major < DPMCP_MIN_VER_MAJOR || - (dpmcp_dev->obj_desc.ver_major == DPMCP_MIN_VER_MAJOR && -dpmcp_dev->obj_desc.ver_minor < DPMCP_MIN_VER_MINOR)) { - dev_err(&dpmcp_dev->dev, - "ERROR: Version %d.%d of DPMCP not supported.\n", - dpmcp_dev->obj_desc.ver_major, - dpmcp_dev->obj_desc.ver_minor); - error = -ENOTSUPP; - goto error_cleanup_resource; - } - - if (WARN_ON(dpmcp_dev->obj_desc.region_count == 0)) - goto error_cleanup_resource; - - mc_portal_phys_addr = dpmcp_dev->regions[0].start; - mc_portal_size = dpmcp_dev->regions[0].end - -dpmcp_dev->regions[0].start + 1; - - if (WARN_ON(mc_portal_size != mc_bus_dev->mc_io->portal_size)) - goto error_cleanup_resource; - - error = fsl_create_mc_io(&mc_bus_dev->dev, -mc_portal_phys_addr, -mc_portal_size, dpmcp_dev, -mc_io_flags, &mc_io); - if (error < 0) - goto error_cleanup_resource; - - *new_mc_io = mc_io; - return 0; - -error_cleanup_resource: - fsl_mc_resource_free(resource); - return error; -} -EXPORT_SYMBOL_GPL(fsl_mc_portal_allocate); - -/** - * fsl_mc_portal_free - Returns an MC portal to the pool of free MC portals - * of a given MC bus
[PATCH 06/14] staging: fsl-mc: move dprc-driver private definitions out of mc-bus.h
Move definitions that are private to dprc-driver.c out of the public mc-bus.h header. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dprc-driver.c | 6 ++ drivers/staging/fsl-mc/include/mc-bus.h | 6 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index 576244b..5e34720 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -18,6 +18,12 @@ #include "dprc-cmd.h" #include "fsl-mc-private.h" +#define FSL_MC_DPRC_DRIVER_NAME"fsl_mc_dprc" + +#define FSL_MC_DEVICE_MATCH(_mc_dev, _obj_desc) \ + (strcmp((_mc_dev)->obj_desc.type, (_obj_desc)->type) == 0 && \ +(_mc_dev)->obj_desc.id == (_obj_desc)->id) + struct dprc_child_objs { int child_count; struct dprc_obj_desc *child_array; diff --git a/drivers/staging/fsl-mc/include/mc-bus.h b/drivers/staging/fsl-mc/include/mc-bus.h index 8a32e55..3f80506 100644 --- a/drivers/staging/fsl-mc/include/mc-bus.h +++ b/drivers/staging/fsl-mc/include/mc-bus.h @@ -15,12 +15,6 @@ #include #include -#define FSL_MC_DPRC_DRIVER_NAME"fsl_mc_dprc" - -#define FSL_MC_DEVICE_MATCH(_mc_dev, _obj_desc) \ - (strcmp((_mc_dev)->obj_desc.type, (_obj_desc)->type) == 0 && \ -(_mc_dev)->obj_desc.id == (_obj_desc)->id) - struct irq_domain; struct msi_domain_info; -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/14] staging: fsl-mc: remove unneeded includes
Over time we've accumulated some includes that are no longer needed. Remove them. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/fsl-mc-msi.c| 2 -- drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 2 -- drivers/staging/fsl-mc/include/mc-bus.h| 1 - drivers/staging/fsl-mc/include/mc.h| 1 - 4 files changed, 6 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c index 6e39a98..7c20f60 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c @@ -17,8 +17,6 @@ #include #include #include -#include "../include/mc-sys.h" -#include "dprc-cmd.h" /* * Generate a unique ID identifying the interrupt (only used within the MSI diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c index aac4379..2586328 100644 --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c +++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c @@ -17,8 +17,6 @@ #include #include #include -#include "../include/mc-sys.h" -#include "dprc-cmd.h" static struct irq_chip its_msi_irq_chip = { .name = "fsl-mc-bus-msi", diff --git a/drivers/staging/fsl-mc/include/mc-bus.h b/drivers/staging/fsl-mc/include/mc-bus.h index 2cdb538..170684a 100644 --- a/drivers/staging/fsl-mc/include/mc-bus.h +++ b/drivers/staging/fsl-mc/include/mc-bus.h @@ -13,7 +13,6 @@ #include "../include/mc.h" #include -#include struct irq_domain; struct msi_domain_info; diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h index 789e6a8..f6e720e 100644 --- a/drivers/staging/fsl-mc/include/mc.h +++ b/drivers/staging/fsl-mc/include/mc.h @@ -13,7 +13,6 @@ #include #include -#include #include #include "../include/dprc.h" -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/14] staging: fsl-mc: explicitly include files where they are needed
Instead of relying on mc-sys.h to include misc system headers, have the source files that need them explicitly do it themselves. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 1 + drivers/staging/fsl-mc/bus/mc-io.c | 2 ++ drivers/staging/fsl-mc/bus/mc-sys.c | 2 ++ drivers/staging/fsl-mc/include/mc-sys.h | 2 -- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index fda6a98..9023df3 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "../include/dpmng.h" #include "../include/mc-sys.h" #include "fsl-mc-private.h" diff --git a/drivers/staging/fsl-mc/bus/mc-io.c b/drivers/staging/fsl-mc/bus/mc-io.c index c5edfc8..fd032c1 100644 --- a/drivers/staging/fsl-mc/bus/mc-io.c +++ b/drivers/staging/fsl-mc/bus/mc-io.c @@ -32,6 +32,8 @@ #include "../include/mc-bus.h" #include "../include/mc-sys.h" +#include + #include "fsl-mc-private.h" #include "dpmcp.h" #include "dpmcp-cmd.h" diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c b/drivers/staging/fsl-mc/bus/mc-sys.c index 23e82e4a..461abaa 100644 --- a/drivers/staging/fsl-mc/bus/mc-sys.c +++ b/drivers/staging/fsl-mc/bus/mc-sys.c @@ -39,6 +39,8 @@ #include #include #include +#include + #include "dpmcp.h" /** diff --git a/drivers/staging/fsl-mc/include/mc-sys.h b/drivers/staging/fsl-mc/include/mc-sys.h index 7a73cf6..89ad0cf 100644 --- a/drivers/staging/fsl-mc/include/mc-sys.h +++ b/drivers/staging/fsl-mc/include/mc-sys.h @@ -37,8 +37,6 @@ #include #include -#include -#include #include #include -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: android: ion: Remove ret variable in ion_handle_put_nolock
It is not necessary to save the return value of kref_put since it is directly returned. Signed-off-by: Johanna Abrahamsson --- drivers/staging/android/ion/ion.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index e97d667..2035782 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -378,11 +378,7 @@ static void ion_handle_get(struct ion_handle *handle) static int ion_handle_put_nolock(struct ion_handle *handle) { - int ret; - - ret = kref_put(&handle->ref, ion_handle_destroy); - - return ret; + return kref_put(&handle->ref, ion_handle_destroy); } static int ion_handle_put(struct ion_handle *handle) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: android: ion: Remove unnused function ion_handle_buffer
Remove the function ion_handle_buffer since it is not used anywhere. Signed-off-by: Johanna Abrahamsson --- drivers/staging/android/ion/ion.c | 5 - drivers/staging/android/ion/ion_priv.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 88dd17e..e97d667 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -371,11 +371,6 @@ static void ion_handle_destroy(struct kref *kref) kfree(handle); } -struct ion_buffer *ion_handle_buffer(struct ion_handle *handle) -{ - return handle->buffer; -} - static void ion_handle_get(struct ion_handle *handle) { kref_get(&handle->ref); diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h index 5eed5e2..fcbc231 100644 --- a/drivers/staging/android/ion/ion_priv.h +++ b/drivers/staging/android/ion/ion_priv.h @@ -29,8 +29,6 @@ #include "ion.h" -struct ion_buffer *ion_handle_buffer(struct ion_handle *handle); - /** * struct ion_buffer - metadata for a particular buffer * @ref: reference count -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/14] staging: fsl-mc: improve naming of source files
The mc- prefix on the source files names of some internal components of the fsl-mc bus driver makes things less clear that they could be. The string "mc" generally refers to hardware-- the physical DPAA 'management complex'. Names like "mc-allocator.c" have nothing to with the "MC" hardware per se. Improve clarity by using the prefix string "fsl-mc" instead which is what we are calling this bus. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/Makefile | 6 +++--- drivers/staging/fsl-mc/bus/{mc-allocator.c => fsl-mc-allocator.c} | 0 drivers/staging/fsl-mc/bus/{mc-bus.c => fsl-mc-bus.c} | 0 drivers/staging/fsl-mc/bus/{mc-msi.c => fsl-mc-msi.c} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename drivers/staging/fsl-mc/bus/{mc-allocator.c => fsl-mc-allocator.c} (100%) rename drivers/staging/fsl-mc/bus/{mc-bus.c => fsl-mc-bus.c} (100%) rename drivers/staging/fsl-mc/bus/{mc-msi.c => fsl-mc-msi.c} (100%) diff --git a/drivers/staging/fsl-mc/bus/Makefile b/drivers/staging/fsl-mc/bus/Makefile index e731517..5fb4c14 100644 --- a/drivers/staging/fsl-mc/bus/Makefile +++ b/drivers/staging/fsl-mc/bus/Makefile @@ -7,13 +7,13 @@ # obj-$(CONFIG_FSL_MC_BUS) += mc-bus-driver.o -mc-bus-driver-objs := mc-bus.o \ +mc-bus-driver-objs := fsl-mc-bus.o \ mc-sys.o \ dprc.o \ dpmng.o \ dprc-driver.o \ - mc-allocator.o \ - mc-msi.o \ + fsl-mc-allocator.o \ + fsl-mc-msi.o \ irq-gic-v3-its-fsl-mc-msi.o \ dpmcp.o \ dpbp.o diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c similarity index 100% rename from drivers/staging/fsl-mc/bus/mc-allocator.c rename to drivers/staging/fsl-mc/bus/fsl-mc-allocator.c diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c similarity index 100% rename from drivers/staging/fsl-mc/bus/mc-bus.c rename to drivers/staging/fsl-mc/bus/fsl-mc-bus.c diff --git a/drivers/staging/fsl-mc/bus/mc-msi.c b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c similarity index 100% rename from drivers/staging/fsl-mc/bus/mc-msi.c rename to drivers/staging/fsl-mc/bus/fsl-mc-msi.c -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/14] staging: fsl-mc: move allocator private definitions out of mc-bus.h
move definitions private to the allocator out of mc-bus.h and into allocator.c Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 5 + drivers/staging/fsl-mc/include/mc-bus.h | 5 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c index 3ebaecb..6550564 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c @@ -17,6 +17,11 @@ #include "dpmcp.h" #include +#define FSL_MC_IS_ALLOCATABLE(_obj_type) \ + (strcmp(_obj_type, "dpbp") == 0 || \ +strcmp(_obj_type, "dpmcp") == 0 || \ +strcmp(_obj_type, "dpcon") == 0) + /** * fsl_mc_resource_pool_add_device - add allocatable device to a resource * pool of a given MC bus diff --git a/drivers/staging/fsl-mc/include/mc-bus.h b/drivers/staging/fsl-mc/include/mc-bus.h index 7f847e6..f192aa8 100644 --- a/drivers/staging/fsl-mc/include/mc-bus.h +++ b/drivers/staging/fsl-mc/include/mc-bus.h @@ -21,11 +21,6 @@ (strcmp((_mc_dev)->obj_desc.type, (_obj_desc)->type) == 0 && \ (_mc_dev)->obj_desc.id == (_obj_desc)->id) -#define FSL_MC_IS_ALLOCATABLE(_obj_type) \ - (strcmp(_obj_type, "dpbp") == 0 || \ -strcmp(_obj_type, "dpmcp") == 0 || \ -strcmp(_obj_type, "dpcon") == 0) - struct irq_domain; struct msi_domain_info; -- 1.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: android: ion: Remove unnused function ion_handle_buffer
On 08/23/2016 03:42 PM, Johanna Abrahamsson wrote: Remove the function ion_handle_buffer since it is not used anywhere. Acked-by: Laura Abbott Signed-off-by: Johanna Abrahamsson --- drivers/staging/android/ion/ion.c | 5 - drivers/staging/android/ion/ion_priv.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 88dd17e..e97d667 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -371,11 +371,6 @@ static void ion_handle_destroy(struct kref *kref) kfree(handle); } -struct ion_buffer *ion_handle_buffer(struct ion_handle *handle) -{ - return handle->buffer; -} - static void ion_handle_get(struct ion_handle *handle) { kref_get(&handle->ref); diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h index 5eed5e2..fcbc231 100644 --- a/drivers/staging/android/ion/ion_priv.h +++ b/drivers/staging/android/ion/ion_priv.h @@ -29,8 +29,6 @@ #include "ion.h" -struct ion_buffer *ion_handle_buffer(struct ion_handle *handle); - /** * struct ion_buffer - metadata for a particular buffer * @ref: reference count ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: android: ion: Remove ret variable in ion_handle_put_nolock
On 08/23/2016 03:41 PM, Johanna Abrahamsson wrote: It is not necessary to save the return value of kref_put since it is directly returned. Acked-by: Laura Abbott Signed-off-by: Johanna Abrahamsson --- drivers/staging/android/ion/ion.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index e97d667..2035782 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -378,11 +378,7 @@ static void ion_handle_get(struct ion_handle *handle) static int ion_handle_put_nolock(struct ion_handle *handle) { - int ret; - - ret = kref_put(&handle->ref, ion_handle_destroy); - - return ret; + return kref_put(&handle->ref, ion_handle_destroy); } static int ion_handle_put(struct ion_handle *handle) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/2] staging: android: ion: cleanup of the ion_free_nolock function
On 08/23/2016 03:01 PM, Johanna Abrahamsson wrote: This is a small cleanup of the ion_free_nolock() method. They are in a patchset because they depend lightly on each other, as in that patch 2 won't apply due to changes in the context. Since this is my first patchset please let me know if I am doing it wrong. v2: Kept the BUG_ON in ion_free as per request from Laura Abbott Johanna Abrahamsson (2): staging: android: ion: Do not BUG on handle client mismatch staging: android: ion: Remove valid_handle variable in ion_free_nolock drivers/staging/android/ion/ion.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) Acked-by: Laura Abbott for both ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/8] staging/lustre/mdc: fix panic at mdc_free_open()
Actually, please do not apply this one, there was a testing error that made me not noticing there's a bug in this one that insta-crashes everything on access. I tested the rest nd the rest are good without this one too. Sorry about this. On Aug 23, 2016, at 5:11 PM, Oleg Drokin wrote: > From: Alexander Boyko > > Assertion was happened for open request when rq_replay is set > to 1. >ASSERTION(mod->mod_open_req->rq_replay == 0) > But this situation is not fatal for client, and could happened > when mdc_close() failed. > The fix allow to free such requests. If mdc_close fail, MDS doesn`t > receive close request from client. And in a worst case client would > be evicted. > > The test recreates issue when mdc_close failed and > client asserts: > ASSERTION( mod->mod_open_req->rq_replay == 0 ) failed > > Signed-off-by: Alexander Boyko > Seagate-bug-id: MRP-3156 > Reviewed-on: http://review.whamcloud.com/17495 > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5282 > Reviewed-by: Alex Zhuravlev > Reviewed-by: Andreas Dilger > Signed-off-by: Oleg Drokin > --- > .../staging/lustre/lustre/include/obd_support.h| 1 + > drivers/staging/lustre/lustre/mdc/mdc_request.c| 50 ++ > 2 files changed, 32 insertions(+), 19 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/include/obd_support.h > b/drivers/staging/lustre/lustre/include/obd_support.h > index 0c29a33..4a9fe88 100644 > --- a/drivers/staging/lustre/lustre/include/obd_support.h > +++ b/drivers/staging/lustre/lustre/include/obd_support.h > @@ -402,6 +402,7 @@ extern char obd_jobid_var[]; > #define OBD_FAIL_MDC_GETATTR_ENQUEUE 0x803 > #define OBD_FAIL_MDC_RPCS_SEM 0x804 > #define OBD_FAIL_MDC_LIGHTWEIGHT 0x805 > +#define OBD_FAIL_MDC_CLOSE0x806 > > #define OBD_FAIL_MGS 0x900 > #define OBD_FAIL_MGS_ALL_REQUEST_NET 0x901 > diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c > b/drivers/staging/lustre/lustre/mdc/mdc_request.c > index 91c0b45..8369afd 100644 > --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c > +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c > @@ -677,9 +677,15 @@ static void mdc_free_open(struct md_open_data *mod) > imp_connect_disp_stripe(mod->mod_open_req->rq_import)) > committed = 1; > > - LASSERT(mod->mod_open_req->rq_replay == 0); > - > - DEBUG_REQ(D_RPCTRACE, mod->mod_open_req, "free open request\n"); > + /* > + * No reason to asssert here if the open request has > + * rq_replay == 1. It means that mdc_close failed, and > + * close request wasn`t sent. It is not fatal to client. > + * The worst thing is eviction if the client gets open lock > + */ > + DEBUG_REQ(D_RPCTRACE, mod->mod_open_req, > + "free open request rq_replay = %d\n", > +mod->mod_open_req->rq_replay); > > ptlrpc_request_committed(mod->mod_open_req, committed); > if (mod->mod_close_req) > @@ -749,22 +755,10 @@ static int mdc_close(struct obd_export *exp, struct > md_op_data *op_data, > } > > *request = NULL; > - req = ptlrpc_request_alloc(class_exp2cliimp(exp), req_fmt); > - if (!req) > - return -ENOMEM; > - > - rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, MDS_CLOSE); > - if (rc) { > - ptlrpc_request_free(req); > - return rc; > - } > - > - /* To avoid a livelock (bug 7034), we need to send CLOSE RPCs to a > - * portal whose threads are not taking any DLM locks and are therefore > - * always progressing > - */ > - req->rq_request_portal = MDS_READPAGE_PORTAL; > - ptlrpc_at_set_req_timeout(req); > + if (OBD_FAIL_CHECK(OBD_FAIL_MDC_CLOSE)) > + req = NULL; > + else > + req = ptlrpc_request_alloc(class_exp2cliimp(exp), req_fmt); > > /* Ensure that this close's handle is fixed up during replay. */ > if (likely(mod)) { > @@ -785,6 +779,23 @@ static int mdc_close(struct obd_export *exp, struct > md_op_data *op_data, >CDEBUG(D_HA, > "couldn't find open req; expecting close error\n"); > } > + if (!req) { > + /* > + * TODO: repeat close after errors > + */ > + CWARN("%s: close of FID "DFID" failed, file reference will be > dropped when this client unmounts or is evicted\n", > + obd->obd_name, PFID(&op_data->op_fid1)); > + rc = -ENOMEM; > + goto out; > + } > + > + /* > + * To avoid a livelock (bug 7034), we need to send CLOSE RPCs to a > + * portal whose threads are not taking any DLM locks and are therefore > + * always progressing > + */ > + req->rq_request_portal = MDS_READPAGE_PORTAL; > + ptlrpc_at_set_req_timeout(req); > > mdc_close_pack(req, op_data); > > @@ -830,6 +841,7 @@ static int mdc_close(struct obd_export *exp, struct >